You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
QW2021/Reporting/Designer/cea397bf.edit-highlight-dia...

1 line
9.8 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{601:function(t,i,l){},611:function(t,i,l){"use strict";function m(){return'\n <div class="fr-highlight-dialog">\n <div class="fr-modal-body fr-highlight-dialog__body">\n <div class="fr-highlight-dialog__conditions">\n <h5>'+_.a.tr("Conditions")+'</h5>\n <div class="fr-highlight-dialog__conditions-body">\n <div class="js-conditions-list"></div>\n <div>\n <button class="fr-btn fr-btn-primary fr-btn-xs fr-highlight-dialog__btn js-highlight-add">'+_.a.tr("HighlightEditor Add")+'</button>\n <button class="fr-btn fr-btn-primary fr-btn-xs fr-highlight-dialog__btn js-highlight-delete">'+_.a.tr("HighlightEditor Delete")+'</button>\n <button class="fr-btn fr-btn-primary fr-btn-xs fr-highlight-dialog__btn js-highlight-edit">'+_.a.tr("HighlightEditor Edit")+'</button>\n </div>\n </div>\n </div>\n <div class="fr-highlight-dialog__menu">\n <h5>'+_.a.tr("Style")+'</h5>\n <div class="fr-highlight-dialog__style-body js-highlight-style">\n <div class="fr-highlight-dialog__style-item js-highlight-style-item" data-item="ApplyBorder">\n <input type="checkbox" class="js-highlight-dialog__enable-item"/>\n <button class="fr-btn fr-btn-primary fr-btn-xs fr-highlight-dialog__btn fr-highlight-dialog__style-item-control js-highlight-style-item-control">'+_.a.tr("Forms Border Border")+'</button>\n </div>\n <div class="fr-highlight-dialog__style-item js-highlight-style-item" data-item="ApplyFill">\n <input type="checkbox" class="js-highlight-dialog__enable-item"/>\n <label class="fr-highlight-dialog__style-item-control">\n <input type="color" class="js-highlight-style-item-control"/>\n <span>'+_.a.tr("HighlightEditor Fill")+'</span>\n </label>\n </div>\n <div class="fr-highlight-dialog__style-item js-highlight-style-item" data-item="ApplyTextFill">\n <input type="checkbox" class="js-highlight-dialog__enable-item"/>\n <label class="fr-highlight-dialog__style-item-control">\n <input type="color" class="js-highlight-style-item-control"/>\n <span>'+_.a.tr("HighlightEditor TextColor")+'</span>\n </label>\n </div>\n <div class="fr-highlight-dialog__style-item js-highlight-style-item" data-item="ApplyFont">\n <input type="checkbox" class="js-highlight-dialog__enable-item"/>\n <button class="fr-btn fr-btn-primary fr-btn-xs fr-highlight-dialog__btn fr-highlight-dialog__style-item-control js-highlight-style-item-control">'+_.a.tr("HighlightEditor Font")+'</button>\n </div>\n <div class="fr-highlight-dialog__style-item js-highlight-style-item" data-item="Visible">\n <label class="js-highlight-style-visible">\n <input type="checkbox" class="js-highlight-dialog__enable-item"/>\n <span class="fr-highlight-dialog__style-item-control">'+_.a.tr("HighlightEditor Visible")+'</span>\n </label>\n </div>\n <hr>\n <div class="fr-highlight-dialog__style-item fr-highlight-dialog__style-sample js-highlight-dialog__sample"></div>\n </div>\n </div>\n </div>\n <div class="fr-modal-footer content-right">\n <button type="button" class="fr-btn fr-btn-primary js-save-highlight">\n '+_.a.tr("Buttons Ok")+"\n </button>\n </div>\n </div>\n "}function e(u){return Object(o.a)().then(function(t){var i=new x.a("HighlightEditor"),l=b()(m()),e=l.find(".js-conditions-list"),r=l.find(".js-highlight-style"),d=l.find(".js-highlight-dialog__sample"),n="fr-condition-item-active",s=function(){return u.conditions.findEntity(l.find("."+n).data("condition-id"))},o=function(){return e.html(function(t){var l="";return t.eachEntity(function(t,i){return l+='<div class="fr-condition-item '+(0===i?"fr-condition-item-active":"")+'" data-condition-id="'+t._id+'">'+t.prop("Expression")+"</div>"}),l}(u.conditions))},a={ApplyBorder:!1,ApplyFill:!1,ApplyTextFill:!1,ApplyFont:!1,Visible:!1},h=function(){var t=s();t?(a.ApplyBorder=!!t.prop("ApplyBorder"),a.ApplyFill=!!t.prop("ApplyFill"),a.ApplyTextFill=!!t.prop("ApplyTextFill"),a.ApplyFont=!!t.prop("ApplyFont"),a.Visible=!!t.prop("Visible")):Object.keys(a).forEach(function(t){return a[t]=!1})},g=function(){var o=s();Object.keys(a).forEach(function(t){var i,l,e=r.find(".js-highlight-style-item[data-item="+t+"]"),n=e.find(".js-highlight-style-item-control");e.toggleClass("disabled",!a[t]),n.attr("disabled",!a[t]),e.find(".js-highlight-dialog__enable-item").prop("checked",a[t]),o&&(i=void 0,"ApplyFill"===t?i="Fill.Color":"ApplyTextFill"===t&&(i="TextFill.Color"),i&&(l=Object(k.a)(o.prop(i)))&&(Object(E.a)("color")?n.val(l):n.spectrum({color:l,preferredFormat:"hex",change:function(){o.prop(i,n.val()),y(),b()(this).trigger("change keyup")}})))})},c=function(){var t=b()(Object(A.a)("svg",{width:"100%",height:"100%"})),i=b()(Object(A.a)("g",{class:"js-highlight-sample-lines"}));i.append(b()(Object(A.a)("line"))),i.append(b()(Object(A.a)("line"))),i.append(b()(Object(A.a)("line"))),i.append(b()(Object(A.a)("line"))),t.append(Object(A.a)("rect",{width:"100%",height:"100%",fill:"#ffffff",class:"js-highlight-sample-rect"})),t.append(b()(Object(A.a)("text",{fill:"#000",x:"44%",y:"50%",class:"js-highlight-sample-text"})).append(_.a.tr("Misc Sample"))),t.append(i),d.html(t)},p=function(t){var i,l,e,n,o,r,s,a,h;t&&(i=d.find(".js-highlight-sample-lines").children(),l=v.a.get("dasharrays"),e={x1:0,x2:0,y1:0,y2:0},n={stroke:"","stroke-width":"","stroke-dasharray":""},o=t.prop("ApplyBorder"),r=t.prop("Border.Lines"),s=t.prop("Border.Color"),a=t.prop("Border.Width"),h=t.prop("Border.Style"),o&&(r.includes("All")||r.includes("Top"))?i.eq(0).attr({x1:.5,x2:"100%",y1:.5,y2:.5}).css({stroke:s,"stroke-width":a,"stroke-dasharray":l[h]}):i.eq(0).attr(e).css(n),o&&(r.includes("All")||r.includes("Right"))?i.eq(1).attr({x1:"100%",x2:"100%",y1:.5,y2:"100%"}).css({stroke:s,"stroke-width":a,"stroke-dasharray":l[h]}):i.eq(1).attr(e).css(n),o&&(r.includes("All")||r.includes("Bottom"))?i.eq(2).attr({x1:.5,x2:"100%",y1:"100%",y2:"100%"}).css({stroke:s,"stroke-width":a,"stroke-dasharray":l[h]}):i.eq(2).attr(e).css(n),o&&(r.includes("All")||r.includes("Left"))?i.eq(3).attr({x1:.5,x2:.5,y1:.5,y2:"100%"}).css({stroke:s,"stroke-width":a,"stroke-dasharray":l[h]}):i.eq(3).attr(e).css(n))},f=Object(w.a)(function(){var t=s(),i=d.find(".js-highlight-sample-rect"),l=d.find(".js-highlight-sample-text");t&&(p(t),t.prop("ApplyFill")&&t.prop("Fill.Color")?i.css("fill",t.prop("Fill.Color")):i.css("fill",""),t.prop("ApplyTextFill")&&t.prop("TextFill.Color")?l.css("fill",t.prop("TextFill.Color")):l.css("fill",""),t.prop("ApplyFont")?(l.css({"font-family":t.attr("Font.Name"),"font-size":t.attr("Font.Size")}),t.attr("Font.Underline")&&t.attr("Font.Strikeout")?l.css("text-decoration","underline line-through"):t.attr("Font.Underline")?l.css("text-decoration","underline"):t.attr("Font.Strikeout")?l.css("text-decoration","line-through"):l.css("text-decoration",""),t.attr("Font.Bold")?l.css("font-weight","600"):l.css("font-weight",""),t.attr("Font.Italic")?l.css("font-style","italic"):l.css("font-style","")):l.css({"font-family":"","font-size":"","text-decoration":"","font-weight":"","font-style":""}))},300),y=function(t){0<arguments.length&&void 0!==t&&!t||o(),h(),g(),f()};return i.on("click",".fr-condition-item:not(.{0})".format(n),function(t){var i=b()(t.currentTarget);i.parent().find(".{0}".format(n)).removeClass(n),i.addClass(n),y(!1)}).on("click",".js-highlight-add",function(){j.a.trigger("show-expression-editor",{entity:F.a.defaultValue,onSave:function(t,i,l){var e=F.a.create();e.prop("Expression",i),u.conditions.add(e),l.close(),y()}})}).on("click",".js-highlight-edit",function(){var e=s();j.a.trigger("show-expression-editor",{entity:e.prop("Expression"),onSave:function(t,i,l){e.prop("Expression",i),l.close(),y()}})}).on("click",".js-highlight-delete",function(){u.conditions.remove(s()),y()}).on("change",".js-highlight-dialog__enable-item",function(t){var i=s(),l=b()(event.target),e=l.parents(".js-highlight-style-item[data-item]:first").data("item");if(!e||!i)return l.prop("checked",!1),t.preventDefault(),!1;a[e]=!a[e],s().prop(e,a[e]),g(),f()}).on("click",".js-highlight-style-item-control",function(){var t=b()(event.target).parents("[data-item]:first").data("item");"ApplyBorder"===t?j.a.trigger("edit-border",s(),function(){return y(!1)}):"ApplyFont"===t&&j.a.trigger("edit-font",s(),function(){return y(!1)})}).on("input",'[data-item="ApplyFill"] .js-highlight-style-item-control',function(t){s().prop("Fill.Color",b()(t.target).val()),y(!1)}).on("input",'[data-item="ApplyTextFill"] .js-highlight-style-item-control',function(t){s().prop("TextFill.Color",b()(t.target).val()),y(!1)}).on("click",".js-save-highlight",function(){return i.trigger("ok",u)}),c(),y(),i.find(".fr-modal-content").html(l),t.append(i),window.DSG.head.put(t),i})}var n,b,v,_,j,o,x,F,k,A,w,E;l.r(i),l(601),n=l(0),b=l.n(n),v=l(4),_=l(2),j=l(1),o=l(173),x=l(244),F=l(247),k=l(69),A=l(3),w=l(93),E=l(178),l(245),l(246),l.d(i,"create",function(){return e})}}]);