@sankhyalabs/ezui 3.0.3 → 3.1.0
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/{ApplicationUtils-350ac2ff.js → ApplicationUtils-1eef635f.js} +8 -4
- package/dist/cjs/constants-5a75e2f3.js +5 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-alert.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-breadcrumb.cjs.entry.js +263 -9
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-card-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -2
- package/dist/cjs/ez-combo-box.cjs.entry.js +95 -11
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-filter-input_4.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +3 -2
- package/dist/cjs/ez-form.cjs.entry.js +2 -2
- package/dist/cjs/ez-grid.cjs.entry.js +1 -1
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-edit.cjs.entry.js +2 -2
- package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-toast.cjs.entry.js +11 -3
- package/dist/cjs/ez-upload.cjs.entry.js +2 -2
- package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/{index-892780f1.js → index-b54f47a1.js} +5 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/ez-breadcrumb/ez-breadcrumb.css +10 -1
- package/dist/collection/components/ez-breadcrumb/ez-breadcrumb.js +291 -9
- package/dist/collection/components/ez-breadcrumb/subcomponents/breadcrumb-item.js +31 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +93 -9
- package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +2 -1
- package/dist/collection/components/ez-toast/ez-toast.css +1 -1
- package/dist/collection/components/ez-toast/ez-toast.js +9 -1
- package/dist/collection/utils/ApplicationUtils.js +8 -4
- package/dist/collection/utils/constants.js +1 -0
- package/dist/custom-elements/index.js +377 -26
- package/dist/esm/{ApplicationUtils-9fda4796.js → ApplicationUtils-79bf1d95.js} +8 -4
- package/dist/esm/constants-ca136201.js +3 -0
- package/dist/esm/ez-actions-button.entry.js +2 -2
- package/dist/esm/ez-alert.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-breadcrumb.entry.js +264 -10
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-card-item.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +2 -2
- package/dist/esm/ez-combo-box.entry.js +95 -11
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-dropdown.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-filter-input_4.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +3 -2
- package/dist/esm/ez-form.entry.js +2 -2
- package/dist/esm/ez-grid.entry.js +1 -1
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +1 -1
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-edit.entry.js +2 -2
- package/dist/esm/ez-text-input.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-toast.entry.js +11 -3
- package/dist/esm/ez-upload.entry.js +2 -2
- package/dist/esm/ez-view-stack.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/{index-de655f48.js → index-c27164d3.js} +5 -0
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-7ffd12e7.js → p-00ea9b50.js} +2 -2
- package/dist/ezui/{p-0c7e81fe.entry.js → p-044a3427.entry.js} +1 -1
- package/dist/ezui/{p-6818dd0a.entry.js → p-064e558f.entry.js} +1 -1
- package/dist/ezui/{p-c98e571a.entry.js → p-0f76448d.entry.js} +1 -1
- package/dist/ezui/{p-36f7ec68.entry.js → p-124859c3.entry.js} +1 -1
- package/dist/ezui/{p-9613fae6.entry.js → p-149442dd.entry.js} +1 -1
- package/dist/ezui/{p-493e2af4.entry.js → p-1806b3c6.entry.js} +1 -1
- package/dist/ezui/{p-37b4bf04.entry.js → p-1a1c2eda.entry.js} +1 -1
- package/dist/ezui/{p-eceb9382.entry.js → p-1cfae451.entry.js} +1 -1
- package/dist/ezui/{p-07b99b94.entry.js → p-216e1153.entry.js} +1 -1
- package/dist/ezui/{p-1b95836f.entry.js → p-2c5f1107.entry.js} +1 -1
- package/dist/ezui/{p-fcf6cf57.entry.js → p-2d16e8c2.entry.js} +1 -1
- package/dist/ezui/p-30afcb93.entry.js +1 -0
- package/dist/ezui/{p-a323b415.entry.js → p-330aef41.entry.js} +1 -1
- package/dist/ezui/p-3f4ae3a3.js +1 -0
- package/dist/ezui/p-51ecf138.entry.js +1 -0
- package/dist/ezui/{p-f670bd32.entry.js → p-52e5cc09.entry.js} +1 -1
- package/dist/ezui/{p-c0184982.entry.js → p-66dba09c.entry.js} +1 -1
- package/dist/ezui/p-68acdc61.entry.js +1 -0
- package/dist/ezui/{p-4bfed869.entry.js → p-74379544.entry.js} +1 -1
- package/dist/ezui/{p-b1e4ccf4.entry.js → p-74b3615b.entry.js} +1 -1
- package/dist/ezui/{p-db131605.entry.js → p-77d70bae.entry.js} +1 -1
- package/dist/ezui/{p-600f1732.entry.js → p-78b28632.entry.js} +1 -1
- package/dist/ezui/{p-a4b281ca.entry.js → p-7ff5d0cc.entry.js} +1 -1
- package/dist/ezui/{p-cc5cfcb7.entry.js → p-80f79b1c.entry.js} +1 -1
- package/dist/ezui/{p-06b3e801.entry.js → p-85c1e00f.entry.js} +1 -1
- package/dist/ezui/{p-c1300e84.entry.js → p-8f1a5e21.entry.js} +1 -1
- package/dist/ezui/p-90c3d4fd.entry.js +1 -0
- package/dist/ezui/{p-b941aeee.entry.js → p-936ae3ac.entry.js} +1 -1
- package/dist/ezui/{p-b3c7b243.entry.js → p-93c8bdc6.entry.js} +1 -1
- package/dist/ezui/p-a0e47238.entry.js +1 -0
- package/dist/ezui/{p-86d29565.entry.js → p-aaba630e.entry.js} +1 -1
- package/dist/ezui/{p-62481744.entry.js → p-bb011a51.entry.js} +1 -1
- package/dist/ezui/{p-fd87638e.entry.js → p-bb0607a6.entry.js} +1 -1
- package/dist/ezui/{p-b405d9b6.entry.js → p-bf442859.entry.js} +1 -1
- package/dist/ezui/{p-8ca4750d.entry.js → p-bfca509e.entry.js} +1 -1
- package/dist/ezui/{p-82db6de7.entry.js → p-cd1e0679.entry.js} +1 -1
- package/dist/ezui/{p-cc40fcb3.entry.js → p-ce1408dd.entry.js} +1 -1
- package/dist/ezui/{p-1581fece.entry.js → p-dd13d0e6.entry.js} +1 -1
- package/dist/ezui/{p-a67e056f.entry.js → p-e6cf82e8.entry.js} +1 -1
- package/dist/ezui/{p-695facd0.entry.js → p-e8271a0e.entry.js} +1 -1
- package/dist/ezui/p-efb43dd8.js +1 -0
- package/dist/types/components/ez-breadcrumb/ez-breadcrumb.d.ts +52 -2
- package/dist/types/components/ez-breadcrumb/subcomponents/breadcrumb-item.d.ts +13 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +10 -0
- package/dist/types/components/ez-toast/ez-toast.d.ts +1 -0
- package/dist/types/components.d.ts +25 -1
- package/dist/types/utils/ApplicationUtils.d.ts +4 -4
- package/dist/types/utils/constants.d.ts +1 -0
- package/package.json +1 -1
- package/dist/ezui/p-69a913b8.js +0 -1
- package/dist/ezui/p-a8c7355e.entry.js +0 -1
- package/dist/ezui/p-ada6e6b0.entry.js +0 -1
- package/dist/ezui/p-d6dd32b2.entry.js +0 -1
- package/dist/ezui/p-e0d756d9.entry.js +0 -1
- package/dist/ezui/p-f18d39e6.entry.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let e,t,n,l=!1,o=!1,s=!1,i=!1,c=!1;const r="http://www.w3.org/1999/xlink",f={},u=e=>"object"==(e=typeof e)||"function"===e;function a(e){var t,n,l;return null!==(l=null===(n=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===n?void 0:n.getAttribute("content"))&&void 0!==l?l:void 0}const d=(e,t,...n)=>{let l=null,o=null,s=null,i=!1,c=!1;const r=[],f=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?f(l):null!=l&&"boolean"!=typeof l&&((i="function"!=typeof e&&!u(l))&&(l+=""),i&&c?r[r.length-1].t+=l:r.push(i?p(null,l):l),c=i)};if(f(n),t){t.key&&(o=t.key),t.name&&(s=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,r,h);const a=p(e,null);return a.l=t,r.length>0&&(a.o=r),a.i=o,a.u=s,a},p=(e,t)=>({p:0,$:e,t,h:null,o:null,l:null,i:null,u:null}),$={},h={forEach:(e,t)=>e.map(m).forEach(t),map:(e,t)=>e.map(m).map(t).map(y)},m=e=>({vattrs:e.l,vchildren:e.o,vkey:e.i,vname:e.u,vtag:e.$,vtext:e.t}),y=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),d(e.vtag,t,...e.vchildren||[])}const t=p(e.vtag,e.vtext);return t.l=e.vattrs,t.o=e.vchildren,t.i=e.vkey,t.u=e.vname,t},b=e=>se(e).m,v=(e,t,n)=>{const l=b(e);return{emit:e=>w(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},w=(e,t,n)=>{const l=he.ce(t,n);return e.dispatchEvent(l),l},g=new WeakMap,k=e=>"sc-"+e.v,j=(e,t,n,l,o,s)=>{if(n!==l){let i=re(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=O(n),s=O(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const f=u(l);if((i||f&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}let a=!1;c!==(c=c.replace(/^xlink\:?/,""))&&(t=c,a=!0),null==l||!1===l?!1===l&&""!==e.getAttribute(t)||(a?e.removeAttributeNS(r,t):e.removeAttribute(t)):(!i||4&s||o)&&!f&&(l=!0===l?"":l,a?e.setAttributeNS(r,t,l):e.setAttribute(t,l))}else t="-"===t[2]?t.slice(3):re(pe,c)?c.slice(2):c[2]+t.slice(3),n&&he.rel(e,t,n,!1),l&&he.ael(e,t,l,!1)}},S=/\s/,O=e=>e?e.split(S):[],C=(e,t,n,l)=>{const o=11===t.h.nodeType&&t.h.host?t.h.host:t.h,s=e&&e.l||f,i=t.l||f;for(l in s)l in i||j(o,l,s[l],void 0,n,t.p);for(l in i)j(o,l,s[l],i[l],n,t.p)},M=(o,c,r,f)=>{const u=c.o[r];let a,d,p,$=0;if(l||(s=!0,"slot"===u.$&&(e&&f.classList.add(e+"-s"),u.p|=u.o?2:1)),null!==u.t)a=u.h=$e.createTextNode(u.t);else if(1&u.p)a=u.h=$e.createTextNode("");else{if(i||(i="svg"===u.$),a=u.h=$e.createElementNS(i?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&u.p?"slot-fb":u.$),i&&"foreignObject"===u.$&&(i=!1),C(null,u,i),null!=e&&a["s-si"]!==e&&a.classList.add(a["s-si"]=e),u.o)for($=0;$<u.o.length;++$)d=M(o,u,$,a),d&&a.appendChild(d);"svg"===u.$?i=!1:"foreignObject"===a.tagName&&(i=!0)}return a["s-hn"]=n,3&u.p&&(a["s-sr"]=!0,a["s-cr"]=t,a["s-sn"]=u.u||"",p=o&&o.o&&o.o[r],p&&p.$===u.$&&o.h&&x(o.h,!1)),a},x=(e,t)=>{he.p|=1;const l=e.childNodes;for(let e=l.length-1;e>=0;e--){const o=l[e];o["s-hn"]!==n&&o["s-ol"]&&(L(o).insertBefore(o,E(o)),o["s-ol"].remove(),o["s-ol"]=void 0,s=!0),t&&x(o,t)}he.p&=-2},R=(e,t,l,o,s,i)=>{let c,r=e["s-cr"]&&e["s-cr"].parentNode||e;for(r.shadowRoot&&r.tagName===n&&(r=r.shadowRoot);s<=i;++s)o[s]&&(c=M(null,l,s,e),c&&(o[s].h=c,r.insertBefore(c,E(t))))},P=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.h,F(l),o=!0,s["s-ol"]?s["s-ol"].remove():x(s,!0),s.remove())},T=(e,t)=>e.$===t.$&&("slot"===e.$?e.u===t.u:e.i===t.i),E=e=>e&&e["s-ol"]||e,L=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,N=(e,t)=>{const n=t.h=e.h,l=e.o,o=t.o,s=t.$,c=t.t;let r;null===c?(i="svg"===s||"foreignObject"!==s&&i,"slot"===s||C(e,t,i),null!==l&&null!==o?((e,t,n,l)=>{let o,s,i=0,c=0,r=0,f=0,u=t.length-1,a=t[0],d=t[u],p=l.length-1,$=l[0],h=l[p];for(;i<=u&&c<=p;)if(null==a)a=t[++i];else if(null==d)d=t[--u];else if(null==$)$=l[++c];else if(null==h)h=l[--p];else if(T(a,$))N(a,$),a=t[++i],$=l[++c];else if(T(d,h))N(d,h),d=t[--u],h=l[--p];else if(T(a,h))"slot"!==a.$&&"slot"!==h.$||x(a.h.parentNode,!1),N(a,h),e.insertBefore(a.h,d.h.nextSibling),a=t[++i],h=l[--p];else if(T(d,$))"slot"!==a.$&&"slot"!==h.$||x(d.h.parentNode,!1),N(d,$),e.insertBefore(d.h,a.h),d=t[--u],$=l[++c];else{for(r=-1,f=i;f<=u;++f)if(t[f]&&null!==t[f].i&&t[f].i===$.i){r=f;break}r>=0?(s=t[r],s.$!==$.$?o=M(t&&t[c],n,r,e):(N(s,$),t[r]=void 0,o=s.h),$=l[++c]):(o=M(t&&t[c],n,c,e),$=l[++c]),o&&L(a.h).insertBefore(o,E(a.h))}i>u?R(e,null==l[p+1]?null:l[p+1].h,n,l,c,p):c>p&&P(t,i,u)})(n,l,t,o):null!==o?(null!==e.t&&(n.textContent=""),R(n,null,t,o,0,o.length-1)):null!==l&&P(l,0,l.length-1),i&&"svg"===s&&(i=!1)):(r=n["s-cr"])?r.parentNode.textContent=c:e.t!==c&&(n.data=c)},W=e=>{const t=e.childNodes;let n,l,o,s,i,c;for(l=0,o=t.length;l<o;l++)if(n=t[l],1===n.nodeType){if(n["s-sr"])for(i=n["s-sn"],n.hidden=!1,s=0;s<o;s++)if(c=t[s].nodeType,t[s]["s-hn"]!==n["s-hn"]||""!==i){if(1===c&&i===t[s].getAttribute("slot")){n.hidden=!0;break}}else if(1===c||3===c&&""!==t[s].textContent.trim()){n.hidden=!0;break}W(n)}},D=[],U=e=>{let t,n,l,s,i,c,r=0;const f=e.childNodes,u=f.length;for(;r<u;r++){if(t=f[r],t["s-sr"]&&(n=t["s-cr"])&&n.parentNode)for(l=n.parentNode.childNodes,s=t["s-sn"],c=l.length-1;c>=0;c--)n=l[c],n["s-cn"]||n["s-nr"]||n["s-hn"]===t["s-hn"]||(A(n,s)?(i=D.find((e=>e.g===n)),o=!0,n["s-sn"]=n["s-sn"]||s,i?i.k=t:D.push({k:t,g:n}),n["s-sr"]&&D.map((e=>{A(e.g,n["s-sn"])&&(i=D.find((e=>e.g===n)),i&&!e.k&&(e.k=i.k))}))):D.some((e=>e.g===n))||D.push({g:n}));1===t.nodeType&&U(t)}},A=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,F=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(F)},H=(e,t)=>{t&&!e.j&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.j=t)))},q=(e,t)=>{if(e.p|=16,!(4&e.p))return H(e,e.S),Se((()=>z(e,t)));e.p|=512},z=(e,t)=>{const n=e.O;let l;return t&&(e.p|=256,e.C&&(e.C.map((([e,t])=>J(n,e,t))),e.C=null),l=J(n,"componentWillLoad")),l=K(l,(()=>J(n,"componentWillRender"))),K(l,(()=>V(e,n,t)))},V=async(e,t,n)=>{const l=e.m,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.m,l=t.p,o=((e,t)=>{var n;let l=k(t);const o=de.get(l);if(e=11===e.nodeType?e:$e,o)if("string"==typeof o){let t,s=g.get(e=e.head||e);if(s||g.set(e,s=new Set),!s.has(l)){{t=$e.createElement("style"),t.innerHTML=o;const l=null!==(n=he.R)&&void 0!==n?n:a($e);null!=l&&t.setAttribute("nonce",l),e.insertBefore(t,e.querySelector("link"))}s&&s.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"),2&l&&n.classList.add(o+"-s"))})(e);_(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>B(e);0===t.length?n():(Promise.all(t).then(n),e.p|=4,t.length=0)}},_=(i,c)=>{try{c=c.render(),i.p&=-17,i.p|=2,((i,c)=>{const r=i.m,f=i.M,u=i.P||p(null,null),a=(e=>e&&e.$===$)(c)?c:d(null,null,c);if(n=r.tagName,f.T&&(a.l=a.l||{},f.T.map((([e,t])=>a.l[t]=r[e]))),a.$=null,a.p|=4,i.P=a,a.h=u.h=r.shadowRoot||r,e=r["s-sc"],t=r["s-cr"],l=0!=(1&f.p),o=!1,N(u,a),he.p|=1,s){let e,t,n,l,o,s;U(a.h);let i=0;for(;i<D.length;i++)e=D[i],t=e.g,t["s-ol"]||(n=$e.createTextNode(""),n["s-nr"]=t,t.parentNode.insertBefore(t["s-ol"]=n,t));for(i=0;i<D.length;i++)if(e=D[i],t=e.g,e.k){for(l=e.k.parentNode,o=e.k.nextSibling,n=t["s-ol"];n=n.previousSibling;)if(s=n["s-nr"],s&&s["s-sn"]===t["s-sn"]&&l===s.parentNode&&(s=s.nextSibling,!s||!s["s-nr"])){o=s;break}(!o&&l!==t.parentNode||t.nextSibling!==o)&&t!==o&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),l.insertBefore(t,o))}else 1===t.nodeType&&(t.hidden=!0)}o&&W(a.h),he.p&=-2,D.length=0})(i,c)}catch(e){fe(e,i.m)}return null},B=e=>{const t=e.m,n=e.O,l=e.S;J(n,"componentDidRender"),64&e.p?J(n,"componentDidUpdate"):(e.p|=64,Q(t),J(n,"componentDidLoad"),e.L(t),l||I()),e.N(t),e.j&&(e.j(),e.j=void 0),512&e.p&&je((()=>q(e,!1))),e.p&=-517},G=e=>{{const t=se(e),n=t.m.isConnected;return n&&2==(18&t.p)&&q(t,!1),n}},I=()=>{Q($e.documentElement),je((()=>w(pe,"appload",{detail:{namespace:"ezui"}})))},J=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){fe(e)}},K=(e,t)=>e&&e.then?e.then(t):t(),Q=e=>e.classList.add("hydrated"),X=(e,t,n)=>{if(t.W){e.watchers&&(t.D=e.watchers);const l=Object.entries(t.W),o=e.prototype;if(l.map((([e,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(o,e,{get(){return((e,t)=>se(this).U.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=se(e),s=o.m,i=o.U.get(t),c=o.p,r=o.O;if(n=((e,t)=>null==e||u(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.W[t][0]),(!(8&c)||void 0===i)&&n!==i&&(!Number.isNaN(i)||!Number.isNaN(n))&&(o.U.set(t,n),r)){if(l.D&&128&c){const e=l.D[t];e&&e.map((e=>{try{r[e](n,i,t)}catch(e){fe(e,s)}}))}2==(18&c)&&q(o,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(o,e,{value(...t){const n=se(this);return n.A.then((()=>n.O[e](...t)))}})})),1&n){const n=new Map;o.attributeChangedCallback=function(e,t,l){he.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(o.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const o=l[1]||e;return n.set(o,e),512&l[0]&&t.T.push([e,o]),o}))}}return e},Y=e=>{J(e,"connectedCallback")},Z=(e,t={})=>{var n;const l=[],o=t.exclude||[],s=pe.customElements,i=$e.head,c=i.querySelector("meta[charset]"),r=$e.createElement("style"),f=[];let u,d=!0;Object.assign(he,t),he.F=new URL(t.resourcesUrl||"./",$e.baseURI).href,e.map((e=>{e[1].map((t=>{const n={p:t[0],v:t[1],W:t[2],H:t[3]};n.W=t[2],n.H=t[3],n.T=[],n.D={};const i=n.v,c=class extends HTMLElement{constructor(e){super(e),ce(e=this,n),1&n.p&&e.attachShadow({mode:"open"})}connectedCallback(){u&&(clearTimeout(u),u=null),d?f.push(this):he.jmp((()=>(e=>{if(0==(1&he.p)){const t=se(e),n=t.M,l=()=>{};if(1&t.p)ee(e,t,n.H),Y(t.O);else{t.p|=1,12&n.p&&(e=>{const t=e["s-cr"]=$e.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)})(e);{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){H(t,t.S=n);break}}n.W&&Object.entries(n.W).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,o)=>{if(0==(32&t.p)){{if(t.p|=32,(o=ae(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(n.D=o.watchers,X(o,n,2),o.isProxied=!0);const e=()=>{};t.p|=8;try{new o(t)}catch(e){fe(e)}t.p&=-9,t.p|=128,e(),Y(t.O)}if(o.style){let e=o.style;const t=k(n);if(!de.has(t)){const l=()=>{};((e,t,n)=>{let l=de.get(e);ye&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,de.set(e,l)})(t,e,!!(1&n.p)),l()}}}const s=t.S,i=()=>q(t,!0);s&&s["s-rc"]?s["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){he.jmp((()=>(()=>{if(0==(1&he.p)){const e=se(this),t=e.O;e.q&&(e.q.map((e=>e())),e.q=void 0),J(t,"disconnectedCallback")}})()))}componentOnReady(){return se(this).V}};n._=e[0],o.includes(i)||s.get(i)||(l.push(i),s.define(i,X(c,n,1)))}))}));{r.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",r.setAttribute("data-styles","");const e=null!==(n=he.R)&&void 0!==n?n:a($e);null!=e&&r.setAttribute("nonce",e),i.insertBefore(r,c?c.nextSibling:i.firstChild)}d=!1,f.length?f.map((e=>e.connectedCallback())):he.jmp((()=>u=setTimeout(I,30)))},ee=(e,t,n)=>{n&&n.map((([n,l,o])=>{const s=e,i=te(t,o),c=ne(n);he.ael(s,l,i,c),(t.q=t.q||[]).push((()=>he.rel(s,l,i,c)))}))},te=(e,t)=>n=>{try{256&e.p?e.O[t](n):(e.C=e.C||[]).push([t,n])}catch(e){fe(e)}},ne=e=>0!=(2&e),le=e=>he.R=e,oe=new WeakMap,se=e=>oe.get(e),ie=(e,t)=>oe.set(t.O=e,t),ce=(e,t)=>{const n={p:0,m:e,M:t,U:new Map};return n.A=new Promise((e=>n.N=e)),n.V=new Promise((e=>n.L=e)),e["s-p"]=[],e["s-rc"]=[],ee(e,n,t.H),oe.set(e,n)},re=(e,t)=>t in e,fe=(e,t)=>(0,console.error)(e,t),ue=new Map,ae=e=>{const t=e.v.replace(/-/g,"_"),n=e._,l=ue.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(ue.set(n,e),e[t])),fe)
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},de=new Map,pe="undefined"!=typeof window?window:{},$e=pe.document||{head:{}},he={p:0,F:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},me=e=>Promise.resolve(e),ye=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),be=[],ve=[],we=(e,t)=>n=>{e.push(n),
|
|
1
|
+
let e,t,n,l=!1,o=!1,s=!1,i=!1,r=!1;const c="http://www.w3.org/1999/xlink",f={},u=e=>"object"==(e=typeof e)||"function"===e;function a(e){var t,n,l;return null!==(l=null===(n=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===n?void 0:n.getAttribute("content"))&&void 0!==l?l:void 0}const d=(e,t,...n)=>{let l=null,o=null,s=null,i=!1,r=!1;const c=[],f=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?f(l):null!=l&&"boolean"!=typeof l&&((i="function"!=typeof e&&!u(l))&&(l+=""),i&&r?c[c.length-1].t+=l:c.push(i?p(null,l):l),r=i)};if(f(n),t){t.key&&(o=t.key),t.name&&(s=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,c,h);const a=p(e,null);return a.l=t,c.length>0&&(a.o=c),a.i=o,a.u=s,a},p=(e,t)=>({p:0,$:e,t,h:null,o:null,l:null,i:null,u:null}),$={},h={forEach:(e,t)=>e.map(m).forEach(t),map:(e,t)=>e.map(m).map(t).map(y)},m=e=>({vattrs:e.l,vchildren:e.o,vkey:e.i,vname:e.u,vtag:e.$,vtext:e.t}),y=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),d(e.vtag,t,...e.vchildren||[])}const t=p(e.vtag,e.vtext);return t.l=e.vattrs,t.o=e.vchildren,t.i=e.vkey,t.u=e.vname,t},b=e=>se(e).m,v=(e,t,n)=>{const l=b(e);return{emit:e=>w(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},w=(e,t,n)=>{const l=he.ce(t,n);return e.dispatchEvent(l),l},g=new WeakMap,k=e=>"sc-"+e.v,j=(e,t,n,l,o,s)=>{if(n!==l){let i=ce(e,t),r=t.toLowerCase();if("class"===t){const t=e.classList,o=O(n),s=O(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const f=u(l);if((i||f&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}let a=!1;r!==(r=r.replace(/^xlink\:?/,""))&&(t=r,a=!0),null==l||!1===l?!1===l&&""!==e.getAttribute(t)||(a?e.removeAttributeNS(c,t):e.removeAttribute(t)):(!i||4&s||o)&&!f&&(l=!0===l?"":l,a?e.setAttributeNS(c,t,l):e.setAttribute(t,l))}else t="-"===t[2]?t.slice(3):ce(pe,r)?r.slice(2):r[2]+t.slice(3),n&&he.rel(e,t,n,!1),l&&he.ael(e,t,l,!1)}},S=/\s/,O=e=>e?e.split(S):[],C=(e,t,n,l)=>{const o=11===t.h.nodeType&&t.h.host?t.h.host:t.h,s=e&&e.l||f,i=t.l||f;for(l in s)l in i||j(o,l,s[l],void 0,n,t.p);for(l in i)j(o,l,s[l],i[l],n,t.p)},M=(o,r,c,f)=>{const u=r.o[c];let a,d,p,$=0;if(l||(s=!0,"slot"===u.$&&(e&&f.classList.add(e+"-s"),u.p|=u.o?2:1)),null!==u.t)a=u.h=$e.createTextNode(u.t);else if(1&u.p)a=u.h=$e.createTextNode("");else{if(i||(i="svg"===u.$),a=u.h=$e.createElementNS(i?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&u.p?"slot-fb":u.$),i&&"foreignObject"===u.$&&(i=!1),C(null,u,i),null!=e&&a["s-si"]!==e&&a.classList.add(a["s-si"]=e),u.o)for($=0;$<u.o.length;++$)d=M(o,u,$,a),d&&a.appendChild(d);"svg"===u.$?i=!1:"foreignObject"===a.tagName&&(i=!0)}return a["s-hn"]=n,3&u.p&&(a["s-sr"]=!0,a["s-cr"]=t,a["s-sn"]=u.u||"",p=o&&o.o&&o.o[c],p&&p.$===u.$&&o.h&&x(o.h,!1)),a},x=(e,t)=>{he.p|=1;const l=e.childNodes;for(let e=l.length-1;e>=0;e--){const o=l[e];o["s-hn"]!==n&&o["s-ol"]&&(L(o).insertBefore(o,E(o)),o["s-ol"].remove(),o["s-ol"]=void 0,s=!0),t&&x(o,t)}he.p&=-2},R=(e,t,l,o,s,i)=>{let r,c=e["s-cr"]&&e["s-cr"].parentNode||e;for(c.shadowRoot&&c.tagName===n&&(c=c.shadowRoot);s<=i;++s)o[s]&&(r=M(null,l,s,e),r&&(o[s].h=r,c.insertBefore(r,E(t))))},P=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.h,F(l),o=!0,s["s-ol"]?s["s-ol"].remove():x(s,!0),s.remove())},T=(e,t)=>e.$===t.$&&("slot"===e.$?e.u===t.u:e.i===t.i),E=e=>e&&e["s-ol"]||e,L=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,N=(e,t)=>{const n=t.h=e.h,l=e.o,o=t.o,s=t.$,r=t.t;let c;null===r?(i="svg"===s||"foreignObject"!==s&&i,"slot"===s||C(e,t,i),null!==l&&null!==o?((e,t,n,l)=>{let o,s,i=0,r=0,c=0,f=0,u=t.length-1,a=t[0],d=t[u],p=l.length-1,$=l[0],h=l[p];for(;i<=u&&r<=p;)if(null==a)a=t[++i];else if(null==d)d=t[--u];else if(null==$)$=l[++r];else if(null==h)h=l[--p];else if(T(a,$))N(a,$),a=t[++i],$=l[++r];else if(T(d,h))N(d,h),d=t[--u],h=l[--p];else if(T(a,h))"slot"!==a.$&&"slot"!==h.$||x(a.h.parentNode,!1),N(a,h),e.insertBefore(a.h,d.h.nextSibling),a=t[++i],h=l[--p];else if(T(d,$))"slot"!==a.$&&"slot"!==h.$||x(d.h.parentNode,!1),N(d,$),e.insertBefore(d.h,a.h),d=t[--u],$=l[++r];else{for(c=-1,f=i;f<=u;++f)if(t[f]&&null!==t[f].i&&t[f].i===$.i){c=f;break}c>=0?(s=t[c],s.$!==$.$?o=M(t&&t[r],n,c,e):(N(s,$),t[c]=void 0,o=s.h),$=l[++r]):(o=M(t&&t[r],n,r,e),$=l[++r]),o&&L(a.h).insertBefore(o,E(a.h))}i>u?R(e,null==l[p+1]?null:l[p+1].h,n,l,r,p):r>p&&P(t,i,u)})(n,l,t,o):null!==o?(null!==e.t&&(n.textContent=""),R(n,null,t,o,0,o.length-1)):null!==l&&P(l,0,l.length-1),i&&"svg"===s&&(i=!1)):(c=n["s-cr"])?c.parentNode.textContent=r:e.t!==r&&(n.data=r)},W=e=>{const t=e.childNodes;let n,l,o,s,i,r;for(l=0,o=t.length;l<o;l++)if(n=t[l],1===n.nodeType){if(n["s-sr"])for(i=n["s-sn"],n.hidden=!1,s=0;s<o;s++)if(r=t[s].nodeType,t[s]["s-hn"]!==n["s-hn"]||""!==i){if(1===r&&i===t[s].getAttribute("slot")){n.hidden=!0;break}}else if(1===r||3===r&&""!==t[s].textContent.trim()){n.hidden=!0;break}W(n)}},D=[],U=e=>{let t,n,l,s,i,r,c=0;const f=e.childNodes,u=f.length;for(;c<u;c++){if(t=f[c],t["s-sr"]&&(n=t["s-cr"])&&n.parentNode)for(l=n.parentNode.childNodes,s=t["s-sn"],r=l.length-1;r>=0;r--)n=l[r],n["s-cn"]||n["s-nr"]||n["s-hn"]===t["s-hn"]||(A(n,s)?(i=D.find((e=>e.g===n)),o=!0,n["s-sn"]=n["s-sn"]||s,i?i.k=t:D.push({k:t,g:n}),n["s-sr"]&&D.map((e=>{A(e.g,n["s-sn"])&&(i=D.find((e=>e.g===n)),i&&!e.k&&(e.k=i.k))}))):D.some((e=>e.g===n))||D.push({g:n}));1===t.nodeType&&U(t)}},A=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,F=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(F)},H=(e,t)=>{t&&!e.j&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.j=t)))},q=(e,t)=>{if(e.p|=16,!(4&e.p))return H(e,e.S),Se((()=>z(e,t)));e.p|=512},z=(e,t)=>{const n=e.O;let l;return t&&(e.p|=256,e.C&&(e.C.map((([e,t])=>J(n,e,t))),e.C=null),l=J(n,"componentWillLoad")),l=K(l,(()=>J(n,"componentWillRender"))),K(l,(()=>V(e,n,t)))},V=async(e,t,n)=>{const l=e.m,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.m,l=t.p,o=((e,t)=>{var n;let l=k(t);const o=de.get(l);if(e=11===e.nodeType?e:$e,o)if("string"==typeof o){let t,s=g.get(e=e.head||e);if(s||g.set(e,s=new Set),!s.has(l)){{t=$e.createElement("style"),t.innerHTML=o;const l=null!==(n=he.R)&&void 0!==n?n:a($e);null!=l&&t.setAttribute("nonce",l),e.insertBefore(t,e.querySelector("link"))}s&&s.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"),2&l&&n.classList.add(o+"-s"))})(e);_(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>B(e);0===t.length?n():(Promise.all(t).then(n),e.p|=4,t.length=0)}},_=(i,r)=>{try{r=r.render(),i.p&=-17,i.p|=2,((i,r)=>{const c=i.m,f=i.M,u=i.P||p(null,null),a=(e=>e&&e.$===$)(r)?r:d(null,null,r);if(n=c.tagName,f.T&&(a.l=a.l||{},f.T.map((([e,t])=>a.l[t]=c[e]))),a.$=null,a.p|=4,i.P=a,a.h=u.h=c.shadowRoot||c,e=c["s-sc"],t=c["s-cr"],l=0!=(1&f.p),o=!1,N(u,a),he.p|=1,s){let e,t,n,l,o,s;U(a.h);let i=0;for(;i<D.length;i++)e=D[i],t=e.g,t["s-ol"]||(n=$e.createTextNode(""),n["s-nr"]=t,t.parentNode.insertBefore(t["s-ol"]=n,t));for(i=0;i<D.length;i++)if(e=D[i],t=e.g,e.k){for(l=e.k.parentNode,o=e.k.nextSibling,n=t["s-ol"];n=n.previousSibling;)if(s=n["s-nr"],s&&s["s-sn"]===t["s-sn"]&&l===s.parentNode&&(s=s.nextSibling,!s||!s["s-nr"])){o=s;break}(!o&&l!==t.parentNode||t.nextSibling!==o)&&t!==o&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),l.insertBefore(t,o))}else 1===t.nodeType&&(t.hidden=!0)}o&&W(a.h),he.p&=-2,D.length=0})(i,r)}catch(e){fe(e,i.m)}return null},B=e=>{const t=e.m,n=e.O,l=e.S;J(n,"componentDidRender"),64&e.p?J(n,"componentDidUpdate"):(e.p|=64,Q(t),J(n,"componentDidLoad"),e.L(t),l||I()),e.N(t),e.j&&(e.j(),e.j=void 0),512&e.p&&je((()=>q(e,!1))),e.p&=-517},G=e=>{{const t=se(e),n=t.m.isConnected;return n&&2==(18&t.p)&&q(t,!1),n}},I=()=>{Q($e.documentElement),je((()=>w(pe,"appload",{detail:{namespace:"ezui"}})))},J=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){fe(e)}},K=(e,t)=>e&&e.then?e.then(t):t(),Q=e=>e.classList.add("hydrated"),X=(e,t,n)=>{if(t.W){e.watchers&&(t.D=e.watchers);const l=Object.entries(t.W),o=e.prototype;if(l.map((([e,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(o,e,{get(){return((e,t)=>se(this).U.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=se(e),s=o.m,i=o.U.get(t),r=o.p,c=o.O;if(n=((e,t)=>null==e||u(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.W[t][0]),(!(8&r)||void 0===i)&&n!==i&&(!Number.isNaN(i)||!Number.isNaN(n))&&(o.U.set(t,n),c)){if(l.D&&128&r){const e=l.D[t];e&&e.map((e=>{try{c[e](n,i,t)}catch(e){fe(e,s)}}))}if(2==(18&r)){if(c.componentShouldUpdate&&!1===c.componentShouldUpdate(n,i,t))return;q(o,!1)}}})(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(o,e,{value(...t){const n=se(this);return n.A.then((()=>n.O[e](...t)))}})})),1&n){const n=new Map;o.attributeChangedCallback=function(e,t,l){he.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(o.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const o=l[1]||e;return n.set(o,e),512&l[0]&&t.T.push([e,o]),o}))}}return e},Y=e=>{J(e,"connectedCallback")},Z=(e,t={})=>{var n;const l=[],o=t.exclude||[],s=pe.customElements,i=$e.head,r=i.querySelector("meta[charset]"),c=$e.createElement("style"),f=[];let u,d=!0;Object.assign(he,t),he.F=new URL(t.resourcesUrl||"./",$e.baseURI).href,e.map((e=>{e[1].map((t=>{const n={p:t[0],v:t[1],W:t[2],H:t[3]};n.W=t[2],n.H=t[3],n.T=[],n.D={};const i=n.v,r=class extends HTMLElement{constructor(e){super(e),re(e=this,n),1&n.p&&e.attachShadow({mode:"open"})}connectedCallback(){u&&(clearTimeout(u),u=null),d?f.push(this):he.jmp((()=>(e=>{if(0==(1&he.p)){const t=se(e),n=t.M,l=()=>{};if(1&t.p)ee(e,t,n.H),Y(t.O);else{t.p|=1,12&n.p&&(e=>{const t=e["s-cr"]=$e.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)})(e);{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){H(t,t.S=n);break}}n.W&&Object.entries(n.W).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,o)=>{if(0==(32&t.p)){{if(t.p|=32,(o=ae(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(n.D=o.watchers,X(o,n,2),o.isProxied=!0);const e=()=>{};t.p|=8;try{new o(t)}catch(e){fe(e)}t.p&=-9,t.p|=128,e(),Y(t.O)}if(o.style){let e=o.style;const t=k(n);if(!de.has(t)){const l=()=>{};((e,t,n)=>{let l=de.get(e);ye&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,de.set(e,l)})(t,e,!!(1&n.p)),l()}}}const s=t.S,i=()=>q(t,!0);s&&s["s-rc"]?s["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){he.jmp((()=>(()=>{if(0==(1&he.p)){const e=se(this),t=e.O;e.q&&(e.q.map((e=>e())),e.q=void 0),J(t,"disconnectedCallback")}})()))}componentOnReady(){return se(this).V}};n._=e[0],o.includes(i)||s.get(i)||(l.push(i),s.define(i,X(r,n,1)))}))}));{c.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",c.setAttribute("data-styles","");const e=null!==(n=he.R)&&void 0!==n?n:a($e);null!=e&&c.setAttribute("nonce",e),i.insertBefore(c,r?r.nextSibling:i.firstChild)}d=!1,f.length?f.map((e=>e.connectedCallback())):he.jmp((()=>u=setTimeout(I,30)))},ee=(e,t,n)=>{n&&n.map((([n,l,o])=>{const s=e,i=te(t,o),r=ne(n);he.ael(s,l,i,r),(t.q=t.q||[]).push((()=>he.rel(s,l,i,r)))}))},te=(e,t)=>n=>{try{256&e.p?e.O[t](n):(e.C=e.C||[]).push([t,n])}catch(e){fe(e)}},ne=e=>0!=(2&e),le=e=>he.R=e,oe=new WeakMap,se=e=>oe.get(e),ie=(e,t)=>oe.set(t.O=e,t),re=(e,t)=>{const n={p:0,m:e,M:t,U:new Map};return n.A=new Promise((e=>n.N=e)),n.V=new Promise((e=>n.L=e)),e["s-p"]=[],e["s-rc"]=[],ee(e,n,t.H),oe.set(e,n)},ce=(e,t)=>t in e,fe=(e,t)=>(0,console.error)(e,t),ue=new Map,ae=e=>{const t=e.v.replace(/-/g,"_"),n=e._,l=ue.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(ue.set(n,e),e[t])),fe)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},de=new Map,pe="undefined"!=typeof window?window:{},$e=pe.document||{head:{}},he={p:0,F:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},me=e=>Promise.resolve(e),ye=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),be=[],ve=[],we=(e,t)=>n=>{e.push(n),r||(r=!0,t&&4&he.p?je(ke):he.raf(ke))},ge=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){fe(e)}e.length=0},ke=()=>{ge(be),ge(ve),(r=be.length>0)&&he.raf(ke)},je=e=>me().then(e),Se=we(ve,!0);export{$ as H,Z as b,v as c,G as f,b as g,d as h,me as p,ie as r,le as s}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as i,H as o}from"./p-
|
|
1
|
+
import{r as t,h as i,H as o}from"./p-00ea9b50.js";const r=class{constructor(i){t(this,i),this._showLoading=!0}async hide(){this._showLoading=!1}async show(){this._showLoading=!0}render(){return i(o,null,this._showLoading&&i("div",{class:"loading-bar"},i("div",{class:"loading-bar__container"})))}};r.style=":host{position:fixed;top:0px;width:100%}.loading-bar{width:100%;margin:0 auto;position:absolute;background-color:var(--color--primary-300, #e2f4ef);height:5px}.loading-bar:before{content:'';position:absolute}.loading-bar__container{position:absolute;top:0;right:100%;bottom:0;left:0;background-color:var(--color--primary, #008561);width:0;animation:loading 2s linear infinite}@keyframes loading{0%{left:0%;right:100%;width:0%}25%{left:0%;right:75%;width:25%}50%{left:0%;right:50%;width:90%}70%{right:0%;left:75%;width:25%}100%{left:100%;right:0%;width:0%}}@-webkit-keyframes loading{0%{left:0%;right:100%;width:0%}25%{left:0%;right:75%;width:25%}50%{left:0%;right:50%;width:90%}70%{right:0%;left:75%;width:25%}100%{left:100%;right:0%;width:0%}}";export{r as ez_loading_bar}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,h as a,H as e,g as t}from"./p-
|
|
1
|
+
import{r,h as a,H as e,g as t}from"./p-00ea9b50.js";import{ElementIDUtils as o}from"@sankhyalabs/core";const c={warn:"warning_triangle",critical:"close",success:"check"},n=class{constructor(a){r(this,a),this.alertType="success"}componentWillRender(){this.dataElementId=o.addIDInfo(this._element)}render(){return a(e,null,a("div",{class:`alert-container ${this.alertType}`},a("div",null,a("ez-icon",Object.assign({},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:this.dataElementId},{class:`alert-container__icon-${this.alertType}`,size:"large",iconName:c[this.alertType]}))),a("div",Object.assign({},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${this.dataElementId}_text`}),a("slot",null))))}get _element(){return t(this)}};n.style=':host{--ez-alert-alert-container--padding-up-down:var(--space--small, 6px);--ez-alert-alert-container--padding-right-left:var(--space--medium, 12px);--ez-alert-alert-container--gap:var(--space--medium, 12px);--ez-alert-alert-container--border-radius:var(--border--radius-medium, 12px);--ez-alert-alert-container--font-color-warn:var(--color--alert-warning-900, #8C6B00);--ez-alert-alert-container--icon-warn:var(--color--alert-warning-900, #8C6B00);--ez-alert-alert-container--background-color-warn:var(--color--alert-warning-200, #FFF7D5);--ez-alert-alert-container--font-color-critical:var(--color--alert-error, #BD0025);--ez-alert-alert-container--icon-critical:var(--color--alert-error, #BD0025);--ez-alert-alert-container--background-color-critical:var(--color--alert-error-200, #F7E0E5);--ez-alert-alert-container--font-color-success:var(--color--alert-success, #157A00);--ez-alert-alert-container--icon-success:var(--color--alert-success, #157A00);--ez-alert-alert-container--background-color-success:var(--color--alert-success-200, #E7F6E0);font-size:var(--text--small, 12px);font-family:var(--font-pattern, "Roboto");width:100%;hyphens:auto;display:block}.alert-container{display:flex;align-items:center;gap:var(--ez-alert-alert-container--gap);padding:var(--ez-alert-alert-container--padding-up-down) var(--ez-alert-alert-container--padding-right-left);border-radius:var(--ez-alert-alert-container--border-radius)}.warn{background-color:var(--ez-alert-alert-container--background-color-warn);color:var(--ez-alert-alert-container--font-color-warn)}.critical{background-color:var(--ez-alert-alert-container--background-color-critical);color:var(--ez-alert-alert-container--font-color-critical)}.success{background-color:var(--ez-alert-alert-container--background-color-success);color:var(--ez-alert-alert-container--font-color-success)}ez-icon{--ez-icon--color:inherit}.alert-container__icon-warn{--ez-icon--color:var(--ez-alert-alert-container--icon-warn)}.alert-container__icon-critical{--ez-icon--color:var(--ez-alert-alert-container--icon-critical)}.alert-container__icon-success{--ez-icon--color:var(--ez-alert-alert-container--icon-success)}';export{n as ez_alert}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as a}from"./p-
|
|
1
|
+
import{r as t,c as i,h as s,H as e,g as a}from"./p-00ea9b50.js";import{ElementIDUtils as o,StringUtils as r}from"@sankhyalabs/core";const n=class{constructor(s){t(this,s),this.ezChange=i(this,"ezChange",7),this.setFocusedParam=t=>{if("Enter"===t.key){const i=this._processedTabs[this._focusedIndex];this.handleTabClick(i),t.preventDefault(),this.setFocusedTab(i.index)}else if("ArrowLeft"===t.key||"ArrowRight"===t.key){let i;if("ArrowLeft"===t.key)i=!1;else{if("ArrowRight"!==t.key)return;i=!0}this._focusedIndex=void 0===this._focusedIndex?!1===i?void 0!==this.selectedIndex?this.selectedIndex-1:void 0:void 0!==this.selectedIndex?this.selectedIndex+1:void 0:!1===i?this._focusedIndex-1:this._focusedIndex+1,this._focusedIndex<0?this._focusedIndex=0:this._focusedIndex>this._processedTabs.length-1&&(this._focusedIndex=this._processedTabs.length-1),this.setFocusedBtn(!0,this._focusedIndex),this.setFocusedTab(this._focusedIndex)}else if("Tab"===t.key||"Escape"===t.key){const i=this._processedTabs[this.selectedIndex];this._focusedIndex=void 0,this.handleTabClick(i),t.preventDefault(),this.setFocusedTab(this.selectedIndex)}},this._processedTabs=void 0,this.selectedIndex=void 0,this.selectedTab=void 0,this.tabs=void 0}observeTabs(t){t&&"string"!=typeof t&&(this._processedTabs=t)}handleTabClick(t){this.selectedIndex=t.index,this._focusedIndex=void 0,this.selectedTab=t.tabKey,this.ezChange.emit(t),this.setFocusedBtn(!1,t.index)}componentWillRender(){this._processedTabs||(this.tabs&&(Array.isArray(this.tabs)?this._processedTabs=[...this.tabs]:(this._processedTabs=[],this.tabs.split(",").forEach((t=>{t=t.trim(),this._processedTabs.push({label:t,tabKey:t,index:this._processedTabs.length}),this.buildElementIdTab(this._processedTabs)})))),this._hostElem.querySelectorAll("ez-tab").forEach((t=>{const i=t.getAttribute("tabKey"),s={label:t.getAttribute("label"),tabKey:i,leftIcon:t.getAttribute("leftIcon"),rightIcon:t.getAttribute("rightIcon"),index:this._processedTabs.length},e=t.firstChild;e&&(e.setAttribute("slot","tab"+s.index),this._hostElem.appendChild(e)),this._processedTabs.push(s),this.buildElementIdTab(this._processedTabs)})))}componentDidRender(){this.updateScroll()}componentDidLoad(){o.addIDInfo(this._hostElem,"itemsSelector"),this._hostElem.shadowRoot.querySelectorAll('button[name="tab-button"]').forEach((t=>{var i;const s=null===(i=t.querySelector("span.tab-label"))||void 0===i?void 0:i.innerText,e={id:`${r.toCamelCase(s)}`};o.addIDInfo(t,"itemSelector",e)}))}handleSlotChange(t){const i=t.target.assignedElements()[0];i&&(i.style.marginLeft="6px")}scrollBackward(){const t=this._scrollContainer;t&&(t.scrollLeft-=t.clientWidth)}scrollFoward(){const t=this._scrollContainer;if(t){let i=null;t.querySelectorAll(".tab").forEach((s=>{s.getBoundingClientRect().right<t.clientWidth&&(i=s)})),t.scrollLeft=i.offsetLeft+i.offsetWidth}}updateScroll(){const t=this._scrollContainer;if(t){const{scrollWidth:i,clientWidth:s,scrollLeft:e}=t,a=i-s-Math.ceil(e);this._startHidden=t.scrollLeft>0,this._endHidden=a>0,this._startHidden?this._backwardButton.classList.remove("hidden"):this._backwardButton.classList.add("hidden"),this._endHidden?this._forwardButton.classList.remove("hidden"):this._forwardButton.classList.add("hidden");const o=["","startHidden","endHidden","middle"],r=o[Number(this._startHidden)|Number(this._endHidden)<<1];o.forEach((i=>{i!==r&&t.classList.contains(i)&&t.classList.remove(i)})),r&&!t.classList.contains(r)&&t.classList.add(r)}}domScrollHandler(){window.clearTimeout(this._scrollCallBack),this._scrollCallBack=window.setTimeout((()=>{this.updateScroll()}),200)}setFocusedTab(t){window.clearTimeout(this._scrollCallBackTest),this._scrollCallBackTest=window.setTimeout((()=>{this._scrollContainer.querySelector(`#tab${t}`).scrollIntoView()}),200)}getTextWidth(t){void 0===this._textMesurement&&(this._textMesurement=this._hostElem.shadowRoot.ownerDocument.createElement("canvas"));const i=this._textMesurement.getContext("2d");return i.font="14px Sora, Algerian",Math.min(220,24+i.measureText(t).width)+"px"}setFocusedBtn(t,i){this._scrollContainer.querySelectorAll(".tab").forEach((s=>{s.classList.remove("is-focused"),s.id==="tab"+i&&t&&s.classList.add("is-focused")}))}buildElementIdTab(t){t.forEach((t=>{if(!t.hasOwnProperty(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME)){const i=`${this._hostElem.getAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME)}_${r.toCamelCase(t.tabKey)}`;t[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=i}}))}render(){return s(e,null,s("button",{class:"backward-button",ref:t=>this._backwardButton=t,onClick:()=>this.scrollBackward()}),s("div",{class:"scroll",ref:t=>this._scrollContainer=t,onScroll:()=>this.domScrollHandler(),onKeyDown:t=>this.setFocusedParam(t)},this._processedTabs.map(((t,i)=>{const e={"min-width":this.getTextWidth(t.label)},a="tab"+i,o=i===this.selectedIndex||this.selectedTab&&t.tabKey===this.selectedTab;return o&&(this.selectedTab=t.tabKey,this.selectedIndex=i),s("button",{id:a,name:"tab-button",class:"tab"+(o?" is-active":""),onClick:()=>this.handleTabClick(t),style:e},t.leftIcon&&s("ez-icon",{iconName:t.leftIcon,class:"left-icon"}),s("span",{class:"tab-label",title:t.label},t.label),t.rightIcon&&s("ez-icon",{iconName:t.rightIcon,class:"right-icon"}),s("slot",{name:a,onSlotchange:t=>{this.handleSlotChange(t)}}))}))),s("button",{class:"forward-button",ref:t=>this._forwardButton=t,onClick:()=>this.scrollFoward()}))}get _hostElem(){return a(this)}static get watchers(){return{tabs:["observeTabs"]}}};n.style='@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}:host{display:flex;position:relative;width:100%;overflow:hidden;--tabselector--backward-icon:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z"/></svg>\');--tabselector--forward-icon:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z"/></svg>\')}.scroll{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.scroll.startHidden{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px)}.scroll.middle{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px))}.scroll.endHidden{-webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab{display:flex;border:none;min-width:100px;background-color:unset;cursor:pointer;padding:6px 12px;align-items:center;justify-content:center;color:var(--text--primary, #626e82);font-family:var(--font-pattern, "Roboto");font-size:var(--title--small, 14px)}.tab:focus,.forward-button,.backward-button{outline:none}.is-active{position:relative;color:var(--color--primary, #008561)}.is-active::after{content:"";position:absolute;width:100%;height:100%;background-color:var(--color--primary, #008561);clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out}.is-focused{border:1px dashed var(--color--primary, #000000c5)}.tab-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--text-shadow);margin-bottom:var(--space--extra-small, 3px)}.forward-button,.backward-button{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.backward-button{left:0px}.forward-button::after,.backward-button::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:10px;height:16px}.forward-button::after{-webkit-mask-image:var(--tabselector--forward-icon);mask-image:var(--tabselector--forward-icon)}.backward-button::after{-webkit-mask-image:var(--tabselector--backward-icon);mask-image:var(--tabselector--backward-icon)}.forward-button:hover::after,.backward-button:hover::after{background-color:var(--color--primary, #4e4e4e)}.hidden{display:none}.scroll::-webkit-scrollbar{display:none}.left-icon{padding-right:var(--space--small)}.right-icon{padding-left:var(--space--small)}';export{n as ez_tabselector}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,H as e,g as h}from"./p-
|
|
1
|
+
import{r as t,c as s,h as i,H as e,g as h}from"./p-00ea9b50.js";import{TimeFormatter as r,MaskFormatter as a,NumberUtils as o,ElementIDUtils as n}from"@sankhyalabs/core";import{C as l}from"./p-4a5e37a7.js";const u=class{constructor(i){t(this,i),this.ezChange=s(this,"ezChange",7),this.ezStartChange=s(this,"ezStartChange",7),this.ezCancelWaitingChange=s(this,"ezCancelWaitingChange",7),this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.showSeconds=!1,this.mode="regular"}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())||(this.prepareValue(this._viewValue),(this._textInput.value||"")!==this._viewValue&&(this._textInput.value=this._viewValue)))}observeShowSeconds(){this.prepareMask(this.showSeconds?"##:##:##":"##:##")}observeValue(t,s){if(this._textInput&&t!=s){let i=this.validateValue(t);i!=this.validateValue(s)&&(this._viewValue=null==i?"":i.toString(),this.prepareValue(this._viewValue),this._viewValue&&!r.validateTime(this._viewValue,this.showSeconds)?(this.setError("Favor inserir um horário válido."),i=void 0):this.setError(""),this.ezChange.emit(null===i?void 0:i))}}prepareMask(t){null==this._maskFormatter?this._maskFormatter=new a(t):this._maskFormatter.mask=t}validateValue(t){return isNaN(t)||void 0===t?null:t}setError(t){this.errorMessage=t,this._textInput&&(null==t?void 0:t.trim())&&this.ezCancelWaitingChange.emit()}getViewValue(){return this._viewValue}prepareValue(t){try{this._viewValue=r.prepareValue(t,this.showSeconds),this._textInput&&this._textInput.value!==this._viewValue&&(this._textInput.value=this._viewValue)}catch(t){this.setError(t.message)}}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}handleBlur(){this._textInput&&(this._viewValue=this._textInput.value,this.prepareValue(this._viewValue),this.value=o.stringToNumber(this._viewValue.replace(/\D/g,"")))}handleInput(){o.stringToNumber(this._textInput.value.replace(/\D/g,""))!==this.value&&this.ezStartChange.emit({waitmessage:"",blocking:!1})}componentDidLoad(){l.applyVarsTextInput(this._elem,this._textInput)}componentWillLoad(){this.observeShowSeconds(),this.value?this.prepareValue(this.value.toString()):this._viewValue&&this.prepareValue(this._viewValue)}render(){return n.addIDInfoIfNotExists(this._elem,"input"),i(e,null,i("ez-text-input",{"data-element-id":n.getInternalIDInfo("textInput"),ref:t=>this._textInput=t,"data-slave-mode":"true",value:this._viewValue,enabled:this.enabled,label:this.label,restrict:"0123456789:",onBlur:()=>this.handleBlur(),onInput:()=>this.handleInput(),errorMessage:this.errorMessage,mode:this.mode},i("ez-icon",{slot:"leftIcon",iconName:"timer-outline"})))}static get assetsDirs(){return["../assets"]}get _elem(){return h(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],showSeconds:["observeShowSeconds"],value:["observeValue"]}}};u.style=":host{display:flex;flex-wrap:wrap;position:relative;width:100%}";export{u as ez_time_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as i,h as t,g as r}from"./p-
|
|
1
|
+
import{r as e,c as i,h as t,g as r}from"./p-00ea9b50.js";import{StringUtils as o,ElementIDUtils as l}from"@sankhyalabs/core";const s=class{constructor(t){e(this,t),this.ezClick=i(this,"ezClick",7),this.ezRemove=i(this,"ezRemove",7),this.canRemove=!0,this.fileName=void 0,this.iconName=void 0,this.fileSize=void 0,this.progress=100}observeProgress(e){if(e<0||e>100)throw new Error("O progresso de upload deve ser um número entre 0 e 100.");this._element.style.setProperty("--ez-file-item--upload-progress",100-e+"%")}getFileSize(){return this.fileSize&&0!==this.fileSize?`(${o.formatBytes(this.fileSize)})`:""}getIconName(){let e;if(this.iconName)return this.iconName;if(this.fileName.indexOf(".")>-1){const i=this.fileName.lastIndexOf(".");e=this.fileName.substring(i)}return a[e]||n}render(){return this._element.title=`${this.fileName} ${this.getFileSize()}`,l.addIDInfoIfNotExists(this._element,"ezFileIcon"),t("div",{class:"box",onClick:()=>this.ezClick.emit(this.fileName)},t("div",{class:"content"},t("ez-icon",{"data-element-id":l.getInternalIDInfo("fileIcon"),class:"file-type-icon",size:"medium","icon-name":this.getIconName()}),t("label",{class:"file-name"},this.fileName),t("label",{class:"file-size"},this.getFileSize())),this.canRemove?t("ez-icon",{"data-element-id":l.getInternalIDInfo("remove"),class:"btn-remove",size:"medium","icon-name":"close",onClick:e=>{this.ezRemove.emit(this.fileName),e.stopPropagation()}}):void 0)}get _element(){return r(this)}static get watchers(){return{progress:["observeProgress"]}}},a={".exe":"exe",".gif":"gif",".mp3":"mp3",".mp4":"mp4",".pdf":"pdf",".png":"png",".txt":"txt",".zip":"zip",".docx":"docx",".xlsx":"xlsx",".pptx":"pptx"},n="generic";s.style=':host{display:flex;width:100%;--ez-file-item--height:42px;--ez-file-item--padding:9px;--ez-file-item--border-radius:var(--border--radius-medium, 12px);--ez-file-item--border-color:var(--color--strokes, #DCE0E8);--ez-file-item--border-style:var(--border--small, 1px solid);--ez-file-item--font-family:var(--font-pattern, Arial);--ez-file-item--font-size:var(--text--medium, 14px);--ez-file-item--font-weight:var(--text-weight--medium, 400);--ez-file-item--color:var(--title--primary, #2B3A54);--ez-file-item__file-size--font-weight:var(--text-weight--large, 600);--ez-file-item__file-size--color:var(--color--primary, #008561);--ez-file-item__background-progress--color:var(--color--primary-300, E2F4EF);--ez-file-item--icon-color:var(--title--primary, #2B3A54)}.box{display:flex;box-sizing:border-box;position:relative;align-items:center;justify-content:space-between;width:100%;padding:var(--ez-file-item--padding);border:var(--ez-file-item--border-color) var(--ez-file-item--border-style);border-radius:var(--ez-file-item--border-radius);height:var(--ez-file-item--height)}.box::before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;clip-path:inset(2px calc(var(--ez-file-item--upload-progress, 0%) + 2px) 2px 2px round calc(var(--ez-file-item--border-radius) - 4px));background-color:var(--ez-file-item__background-progress--color)}.content{display:flex;align-items:center;z-index:0;overflow:hidden}.file-name{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-family:var(--ez-file-item--font-family);font-size:var(--ez-file-item--font-size);font-weight:var(--ez-file-item--font-weight);color:var(--ez-file-item--color)}.file-type-icon{flex-shrink:0;--ez-icon--color:var(--ez-file-item--icon-color);padding-right:var(--ez-file-item--padding)}.file-size{padding-left:2px;overflow:hidden;flex-shrink:0;white-space:nowrap;font-family:var(--ez-file-item--font-family);font-size:var(--ez-file-item--font-size);font-weight:var(--ez-file-item__file-size--font-weight);color:var(--ez-file-item__file-size--color)}.btn-remove{cursor:pointer;flex-shrink:0;--ez-icon--color:var(--ez-file-item--icon-color)}';export{s as ez_file_item}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as o,g as r}from"./p-7ffd12e7.js";import{MaskFormatter as n,ElementIDUtils as s}from"@sankhyalabs/core";const a=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.mask=void 0,this.canShowError=!0,this.restrict=void 0,this.mode="regular",this.noBorder=!1}observeErrorMessage(){this._inputElem&&this.isInvalid().then((t=>{var i,e;t?(this._inputElem.classList.add("hasError"),null===(i=this._messageBoxElem)||void 0===i||i.classList.add("hasError")):(this._inputElem.classList.remove("hasError"),null===(e=this._messageBoxElem)||void 0===e||e.classList.remove("hasError"))}))}observeMask(){this.mask&&(null==this._maskFormatter?this._maskFormatter=new n(this.mask):this._maskFormatter.mask=this.mask)}observeValue(t,i){this._inputElem&&t!=i&&(this._inputElem.value=this.value||"",this.handleChange(),this.adjustFloatingLabel(),this.isSlaveMode()||(this.errorMessage="",this.ezChange.emit(this.value)))}adjustFloatingLabel(){if(this.label&&this._labelElem){this._inputElem&&!this._inputElem.classList.contains("input--with--label")&&this._inputElem.classList.add("input--with--label");const t=this.value&&this.value.toString().length>0,i=this._labelElem.classList.contains("input__label--floated");t||this.isFocused()?i||this._labelElem.classList.add("input__label--floated"):i&&this._labelElem.classList.remove("input__label--floated")}}isFocused(){return null!==this._hostElement.shadowRoot.activeElement}isSlaveMode(){var t,i;return"true"===(null===(i=null===(t=this._hostElement)||void 0===t?void 0:t.dataset)||void 0===i?void 0:i.slaveMode)}adjustColorContentSlot(t=""){this._contentLeftSlot&&(this._contentLeftSlot.style.color=t)}adjustBorderInput(){this.noBorder&&this._inputElem.classList.add("input__slim--noborder")}async setFocus(){this._inputElem.focus()}async setBlur(){this._inputElem.blur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}handleFocusout(){const t=this._inputElem.value;if(t&&this._maskFormatter)try{this._inputElem.value=this._maskFormatter.format(t)}catch(t){this.errorMessage=t.message}this.controlChangeValue(),this.adjustFloatingLabel(),this.adjustColorContentSlot()}isValidValue(t){return!this.restrict||Array.from(t).reduce(((t,i)=>t&&this.restrict.indexOf(i)>-1),!0)}controlChangeValue(){this._inputElem&&(this.value||"")!==this._inputElem.value&&(this.value=this._inputElem.value)}handleChange(){if(!this._inputElem)return;const t=this._inputElem.value;this.isValidValue(t)?this._lastValidValue=t:this._inputElem.value=null==this._lastValidValue?"":this._lastValidValue,this.controlChangeValue()}handleSlotChange(t){const i=t.target,e=i.assignedElements()[0];e&&(e.style.position="absolute",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center",e.style.overflow="hidden",e.style.top="0px",e.style.width="var(--ez-text-input__icon--width)",e.style.height="slim"!=this.mode?"var(--ez-text-input--height)":"var(--ez-text-input--height--slim)","leftIcon"==i.name?(e.style.left="0px",e.style.borderRadius="var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)",this._inputElem.classList.add("icon--left"),this._labelElem&&this._labelElem.classList.add("input__label--left"),this._contentLeftSlot=e):"rightIcon"==i.name&&(e.style.right="0px",e.style.borderRadius="0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0",this._inputElem.classList.add("icon--right"),this._labelElem&&this._labelElem.classList.add("input__label--right")),i.name&&s.addIDInfo(e,i.name)),this.observeErrorMessage()}doFocus(){this.label&&this._labelElem&&!this._labelElem.classList.contains("input__label--floated")&&this._labelElem.classList.add("input__label--floated"),this.adjustColorContentSlot("var(--ez-text-input__input--focus--border-color)")}componentDidLoad(){this.observeErrorMessage(),this.observeMask(),this.adjustFloatingLabel(),this.adjustBorderInput()}componentWillLoad(){if(this.observeMask(),this.value){if(this._maskFormatter)try{this.value=this._maskFormatter.format(this.value)}catch(t){this.errorMessage=t.message}this.isValidValue(this.value)||(this._lastValidValue="",this.value="")}}render(){return s.addIDInfoIfNotExists(this._hostElement,"input"),e(o,null,e("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label&&"slim"!=this.mode?e("label",{ref:t=>this._labelElem=t,class:this.enabled?"input__label":"input__label input__label--disabled",onClick:()=>this._inputElem.focus(),title:this.label},this.label):null,e("input",{"data-element-id":s.getInternalIDInfo("input"),onFocus:()=>this.doFocus(),ref:t=>this._inputElem=t,type:"text",class:"slim"===this.mode?"input--slim":"",placeholder:"slim"===this.mode&&this.label?this.label:"",value:this.value,disabled:!this.enabled,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()}}),e("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.canShowError&&"slim"!=this.mode&&e("span",{class:"message-box",ref:t=>this._messageBoxElem=t,title:this.errorMessage,"data-element-id":s.getInternalIDInfo("message_box")},this.errorMessage))}get _hostElement(){return r(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],mask:["observeMask"],value:["observeValue"]}}};a.style=":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--ez-text-input--height--slim:32px;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #2B3A54);--ez-text-input__input--background-color:var(--background--medium, #e0e0e0);--ez-text-input__input--border:var(--border--medium, 2px solid);--ez-text-input__input--border-color:var(--ez-text-input__input--background-color);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-text-input__input--disabled--color:var(--text--disable, #AFB6C0);--ez-text-input__input--error--border-color:#CC2936;--ez-text-input__input--noborder-color:white;--ez-text-input__input--padding:var(--space--medium, 6px);--ez-text-input__message_box--font-size:var(--text--small, 12px);--ez-text-input__message_box--info--color:var(--color--success, #22085d);--ez-text-input__message_box--error--color:var(--color--error, #FF0000);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width)}input{width:100%;box-sizing:border-box;height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color);font-weight:var(--ez-text-input--font-weight);padding:var(--ez-text-input__input--padding)}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color)}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color)}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:read-only{cursor:default}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input__message_box--font-size);color:var(--ez-text-input__message_box--info--color)}.hasError{color:var(--ez-text-input__message_box--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color)}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}.input--slim{padding-top:var(--space--small, 3px);padding-bottom:var(--space--small, 3px);height:var(--ez-text-input--height--slim)}.input__slim--title{font-size:16px;font-weight:bold}.input--slim::-webkit-input-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:-moz-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim::-moz-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:-ms-input-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim::placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:disabled::-webkit-input-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled:-moz-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled::-moz-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled:-ms-input-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled::placeholder{color:var(--ez-text-input__input--disabled--color)}input.input__slim--noborder{box-shadow:0 0 0 0;border:0 none;outline:0;background:var(--ez-text-input__input--noborder-color)}";export{a as ez_text_input}
|
|
1
|
+
import{r as t,c as i,h as e,H as o,g as r}from"./p-00ea9b50.js";import{MaskFormatter as n,ElementIDUtils as a}from"@sankhyalabs/core";const s=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.mask=void 0,this.canShowError=!0,this.restrict=void 0,this.mode="regular",this.noBorder=!1}observeErrorMessage(){this._inputElem&&this.isInvalid().then((t=>{var i,e;t?(this._inputElem.classList.add("hasError"),null===(i=this._messageBoxElem)||void 0===i||i.classList.add("hasError")):(this._inputElem.classList.remove("hasError"),null===(e=this._messageBoxElem)||void 0===e||e.classList.remove("hasError"))}))}observeMask(){this.mask&&(null==this._maskFormatter?this._maskFormatter=new n(this.mask):this._maskFormatter.mask=this.mask)}observeValue(t,i){this._inputElem&&t!=i&&(this._inputElem.value=this.value||"",this.handleChange(),this.adjustFloatingLabel(),this.isSlaveMode()||(this.errorMessage="",this.ezChange.emit(this.value)))}adjustFloatingLabel(){if(this.label&&this._labelElem){this._inputElem&&!this._inputElem.classList.contains("input--with--label")&&this._inputElem.classList.add("input--with--label");const t=this.value&&this.value.toString().length>0,i=this._labelElem.classList.contains("input__label--floated");t||this.isFocused()?i||this._labelElem.classList.add("input__label--floated"):i&&this._labelElem.classList.remove("input__label--floated")}}isFocused(){return null!==this._hostElement.shadowRoot.activeElement}isSlaveMode(){var t,i;return"true"===(null===(i=null===(t=this._hostElement)||void 0===t?void 0:t.dataset)||void 0===i?void 0:i.slaveMode)}adjustColorContentSlot(t=""){this._contentLeftSlot&&(this._contentLeftSlot.style.color=t)}adjustBorderInput(){this.noBorder&&this._inputElem.classList.add("input__slim--noborder")}async setFocus(){this._inputElem.focus()}async setBlur(){this._inputElem.blur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}handleFocusout(){const t=this._inputElem.value;if(t&&this._maskFormatter)try{this._inputElem.value=this._maskFormatter.format(t)}catch(t){this.errorMessage=t.message}this.controlChangeValue(),this.adjustFloatingLabel(),this.adjustColorContentSlot()}isValidValue(t){return!this.restrict||Array.from(t).reduce(((t,i)=>t&&this.restrict.indexOf(i)>-1),!0)}controlChangeValue(){this._inputElem&&(this.value||"")!==this._inputElem.value&&(this.value=this._inputElem.value)}handleChange(){if(!this._inputElem)return;const t=this._inputElem.value;this.isValidValue(t)?this._lastValidValue=t:this._inputElem.value=null==this._lastValidValue?"":this._lastValidValue,this.controlChangeValue()}handleSlotChange(t){const i=t.target,e=i.assignedElements()[0];e&&(e.style.position="absolute",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center",e.style.overflow="hidden",e.style.top="0px",e.style.width="var(--ez-text-input__icon--width)",e.style.height="slim"!=this.mode?"var(--ez-text-input--height)":"var(--ez-text-input--height--slim)","leftIcon"==i.name?(e.style.left="0px",e.style.borderRadius="var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)",this._inputElem.classList.add("icon--left"),this._labelElem&&this._labelElem.classList.add("input__label--left"),this._contentLeftSlot=e):"rightIcon"==i.name&&(e.style.right="0px",e.style.borderRadius="0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0",this._inputElem.classList.add("icon--right"),this._labelElem&&this._labelElem.classList.add("input__label--right")),i.name&&a.addIDInfo(e,i.name)),this.observeErrorMessage()}doFocus(){this.label&&this._labelElem&&!this._labelElem.classList.contains("input__label--floated")&&this._labelElem.classList.add("input__label--floated"),this.adjustColorContentSlot("var(--ez-text-input__input--focus--border-color)")}componentDidLoad(){this.observeErrorMessage(),this.observeMask(),this.adjustFloatingLabel(),this.adjustBorderInput()}componentWillLoad(){if(this.observeMask(),this.value){if(this._maskFormatter)try{this.value=this._maskFormatter.format(this.value)}catch(t){this.errorMessage=t.message}this.isValidValue(this.value)||(this._lastValidValue="",this.value="")}}render(){return a.addIDInfoIfNotExists(this._hostElement,"input"),e(o,null,e("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label&&"slim"!=this.mode?e("label",{ref:t=>this._labelElem=t,class:this.enabled?"input__label":"input__label input__label--disabled",onClick:()=>this._inputElem.focus(),title:this.label},this.label):null,e("input",{"data-element-id":a.getInternalIDInfo("input"),onFocus:()=>this.doFocus(),ref:t=>this._inputElem=t,type:"text",class:"slim"===this.mode?"input--slim":"",placeholder:"slim"===this.mode&&this.label?this.label:"",value:this.value,disabled:!this.enabled,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()}}),e("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.canShowError&&"slim"!=this.mode&&e("span",{class:"message-box",ref:t=>this._messageBoxElem=t,title:this.errorMessage,"data-element-id":a.getInternalIDInfo("message_box")},this.errorMessage))}get _hostElement(){return r(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],mask:["observeMask"],value:["observeValue"]}}};s.style=":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--ez-text-input--height--slim:32px;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #2B3A54);--ez-text-input__input--background-color:var(--background--medium, #e0e0e0);--ez-text-input__input--border:var(--border--medium, 2px solid);--ez-text-input__input--border-color:var(--ez-text-input__input--background-color);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-text-input__input--disabled--color:var(--text--disable, #AFB6C0);--ez-text-input__input--error--border-color:#CC2936;--ez-text-input__input--noborder-color:white;--ez-text-input__input--padding:var(--space--medium, 6px);--ez-text-input__message_box--font-size:var(--text--small, 12px);--ez-text-input__message_box--info--color:var(--color--success, #22085d);--ez-text-input__message_box--error--color:var(--color--error, #FF0000);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width)}input{width:100%;box-sizing:border-box;height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color);font-weight:var(--ez-text-input--font-weight);padding:var(--ez-text-input__input--padding)}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color)}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color)}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:read-only{cursor:default}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input__message_box--font-size);color:var(--ez-text-input__message_box--info--color)}.hasError{color:var(--ez-text-input__message_box--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color)}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}.input--slim{padding-top:var(--space--small, 3px);padding-bottom:var(--space--small, 3px);height:var(--ez-text-input--height--slim)}.input__slim--title{font-size:16px;font-weight:bold}.input--slim::-webkit-input-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:-moz-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim::-moz-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:-ms-input-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim::placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:disabled::-webkit-input-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled:-moz-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled::-moz-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled:-ms-input-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled::placeholder{color:var(--ez-text-input__input--disabled--color)}input.input__slim--noborder{box-shadow:0 0 0 0;border:0 none;outline:0;background:var(--ez-text-input__input--noborder-color)}";export{s as ez_text_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,f as n,H as s,g as r}from"./p-7ffd12e7.js";import{Action as o,WaitingChangeException as l,ApplicationContext as a,UserInterface as h,StringUtils as c,DataUnitAction as u,DataUnit as d,ElementIDUtils as f}from"@sankhyalabs/core";import{A as v}from"./p-69a913b8.js";import"./p-ab574d59.js";function p(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 m="function"==typeof Symbol&&Symbol.observable||"@@observable",b=function(){return Math.random().toString(36).substring(7).split("").join(".")},_={INIT:"@@redux/INIT"+b(),REPLACE:"@@redux/REPLACE"+b(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+b()}};function g(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 y(t,i,e){var n;if("function"==typeof i&&"function"==typeof e||"function"==typeof e&&"function"==typeof arguments[3])throw new Error(p(0));if("function"==typeof i&&void 0===e&&(e=i,i=void 0),void 0!==e){if("function"!=typeof e)throw new Error(p(1));return e(y)(t,i)}if("function"!=typeof t)throw new Error(p(2));var s=t,r=i,o=[],l=o,a=!1;function h(){l===o&&(l=o.slice())}function c(){if(a)throw new Error(p(3));return r}function u(t){if("function"!=typeof t)throw new Error(p(4));if(a)throw new Error(p(5));var i=!0;return h(),l.push(t),function(){if(i){if(a)throw new Error(p(6));i=!1,h();var e=l.indexOf(t);l.splice(e,1),o=null}}}function d(t){if(!g(t))throw new Error(p(7));if(void 0===t.type)throw new Error(p(8));if(a)throw new Error(p(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(p(10));s=t,d({type:_.REPLACE})}function v(){var t,i=u;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(p(11));function e(){t.next&&t.next(c())}return e(),{unsubscribe:i(e)}}})[m]=function(){return this},t}return d({type:_.INIT}),(n={dispatch:d,subscribe:u,getState:c,replaceReducer:f})[m]=v,n}class w{constructor(t){this._invalidFields=new Map,this.onDataUnitEvent=t=>{var i;switch(t.type){case o.DATA_LOADED:case o.DATA_SAVED:case o.RECORDS_REMOVED:case o.RECORDS_ADDED:case o.RECORDS_COPIED:case o.EDITION_CANCELED:case o.SELECTION_CHANGED:case o.NEXT_SELECTED:case o.PREVIOUS_SELECTED:this.clearInvalid();case o.DATA_CHANGED:case o.CHANGE_UNDONE:case o.CHANGE_REDONE:case o.RECORD_LOADED:null===(i=this._fields)||void 0===i||i.forEach((t=>{this.updateValue(t.fieldName,t.field)}))}},this._fields=new Map,this._dataUnit=t,this._dataUnit.subscribe(this.onDataUnitEvent)}bind(t){t.forEach((t=>{this.updateBind(t.dataset.fieldName,t)}))}onDisconnectedCallback(){this._dataUnit.unsubscribe(this.onDataUnitEvent)}markInvalid(t){if(this._invalidFields.set(t.name,t),this._fields.has(t.name)){const i=this._fields.get(t.name).field;i.errorMessage||this.updateErrorMessage(t.name,i)}}clearInvalid(){this._invalidFields.clear(),this._fields.forEach((t=>{t.field.errorMessage=""}))}updateValue(t,i){const e=this._fields.get(t);try{e&&(e.listen=!1),i.value=this._dataUnit.getFieldValue(t),this.updateErrorMessage(t,i)}finally{e&&(e.listen=!0)}}updateErrorMessage(t,i){const e=this._invalidFields.get(t);e&&(i.errorMessage=e.message)}getErrorMessage(t){if(this._fields.has(t))return this._fields.get(t).field.errorMessage||null}updateBind(t,i){const e=this._fields.get(t);e&&e.destroy(),i.value=this._dataUnit.getFieldValue(t),this.updateErrorMessage(t,i),this._fields.set(t,E.create(t,i,((t,i)=>this.changeStarted(t,i)),(t=>this.cancelWaitingChange(t)),((t,i)=>this.setFieldValue(t,i)))),this.bindSearchOptionsLoader(t,i),this.applyEzUploadContext(t,i)}changeStarted(t,i){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),!i.blocking&&null==i.promise){const e=this._fields.get(t);e&&(i.promise=new Promise(((t,i)=>{e.waitingChangePromiseResolve=t,e.waitingChangePromiseReject=i})))}this._dataUnit.startChange(t,i)}cancelWaitingChange(t){if(this._dataUnit.waitingForChange(t)){this._dataUnit.cancelWaitingChange(t);const i=this._fields.get(t);i&&i.rejectWaitingChange(new l("Change canceled",t))}}setFieldValue(t,i){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),this._invalidFields.delete(t),this._dataUnit.setFieldValue(t,i),this._dataUnit.waitingForChange(t)){const i=this._fields.get(t);i&&i.acceptWaitingChange()}}bindSearchOptionsLoader(t,i){if("EZ-SEARCH"===i.nodeName&&null==i.optionLoader){const e=a.getContextValue("__EZUI__SEARCH__OPTION__LOADER__");e&&(i.optionLoader=i=>e(i,t,this._dataUnit))}}applyEzUploadContext(t,i){var e,n;if("EZ-UPLOAD"===i.nodeName){i.urlUpload=a.getContextValue("__EZUI__UPLOAD__ADD__URL__"),i.urlDelete=a.getContextValue("__EZUI__UPLOAD__DEL__URL__");const s=this._dataUnit.getField(t),r=null===(e=s.properties)||void 0===e?void 0:e.DESTINATION;r&&(i.requestHeaders={XTRAINF:`{"destination": "${r}"}`}),i.maxFiles=(null===(n=s.properties)||void 0===n?void 0:n.MAX_FILES)||0}}}class E{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,i,e,n,s){const r=new E;return r.field=i,r.fieldName=t,r.startChangeListener=i=>{r.listen&&e(t,i.detail)},r.field.addEventListener(r.startChangeEventName,r.startChangeListener),r.cancelWaitingChangeListener=()=>{r.listen&&n(t)},r.field.addEventListener(r.cancelWaitingChangeEventName,r.cancelWaitingChangeListener),r.changeListener=i=>{r.listen&&s(t,i.detail)},r.field.addEventListener(r.changeEventName,r.changeListener),r}}const O={};function C(t=O,i){switch(i.type){case R.METADATA_LOADED:return Object.assign(Object.assign({},t),{formMetadata:i.payload,currentSheet:void 0});case R.CHANGE_TAB:return Object.assign(Object.assign({},t),{currentSheet:i.payload});default:return t}}function A(t){return{type:R.CHANGE_TAB,payload:"string"==typeof t?t:t.tabKey}}function z(t){return t.formMetadata}function j(t){return t.currentSheet}var R;!function(t){t.METADATA_LOADED="FORM/METADATA_LOADED",t.CHANGE_TAB="FORM/CHANGE_TAB"}(R||(R={}));class x{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}getSheet(t){return this._sheets.get(t)}getAllSheets(){return this._sheets}addSheet(t){this._sheets.set(t.name,t),this._requiredFields=this._requiredFields.concat(t.requiredFields),this._cleanOnCopyFields=this._cleanOnCopyFields.concat(t.cleanOnCopyFields),this._defaultValues=t.defaultValues}getRequiredFields(){return this._requiredFields}getCleanOnCopyFields(){return this._cleanOnCopyFields}getDefaultValues(){return this._defaultValues}}const M=(t,i)=>{let e,n,{name:s,label:r,group:o}=Object.assign({},i),{readOnly:l,required:a}=Object.assign({},i);return t&&(r=r||t.label,s=s||t.name,a=t.required||(null==i?void 0:i.required),l=t.readOnly||(null==i?void 0:i.readOnly),e=t.properties,n=t.userInterface),{name:s,label:r,group:o,readOnly:l,required:a,props:e,userInterface:n||h.SHORTTEXT}},I=(t,i)=>"__main"==t[0].label?-1:(t[0].order||1e4)-(i[0].order||1e4),S=class{constructor(e){t(this,e),this.ezReady=i(this,"ezReady",7),this.onDataUnitAction=t=>{t.type===o.METADATA_LOADED&&this.processMetadata()},this.dataUnit=void 0,this.config=void 0,this.recordsValidator=void 0,this.multiLevel=void 0,this.levelResolver=void 0,this.contentBuilder=void 0}validate(){return new Promise(((t,i)=>{var e;const n=this.dataUnit.getModifiedRecords();for(let t=0;t<n.length;t++){const s=n[t],r=[];let o=this.validateRequired(s);if(o&&!o.isValid&&r.push(o),o=null===(e=this.recordsValidator)||void 0===e?void 0:e.validateRecord(this,s),o&&!o.isValid&&r.push(o),r.length>0){this.processValidationResult(r),i();break}}t()}))}observeConfig(){this.processMetadata()}validateRequired(t){const i=z(this._store.getState()),e=this._staticFields.filter((t=>t.dataset.required)).map((t=>t.dataset.fieldName)).concat(i.getRequiredFields()),n=[];if(new Set(e).forEach((i=>{const e=t[i];if(null==e||""===e){const t=this._dataBinder.getErrorMessage(i);n.push(t?{name:i,message:t}:{name:i,message:"Essa informação é obrigatória"})}})),n.length>0)return{isValid:!1,invalidFields:n,infoMessage:"Há pelo menos um campo obrigatório não preenchido."}}processValidationResult(t){t.forEach((t=>{const i=t.invalidFields;if(i&&i.forEach((t=>{this._dataBinder.markInvalid(t)})),t.infoMessage&&v.info(t.infoMessage),t.errorMessage){const{errorTitle:i,errorMessage:e}=t;v.error(i,e)}}))}resolveLevel(t){return this.levelResolver?this.levelResolver(t):t}getMultiLevelContent(t,i,n){const s=this.resolveLevel(t.map((t=>({id:t.name,label:t.label}))));return e("div",{class:"multi-level__container"},e("div",null,e("ez-tree",{selectedId:null==i?void 0:i.name,items:s,onEzChange:t=>{var e;const n=null===(e=t.detail)||void 0===e?void 0:e.id;n&&n!==(null==i?void 0:i.name)&&this._store.dispatch(A(n))}})),e("div",null,this.buildFormContent(n,i)))}getDynamicContent(){var t,i;const n=z(this._store.getState());if(!n)return null;const s=Array.from(n.getAllSheets().values()),r=j(null===(t=this._store)||void 0===t?void 0:t.getState()),o=function(t){const i=j(t);return i?t.formMetadata.getSheet(i):Array.from(t.formMetadata.getAllSheets().values())[0]}(null===(i=this._store)||void 0===i?void 0:i.getState());if(this.multiLevel)return this.getMultiLevelContent(s,o,r);let l=[];if(s.length>1){const t=s.map(((t,i)=>({tabKey:t.name,label:t.label,index:i}))),i="selector";l.push(e("ez-tabselector",{tabs:this.buildIdTabSelector(t),onEzChange:t=>this._store.dispatch(A(t.detail)),selectedTab:o.name,"data-element-id":i}))}return l=l.concat(this.buildFormContent(r,o)),l}buildFormContent(t,i){const n=null==i?void 0:i.fields;if(null!=this.contentBuilder){const i=this.contentBuilder(t,n);if(null!=i)return e("div",{innerHTML:i})}if(null==i)return;const s=`${c.replaceAccentuatedChars(c.toCamelCase(null==i?void 0:i.label),!1)}_selectorContainer`;return e("div",{class:"dynamic-content ez-box__container","data-element-id":s},e("ez-form-view",{class:"ez-row ez-padding-vertical--small",fields:n}))}processMetadata(){if(!this.isStatic()&&this.dataUnit&&this._store){const t=null!=this.config&&Object.values(this.config).length>0?((t,i)=>{var e,n;const s=new Map,r=new Map,o=[],l=[],a={};null===(e=null==t?void 0:t.tabs)||void 0===e||e.forEach((t=>{r.has(t.label)||!1!==t.visible||r.set(t.label,t)})),null===(n=null==t?void 0:t.fields)||void 0===n||n.forEach((t=>{var e,n,h,c;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",s);if(r.has(u.label))return;const d=i.getField(t.name);if(d&&u.visible){s.has(u)||s.set(u,[]);const i=M(d,t);s.get(u).push(i),i.required&&o.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.autoNum)||(null===(h=d.properties)||void 0===h?void 0:h.cleanOnCopy))&&l.push(t.name),(null==t.defaultValue?null===(c=d.properties)||void 0===c?void 0:c.defaultValue:t.defaultValue)&&(a[t.name]=t.defaultValue)}}}));const h=new x;return Array.from(s.entries()).sort(I).forEach((([t,i])=>{h.addSheet({label:"__main"===t.label?"Principal":t.label,name:t.label,fields:i,requiredFields:o,cleanOnCopyFields:l,defaultValues:a})})),h})(this.config,this.dataUnit):(()=>{const t=this.dataUnit.metadata,i=new x;if(t){const e=(t.fields||[]).filter((t=>!1!==t.visible)),n=e.map((t=>M(t)));let s={};e.filter((t=>t.defaultValue)).forEach((t=>s[t.name]=t.defaultValue)),i.addSheet({name:t.name,label:t.label,fields:n,requiredFields:e.filter((t=>t.required)).map((t=>t.name)),cleanOnCopyFields:e.filter((t=>{var i,e;return(null===(i=t.properties)||void 0===i?void 0:i.cleanOnCopy)||(null===(e=t.properties)||void 0===e?void 0:e.autoNum)})).map((t=>t.name)),defaultValues:s})}return i})();this._store.dispatch({type:R.METADATA_LOADED,payload:t})}}isStatic(){var t;return(null===(t=this._staticFields)||void 0===t?void 0:t.length)>0}getFormattedValue(t){return null==t||"object"!=typeof t?t:"formattedValue"in t?t.formattedValue:t.value}interceptAction(t){if(t.type===o.RECORDS_COPIED){const i=z(this._store.getState()).getCleanOnCopyFields();if(i)return new u(o.RECORDS_COPIED,t.payload.map((t=>{const e=Object.assign({},t);return i.forEach((t=>delete e[t])),e})))}if(t.type===o.SAVING_DATA)return new Promise((i=>{this.validate().then((()=>i(t))).catch((()=>{}))}));if(t.type===o.RECORDS_ADDED){const i=z(this._store.getState()),e=null==i?void 0:i.getDefaultValues();if(e)return new u(o.RECORDS_ADDED,t.payload.map((t=>{const i=Object.assign({},t);for(const t in e){const n=this.getFormattedValue(e[t]),s="function"==typeof n?n():n;i[t]=this.dataUnit.valueFromString(t,s)}return i})))}return t}componentWillLoad(){void 0===this.dataUnit&&(this.dataUnit=new d("ez-form")),this.dataUnit.addInterceptor(this),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new w(this.dataUnit),this._store=y(C),this._store.subscribe((()=>n(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata(),f.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}componentDidRender(){this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]"))),this.ezReady.emit()}disconnectedCallback(){this.dataUnit.unsubscribe(this.onDataUnitAction),this.dataUnit.removeInterceptor(this),this._dataBinder.onDisconnectedCallback()}buildIdTabSelector(t){return t&&t.forEach((t=>t[f.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=c.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"]}}};S.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)}.multi-level__container.sc-ez-form{display:grid;grid-template-columns:minmax(20%, 300px) auto;width:100%}";export{S as ez_form}
|
|
1
|
+
import{r as t,c as i,h as e,f as n,H as s,g as r}from"./p-00ea9b50.js";import{Action as o,WaitingChangeException as l,ApplicationContext as a,UserInterface as h,StringUtils as c,DataUnitAction as u,DataUnit as d,ElementIDUtils as f}from"@sankhyalabs/core";import{A as v}from"./p-efb43dd8.js";import"./p-ab574d59.js";function p(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 m="function"==typeof Symbol&&Symbol.observable||"@@observable",b=function(){return Math.random().toString(36).substring(7).split("").join(".")},_={INIT:"@@redux/INIT"+b(),REPLACE:"@@redux/REPLACE"+b(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+b()}};function g(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 y(t,i,e){var n;if("function"==typeof i&&"function"==typeof e||"function"==typeof e&&"function"==typeof arguments[3])throw new Error(p(0));if("function"==typeof i&&void 0===e&&(e=i,i=void 0),void 0!==e){if("function"!=typeof e)throw new Error(p(1));return e(y)(t,i)}if("function"!=typeof t)throw new Error(p(2));var s=t,r=i,o=[],l=o,a=!1;function h(){l===o&&(l=o.slice())}function c(){if(a)throw new Error(p(3));return r}function u(t){if("function"!=typeof t)throw new Error(p(4));if(a)throw new Error(p(5));var i=!0;return h(),l.push(t),function(){if(i){if(a)throw new Error(p(6));i=!1,h();var e=l.indexOf(t);l.splice(e,1),o=null}}}function d(t){if(!g(t))throw new Error(p(7));if(void 0===t.type)throw new Error(p(8));if(a)throw new Error(p(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(p(10));s=t,d({type:_.REPLACE})}function v(){var t,i=u;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(p(11));function e(){t.next&&t.next(c())}return e(),{unsubscribe:i(e)}}})[m]=function(){return this},t}return d({type:_.INIT}),(n={dispatch:d,subscribe:u,getState:c,replaceReducer:f})[m]=v,n}class w{constructor(t){this._invalidFields=new Map,this.onDataUnitEvent=t=>{var i;switch(t.type){case o.DATA_LOADED:case o.DATA_SAVED:case o.RECORDS_REMOVED:case o.RECORDS_ADDED:case o.RECORDS_COPIED:case o.EDITION_CANCELED:case o.SELECTION_CHANGED:case o.NEXT_SELECTED:case o.PREVIOUS_SELECTED:this.clearInvalid();case o.DATA_CHANGED:case o.CHANGE_UNDONE:case o.CHANGE_REDONE:case o.RECORD_LOADED:null===(i=this._fields)||void 0===i||i.forEach((t=>{this.updateValue(t.fieldName,t.field)}))}},this._fields=new Map,this._dataUnit=t,this._dataUnit.subscribe(this.onDataUnitEvent)}bind(t){t.forEach((t=>{this.updateBind(t.dataset.fieldName,t)}))}onDisconnectedCallback(){this._dataUnit.unsubscribe(this.onDataUnitEvent)}markInvalid(t){if(this._invalidFields.set(t.name,t),this._fields.has(t.name)){const i=this._fields.get(t.name).field;i.errorMessage||this.updateErrorMessage(t.name,i)}}clearInvalid(){this._invalidFields.clear(),this._fields.forEach((t=>{t.field.errorMessage=""}))}updateValue(t,i){const e=this._fields.get(t);try{e&&(e.listen=!1),i.value=this._dataUnit.getFieldValue(t),this.updateErrorMessage(t,i)}finally{e&&(e.listen=!0)}}updateErrorMessage(t,i){const e=this._invalidFields.get(t);e&&(i.errorMessage=e.message)}getErrorMessage(t){if(this._fields.has(t))return this._fields.get(t).field.errorMessage||null}updateBind(t,i){const e=this._fields.get(t);e&&e.destroy(),i.value=this._dataUnit.getFieldValue(t),this.updateErrorMessage(t,i),this._fields.set(t,E.create(t,i,((t,i)=>this.changeStarted(t,i)),(t=>this.cancelWaitingChange(t)),((t,i)=>this.setFieldValue(t,i)))),this.bindSearchOptionsLoader(t,i),this.applyEzUploadContext(t,i)}changeStarted(t,i){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),!i.blocking&&null==i.promise){const e=this._fields.get(t);e&&(i.promise=new Promise(((t,i)=>{e.waitingChangePromiseResolve=t,e.waitingChangePromiseReject=i})))}this._dataUnit.startChange(t,i)}cancelWaitingChange(t){if(this._dataUnit.waitingForChange(t)){this._dataUnit.cancelWaitingChange(t);const i=this._fields.get(t);i&&i.rejectWaitingChange(new l("Change canceled",t))}}setFieldValue(t,i){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),this._invalidFields.delete(t),this._dataUnit.setFieldValue(t,i),this._dataUnit.waitingForChange(t)){const i=this._fields.get(t);i&&i.acceptWaitingChange()}}bindSearchOptionsLoader(t,i){if("EZ-SEARCH"===i.nodeName&&null==i.optionLoader){const e=a.getContextValue("__EZUI__SEARCH__OPTION__LOADER__");e&&(i.optionLoader=i=>e(i,t,this._dataUnit))}}applyEzUploadContext(t,i){var e,n;if("EZ-UPLOAD"===i.nodeName){i.urlUpload=a.getContextValue("__EZUI__UPLOAD__ADD__URL__"),i.urlDelete=a.getContextValue("__EZUI__UPLOAD__DEL__URL__");const s=this._dataUnit.getField(t),r=null===(e=s.properties)||void 0===e?void 0:e.DESTINATION;r&&(i.requestHeaders={XTRAINF:`{"destination": "${r}"}`}),i.maxFiles=(null===(n=s.properties)||void 0===n?void 0:n.MAX_FILES)||0}}}class E{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,i,e,n,s){const r=new E;return r.field=i,r.fieldName=t,r.startChangeListener=i=>{r.listen&&e(t,i.detail)},r.field.addEventListener(r.startChangeEventName,r.startChangeListener),r.cancelWaitingChangeListener=()=>{r.listen&&n(t)},r.field.addEventListener(r.cancelWaitingChangeEventName,r.cancelWaitingChangeListener),r.changeListener=i=>{r.listen&&s(t,i.detail)},r.field.addEventListener(r.changeEventName,r.changeListener),r}}const O={};function C(t=O,i){switch(i.type){case R.METADATA_LOADED:return Object.assign(Object.assign({},t),{formMetadata:i.payload,currentSheet:void 0});case R.CHANGE_TAB:return Object.assign(Object.assign({},t),{currentSheet:i.payload});default:return t}}function A(t){return{type:R.CHANGE_TAB,payload:"string"==typeof t?t:t.tabKey}}function z(t){return t.formMetadata}function j(t){return t.currentSheet}var R;!function(t){t.METADATA_LOADED="FORM/METADATA_LOADED",t.CHANGE_TAB="FORM/CHANGE_TAB"}(R||(R={}));class x{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}getSheet(t){return this._sheets.get(t)}getAllSheets(){return this._sheets}addSheet(t){this._sheets.set(t.name,t),this._requiredFields=this._requiredFields.concat(t.requiredFields),this._cleanOnCopyFields=this._cleanOnCopyFields.concat(t.cleanOnCopyFields),this._defaultValues=t.defaultValues}getRequiredFields(){return this._requiredFields}getCleanOnCopyFields(){return this._cleanOnCopyFields}getDefaultValues(){return this._defaultValues}}const M=(t,i)=>{let e,n,{name:s,label:r,group:o}=Object.assign({},i),{readOnly:l,required:a}=Object.assign({},i);return t&&(r=r||t.label,s=s||t.name,a=t.required||(null==i?void 0:i.required),l=t.readOnly||(null==i?void 0:i.readOnly),e=t.properties,n=t.userInterface),{name:s,label:r,group:o,readOnly:l,required:a,props:e,userInterface:n||h.SHORTTEXT}},I=(t,i)=>"__main"==t[0].label?-1:(t[0].order||1e4)-(i[0].order||1e4),S=class{constructor(e){t(this,e),this.ezReady=i(this,"ezReady",7),this.onDataUnitAction=t=>{t.type===o.METADATA_LOADED&&this.processMetadata()},this.dataUnit=void 0,this.config=void 0,this.recordsValidator=void 0,this.multiLevel=void 0,this.levelResolver=void 0,this.contentBuilder=void 0}validate(){return new Promise(((t,i)=>{var e;const n=this.dataUnit.getModifiedRecords();for(let t=0;t<n.length;t++){const s=n[t],r=[];let o=this.validateRequired(s);if(o&&!o.isValid&&r.push(o),o=null===(e=this.recordsValidator)||void 0===e?void 0:e.validateRecord(this,s),o&&!o.isValid&&r.push(o),r.length>0){this.processValidationResult(r),i();break}}t()}))}observeConfig(){this.processMetadata()}validateRequired(t){const i=z(this._store.getState()),e=this._staticFields.filter((t=>t.dataset.required)).map((t=>t.dataset.fieldName)).concat(i.getRequiredFields()),n=[];if(new Set(e).forEach((i=>{const e=t[i];if(null==e||""===e){const t=this._dataBinder.getErrorMessage(i);n.push(t?{name:i,message:t}:{name:i,message:"Essa informação é obrigatória"})}})),n.length>0)return{isValid:!1,invalidFields:n,infoMessage:"Há pelo menos um campo obrigatório não preenchido."}}processValidationResult(t){t.forEach((t=>{const i=t.invalidFields;if(i&&i.forEach((t=>{this._dataBinder.markInvalid(t)})),t.infoMessage&&v.info(t.infoMessage),t.errorMessage){const{errorTitle:i,errorMessage:e}=t;v.error(i,e)}}))}resolveLevel(t){return this.levelResolver?this.levelResolver(t):t}getMultiLevelContent(t,i,n){const s=this.resolveLevel(t.map((t=>({id:t.name,label:t.label}))));return e("div",{class:"multi-level__container"},e("div",null,e("ez-tree",{selectedId:null==i?void 0:i.name,items:s,onEzChange:t=>{var e;const n=null===(e=t.detail)||void 0===e?void 0:e.id;n&&n!==(null==i?void 0:i.name)&&this._store.dispatch(A(n))}})),e("div",null,this.buildFormContent(n,i)))}getDynamicContent(){var t,i;const n=z(this._store.getState());if(!n)return null;const s=Array.from(n.getAllSheets().values()),r=j(null===(t=this._store)||void 0===t?void 0:t.getState()),o=function(t){const i=j(t);return i?t.formMetadata.getSheet(i):Array.from(t.formMetadata.getAllSheets().values())[0]}(null===(i=this._store)||void 0===i?void 0:i.getState());if(this.multiLevel)return this.getMultiLevelContent(s,o,r);let l=[];if(s.length>1){const t=s.map(((t,i)=>({tabKey:t.name,label:t.label,index:i}))),i="selector";l.push(e("ez-tabselector",{tabs:this.buildIdTabSelector(t),onEzChange:t=>this._store.dispatch(A(t.detail)),selectedTab:o.name,"data-element-id":i}))}return l=l.concat(this.buildFormContent(r,o)),l}buildFormContent(t,i){const n=null==i?void 0:i.fields;if(null!=this.contentBuilder){const i=this.contentBuilder(t,n);if(null!=i)return e("div",{innerHTML:i})}if(null==i)return;const s=`${c.replaceAccentuatedChars(c.toCamelCase(null==i?void 0:i.label),!1)}_selectorContainer`;return e("div",{class:"dynamic-content ez-box__container","data-element-id":s},e("ez-form-view",{class:"ez-row ez-padding-vertical--small",fields:n}))}processMetadata(){if(!this.isStatic()&&this.dataUnit&&this._store){const t=null!=this.config&&Object.values(this.config).length>0?((t,i)=>{var e,n;const s=new Map,r=new Map,o=[],l=[],a={};null===(e=null==t?void 0:t.tabs)||void 0===e||e.forEach((t=>{r.has(t.label)||!1!==t.visible||r.set(t.label,t)})),null===(n=null==t?void 0:t.fields)||void 0===n||n.forEach((t=>{var e,n,h,c;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",s);if(r.has(u.label))return;const d=i.getField(t.name);if(d&&u.visible){s.has(u)||s.set(u,[]);const i=M(d,t);s.get(u).push(i),i.required&&o.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.autoNum)||(null===(h=d.properties)||void 0===h?void 0:h.cleanOnCopy))&&l.push(t.name),(null==t.defaultValue?null===(c=d.properties)||void 0===c?void 0:c.defaultValue:t.defaultValue)&&(a[t.name]=t.defaultValue)}}}));const h=new x;return Array.from(s.entries()).sort(I).forEach((([t,i])=>{h.addSheet({label:"__main"===t.label?"Principal":t.label,name:t.label,fields:i,requiredFields:o,cleanOnCopyFields:l,defaultValues:a})})),h})(this.config,this.dataUnit):(()=>{const t=this.dataUnit.metadata,i=new x;if(t){const e=(t.fields||[]).filter((t=>!1!==t.visible)),n=e.map((t=>M(t)));let s={};e.filter((t=>t.defaultValue)).forEach((t=>s[t.name]=t.defaultValue)),i.addSheet({name:t.name,label:t.label,fields:n,requiredFields:e.filter((t=>t.required)).map((t=>t.name)),cleanOnCopyFields:e.filter((t=>{var i,e;return(null===(i=t.properties)||void 0===i?void 0:i.cleanOnCopy)||(null===(e=t.properties)||void 0===e?void 0:e.autoNum)})).map((t=>t.name)),defaultValues:s})}return i})();this._store.dispatch({type:R.METADATA_LOADED,payload:t})}}isStatic(){var t;return(null===(t=this._staticFields)||void 0===t?void 0:t.length)>0}getFormattedValue(t){return null==t||"object"!=typeof t?t:"formattedValue"in t?t.formattedValue:t.value}interceptAction(t){if(t.type===o.RECORDS_COPIED){const i=z(this._store.getState()).getCleanOnCopyFields();if(i)return new u(o.RECORDS_COPIED,t.payload.map((t=>{const e=Object.assign({},t);return i.forEach((t=>delete e[t])),e})))}if(t.type===o.SAVING_DATA)return new Promise((i=>{this.validate().then((()=>i(t))).catch((()=>{}))}));if(t.type===o.RECORDS_ADDED){const i=z(this._store.getState()),e=null==i?void 0:i.getDefaultValues();if(e)return new u(o.RECORDS_ADDED,t.payload.map((t=>{const i=Object.assign({},t);for(const t in e){const n=this.getFormattedValue(e[t]),s="function"==typeof n?n():n;i[t]=this.dataUnit.valueFromString(t,s)}return i})))}return t}componentWillLoad(){void 0===this.dataUnit&&(this.dataUnit=new d("ez-form")),this.dataUnit.addInterceptor(this),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new w(this.dataUnit),this._store=y(C),this._store.subscribe((()=>n(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata(),f.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}componentDidRender(){this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]"))),this.ezReady.emit()}disconnectedCallback(){this.dataUnit.unsubscribe(this.onDataUnitAction),this.dataUnit.removeInterceptor(this),this._dataBinder.onDisconnectedCallback()}buildIdTabSelector(t){return t&&t.forEach((t=>t[f.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=c.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"]}}};S.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)}.multi-level__container.sc-ez-form{display:grid;grid-template-columns:minmax(20%, 300px) auto;width:100%}";export{S as ez_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,c as t,h as i,H as o}from"./p-
|
|
1
|
+
import{r as d,c as t,h as i,H as o}from"./p-00ea9b50.js";const l=class{constructor(i){d(this,i),this.ezCloseModal=t(this,"ezCloseModal",7),this.ezOpenModal=t(this,"ezOpenModal",7),this.handleKeyboardEvent=d=>{"Escape"===(null==d?void 0:d.key)&&this.closeEsc&&this.closeModal()},this.modalSize=void 0,this.align=void 0,this.opened=!0,this.closeEsc=!1,this.closeOutsideClick=!1}observeOpened(){this.opened?document.addEventListener("keydown",this.handleKeyboardEvent):document.removeEventListener("keydown",this.handleKeyboardEvent)}closeModal(){this.opened=!1,this.ezCloseModal.emit(this.opened)}componentDidLoad(){this.observeOpened()}componentDidRender(){this.opened&&this.ezOpenModal.emit()}onMouseDownHandler(d){this.closeOutsideClick&&d.target===this._overlay&&this.closeModal()}render(){const d="left"===this.align?"left":"right";return i(o,null,this.opened?i("div",{class:"modal",onMouseDown:d=>this.onMouseDownHandler(d)},i("div",{class:`modal__container modal__container--${d}`,ref:d=>this._overlay=d},i("div",{class:`modal__content modal__content--${d} ${this.modalSize}`},i("slot",null)))):void 0)}static get watchers(){return{opened:["observeOpened"]}}};l.style=":host{--ez-modal-z-index:var(--most-visible, 3);--ez-modal-vertical-padding:var(--space--large, 24px);display:block}.modal{position:fixed;padding:var(--ez-modal-vertical-padding) 0;display:flex;top:0px;z-index:var(--ez-modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;box-sizing:border-box;max-height:100%;height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:24px;border-radius:12px 0px 0px 12px;box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.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{l as ez_modal}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as a,g as r}from"./p-
|
|
1
|
+
import{r as t,c as e,h as i,H as a,g as r}from"./p-00ea9b50.js";import{StringUtils as l,ElementIDUtils as o}from"@sankhyalabs/core";const d=class{constructor(i){t(this,i),this.ezClick=e(this,"ezClick",7),this.item=void 0}componentWillRender(){this.createDetailList()}componentDidLoad(){var t,e;const i={id:l.toCamelCase((null===(t=this.item)||void 0===t?void 0:t.key)||(null===(e=this.item)||void 0===e?void 0:e.title)||"")};o.addIDInfo(this._element,null,i)}createDetailList(){var t,e,i;this._details={detailsLeft:[],detailsRight:[]};let a=0;if(null===(t=this.item)||void 0===t?void 0:t.details)for(const t in this.item.details)a<3?this._details.detailsLeft.push({label:t,value:null===(e=this.item.details[t])||void 0===e?void 0:e.toString()}):this._details.detailsRight.push({label:t,value:null===(i=this.item.details[t])||void 0===i?void 0:i.toString()}),a++}buildDetailContent(t){return i("div",{class:"card-item__detail"},i("label",{class:"card-item__detail-label"},t.label),": ",i("label",{class:"card-item__detail-value",innerHTML:t.value}))}render(){return i(a,null,this.item&&i("div",{class:"card-item",onClick:()=>{this.ezClick.emit(this.item)}},i("label",{class:"card-item__title"},i("span",{class:"card-item__key",innerHTML:this.item.key}),i("span",{innerHTML:this.item.title})),i("div",{class:"card-item__details"},i("div",{class:"card-item__details-left"},this._details.detailsLeft.map((t=>this.buildDetailContent(t)))),i("div",{class:"card-item__details-right"},this._details.detailsRight.map((t=>this.buildDetailContent(t)))))))}get _element(){return r(this)}};d.style=":host{--ez-card-item--font-size:var(--text--medium, 14px);--ez-card-item--font-family:var(--font-pattern, Arial);--ez-card-item--font-weight:var(--text-weight--medium, 400);--ez-card-item--font-weight-large:var(--text-weight--large, 600);--ez-card-item--color:var(--title--primary, #2B3A54);--ez-card-item__key--color:var(--text--primary, #626e82);--ez-card-item__detail-label--color:var(--text--secondary, #A2ABB9);--ez-card-item__detail--padding-bottom:var(--space--extra-small, 3px);--ez-card-item__title--padding-bottom:var(--space--extra-small, 3px);--ez-card-item__highlight--color:var(--color--primary-300, #E2F4EF);width:100%;display:flex;cursor:pointer}.card-item{display:flex;flex-direction:column;width:100%;cursor:pointer;padding:12px;z-index:0;position:relative}.card-item:hover{background:#F0F3F7;border-radius:12px}.card-item__title{display:flex;align-items:center;line-height:18px;cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight-large);color:var(--ez-card-item--color);padding-bottom:var(--ez-card-item__title--padding-bottom);gap:var(--space--small, 6px)}.card-item__key{color:var(--ez-card-item__key--color)}.card-item__details{display:flex;cursor:pointer;justify-content:space-between;gap:var(--space--small, 6px)}.card-item__details-left{cursor:pointer;width:50%}.card-item__details-right{width:50%;cursor:pointer}.card-item__detail:not(:last-child){cursor:pointer;padding-bottom:var(--ez-card-item__detail--padding-bottom)}.card-item__detail-label{cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight);color:var(--ez-card-item__detail-label--color)}.card-item__detail-value{cursor:pointer;font-size:var(--ez-card-item--font-size);font-family:var(--ez-card-item--font-family);font-weight:var(--ez-card-item--font-weight);color:var(--ez-card-item--color)}.card-item__highlight{position:relative;border-radius:8px;z-index:-1;background-color:var(--ez-card-item__highlight--color);outline:2px solid var(--ez-card-item__highlight--color);box-shadow:-4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color)}";export{d as ez_card_item}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as o,H as i}from"./p-
|
|
1
|
+
import{r as e,c as t,h as o,H as i}from"./p-00ea9b50.js";var n;!function(e){e.CLOSE="CLOSE",e.OK="OK",e.CANCEL="CANCEL",e.LOAD="LOAD"}(n||(n={}));const a=n;var s;!function(e){e.ENABLED="ENABLED",e.DISABLED="DISABLED",e.HIDDEN="HIDDEN"}(s||(s={}));const l=s,r=class{constructor(o){e(this,o),this.ezModalAction=t(this,"ezModalAction",7),this.modalTitle=void 0,this.modalSubTitle=void 0,this.showTitleBar=!0,this.cancelButtonLabel=void 0,this.okButtonLabel=void 0,this.cancelButtonStatus=void 0,this.okButtonStatus=void 0}cancelIsVisible(){return this.cancelButtonStatus!==l.HIDDEN&&null!=this.cancelButtonLabel}okIsVisible(){return this.okButtonStatus!==l.HIDDEN&&null!=this.okButtonLabel}componentDidLoad(){window.requestAnimationFrame((()=>{this.ezModalAction.emit(a.LOAD)}))}focusLast(e){this._okButton.setFocus()}focusFirst(e){this._closeButton.focus()}render(){return o(i,null,o("button",{class:"ez-modal-container__focus-ctrl",onFocusin:e=>this.focusLast(e)}),this.showTitleBar&&o("div",{class:"ez-modal-container__header ez-margin-bottom--large ez-align--middle"},o("div",{class:"ez-col ez-align--middle ez-modal-container__title"},o("h2",{class:"ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small"},this.modalTitle),this.modalSubTitle?o("div",{class:"ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small"},this.modalSubTitle):void 0),o("button",{ref:e=>this._closeButton=e,class:"ez-modal-container__close-button",onClick:()=>this.ezModalAction.emit(a.CLOSE)},o("ez-icon",{class:"ez-modal-container__close-icon",size:"medium",iconName:"close"}))),o("div",{class:"ez-modal-container__content"},o("slot",null)),o("div",{class:"ez-flex ez-flex--justify-end"},this.cancelIsVisible()?o("ez-button",{label:this.cancelButtonLabel,enabled:this.cancelButtonStatus!==l.DISABLED,onClick:()=>this.ezModalAction.emit(a.CANCEL)}):void 0,this.okIsVisible()?o("ez-button",{ref:e=>this._okButton=e,label:this.okButtonLabel,enabled:this.okButtonStatus!==l.DISABLED,class:"ez-button--primary ez-margin-left--medium",onClick:()=>this.ezModalAction.emit(a.OK)}):void 0),o("button",{class:"ez-modal-container__focus-ctrl",onFocusin:e=>this.focusFirst(e)}))}};r.style=".sc-ez-modal-container-h{display:grid;grid-template-rows:0 auto 1fr auto;width:100%;height:100%}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between}.ez-modal-container__content.sc-ez-modal-container{overflow-y:auto;scrollbar-gutter:stable}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";export{r as ez_modal_container}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as r,h as t,g as i,H as s,f as o}from"./p-7ffd12e7.js";import{ElementIDUtils as l,JSUtils as a,StringUtils as n}from"@sankhyalabs/core";import{C as c}from"./p-4a5e37a7.js";import{E as h}from"./p-98bb8b16.js";const d=class{constructor(t){e(this,t),this.ezChange=r(this,"ezChange",7),this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.restrict=void 0,this.mode="regular"}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){this._textInput&&(this._textInput.errorMessage=this.errorMessage)}observeValue(e,r){this._textInput&&e!=r&&(this._textInput.value=e,this.ezChange.emit(e))}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}changeValue(e){const r=e.detail;this.errorMessage="",r!==this.value&&(this.value=r)}componentDidLoad(){c.applyVarsTextInput(this._elem,this._textInput)}render(){return l.addIDInfoIfNotExists(this._elem,"input"),t("ez-text-input",{"data-element-id":l.getInternalIDInfo("textInput"),ref:e=>this._textInput=e,label:this.label,onEzChange:e=>this.changeValue(e),value:this.value,enabled:this.enabled,errorMessage:this.errorMessage,restrict:this.restrict,mode:this.mode},t("ez-icon",{slot:"leftIcon",iconName:"search"}))}get _elem(){return i(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};d.style=":host{display:block;width:100%}";const b=class{constructor(r){e(this,r),this._shadowStart="ez-scroller__wrapper--shadow-start",this._shadowEnd="ez-scroller__wrapper--shadow-end",this.isActive=!1,this.direction=void 0,this.locked=!1,this.activeShadow=!1}getContainerClass(){return`ez-scroller__container ez-scroller__container--${this.direction}\n ${this.locked||!this.isActive?" ez-scroller__container--locked":""}\n `}getWrapperClass(){return`ez-scroller__wrapper ez-scroller__wrapper--${this.direction}`}finishDrag(){this._controller&&this._container.classList.remove("dragging")}updateScroller(){const e=this._container;if(null==e)return;let r;if(this.direction===h.HORIZONTAL){const{scrollWidth:t,clientWidth:i,scrollLeft:s}=e;r=t-i-Math.ceil(s),this._startHidden=e.scrollLeft>0}else if(this.direction===h.VERTICAL){const{scrollHeight:t,clientHeight:i,scrollTop:s}=e;r=t-i-Math.ceil(s),this._startHidden=e.scrollTop>0}this._endHidden=r>0,this.isActive=this._startHidden||this._endHidden||this.isActiveScroller(),this.updateShadow()}updateShadow(){const e=this._wrapper;if(!this.activeShadow||null==e)return;const r=["","start","end","middle"][Number(this._startHidden)|Number(this._endHidden)<<1];"start"===r?(e.classList.add(this._shadowStart),e.classList.remove(this._shadowEnd)):"end"===r?(e.classList.remove(this._shadowStart),e.classList.add(this._shadowEnd)):"middle"===r?(e.classList.add(this._shadowStart),e.classList.add(this._shadowEnd)):(e.classList.remove(this._shadowStart),e.classList.remove(this._shadowEnd))}configResize(){const e=this._container;null!=e&&(null!=this._resizeObserver&&this._resizeObserver.unobserve(e),this._resizeObserver=new ResizeObserver(a.debounce(this.updateScroller.bind(this),200)),this._resizeObserver.observe(e))}getContainerElement(){return t("div",{ref:e=>this._container=e,class:this.getContainerClass()},t("slot",null))}isActiveScroller(){return null!=this._container&&(this._container.scrollWidth>this._container.clientWidth||this._container.scrollHeight>this._container.clientHeight)}clickListener(e){this._controller&&this._controller.didScroll()&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())}mouseDownHandler(e){this.locked?this.finishDrag():(this._controller||(this._controller=new u(this._container)),this._controller.startDragg(e),this._container.classList.add("dragging"))}mouseUpHandler(){this.finishDrag()}mouseMoveHandler(e){this.locked?this.finishDrag():this._controller&&(0===e.buttons?this.finishDrag():this._controller.doScroll(e))}componentDidRender(){var e,r;if(null!=this._container){if(this.direction===h.BOTH)return null===(e=this._wrapper)||void 0===e||e.classList.remove(this._shadowStart),null===(r=this._wrapper)||void 0===r||r.classList.remove(this._shadowEnd),void(this.isActive=this.isActiveScroller());this._container.onscroll=this.updateScroller.bind(this),this.configResize(),this.updateScroller()}}render(){return t(s,null,this.activeShadow?t("div",{ref:e=>this._wrapper=e,class:this.getWrapperClass()},this.getContainerElement()):this.getContainerElement())}};class u{constructor(e){this.scrollablePanel=e}startDragg(e){this.startX=this.measureX(e),this.startY=this.measureY(e),this.scrollWidth=0,this.scrollHeight=0}measureX(e){return e.pageX-this.scrollablePanel.offsetLeft}measureY(e){return e.pageY-this.scrollablePanel.offsetTop}doScroll(e){const r=this.measureX(e),t=this.measureY(e);if(r!=this.startX||t!=this.startY){const e=r-this.startX,i=t-this.startY;this.startX+=e,this.startY+=i,this.scrollWidth+=Math.abs(e),this.scrollHeight+=Math.abs(i),this.scrollablePanel.scrollLeft=Math.max(0,this.scrollablePanel.scrollLeft-e),this.scrollablePanel.scrollTop=Math.max(0,this.scrollablePanel.scrollTop-i)}}didScroll(){return this.scrollHeight>5||this.scrollWidth>5}}b.style=':host{--ez-scroller--box-shadow-color:var(--background--body, #fafcff);--ez-scroller__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-scroller__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-scroller__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-scroller__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-scroller__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-scroller__scrollbar--width:var(--space--small, 6px);display:flex;cursor:grab;width:100%;overflow:hidden}.dragging{cursor:grabbing}.ez-scroller__container{display:flex;overflow-y:hidden;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:transparent transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked),.ez-scroller__container:not(.ez-scroller__container--locked):hover{scrollbar-color:var(--ez-scroller__scrollbar--color-clicked) var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container--both{overflow-y:scroll;overflow-x:scroll;flex-wrap:wrap}.ez-scroller__container--horizontal{overflow-x:scroll;flex-direction:row}.ez-scroller__container--vertical{overflow-y:scroll;flex-direction:column}.ez-scroller__container::-webkit-scrollbar{background-color:transparent;width:var(--ez-scroller__scrollbar--width);height:var(--ez-scroller__scrollbar--width);max-width:var(--ez-scroller__scrollbar--width);min-width:var(--ez-scroller__scrollbar--width)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar{background-color:var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container::-webkit-scrollbar-track{visibility:hidden;background-color:transparent;border-radius:var(--ez-scroller__scrollbar--border-radius)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-track,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-track{background-color:var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container::-webkit-scrollbar-thumb{background-color:transparent;border-radius:var(--ez-scroller__scrollbar--border-radius)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb{background-color:var(--ez-scroller__scrollbar--color-default)}.ez-scroller__container::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container::-webkit-scrollbar-thumb:horizontal:hover{background-color:transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:horizontal:hover,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-scroller__scrollbar--color-hover)}.ez-scroller__container::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container::-webkit-scrollbar-thumb:horizontal:active{background-color:transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:horizontal:active,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-scroller__scrollbar--color-clicked)}.ez-scroller__wrapper{display:flex;position:relative;width:100%;height:auto}.ez-scroller__wrapper--horizontal{flex-direction:row}.ez-scroller__wrapper--vertical{flex-direction:column}.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--shadow-end::after{content:"";display:flex;position:absolute;z-index:1}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-end::after{width:24px;min-height:calc(100% - 10px)}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-start::before{left:0;background:linear-gradient(to right, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-end::after{right:0;background:linear-gradient(to left, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-end::after{min-width:calc(100% - 10px);height:24px}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-start::before{top:0;background:linear-gradient(to bottom, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-end::after{bottom:0;background:linear-gradient(to top, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}';const _=class{constructor(t){e(this,t),this.ezClick=r(this,"ezClick",7)}componentDidLoad(){this._element&&l.addIDInfo(this._element),this._button&&l.addIDInfo(this._button,"button",{id:"embedded"})}render(){return t("button",{type:"button",onClick:()=>{this.ezClick.emit()},ref:e=>this._button=e},t("span",null))}get _element(){return i(this)}};_.style=":host{--ez-sidebar-button--width:6px;--ez-sidebar-button--hover--width:12px;--ez-sidebar-button--height:96px;--ez-sidebar-button--background-color--xlight:var(--background--xlight, #fff);--ez-sidebar-button--background-color--primary:var(--color--primary);--ez-sidebar-button--space--small:var(--space--small, 6px);--ez-sidebar-button--space--medium:var(--space--medium, 12px);--ez-sidebar-button--box-shadow:var(--shadow--small, 0px 0px 16px rgba(0, 38, 111, 0.07));--ez-sidebar-button--hover--box-shadow:var(--shadow--hard, 0px 0px 16px rgba(43, 58, 84, 0.24));--ez-sidebar-button--border--radius-small:var(--border--radius-small);--ez-sidebar-button--border--radius-medium:var(--border--radius-medium)}button{display:flex;background:var(--ez-sidebar-button--background-color--xlight);border:0;border-radius:0 var(--ez-sidebar-button--border--radius-medium) var(--ez-sidebar-button--border--radius-medium) 0;box-shadow:var(--ez-sidebar-button--box-shadow);padding:0;cursor:pointer}span{width:var(--ez-sidebar-button--width);height:var(--ez-sidebar-button--height);margin:var(--ez-sidebar-button--space--medium) var(--ez-sidebar-button--space--small) var(--ez-sidebar-button--space--medium) 0;background:var(--ez-sidebar-button--background-color--primary);border-radius:0 var(--ez-sidebar-button--border--radius-small) var(--ez-sidebar-button--border--radius-small) 0}button:hover{box-shadow:var(--ez-sidebar-button--hover--box-shadow)}button:hover span{width:var(--ez-sidebar-button--hover--width);margin:var(--ez-sidebar-button--space--medium) var(--ez-sidebar-button--space--medium) var(--ez-sidebar-button--space--medium) 0}";const v=(e,r)=>r?e.iconExpanded||"chevron-down":e.iconContracted||"chevron-right",z=e=>e.tooltip||e.label,p=e=>{const{node:r,selectedId:i,itemClick:s,iconClick:o,iconResolver:a,tooltipResolver:n,itemsList:c}=e;if(!r.visible)return;const h=r.item,d=e.level||1,b=r.isDisabled(),u=!b&&h.expanded,_=r.isExpandable(),v=!b&&!r.isPlaceHolder;return v&&c.push(h),t("ul",{class:1===d?"first-level":void 0},t("li",Object.assign({title:n(h,!b,d),class:"tree-item",onClick:()=>v&&s(h)},{disabled:b,selected:h.id===i,[l.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:l.getInternalIDInfo(`ezTreeItem_${h.id}`)}),t("div",{class:"item-icon-box"},_&&t("ez-icon",{id:h.id,class:"item-icon",size:"small",iconName:a(h,u,d),onClick:()=>v&&o(h)})),t("label",{class:"item-label"},h.label)),u&&r.getChildren().map((e=>t(p,{selectedId:i,node:e,itemClick:s,iconClick:o,level:d+1,iconResolver:a,tooltipResolver:n,itemsList:c}))))};class m{constructor(e,r,t,i=!1){this.children=new Map,this.visible=!0,this.item=r,this.parent=t,this._tree=e,this.isPlaceHolder=i,r&&!i?(this._isLazyLoad="function"==typeof r.children||r.childrenCount>0,Array.isArray(r.children)&&(Array.from(r.children).forEach((e=>this.addChild(this._tree,e))),this._childrenLoaded=!0)):(this._isLazyLoad=!1,this._childrenLoaded=!0)}refresh(e){if(this.isPlaceHolder)return;this.item=Object.assign({},e),this._isLazyLoad="function"==typeof this.item.children||this.item.childrenCount>0;const r=this.children;this.children=new Map,Array.isArray(this.item.children)?(Array.from(this.item.children).forEach((e=>{const t=r.get(e.id);t?(t.refresh(e),this.children.set(e.id,t)):this.addChild(this._tree,Object.assign({},e))})),this._childrenLoaded=!0):this._childrenLoaded=!1}isDisabled(){return!this.isPlaceHolder&&this._tree.isNodeDisabled(this.item.id,this.item.disabled)}updateChildren(e){this.isPlaceHolder||this.refresh(Object.assign(Object.assign({},this.item),{children:e}))}addChild(e,r){this.children.has(r.id)||this.children.set(r.id,new m(e,r,this))}addPlaceHolder(){this.children.clear();const e=this.item.id;this.children.set(e,new m(void 0,{id:`placeholder_${e}`,label:"Carregando..."},this,!0))}getNode(e){if(this.children.has(e))return this.children.get(e);const r=Array.from(this.children.values());for(const t of r){const r=t.getNode(e);if(r)return r}}needLoad(){return this._isLazyLoad&&!this._childrenLoaded}isExpandable(){return this._isLazyLoad||this.children.size>0||Array.isArray(this.item.children)}getChildren(){return this.isPlaceHolder?[]:(this.needLoad()&&this._tree.loadChildren(this),Array.from(this.children.values()))}}class g extends m{constructor(e){super(void 0),this._disabledValues=new Map,this._changeCallback=e}async addChildAt(e,r){const t=this.getNode(e);null!=t&&(t.addChild(this,r),this._changeCallback())}setDisabled(e,r){this._disabledValues.set(e,r),this._changeCallback()}isNodeDisabled(e,r){return this._disabledValues.has(e)?this._disabledValues.get(e):r}load(e){if(e===this._currentItems)return;this._currentItems=e;const r=this.children;this.children=new Map,this._disabledValues.clear(),e.forEach((e=>{const t=r.get(e.id);t?(t.refresh(e),this.children.set(e.id,t)):this.addChild(this,Object.assign({},e))}))}setFilterPattern(e){this._filterPattern=n.replaceAccentuatedCharsKeepSymbols(e),this.applyFilter(this),this._changeCallback()}updateItem(e){if(null==e)return;const r=this.getNode(e.id);null!=r&&(Object.keys(e).forEach((t=>r.item[t]=e[t])),this._changeCallback())}async open(e){return new Promise((async r=>{await this.walkPath(this,e,(e=>e.item.expanded=!0)),r()}))}applyFilter(e){if(e.children.forEach((e=>{this.applyFilter(e)})),null==e.item)return;let r=!1;if(n.replaceAccentuatedCharsKeepSymbols(e.item.label).includes(this._filterPattern))r=!0;else{const t=Array.from(e.children.values());for(let i=0;i<t.length;i++)if(t[i].visible){r=!0,e.item.expanded=!0;break}}e.visible=r}async walkPath(e,r,t,i=0){return new Promise((async s=>{const o=r.split(">>").map((e=>e.trim()));if(o.length>i){const s=e.getNode(o[i]);s&&(s.needLoad()&&await this.loadLevel(s),t(s),await this.walkPath(s,r,t,i+1))}s()}))}async loadChildren(e){return new Promise((r=>{this.loadLevel(e).then((()=>{r(),this._changeCallback()}))}))}async loadLevel(e){return new Promise((r=>{e.addPlaceHolder(),(0,e.item.children)(e.item).then((t=>{e.updateChildren(t),r()}))}))}}const w=class{constructor(t){e(this,t),this.ezChange=r(this,"ezChange",7),this.ezOpenItem=r(this,"ezOpenItem",7),this._onItemClick=e=>{this.value=e},this._onIconClick=e=>{this.openClose(e),this.value=e},this._tree=new g((()=>o(this))),this._waintingForLoad=void 0,this.items=[],this.value=void 0,this.selectedId=void 0,this.iconResolver=v,this.tooltipResolver=void 0}async selectItem(e){const r=this._tree.getNode(e);this.value=r?r.item:void 0}async openItem(e){this._waintingForLoad=!0,await this._tree.open(e),this._waintingForLoad=!1}async disableItem(e){[].concat(e).forEach((e=>this._tree.setDisabled(e,!0)))}async enableItem(e){[].concat(e).forEach((e=>this._tree.setDisabled(e,!1)))}async addChild(e,r){var t;null==r&&(r=null===(t=this.value)||void 0===t?void 0:t.id),this._tree.addChildAt(r,e);const i=this._tree.getNode(r);i&&(i.item.expanded=!0)}async applyFilter(e){this._tree.setFilterPattern(e)}observeItems(e,r){e!=r&&this._tree.load(this.items||[])}observeValue(){var e;this.ezChange.emit(this.value),this.selectedId=null===(e=this.value)||void 0===e?void 0:e.id}onKeyDownListener(e){if(!this.value)return;let r=!1;switch(e.key){case"ArrowUp":this.previousItem(),r=!0;break;case"ArrowDown":this.nextItem(),r=!0;break;case"ArrowLeft":this.previousLevel(),r=!0;break;case"ArrowRight":this.nextLevel(),r=!0;break;case" ":this.openClose(this.value),r=!0}r&&(e.stopPropagation(),e.preventDefault())}openClose(e){if(null==e)return;const r=!e.expanded;e.expanded=r,r&&this.ezOpenItem.emit(e),this._tree.updateItem(e)}previousLevel(){var e;if(this.value)if(this.value.expanded)this.value.expanded=!1,this._tree.updateItem(this.value);else{const r=null===(e=this._tree.getNode(this.value.id).parent)||void 0===e?void 0:e.item;r&&(this.value=r)}}nextLevel(){this.value&&this._tree.getNode(this.value.id).isExpandable()&&(this.value.expanded?this.nextItem():(this.value.expanded=!0,this._tree.updateItem(this.value)))}indexOf(e){if(null==e)return-1;for(let r=0;r<this._visibleItems.length;r++)if(this._visibleItems[r].id===e)return r;return-1}selectNextItem(e){var r;const t=this.indexOf(null===(r=this.value)||void 0===r?void 0:r.id)+e;t>-1&&t<this._visibleItems.length&&(this.value=this._visibleItems[t])}nextItem(){this.selectNextItem(1)}previousItem(){this.selectNextItem(-1)}connectedCallback(){this.items&&this._tree.load(this.items)}componentWillRender(){var e;if(!this.selectedId||(null===(e=this.value)||void 0===e?void 0:e.id)===this.selectedId)return;const r=this._tree.getNode(this.selectedId);r?this.value=r.item:this.selectedId=void 0}render(){if(l.addIDInfoIfNotExists(this._element,"ezTree"),null!=this.items)return this._visibleItems=[],t(s,{tabindex:"-1"},this._waintingForLoad?t("label",null,"Carregando..."):this._tree.getChildren().map((e=>{var r;return t(p,{selectedId:null===(r=this.value)||void 0===r?void 0:r.id,node:e,itemClick:this._onItemClick,iconClick:this._onIconClick,iconResolver:this.iconResolver,tooltipResolver:this.tooltipResolver||z,itemsList:this._visibleItems})})))}get _element(){return i(this)}static get watchers(){return{items:["observeItems"],value:["observeValue"]}}};w.style=":host{--ez-tree--border-radius:var(--border--radius-small, 8px);--ez-tree--padding-inline-start:20px;--ez-tree--margin:var(--space--extra-small, 3px);--ez-tree--margin-right:calc(var(--space--small, 6px) + 2px);--ez-tree--font-family:var(--font-pattern, Arial);--ez-tree--font-size:var(--text--medium, 14px);--ez-tree--selected--font-weight:var(--text-weight--large, 600);--ez-tree--font-weight:var(--text-weight--small, 400);--ez-tree--color:var(--title--primary, #2B3A54);--ez-tree--selected--color:var(--color--primary, #008561);--ez-tree--disabled--color:var(--text--disable, #AFB6C0);--ez-tree__tree-item--height:var(--size-medium, 18px);--ez-tree__tree-item--padding:var(--space--small, 6px);--ez-tree__tree-item--background-color:var(--background--xlight, #FFFFFF);--ez-tree__tree-item--selected--background-color:var(--color--primary-300, #E2F4EF);--ez-tree__tree-item--hover--background-color:var(--background--medium, #F0F3F7);--ez-tree__tree-item--disabled--background-color:var(--ez-tree__tree-Item--background-color);--ez-tree__item-icon-box--height:var(--ez-tree__tree-item--height);--ez-tree__item-icon-box--width:var(--size-medium, 18px);--ez-tree__item-icon-box--padding:var(--ez-tree__tree-item--padding);display:flex;flex-direction:column;margin:0 var(--ez-tree--margin) var(--ez-tree--margin) var(--ez-tree--margin);outline:none}ul{list-style-type:none;margin:0;padding-inline-start:var(--ez-tree--padding-inline-start)}ul.first-level{padding-inline-start:0}.tree-item{display:flex;align-items:center;margin-top:var(--ez-tree--margin);margin-right:var(--ez-tree--margin-right);border-radius:var(--ez-tree--border-radius);height:var(--ez-tree__tree-item--height);padding:var(--ez-tree__tree-item--padding)}.tree-item[selected]{background-color:var(--ez-tree__tree-item--selected--background-color)}.tree-item:hover{background-color:var(--ez-tree__tree-item--hover--background-color)}.tree-item[disabled],.tree-item[disabled]:hover{background-color:var(--ez-tree__tree-item--disabled--background-color)}.item-icon-box{display:flex;align-items:center;justify-content:center;width:var(--ez-tree__item-icon-box--width);height:var(--ez-tree__item-icon-box--height);padding:var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) 0}.item-icon{--ez-icon--color:var(--ez-tree--color)}.item-icon:hover{cursor:pointer}.tree-item[selected] .item-icon{--ez-icon--color:var(--ez-tree--selected--color)}.tree-item[disabled] .item-icon{cursor:unset;--ez-icon--color:var(--ez-tree--disabled--color)}.item-label{cursor:inherit;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.tree-item[selected] .item-label{color:var(--ez-tree--selected--color);font-weight:var(--ez-tree--selected--font-weight)}.tree-item[disabled] .item-label{color:var(--ez-tree--disabled--color)}";export{d as ez_filter_input,b as ez_scroller,_ as ez_sidebar_button,w as ez_tree}
|
|
1
|
+
import{r as e,c as r,h as t,g as i,H as s,f as o}from"./p-00ea9b50.js";import{ElementIDUtils as l,JSUtils as a,StringUtils as n}from"@sankhyalabs/core";import{C as c}from"./p-4a5e37a7.js";import{E as h}from"./p-98bb8b16.js";const d=class{constructor(t){e(this,t),this.ezChange=r(this,"ezChange",7),this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.restrict=void 0,this.mode="regular"}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){this._textInput&&(this._textInput.errorMessage=this.errorMessage)}observeValue(e,r){this._textInput&&e!=r&&(this._textInput.value=e,this.ezChange.emit(e))}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}changeValue(e){const r=e.detail;this.errorMessage="",r!==this.value&&(this.value=r)}componentDidLoad(){c.applyVarsTextInput(this._elem,this._textInput)}render(){return l.addIDInfoIfNotExists(this._elem,"input"),t("ez-text-input",{"data-element-id":l.getInternalIDInfo("textInput"),ref:e=>this._textInput=e,label:this.label,onEzChange:e=>this.changeValue(e),value:this.value,enabled:this.enabled,errorMessage:this.errorMessage,restrict:this.restrict,mode:this.mode},t("ez-icon",{slot:"leftIcon",iconName:"search"}))}get _elem(){return i(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};d.style=":host{display:block;width:100%}";const b=class{constructor(r){e(this,r),this._shadowStart="ez-scroller__wrapper--shadow-start",this._shadowEnd="ez-scroller__wrapper--shadow-end",this.isActive=!1,this.direction=void 0,this.locked=!1,this.activeShadow=!1}getContainerClass(){return`ez-scroller__container ez-scroller__container--${this.direction}\n ${this.locked||!this.isActive?" ez-scroller__container--locked":""}\n `}getWrapperClass(){return`ez-scroller__wrapper ez-scroller__wrapper--${this.direction}`}finishDrag(){this._controller&&this._container.classList.remove("dragging")}updateScroller(){const e=this._container;if(null==e)return;let r;if(this.direction===h.HORIZONTAL){const{scrollWidth:t,clientWidth:i,scrollLeft:s}=e;r=t-i-Math.ceil(s),this._startHidden=e.scrollLeft>0}else if(this.direction===h.VERTICAL){const{scrollHeight:t,clientHeight:i,scrollTop:s}=e;r=t-i-Math.ceil(s),this._startHidden=e.scrollTop>0}this._endHidden=r>0,this.isActive=this._startHidden||this._endHidden||this.isActiveScroller(),this.updateShadow()}updateShadow(){const e=this._wrapper;if(!this.activeShadow||null==e)return;const r=["","start","end","middle"][Number(this._startHidden)|Number(this._endHidden)<<1];"start"===r?(e.classList.add(this._shadowStart),e.classList.remove(this._shadowEnd)):"end"===r?(e.classList.remove(this._shadowStart),e.classList.add(this._shadowEnd)):"middle"===r?(e.classList.add(this._shadowStart),e.classList.add(this._shadowEnd)):(e.classList.remove(this._shadowStart),e.classList.remove(this._shadowEnd))}configResize(){const e=this._container;null!=e&&(null!=this._resizeObserver&&this._resizeObserver.unobserve(e),this._resizeObserver=new ResizeObserver(a.debounce(this.updateScroller.bind(this),200)),this._resizeObserver.observe(e))}getContainerElement(){return t("div",{ref:e=>this._container=e,class:this.getContainerClass()},t("slot",null))}isActiveScroller(){return null!=this._container&&(this._container.scrollWidth>this._container.clientWidth||this._container.scrollHeight>this._container.clientHeight)}clickListener(e){this._controller&&this._controller.didScroll()&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())}mouseDownHandler(e){this.locked?this.finishDrag():(this._controller||(this._controller=new u(this._container)),this._controller.startDragg(e),this._container.classList.add("dragging"))}mouseUpHandler(){this.finishDrag()}mouseMoveHandler(e){this.locked?this.finishDrag():this._controller&&(0===e.buttons?this.finishDrag():this._controller.doScroll(e))}componentDidRender(){var e,r;if(null!=this._container){if(this.direction===h.BOTH)return null===(e=this._wrapper)||void 0===e||e.classList.remove(this._shadowStart),null===(r=this._wrapper)||void 0===r||r.classList.remove(this._shadowEnd),void(this.isActive=this.isActiveScroller());this._container.onscroll=this.updateScroller.bind(this),this.configResize(),this.updateScroller()}}render(){return t(s,null,this.activeShadow?t("div",{ref:e=>this._wrapper=e,class:this.getWrapperClass()},this.getContainerElement()):this.getContainerElement())}};class u{constructor(e){this.scrollablePanel=e}startDragg(e){this.startX=this.measureX(e),this.startY=this.measureY(e),this.scrollWidth=0,this.scrollHeight=0}measureX(e){return e.pageX-this.scrollablePanel.offsetLeft}measureY(e){return e.pageY-this.scrollablePanel.offsetTop}doScroll(e){const r=this.measureX(e),t=this.measureY(e);if(r!=this.startX||t!=this.startY){const e=r-this.startX,i=t-this.startY;this.startX+=e,this.startY+=i,this.scrollWidth+=Math.abs(e),this.scrollHeight+=Math.abs(i),this.scrollablePanel.scrollLeft=Math.max(0,this.scrollablePanel.scrollLeft-e),this.scrollablePanel.scrollTop=Math.max(0,this.scrollablePanel.scrollTop-i)}}didScroll(){return this.scrollHeight>5||this.scrollWidth>5}}b.style=':host{--ez-scroller--box-shadow-color:var(--background--body, #fafcff);--ez-scroller__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-scroller__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-scroller__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-scroller__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-scroller__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-scroller__scrollbar--width:var(--space--small, 6px);display:flex;cursor:grab;width:100%;overflow:hidden}.dragging{cursor:grabbing}.ez-scroller__container{display:flex;overflow-y:hidden;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:transparent transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked),.ez-scroller__container:not(.ez-scroller__container--locked):hover{scrollbar-color:var(--ez-scroller__scrollbar--color-clicked) var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container--both{overflow-y:scroll;overflow-x:scroll;flex-wrap:wrap}.ez-scroller__container--horizontal{overflow-x:scroll;flex-direction:row}.ez-scroller__container--vertical{overflow-y:scroll;flex-direction:column}.ez-scroller__container::-webkit-scrollbar{background-color:transparent;width:var(--ez-scroller__scrollbar--width);height:var(--ez-scroller__scrollbar--width);max-width:var(--ez-scroller__scrollbar--width);min-width:var(--ez-scroller__scrollbar--width)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar{background-color:var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container::-webkit-scrollbar-track{visibility:hidden;background-color:transparent;border-radius:var(--ez-scroller__scrollbar--border-radius)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-track,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-track{background-color:var(--ez-scroller__scrollbar--color-background)}.ez-scroller__container::-webkit-scrollbar-thumb{background-color:transparent;border-radius:var(--ez-scroller__scrollbar--border-radius)}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb{background-color:var(--ez-scroller__scrollbar--color-default)}.ez-scroller__container::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container::-webkit-scrollbar-thumb:horizontal:hover{background-color:transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:horizontal:hover,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:vertical:hover,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-scroller__scrollbar--color-hover)}.ez-scroller__container::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container::-webkit-scrollbar-thumb:horizontal:active{background-color:transparent}.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container--both:not(.ez-scroller__container--locked)::-webkit-scrollbar-thumb:horizontal:active,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:vertical:active,.ez-scroller__container:not(.ez-scroller__container--locked):hover::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-scroller__scrollbar--color-clicked)}.ez-scroller__wrapper{display:flex;position:relative;width:100%;height:auto}.ez-scroller__wrapper--horizontal{flex-direction:row}.ez-scroller__wrapper--vertical{flex-direction:column}.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--shadow-end::after{content:"";display:flex;position:absolute;z-index:1}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-end::after{width:24px;min-height:calc(100% - 10px)}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-start::before{left:0;background:linear-gradient(to right, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--horizontal.ez-scroller__wrapper--shadow-end::after{right:0;background:linear-gradient(to left, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-start::before,.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-end::after{min-width:calc(100% - 10px);height:24px}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-start::before{top:0;background:linear-gradient(to bottom, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}.ez-scroller__wrapper--vertical.ez-scroller__wrapper--shadow-end::after{bottom:0;background:linear-gradient(to top, var(--ez-scroller--box-shadow-color) 20%, transparent 80%)}';const _=class{constructor(t){e(this,t),this.ezClick=r(this,"ezClick",7)}componentDidLoad(){this._element&&l.addIDInfo(this._element),this._button&&l.addIDInfo(this._button,"button",{id:"embedded"})}render(){return t("button",{type:"button",onClick:()=>{this.ezClick.emit()},ref:e=>this._button=e},t("span",null))}get _element(){return i(this)}};_.style=":host{--ez-sidebar-button--width:6px;--ez-sidebar-button--hover--width:12px;--ez-sidebar-button--height:96px;--ez-sidebar-button--background-color--xlight:var(--background--xlight, #fff);--ez-sidebar-button--background-color--primary:var(--color--primary);--ez-sidebar-button--space--small:var(--space--small, 6px);--ez-sidebar-button--space--medium:var(--space--medium, 12px);--ez-sidebar-button--box-shadow:var(--shadow--small, 0px 0px 16px rgba(0, 38, 111, 0.07));--ez-sidebar-button--hover--box-shadow:var(--shadow--hard, 0px 0px 16px rgba(43, 58, 84, 0.24));--ez-sidebar-button--border--radius-small:var(--border--radius-small);--ez-sidebar-button--border--radius-medium:var(--border--radius-medium)}button{display:flex;background:var(--ez-sidebar-button--background-color--xlight);border:0;border-radius:0 var(--ez-sidebar-button--border--radius-medium) var(--ez-sidebar-button--border--radius-medium) 0;box-shadow:var(--ez-sidebar-button--box-shadow);padding:0;cursor:pointer}span{width:var(--ez-sidebar-button--width);height:var(--ez-sidebar-button--height);margin:var(--ez-sidebar-button--space--medium) var(--ez-sidebar-button--space--small) var(--ez-sidebar-button--space--medium) 0;background:var(--ez-sidebar-button--background-color--primary);border-radius:0 var(--ez-sidebar-button--border--radius-small) var(--ez-sidebar-button--border--radius-small) 0}button:hover{box-shadow:var(--ez-sidebar-button--hover--box-shadow)}button:hover span{width:var(--ez-sidebar-button--hover--width);margin:var(--ez-sidebar-button--space--medium) var(--ez-sidebar-button--space--medium) var(--ez-sidebar-button--space--medium) 0}";const v=(e,r)=>r?e.iconExpanded||"chevron-down":e.iconContracted||"chevron-right",z=e=>e.tooltip||e.label,p=e=>{const{node:r,selectedId:i,itemClick:s,iconClick:o,iconResolver:a,tooltipResolver:n,itemsList:c}=e;if(!r.visible)return;const h=r.item,d=e.level||1,b=r.isDisabled(),u=!b&&h.expanded,_=r.isExpandable(),v=!b&&!r.isPlaceHolder;return v&&c.push(h),t("ul",{class:1===d?"first-level":void 0},t("li",Object.assign({title:n(h,!b,d),class:"tree-item",onClick:()=>v&&s(h)},{disabled:b,selected:h.id===i,[l.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:l.getInternalIDInfo(`ezTreeItem_${h.id}`)}),t("div",{class:"item-icon-box"},_&&t("ez-icon",{id:h.id,class:"item-icon",size:"small",iconName:a(h,u,d),onClick:()=>v&&o(h)})),t("label",{class:"item-label"},h.label)),u&&r.getChildren().map((e=>t(p,{selectedId:i,node:e,itemClick:s,iconClick:o,level:d+1,iconResolver:a,tooltipResolver:n,itemsList:c}))))};class m{constructor(e,r,t,i=!1){this.children=new Map,this.visible=!0,this.item=r,this.parent=t,this._tree=e,this.isPlaceHolder=i,r&&!i?(this._isLazyLoad="function"==typeof r.children||r.childrenCount>0,Array.isArray(r.children)&&(Array.from(r.children).forEach((e=>this.addChild(this._tree,e))),this._childrenLoaded=!0)):(this._isLazyLoad=!1,this._childrenLoaded=!0)}refresh(e){if(this.isPlaceHolder)return;this.item=Object.assign({},e),this._isLazyLoad="function"==typeof this.item.children||this.item.childrenCount>0;const r=this.children;this.children=new Map,Array.isArray(this.item.children)?(Array.from(this.item.children).forEach((e=>{const t=r.get(e.id);t?(t.refresh(e),this.children.set(e.id,t)):this.addChild(this._tree,Object.assign({},e))})),this._childrenLoaded=!0):this._childrenLoaded=!1}isDisabled(){return!this.isPlaceHolder&&this._tree.isNodeDisabled(this.item.id,this.item.disabled)}updateChildren(e){this.isPlaceHolder||this.refresh(Object.assign(Object.assign({},this.item),{children:e}))}addChild(e,r){this.children.has(r.id)||this.children.set(r.id,new m(e,r,this))}addPlaceHolder(){this.children.clear();const e=this.item.id;this.children.set(e,new m(void 0,{id:`placeholder_${e}`,label:"Carregando..."},this,!0))}getNode(e){if(this.children.has(e))return this.children.get(e);const r=Array.from(this.children.values());for(const t of r){const r=t.getNode(e);if(r)return r}}needLoad(){return this._isLazyLoad&&!this._childrenLoaded}isExpandable(){return this._isLazyLoad||this.children.size>0||Array.isArray(this.item.children)}getChildren(){return this.isPlaceHolder?[]:(this.needLoad()&&this._tree.loadChildren(this),Array.from(this.children.values()))}}class g extends m{constructor(e){super(void 0),this._disabledValues=new Map,this._changeCallback=e}async addChildAt(e,r){const t=this.getNode(e);null!=t&&(t.addChild(this,r),this._changeCallback())}setDisabled(e,r){this._disabledValues.set(e,r),this._changeCallback()}isNodeDisabled(e,r){return this._disabledValues.has(e)?this._disabledValues.get(e):r}load(e){if(e===this._currentItems)return;this._currentItems=e;const r=this.children;this.children=new Map,this._disabledValues.clear(),e.forEach((e=>{const t=r.get(e.id);t?(t.refresh(e),this.children.set(e.id,t)):this.addChild(this,Object.assign({},e))}))}setFilterPattern(e){this._filterPattern=n.replaceAccentuatedCharsKeepSymbols(e),this.applyFilter(this),this._changeCallback()}updateItem(e){if(null==e)return;const r=this.getNode(e.id);null!=r&&(Object.keys(e).forEach((t=>r.item[t]=e[t])),this._changeCallback())}async open(e){return new Promise((async r=>{await this.walkPath(this,e,(e=>e.item.expanded=!0)),r()}))}applyFilter(e){if(e.children.forEach((e=>{this.applyFilter(e)})),null==e.item)return;let r=!1;if(n.replaceAccentuatedCharsKeepSymbols(e.item.label).includes(this._filterPattern))r=!0;else{const t=Array.from(e.children.values());for(let i=0;i<t.length;i++)if(t[i].visible){r=!0,e.item.expanded=!0;break}}e.visible=r}async walkPath(e,r,t,i=0){return new Promise((async s=>{const o=r.split(">>").map((e=>e.trim()));if(o.length>i){const s=e.getNode(o[i]);s&&(s.needLoad()&&await this.loadLevel(s),t(s),await this.walkPath(s,r,t,i+1))}s()}))}async loadChildren(e){return new Promise((r=>{this.loadLevel(e).then((()=>{r(),this._changeCallback()}))}))}async loadLevel(e){return new Promise((r=>{e.addPlaceHolder(),(0,e.item.children)(e.item).then((t=>{e.updateChildren(t),r()}))}))}}const w=class{constructor(t){e(this,t),this.ezChange=r(this,"ezChange",7),this.ezOpenItem=r(this,"ezOpenItem",7),this._onItemClick=e=>{this.value=e},this._onIconClick=e=>{this.openClose(e),this.value=e},this._tree=new g((()=>o(this))),this._waintingForLoad=void 0,this.items=[],this.value=void 0,this.selectedId=void 0,this.iconResolver=v,this.tooltipResolver=void 0}async selectItem(e){const r=this._tree.getNode(e);this.value=r?r.item:void 0}async openItem(e){this._waintingForLoad=!0,await this._tree.open(e),this._waintingForLoad=!1}async disableItem(e){[].concat(e).forEach((e=>this._tree.setDisabled(e,!0)))}async enableItem(e){[].concat(e).forEach((e=>this._tree.setDisabled(e,!1)))}async addChild(e,r){var t;null==r&&(r=null===(t=this.value)||void 0===t?void 0:t.id),this._tree.addChildAt(r,e);const i=this._tree.getNode(r);i&&(i.item.expanded=!0)}async applyFilter(e){this._tree.setFilterPattern(e)}observeItems(e,r){e!=r&&this._tree.load(this.items||[])}observeValue(){var e;this.ezChange.emit(this.value),this.selectedId=null===(e=this.value)||void 0===e?void 0:e.id}onKeyDownListener(e){if(!this.value)return;let r=!1;switch(e.key){case"ArrowUp":this.previousItem(),r=!0;break;case"ArrowDown":this.nextItem(),r=!0;break;case"ArrowLeft":this.previousLevel(),r=!0;break;case"ArrowRight":this.nextLevel(),r=!0;break;case" ":this.openClose(this.value),r=!0}r&&(e.stopPropagation(),e.preventDefault())}openClose(e){if(null==e)return;const r=!e.expanded;e.expanded=r,r&&this.ezOpenItem.emit(e),this._tree.updateItem(e)}previousLevel(){var e;if(this.value)if(this.value.expanded)this.value.expanded=!1,this._tree.updateItem(this.value);else{const r=null===(e=this._tree.getNode(this.value.id).parent)||void 0===e?void 0:e.item;r&&(this.value=r)}}nextLevel(){this.value&&this._tree.getNode(this.value.id).isExpandable()&&(this.value.expanded?this.nextItem():(this.value.expanded=!0,this._tree.updateItem(this.value)))}indexOf(e){if(null==e)return-1;for(let r=0;r<this._visibleItems.length;r++)if(this._visibleItems[r].id===e)return r;return-1}selectNextItem(e){var r;const t=this.indexOf(null===(r=this.value)||void 0===r?void 0:r.id)+e;t>-1&&t<this._visibleItems.length&&(this.value=this._visibleItems[t])}nextItem(){this.selectNextItem(1)}previousItem(){this.selectNextItem(-1)}connectedCallback(){this.items&&this._tree.load(this.items)}componentWillRender(){var e;if(!this.selectedId||(null===(e=this.value)||void 0===e?void 0:e.id)===this.selectedId)return;const r=this._tree.getNode(this.selectedId);r?this.value=r.item:this.selectedId=void 0}render(){if(l.addIDInfoIfNotExists(this._element,"ezTree"),null!=this.items)return this._visibleItems=[],t(s,{tabindex:"-1"},this._waintingForLoad?t("label",null,"Carregando..."):this._tree.getChildren().map((e=>{var r;return t(p,{selectedId:null===(r=this.value)||void 0===r?void 0:r.id,node:e,itemClick:this._onItemClick,iconClick:this._onIconClick,iconResolver:this.iconResolver,tooltipResolver:this.tooltipResolver||z,itemsList:this._visibleItems})})))}get _element(){return i(this)}static get watchers(){return{items:["observeItems"],value:["observeValue"]}}};w.style=":host{--ez-tree--border-radius:var(--border--radius-small, 8px);--ez-tree--padding-inline-start:20px;--ez-tree--margin:var(--space--extra-small, 3px);--ez-tree--margin-right:calc(var(--space--small, 6px) + 2px);--ez-tree--font-family:var(--font-pattern, Arial);--ez-tree--font-size:var(--text--medium, 14px);--ez-tree--selected--font-weight:var(--text-weight--large, 600);--ez-tree--font-weight:var(--text-weight--small, 400);--ez-tree--color:var(--title--primary, #2B3A54);--ez-tree--selected--color:var(--color--primary, #008561);--ez-tree--disabled--color:var(--text--disable, #AFB6C0);--ez-tree__tree-item--height:var(--size-medium, 18px);--ez-tree__tree-item--padding:var(--space--small, 6px);--ez-tree__tree-item--background-color:var(--background--xlight, #FFFFFF);--ez-tree__tree-item--selected--background-color:var(--color--primary-300, #E2F4EF);--ez-tree__tree-item--hover--background-color:var(--background--medium, #F0F3F7);--ez-tree__tree-item--disabled--background-color:var(--ez-tree__tree-Item--background-color);--ez-tree__item-icon-box--height:var(--ez-tree__tree-item--height);--ez-tree__item-icon-box--width:var(--size-medium, 18px);--ez-tree__item-icon-box--padding:var(--ez-tree__tree-item--padding);display:flex;flex-direction:column;margin:0 var(--ez-tree--margin) var(--ez-tree--margin) var(--ez-tree--margin);outline:none}ul{list-style-type:none;margin:0;padding-inline-start:var(--ez-tree--padding-inline-start)}ul.first-level{padding-inline-start:0}.tree-item{display:flex;align-items:center;margin-top:var(--ez-tree--margin);margin-right:var(--ez-tree--margin-right);border-radius:var(--ez-tree--border-radius);height:var(--ez-tree__tree-item--height);padding:var(--ez-tree__tree-item--padding)}.tree-item[selected]{background-color:var(--ez-tree__tree-item--selected--background-color)}.tree-item:hover{background-color:var(--ez-tree__tree-item--hover--background-color)}.tree-item[disabled],.tree-item[disabled]:hover{background-color:var(--ez-tree__tree-item--disabled--background-color)}.item-icon-box{display:flex;align-items:center;justify-content:center;width:var(--ez-tree__item-icon-box--width);height:var(--ez-tree__item-icon-box--height);padding:var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) 0}.item-icon{--ez-icon--color:var(--ez-tree--color)}.item-icon:hover{cursor:pointer}.tree-item[selected] .item-icon{--ez-icon--color:var(--ez-tree--selected--color)}.tree-item[disabled] .item-icon{cursor:unset;--ez-icon--color:var(--ez-tree--disabled--color)}.item-label{cursor:inherit;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.tree-item[selected] .item-label{color:var(--ez-tree--selected--color);font-weight:var(--ez-tree--selected--font-weight)}.tree-item[disabled] .item-label{color:var(--ez-tree--disabled--color)}";export{d as ez_filter_input,b as ez_scroller,_ as ez_sidebar_button,w as ez_tree}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,c as i,h as t,H as e,g as s}from"./p-00ea9b50.js";import{FloatingManager as r,ElementIDUtils as l}from"@sankhyalabs/core";import{A as a}from"./p-efb43dd8.js";import{C as h}from"./p-4a5e37a7.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{R as n}from"./p-3f4ae3a3.js";const c=class{constructor(t){o(this,t),this.ezChange=i(this,"ezChange",7),this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._textEmptyList="Nenhum resultado encontrado",this._textEmptySearch="Nenhum resultado de {0} encontrado",this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._criteria=void 0,this.value=void 0,this.label=void 0,this.enabled=!0,this.options=void 0,this.errorMessage=void 0,this.searchMode=void 0,this.showSelectedValue=!1,this.showOptionValue=!1,this.suppressSearch=!1,this.optionLoader=void 0,this.suppressEmptyOption=!1,this.canShowError=!0,this.mode="regular"}observeErrorMessage(){var o;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(o=this.errorMessage)||void 0===o?void 0:o.trim())||this.setInputValue())}observeValue(o,i){if(this._textInput&&o!=i){const t=this.getSelectedOption(o),e=this.getSelectedOption(i),s=this.getSelectedOption(this.value);this.isDifferentValues(s,t)&&(this.value=t),this.isDifferentValues(t,e)&&(this.setInputValue(),this.ezChange.emit(null===t?void 0:t)),this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}isDifferentValues(o,i){return JSON.stringify(o||{})!==JSON.stringify(i||{})}getFormattedText(o){if(null!=o){if(!this.showSelectedValue||null==o.value)return o.label;if(o.label)return`${o.value} - ${o.label}`}}getText(){const o=this.getSelectedOption(this.value),i=this.getFormattedText(o);if(null!=i)return String(i).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}getSelectedOption(o){return"string"==typeof o||o instanceof String?this._visibleOptions.find((i=>i.value===o)):o}updateVisibleOptions(){let o=this._source||[];if(!this.searchMode&&this._criteria){const i=this._criteria.toUpperCase();o=o.filter((o=>o.label.toLocaleUpperCase().indexOf(i)>-1))}this._visibleOptions=this.suppressEmptyOption?o:[{value:void 0,label:""}].concat(o),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var o;if(this.showOptionValue){const i=[];return null===(o=this._visibleOptions)||void 0===o||o.forEach((o=>{const t=this.getWidthValue(o.value);i.includes(t)||i.push(t)})),i.length>1?Math.max(...i):0}return 0}getWidthValue(o){if(null!=this._itemValueBasis){const i=this._itemValueBasis;if(null!=o)return i.innerHTML=o,i.clientWidth>0?i.clientWidth+2:0;i.innerHTML=""}return 0}buildItem(o,i){const e=this.showOptionValue&&this._maxWidthValue>0?`${this._maxWidthValue}px`:"";return o.label=o.label||(o.value?`<SEM ${this.getFieldLabel()}>`:""),t("li",{class:i===this._preSelection?"item preselected":"item",id:`item_${o.value}`,onMouseDown:()=>this.selectOption(o),onMouseOver:()=>this._preSelection=i},this.showOptionValue?t("span",{class:"item__value",title:o.value,style:{width:e,minWidth:e,maxWidth:e}},o.value):void 0,t("span",{class:"item__label "+(this.showOptionValue?"item__label--bold":""),title:o.label},o.label))}showOptions(){this.enabled&&(this._floatingID=r.float(this._listWrapper,this._listContainer,{autoClose:!0,top:this.errorMessage||!this.canShowError||"slim"===this.mode?"6px":"-13px"}),this.setFocus(),window.requestAnimationFrame((()=>{this._listWrapper.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})))}hideOptions(){void 0!==this._floatingID&&r.close(this._floatingID),this._floatingID=void 0}isOptionsVisible(){return void 0!==this._floatingID&&r.isFloating(this._floatingID)}nextOption(){this.searchMode&&!this.isOptionsVisible()||(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection],!0))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection],!1)}scrollToOption(o,i){window.requestAnimationFrame((()=>{const t=(null==o?void 0:o.value)?this._optionsList.querySelector(`li#item_${o.value}`):void 0;if(t){const o=t.parentElement,e=o.getBoundingClientRect(),s=t.getBoundingClientRect();i&&s.bottom>e.bottom?o.scrollTop=s.height*(this._preSelection-3):!i&&s.top<e.top&&(o.scrollTop=s.height*this._preSelection)}}))}selectCurrentOption(){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(o){this._startLoading=!1,o instanceof Promise?(this._showLoading=!0,o.then((o=>{this._showLoading=!1,this.updateSource(o)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(o)?(this._source=o,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch())):this.selectOption(o))}clearSource(){this._source=[],this.updateVisibleOptions()}selectOption(o){var i,t;const e=this.getSelectedOption(this.value);(null===(i=null==e?void 0:e.value)||void 0===i?void 0:i.toString())!==(null===(t=null==o?void 0:o.value)||void 0===t?void 0:t.toString())?this.value=(null==o?void 0:o.value)?o:void 0:(this.setInputValue(),this.hideOptions()),this.searchMode&&(this._visibleOptions=[]),this.searchMode&&(this._visibleOptions=[])}loadOptions(o,i=""){this._criteria=i,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:o,argument:i}):this.options)}cancelPreselection(){!this._textInput.value&&this.value?this.selectOption(void 0):this.setInputValue()}setInputValue(o=!0){const i=this.getText();(this._textInput.value||"")!==i&&(this._textInput.value=i,o&&(this.errorMessage=null))}clearSearch(){this.value=null}controlListWithOnlyOne(){if(this.searchMode){const o=this._visibleOptions;1===(null==o?void 0:o.length)&&this.selectOption(o[0])}}controlEmptySearch(){var o;this.searchMode&&((null===(o=this._visibleOptions)||void 0===o?void 0:o.length)?this.controlListWithOnlyOne():(this.clearSearch(),a.info(this._textEmptyList)))}validateDescriptionValue(){if(!this.searchMode||"object"!=typeof this.value)return;const{label:o,value:i}=this.value||{};o||null==i||this.loadDescriptionValue(i)}async loadDescriptionValue(o){var i,t;if(null==o)return;if((null===(i=this.options)||void 0===i?void 0:i.length)>0)return void this.loadOptionValue(o);const e={mode:b.PREDICTIVE,argument:o},s=await(null===(t=this.optionLoader)||void 0===t?void 0:t.call(this,e));null!=s&&(s instanceof Promise?s.then((o=>{this.setDescriptionValue(o)})):this.setDescriptionValue(s))}setDescriptionValue(o){const i=(null==o?void 0:o[0])||o;null!=i&&Object.keys(i).length?(i.label||(i.label=`<SEM ${this.getFieldLabel()}>`),this.value=i):this.showNoResultMessage()}loadOptionValue(o){var i;const t=null===(i=this.options)||void 0===i?void 0:i.find((i=>i.value===o));null!=t?this.selectOption(t):this.showNoResultMessage()}async showNoResultMessage(){this.clearSearch(),a.info(this._textEmptySearch.replace("{0}",this.getFieldLabel()))}getFieldLabel(){var o;return null===(o=this.label)||void 0===o?void 0:o.replace(n,"").toUpperCase()}componentWillLoad(){if(void 0===this.options){this.options=[];const o=this.el.querySelectorAll("option");o&&o.forEach((o=>{let i=o.innerText,t=o.getAttribute("value");t||(t=i),this.options.push({label:i,value:t}),o.hidden=!0}))}this.searchMode?this.updateSource([]):this.loadOptions(b.PRELOAD)}componentDidRender(){var o;void 0===this._floatingID&&this._listWrapper.remove(),null===(o=this._optionsList)||void 0===o||o.querySelectorAll(".item").forEach((o=>{l.addIDInfoIfNotExists(o,"itemComboBox")}))}componentDidLoad(){h.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1)}componentShouldUpdate(o,i){this.isDifferentValues(o,i)&&this.validateDescriptionValue()}handlerIconClick(){this.searchMode?this.loadOptions(b.ADVANCED):this.showOptions()}onTextInputChangeHandler(o){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(o)}),this._deboucingTime));const t=null===(i=o.target.value)||void 0===i?void 0:i.trim(),e=Number(t||void 0);this._criteria||(this._textInput.value=o.data||t),this._criteria=t,t&&(!isNaN(e)||t.length>=this._limitCharsToSearch)?(this.searchMode?(this._showLoading=!0,this.clearSource(),this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions(b.PREDICTIVE,isNaN(e)?t:e.toString())}),this._deboucingTime)):this.updateVisibleOptions(),this.showOptions()):this.hideOptions()}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}onTextInputClickHandler(){this.searchMode||this.showOptions()}keyDownHandler(o){switch(this._tabPressed=!1,o.ctrlKey&&("f"!==o.key&&"F"!==o.key||(this.loadOptions(b.ADVANCED),o.stopPropagation(),o.stopImmediatePropagation(),o.preventDefault())),o.key){case"ArrowDown":this.nextOption();break;case"ArrowUp":this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.controlListWithOnlyOne()}}onTextInputFocusOutHandler(){this.cancelPreselection()}render(){var o;return l.addIDInfoIfNotExists(this.el,"input"),t(e,null,t("ez-text-input",{"data-element-id":l.getInternalIDInfo("textInput"),class:this.suppressSearch?"suppressed-search-input":"",ref:o=>this._textInput=o,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:o=>this.onTextInputChangeHandler(o),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:o=>this.keyDownHandler(o),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode},t("button",{class:"btn",slot:this.searchMode?"leftIcon":"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},t("ez-icon",{iconName:this.searchMode?"search":"chevron-down"})),this.searchMode&&(null===(o=this._textInput)||void 0===o?void 0:o.value)&&(this._criteria||this.value)?t("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},t("ez-icon",{iconName:"close"})):void 0),t("section",{class:"list-container",ref:o=>this._listContainer=o},t("div",{class:"list-wrapper",ref:o=>this._listWrapper=o},t("div",{class:"list-options",ref:o=>this._optionsList=o},0===this._visibleOptions.length&&t("div",{class:"message"},!this._showLoading&&t("span",{class:"message__no-result"},this._textEmptyList),this._showLoading&&t("div",{class:"message__loading"})),this.showOptionValue?t("span",{class:"item__value item__value--hidden",ref:o=>this._itemValueBasis=o}):void 0,this._visibleOptions.length>0&&this._visibleOptions.map(((o,i)=>this.buildItem(o,i)))))))}get el(){return s(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"]}}};var b;!function(o){o.ADVANCED="ADVANCED",o.PRELOAD="PRELOAD",o.PREDICTIVE="PREDICTIVE"}(b||(b={})),c.style=":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box--line-height:calc(var(--text--medium, 14px) + 4px);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn--color:var(--title--primary, #2B3A54);--ez-combo-box__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-hover--color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #2B3A54);--ez-combo-box__list-title--primary:var(--title--primary, #2B3A54);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium) + 4px);--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);--ez-combo-box__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-combo-box__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-combo-box__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-combo-box__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-combo-box__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-combo-box__scrollbar--width:var(--space--medium, 12px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.list-container{position:relative;width:100%}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small) + 9px);background-color:var(--ez-combo-box--background-color--xlight);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);padding:var(--ez-combo-box--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-combo-box__scrollbar--color-clicked) var(--ez-combo-box__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-combo-box__scrollbar--color-background);width:var(--ez-combo-box__scrollbar--width);max-width:var(--ez-combo-box__scrollbar--width);min-width:var(--ez-combo-box__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-combo-box__scrollbar--color-background);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-combo-box__scrollbar--color-default);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-combo-box__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-combo-box__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-combo-box--border-radius-small);padding:var(--ez-combo-box--space--small);min-height:var(--ez-combo-box__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size);line-height:var(--ez-combo-box--line-height)}.item__label{font-weight:var(--ez-combo-box--font-weight--medium)}.item__label--bold{font-weight:var(--ez-combo-box--font-weight--large)}.item__value{text-align:center;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-combo-box__list-height)}.message__no-result{color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-combo-box__list-title--primary);border-top:3px solid transparent}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:hover{color:var(--ez-combo-box__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{c as ez_combo_box}
|