@sankhyalabs/ezui 7.1.0-dev.1 → 7.1.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-combo-box-list_4.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +110 -38
- package/dist/cjs/ez-grid.cjs.entry.js +3 -3
- package/dist/cjs/ez-modal-container.cjs.entry.js +2 -11
- package/dist/cjs/ez-popup.cjs.entry.js +9 -6
- package/dist/cjs/ez-tree.cjs.entry.js +154 -7
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{purify-47a2f27b.js → purify-453a8028.js} +35 -12
- package/dist/cjs/{search-column-9aa090ec.js → search-column-8bfee733.js} +1 -1
- package/dist/collection/components/ez-dialog/ez-dialog.css +6 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +1 -1
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +3 -9
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +1 -10
- package/dist/collection/components/ez-popup/ez-popup.css +3 -2
- package/dist/collection/components/ez-popup/ez-popup.js +9 -6
- package/dist/collection/components/ez-tree/ez-tree.css +4 -0
- package/dist/collection/components/ez-tree/ez-tree.js +185 -6
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +4 -1
- package/dist/collection/components/ez-tree/types/Node.js +7 -0
- package/dist/collection/components/ez-tree/types/Tree.js +19 -0
- package/dist/collection/components/ez-tree/types/UpdateItemConfig.js +1 -0
- package/dist/collection/utils/form/DataBinder.js +1 -1
- package/dist/collection/utils/form/FormMetadata.js +109 -37
- package/dist/custom-elements/index.js +313 -77
- package/dist/esm/ez-combo-box-list_4.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +110 -38
- package/dist/esm/ez-grid.entry.js +3 -3
- package/dist/esm/ez-modal-container.entry.js +2 -11
- package/dist/esm/ez-popup.entry.js +9 -6
- package/dist/esm/ez-tree.entry.js +154 -7
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{purify-dc6814bf.js → purify-003c47e2.js} +35 -12
- package/dist/esm/{search-column-83562552.js → search-column-c00119ae.js} +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-294f54fe.entry.js +1 -0
- package/dist/ezui/p-4f0632b4.js +1 -0
- package/dist/ezui/{p-d66bf34e.entry.js → p-8c57ffa4.entry.js} +2 -2
- package/dist/ezui/p-ae5f64cd.entry.js +1 -0
- package/dist/ezui/p-bb409cba.js +3 -0
- package/dist/ezui/p-c82acfc6.entry.js +1 -0
- package/dist/ezui/{p-c943f7c4.entry.js → p-e03b2f19.entry.js} +1 -1
- package/dist/ezui/p-e77610ef.entry.js +1 -0
- package/dist/ezui/p-ff4bde07.entry.js +1 -0
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +0 -2
- package/dist/types/components/ez-popup/ez-popup.d.ts +1 -0
- package/dist/types/components/ez-tree/ez-tree.d.ts +20 -1
- package/dist/types/components/ez-tree/types/Node.d.ts +1 -0
- package/dist/types/components/ez-tree/types/Tree.d.ts +1 -0
- package/dist/types/components/ez-tree/types/UpdateItemConfig.d.ts +4 -0
- package/dist/types/components.d.ts +18 -1
- package/dist/types/utils/form/FormMetadata.d.ts +2 -1
- package/dist/types/utils/form/interfaces/IFormSheetMetadata.d.ts +3 -0
- package/dist/types/utils/form/interfaces/ITabConfig.d.ts +3 -0
- package/package.json +1 -1
- package/dist/ezui/p-02f6e3b0.entry.js +0 -1
- package/dist/ezui/p-191cfbc8.entry.js +0 -1
- package/dist/ezui/p-228a4d2f.js +0 -3
- package/dist/ezui/p-2df50161.entry.js +0 -1
- package/dist/ezui/p-4c4f0850.entry.js +0 -1
- package/dist/ezui/p-623161e2.js +0 -1
- package/dist/ezui/p-bd6146c5.entry.js +0 -1
package/dist/ezui/p-228a4d2f.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{c as t,a as e}from"./p-112455b1.js";var n=t((function(t){
|
|
2
|
-
/*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE */
|
|
3
|
-
t.exports=function(){const{entries:t,setPrototypeOf:e,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:i}=Object;let{freeze:r,seal:a,create:l}=Object,{apply:s,construct:c}="undefined"!=typeof Reflect&&Reflect;r||(r=function(t){return t}),a||(a=function(t){return t}),s||(s=function(t,e){for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return t.apply(e,o)}),c||(c=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return new t(...n)});const u=k(Array.prototype.forEach),f=k(Array.prototype.lastIndexOf),p=k(Array.prototype.pop),m=k(Array.prototype.push),d=k(Array.prototype.splice),h=k(String.prototype.toLowerCase),g=k(String.prototype.toString),y=k(String.prototype.match),b=k(String.prototype.replace),w=k(String.prototype.indexOf),x=k(String.prototype.trim),v=k(Object.prototype.hasOwnProperty),T=k(RegExp.prototype.test),S=(A=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return c(A,e)});var A;function k(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return s(t,e,o)}}function E(t,o){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;e&&e(t,null);let r=o.length;for(;r--;){let e=o[r];if("string"==typeof e){const t=i(e);t!==e&&(n(o)||(o[r]=t),e=t)}t[e]=!0}return t}function R(t){for(let e=0;e<t.length;e++)v(t,e)||(t[e]=null);return t}function _(e){const n=l(null);for(const[o,i]of t(e))v(e,o)&&(n[o]=Array.isArray(i)?R(i):i&&"object"==typeof i&&i.constructor===Object?_(i):i);return n}function z(t,e){for(;null!==t;){const n=i(t,e);if(n){if(n.get)return k(n.get);if("function"==typeof n.value)return k(n.value)}t=o(t)}return function(){return null}}const D=r(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),O=r(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","slot","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),L=r(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),M=r(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),I=r(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),F=r(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),P=r(["#text"]),N=r(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),C=r(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),j=r(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),U=r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),H=a(/\$\{[\w\W]*/gm),q=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),Y=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$=a(/^(?:\w+script|data):/i),G=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var J=Object.freeze({__proto__:null,ARIA_ATTR:Y,ATTR_WHITESPACE:G,CUSTOM_ELEMENT:V,DATA_ATTR:q,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:$,MUSTACHE_EXPR:B,TMPLIT_EXPR:H});const Q=1,Z=3,tt=7,et=8,nt=9,ot=function(){return"undefined"==typeof window?null:window},it=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";e&&e.hasAttribute(o)&&(n=e.getAttribute(o));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};var rt=function e(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ot();const o=t=>e(t);if(o.version="3.2.7",o.removed=[],!n||!n.document||n.document.nodeType!==nt||!n.Element)return o.isSupported=!1,o;let{document:i}=n;const a=i,s=a.currentScript,{DocumentFragment:c,HTMLTemplateElement:A,Node:k,Element:R,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:H,DOMParser:q,trustedTypes:Y}=n,$=R.prototype,G=z($,"cloneNode"),V=z($,"remove"),rt=z($,"nextSibling"),at=z($,"childNodes"),lt=z($,"parentNode");if("function"==typeof A){const t=i.createElement("template");t.content&&t.content.ownerDocument&&(i=t.content.ownerDocument)}let st,ct="";const{implementation:ut,createNodeIterator:ft,createDocumentFragment:pt,getElementsByTagName:mt}=i,{importNode:dt}=a;let ht={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof t&&"function"==typeof lt&&ut&&void 0!==ut.createHTMLDocument;const{MUSTACHE_EXPR:gt,ERB_EXPR:yt,TMPLIT_EXPR:bt,DATA_ATTR:wt,ARIA_ATTR:xt,IS_SCRIPT_OR_DATA:vt,ATTR_WHITESPACE:Tt,CUSTOM_ELEMENT:St}=J;let{IS_ALLOWED_URI:At}=J,kt=null;const Et=E({},[...D,...O,...L,...I,...P]);let Rt=null;const _t=E({},[...N,...C,...j,...U]);let zt=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Dt=null,Ot=null,Lt=!0,Mt=!0,It=!1,Ft=!0,Pt=!1,Nt=!0,Ct=!1,jt=!1,Ut=!1,Bt=!1,Wt=!1,Ht=!1,qt=!0,Yt=!1;const Xt="user-content-";let $t=!0,Gt=!1,Kt={},Vt=null;const Jt=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Qt=null;const Zt=E({},["audio","video","img","source","image","track"]);let te=null;const ee=E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ne="http://www.w3.org/1998/Math/MathML",oe="http://www.w3.org/2000/svg",ie="http://www.w3.org/1999/xhtml";let re=ie,ae=!1,le=null;const se=E({},[ne,oe,ie],g);let ce=E({},["mi","mo","mn","ms","mtext"]),ue=E({},["annotation-xml"]);const fe=E({},["title","style","font","a","script"]);let pe=null;const me=["application/xhtml+xml","text/html"],de="text/html";let he=null,ge=null;const ye=i.createElement("form"),be=function(t){return t instanceof RegExp||t instanceof Function},we=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ge||ge!==t){if(t&&"object"==typeof t||(t={}),t=_(t),pe=-1===me.indexOf(t.PARSER_MEDIA_TYPE)?de:t.PARSER_MEDIA_TYPE,he="application/xhtml+xml"===pe?g:h,kt=v(t,"ALLOWED_TAGS")?E({},t.ALLOWED_TAGS,he):Et,Rt=v(t,"ALLOWED_ATTR")?E({},t.ALLOWED_ATTR,he):_t,le=v(t,"ALLOWED_NAMESPACES")?E({},t.ALLOWED_NAMESPACES,g):se,te=v(t,"ADD_URI_SAFE_ATTR")?E(_(ee),t.ADD_URI_SAFE_ATTR,he):ee,Qt=v(t,"ADD_DATA_URI_TAGS")?E(_(Zt),t.ADD_DATA_URI_TAGS,he):Zt,Vt=v(t,"FORBID_CONTENTS")?E({},t.FORBID_CONTENTS,he):Jt,Dt=v(t,"FORBID_TAGS")?E({},t.FORBID_TAGS,he):_({}),Ot=v(t,"FORBID_ATTR")?E({},t.FORBID_ATTR,he):_({}),Kt=!!v(t,"USE_PROFILES")&&t.USE_PROFILES,Lt=!1!==t.ALLOW_ARIA_ATTR,Mt=!1!==t.ALLOW_DATA_ATTR,It=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Ft=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Pt=t.SAFE_FOR_TEMPLATES||!1,Nt=!1!==t.SAFE_FOR_XML,Ct=t.WHOLE_DOCUMENT||!1,Bt=t.RETURN_DOM||!1,Wt=t.RETURN_DOM_FRAGMENT||!1,Ht=t.RETURN_TRUSTED_TYPE||!1,Ut=t.FORCE_BODY||!1,qt=!1!==t.SANITIZE_DOM,Yt=t.SANITIZE_NAMED_PROPS||!1,$t=!1!==t.KEEP_CONTENT,Gt=t.IN_PLACE||!1,At=t.ALLOWED_URI_REGEXP||X,re=t.NAMESPACE||ie,ce=t.MATHML_TEXT_INTEGRATION_POINTS||ce,ue=t.HTML_INTEGRATION_POINTS||ue,zt=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&be(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(zt.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&be(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(zt.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(zt.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pt&&(Mt=!1),Wt&&(Bt=!0),Kt&&(kt=E({},P),Rt=[],!0===Kt.html&&(E(kt,D),E(Rt,N)),!0===Kt.svg&&(E(kt,O),E(Rt,C),E(Rt,U)),!0===Kt.svgFilters&&(E(kt,L),E(Rt,C),E(Rt,U)),!0===Kt.mathMl&&(E(kt,I),E(Rt,j),E(Rt,U))),t.ADD_TAGS&&(kt===Et&&(kt=_(kt)),E(kt,t.ADD_TAGS,he)),t.ADD_ATTR&&(Rt===_t&&(Rt=_(Rt)),E(Rt,t.ADD_ATTR,he)),t.ADD_URI_SAFE_ATTR&&E(te,t.ADD_URI_SAFE_ATTR,he),t.FORBID_CONTENTS&&(Vt===Jt&&(Vt=_(Vt)),E(Vt,t.FORBID_CONTENTS,he)),$t&&(kt["#text"]=!0),Ct&&E(kt,["html","head","body"]),kt.table&&(E(kt,["tbody"]),delete Dt.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');st=t.TRUSTED_TYPES_POLICY,ct=st.createHTML("")}else void 0===st&&(st=it(Y,s)),null!==st&&"string"==typeof ct&&(ct=st.createHTML(""));r&&r(t),ge=t}},xe=E({},[...O,...L,...M]),ve=E({},[...I,...F]),Te=function(t){let e=lt(t);e&&e.tagName||(e={namespaceURI:re,tagName:"template"});const n=h(t.tagName),o=h(e.tagName);return!!le[t.namespaceURI]&&(t.namespaceURI===oe?e.namespaceURI===ie?"svg"===n:e.namespaceURI===ne?"svg"===n&&("annotation-xml"===o||ce[o]):Boolean(xe[n]):t.namespaceURI===ne?e.namespaceURI===ie?"math"===n:e.namespaceURI===oe?"math"===n&&ue[o]:Boolean(ve[n]):t.namespaceURI===ie?!(e.namespaceURI===oe&&!ue[o])&&!(e.namespaceURI===ne&&!ce[o])&&!ve[n]&&(fe[n]||!xe[n]):!("application/xhtml+xml"!==pe||!le[t.namespaceURI]))},Se=function(t){m(o.removed,{element:t});try{lt(t).removeChild(t)}catch(e){V(t)}},Ae=function(t,e){try{m(o.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){m(o.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(Bt||Wt)try{Se(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},ke=function(t){let e=null,n=null;if(Ut)t="<remove></remove>"+t;else{const e=y(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===pe&&re===ie&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const o=st?st.createHTML(t):t;if(re===ie)try{e=(new q).parseFromString(o,pe)}catch(t){}if(!e||!e.documentElement){e=ut.createDocument(re,"template",null);try{e.documentElement.innerHTML=ae?ct:o}catch(t){}}const r=e.body||e.documentElement;return t&&n&&r.insertBefore(i.createTextNode(n),r.childNodes[0]||null),re===ie?mt.call(e,Ct?"html":"body")[0]:Ct?e.documentElement:r},Ee=function(t){return ft.call(t.ownerDocument||t,t,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},Re=function(t){return t instanceof H&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof W)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)},_e=function(t){return"function"==typeof k&&t instanceof k};function ze(t,e,n){u(t,(t=>{t.call(o,e,n,ge)}))}const De=function(t){let e=null;if(ze(ht.beforeSanitizeElements,t,null),Re(t))return Se(t),!0;const n=he(t.nodeName);if(ze(ht.uponSanitizeElement,t,{tagName:n,allowedTags:kt}),Nt&&t.hasChildNodes()&&!_e(t.firstElementChild)&&T(/<[/\w!]/g,t.innerHTML)&&T(/<[/\w!]/g,t.textContent))return Se(t),!0;if(t.nodeType===tt)return Se(t),!0;if(Nt&&t.nodeType===et&&T(/<[/\w]/g,t.data))return Se(t),!0;if(!kt[n]||Dt[n]){if(!Dt[n]&&Le(n)){if(zt.tagNameCheck instanceof RegExp&&T(zt.tagNameCheck,n))return!1;if(zt.tagNameCheck instanceof Function&&zt.tagNameCheck(n))return!1}if($t&&!Vt[n]){const e=lt(t)||t.parentNode,n=at(t)||t.childNodes;if(n&&e)for(let o=n.length-1;o>=0;--o){const i=G(n[o],!0);i.__removalCount=(t.__removalCount||0)+1,e.insertBefore(i,rt(t))}}return Se(t),!0}return t instanceof R&&!Te(t)?(Se(t),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!T(/<\/no(script|embed|frames)/i,t.innerHTML)?(Pt&&t.nodeType===Z&&(e=t.textContent,u([gt,yt,bt],(t=>{e=b(e,t," ")})),t.textContent!==e&&(m(o.removed,{element:t.cloneNode()}),t.textContent=e)),ze(ht.afterSanitizeElements,t,null),!1):(Se(t),!0)},Oe=function(t,e,n){if(qt&&("id"===e||"name"===e)&&(n in i||n in ye))return!1;if(Mt&&!Ot[e]&&T(wt,e));else if(Lt&&T(xt,e));else if(!Rt[e]||Ot[e]){if(!(Le(t)&&(zt.tagNameCheck instanceof RegExp&&T(zt.tagNameCheck,t)||zt.tagNameCheck instanceof Function&&zt.tagNameCheck(t))&&(zt.attributeNameCheck instanceof RegExp&&T(zt.attributeNameCheck,e)||zt.attributeNameCheck instanceof Function&&zt.attributeNameCheck(e,t))||"is"===e&&zt.allowCustomizedBuiltInElements&&(zt.tagNameCheck instanceof RegExp&&T(zt.tagNameCheck,n)||zt.tagNameCheck instanceof Function&&zt.tagNameCheck(n))))return!1}else if(te[e]);else if(T(At,b(n,Tt,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==w(n,"data:")||!Qt[t])if(It&&!T(vt,b(n,Tt,"")));else if(n)return!1;return!0},Le=function(t){return"annotation-xml"!==t&&y(t,St)},Me=function(t){ze(ht.beforeSanitizeAttributes,t,null);const{attributes:e}=t;if(!e||Re(t))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Rt,forceKeepAttr:void 0};let i=e.length;for(;i--;){const r=e[i],{name:a,namespaceURI:l,value:s}=r,c=he(a),f=s;let m="value"===a?f:x(f);if(n.attrName=c,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,ze(ht.uponSanitizeAttribute,t,n),m=n.attrValue,!Yt||"id"!==c&&"name"!==c||(Ae(a,t),m=Xt+m),Nt&&T(/((--!?|])>)|<\/(style|title|textarea)/i,m)){Ae(a,t);continue}if("attributename"===c&&y(m,"href")){Ae(a,t);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){Ae(a,t);continue}if(!Ft&&T(/\/>/i,m)){Ae(a,t);continue}Pt&&u([gt,yt,bt],(t=>{m=b(m,t," ")}));const d=he(t.nodeName);if(Oe(d,c,m)){if(st&&"object"==typeof Y&&"function"==typeof Y.getAttributeType)if(l);else switch(Y.getAttributeType(d,c)){case"TrustedHTML":m=st.createHTML(m);break;case"TrustedScriptURL":m=st.createScriptURL(m)}if(m!==f)try{l?t.setAttributeNS(l,a,m):t.setAttribute(a,m),Re(t)?Se(t):p(o.removed)}catch(e){Ae(a,t)}}else Ae(a,t)}ze(ht.afterSanitizeAttributes,t,null)},Ie=function t(e){let n=null;const o=Ee(e);for(ze(ht.beforeSanitizeShadowDOM,e,null);n=o.nextNode();)ze(ht.uponSanitizeShadowNode,n,null),De(n),Me(n),n.content instanceof c&&t(n.content);ze(ht.afterSanitizeShadowDOM,e,null)};return o.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,i=null,r=null,l=null;if(ae=!t,ae&&(t="\x3c!--\x3e"),"string"!=typeof t&&!_e(t)){if("function"!=typeof t.toString)throw S("toString is not a function");if("string"!=typeof(t=t.toString()))throw S("dirty is not a string, aborting")}if(!o.isSupported)return t;if(jt||we(e),o.removed=[],"string"==typeof t&&(Gt=!1),Gt){if(t.nodeName){const e=he(t.nodeName);if(!kt[e]||Dt[e])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof k)n=ke("\x3c!----\x3e"),i=n.ownerDocument.importNode(t,!0),i.nodeType===Q&&"BODY"===i.nodeName||"HTML"===i.nodeName?n=i:n.appendChild(i);else{if(!Bt&&!Pt&&!Ct&&-1===t.indexOf("<"))return st&&Ht?st.createHTML(t):t;if(n=ke(t),!n)return Bt?null:Ht?ct:""}n&&Ut&&Se(n.firstChild);const s=Ee(Gt?t:n);for(;r=s.nextNode();)De(r),Me(r),r.content instanceof c&&Ie(r.content);if(Gt)return t;if(Bt){if(Wt)for(l=pt.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(Rt.shadowroot||Rt.shadowrootmode)&&(l=dt.call(a,l,!0)),l}let f=Ct?n.outerHTML:n.innerHTML;return Ct&&kt["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&T(K,n.ownerDocument.doctype.name)&&(f="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+f),Pt&&u([gt,yt,bt],(t=>{f=b(f,t," ")})),st&&Ht?st.createHTML(f):f},o.setConfig=function(){we(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),jt=!0},o.clearConfig=function(){ge=null,jt=!1},o.isValidAttribute=function(t,e,n){ge||we({});const o=he(t),i=he(e);return Oe(o,i,n)},o.addHook=function(t,e){"function"==typeof e&&m(ht[t],e)},o.removeHook=function(t,e){if(void 0!==e){const n=f(ht[t],e);return-1===n?void 0:d(ht[t],n,1)[0]}return p(ht[t])},o.removeHooks=function(t){ht[t]=[]},o.removeAllHooks=function(){ht={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return rt}()}));export{n as p}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as o,H as e,g as l}from"./p-23a36bb6.js";import{KeyboardManager as s,FloatingManager as n}from"@sankhyalabs/core";import{i as a}from"./p-641ee538.js";const d=class{constructor(o){t(this,o),this.ezClosePopup=i(this,"ezClosePopup",7),this.ezPopupAction=i(this,"ezPopupAction",7),this.size="medium",this.opened=!1,this.useHeader=!0,this.heightMode="full",this.ezTitle=void 0,this.enabledScroll=!1,this.autoClose=!0,this.footerButtons=[]}observeConfig(){this.manageOverflow()}async componentWillLoad(){this.i18n=await a()}componentDidLoad(){this.popUpFocus(),this._keyboardManager=new s({propagate:!1,element:this._element,enableShadowDom:!0}).bind("Enter",this.ezPopupAction.emit.bind("OK")).bind("Escape",(()=>this.closePopup())).bind("Esc",(()=>this.closePopup()))}disconnectedCallback(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}closePopup(){this.opened=!1,this.manageOverflow(),this.ezClosePopup.emit()}manageOverflow(){window.document.body.style.overflow=this.opened?"hidden":""}manageOverlay(){this.opened?this._overlayId=n.subscribeOverlayControl(this._popupRef):n.unsubscribeOverlayControl(this._popupRef||this._overlayId)}popUpFocus(){this.opened&&this._popupRef&&this._popupRef.focus()}getGridSize(){const t={"x-small":"col--sd-3 ez-popup__size-limit--x-small",small:"col--sd-5",medium:"col--sd-6",large:"col--sd-9","x-large":"col--sd-11",default:"ez-popup__size-limit--x-small",auto:""};return this.size&&t.hasOwnProperty(this.size)&&t[this.size]||t.medium}getDialogClass(){let t="popup__container";return"auto"===this.heightMode&&(t+=" popup__container--auto"),this.enabledScroll&&(t+=" popup__overflow-y--auto"),t+=` ${this.getGridSize()}`,t}componentDidRender(){this.manageOverlay(),this.popUpFocus()}handleAutoClose(t){if(!this.opened||!this._popupRef||!this.autoClose)return;if(this._popupRef.contains(t.target))return;const i=this._popupRef.querySelector("slot");if(i&&i.assignedElements().length>0){const o=i.assignedElements();for(const i of o)if(i.contains(t.target))return}this._popupRef.shadowRoot&&this._popupRef.shadowRoot.contains(t.target)||this.closePopup()}handleDefaultPropsButtonsByIndex(t){switch(t){case 0:return{label:this.i18n?this.i18n("app.confirm"):"Confirmar",variant:"primary",size:"small",onClick:()=>{this.closePopup(),this.ezPopupAction.emit("OK")}};case 1:return{label:this.i18n?this.i18n("app.cancel"):"Cancelar",variant:"secondary",size:"small",onClick:()=>{this.closePopup()}};case 2:return{label:this.i18n?this.i18n("app.close"):"Fechar",variant:"tertiary",size:"small",onClick:()=>{this.closePopup()}}}}render(){return o(e,null,this.opened&&o("div",{class:"overlay",tabIndex:-1,onClick:this.handleAutoClose.bind(this)},o("dialog",{ref:t=>this._popupRef=t,class:this.getDialogClass()},this.useHeader&&o("header",{class:"popup__header"},!!this.ezTitle&&o("h1",{class:"popup__title"},this.ezTitle),o("ez-button",{class:this.ezTitle?"btn-close":"btn-close btn-close--solo",variant:"tertiary",mode:"icon",iconName:"close",size:"small",onClick:this.closePopup.bind(this)})),o("main",{class:"popup__expandable-content"},o("slot",null)),this.footerButtons.length>0&&o("footer",{class:"popup__footer"},this.footerButtons.slice(0,3).map(((t,i)=>o("ez-button",Object.assign({key:i},this.handleDefaultPropsButtonsByIndex(i),t))))))))}get _element(){return l(this)}static get watchers(){return{opened:["observeConfig"]}}};d.style=':host{display:flex;width:auto;--ez-popup-z-index:var(--elevation--24, 24);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--24, 24px);--ez-popup__title--font-family:var(--font--pattern, "Roboto");--ez-popup__title--font-size:var(--font-size--xxlarge, 22px);--ez-popup__title--color:var(--title--primary, #00281D);--ez-popup__title--font-weight:var(--font-weight--regular, 400)}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index, 24);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup__container{width:100%;max-height:90%;height:100%;display:flex;flex-direction:column;overflow:hidden;outline:none;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding);margin:0;border:none;position:unset;gap:var(--space--16, 16px)}.popup__container--auto{height:auto}.popup__overflow-y--auto{overflow-y:auto}.popup__content{box-sizing:border-box;height:100%;width:100%}.popup__expandable-content{box-sizing:border-box;width:100%;flex:1;font-family:var(--font--pattern, "Roboto");font-size:var(--font-size--default, 14px);color:var(--title--primary, #00281D);font-weight:var(--font-weight--regular, 400);line-height:var(--line-height--24, 24px)}.popup__header{width:100%;display:flex;align-items:center}.popup__title{display:flex;margin:0;width:100%;font-family:var(--ez-popup__title--font-family);font-size:var(--ez-popup__title--font-size);font-weight:var(--ez-popup__title--font-weight);color:var(--ez-popup__title--color);line-height:var(--line-height--32, 32px)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close--solo{width:100%}.popup__footer{display:flex;width:100%;flex-direction:row-reverse;gap:var(--space--8, 8px)}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}.ez-popup__size-limit--x-small{min-width:350px;max-width:560px}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}';export{d as ez_popup}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,f as n,H as s,g as r}from"./p-23a36bb6.js";import{DateUtils as o,ApplicationContext as l,Action as a,StringUtils as h,KeyboardManager as u,DataUnit as d,ElementIDUtils as c}from"@sankhyalabs/core";import{b as f,a as v,S as p,f as m,c as b,D as y}from"./p-623161e2.js";import{g as w,i as g}from"./p-641ee538.js";import{F as E}from"./p-30ffb9ed.js";import"./p-5a11cf56.js";import"./p-ab574d59.js";import"./p-b853763b.js";const O=/child\[([^\]]+)\]/,C=/\$\{.+\}/;class F{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}static getDetailName(t){const i=O.exec(t);return i?i[1]:void 0}getSheet(t){return this._sheets.get(t)}getAllSheets(){return this._sheets}addSheet(t){this._sheets.set(t.name,t)}addRequiredFields(t){this._requiredFields=this._requiredFields.concat(t)}getRequiredFields(){return this._requiredFields}addCleanOnCopyFields(t){this._cleanOnCopyFields=this._cleanOnCopyFields.concat(t)}getCleanOnCopyFields(){return this._cleanOnCopyFields}addDefaultValues(t){return this._defaultValues=Object.assign(Object.assign({},this._defaultValues),t)}getDefaultValues(){const t={};return Object.entries(this._defaultValues).forEach((([i,e])=>{if("string"==typeof e){const t=C.exec(e);t&&(e=this.getDefaultVar(t[0]))}t[i]=e})),t}getDefaultVar(t){return"${data}"===t?o.getToday():"${datahora}"===t?o.getToday(!0):this._defaultVars?this._defaultVars.get(t):void 0}setDefaultVars(t){this._defaultVars=t}}const _=(t,i)=>"__main"==t[0].label?-1:(t[0].order||1e4)-(i[0].order||1e4);function j(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var z="function"==typeof Symbol&&Symbol.observable||"@@observable",A=function(){return Math.random().toString(36).substring(7).split("").join(".")},S={INIT:"@@redux/INIT"+A(),REPLACE:"@@redux/REPLACE"+A(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+A()}};function x(t){if("object"!=typeof t||null===t)return!1;for(var i=t;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return Object.getPrototypeOf(t)===i}function N(t,i,e){var n;if("function"==typeof i&&"function"==typeof e||"function"==typeof e&&"function"==typeof arguments[3])throw new Error(j(0));if("function"==typeof i&&void 0===e&&(e=i,i=void 0),void 0!==e){if("function"!=typeof e)throw new Error(j(1));return e(N)(t,i)}if("function"!=typeof t)throw new Error(j(2));var s=t,r=i,o=[],l=o,a=!1;function h(){l===o&&(l=o.slice())}function u(){if(a)throw new Error(j(3));return r}function d(t){if("function"!=typeof t)throw new Error(j(4));if(a)throw new Error(j(5));var i=!0;return h(),l.push(t),function(){if(i){if(a)throw new Error(j(6));i=!1,h();var e=l.indexOf(t);l.splice(e,1),o=null}}}function c(t){if(!x(t))throw new Error(j(7));if(void 0===t.type)throw new Error(j(8));if(a)throw new Error(j(9));try{a=!0,r=s(r,t)}finally{a=!1}for(var i=o=l,e=0;e<i.length;e++)(0,i[e])();return t}function f(t){if("function"!=typeof t)throw new Error(j(10));s=t,c({type:S.REPLACE})}function v(){var t,i=d;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(j(11));function e(){t.next&&t.next(u())}return e(),{unsubscribe:i(e)}}})[z]=function(){return this},t}return c({type:S.INIT}),(n={dispatch:c,subscribe:d,getState:u,replaceReducer:f})[z]=v,n}const M={};function R(t=M,i){switch(i.type){case I.METADATA_LOADED:return Object.assign(Object.assign({},t),{formMetadata:i.payload,currentSheet:void 0});case I.CHANGE_TAB:return Object.assign(Object.assign({},t),{currentSheet:i.payload});default:return t}}function T(t){return t.formMetadata}function D(t){const i=function(t){return t.currentSheet}(t);return i?t.formMetadata.getSheet(i):Array.from(t.formMetadata.getAllSheets().values())[0]}var I;!function(t){t.METADATA_LOADED="FORM/METADATA_LOADED",t.CHANGE_TAB="FORM/CHANGE_TAB"}(I||(I={}));const P=class{constructor(e){t(this,e),this.ezFormRequestClearFieldToFocus=i(this,"ezFormRequestClearFieldToFocus",7),this.ezFormSetFields=i(this,"ezFormSetFields",7),this.ezReady=i(this,"ezReady",7),this.formItemsReady=i(this,"formItemsReady",7),this._customEditors=new Map,this._application=l.getContextValue("__SNK__APPLICATION__"),this.onDataUnitAction=t=>{t.type===a.METADATA_LOADED&&this.processMetadata()},this._fieldsProps=new Map,this._singleColumn=!1,this.dataUnit=void 0,this.config=void 0,this.recordsValidator=void 0,this.fieldToFocus=void 0,this.onlyStaticFields=!1,this.useSearchField=!0,this.elementFocusSearchField=void 0}validate(){return this._dataBinder.validate()}async addCustomEditor(t,i,e){if(this._formView)return void this._formView.addCustomEditor(t,i,e);const n=new Map(this._customEditors);n.set(t,{customEditor:i,detailContext:e}),this._customEditors=n}observeConfig(){this.processMetadata()}async setFieldProp(t,i,e){const n=new Map(this._fieldsProps),s=this._fieldsProps.get(t);n.set(t,Object.assign(Object.assign({},s),{[i]:e})),this._fieldsProps=n}getDynamicContent(){var t;const i=T(this._store.getState());if(!i)return null;const n=Array.from(i.getAllSheets().values()),s=D(null===(t=this._store)||void 0===t?void 0:t.getState());let r=[];if(n.length>1){const t=n.map(((t,i)=>({tabKey:t.name,label:t.label,index:i}))),i="selector";r.push(e("ez-tabselector",{tabs:this.buildIdTabSelector(t),onEzChange:t=>this._store.dispatch(function(t){return{type:I.CHANGE_TAB,payload:"string"==typeof t?t:t.tabKey}}(t.detail)),selectedTab:s.name,"data-element-id":i}))}return r=r.concat(this.buildFormContent(s)),r}buildFormContent(t){const i=null==t?void 0:t.fields;if(null==t)return;this.ezFormSetFields.emit(i);const n=`${h.replaceAccentuatedChars(h.toCamelCase(null==t?void 0:t.label),!1)}_selectorContainer`;return e("div",{class:"dynamic-content ez-box--no-outline","data-element-id":n,ref:t=>this._container=t,tabindex:"0"},e("ez-popover",{ref:t=>this._ezPopoverSearchField=t,overlayType:"none"},this.renderFieldColumn()),e("ez-form-view",{ref:t=>this._formView=t,class:"ez-row ez-padding-vertical--small",fields:i,singleColumn:this._singleColumn,selectedRecord:this.dataUnit.getSelectedRecord()}))}renderFieldColumn(){return null!=this._fieldSearch||(this._fieldSearch=v({value:h.generateUUID(),label:this._i18n("ez-form.labelSearchField")},(({argument:t})=>this.fieldsOptionLoader(t)),(t=>this.onSelectField(t)))),this._fieldSearch}getFormFields(){var t;return null===(t=this.config)||void 0===t?void 0:t.fields}fieldsOptionLoader(t){const i=null==t?void 0:t.toLowerCase(),e=this.getFormFields().map((t=>{var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getField(t.name)})).filter((t=>{var e,n;return(null===(e=t.name)||void 0===e?void 0:e.toLowerCase().includes(i))||(null===(n=t.label)||void 0===n?void 0:n.toLowerCase().includes(i))})).map((t=>({value:t.name,label:t.label})));return Promise.resolve(e)}onSelectField(t){null!=t&&null!=t.value?(this.fieldToFocus=t.value,this._ezPopoverSearchField.hide()):this.fieldToFocus=""}async initKeyboardManager(){var t,i;this._keyboardManager=new u({propagate:!1,element:null!==(t=this.elementFocusSearchField)&&void 0!==t?t:this._element}),this.useSearchField&&this._keyboardManager.bind(p,(async()=>{if(!this._container||!this._ezPopoverSearchField)return;const t=this._container.getBoundingClientRect();await m(this._fieldSearch),this._ezPopoverSearchField.showUnder(this._container,{horizontalGap:t.width-b,verticalGap:-1*t.height})}),{description:this._i18n("ez-form.labelSearchField"),element:null!==(i=this.elementFocusSearchField)&&void 0!==i?i:this._element})}componentDidLoad(){this.initKeyboardManager()}processMetadata(){if(this.bindFields()&&this.dataUnit&&this._store){const t=((t,i,e=!1)=>{var n,s;null!=t&&!0!==(null==t?void 0:t.emptyConfig)||(t=(t=>{const i=t.metadata;let e;return i&&(e=i.fields.filter((t=>!1!==t.visible)).map((t=>({name:t.name,defaultValue:t.defaultValue})))),{emptyConfig:!1,fields:e}})(i));const r=new Map,o=new Map,l=[],a=[],h={};null===(n=null==t?void 0:t.tabs)||void 0===n||n.forEach((t=>{o.has(t.label)||!1!==t.visible||o.set(t.label,t)})),null===(s=null==t?void 0:t.fields)||void 0===s||s.forEach((t=>{var e,n,s;if(!1!==t.visible){const u=((t,i)=>("string"==typeof t?Array.from(i.keys()).find((i=>i.label===t)):t)||{label:t,visible:!0})(t.tab||"__main",r);if(o.has(u.label))return;const d=i.getField(t.name);if(d&&(null==(null==d?void 0:d.visible)||!0===(null==d?void 0:d.visible))&&u.visible){r.has(u)||r.set(u,[]);const i=f(d,t);r.get(u).push(i),i.required&&l.push(t.name),((null==t.cleanOnCopy?null===(e=d.properties)||void 0===e?void 0:e.cleanOnCopy:t.cleanOnCopy)||(null===(n=d.properties)||void 0===n?void 0:n.cleanOnCopy))&&a.push(t.name);let o=null==t.defaultValue?null===(s=d.properties)||void 0===s?void 0:s.defaultValue:t.defaultValue;if(o&&null!=o.value){const{type:i,value:e}=o;if(i)if("V"===i)o=e;else try{const t=JSON.parse(e);o=t&&"value"in t?t:e}catch(t){}h[t.name]=o}}}}));const u=new F;if(u.setDefaultVars(t.defaultVars),e){const t=i.metadata;null!=t&&null!=t.children&&t.children.forEach((t=>{const{label:i,name:e,fields:n}=(t=>({name:`child[${t.name}]`,label:t.label,fields:[]}))(t);r.set({name:e,label:i},n)}))}const d=w();return Array.from(r.entries()).sort(_).forEach((([t,i])=>{u.addSheet({label:"__main"===t.label?d("ez-form.mainTab"):t.label,name:t.name||t.label,fields:i})})),u.addRequiredFields(l),u.addCleanOnCopyFields(a),u.addDefaultValues(h),u})(this.config,this.dataUnit);this._store.dispatch({type:I.METADATA_LOADED,payload:t})}}isStatic(){var t;return(null===(t=this._staticFields)||void 0===t?void 0:t.length)>0}bindFields(){return!this.isStatic()||!1===this.onlyStaticFields}async componentWillLoad(){var t;void 0===this.dataUnit&&(this.dataUnit=new d("ez-form")),this.dataUnit.unsubscribe(this.onDataUnitAction),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new y(this.dataUnit),this._store=N(R),this._store.subscribe((()=>n(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata(),c.addIDInfo(this._element,null,{dataUnit:this.dataUnit});const i=await(null===(t=this._application)||void 0===t?void 0:t.getLayoutFormConfig());this.setSingleColumn(i),this.registerNotifyListeners(i),this._i18n=await g()}async setSingleColumn(t){this._singleColumn=(null==t?void 0:t.config)===E.CASCADE}async registerNotifyListeners(t){t&&t.onConfigChange((t=>{this._singleColumn=t===E.CASCADE}))}componentDidRender(){const t=T(this._store.getState());t.addRequiredFields(this._staticFields.filter((t=>t.dataset.required)).map((t=>t.dataset.fieldName))),this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")),this.dataUnit.dataUnitId,t,this.recordsValidator),this.ezReady.emit(),this.handleFieldToFocus(),this.setCustomEditors(),this.setFieldsProps()}setCustomEditors(){if(this._formView)for(const[t,i]of this._customEditors)this._formView.addCustomEditor(t,i.customEditor,i.detailContext),this._customEditors.delete(t)}handleFieldToFocus(){var t;if(null==this.fieldToFocus)return;const i=D(null===(t=this._store)||void 0===t?void 0:t.getState());(null==i?void 0:i.fields).some((t=>t.name===this.fieldToFocus))&&requestAnimationFrame((()=>{this._dataBinder.setFocus(this.fieldToFocus),this.ezFormRequestClearFieldToFocus.emit(),this.fieldToFocus=null}))}setFieldsProps(){if(this._formView)for(const[t,i]of this._fieldsProps){for(const e in i)this._formView.setFieldProp(t,e,i[e]);this._fieldsProps.delete(t)}}disconnectedCallback(){var t;this.dataUnit.unsubscribe(this.onDataUnitAction),this._dataBinder.onDisconnectedCallback(),null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}buildIdTabSelector(t){return t&&t.forEach((t=>t[c.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=h.toCamelCase(t.label))),t}render(){return e(s,null,this.isStatic()?null:this.getDynamicContent())}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"]}}};P.style=".sc-ez-form-h{display:flex;flex-direction:column;width:100%}.dynamic-content.sc-ez-form ez-collapsible-box.sc-ez-form{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}";export{P as ez_form}
|
package/dist/ezui/p-623161e2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{UserInterface as t,Action as s,StringUtils as i,ApplicationContext as e,ObjectUtils as n,WaitingChangeException as a,DataUnitAction as h}from"@sankhyalabs/core";import{A as r}from"./p-5a11cf56.js";import{g as o}from"./p-641ee538.js";import{h as l}from"./p-23a36bb6.js";const c=(s,i)=>{var e,n;let a,h,{name:r,label:o,group:l}=Object.assign({},i),{readOnly:c,required:d}=Object.assign({},i);return s&&(o=o||s.label,r=r||s.name,d=null!==(e=s.required)&&void 0!==e?e:null==i?void 0:i.required,c=null!==(n=s.readOnly)&&void 0!==n?n:null==i?void 0:i.readOnly,a=s.properties,h=s.userInterface),{name:r,label:o,group:l,readOnly:c,required:d,props:a,userInterface:h||t.SHORTTEXT}};class d{constructor(t,s,i){this._dataUnit=t,this._validationSource=s,this._validator=i,this._i18n=o()}validate(t=!0){return new Promise(((s,i)=>{const e=this._dataUnit.getModifiedRecords();for(let s=0;s<e.length;s++){const n=e[s],a=[];let h=this.validateRequired(n);if(h&&!h.isValid&&a.push(h),this._validator&&(h=this._validator.validateRecord(n),h&&!h.isValid&&a.push(h)),a.length>0){if(!t&&a[0].invalidFields.length>0){this._validationSource.markAsInvalid(a[0].invalidFields[0],n.__record__id__),i();break}this.processValidationResult(a,n.__record__id__),i();break}}return s()}))}validateRequired(t){const s=this._validationSource.getRequiredFields(),i=[];if(new Set(s).forEach((s=>{const e=t[s];if(null==e||""===e){const e=this._validationSource.getMessageForField(s,t.__record__id__);i.push(e?{name:s,message:e}:{name:s,message:this._i18n("utils.requiredField")})}})),i.length>0)return{isValid:!1,invalidFields:i,infoMessage:this._i18n("utils.requiredFieldMessage")}}processValidationResult(t,s){t.forEach((t=>{const i=t.invalidFields;if(this._dataUnit.savingCanceled(i,s),i&&i.forEach((t=>{this.markAsInvalid(t,s)})),t.infoMessage&&r.info(t.infoMessage),t.errorMessage){const{errorTitle:s,errorMessage:i}=t;r.error(s,i)}}))}markAsInvalid(t,s){this._dataUnit.setInvalidField(t.name,t.message,s),this._validationSource.markAsInvalid(t,s)}}class u{constructor(t){this.onDataUnitEvent=t=>{var i;switch(t.type){case s.MULTIPLE_EDITION_CHANGED:this.clearInvalid(),this.updateAllFieldsValues();break;case s.DATA_LOADED:case s.DATA_SAVED:case s.RECORDS_REMOVED:case s.RECORDS_ADDED:case s.RECORDS_COPIED:case s.EDITION_CANCELED:case s.SELECTION_CHANGED:case s.NEXT_SELECTED:case s.PREVIOUS_SELECTED:this.clearInvalid();case s.DATA_CHANGED:case s.CHANGE_UNDONE:case s.CHANGE_REDONE:case s.RECORD_LOADED:this.updateAllFieldsValues(),this.clearFieldError(Object.keys(t.payload)[0]);break;case s.FIELD_INVALIDATED:null===(i=this._fields)||void 0===i||i.forEach((t=>{this.updateErrorMessage(t.fieldName,t.field)}))}},this._uuid=i.generateUUID(),this._fields=new Map,this._dataUnit=t,this.applyDefaultValues(),this._dataUnit.subscribe(this.onDataUnitEvent),this._dataUnit.addInterceptor(this),this.setContextDataBinder(t)}get dataBinderId(){return this._uuid}setContextDataBinder(t){const s=e.getContextValue("__DATABINDER_BY_DATAUNIT__")||new Map,i=[...s.get(t.dataUnitId)||[],this];s.set(t.dataUnitId,i),e.setContextValue("__DATABINDER_BY_DATAUNIT__",s)}applyDefaultValues(){const t=(this._dataUnit.getAddedRecords()||[]).map((t=>t.__record__id__));if(t.length>0){const s=this.getDefaultValues();s&&Object.keys(s).forEach((i=>{this._dataUnit.setFieldValue(i,s[i],t)}))}}bind(t,s,i,e){t.forEach((t=>{const{fieldName:i,contextName:e}=t.dataset;null!=e&&e!==s||this.updateBind(i,t)})),this._formMetadata=i,this._recordValidatorProcessor=new d(this._dataUnit,{getRequiredFields:()=>this.getFormRequiredFields(),markAsInvalid:t=>this.markInvalid(t),getMessageForField:t=>this.getErrorMessage(t)},e)}getFormRequiredFields(){return this._formMetadata.getRequiredFields()}disconnectDataUnit(){const t=e.getContextValue("__DATABINDER_BY_DATAUNIT__")||new Map,s=t.get(this._dataUnit.dataUnitId).filter((t=>t.dataBinderId!==this.dataBinderId));t.set(this._dataUnit.dataUnitId,s),e.setContextValue("__DATABINDER_BY_DATAUNIT__",t)}onDisconnectedCallback(){this._dataUnit.unsubscribe(this.onDataUnitEvent),this._dataUnit.removeInterceptor(this),this.disconnectDataUnit()}getCurrentRecordId(){const t=this._dataUnit.getSelectedRecord();return null==t?void 0:t.__record__id__}markInvalid(t){if(this._fields.has(t.name)){const s=this._fields.get(t.name).field;this.updateErrorMessage(t.name,s,t.message)}}setFocus(t){if(!this._fields.has(t))return;const s=this._fields.get(t).field;"function"==typeof s.setFocus&&s.setFocus()}clearInvalid(t){this._dataUnit.clearInvalid(t),this._fields.forEach((t=>{t.field.errorMessage=""}))}clearFieldError(t){var s;const i=null===(s=this._fields.get(t))||void 0===s?void 0:s.field;i.errorMessage&&(i.errorMessage="",this._dataUnit.clearInvalid(this.getCurrentRecordId(),t))}updateFieldValue(t,s){const i=this._fields.get(t);try{i&&(i.listen=!1),this._dataUnit.isMultipleEdition&&this.hasMultipleValuesBetweenRecords(t)?(s.value=void 0,s.alternativePlaceholder="Múltiplos Valores"):(s.value=this._dataUnit.getFieldValue(t),s.alternativePlaceholder=void 0),this.updateErrorMessage(t,s)}finally{i&&(i.listen=!0)}}hasMultipleValuesBetweenRecords(t){var s,i;const e=null!==(i=null===(s=this._dataUnit.getSelectionInfo())||void 0===s?void 0:s.records)&&void 0!==i?i:[];if(e.length<=1)return!1;const a=e[0][t];return!e.every((s=>n.equals(s[t],a)))}validate(){return this._recordValidatorProcessor.validate()}static async validateByDataunit(t){try{const s=this.getDataBindersByDataUnit(t);return await Promise.all(s.map((t=>t.validate()))),!0}catch(t){return!1}}static getDataBindersByDataUnit(t){const s=e.getContextValue("__DATABINDER_BY_DATAUNIT__");return(null==s?void 0:s.get(t.dataUnitId))||[]}updateErrorMessage(t,s,i){null==i&&(i=this._dataUnit.getInvalidMessage(this.getCurrentRecordId(),t)),s.errorMessage||(s.errorMessage=i)}getErrorMessage(t){if(this._fields.has(t))return this._fields.get(t).field.errorMessage}updateBind(t,s){const i=this._fields.get(t);i&&i.destroy(),this.bindSearchOptionsLoader(t,s),this.updateFieldValue(t,s),this.updateErrorMessage(t,s),this._fields.set(t,_.create(t,s,((t,s)=>this.changeStarted(t,s)),(t=>this.cancelWaitingChange(t)),((t,s)=>this.setFieldValue(t,s)))),this.applyEzUploadContext(t,s)}changeStarted(t,s){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),!s.blocking&&null==s.promise){const i=this._fields.get(t);i&&(s.promise=new Promise(((t,s)=>{i.waitingChangePromiseResolve=t,i.waitingChangePromiseReject=s})))}this._dataUnit.startChange(t,s)}cancelWaitingChange(t){if(this._dataUnit.waitingForChange(t)){this._dataUnit.cancelWaitingChange(t);const s=this._fields.get(t);s&&s.rejectWaitingChange(new a("Change canceled",t))}}setFieldValue(t,s){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),this._dataUnit.clearInvalid(this.getCurrentRecordId(),t),this._dataUnit.isMultipleEdition){const i=this._dataUnit.getSelectionInfo();this._dataUnit.setFieldValue(t,s,i.recordIds)}else{const i=this._dataUnit.getSelectedRecord();this._dataUnit.setFieldValue(t,s,i?[i.__record__id__]:void 0)}if(this._dataUnit.waitingForChange(t)){const s=this._fields.get(t);s&&s.acceptWaitingChange()}}bindSearchOptionsLoader(t,s){if(("EZ-SEARCH"===s.nodeName||"EZ-SEARCH-PLUS"===s.nodeName)&&null==s.optionLoader){const i=e.getContextValue("EZ-SEARCH-PLUS"===s.nodeName?"__EZUI__SEARCH__PLUS__OPTION__LOADER__":"__EZUI__SEARCH__OPTION__LOADER__");i&&(s.optionLoader=(s,e)=>i(s,t,this._dataUnit,e))}}applyEzUploadContext(t,s){var i,n;if("EZ-UPLOAD"===s.nodeName){s.urlUpload=e.getContextValue("__EZUI__UPLOAD__ADD__URL__"),s.urlDelete=e.getContextValue("__EZUI__UPLOAD__DEL__URL__");const a=this._dataUnit.getField(t),h=null===(i=a.properties)||void 0===i?void 0:i.DESTINATION;h&&(s.requestHeaders={XTRAINF:`{"destination": "${h}"}`}),s.maxFiles=(null===(n=a.properties)||void 0===n?void 0:n.MAX_FILES)||0}}updateAllFieldsValues(){var t;null===(t=this._fields)||void 0===t||t.forEach((t=>{this.updateFieldValue(t.fieldName,t.field)}))}interceptAction(t){if(t.type===s.RECORDS_COPIED){const i=this._formMetadata.getCleanOnCopyFields();if(i)return new h(s.RECORDS_COPIED,t.payload.map((t=>{const s=Object.assign({},t);return i.forEach((t=>delete s[t])),s})))}if(t.type===s.SAVING_DATA)return new Promise((s=>{this.validate().then((()=>s(t))).catch((()=>{}))}));if(t.type===s.RECORDS_ADDED){const i=this.getDefaultValues();if(i)return new h(s.RECORDS_ADDED,t.payload.map((t=>Object.assign(Object.assign({},t),i))))}return t}getDefaultValues(){var t;const s=null===(t=this._formMetadata)||void 0===t?void 0:t.getDefaultValues();if(s){const t={};for(const i in s)t[i]=this._dataUnit.valueFromString(i,s[i]);return t}}}class _{constructor(){this.listen=!0,this.startChangeEventName="ezStartChange",this.cancelWaitingChangeEventName="ezCancelWaitingChange",this.changeEventName="ezChange"}destroy(){this.field.removeEventListener(this.startChangeEventName,this.startChangeListener),this.field.removeEventListener(this.cancelWaitingChangeEventName,this.cancelWaitingChangeListener),this.field.removeEventListener(this.changeEventName,this.changeListener)}acceptWaitingChange(){this.waitingChangePromiseResolve&&(this.waitingChangePromiseResolve(),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}rejectWaitingChange(t){this.waitingChangePromiseReject&&(this.waitingChangePromiseReject(t),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}static create(t,s,i,e,n){const a=new _;return a.field=s,a.fieldName=t,a.startChangeListener=s=>{a.listen&&i(t,s.detail)},a.field.addEventListener(a.startChangeEventName,a.startChangeListener),a.cancelWaitingChangeListener=()=>{a.listen&&e(t)},a.field.addEventListener(a.cancelWaitingChangeEventName,a.cancelWaitingChangeListener),a.changeListener=s=>{a.listen&&n(t,s.detail)},a.field.addEventListener(a.changeEventName,a.changeListener),a}}const v="ctrl+f",f=240,p=String(210)+"px",A=(t,s,i)=>l("ez-search",{class:"ez-padding--small ez-margin--none",style:{"--ez-text-input__margin-bottom":"0px","--ez-search--width":p},canShowError:!1,showSelectedValue:!1,showOptionValue:!1,suppressEmptyOption:!0,label:t.label,value:null,optionLoader:s,onEzChange:t=>i(t.detail),ignoreLimitCharsToSearch:!0}),g=async t=>{requestAnimationFrame((async()=>{if(t){const s=t.t;if(!s)return;s.value=null,await s.setFocus()}}))};export{u as D,d as R,v as S,A as a,c as b,f as c,g as f}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,f as o,h as a,g as e}from"./p-23a36bb6.js";import{D as n}from"./p-ab574d59.js";import{FloatingManager as l,ElementIDUtils as r,KeyboardManager as d}from"@sankhyalabs/core";import{F as c}from"./p-dc628ed3.js";import{i as s}from"./p-641ee538.js";class h{constructor(t,i,o,a,e,n,l,r,d,c){this.title=t,this.message=i,this.dialogType=o,this.confirm=a,this.icon=e,this.labelCancel=n,this.labelConfirm=l,this.btnConfirmDanger=r,this.callBack=d,this.beforeClose=c}}const g=class{constructor(o){t(this,o),this.ezCancel=i(this,"ezCancel",7),this.ezAccept=i(this,"ezAccept",7),this.PRIMARY_BUTTON_ID="EZ_DIALOG_PRIMARY_BUTTON",this.btnConfirmDanger=!1,this._messageQueue=[],this._canFocusOnPrimaryBtn=!1,this.confirm=!1,this.dialogType=void 0,this.message=void 0,this.opened=!1,this.personalizedIconPath=void 0,this.ezTitle=void 0,this.beforeClose=void 0}observeConfig(t,i){this.manageOverflow(),t&&!i&&(this._canFocusOnPrimaryBtn=!0)}manageOverflow(){window.document.body.style.overflow=this.opened?"hidden":""}manageOverlay(){this.opened?this._overlayId=l.subscribeOverlayControl(this._overlayRef):l.unsubscribeOverlayControl(this._overlayRef||this._overlayId)}handleButtonClick(t){this._currentMessage.beforeClose&&!1===this._currentMessage.beforeClose(t)||(this.opened=this._messageQueue.length>0,this._currentMessage.callBack&&this._currentMessage.callBack(t),t?this.ezAccept.emit(t):this.ezCancel.emit(t),this._currentMessage=this._messageQueue.shift(),o(this))}async show(t,i,o,a,e,n,l,r,d){return this.opened=!0,new Promise((c=>{this._messageQueue.push(new h(t,i,o,a,e,n,l,r,c,d))}))}isCritical(t){return t===n.CRITICAL}getIconElement(t){if(t.dialogType===n.DEFAULT)return;const i=this.getIconClass(t.dialogType);return a("div",{class:`changeable__icon__container ${i}`},a("ez-icon",{class:"changeable__icon",size:"small",iconName:this.getIconName(t)}))}getIconClass(t){return this.isCritical(t)?"title-icon--critical":t===n.SUCCESS?"title-icon--success":t===n.WARN?"title-icon--warn":""}getIconName(t){return t.icon?t.icon:this.isCritical(t.dialogType)?"alert-circle-inverted":t.dialogType===n.WARN?"warning-outline":t.dialogType===n.SUCCESS?"check":void 0}getTypeIndicatorElement(t){if(t.dialogType!==n.DEFAULT)return a("div",{class:this.getClassIconIndicator(t.dialogType)})}getClassIconIndicator(t){return this.isCritical(t)?"dialog__critical--indicator":t==n.SUCCESS?"dialog__success--indicator":t==n.WARN?"dialog__warning--indicator":""}getClassContainer(t){return(t.dialogType||n.DEFAULT)===n.DEFAULT?"dialog__container dialog__container--default":"dialog__container"}getClassTitleLabel(t){return null==this.getIconElement(t)?"title title__label title__label--no-icon":"title title__label"}async componentWillLoad(){this.i18n=await s()}componentWillRender(){this._currentMessage||(this._messageQueue.length>0?this._currentMessage=this._messageQueue.pop():this.opened&&(this._currentMessage=new h(this.ezTitle,this.message,this.dialogType,this.confirm,this.personalizedIconPath,this.i18n("app.no"),this.i18n("app.yes"),this.btnConfirmDanger,null,this.beforeClose)))}componentDidLoad(){r.addIDInfo(this._element),this._keyboardManager=new d({propagate:!1,element:this._element}).bind("Enter",(()=>this.handleButtonClick(!0)),{description:this.i18n("ez-dialog.confirmButton"),element:this._element}).bind("Escape",(()=>this.handleButtonClick(!1)),{description:this.i18n("ez-dialog.closeButton"),element:this._element}).bind("Esc",(()=>this.handleButtonClick(!1)),{description:this.i18n("ez-dialog.closeButton"),element:this._element})}componentDidRender(){this.manageOverlay(),this.focusOnDialog(),this.handleFocusOnPrimaryButton()}focusOnDialog(){const t=this._element.shadowRoot.querySelector(".overlay .dialog");t instanceof HTMLDivElement&&(t.style.outline="none",this._lastActiveElement=document.activeElement,t.focus())}handleFocusOnPrimaryButton(){this._canFocusOnPrimaryBtn&&(this.focusOnPrimaryButton(),this._canFocusOnPrimaryBtn=!1)}focusOnPrimaryButton(){const t=this._element.shadowRoot.querySelector(`#${this.PRIMARY_BUTTON_ID}`),i=null==t?void 0:t.shadowRoot.querySelector("button");requestAnimationFrame((()=>{null==i||i.focus()}))}disconnectedCallback(){var t;c.resolveFocus(this._lastActiveElement),this._lastActiveElement=void 0,null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}render(){return this.opened&&this._currentMessage?a("div",{class:"overlay",ref:t=>this._overlayRef=t},a("div",{tabindex:"-1",class:"dialog"},this.getTypeIndicatorElement(this._currentMessage),a("div",{class:this.getClassContainer(this._currentMessage)},a("div",{class:"title__container"},a("div",{class:"title__box"},this.getIconElement(this._currentMessage),a("div",{class:this.getClassTitleLabel(this._currentMessage),innerHTML:this._currentMessage.title,"data-element-id":r.getInternalIDInfo("title")})),a("button",{class:"btn-close",onClick:()=>this.handleButtonClick(!1),"data-element-id":r.getInternalIDInfo("buttonClose")})),a("div",{class:"message",innerHTML:this._currentMessage.message,"data-element-id":r.getInternalIDInfo("message")}),this._currentMessage.confirm&&a("div",{class:"button-yes-no__container"},a("ez-button",{class:"button__cancel","data-element-id":r.getInternalIDInfo("cancel"),label:this._currentMessage.labelCancel,onClick:()=>this.handleButtonClick(!1)}),a("ez-button",{id:this.PRIMARY_BUTTON_ID,class:this._currentMessage.btnConfirmDanger?"button__confirm--danger":"button__confirm","data-element-id":r.getInternalIDInfo("confirm"),label:this._currentMessage.labelConfirm,onClick:()=>this.handleButtonClick(!0)})),!this._currentMessage.confirm&&a("div",{class:"button__confirm--container"},a("ez-button",{id:this.PRIMARY_BUTTON_ID,label:"Ok","data-element-id":r.getInternalIDInfo("ok"),class:"button__confirm",onClick:()=>this.handleButtonClick(!0)}))))):null}get _element(){return e(this)}static get watchers(){return{opened:["observeConfig"]}}};g.style=':host{--dialog__container-padding:var(--space--md, 20px);--dialog__btn__close--background-color:var(--title--primary, #2b3a54);--dialog__btn__no--padding-right:var(--space--large, 24px);--dialog__btn__close__image:url(\'data:image/svg+xml;utf8,<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg%22%3E<path d="M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z"/></svg>\');--dialog__title--font-pattern:var(--font-pattern, "Roboto");--dialog__title--padding-left:var(--space--small, 6px);--dialog__title__container--padding-bottom:var(--space--medium, 12px);--dialog__title--weight--large:var(--text-weight--large, 600);--dialog__body--font-pattern:var(--font-pattern, "Roboto");--dialog__body--text-shadow:var(--text-shadow, "0 0 0 #353535, 0 0 1px transparent");--dialog__body--text-weight--medium:var(--text-weight--medium, 400);--dialog__body--padding-bottom:var(--space--medium, 12px);--dialog__body--font-size:var(--text--medium, 14px);--dialog__body--color:var(--text--primary, #626e82);--dialog__icon--color:var(--text--inverted, #fff);--dialog__critical--background-color:var(--color--alert-error-800, #BD0025);--dialog__warning--background-color:var(--color--alert-warning-500, #EFB103);--dialog__success--background-color:var(--color--alert-success-500, #00523c);--dialog-z-index:var(--elevation--100, 100);--dialog--warning__image:url(\'data: image/svg+xml;utf8,<svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><path d="M 7.5,0 0,13 h 15 z m 0,2.73684 5.1341,8.89476 H 2.36591 Z M 6.81818,5.47368 V 8.21053 H 8.18182 V 5.47368 Z m 0,4.10527 V 10.9474 H 8.18182 V 9.57895"/></svg>\');--dialog--critical__image:url(\'data: image/svg+xml;utf8,<svg width="13" height="13" viewBox="0 0 13 13" xmlns="http://www.w3.org/2000/svg"><path d="M 7.6534493,6.4948538 12.762051,1.3864299 C 12.914368,1.2341297 13,1.027552 13,0.81215179 13,0.59676225 12.914369,0.39018443 12.762051,0.23787352 12.609733,0.08557341 12.40318,0 12.187747,0 11.972425,0 11.765762,0.08557341 11.613445,0.23787352 L 6.5048431,5.3462975 1.3961977,0.23787352 C 1.2438802,0.08557341 1.0373043,0 0.82189458,0 0.60649572,0 0.39990901,0.08557341 0.24759147,0.23787352 0.09527396,0.39018443 0.00970766,0.59676225 0.00970766,0.81215179 c 0,0.21540021 0.0855663,0.42197791 0.23788381,0.57427811 L 5.3562369,6.4948538 0.24759147,11.604381 c -0.0775121,0.07492 -0.13931586,0.164543 -0.18182835,0.263595 -0.04250169,0.09905 -0.064850182,0.205678 -0.0657357237,0.313391 -8.8554258e-4,0.107813 0.0197049337,0.214771 0.0605827337,0.314472 0.04086693,0.0998 0.10119858,0.190415 0.17746563,0.266625 0.0762779,0.07622 0.16695386,0.136398 0.26675594,0.177208 0.099802,0.04082 0.20672745,0.06127 0.31452961,0.06029 0.1078025,-9.53e-4 0.21433799,-0.0235 0.31337139,-0.06604 0.099045,-0.04265 0.1886052,-0.104571 0.263465,-0.182081 L 6.5048431,7.6434102 11.613445,12.751855 c 0.152317,0.152312 0.35898,0.237831 0.574302,0.237831 0.215433,0 0.421986,-0.08552 0.574304,-0.237831 C 12.914368,12.599545 13,12.393 13,12.177578 13,11.962157 12.91437,11.75561 12.762051,11.603299 Z"/></svg>\')}h2{margin-block-start:0;margin-block-end:0;margin-inline-start:0px;margin-inline-end:0px}.overlay{position:fixed;display:flex;top:0px;z-index:var(--dialog-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;background-color:rgba(var(--rgb-background--overlay), var(--opacity--soft));backdrop-filter:blur(var(--background-blur--medium))}.dialog{display:flex;width:80%;position:absolute;top:50%;left:50%;margin-right:-50%;box-sizing:border-box;transform:translate(-50%, -50%);box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122)}@media screen and (min-width: 768px){.dialog{width:50%}}@media screen and (min-width: 992px){.dialog{width:33.33333%}}.dialog__container{width:100%;background:#FFFF;border-radius:0px 6px 6px 0px;box-sizing:border-box;padding:var(--dialog__container-padding)}.dialog__container--default{border-radius:6px 6px 6px 6px}.dialog__critical--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--dialog__critical--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__warning--background-color)}.dialog__success--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dialog__success--background-color)}.message{font-size:var(--dialog__body--font-size);font-weight:var(--dialog__body--text-weight--medium);font-family:var(--dialog__body--font-pattern);text-shadow:var(--dialog__body--text-shadow);padding-bottom:var(--dialog__body--padding-bottom);color:var(--dialog__body--color);max-height:30vh;content-visibility:auto;margin-bottom:var(--space--medium);overflow-y:auto}.changeable__icon__container{background:var(--dialog__warning--background-color);display:flex;justify-content:center;align-items:center;min-width:26px;min-height:26px;border-radius:50%}.changeable__icon{--ez-icon--color:var(--dialog__icon--color)}.changeable__icon__container.title-icon--critical{background-color:var(--dialog__critical--background-color)}.changeable__icon__container.title-icon--success{background-color:var(--dialog__success--background-color)}.changeable__icon__container.title-icon--warn{background-color:var(--dialog__warning--background-color)}.changeable__icon__container.title-icon--warn ez-icon{transform:translateY(-1px)}.title{display:flex;font-family:var(--dialog__title--font-pattern);margin:0;font-weight:var(--dialog__title--weight--large);color:var(--title--primary)}.title__container{display:flex;padding-bottom:var(--dialog__title__container--padding-bottom)}.title__box{display:flex;width:100%;align-items:center;align-self:center}.title__label{padding-left:var(--dialog__title--padding-left)}.title__label--no-icon{padding-left:0}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:\'\';display:flex;background-color:var(--dialog__btn__close--background-color);width:12px;height:12px;-webkit-mask-image:var(--dialog__btn__close__image);mask-image:var(--dialog__btn__close__image)}.title-icon::after{content:\'\';display:flex;background-color:#FFFF;width:15px;height:15px;-webkit-mask-image:var(--dialog--warning__image);mask-image:var(--dialog--warning__image)}.button-yes-no__container{display:flex;box-sizing:border-box;align-self:center;align-items:center;justify-content:flex-end}.button__cancel{padding-right:var(--dialog__btn__no--padding-right)}.button__confirm{--ez-button--background-color:var(--color--primary);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color--primary-600);--ez-button--hover-color:var(--color--inverted)}.button__confirm--danger{--ez-button--background-color:var(--color--alert-error-800, #BD0025);--ez-button--color:var(--color--inverted);--ez-button--hover--background-color:var(--color-alert--error-900, #a10020);--ez-button--hover-color:var(--color--inverted)}.button__confirm--container{display:flex;justify-content:flex-end}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}';export{g as ez_dialog}
|