@sankhyalabs/ezui 7.1.0-dev.2 → 7.1.0-dev.21
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-d04f5c94.js → ApplicationUtils-4fb87a9e.js} +1 -1
- package/dist/cjs/{app-globals-c128c97e.js → app-globals-cb31a206.js} +1 -1
- package/dist/cjs/ez-actions-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-avatar.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.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-list_4.cjs.entry.js → ez-combo-box-list_5.cjs.entry.js} +150 -3
- package/dist/cjs/ez-combo-box.cjs.entry.js +2 -2
- package/dist/cjs/ez-date-input.cjs.entry.js +11 -4
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +2 -2
- package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +15 -7
- package/dist/cjs/ez-form.cjs.entry.js +17 -6
- package/dist/cjs/ez-grid.cjs.entry.js +12 -5
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-link-builder_6.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +16 -17
- package/dist/cjs/ez-modal.cjs.entry.js +2 -2
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +3 -1
- package/dist/cjs/ez-pagination.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +20 -8
- package/dist/cjs/ez-search-plus.cjs.entry.js +18 -4
- package/dist/cjs/ez-search-result-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +30 -26
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ez-sortable-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-spinner.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-split-item.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-tooltip.cjs.entry.js +13 -2
- package/dist/cjs/ez-tree.cjs.entry.js +155 -8
- package/dist/cjs/ez-upload.cjs.entry.js +2 -2
- package/dist/cjs/ezui.cjs.js +3 -3
- package/dist/cjs/filter-column.cjs.entry.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +2 -2
- package/dist/cjs/{index-00d0166b.js → index-e61642ff.js} +24 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{purify-47a2f27b.js → purify-b30a5718.js} +41 -12
- package/dist/cjs/{search-column-9aa090ec.js → search-column-51e50b59.js} +3 -3
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ez-chip/ez-chip.css +3 -0
- package/dist/collection/components/ez-date-input/ez-date-input.js +28 -3
- package/dist/collection/components/ez-dialog/ez-dialog.css +6 -1
- package/dist/collection/components/ez-form/ez-form.js +23 -1
- package/dist/collection/components/ez-form-view/ez-form-view.js +24 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +4 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ImageInput.tpl.js +4 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +3 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +5 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +3 -0
- package/dist/collection/components/ez-image-input/ez-image-input.css +173 -0
- package/dist/collection/components/ez-image-input/ez-image-input.js +324 -0
- package/dist/collection/components/ez-modal/ez-modal.css +3 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -9
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +32 -15
- package/dist/collection/components/ez-number-input/ez-number-input.js +16 -0
- package/dist/collection/components/ez-popup/ez-popup.css +9 -4
- package/dist/collection/components/ez-popup/ez-popup.js +24 -7
- package/dist/collection/components/ez-search/ez-search.js +41 -19
- package/dist/collection/components/ez-search-plus/ez-search-plus.js +16 -2
- package/dist/collection/components/ez-split-button/ez-split-button.css +7 -2
- package/dist/collection/components/ez-text-input/ez-text-input.css +3 -3
- package/dist/collection/components/ez-tooltip/ez-tooltip.js +13 -2
- package/dist/collection/components/ez-tree/ez-tree.css +4 -0
- package/dist/collection/components/ez-tree/ez-tree.js +185 -6
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +4 -1
- package/dist/collection/components/ez-tree/types/Node.js +7 -0
- package/dist/collection/components/ez-tree/types/Tree.js +19 -0
- package/dist/collection/components/ez-tree/types/UpdateItemConfig.js +1 -0
- package/dist/collection/utils/form/DataBinder.js +1 -1
- package/dist/collection/utils/form/FormMetadata.js +12 -2
- package/dist/collection/utils/i18n/locales/en-us.js +8 -0
- package/dist/collection/utils/i18n/locales/es-es.js +8 -0
- package/dist/collection/utils/i18n/locales/pt-br.js +8 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +530 -105
- package/dist/esm/{ApplicationUtils-12768f5a.js → ApplicationUtils-985c24ae.js} +1 -1
- package/dist/esm/{app-globals-9507c20e.js → app-globals-75f8a758.js} +1 -1
- package/dist/esm/ez-actions-button.entry.js +2 -2
- package/dist/esm/ez-alert-list.entry.js +1 -1
- package/dist/esm/ez-avatar.entry.js +1 -1
- package/dist/esm/ez-calendar.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-list_4.entry.js → ez-combo-box-list_5.entry.js} +150 -4
- package/dist/esm/ez-combo-box.entry.js +2 -2
- package/dist/esm/ez-date-input.entry.js +11 -4
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +2 -2
- package/dist/esm/ez-double-list.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +15 -7
- package/dist/esm/ez-form.entry.js +17 -6
- package/dist/esm/ez-grid.entry.js +12 -5
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-link-builder_6.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +16 -17
- package/dist/esm/ez-modal.entry.js +2 -2
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +3 -1
- package/dist/esm/ez-pagination.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +20 -8
- package/dist/esm/ez-search-plus.entry.js +18 -4
- package/dist/esm/ez-search-result-list.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +25 -21
- package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
- package/dist/esm/ez-skeleton.entry.js +1 -1
- package/dist/esm/ez-sortable-list.entry.js +1 -1
- package/dist/esm/ez-spinner.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +2 -2
- package/dist/esm/ez-split-item.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-tooltip.entry.js +13 -2
- package/dist/esm/ez-tree.entry.js +155 -8
- package/dist/esm/ez-upload.entry.js +2 -2
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/filter-column.entry.js +1 -1
- package/dist/esm/{index-62fc771e.js → index-a3b24b5d.js} +24 -0
- package/dist/esm/index-baa5e267.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{purify-dc6814bf.js → purify-9357603c.js} +41 -12
- package/dist/esm/{search-column-83562552.js → search-column-0c42248b.js} +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-e882635e.entry.js → p-0aafbc30.entry.js} +1 -1
- package/dist/ezui/{p-0c0eb410.entry.js → p-0e325699.entry.js} +1 -1
- package/dist/ezui/{p-5a11cf56.js → p-0ec5c128.js} +1 -1
- package/dist/ezui/p-1bf40959.entry.js +1 -0
- package/dist/ezui/p-1c3f43e8.entry.js +1 -0
- package/dist/ezui/{p-1cde96f9.entry.js → p-2676e2a3.entry.js} +1 -1
- package/dist/ezui/{p-e27d7dc2.entry.js → p-28af6826.entry.js} +1 -1
- package/dist/ezui/{p-1adf7139.entry.js → p-2b23906a.entry.js} +1 -1
- package/dist/ezui/{p-1730ee24.entry.js → p-2e5de2a7.entry.js} +1 -1
- package/dist/ezui/{p-5ab08b60.entry.js → p-2fd16ff2.entry.js} +1 -1
- package/dist/ezui/{p-d66bf34e.entry.js → p-3d71e8e1.entry.js} +2 -2
- package/dist/ezui/{p-6f119d5f.entry.js → p-3fcf79c7.entry.js} +1 -1
- package/dist/ezui/p-474076b3.js +1 -0
- package/dist/ezui/{p-a401041c.entry.js → p-47d9256e.entry.js} +1 -1
- package/dist/ezui/{p-124699e0.entry.js → p-4ea5c8a7.entry.js} +1 -1
- package/dist/ezui/p-582c3f90.entry.js +1 -0
- package/dist/ezui/{p-6a9a20a0.entry.js → p-5e6de2c1.entry.js} +1 -1
- package/dist/ezui/{p-2a70f094.entry.js → p-6570ca10.entry.js} +1 -1
- package/dist/ezui/{p-e99cbb51.entry.js → p-67f9fadb.entry.js} +1 -1
- package/dist/ezui/p-6a982147.js +1 -0
- package/dist/ezui/p-6c484770.entry.js +1 -0
- package/dist/ezui/{p-1266fe78.entry.js → p-6d7f2fdc.entry.js} +1 -1
- package/dist/ezui/p-6f466aec.entry.js +1 -0
- package/dist/ezui/{p-3fe05d6b.entry.js → p-714452c7.entry.js} +1 -1
- package/dist/ezui/{p-957d08cd.entry.js → p-7624767b.entry.js} +1 -1
- package/dist/ezui/p-782fe2e3.entry.js +1 -0
- package/dist/ezui/p-8709c4f6.entry.js +1 -0
- package/dist/ezui/{p-8dc267ff.entry.js → p-8a8006e6.entry.js} +1 -1
- package/dist/ezui/{p-0e49c0ff.entry.js → p-8d626d2b.entry.js} +1 -1
- package/dist/ezui/{p-79277e43.entry.js → p-9568a93d.entry.js} +1 -1
- package/dist/ezui/p-9771ea3c.entry.js +1 -0
- package/dist/ezui/p-98218fbc.js +1 -0
- package/dist/ezui/p-9d004e22.entry.js +1 -0
- package/dist/ezui/{p-eee3c7ff.entry.js → p-a13e65a4.entry.js} +1 -1
- package/dist/ezui/{p-e8c6c973.entry.js → p-a1a63294.entry.js} +1 -1
- package/dist/ezui/p-c711900a.entry.js +1 -0
- package/dist/ezui/p-cfa26133.entry.js +1 -0
- package/dist/ezui/{p-a7eab406.entry.js → p-dc192d01.entry.js} +1 -1
- package/dist/ezui/p-dff9862b.js +3 -0
- package/dist/ezui/{p-59a98e31.entry.js → p-e2e0dd76.entry.js} +1 -1
- package/dist/ezui/{p-2ba2d792.entry.js → p-e4a579f2.entry.js} +1 -1
- package/dist/ezui/{p-59092a66.entry.js → p-e82a12c6.entry.js} +1 -1
- package/dist/ezui/p-f1bbf23f.entry.js +1 -0
- package/dist/ezui/p-f34ec732.entry.js +1 -0
- package/dist/ezui/p-f45ddc1f.entry.js +1 -0
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +5 -1
- package/dist/types/components/ez-form/ez-form.d.ts +5 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +4 -0
- package/dist/types/components/ez-form-view/fieldbuilder/FieldBuilder.d.ts +3 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/ImageInput.tpl.d.ts +2 -0
- package/dist/types/components/ez-image-input/ez-image-input.d.ts +42 -0
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +6 -2
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +4 -0
- package/dist/types/components/ez-popup/ez-popup.d.ts +3 -0
- package/dist/types/components/ez-search/ez-search.d.ts +5 -6
- package/dist/types/components/ez-search-plus/ez-search-plus.d.ts +1 -0
- package/dist/types/components/ez-tooltip/ez-tooltip.d.ts +3 -0
- package/dist/types/components/ez-tree/ez-tree.d.ts +20 -1
- package/dist/types/components/ez-tree/types/Node.d.ts +1 -0
- package/dist/types/components/ez-tree/types/Tree.d.ts +1 -0
- package/dist/types/components/ez-tree/types/UpdateItemConfig.d.ts +4 -0
- package/dist/types/components.d.ts +140 -1
- package/dist/types/utils/form/interfaces/IFormSheetMetadata.d.ts +1 -0
- package/dist/types/utils/form/interfaces/ITabConfig.d.ts +1 -0
- package/dist/types/utils/i18n/locales/en-us.d.ts +8 -0
- package/dist/types/utils/i18n/locales/es-es.d.ts +8 -0
- package/dist/types/utils/i18n/locales/pt-br.d.ts +8 -0
- package/dist/types/utils/i18n/translations.d.ts +24 -0
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-02f6e3b0.entry.js +0 -1
- package/dist/ezui/p-0b333f09.entry.js +0 -1
- package/dist/ezui/p-14807f4e.js +0 -1
- package/dist/ezui/p-191cfbc8.entry.js +0 -1
- package/dist/ezui/p-1bfef8e5.entry.js +0 -1
- package/dist/ezui/p-228a4d2f.js +0 -3
- package/dist/ezui/p-2df50161.entry.js +0 -1
- package/dist/ezui/p-4e1df756.entry.js +0 -1
- package/dist/ezui/p-623161e2.js +0 -1
- package/dist/ezui/p-641ee538.js +0 -1
- package/dist/ezui/p-7f8c1fce.entry.js +0 -1
- package/dist/ezui/p-8bb3aeb0.entry.js +0 -1
- package/dist/ezui/p-ba7e908a.entry.js +0 -1
- package/dist/ezui/p-bd6146c5.entry.js +0 -1
- package/dist/ezui/p-c943f7c4.entry.js +0 -1
- package/dist/ezui/p-d0e6911e.entry.js +0 -1
- package/dist/ezui/p-e46a4d06.entry.js +0 -1
- package/dist/ezui/p-f958dcb1.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e,H as i,g as n}from"./p-23a36bb6.js";import{FloatingManager as a,ElementIDUtils as o}from"@sankhyalabs/core";import{i as l}from"./p-
|
|
1
|
+
import{r as t,h as e,H as i,g as n}from"./p-23a36bb6.js";import{FloatingManager as a,ElementIDUtils as o}from"@sankhyalabs/core";import{i as l}from"./p-98218fbc.js";const r=class{constructor(e){t(this,e),this._container=void 0,this.alerts=[],this.enableDragAndDrop=void 0,this.enableExpand=!0,this.itemRightSlotBuilder=void 0,this.opened=!0,this.expanded=!1}observeOpened(){this.opened&&this.manageOverlay()}alertId(t,e){return`alert-${e}-${(t=>{var e;return null!==(e=null==t?void 0:t.split(" ").join("-"))&&void 0!==e?e:""})(t)}`}getAlertTitle(t){var e;return null===(e=this.alerts.find(((e,i)=>this.alertId(e.title,i)===t)))||void 0===e?void 0:e.title}getLinkActionClick(t){var e;return(null===(e=this.alerts.find(((e,i)=>this.alertId(e.title,i)===t.id)))||void 0===e?void 0:e.onClickLink)||(()=>{})}getTitleText(t){var e;const i=null!==(e=this.getAlertTitle(t.id))&&void 0!==e?e:"";return`${i}${i&&t.label?":":""}`}toggleExpandContainer(){this.enableExpand&&(this.expanded=!this.expanded,this._container.classList.toggle("expanded",this.expanded),this.expanded?this.updatePosition(this.getBoundingRight(),this.getBoundingBottom()):this.updatePosition("10px","10px"))}manageOverlay(){if(this.opened&&this._container)this._overlayId=a.float(this._container,this._overlayRef,this.getFloatOptions());else{if(void 0===this._overlayId)return;a.close(this._overlayId),this._overlayId=void 0}}updatePosition(t,e){this.opened&&a.updateFloatPosition(this._container,this._overlayRef,Object.assign(Object.assign({},this.getFloatOptions()),{right:t,bottom:e}))}getFloatOptions(){return{autoClose:!1,isFixed:!0,bottom:"10px",right:"10px"}}getBoundingRight(){return(document.body.clientWidth-this._container.getBoundingClientRect().width)/2+"px"}getBoundingBottom(){return(document.body.clientHeight-this._container.getBoundingClientRect().height)/2+"px"}componentDidLoad(){this.manageOverlay(),this.opened&&this._container&&this._container.focus()}async componentWillLoad(){this.dataElementId=o.addIDInfo(this._element,"EzAlertList"),this.i18n=await l()}render(){return e(i,Object.assign({},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:this.dataElementId}),this.opened?e("div",{ref:t=>this._overlayRef=t},e("div",{class:"alert-list__container "+(this.expanded?"expanded":""),ref:t=>this._container=t},e("div",{class:"alert-list__content"},e("div",{class:"alert-list__header"},e("div",{class:"alert-list__title"},`${this.i18n("app.alerts")} (${this.alerts.length})`),e("div",{class:"alert-list__header__buttons"},this.enableExpand&&e("ez-button",{mode:"icon",size:"small",iconName:"expand",onClick:()=>this.toggleExpandContainer(),"data-element-id":o.getInternalIDInfo("expandButton"),title:this.i18n(this.expanded?"app.collapse":"app.expand")}),e("ez-button",{mode:"icon",size:"small",iconName:"close","data-element-id":o.getInternalIDInfo("closeButton"),onClick:()=>{this.opened=!1},title:this.i18n("app.close")}))),e("div",{class:"alert-list__expandable-content"},e("ez-list",{itemSlotBuilder:this.itemRightSlotBuilder,hoverFeedback:!0,itemLeftSlotBuilder:t=>e("a",{onClick:this.getLinkActionClick(t),style:{fontFamily:"var(--font-pattern, 'Roboto')",fontSize:"var(--text--medium, 14px)",fontWeight:"var(--text-weight--medium, 400)",color:"var(--color--primary, #008561)",marginRight:"4px",cursor:"pointer",display:"flex",width:"max-content",textDecoration:"none"}},this.getTitleText(t)),dataSource:this.alerts.map(((t,e)=>{var i;return{id:this.alertId(t.title,e),label:null!==(i=t.detail)&&void 0!==i?i:""}}))}))))):null)}get _element(){return n(this)}static get watchers(){return{_container:["observeOpened"]}}};r.style=':host {\n display: flex;\n\n /* Alert List */\n \n /*@doc Define a largura da lista minimizado */\n --ez-alert-list__container--width: 680px;\n /*@doc Define a altura da lista minimizado */\n --ez-alert-list__container--height: 220px;\n \n /*@doc Define a largura da lista maximizada */\n --ez-alert-list__container--width--expanded: 920px;\n /*@doc Define a altura da lista maximizada */\n --ez-alert-list__container--height--expanded: 540px;\n\n /* Title */\n /*@doc Define a fonte do título do componente */\n --ez-alert-list__title--font-family: var(--font-pattern, "Roboto");\n /*@doc Define o tamanho da fonte do título do popup.*/\n --ez-alert-list__title--font-size: var(--title--large, 20px);\n /*@doc Define a cor da fonte do título do popup.*/\n --ez-alert-list__title--color: var(--title--primary, #2b3a54);\n /*@doc Define o peso da fonte do título do popup.*/\n --ez-alert-list__title--font-weight: var(--text-weight--extra-large, 700);\n\n /* @doc Define a borda inferior do item da lista. */\n --ez-list__item--border-bottom: var(--border--small, 1px solid);\n\n /* @doc Define a cor da borda inferior do item da lista. */\n --ez-list__item--border-bottom-color: var(--color--strokes, #DCE0E8);\n\n /* @doc Define o tipo da quebra de linha do item da lista. */\n --ez-list__item--white-space: break-space;\n}\n\n.alert-list__content {\n display: flex;\n flex-direction: column;\n \n gap: var(--space--xs);\n margin: var(--space--large, 24px);\n width: 100%;\n}\n\n.alert-list__container {\n z-index: var(--ez-elevation--8, 8);\n display: flex;\n height: var(--ez-alert-list__container--height);\n width: var(--ez-alert-list__container--width);\n border-radius: var(--border--radius-medium);\n background-color: var(--background--xlight);\n box-shadow: var(--shadow--medium);\n\n &.expanded {\n height: var(--ez-alert-list__container--height--expanded);\n width: var(--ez-alert-list__container--width--expanded);\n }\n\n @media (max-height: 640px) {\n max-height: calc(100vh - var(--space--3xl));\n } \n}\n\n.alert-list__header {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.alert-list__title {\n font-family: var(--ez-alert-list__title--font-family);\n font-size: var(--ez-alert-list__title--font-size);\n font-weight: var(--ez-alert-list__title--font-weight);\n color: var(--ez-alert-list__title--color);\n}\n\n.alert-list__header__buttons {\n display: flex;\n gap: var(--space--xs);\n}\n\n.alert-list__expandable-content {\n overflow-y: auto;\n scrollbar-width: thin;\n}\n\n';export{r as ez_alert_list}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,r as t,c as i,f as r,H as s,g as o}from"./p-23a36bb6.js";import{ElementIDUtils as n,StringUtils as l,ObjectUtils as a}from"@sankhyalabs/core";import{i as h}from"./p-98218fbc.js";const c=(e,t)=>t?e.iconExpanded||"chevron-down":e.iconContracted||"chevron-right",d=e=>e.tooltip||e.label,u=t=>{const{node:i,selectedId:r,itemClick:s,iconClick:o,iconResolver:l,tooltipResolver:a,itemsList:h,itemDoubleClick:c}=t;if(!i.visible)return;const d=i.item,v=t.level||1,m=i.isDisabled(),b=!m&&d.expanded,g=i.isExpandable(),f=!m&&!i.isPlaceHolder;return f&&h.push(d),e("ul",{class:1===v?"first-level":void 0},e("li",Object.assign({title:a(d,!m,v),class:"tree-item "+(d.id!==r?"tree-item-error":""),onClick:()=>f&&s(d),onDblClick:()=>f&&c(d)},{disabled:m,selected:d.id===r,[n.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:n.getInternalIDInfo(`ezTreeItem_${d.id}`)}),e("div",{class:"item-label-container"},e("div",{class:"item-icon-box"},g&&e("ez-icon",{id:d.id,class:"item-icon",size:"small",iconName:l(d,b,v),onClick:e=>function(e){e.stopPropagation(),f&&o(d)}(e),onDblClick:e=>function(e){e.stopPropagation()}(e)})),e("label",{class:"item-label "+(d.bold?"item-label--bold":"")},d.label)),function(t,i,r){if(null!=i)return"string"==typeof i?e("div",{class:`tree-item-badge ${r?null:i}`},"error"===i&&e("ez-icon",{id:`${t}-badge-error`,class:"tree-item-badge-error-icon",size:"x-small",style:{color:"white"},iconName:"alert-circle"})):"text"===i.type?e("div",{id:`${t}-badge-text`,class:"tree-item-badge-text"},i.text):e("div",null,e("ez-icon",{id:`${t}-badge-icon`,class:"tree-item-badge-icon",style:{"--ez-icon--color":`var(--ez-tree__badge--icon-color--${i.iconColor||"default"})`},iconName:i.iconName}))}(d.id,d.badge,d.id===r)),b&&i.getChildren().map((t=>e(u,{selectedId:r,node:t,itemClick:s,iconClick:o,level:v+1,iconResolver:l,tooltipResolver:a,itemsList:h,itemDoubleClick:c}))))};class v{constructor(e,t,i,r=!1){this.children=new Map,this.visible=!0,this.item=t,this.parent=i,this._tree=e,this.isPlaceHolder=r,t&&!r?(this._isLazyLoad="function"==typeof t.children||t.childrenCount>0,Array.isArray(t.children)&&(Array.from(t.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 t=this.children;this.children=new Map,Array.isArray(this.item.children)?(void 0===this.item.expanded&&(this.item.expanded=!0),Array.from(this.item.children).forEach((e=>{const i=t.get(e.id);i?(void 0===e.expanded&&(e.expanded=i.item.expanded),i.refresh(e),this.children.set(e.id,i)):(void 0===e.expanded&&(e.expanded=!0),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,t){this.children.has(t.id)||this.children.set(t.id,new v(e,t,this))}removeChild(e){return!!this.children.has(e)&&(this.children.delete(e),!0)}addPlaceHolder(){this.children.clear();const e=this.item.id;this.children.set(e,new v(void 0,{id:`placeholder_${e}`,label:"Carregando..."},this,!0))}getNode(e){if(this.children.has(e))return this.children.get(e);const t=Array.from(this.children.values());for(const i of t){const t=i.getNode(e);if(t)return t}}needLoad(){return this._isLazyLoad&&!this._childrenLoaded}isExpandable(){return!!this._isLazyLoad||this.children.size>0}getChildren(){return this.isPlaceHolder?[]:(this.needLoad()&&this._tree.loadChildren(this),Array.from(this.children.values()))}}class m extends v{constructor(e){super(void 0),this._disabledValues=new Map,this._changeCallback=e}async addChildAt(e,t){const i=this.getNode(e);if(null==i)return this.addChild(this,t),void this._changeCallback();i.addChild(this,t),this._changeCallback()}setDisabled(e,t){this._disabledValues.set(e,t),this._changeCallback()}isNodeDisabled(e,t){return this._disabledValues.has(e)?this._disabledValues.get(e):t}load(e){if(e===this._currentItems)return;this._currentItems=e;const t=this.children;this.children=new Map,this._disabledValues.clear(),e.forEach((e=>{const i=t.get(e.id);i?(i.refresh(e),this.children.set(e.id,i)):this.addChild(this,Object.assign({},e))}))}async setFilterPattern(e,t=!0){if(e&&t&&e.includes(".")){const t=e.split(".").map((e=>l.replaceAccentuatedCharsKeepSymbols(e.trim())));await this.applyLayeredFilter(this,t,0)}else this._filterPattern=l.replaceAccentuatedCharsKeepSymbols(e),this.setAllChildrenExpanded(this,!1),this.applyFilter(this);this._changeCallback()}updateItem(e){if(null==e)return;const t=this.getNode(e.id);null!=t&&(Object.keys(e).forEach((i=>t.item[i]=e[i])),null==e.children?t.children.clear():Array.isArray(e.children)&&t.updateChildren(e.children),this._changeCallback())}removeItem(e){if(!e)return;const t=this.getNode(e);t&&(t.parent?t.parent.removeChild(e):this.children.delete(e),this._disabledValues.delete(e),this._changeCallback())}async open(e){return new Promise((async t=>{await this.walkPath(this,e,(e=>e.item.expanded=!0)),t()}))}setAllChildrenVisible(e){e.children.forEach((e=>{e.visible=!0,this.setAllChildrenVisible(e)}))}applyFilter(e){if(!this._filterPattern)return e.visible=!0,void this.setAllChildrenVisible(e);if(e.children.forEach((e=>{this.applyFilter(e)})),null==e.item)return;let t=!1;if(l.replaceAccentuatedCharsKeepSymbols(e.item.label).includes(this._filterPattern))t=!0,e.item.expanded=!0,this.setAllChildrenVisible(e);else{const i=Array.from(e.children.values());for(let r=0;r<i.length;r++)if(i[r].visible){t=!0,e.item.expanded=!0;break}}e.visible=t}async applyLayeredFilter(e,t,i){if(!e.item){const r=(await Promise.all(Array.from(e.children.values()).map((e=>this.applyLayeredFilter(e,t,i))))).some(Boolean);return e.visible=r,r}if(!l.replaceAccentuatedCharsKeepSymbols(e.item.label).includes(t[i])){const r=(await Promise.all(Array.from(e.children.values()).map((e=>this.applyLayeredFilter(e,t,i))))).some(Boolean);return r&&(e.item.expanded=!0),e.visible=r,r}if(i===t.length-1)return e.visible=!0,this.setAllChildrenVisible(e),!0;const r=(await Promise.all(Array.from(e.children.values()).map((e=>this.applyLayeredFilter(e,t,i+1))))).some(Boolean);return r&&(e.item.expanded=!0),e.visible=r,r}async walkPath(e,t,i,r=0){return new Promise((async s=>{const o=t.split(">>").map((e=>e.trim()));if(o.length>r){const s=e.getNode(o[r]);s&&(s.needLoad()&&await this.loadLevel(s),i(s),await this.walkPath(s,t,i,r+1))}s()}))}async loadChildren(e){return new Promise((t=>{this.loadLevel(e).then((()=>{t(),this._changeCallback()}))}))}expandAll(){this.setAllChildrenExpanded(this,!0),this._changeCallback()}collapseAll(){this.setAllChildrenExpanded(this,!1),this._changeCallback()}setAllChildrenExpanded(e,t){e.item&&!e.isPlaceHolder&&(e.item.expanded=t),e.children.forEach((e=>{this.setAllChildrenExpanded(e,t)}))}async loadLevel(e){return new Promise((t=>{e.addPlaceHolder(),(0,e.item.children)(e.item).then((i=>{e.updateChildren(i),t()}))}))}}const b=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.ezOpenItem=i(this,"ezOpenItem",7),this.ezDbClickItem=i(this,"ezDbClickItem",7),this.ezRemoveItem=i(this,"ezRemoveItem",7),this._onItemClick=e=>{this.selectable?this.value=this.value&&this.value.id===e.id?void 0:e:this.openClose(e)},this._onIconClick=e=>{this.openClose(e)},this._tree=new m((()=>r(this))),this._waintingForLoad=void 0,this.items=[],this.value=void 0,this.selectedId=void 0,this.iconResolver=c,this.tooltipResolver=void 0,this.enableHierarchicalFilter=!0,this.selectable=!0}async selectItem(e){const t=this._tree.getNode(e);this.value=t?t.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,t){var i;null==t&&(t=null===(i=this.value)||void 0===i?void 0:i.id),this._tree.addChildAt(t,e),this.addItemInIndexedList(t,e);const r=this._tree.getNode(t);r?r.item.expanded=!0:this.collapseAll()}async applyFilter(e){await this._tree.setFilterPattern(e,this.enableHierarchicalFilter)}async expandAll(){this._tree.expandAll()}async collapseAll(){this._tree.collapseAll()}async updateItem(e,t){var i,r,s;if(Array.isArray(e))return void e.forEach((e=>this.updateItem(e,t)));if((null==t?void 0:t.updatedBySelectedId)&&Object.assign(e,{id:this.selectedId}),this._tree.updateItem((null==t?void 0:t.forceDefaultValues)?this.applyDefaultValues(e):e),this.updateItemInIndexedList(e,null==t?void 0:t.forceDefaultValues),null==(null===(i=this._tree)||void 0===i?void 0:i.getNode(this.selectedId))&&(this.value=this._visibleItems?this._visibleItems[0]:void 0,this._tree.collapseAll()),(null===(r=this.value)||void 0===r?void 0:r.id)===e.id)return this.value=e,void this.ezChange.emit(this.value);const o=this.getItemById(null===(s=this.value)||void 0===s?void 0:s.id,[e]);o&&(this.value=o,this.ezChange.emit(this.value))}async removeItem(e){var t;(e=null!=e?e:this.selectedId)&&(this._tree.removeItem(e),this.removeItemFromIndexedList(e),this.ezRemoveItem.emit(e),(null===(t=this.value)||void 0===t?void 0:t.id)===e&&(this.value=void 0))}async getItem(e){return new Promise((t=>{const i=this._tree.getNode(e);t(null==i?void 0:i.item)}))}async getCurrentPath(){var e,t,i;const r=null===(e=this._tree)||void 0===e?void 0:e.getNode(this.selectedId);if(null==r)return;const s=[];let o,n=null===(t=r.parent)||void 0===t?void 0:t.item;for(s.push(this.getItemPathAttrs(r.item));null!=n;)s.unshift(this.getItemPathAttrs(n)),o=this._tree.getNode(n.id),n=null===(i=null==o?void 0:o.parent)||void 0===i?void 0:i.item;return s}async getParent(e){return new Promise((t=>{var i;const r=this._tree.getNode(e);r&&t(null===(i=r.parent)||void 0===i?void 0:i.item),t(void 0)}))}observeItems(e,t){a.objectToString(e)!==a.objectToString(t)&&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 t=!1;switch(e.key){case"ArrowUp":this.previousItem(),t=!0;break;case"ArrowDown":this.nextItem(),t=!0;break;case"ArrowLeft":this.previousLevel(),t=!0;break;case"ArrowRight":this.nextLevel(),t=!0;break;case" ":this.openClose(this.value),t=!0}t&&(e.stopPropagation(),e.preventDefault())}getItemById(e,t){for(const i of t){if(i.id===e)return i;if(i.children&&Array.isArray(i.children)){const t=this.getItemById(e,i.children);if(t)return t}}}addItemInIndexedList(e,t,i){var r,s;i=null!==(r=null!=i?i:this.items)&&void 0!==r?r:[],e||i.push(t);const o=this.getItemById(e,i);o.children=null!==(s=o.children)&&void 0!==s?s:[],o.children.push(t),o.childrenCount=o.children.length}applyDefaultValues(e){return void 0===e.disabled&&(e.disabled=!1),void 0===e.expanded&&(e.expanded=!1),e}updateItemInIndexedList(e,t=!1){if(!e||!this.items)return;const i=this.getItemById(e.id,this.items);i&&Object.assign(i,t?this.applyDefaultValues(e):e)}removeItemFromIndexedList(e,t){var i;if(t=null!==(i=null!=t?t:this.items)&&void 0!==i?i:[],!e)return!1;const r=t.findIndex((t=>t.id===e));if(-1!==r)return t.splice(r,1),!0;for(const i of t)if(i.children&&Array.isArray(i.children)){const t=i.children.findIndex((t=>t.id===e));if(-1!==t)return i.children.splice(t,1),i.childrenCount=i.children.length,!0;if(this.removeItemFromIndexedList(e,i.children))return!0}return!1}getItemPathAttrs({id:e,label:t}){return{id:e,label:t}}openClose(e){if(null==e)return;const t=!e.expanded;e.expanded=t,t&&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 t=null===(e=this._tree.getNode(this.value.id).parent)||void 0===e?void 0:e.item;t&&(this.value=t)}}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 t=0;t<this._visibleItems.length;t++)if(this._visibleItems[t].id===e)return t;return-1}selectNextItem(e){var t;const i=this.indexOf(null===(t=this.value)||void 0===t?void 0:t.id)+e;i>-1&&i<this._visibleItems.length&&(this.value=this._visibleItems[i])}nextItem(){this.selectNextItem(1)}previousItem(){this.selectNextItem(-1)}connectedCallback(){this.items&&this._tree.load(this.items)}async componentWillLoad(){this.i18n=await h()}componentWillRender(){var e;if(!this.selectedId||(null===(e=this.value)||void 0===e?void 0:e.id)===this.selectedId)return;const t=this._tree.getNode(this.selectedId);t&&(this.value=t.item)}render(){if(n.addIDInfoIfNotExists(this._element,"ezTree"),null!=this.items)return this._visibleItems=[],e(s,{tabindex:"-1"},this._waintingForLoad?e("label",null,this.i18n("app.loading"),"..."):this._tree.getChildren().map((t=>{var i;return e(u,{selectedId:null===(i=this.value)||void 0===i?void 0:i.id,node:t,itemClick:this._onItemClick,iconClick:this._onIconClick,iconResolver:this.iconResolver,tooltipResolver:this.tooltipResolver||d,itemsList:this._visibleItems,itemDoubleClick:e=>this.ezDbClickItem.emit(e)})})))}get _element(){return o(this)}static get watchers(){return{items:["observeItems"],value:["observeValue"]}}};b.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:0px;--ez-tree--user-select:auto;--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--font-weight--bold:var(--text-weight--large, 600);--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);--ez-tree__badge--icon-color--default:var(--title--primary, #2B3A54);--ez-tree__badge--icon-color--error:var(--color--error, #da4453);--ez-tree__badge--icon-color--success:var(--color-alert--success-800, #157a00);--ez-tree__badge--icon-color--warning:var(--color--warning, #f2d410);--ez-tree__badge--icon-color--disabled:var(--text--disable, #AFB6C0);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;cursor:default;padding-inline-start:var(--ez-tree--padding-inline-start)}ul.first-level{padding-inline-start:0}.tree-item-badge{width:16px;height:16px;background:transparent;border-radius:50%;transition:all 300ms ease-in-out;display:flex;align-items:center;justify-content:center}.tree-item-badge-error-icon{--ez-icon--color:white}.tree-item-badge-text{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-badge.error{background:var(--color--error)}.tree-item-badge.warning{background:var(--color--warning)}.tree-item-badge.success{background:var(--color--success)}.item-label-container{display:flex;align-items:center;overflow:hidden}.tree-item{display:flex;align-items:center;cursor:pointer;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);justify-content:space-between}.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;user-select:var(--ez-tree--user-select);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)}.item-label--bold{font-weight:var(--ez-tree--font-weight--bold)}.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{b as ez_tree}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as e,f as n,H as s,g as r}from"./p-23a36bb6.js";import{DateUtils as o,ApplicationContext as l,Action as a,StringUtils as u,KeyboardManager as h,DataUnit as c,ElementIDUtils as d}from"@sankhyalabs/core";import{b as f,a as v,S as m,f as p,c as b,D as y}from"./p-474076b3.js";import{g as w,i as g}from"./p-98218fbc.js";import{F as _}from"./p-30ffb9ed.js";import"./p-0ec5c128.js";import"./p-ab574d59.js";import"./p-b853763b.js";const O=/child\[([^\]]+)\]/,C=/\$\{.+\}/;class E{constructor(){this._sheets=new Map,this._requiredFields=[],this._cleanOnCopyFields=[],this._defaultValues={}}static getDetailName(t){const i=O.exec(t);return i?i[1]:void 0}getSheet(t){return this._sheets.get(t)}getAllSheets(){return this._sheets}addSheet(t){this._sheets.set(t.name,t)}addRequiredFields(t){this._requiredFields=this._requiredFields.concat(t)}getRequiredFields(){return this._requiredFields}addCleanOnCopyFields(t){this._cleanOnCopyFields=this._cleanOnCopyFields.concat(t)}getCleanOnCopyFields(){return this._cleanOnCopyFields}addDefaultValues(t){return this._defaultValues=Object.assign(Object.assign({},this._defaultValues),t)}getDefaultValues(){const t={};return Object.entries(this._defaultValues).forEach((([i,e])=>{if("string"==typeof e){const t=C.exec(e);t&&(e=this.getDefaultVar(t[0]))}t[i]=e})),t}getDefaultVar(t){return"${data}"===t?o.getToday():"${datahora}"===t?o.getToday(!0):this._defaultVars?this._defaultVars.get(t):void 0}setDefaultVars(t){this._defaultVars=t}}const j=(t,i)=>{var e;if(i)return null===(e=i.tabs)||void 0===e?void 0:e.find((i=>i.label===t))},F=(t,i,e)=>{if("string"!=typeof t)return t;if(e){const i=j(t,e);if(i)return i}return Array.from(i.keys()).find((i=>i.label===t))||{label:t,visible:!0}};function z(t,i){var e,n;return"__main"===t[0].label&&"__main"!==i[0].label?-1:"__main"!==t[0].label&&"__main"===i[0].label?1:(null!==(e=t[0].order)&&void 0!==e?e:Number.MAX_VALUE)-(null!==(n=i[0].order)&&void 0!==n?n:Number.MAX_VALUE)}const x=t=>`child[${t.name}]`,A=t=>({name:x(t),label:t.label,fields:[]});function N(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 S="function"==typeof Symbol&&Symbol.observable||"@@observable",M=function(){return Math.random().toString(36).substring(7).split("").join(".")},D={INIT:"@@redux/INIT"+M(),REPLACE:"@@redux/REPLACE"+M(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+M()}};function R(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 T(t,i,e){var n;if("function"==typeof i&&"function"==typeof e||"function"==typeof e&&"function"==typeof arguments[3])throw new Error(N(0));if("function"==typeof i&&void 0===e&&(e=i,i=void 0),void 0!==e){if("function"!=typeof e)throw new Error(N(1));return e(T)(t,i)}if("function"!=typeof t)throw new Error(N(2));var s=t,r=i,o=[],l=o,a=!1;function u(){l===o&&(l=o.slice())}function h(){if(a)throw new Error(N(3));return r}function c(t){if("function"!=typeof t)throw new Error(N(4));if(a)throw new Error(N(5));var i=!0;return u(),l.push(t),function(){if(i){if(a)throw new Error(N(6));i=!1,u();var e=l.indexOf(t);l.splice(e,1),o=null}}}function d(t){if(!R(t))throw new Error(N(7));if(void 0===t.type)throw new Error(N(8));if(a)throw new Error(N(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(N(10));s=t,d({type:D.REPLACE})}function v(){var t,i=c;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(N(11));function e(){t.next&&t.next(h())}return e(),{unsubscribe:i(e)}}})[S]=function(){return this},t}return d({type:D.INIT}),(n={dispatch:d,subscribe:c,getState:h,replaceReducer:f})[S]=v,n}const P={};function I(t=P,i){switch(i.type){case K.METADATA_LOADED:return Object.assign(Object.assign({},t),{formMetadata:i.payload,currentSheet:void 0});case K.CHANGE_TAB:return Object.assign(Object.assign({},t),{currentSheet:i.payload});default:return t}}function L(t){return t.formMetadata}function V(t){const i=function(t){return t.currentSheet}(t);return i?t.formMetadata.getSheet(i):Array.from(t.formMetadata.getAllSheets().values())[0]}var K;!function(t){t.METADATA_LOADED="FORM/METADATA_LOADED",t.CHANGE_TAB="FORM/CHANGE_TAB"}(K||(K={}));const $=class{constructor(e){t(this,e),this.ezFormRequestClearFieldToFocus=i(this,"ezFormRequestClearFieldToFocus",7),this.ezFormSetFields=i(this,"ezFormSetFields",7),this.ezReady=i(this,"ezReady",7),this.formItemsReady=i(this,"formItemsReady",7),this._customEditors=new Map,this._application=l.getContextValue("__SNK__APPLICATION__"),this.onDataUnitAction=t=>{t.type===a.METADATA_LOADED&&this.processMetadata()},this._fieldsProps=new Map,this._singleColumn=!1,this.dataUnit=void 0,this.config=void 0,this.recordsValidator=void 0,this.fieldToFocus=void 0,this.onlyStaticFields=!1,this.useSearchField=!0,this.elementFocusSearchField=void 0,this.customUiBuilders=new Map}validate(){return this._dataBinder.validate()}async addCustomEditor(t,i,e){if(this._formView)return void this._formView.addCustomEditor(t,i,e);const n=new Map(this._customEditors);n.set(t,{customEditor:i,detailContext:e}),this._customEditors=n}observeConfig(){this.processMetadata()}async setFieldProp(t,i,e){const n=new Map(this._fieldsProps),s=this._fieldsProps.get(t);n.set(t,Object.assign(Object.assign({},s),{[i]:e})),this._fieldsProps=n}getDynamicContent(){var t;const i=L(this._store.getState());if(!i)return null;const n=Array.from(i.getAllSheets().values()),s=V(null===(t=this._store)||void 0===t?void 0:t.getState());let r=[];if(n.length>1){const t=n.map(((t,i)=>({tabKey:t.name,label:t.label,index:i}))),i="selector";r.push(e("ez-tabselector",{tabs:this.buildIdTabSelector(t),onEzChange:t=>this._store.dispatch(function(t){return{type:K.CHANGE_TAB,payload:"string"==typeof t?t:t.tabKey}}(t.detail)),selectedTab:s.name,"data-element-id":i}))}return r=r.concat(this.buildFormContent(s)),r}buildFormContent(t){const i=null==t?void 0:t.fields;if(null==t)return;this.ezFormSetFields.emit(i);const n=`${u.replaceAccentuatedChars(u.toCamelCase(null==t?void 0:t.label),!1)}_selectorContainer`;return e("div",{class:"dynamic-content ez-box--no-outline","data-element-id":n,ref:t=>this._container=t,tabindex:"0"},e("ez-popover",{ref:t=>this._ezPopoverSearchField=t,overlayType:"none"},this.renderFieldColumn()),e("ez-form-view",{ref:t=>this._formView=t,class:"ez-row ez-padding-vertical--small",fields:i,singleColumn:this._singleColumn,selectedRecord:this.dataUnit.getSelectedRecord(),customUiBuilders:this.customUiBuilders}))}renderFieldColumn(){return null!=this._fieldSearch||(this._fieldSearch=v({value:u.generateUUID(),label:this._i18n("ez-form.labelSearchField")},(({argument:t})=>this.fieldsOptionLoader(t)),(t=>this.onSelectField(t)))),this._fieldSearch}getFormFields(){var t;return null===(t=this.config)||void 0===t?void 0:t.fields}fieldsOptionLoader(t){const i=null==t?void 0:t.toLowerCase(),e=this.getFormFields().map((t=>{var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getField(t.name)})).filter((t=>{var e,n;return(null===(e=t.name)||void 0===e?void 0:e.toLowerCase().includes(i))||(null===(n=t.label)||void 0===n?void 0:n.toLowerCase().includes(i))})).map((t=>({value:t.name,label:t.label})));return Promise.resolve(e)}onSelectField(t){null!=t&&null!=t.value?(this.fieldToFocus=t.value,this._ezPopoverSearchField.hide()):this.fieldToFocus=""}async initKeyboardManager(){var t,i;this._keyboardManager=new h({propagate:!1,element:null!==(t=this.elementFocusSearchField)&&void 0!==t?t:this._element}),this.useSearchField&&this._keyboardManager.bind(m,(async()=>{if(!this._container||!this._ezPopoverSearchField)return;const t=this._container.getBoundingClientRect();await p(this._fieldSearch),this._ezPopoverSearchField.showUnder(this._container,{horizontalGap:t.width-b,verticalGap:-1*t.height})}),{description:this._i18n("ez-form.labelSearchField"),element:null!==(i=this.elementFocusSearchField)&&void 0!==i?i:this._element})}componentDidLoad(){this.initKeyboardManager()}processMetadata(){if(this.bindFields()&&this.dataUnit&&this._store){const t=((t,i,e=!1,n)=>{var s;null!=t&&!0!==(null==t?void 0:t.emptyConfig)||(t=(t=>{const i=t.metadata;let e;return i&&(e=i.fields.filter((t=>!1!==t.visible)).map((t=>({name:t.name,defaultValue:t.defaultValue})))),{emptyConfig:!1,fields:e}})(i));const r=new Map,o=new Map,l=[],a=[],u={};(null!==(s=null==t?void 0:t.tabs)&&void 0!==s?s:[]).forEach((t=>{o.has(t.label)||!1!==t.visible||o.set(t.label,t)})),function(t,i,e,n,s,r,o){var l;null===(l=null==t?void 0:t.fields)||void 0===l||l.forEach((l=>{var a,u,h;if(!1!==l.visible){const c=F(l.tab||"__main",i,t);if(e.has(c.label))return;const d=n.getField(l.name);if(d&&(null==(null==d?void 0:d.visible)||!0===(null==d?void 0:d.visible))&&c.visible){i.has(c)||i.set(c,[]);const t=f(d,l);i.get(c).push(t),t.required&&s.push(l.name),((null==l.cleanOnCopy?null===(a=d.properties)||void 0===a?void 0:a.cleanOnCopy:l.cleanOnCopy)||(null===(u=d.properties)||void 0===u?void 0:u.cleanOnCopy))&&r.push(l.name);let e=null==l.defaultValue?null===(h=d.properties)||void 0===h?void 0:h.defaultValue:l.defaultValue;if(e&&null!=e.value){const{type:t,value:i}=e;if(t)if("V"===t)e=i;else try{const t=JSON.parse(i);e=t&&"value"in t?t:i}catch(t){}o[l.name]=e}}}}))}(t,r,o,i,l,a,u);const h=new E;return h.setDefaultVars(t.defaultVars),e&&function(t,i,e){const n=t.metadata;void 0!==n&&void 0!==n.children&&n.children.forEach((t=>{const n=j(t.label,i);if(n)return void e.set(Object.assign(n,{name:x(t),isDetail:!0}),[]);const{label:s,name:r,fields:o}=A(t);e.set({name:r,label:s,isDetail:!0},o)}))}(i,t,r),n&&function(t,i,e){t.forEach((t=>{const n=j(t.label,i),s={};Object.entries(t).forEach((([t,i])=>{(function(t){return["id","label"].includes(t)})(t)||(s[t]=i)})),e.set(n?Object.assign(n,{name:t.id,isCustom:!0,ctxProps:s}):{label:t.label,name:t.id,isCustom:!0,visible:!0,ctxProps:s},[])}))}(n,t,r),Array.from(r.entries()).sort(z).forEach((([t,i])=>{o.has(t.label)||h.addSheet(function(t,i){const e=w();return{label:"__main"===t.label?e("ez-form.mainTab"):t.label,name:t.name||t.label,isCustom:t.isCustom,isDetail:t.isDetail,ctxProps:t.ctxProps,fields:i}}(t,i))})),h.addRequiredFields(l),h.addCleanOnCopyFields(a),h.addDefaultValues(u),h})(this.config,this.dataUnit);this._store.dispatch({type:K.METADATA_LOADED,payload:t})}}isStatic(){var t;return(null===(t=this._staticFields)||void 0===t?void 0:t.length)>0}bindFields(){return!this.isStatic()||!1===this.onlyStaticFields}async componentWillLoad(){var t;void 0===this.dataUnit&&(this.dataUnit=new c("ez-form")),this.dataUnit.unsubscribe(this.onDataUnitAction),this.dataUnit.subscribe(this.onDataUnitAction),this._dataBinder=new y(this.dataUnit),this._store=T(I),this._store.subscribe((()=>n(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata(),d.addIDInfo(this._element,null,{dataUnit:this.dataUnit});const i=await(null===(t=this._application)||void 0===t?void 0:t.getLayoutFormConfig());this.setSingleColumn(i),this.registerNotifyListeners(i),this._i18n=await g()}async setSingleColumn(t){this._singleColumn=(null==t?void 0:t.config)===_.CASCADE}async registerNotifyListeners(t){t&&t.onConfigChange((t=>{this._singleColumn=t===_.CASCADE}))}componentDidRender(){const t=L(this._store.getState());t.addRequiredFields(this._staticFields.filter((t=>t.dataset.required)).map((t=>t.dataset.fieldName))),this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")),this.dataUnit.dataUnitId,t,this.recordsValidator),this.ezReady.emit(),this.handleFieldToFocus(),this.setCustomEditors(),this.setFieldsProps()}setCustomEditors(){if(this._formView)for(const[t,i]of this._customEditors)this._formView.addCustomEditor(t,i.customEditor,i.detailContext),this._customEditors.delete(t)}handleFieldToFocus(){var t;if(null==this.fieldToFocus)return;const i=V(null===(t=this._store)||void 0===t?void 0:t.getState());(null==i?void 0:i.fields).some((t=>t.name===this.fieldToFocus))&&requestAnimationFrame((()=>{this._dataBinder.setFocus(this.fieldToFocus),this.ezFormRequestClearFieldToFocus.emit(),this.fieldToFocus=null}))}setFieldsProps(){if(this._formView)for(const[t,i]of this._fieldsProps){for(const e in i)this._formView.setFieldProp(t,e,i[e]);this._fieldsProps.delete(t)}}disconnectedCallback(){var t;this.dataUnit.unsubscribe(this.onDataUnitAction),this._dataBinder.onDisconnectedCallback(),null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}buildIdTabSelector(t){return t&&t.forEach((t=>t[d.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=u.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"]}}};$.style=".sc-ez-form-h{display:flex;flex-direction:column;width:100%}.dynamic-content.sc-ez-form ez-collapsible-box.sc-ez-form{--ez-collapsible-box__header--padding-right:var(--space-small, 6px);--ez-collapsible-box__header--padding-left:var(--space-small, 6px)}";export{$ as ez_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as o,g as e}from"./p-23a36bb6.js";import{ObjectUtils as h,ElementIDUtils as r}from"@sankhyalabs/core";import"./p-5a11cf56.js";import{C as n}from"./p-ec7db713.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{i as a}from"./p-641ee538.js";import"./p-30ffb9ed.js";const l=class{constructor(s){t(this,s),this.ezChange=i(this,"ezChange",7),this.ezVisibilityChange=i(this,"ezVisibilityChange",7),this._changeDeboucingTimeout=null,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._lookupMode=!1,this.isOpen=!1,this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._criteria=void 0,this.limitCharsToSearch=3,this.value=void 0,this.label=void 0,this.enabled=!0,this.options=void 0,this.errorMessage=void 0,this.showSelectedValue=!1,this.showOptionValue=!1,this.suppressSearch=!1,this.optionLoader=void 0,this.suppressEmptyOption=!1,this.stopPropagateEnterKeyEvent=!0,this.canShowError=!0,this.mode="regular",this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.autoFocus=!1,this.preventAutoFocus=!1,this.alternativePlaceholder=void 0,this.textEmptyOption=void 0}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())||this.setInputValue())}observeValue(t,i){if(this._textInput&&t!=i)try{if("string"==typeof t)return void this.setInputValue();const s=this.getSelectedOption(t),o=this.getSelectedOption(i),e=this.getSelectedOption(this.value);this.isDifferentValues(e,s)&&(this.value=s),this.isDifferentValues(s,o)&&(this.setInputValue(),this._lookupMode||this.ezChange.emit(null===s?void 0:s)),this.resetOptions()}finally{this._lookupMode=!1}}observeOptions(t,i){h.equals(t,i)||this.loadOptions(d.PRELOAD)}async getValueAsync(){return new Promise(this._showLoading?t=>{let i=setInterval((()=>{this._showLoading||(clearInterval(i),t(this.sanitizeValue(this.value)))}),100)}:t=>t(this.sanitizeValue(this.value)))}async setFocus(t){this._textInput&&this._textInput.setFocus(t)}async setBlur(){this._textInput&&this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async clearValue(){this.clearSearch()}isDifferentValues(t,i){return h.objectToString(t||{})!==h.objectToString(i||{})}getFormattedText(t){if(null!=t)return this.showSelectedValue&&null!=t.value?t.label?`${t.value} - ${t.label}`:t.value:t.label}getText(){const t=this.getSelectedOption(this.sanitizeValue(this.value)),i=this.getFormattedText(t);if(null!=i)return String(i).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}getSelectedOption(t){return"string"==typeof t||t instanceof String?this._visibleOptions.find((i=>i.value===t)):t}updateVisibleOptions(){let t=this._source||[];if(this._criteria){const i=this._criteria.toUpperCase();t=t.filter((t=>t.label.toLocaleUpperCase().indexOf(i)>-1))}this.hasToAddEmptyoption(t)&&(t=[{value:void 0,label:this.textEmptyOption||this.i18n("ez-combo-box.placeholder")}].concat(t)),this._visibleOptions=t,this._maxWidthValue=this.getMaxWidthValue()}hasToAddEmptyoption(t){return!this.suppressEmptyOption&&!t.filter((t=>!t.value)).length}getMaxWidthValue(){var t;if(this.showOptionValue){const i=[];return null===(t=this._visibleOptions)||void 0===t||t.forEach((t=>{const s=this.getWidthValue(t.value);i.includes(s)||i.push(s)})),i.length>1?Math.max(...i):0}return 0}getWidthValue(t){if(null!=this._itemValueBasis){const i=this._itemValueBasis;if(null!=t)return i.innerHTML=t,i.clientWidth>0?i.clientWidth+2:0;i.innerHTML=""}return 0}async showOptions(){var t,i;if(!this.enabled)return;await this.openPopover();const s=null!==(i=null===(t=this.value)||void 0===t?void 0:t.value)&&void 0!==i?i:this.value,o=this._visibleOptions.findIndex((t=>t.value===s));this._preSelection=-1===o?0:o,this._resizeObserver&&this._resizeObserver.observe(this._textInput),this.preventAutoFocus||await this.setFocus()}hideOptions(){var t;null===(t=this._popover)||void 0===t||t.hide(),this._resizeObserver&&this._resizeObserver.unobserve(this._textInput)}updateSource(t){this._startLoading=!1,t instanceof Promise?(this._showLoading=!0,t.then((t=>{this._showLoading=!1,this.updateSource(t)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(t)?(this._source=t,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1)):this.selectOption(t))}selectOption(t,i=!0){var s,o,e;const h=this.getSelectedOption(this.value);(null===(s=null==h?void 0:h.value)||void 0===s?void 0:s.toString())!==(null===(o=null==t?void 0:t.value)||void 0===o?void 0:o.toString())||null==h&&null!=t&&"value"in t?(this.value=(null==t?void 0:t.value)?t:void 0,null===(e=this._popover)||void 0===e||e.hide()):this.resetOptions(),i&&setTimeout((()=>{this.setFocus()}),0)}loadOptions(t,i=""){this._criteria=i,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:t,argument:i}):this.options)}cancelPreselection(){!this._textInput.value&&this.sanitizeValue(this.value)?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue(!1)}),this._deboucingTime)}setInputValue(t=!0){const i=this.getText();(this._textInput.value||"")!==i&&(this._textInput.value=i,t&&(this.errorMessage=null))}clearSearch(){this.value=null}resetOptions(){this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}sanitizeValue(t){if("undefined"!==t&&"null"!==t)return t}async componentWillLoad(){if(this.i18n=await a(),void 0===this.options){this.options=[];const t=this.el.querySelectorAll("option");t&&t.forEach((t=>{let i=t.innerText,s=t.getAttribute("value");s||(s=i),this.options.push({label:i,value:s}),t.hidden=!0}))}this.loadOptions(d.PRELOAD)}setResizeObserver(){this._resizeObserver=new ResizeObserver((t=>{window.requestAnimationFrame((()=>{Array.isArray(t)&&t.length&&this._textInput&&this._comboBoxList&&(this._comboBoxList.width=this._textInput.clientWidth)}))}))}connectedCallback(){this._resizeObserver||this.setResizeObserver()}componentDidLoad(){n.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1),this.setResizeObserver(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}disconnectedCallback(){var t;null===(t=this._popover)||void 0===t||t.remove(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}handlerIconClick(){this.showOptions()}onTextInputChangeHandler(t){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(t)}),this._deboucingTime));const s=null===(i=t.target.value)||void 0===i?void 0:i.trim();this._criteria||(this._textInput.value=t.data||s),this._criteria=s,s?(this.updateVisibleOptions(),this.showOptions()):(this._preSelection=void 0,this.updateVisibleOptions())}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}onTextInputClickHandler(){this.showOptions()}keyDownHandler(t){var i,s,o,e,h,r;if(t.ctrlKey&&("f"===t.key||"F"===t.key))return this.loadOptions(d.ADVANCED),t.preventDefault(),void t.stopPropagation();switch(t.key){case"ArrowDown":t.preventDefault(),this.canShowListOptions()&&(this.showOptions(),null===(i=this._comboBoxList)||void 0===i||i.nextOption());break;case"ArrowUp":t.preventDefault(),this.canShowListOptions()&&(this.showOptions(),null===(s=this._comboBoxList)||void 0===s||s.previousOption());break;case"Enter":this.isOpen&&(t.preventDefault(),null===(o=this._comboBoxList)||void 0===o||o.selectCurrentOption());break;case"Escape":this.isOpen&&(t.preventDefault(),null===(e=this._popover)||void 0===e||e.hide());break;case"Tab":this._tabPressed=!0,this.isOpen&&(null===(h=this._comboBoxList)||void 0===h||h.selectCurrentOption(),null===(r=this._popover)||void 0===r||r.hide())}}onTextInputFocusOutHandler(){this.hideErrorOnFocusOut&&this.cancelPreselection()}canShowListOptions(){return!this._showLoading&&this._visibleOptions.length>0}async openPopover(){var t;this.isOpen=!0,await(null===(t=this._popover)||void 0===t?void 0:t.showUnder(this._textInput))}render(){var t;return r.addIDInfoIfNotExists(this.el,"input"),s(o,null,s("ez-text-input",{"data-element-id":r.getInternalIDInfo("textInput"),class:"text-input-slot-container "+(this.suppressSearch?"suppressed-search-input":""),ref:t=>this._textInput=t,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:t=>this.onTextInputChangeHandler(t),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:t=>this.keyDownHandler(t),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode,alternativePlaceholder:this.alternativePlaceholder||this.i18n("ez-combo-box.placeholder")},s("button",{class:"btn",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},s("ez-icon",{iconName:"chevron-down"}))),s("ez-popover-plus",{ref:t=>this._popover=t,anchorElement:this._textInput,autoClose:!0,boxWidth:"fit-content",overlayType:"none",onEzVisibilityChange:t=>this.isOpen=t.detail,"data-element-id":this.el.getAttribute("data-element-id")},s("ez-combo-box-list",{ref:t=>this._comboBoxList=t,showLoading:this._showLoading,visibleOptions:this._visibleOptions,textEmptyList:this.i18n("ez-combo-box.noResults"),showOptionValue:this.showOptionValue,preSelection:this._preSelection,maxWidth:this._maxWidthValue,width:null===(t=this._textInput)||void 0===t?void 0:t.clientWidth,onOptionSelect:t=>this.selectOption(t),onOptionHover:t=>this._preSelection=t})))}get el(){return e(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"],options:["observeOptions"]}}};var d;!function(t){t.ADVANCED="ADVANCED",t.PRELOAD="PRELOAD",t.PREDICTIVE="PREDICTIVE"}(d||(d={})),l.style=":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--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__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);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)}.btn{outline:none;border:none;background:none;cursor:pointer;padding:0px;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:not-allowed;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}.text-input-slot-container{--ez-text-input__icon--width:32px;--ez-text-input__min-width:var(--ez-combo-box__min-width);--ez-text-input__max-width:var(--ez-combo-box__max-width)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{l as ez_combo_box}
|
|
1
|
+
import{r as t,c as i,h as s,H as o,g as e}from"./p-23a36bb6.js";import{ObjectUtils as h,ElementIDUtils as r}from"@sankhyalabs/core";import"./p-0ec5c128.js";import{C as n}from"./p-ec7db713.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{i as a}from"./p-98218fbc.js";import"./p-30ffb9ed.js";const l=class{constructor(s){t(this,s),this.ezChange=i(this,"ezChange",7),this.ezVisibilityChange=i(this,"ezVisibilityChange",7),this._changeDeboucingTimeout=null,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._lookupMode=!1,this.isOpen=!1,this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._criteria=void 0,this.limitCharsToSearch=3,this.value=void 0,this.label=void 0,this.enabled=!0,this.options=void 0,this.errorMessage=void 0,this.showSelectedValue=!1,this.showOptionValue=!1,this.suppressSearch=!1,this.optionLoader=void 0,this.suppressEmptyOption=!1,this.stopPropagateEnterKeyEvent=!0,this.canShowError=!0,this.mode="regular",this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.autoFocus=!1,this.preventAutoFocus=!1,this.alternativePlaceholder=void 0,this.textEmptyOption=void 0}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())||this.setInputValue())}observeValue(t,i){if(this._textInput&&t!=i)try{if("string"==typeof t)return void this.setInputValue();const s=this.getSelectedOption(t),o=this.getSelectedOption(i),e=this.getSelectedOption(this.value);this.isDifferentValues(e,s)&&(this.value=s),this.isDifferentValues(s,o)&&(this.setInputValue(),this._lookupMode||this.ezChange.emit(null===s?void 0:s)),this.resetOptions()}finally{this._lookupMode=!1}}observeOptions(t,i){h.equals(t,i)||this.loadOptions(d.PRELOAD)}async getValueAsync(){return new Promise(this._showLoading?t=>{let i=setInterval((()=>{this._showLoading||(clearInterval(i),t(this.sanitizeValue(this.value)))}),100)}:t=>t(this.sanitizeValue(this.value)))}async setFocus(t){this._textInput&&this._textInput.setFocus(t)}async setBlur(){this._textInput&&this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async clearValue(){this.clearSearch()}isDifferentValues(t,i){return h.objectToString(t||{})!==h.objectToString(i||{})}getFormattedText(t){if(null!=t)return this.showSelectedValue&&null!=t.value?t.label?`${t.value} - ${t.label}`:t.value:t.label}getText(){const t=this.getSelectedOption(this.sanitizeValue(this.value)),i=this.getFormattedText(t);if(null!=i)return String(i).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}getSelectedOption(t){return"string"==typeof t||t instanceof String?this._visibleOptions.find((i=>i.value===t)):t}updateVisibleOptions(){let t=this._source||[];if(this._criteria){const i=this._criteria.toUpperCase();t=t.filter((t=>t.label.toLocaleUpperCase().indexOf(i)>-1))}this.hasToAddEmptyoption(t)&&(t=[{value:void 0,label:this.textEmptyOption||this.i18n("ez-combo-box.placeholder")}].concat(t)),this._visibleOptions=t,this._maxWidthValue=this.getMaxWidthValue()}hasToAddEmptyoption(t){return!this.suppressEmptyOption&&!t.filter((t=>!t.value)).length}getMaxWidthValue(){var t;if(this.showOptionValue){const i=[];return null===(t=this._visibleOptions)||void 0===t||t.forEach((t=>{const s=this.getWidthValue(t.value);i.includes(s)||i.push(s)})),i.length>1?Math.max(...i):0}return 0}getWidthValue(t){if(null!=this._itemValueBasis){const i=this._itemValueBasis;if(null!=t)return i.innerHTML=t,i.clientWidth>0?i.clientWidth+2:0;i.innerHTML=""}return 0}async showOptions(){var t,i;if(!this.enabled)return;await this.openPopover();const s=null!==(i=null===(t=this.value)||void 0===t?void 0:t.value)&&void 0!==i?i:this.value,o=this._visibleOptions.findIndex((t=>t.value===s));this._preSelection=-1===o?0:o,this._resizeObserver&&this._resizeObserver.observe(this._textInput),this.preventAutoFocus||await this.setFocus()}hideOptions(){var t;null===(t=this._popover)||void 0===t||t.hide(),this._resizeObserver&&this._resizeObserver.unobserve(this._textInput)}updateSource(t){this._startLoading=!1,t instanceof Promise?(this._showLoading=!0,t.then((t=>{this._showLoading=!1,this.updateSource(t)})).catch((()=>this._showLoading=!1)),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(t)?(this._source=t,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1)):this.selectOption(t))}selectOption(t,i=!0){var s,o,e;const h=this.getSelectedOption(this.value);(null===(s=null==h?void 0:h.value)||void 0===s?void 0:s.toString())!==(null===(o=null==t?void 0:t.value)||void 0===o?void 0:o.toString())||null==h&&null!=t&&"value"in t?(this.value=(null==t?void 0:t.value)?t:void 0,null===(e=this._popover)||void 0===e||e.hide()):this.resetOptions(),i&&setTimeout((()=>{this.setFocus()}),0)}loadOptions(t,i=""){this._criteria=i,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:t,argument:i}):this.options)}cancelPreselection(){!this._textInput.value&&this.sanitizeValue(this.value)?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue(!1)}),this._deboucingTime)}setInputValue(t=!0){const i=this.getText();(this._textInput.value||"")!==i&&(this._textInput.value=i,t&&(this.errorMessage=null))}clearSearch(){this.value=null}resetOptions(){this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}sanitizeValue(t){if("undefined"!==t&&"null"!==t)return t}async componentWillLoad(){if(this.i18n=await a(),void 0===this.options){this.options=[];const t=this.el.querySelectorAll("option");t&&t.forEach((t=>{let i=t.innerText,s=t.getAttribute("value");s||(s=i),this.options.push({label:i,value:s}),t.hidden=!0}))}this.loadOptions(d.PRELOAD)}setResizeObserver(){this._resizeObserver=new ResizeObserver((t=>{window.requestAnimationFrame((()=>{Array.isArray(t)&&t.length&&this._textInput&&this._comboBoxList&&(this._comboBoxList.width=this._textInput.clientWidth)}))}))}connectedCallback(){this._resizeObserver||this.setResizeObserver()}componentDidLoad(){n.applyVarsTextInput(this.el,this._textInput),this.setInputValue(!1),this.setResizeObserver(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}disconnectedCallback(){var t;null===(t=this._popover)||void 0===t||t.remove(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}handlerIconClick(){this.showOptions()}onTextInputChangeHandler(t){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(t)}),this._deboucingTime));const s=null===(i=t.target.value)||void 0===i?void 0:i.trim();this._criteria||(this._textInput.value=t.data||s),this._criteria=s,s?(this.updateVisibleOptions(),this.showOptions()):(this._preSelection=void 0,this.updateVisibleOptions())}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}onTextInputClickHandler(){this.showOptions()}keyDownHandler(t){var i,s,o,e,h,r;if(t.ctrlKey&&("f"===t.key||"F"===t.key))return this.loadOptions(d.ADVANCED),t.preventDefault(),void t.stopPropagation();switch(t.key){case"ArrowDown":t.preventDefault(),this.canShowListOptions()&&(this.showOptions(),null===(i=this._comboBoxList)||void 0===i||i.nextOption());break;case"ArrowUp":t.preventDefault(),this.canShowListOptions()&&(this.showOptions(),null===(s=this._comboBoxList)||void 0===s||s.previousOption());break;case"Enter":this.isOpen&&(t.preventDefault(),null===(o=this._comboBoxList)||void 0===o||o.selectCurrentOption());break;case"Escape":this.isOpen&&(t.preventDefault(),null===(e=this._popover)||void 0===e||e.hide());break;case"Tab":this._tabPressed=!0,this.isOpen&&(null===(h=this._comboBoxList)||void 0===h||h.selectCurrentOption(),null===(r=this._popover)||void 0===r||r.hide())}}onTextInputFocusOutHandler(){this.hideErrorOnFocusOut&&this.cancelPreselection()}canShowListOptions(){return!this._showLoading&&this._visibleOptions.length>0}async openPopover(){var t;this.isOpen=!0,await(null===(t=this._popover)||void 0===t?void 0:t.showUnder(this._textInput))}render(){var t;return r.addIDInfoIfNotExists(this.el,"input"),s(o,null,s("ez-text-input",{"data-element-id":r.getInternalIDInfo("textInput"),class:"text-input-slot-container "+(this.suppressSearch?"suppressed-search-input":""),ref:t=>this._textInput=t,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:t=>this.onTextInputChangeHandler(t),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:t=>this.keyDownHandler(t),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode,alternativePlaceholder:this.alternativePlaceholder||this.i18n("ez-combo-box.placeholder")},s("button",{class:"btn",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},s("ez-icon",{iconName:"chevron-down"}))),s("ez-popover-plus",{ref:t=>this._popover=t,anchorElement:this._textInput,autoClose:!0,boxWidth:"fit-content",overlayType:"none",onEzVisibilityChange:t=>this.isOpen=t.detail,"data-element-id":this.el.getAttribute("data-element-id")},s("ez-combo-box-list",{ref:t=>this._comboBoxList=t,showLoading:this._showLoading,visibleOptions:this._visibleOptions,textEmptyList:this.i18n("ez-combo-box.noResults"),showOptionValue:this.showOptionValue,preSelection:this._preSelection,maxWidth:this._maxWidthValue,width:null===(t=this._textInput)||void 0===t?void 0:t.clientWidth,onOptionSelect:t=>this.selectOption(t),onOptionHover:t=>this._preSelection=t})))}get el(){return e(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"],options:["observeOptions"]}}};var d;!function(t){t.ADVANCED="ADVANCED",t.PRELOAD="PRELOAD",t.PREDICTIVE="PREDICTIVE"}(d||(d={})),l.style=":host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--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__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);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)}.btn{outline:none;border:none;background:none;cursor:pointer;padding:0px;color:var(--ez-combo-box__btn--color)}.btn:disabled{cursor:unset;color:var(--ez-combo-box__btn-disabled--color)}.btn:disabled:hover{cursor:not-allowed;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}.text-input-slot-container{--ez-text-input__icon--width:32px;--ez-text-input__min-width:var(--ez-combo-box__min-width);--ez-text-input__max-width:var(--ez-combo-box__max-width)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";export{l as ez_combo_box}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as r,g as o}from"./p-23a36bb6.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._isOverflowing=!1,this.label=void 0,this.alternativePlaceholder=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.hasInvalid=!1,this.mask=void 0,this.cleanValueMask=!1,this.canShowError=!0,this.restrict=void 0,this.mode="regular",this.noBorder=!1,this.password=!1,this.autoFocus=!1,this.hasRightSlotContent=!1,this.forceLabelFloat=!1}observeHasInvalid(t,i){t!==i&&this.validateErrors()}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.checkIsOverflowing(),this.isSlaveMode()||(this.errorMessage="",this.ezChange.emit(this.value)))}observeAlternativePlaceholder(t){this.forceLabelFloat=!!t}validateErrors(){const t=this.handleValidateErrorMessage(this.errorMessage);this.updateClassError(this.canShowError&&(t||this.hasInvalid))}handleValidateErrorMessage(t=this.errorMessage){return"string"==typeof t&&""!==t.trim()}updateClassError(t){this._inputElem&&(t?this._inputElem.classList.add("hasError"):this._inputElem.classList.remove("hasError"))}adjustFloatingLabel(){if(this.label&&this._labelElem){if(this._inputElem&&!this._inputElem.classList.contains("input--with--label")&&this._inputElem.classList.add("input--with--label"),this.forceLabelFloat)return;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(t){const{selectText:i}=t||{};if(i&&this._inputElem.select(),this._inputElem.disabled)return this._inputElem.classList.add("focused"),void this._inputElem.scrollIntoView({behavior:"smooth",block:"start"});requestAnimationFrame((()=>this._inputElem.focus()))}async setBlur(){this._inputElem.blur()}async isInvalid(){return this.handleValidateErrorMessage()}handleFocusout(){const t=this._inputElem.value;if(t&&this._maskFormatter)try{this.cleanValueMask?this.applyMask(t):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.cleanValueMask&&this._maskFormatter?this._maskFormatter.removeMask(this._inputElem.value):this._inputElem.value)}applyMask(t){if(!t||""===t)return t;if(this._maskFormatter)try{const i=this._maskFormatter.applyMask(this._maskFormatter.removeMask(t));return this._inputElem?(this._inputElem.value=i,this._inputElem.value):(this.value=i,this.value)}catch(t){this.errorMessage=t.message}return t}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){var i;const e=t.target,r=e.assignedElements()[0];this.hasRightSlotContent=!1,r&&(r.style.position="absolute",r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.style.overflow="hidden",r.style.top="0px",r.style.width="var(--ez-text-input__icon--width)",r.style.height="slim"!=this.mode?"var(--ez-text-input--height)":"var(--ez-text-input--height--slim)","leftIcon"==e.name?(r.style.left="0px",r.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=r):"rightIcon"==e.name&&(r.style.right="0px",r.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"),this._tooltipIconElem&&this._tooltipIconElem.classList.add("rightIconSlot"),this.hasRightSlotContent=(null===(i=r.children)||void 0===i?void 0:i.length)>0),e.name&&s.addIDInfo(r,e.name)),this.validateErrors()}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--icon-color)")}getValue(){return this.mask&&this.cleanValueMask?this.applyMask(this.value):this.value}buildLabelClass(){let t=this.enabled?"input__label":"input__label input__label--disabled";return this.errorMessage&&(t+=" hasError"),this.forceLabelFloat&&(t+=" input__label--floated"),t}buildPlaceholder(){return this.alternativePlaceholder?this.alternativePlaceholder:"slim"===this.mode&&this.label?this.label:""}checkIsOverflowing(){this._isOverflowing=!!this._inputElem&&this._inputElem.offsetWidth<this._inputElem.scrollWidth}componentWillLoad(){if(this.observeMask(),this.forceLabelFloat=!!this.alternativePlaceholder,this.value){if(this._maskFormatter)try{this.cleanValueMask?this.applyMask(this.value):this.value=this._maskFormatter.format(this.value)}catch(t){this.errorMessage=t.message}this.isValidValue(this.value)||(this._lastValidValue="",this.value="")}}componentDidLoad(){var t;this.validateErrors(),this.observeMask(),this.adjustFloatingLabel(),this.adjustBorderInput(),this.checkIsOverflowing(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})})),null===(t=this._inputElem)||void 0===t||t.addEventListener("focus",(()=>{var t;this._inputElem.setSelectionRange(0,null===(t=this._inputElem)||void 0===t?void 0:t.value.length)})),this.onClickOutside=t=>{this._inputElem.contains(t.target)||this._inputElem.classList.remove("focused")},document.addEventListener("click",this.onClickOutside)}disconnectedCallback(){document.removeEventListener("click",this.onClickOutside)}componentDidRender(){this.adjustFloatingLabel()}render(){return s.addIDInfoIfNotExists(this._hostElement,"input"),e(r,{style:this._hostElement.classList.contains("grid_editor")?{height:"100%"}:null},e("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label&&"slim"!=this.mode?e("label",{ref:t=>this._labelElem=t,class:this.buildLabelClass(),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:this.password?"password":"text",class:"slim"===this.mode?"input--slim":"",placeholder:this.buildPlaceholder(),value:this.getValue(),disabled:!this.enabled,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()}}),e("ez-tooltip",{anchoringElement:this._hostElement,message:this.getValue(),active:this._isOverflowing,useAnchorSize:!0}),this.canShowError&&"slim"!=this.mode&&this.errorMessage&&e("ez-tooltip",{type:"error",message:this.errorMessage},e("ez-icon",{class:`tooltip-icon ${this.errorMessage?"hasError":""} ${this.hasRightSlotContent?"rightIconSlot":""}`,"data-element-id":s.getInternalIDInfo("tooltip-icon"),ref:t=>this._tooltipIconElem=t,iconName:"alert-circle"})),e("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}}," "))}get _hostElement(){return o(this)}static get watchers(){return{hasInvalid:["observeHasInvalid"],errorMessage:["observeHasInvalid"],canShowError:["observeHasInvalid"],mask:["observeMask"],value:["observeValue"],alternativePlaceholder:["observeAlternativePlaceholder"]}}};a.style=":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:30px;--ez-text-input--height--slim:32px;--ez-text-input__min-width:0px;--ez-text-input__max-width:100%;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--border-top-left-radius:var(--ez-text-input--border-radius);--ez-text-input--border-bottom-left-radius:var(--ez-text-input--border-radius);--ez-text-input--border-top-right-radius:var(--ez-text-input--border-radius);--ez-text-input--border-bottom-right-radius:var(--ez-text-input--border-radius);--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__margin-bottom:var(--space--small);--ez-text-input__input--background-color:var(--background--light, #ffffff);--ez-text-input__input--border:var(--border--small, 1px solid);--ez-text-input__input--border-color:var(--color--strokes,#DCE0E8);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--background--medium, #F0F3F7);--ez-text-input__input--disabled--color:var(--text--primary, #626E82);--ez-text-input__input--error--border-color:var(--color-alert--error-800,#BD0025);--ez-text-input__input--noborder-color:white;--ez-text-input__input--padding:var(--space--medium, 6px);--ez-text-input__placeholder--color:var(--text--secondary, #a2abb9);--ez-text-input__tooltip_icon--error--color:var(--color-alert--error-800,#BD0025);--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;--ez-text-input__input--focus--icon-color:var(--title--primary, #2B3A54);--ez-text-input__input--disabled--focus--icon-color:var(--text--primary, #626E82);--ez-text-input__tooltip-icon--spacing:var(--space--large);--ez-text-input__tooltip-icon---width:var(--space--large);--ez-text-input__tooltip-icon---horizontal-margin:var(--space--medium, 12px);--ez-text-input__tooltip-icon---vertical-margin:10px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width);min-width:var(--ez-text-input__min-width);max-width:var(--ez-text-input__max-width)}:host(.grid_editor){--ez-text-input--height--slim:25px}input{width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;height:var(--ez-text-input--height);border-top-left-radius:var(--ez-text-input--border-top-left-radius);border-bottom-left-radius:var(--ez-text-input--border-bottom-left-radius);border-top-right-radius:var(--ez-text-input--border-top-right-radius);border-bottom-right-radius:var(--ez-text-input--border-bottom-right-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);margin-bottom:var(--ez-text-input__margin-bottom)}input.no--margin{--ez-text-input__margin-bottom:0}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}input:focus{outline:none;border:var(--border--medium, 2px solid);border-color:var(--ez-text-input__input--focus--border-color)}input.focused{border:var(--border--medium, 2px solid);border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--left.hasError{padding-right:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.icon--right.hasError{padding-right:calc(var(--ez-text-input__icon--width) + var(--ez-text-input__tooltip-icon--spacing))}input.hasError{color:var(--ez-text-input--color);border:var(--border--medium, 2px solid);border-color:var(--ez-text-input__input--error--border-color);padding-right:calc(var(--ez-text-input__tooltip-icon---width) + (2*var(--ez-text-input__tooltip-icon---horizontal-margin)))}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:disabled,input:read-only{cursor:not-allowed}.hasError{color:var(--ez-text-input__tooltip_icon--error--color)}.input__label{box-sizing:border-box;position:absolute;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.hasError{width:calc(100% - 2*(var(--ez-text-input__tooltip-icon--spacing)))}.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);cursor:not-allowed}.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--left.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.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,.input--slim:-moz-placeholder,.input--slim::-moz-placeholder,.input--slim:-ms-input-placeholder,.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__placeholder--color)}.input--slim:disabled::-webkit-input-placeholder,.input--slim:disabled:-moz-placeholder,.input--slim:disabled::-moz-placeholder,.input--slim:disabled:-ms-input-placeholder,.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)}ez-icon.tooltip-icon{position:absolute;display:flex;align-items:center;justify-content:center;overflow:hidden;width:var(--ez-text-input__tooltip-icon---width);height:22px;margin:var(--ez-text-input__tooltip-icon---vertical-margin) var(--ez-text-input__tooltip-icon---horizontal-margin);top:0;right:0;border-radius:var(--ez-text-input--border-radius)}ez-icon.tooltip-icon.rightIconSlot{right:var(--ez-text-input__tooltip-icon--spacing)}ez-icon.tooltip-icon.hasError{--ez-icon--color:var(--ez-text-input__tooltip_icon--error--color)}";export{a as ez_text_input}
|
|
1
|
+
import{r as t,c as i,h as e,H as r,g as o}from"./p-23a36bb6.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._isOverflowing=!1,this.label=void 0,this.alternativePlaceholder=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.hasInvalid=!1,this.mask=void 0,this.cleanValueMask=!1,this.canShowError=!0,this.restrict=void 0,this.mode="regular",this.noBorder=!1,this.password=!1,this.autoFocus=!1,this.hasRightSlotContent=!1,this.forceLabelFloat=!1}observeHasInvalid(t,i){t!==i&&this.validateErrors()}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.checkIsOverflowing(),this.isSlaveMode()||(this.errorMessage="",this.ezChange.emit(this.value)))}observeAlternativePlaceholder(t){this.forceLabelFloat=!!t}validateErrors(){const t=this.handleValidateErrorMessage(this.errorMessage);this.updateClassError(this.canShowError&&(t||this.hasInvalid))}handleValidateErrorMessage(t=this.errorMessage){return"string"==typeof t&&""!==t.trim()}updateClassError(t){this._inputElem&&(t?this._inputElem.classList.add("hasError"):this._inputElem.classList.remove("hasError"))}adjustFloatingLabel(){if(this.label&&this._labelElem){if(this._inputElem&&!this._inputElem.classList.contains("input--with--label")&&this._inputElem.classList.add("input--with--label"),this.forceLabelFloat)return;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(t){const{selectText:i}=t||{};if(i&&this._inputElem.select(),this._inputElem.disabled)return this._inputElem.classList.add("focused"),void this._inputElem.scrollIntoView({behavior:"smooth",block:"start"});requestAnimationFrame((()=>this._inputElem.focus()))}async setBlur(){this._inputElem.blur()}async isInvalid(){return this.handleValidateErrorMessage()}handleFocusout(){const t=this._inputElem.value;if(t&&this._maskFormatter)try{this.cleanValueMask?this.applyMask(t):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.cleanValueMask&&this._maskFormatter?this._maskFormatter.removeMask(this._inputElem.value):this._inputElem.value)}applyMask(t){if(!t||""===t)return t;if(this._maskFormatter)try{const i=this._maskFormatter.applyMask(this._maskFormatter.removeMask(t));return this._inputElem?(this._inputElem.value=i,this._inputElem.value):(this.value=i,this.value)}catch(t){this.errorMessage=t.message}return t}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){var i;const e=t.target,r=e.assignedElements()[0];this.hasRightSlotContent=!1,r&&(r.style.position="absolute",r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.style.overflow="hidden",r.style.top="0px",r.style.width="var(--ez-text-input__icon--width)",r.style.height="slim"!=this.mode?"var(--ez-text-input--height)":"var(--ez-text-input--height--slim)","leftIcon"==e.name?(r.style.left="0px",r.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=r):"rightIcon"==e.name&&(r.style.right="0px",r.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"),this._tooltipIconElem&&this._tooltipIconElem.classList.add("rightIconSlot"),this.hasRightSlotContent=(null===(i=r.children)||void 0===i?void 0:i.length)>0),e.name&&a.addIDInfo(r,e.name)),this.validateErrors()}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--icon-color)")}getValue(){return this.mask&&this.cleanValueMask?this.applyMask(this.value):this.value}buildLabelClass(){let t=this.enabled?"input__label":"input__label input__label--disabled";return this.errorMessage&&(t+=" hasError"),this.forceLabelFloat&&(t+=" input__label--floated"),t}buildPlaceholder(){return this.alternativePlaceholder?this.alternativePlaceholder:"slim"===this.mode&&this.label?this.label:""}checkIsOverflowing(){this._isOverflowing=!!this._inputElem&&this._inputElem.offsetWidth<this._inputElem.scrollWidth}componentWillLoad(){if(this.observeMask(),this.forceLabelFloat=!!this.alternativePlaceholder,this.value){if(this._maskFormatter)try{this.cleanValueMask?this.applyMask(this.value):this.value=this._maskFormatter.format(this.value)}catch(t){this.errorMessage=t.message}this.isValidValue(this.value)||(this._lastValidValue="",this.value="")}}componentDidLoad(){var t;this.validateErrors(),this.observeMask(),this.adjustFloatingLabel(),this.adjustBorderInput(),this.checkIsOverflowing(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})})),null===(t=this._inputElem)||void 0===t||t.addEventListener("focus",(()=>{var t;this._inputElem.setSelectionRange(0,null===(t=this._inputElem)||void 0===t?void 0:t.value.length)})),this.onClickOutside=t=>{this._inputElem.contains(t.target)||this._inputElem.classList.remove("focused")},document.addEventListener("click",this.onClickOutside)}disconnectedCallback(){document.removeEventListener("click",this.onClickOutside)}componentDidRender(){this.adjustFloatingLabel()}render(){return a.addIDInfoIfNotExists(this._hostElement,"input"),e(r,{style:this._hostElement.classList.contains("grid_editor")?{height:"100%"}:null},e("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label&&"slim"!=this.mode?e("label",{ref:t=>this._labelElem=t,class:this.buildLabelClass(),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:this.password?"password":"text",class:"slim"===this.mode?"input--slim":"",placeholder:this.buildPlaceholder(),value:this.getValue(),disabled:!this.enabled,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()}}),e("ez-tooltip",{anchoringElement:this._hostElement,message:this.getValue(),active:this._isOverflowing,useAnchorSize:!0}),this.canShowError&&"slim"!=this.mode&&this.errorMessage&&e("ez-tooltip",{type:"error",message:this.errorMessage},e("ez-icon",{class:`tooltip-icon ${this.errorMessage?"hasError":""} ${this.hasRightSlotContent?"rightIconSlot":""}`,"data-element-id":a.getInternalIDInfo("tooltip-icon"),ref:t=>this._tooltipIconElem=t,iconName:"alert-circle"})),e("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}}," "))}get _hostElement(){return o(this)}static get watchers(){return{hasInvalid:["observeHasInvalid"],errorMessage:["observeHasInvalid"],canShowError:["observeHasInvalid"],mask:["observeMask"],value:["observeValue"],alternativePlaceholder:["observeAlternativePlaceholder"]}}};s.style=":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:30px;--ez-text-input--height--slim:32px;--ez-text-input__min-width:0px;--ez-text-input__max-width:100%;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--border-top-left-radius:var(--ez-text-input--border-radius);--ez-text-input--border-bottom-left-radius:var(--ez-text-input--border-radius);--ez-text-input--border-top-right-radius:var(--ez-text-input--border-radius);--ez-text-input--border-bottom-right-radius:var(--ez-text-input--border-radius);--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__margin-bottom:var(--space--small);--ez-text-input__input--background-color:var(--background--light, #ffffff);--ez-text-input__input--border:var(--border--small, 1px solid);--ez-text-input__input--border-color:var(--color--strokes,#DCE0E8);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--background--medium, #F0F3F7);--ez-text-input__input--disabled--color:var(--text--primary, #626E82);--ez-text-input__input--error--border-color:var(--color-alert--error-800,#BD0025);--ez-text-input__input--noborder-color:white;--ez-text-input__input--padding:var(--space--medium, 6px);--ez-text-input__placeholder--color:var(--text--secondary, #a2abb9);--ez-text-input__tooltip_icon--error--color:var(--color-alert--error-800,#BD0025);--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;--ez-text-input__input--focus--icon-color:var(--title--primary, #2B3A54);--ez-text-input__input--disabled--focus--icon-color:var(--text--primary, #626E82);--ez-text-input__tooltip-icon--spacing:var(--space--large);--ez-text-input__tooltip-icon---width:var(--space--large);--ez-text-input__tooltip-icon---horizontal-margin:var(--space--medium, 12px);--ez-text-input__tooltip-icon---vertical-margin:10px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width);min-width:var(--ez-text-input__min-width);max-width:var(--ez-text-input__max-width)}:host(.grid_editor){--ez-text-input--height--slim:25px}input{width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;height:var(--ez-text-input--height);border-top-left-radius:var(--ez-text-input--border-top-left-radius);border-bottom-left-radius:var(--ez-text-input--border-bottom-left-radius);border-top-right-radius:var(--ez-text-input--border-top-right-radius);border-bottom-right-radius:var(--ez-text-input--border-bottom-right-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);margin-bottom:var(--ez-text-input__margin-bottom)}input.no--margin{--ez-text-input__margin-bottom:0}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color);cursor:not-allowed}input:focus{outline:none;border:var(--border--medium, 2px solid);border-color:var(--ez-text-input__input--focus--border-color)}input.focused{border:var(--border--medium, 2px solid);border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--left.hasError{padding-right:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.icon--right.hasError{padding-right:calc(var(--ez-text-input__icon--width) + var(--ez-text-input__tooltip-icon--spacing))}input.hasError{color:var(--ez-text-input--color);border:var(--border--medium, 2px solid);border-color:var(--ez-text-input__input--error--border-color);padding-right:calc(var(--ez-text-input__tooltip-icon---width) + (2*var(--ez-text-input__tooltip-icon---horizontal-margin)))}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:disabled,input:read-only{cursor:not-allowed}.hasError{color:var(--ez-text-input__tooltip_icon--error--color)}.input__label{box-sizing:border-box;position:absolute;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) + var(--ez-text-input__label--padding-left)));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.hasError{width:calc(100% - 2*(var(--ez-text-input__tooltip-icon--spacing)))}.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);cursor:not-allowed}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - (var(--ez-text-input__icon--width) + var(--ez-text-input__label--padding-right)))}.input__label--left.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - (var(--ez-text-input__icon--width) + var(--ez-text-input__label--padding-left)))}.input__label--right.hasError{width:calc(100% - var(--ez-text-input__icon--width) - var(--ez-text-input__tooltip-icon--spacing))}.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,.input--slim:-moz-placeholder,.input--slim::-moz-placeholder,.input--slim:-ms-input-placeholder,.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__placeholder--color)}.input--slim:disabled::-webkit-input-placeholder,.input--slim:disabled:-moz-placeholder,.input--slim:disabled::-moz-placeholder,.input--slim:disabled:-ms-input-placeholder,.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)}ez-icon.tooltip-icon{position:absolute;display:flex;align-items:center;justify-content:center;overflow:hidden;width:var(--ez-text-input__tooltip-icon---width);height:22px;margin:var(--ez-text-input__tooltip-icon---vertical-margin) var(--ez-text-input__tooltip-icon---horizontal-margin);top:0;right:0;border-radius:var(--ez-text-input--border-radius)}ez-icon.tooltip-icon.rightIconSlot{right:var(--ez-text-input__tooltip-icon--spacing)}ez-icon.tooltip-icon.hasError{--ez-icon--color:var(--ez-text-input__tooltip_icon--error--color)}";export{s as ez_text_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,h as i}from"./p-23a36bb6.js";import{i as e}from"./p-
|
|
1
|
+
import{r as n,h as i}from"./p-23a36bb6.js";import{i as e}from"./p-98218fbc.js";import"@sankhyalabs/core";const r=["progress","pulse","false"],t=["circle","rect","text"],a="text",o="progress",s="circle",g=class{constructor(i){n(this,i),this.items=[],this.template=void 0,this.count=1,this.variant=a,this.width=null,this.height=null,this.marginTop=null,this.marginRight=null,this.marginBottom=null,this.marginLeft=null,this.animation=o}async componentWillLoad(){this.i18n=await e(),this.initializeItems()}componentWillUpdate(){this.initializeItems()}initializeItems(){this.items=Array(this.count).fill(1)}getSkeletonConfig(n){if(n)return(null==n?void 0:n.variant)==s?(n.width=n.width||"var(--skeleton-width, 40px)",n.height=n.height||"var(--skeleton-height, 40px)"):n.width=n.width||"var(--skeleton-width, 100%)",{skeletonClasses:{skeleton:!0,circle:n.variant===s,rect:"rect"===n.variant,progress:"progress"===n.animation,pulse:"pulse"===n.animation},styles:{width:(n.marginRight||n.marginLeft)&&n.width&&n.variant!=s?`calc(${n.width} ${n.marginRight?`- ${n.marginRight}`:""} ${n.marginLeft?`- ${n.marginLeft}`:""})`:n.width,height:n.height,marginTop:n.marginTop,marginRight:n.marginRight,marginBottom:n.marginBottom,marginLeft:n.marginLeft}}}validateVariant(n){return t.includes(n)?n:a}validateAnimation(n){return r.includes(n)?n:o}renderSkeletonTemplate(n){var e;const r=(null===(e=n.$attrs)||void 0===e?void 0:e.innerHTML)||n;if("string"==typeof r){const n=document.createElement("div");n.innerHTML=r;const e=(null==n?void 0:n.querySelectorAll(":not(.skeleton) > *"))||[];return Array.from(e).map((n=>{var e,r,t,a,o,s,g,l,d,p;if(null===(e=null==n?void 0:n.classList)||void 0===e?void 0:e.contains("skeleton")){const i=this.getSkeletonConfig({variant:this.validateVariant((null===(r=n.getAttribute("variant"))||void 0===r?void 0:r.replace(/[{}]/g,""))||this.variant),width:(null===(t=n.getAttribute("width"))||void 0===t?void 0:t.replace(/[{}]/g,""))||this.width,height:(null===(a=n.getAttribute("height"))||void 0===a?void 0:a.replace(/[{}]/g,""))||this.height,marginTop:(null===(o=n.getAttribute("marginTop"))||void 0===o?void 0:o.replace(/[{}]/g,""))||this.marginTop,marginLeft:(null===(s=n.getAttribute("marginLeft"))||void 0===s?void 0:s.replace(/[{}]/g,""))||this.marginLeft,marginRight:(null===(g=n.getAttribute("marginRight"))||void 0===g?void 0:g.replace(/[{}]/g,""))||this.marginRight,marginBottom:(null===(l=n.getAttribute("marginBottom"))||void 0===l?void 0:l.replace(/[{}]/g,""))||this.marginBottom,animation:this.validateAnimation((null===(d=n.getAttribute("animation"))||void 0===d?void 0:d.replace(/[{}]/g,""))||this.animation)}),e=Number(null===(p=n.getAttribute("count"))||void 0===p?void 0:p.replace(/[{}]/g,""))||1;return Array(e).fill(1).map(((n,e)=>this.renderSkeletonItem(e,i)))}return i("div",{innerHTML:n.outerHTML})}))}return n}renderSkeletonItem(n,i){const e=i||this.getSkeletonConfig({variant:this.validateVariant(this.variant),animation:this.validateAnimation(this.animation),width:this.width,height:this.height,marginTop:this.marginTop,marginRight:this.marginRight,marginBottom:this.marginBottom,marginLeft:this.marginLeft});return this.renderSkeletonSpan(n,e)}renderSkeletonSpan(n,e){return i("span",{key:n,class:null==e?void 0:e.skeletonClasses,style:null==e?void 0:e.styles,"data-busy":"true","data-valuemin":"0","data-valuemax":"100","data-valuetext":this.i18n("app.loading"),role:"progressbar",tabindex:"0"})}render(){return this.template?this.renderSkeletonTemplate(this.template):this.items.map(((n,i)=>this.renderSkeletonItem(i)))}};g.style=".skeleton {\n background: var(--skeleton-background, #f0f3f7) no-repeat;\n border-radius: var(--skeleton-border-radius, 12px);\n width: var(--skeleton-width, 100%);\n height: var(--skeleton-height, 20px);\n display: inline-block;\n margin-bottom: var(--skeleton-margin-bottom, 0px);\n\tmargin-top: var(--skeleton-margin-top, 0px);\n\tmargin-right: var(--skeleton-margin-right, 0px);\n\tmargin-left: var(--skeleton-margin-left, 0px);\n box-sizing: border-box;\n outline: none;\n overflow: hidden;\n position: relative;\n -webkit-will-change: transform;\n -moz-will-change: transform;\n will-change: transform;\n\n &:after,\n &:before {\n box-sizing: border-box;\n }\n\n &.circle {\n width: var(--skeleton-width, 40px);\n height: var(--skeleton-height, 40px);\n margin-bottom: var(--skeleton-margin-bottom, 0px);\n border-radius: var(--skeleton-border-radius, 50%);\n }\n\n &.rect {\n border-radius: var(--skeleton-border-radius, 0px);\n }\n\n &.progress,\n &.progress-dark {\n -webkit-animation: progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n -moz-animation: progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n -ms-animation: progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n animation: progress 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n background-size: 200px 100%;\n }\n\n &.progress {\n background-image: -webkit-linear-gradient(90deg, rgba(255, 255, 255, 0), var(--skeleton-background-image, #e4eaf1), rgba(255, 255, 255, 0));\n background-image: -moz-linear-gradient(90deg, rgba(255, 255, 255, 0), var(--skeleton-background-image, #e4eaf1), rgba(255, 255, 255, 0));\n background-image: -ms-linear-gradient(90deg, rgba(255, 255, 255, 0), var(--skeleton-background-image, #e4eaf1), rgba(255, 255, 255, 0));\n background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--skeleton-background-image, #e4eaf1), rgba(255, 255, 255, 0));\n }\n\n &.progress-dark {\n background-image: -webkit-linear-gradient(90deg, transparent, hsla(0, 0%, 0%, 0.2), transparent);\n background-image: -moz-linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.2), transparent);\n background-image: -ms-linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.2), transparent);\n background-image: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.2), transparent);\n }\n\n &.pulse {\n -webkit-animation: pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n -moz-animation: pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n -ms-animation: pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n animation: pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;\n animation-delay: 0.5s;\n }\n\n @media (prefers-reduced-motion: reduce) {\n &.pulse,\n &.progress-dark,\n &.progress {\n animation: none;\n }\n\n &.progress,\n &.progress-dark {\n background-image: none;\n }\n }\n}\n\n@-webkit-keyframes progress {\n 0% {\n background-position: -200px 0;\n }\n 100% {\n background-position: calc(200px + 100%) 0;\n }\n}\n@-moz-keyframes progress {\n 0% {\n background-position: -200px 0;\n }\n 100% {\n background-position: calc(200px + 100%) 0;\n }\n}\n@-ms-keyframes progress {\n 0% {\n background-position: -200px 0;\n }\n 100% {\n background-position: calc(200px + 100%) 0;\n }\n}\n@keyframes progress {\n 0% {\n background-position: -200px 0;\n }\n 100% {\n background-position: calc(200px + 100%) 0;\n }\n}\n\n@-webkit-keyframes pulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.4;\n }\n 100% {\n opacity: 1;\n }\n}\n@-moz-keyframes pulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.4;\n }\n 100% {\n opacity: 1;\n }\n}\n@-ms-keyframes pulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.4;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes pulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.4;\n }\n 100% {\n opacity: 1;\n }\n}\n";export{g as ez_skeleton}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as o,H as e,g as l}from"./p-23a36bb6.js";import{KeyboardManager as s,FloatingManager as n}from"@sankhyalabs/core";import{i as a}from"./p-98218fbc.js";const p=class{constructor(o){t(this,o),this.ezClosePopup=i(this,"ezClosePopup",7),this.ezPopupAction=i(this,"ezPopupAction",7),this.handleFooterSlotChange=t=>{this._hasFooterSlotContent=t.target.assignedElements().length>0},this._hasFooterSlotContent=!1,this.size="medium",this.opened=!1,this.useHeader=!0,this.heightMode="full",this.ezTitle=void 0,this.enabledScroll=!0,this.autoClose=!0,this.footerButtons=[]}observeConfig(){this.manageOverflow()}async componentWillLoad(){this.i18n=await a()}componentDidLoad(){this.popUpFocus(),this._keyboardManager=new s({propagate:!1,element:this._element,enableShadowDom:!0}).bind("Enter",this.ezPopupAction.emit.bind("OK")).bind("Escape",(()=>this.closePopup())).bind("Esc",(()=>this.closePopup()))}disconnectedCallback(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}closePopup(){this.opened=!1,this.manageOverflow(),this.ezClosePopup.emit()}manageOverflow(){window.document.body.style.overflow=this.opened?"hidden":""}manageOverlay(){this.opened?this._overlayId=n.subscribeOverlayControl(this._popupRef):n.unsubscribeOverlayControl(this._popupRef||this._overlayId)}popUpFocus(){this.opened&&this._popupRef&&this._popupRef.focus()}getGridSize(){var t;const i={"x-small":"col--sd-3 ez-popup__size-limit--x-small",small:"col--sd-5",medium:"col--sd-6",large:"col--sd-9","x-large":"col--sd-11",default:"ez-popup__size-limit--x-small",auto:""};return this.size&&i.hasOwnProperty(this.size)&&null!==(t=i[this.size])&&void 0!==t?t:i.medium}getDialogClass(){let t="popup__container";return"auto"===this.heightMode&&(t+=" popup__container--auto"),t+=` ${this.getGridSize()}`,t}componentDidRender(){this.manageOverlay(),this.popUpFocus()}handleAutoClose(t){if(!this.opened||!this._popupRef||!this.autoClose)return;if(this._popupRef.contains(t.target))return;const i=this._popupRef.querySelector("slot");if(i&&i.assignedElements().length>0){const o=i.assignedElements();for(const i of o)if(i.contains(t.target))return}this._popupRef.shadowRoot&&this._popupRef.shadowRoot.contains(t.target)||this.closePopup()}handleDefaultPropsButtonsByIndex(t){switch(t){case 0:return{label:this.i18n?this.i18n("app.confirm"):"Confirmar",variant:"primary",size:"small",onClick:()=>{this.closePopup(),this.ezPopupAction.emit("OK")}};case 1:return{label:this.i18n?this.i18n("app.cancel"):"Cancelar",variant:"secondary",size:"small",onClick:()=>{this.closePopup()}};case 2:return{label:this.i18n?this.i18n("app.close"):"Fechar",variant:"tertiary",size:"small",onClick:()=>{this.closePopup()}}}}renderFooterButtons(){return this.footerButtons.slice(0,3).map(((t,i)=>o("ez-button",Object.assign({key:i},this.handleDefaultPropsButtonsByIndex(i),t))))}render(){return o(e,null,this.opened&&o("div",{class:"overlay",tabIndex:-1,onClick:this.handleAutoClose.bind(this)},o("dialog",{ref:t=>this._popupRef=t,class:this.getDialogClass()},this.useHeader&&o("header",{class:"popup__header"},!!this.ezTitle&&o("h1",{class:"popup__title"},this.ezTitle),o("ez-button",{class:this.ezTitle?"btn-close":"btn-close btn-close--solo",variant:"tertiary",mode:"icon",iconName:"close",size:"small",onClick:this.closePopup.bind(this)})),o("main",{class:{"popup__expandable-content":!0,"popup__overflow-y--auto":this.enabledScroll}},o("slot",null)),o("footer",{class:{popup__footer:!0,"popup_margin-top":this.footerButtons.length>0||this._hasFooterSlotContent}},this.footerButtons.length>0&&this.renderFooterButtons(),o("slot",{name:"footer",onSlotchange:this.handleFooterSlotChange})))))}get _element(){return l(this)}static get watchers(){return{opened:["observeConfig"]}}};p.style=':host{display:flex;width:auto;--ez-popup-z-index:var(--elevation--24, 24);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--24, 24px);--ez-popup__title--font-family:var(--font--pattern, "Roboto");--ez-popup__title--font-size:var(--font-size--xxlarge, 22px);--ez-popup__title--color:var(--title--primary, #00281D);--ez-popup__title--font-weight:var(--font-weight--regular, 400)}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index, 24);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup__container{width:auto;max-height:90%;height:100%;display:flex;flex-direction:column;overflow:hidden;outline:none;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding);margin:0;border:none;position:unset}.popup__container--auto{height:auto}.popup__overflow-y--auto{overflow-y:auto}.popup__content{box-sizing:border-box;height:100%;width:100%}.popup__expandable-content{flex-grow:1;box-sizing:border-box;width:100%;font-family:var(--font--pattern, "Roboto");font-size:var(--font-size--default, 14px);color:var(--title--primary, #00281D);font-weight:var(--font-weight--regular, 400)}.popup__header{flex-shrink:0;width:100%;display:flex;align-items:center;margin-bottom:var(--space--16, 16px)}.popup__title{display:flex;margin:0;width:100%;font-family:var(--ez-popup__title--font-family);font-size:var(--ez-popup__title--font-size);font-weight:var(--ez-popup__title--font-weight);color:var(--ez-popup__title--color);line-height:var(--line-height--32, 32px)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close--solo{width:100%}.popup__footer{flex-shrink:0;display:flex;width:100%;flex-direction:row-reverse;gap:var(--space--8, 8px)}.popup_margin-top{margin-top:var(--space--16, 16px)}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}.ez-popup__size-limit--x-small{min-width:350px;max-width:560px}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}';export{p as ez_popup}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ApplicationContext as e,LangUtils as t}from"@sankhyalabs/core";const i=e=>"string"==typeof e,o=()=>{let e,t;const i=new Promise(((i,o)=>{e=i,t=o}));return i.resolve=e,i.reject=t,i},a=e=>null==e?"":""+e,s=/###/g,r=e=>e&&e.indexOf("###")>-1?e.replace(s,"."):e,n=e=>!e||i(e),l=(e,t,o)=>{const a=i(t)?t.split("."):t;let s=0;for(;s<a.length-1;){if(n(e))return{};const t=r(a[s]);!e[t]&&o&&(e[t]=new o),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++s}return n(e)?{}:{obj:e,k:r(a[s])}},u=(e,t,i)=>{const{obj:o,k:a}=l(e,t,Object);if(void 0!==o||1===t.length)return void(o[a]=i);let s=t[t.length-1],r=t.slice(0,t.length-1),n=l(e,r,Object);for(;void 0===n.obj&&r.length;)s=`${r[r.length-1]}.${s}`,r=r.slice(0,r.length-1),n=l(e,r,Object),n&&n.obj&&void 0!==n.obj[`${n.k}.${s}`]&&(n.obj=void 0);n.obj[`${n.k}.${s}`]=i},c=(e,t)=>{const{obj:i,k:o}=l(e,t);if(i)return i[o]},d=(e,t,i)=>{const o=c(e,i);return void 0!==o?o:c(t,i)},h=(e,t,o)=>{for(const a in t)"__proto__"!==a&&"constructor"!==a&&(a in e?i(e[a])||e[a]instanceof String||i(t[a])||t[a]instanceof String?o&&(e[a]=t[a]):h(e[a],t[a],o):e[a]=t[a]);return e},p=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var m={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const g=e=>i(e)?e.replace(/[&<>"'\/]/g,(e=>m[e])):e,f=[" ",",","?","!",";"],v=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}(20),b=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const o=t.split(i);let a=e;for(let e=0;e<o.length;){if(!a||"object"!=typeof a)return;let t,s="";for(let r=e;r<o.length;++r)if(r!==e&&(s+=i),s+=o[r],t=a[s],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&r<o.length-1)continue;e+=r-e+1;break}a=t}return a},y=e=>e&&e.replace("_","-"),x={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class S{constructor(e){this.init(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||x,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,o,a){return a&&!this.debug?null:(i(e[0])&&(e[0]=`${o}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new S(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new S(this.logger,e)}}var w=new S;class C{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const i=this.observers[e].get(t)||0;this.observers[e].set(t,i+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];this.observers[e]&&Array.from(this.observers[e].entries()).forEach((e=>{let[t,o]=e;for(let e=0;e<o;e++)t(...i)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((t=>{let[o,a]=t;for(let t=0;t<a;t++)o.apply(o,[e,...i])}))}}class P extends C{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const s=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,r=void 0!==a.ignoreJSONStructure?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let n;e.indexOf(".")>-1?n=e.split("."):(n=[e,t],o&&(Array.isArray(o)?n.push(...o):i(o)&&s?n.push(...o.split(s)):n.push(o)));const l=c(this.data,n);return!l&&!t&&!o&&e.indexOf(".")>-1&&(e=n[0],t=n[1],o=n.slice(2).join(".")),!l&&r&&i(o)?b(this.data&&this.data[e]&&this.data[e][t],o,s):l}addResource(e,t,i,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const s=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator;let r=[e,t];i&&(r=r.concat(s?i.split(s):i)),e.indexOf(".")>-1&&(r=e.split("."),o=t,t=r[1]),this.addNamespaces(t),u(this.data,r,o),a.silent||this.emit("added",e,t,i,o)}addResources(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const a in o)(i(o[a])||Array.isArray(o[a]))&&this.addResource(e,t,a,o[a],{silent:!0});a.silent||this.emit("added",e,t,o)}addResourceBundle(e,t,i,o,a){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},r=[e,t];e.indexOf(".")>-1&&(r=e.split("."),o=i,i=t,t=r[1]),this.addNamespaces(t);let n=c(this.data,r)||{};s.skipCopy||(i=JSON.parse(JSON.stringify(i))),o?h(n,i,a):n={...n,...i},u(this.data,r,n),s.silent||this.emit("added",e,t,i)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var z={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,i,o,a){return e.forEach((e=>{this.processors[e]&&(t=this.processors[e].process(t,i,o,a))})),t}};const A={};class L extends C{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o;super(),i=e,o=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((e=>{i[e]&&(o[e]=i[e])})),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=w.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){if(null==e)return!1;const t=this.resolve(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}});return t&&void 0!==t.res}extractFromKey(e,t){let o=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===o&&(o=":");const a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let s=t.ns||this.options.defaultNS||[];const r=o&&e.indexOf(o)>-1,n=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,i)=>{t=t||"",i=i||"";const o=f.filter((e=>t.indexOf(e)<0&&i.indexOf(e)<0));if(0===o.length)return!0;const a=v.getRegExp(`(${o.map((e=>"?"===e?"\\?":e)).join("|")})`);let s=!a.test(e);if(!s){const t=e.indexOf(i);t>0&&!a.test(e.substring(0,t))&&(s=!0)}return s})(e,o,a));if(r&&!n){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:i(s)?[s]:s};const r=e.split(o);(o!==a||o===a&&this.options.ns.indexOf(r[0])>-1)&&(s=r.shift()),e=r.join(a)}return{key:e,namespaces:i(s)?[s]:s}}translate(e,t,o){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const a=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:r,namespaces:n}=this.extractFromKey(e[e.length-1],t),l=n[n.length-1],u=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(c){const e=t.nsSeparator||this.options.nsSeparator;return a?{res:`${l}${e}${r}`,usedKey:r,exactUsedKey:r,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:`${l}${e}${r}`}return a?{res:r,usedKey:r,exactUsedKey:r,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:r}const d=this.resolve(e,t);let h=d&&d.res;const p=d&&d.usedKey||r,m=d&&d.exactUsedKey||r,g=Object.prototype.toString.apply(h),f=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,b=!i(h)&&"boolean"!=typeof h&&"number"!=typeof h;if(!(v&&h&&b&&["[object Number]","[object Function]","[object RegExp]"].indexOf(g)<0)||i(f)&&Array.isArray(h))if(v&&i(f)&&Array.isArray(h))h=h.join(f),h&&(h=this.extendTranslation(h,e,t,o));else{let a=!1,n=!1;const c=void 0!==t.count&&!i(t.count),p=L.hasDefaultValue(t),m=c?this.pluralResolver.getSuffix(u,t.count,t):"",g=t.ordinal&&c?this.pluralResolver.getSuffix(u,t.count,{ordinal:!1}):"",f=c&&!t.ordinal&&0===t.count&&this.pluralResolver.shouldUseIntlApi(),v=f&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${m}`]||t[`defaultValue${g}`]||t.defaultValue;!this.isValidLookup(h)&&p&&(a=!0,h=v),this.isValidLookup(h)||(n=!0,h=r);const b=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:h,y=p&&v!==h&&this.options.updateMissing;if(n||a||y){if(this.logger.log(y?"updateKey":"missingKey",u,l,r,y?v:h),s){const e=this.resolve(r,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const i=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&i&&i[0])for(let t=0;t<i.length;t++)e.push(i[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const o=(e,i,o)=>{const a=p&&o!==h?o:b;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,i,a,y,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,l,i,a,y,t),this.emit("missingKey",e,l,i,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&c?e.forEach((e=>{const i=this.pluralResolver.getSuffixes(e,t);f&&t[`defaultValue${this.options.pluralSeparator}zero`]&&i.indexOf(`${this.options.pluralSeparator}zero`)<0&&i.push(`${this.options.pluralSeparator}zero`),i.forEach((i=>{o([e],r+i,t[`defaultValue${i}`]||v)}))})):o(e,r,v))}h=this.extendTranslation(h,e,t,d,o),n&&h===r&&this.options.appendNamespaceToMissingKey&&(h=`${l}:${r}`),(n||a)&&this.options.parseMissingKeyHandler&&(h="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${r}`:r,a?h:void 0):this.options.parseMissingKeyHandler(h))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,h,{...t,ns:n}):`key '${r} (${this.language})' returned an object instead of string.`;return a?(d.res=e,d.usedParams=this.getUsedParamsDetails(t),d):e}if(s){const e=Array.isArray(h),i=e?[]:{},o=e?m:p;for(const e in h)if(Object.prototype.hasOwnProperty.call(h,e)){const a=`${o}${s}${e}`;i[e]=this.translate(a,{...t,joinArrays:!1,ns:n}),i[e]===a&&(i[e]=h[e])}h=i}}return a?(d.res=h,d.usedParams=this.getUsedParamsDetails(t),d):h}extendTranslation(e,t,o,a,s){var r=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const n=i(e)&&(o&&o.interpolation&&void 0!==o.interpolation.skipOnVariables?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(n){const t=e.match(this.interpolator.nestingRegexp);l=t&&t.length}let u=o.replace&&!i(o.replace)?o.replace:o;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,o.lng||this.language||a.usedLng,o),n){const t=e.match(this.interpolator.nestingRegexp);l<(t&&t.length)&&(o.nest=!1)}!o.lng&&"v1"!==this.options.compatibilityAPI&&a&&a.res&&(o.lng=this.language||a.usedLng),!1!==o.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];return s&&s[0]===i[0]&&!o.context?(r.logger.warn(`It seems you are nesting recursively key: ${i[0]} in key: ${t[0]}`),null):r.translate(...i,t)}),o)),o.interpolation&&this.interpolator.reset()}const n=o.postProcess||this.options.postProcess,l=i(n)?[n]:n;return null!=e&&l&&l.length&&!1!==o.applyPostProcessor&&(e=z.handle(l,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(o)},...o}:o,this)),e}resolve(e){let t,o,a,s,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const l=this.extractFromKey(e,n),u=l.key;o=u;let c=l.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=void 0!==n.count&&!i(n.count),h=d&&!n.ordinal&&0===n.count&&this.pluralResolver.shouldUseIntlApi(),p=void 0!==n.context&&(i(n.context)||"number"==typeof n.context)&&""!==n.context,m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);c.forEach((e=>{this.isValidLookup(t)||(r=e,!A[`${m[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(r)&&(A[`${m[0]}-${e}`]=!0,this.logger.warn(`key "${o}" for languages "${m.join(", ")}" won't get resolved as namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach((i=>{if(this.isValidLookup(t))return;s=i;const o=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(o,u,i,e,n);else{let e;d&&(e=this.pluralResolver.getSuffix(i,n.count,n));const t=`${this.options.pluralSeparator}zero`,a=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(o.push(u+e),n.ordinal&&0===e.indexOf(a)&&o.push(u+e.replace(a,this.options.pluralSeparator)),h&&o.push(u+t)),p){const i=`${u}${this.options.contextSeparator}${n.context}`;o.push(i),d&&(o.push(i+e),n.ordinal&&0===e.indexOf(a)&&o.push(i+e.replace(a,this.options.pluralSeparator)),h&&o.push(i+t))}}let r;for(;r=o.pop();)this.isValidLookup(t)||(a=r,t=this.getResource(i,e,r,n))})))}))})),{res:t,usedKey:o,exactUsedKey:a,usedLng:s,usedNS:r}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,i,o):this.resourceStore.getResource(e,t,i,o)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=e.replace&&!i(e.replace);let a=o?e.replace:e;if(o&&void 0!==e.count&&(a.count=e.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!o){a={...a};for(const e of t)delete a[e]}return a}static hasDefaultValue(e){const t="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t===i.substring(0,t.length)&&void 0!==e[i])return!0;return!1}}const N=e=>e.charAt(0).toUpperCase()+e.slice(1);class k{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=w.create("languageUtils")}getScriptPartFromCode(e){if(!(e=y(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=y(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(i(e)&&e.indexOf("-")>-1){if("undefined"!=typeof Intl&&void 0!==Intl.getCanonicalLocales)try{let t=Intl.getCanonicalLocales(e)[0];if(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)return t}catch(e){}const t=["hans","hant","latn","cyrl","cans","mong","arab"];let i=e.split("-");return this.options.lowerCaseLng?i=i.map((e=>e.toLowerCase())):2===i.length?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=N(i[1].toLowerCase()))):3===i.length&&(i[0]=i[0].toLowerCase(),2===i[1].length&&(i[1]=i[1].toUpperCase()),"sgn"!==i[0]&&2===i[2].length&&(i[2]=i[2].toUpperCase()),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=N(i[1].toLowerCase())),t.indexOf(i[2].toLowerCase())>-1&&(i[2]=N(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const i=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(i)||(t=i)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const i=this.getLanguagePartFromCode(e);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find((e=>e===i?e:e.indexOf("-")<0&&i.indexOf("-")<0?void 0:e.indexOf("-")>0&&i.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===i||0===e.indexOf(i)&&i.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),i(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let o=e[t];return o||(o=e[this.getScriptPartFromCode(t)]),o||(o=e[this.formatLanguageCode(t)]),o||(o=e[this.getLanguagePartFromCode(t)]),o||(o=e.default),o||[]}toResolveHierarchy(e,t){const o=this.getFallbackCodes(t||this.options.fallbackLng||[],e),a=[],s=e=>{e&&(this.isSupportedCode(e)?a.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return i(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&s(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&s(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&s(this.getLanguagePartFromCode(e))):i(e)&&s(this.formatLanguageCode(e)),o.forEach((e=>{a.indexOf(e)<0&&s(this.formatLanguageCode(e))})),a}}let T=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],R={1:e=>Number(e>1),2:e=>Number(1!=e),3:()=>0,4:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),5:e=>Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5),6:e=>Number(1==e?0:e>=2&&e<=4?1:2),7:e=>Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),8:e=>Number(1==e?0:2==e?1:8!=e&&11!=e?2:3),9:e=>Number(e>=2),10:e=>Number(1==e?0:2==e?1:e<7?2:e<11?3:4),11:e=>Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3),12:e=>Number(e%10!=1||e%100==11),13:e=>Number(0!==e),14:e=>Number(1==e?0:2==e?1:3==e?2:3),15:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2),16:e=>Number(e%10==1&&e%100!=11?0:0!==e?1:2),17:e=>Number(1==e||e%10==1&&e%100!=11?0:1),18:e=>Number(0==e?0:1==e?1:2),19:e=>Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3),20:e=>Number(1==e?0:0==e||e%100>0&&e%100<20?1:2),21:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0),22:e=>Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)};const E=["v1","v2","v3"],M=["v4"],$={zero:0,one:1,two:2,few:3,many:4,other:5};class O{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=w.create("pluralResolver"),this.options.compatibilityJSON&&!M.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(()=>{const e={};return T.forEach((t=>{t.lngs.forEach((i=>{e[i]={numbers:t.nr,plurals:R[t.fc]}}))})),e})(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi()){const i=y("dev"===e?"en":e),o=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:i,type:o});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let s;try{s=new Intl.PluralRules(i,{type:o})}catch(i){if(!e.match(/-|_/))return;const o=this.languageUtils.getLanguagePartFromCode(e);s=this.getRule(o,t)}return this.pluralRulesCache[a]=s,s}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){const t=this.getRule(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return this.shouldUseIntlApi()?t&&t.resolvedOptions().pluralCategories.length>1:t&&t.numbers.length>1}getPluralFormsOfKey(e,t){return this.getSuffixes(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=this.getRule(e,t);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort(((e,t)=>$[e]-$[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):i.numbers.map((i=>this.getSuffix(e,i,t))):[]}getSuffix(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=this.getRule(e,i);return o?this.shouldUseIntlApi()?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o.select(t)}`:this.getSuffixRetroCompatible(o,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const i=e.plurals(e.noAbs?t:Math.abs(t));let o=e.numbers[i];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===o?o="plural":1===o&&(o=""));const a=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?`_plural_${o.toString()}`:a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?a():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}shouldUseIntlApi(){return!E.includes(this.options.compatibilityJSON)}}const I=function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=d(e,t,o);return!r&&s&&i(o)&&(r=b(e,o,a),void 0===r&&(r=b(t,o,a))),r},F=e=>e.replace(/\$/g,"$$$$");class j{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=w.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:i,useRawValueToEscape:o,prefix:a,prefixEscaped:s,suffix:r,suffixEscaped:n,formatSeparator:l,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:m,nestingSuffixEscaped:f,nestingOptionsSeparator:v,maxReplaces:b,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:g,this.escapeValue=void 0===i||i,this.useRawValueToEscape=void 0!==o&&o,this.prefix=a?p(a):s||"{{",this.suffix=r?p(r):n||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?p(d):h||p("$t("),this.nestingSuffix=m?p(m):f||p(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=b||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,o,s){let r,n,l;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){const i=I(t,u,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,o,{...s,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),a=i.shift().trim(),r=i.join(this.formatSeparator).trim();return this.format(I(t,u,a,this.options.keySeparator,this.options.ignoreJSONStructure),r,o,{...s,...t,interpolationkey:a})};this.resetRegExp();const d=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,h=s&&s.interpolation&&void 0!==s.interpolation.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>F(e)},{regex:this.regexp,safeValue:e=>F(this.escapeValue?this.escape(e):e)}].forEach((t=>{for(l=0;r=t.regex.exec(e);){const o=r[1].trim();if(n=c(o),void 0===n)if("function"==typeof d){const t=d(e,r,s);n=i(t)?t:""}else if(s&&Object.prototype.hasOwnProperty.call(s,o))n="";else{if(h){n=r[0];continue}this.logger.warn(`missed to pass in variable ${o} for interpolating ${e}`),n=""}else i(n)||this.useRawValueToEscape||(n=a(n));const u=t.safeValue(n);if(e=e.replace(r[0],u),h?(t.regex.lastIndex+=n.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,l++,l>=this.maxReplaces)break}})),e}nest(e,t){let o,s,r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const l=(e,t)=>{const i=this.nestingOptionsSeparator;if(e.indexOf(i)<0)return e;const o=e.split(new RegExp(`${i}[ ]*{`));let a=`{${o[1]}`;e=o[0],a=this.interpolate(a,r);const s=a.match(/'/g),n=a.match(/"/g);(s&&s.length%2==0&&!n||n.length%2!=0)&&(a=a.replace(/'/g,'"'));try{r=JSON.parse(a),t&&(r={...t,...r})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${i}${a}`}return r.defaultValue&&r.defaultValue.indexOf(this.prefix)>-1&&delete r.defaultValue,e};for(;o=this.nestingRegexp.exec(e);){let u=[];r={...n},r=r.replace&&!i(r.replace)?r.replace:r,r.applyPostProcessor=!1,delete r.defaultValue;let c=!1;if(-1!==o[0].indexOf(this.formatSeparator)&&!/{.*}/.test(o[1])){const e=o[1].split(this.formatSeparator).map((e=>e.trim()));o[1]=e.shift(),u=e,c=!0}if(s=t(l.call(this,o[1].trim(),r),r),s&&o[0]===e&&!i(s))return s;i(s)||(s=a(s)),s||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),s=""),c&&(s=u.reduce(((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:o[1].trim()})),s.trim())),e=e.replace(o[0],s),this.regexp.lastIndex=0}return e}}const D=e=>{const t={};return(i,o,a)=>{let s=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(s={...s,[a.interpolationkey]:void 0});const r=o+JSON.stringify(s);let n=t[r];return n||(n=e(y(o),a),t[r]=n),n(i)}};class B{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=w.create("formatter"),this.options=e,this.formats={number:D(((e,t)=>{const i=new Intl.NumberFormat(e,{...t});return e=>i.format(e)})),currency:D(((e,t)=>{const i=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>i.format(e)})),datetime:D(((e,t)=>{const i=new Intl.DateTimeFormat(e,{...t});return e=>i.format(e)})),relativetime:D(((e,t)=>{const i=new Intl.RelativeTimeFormat(e,{...t});return e=>i.format(e,t.range||"day")})),list:D(((e,t)=>{const i=new Intl.ListFormat(e,{...t});return e=>i.format(e)}))},this.init(e)}init(e){this.formatSeparator=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=D(t)}format(e,t,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find((e=>e.indexOf(")")>-1))){const e=a.findIndex((e=>e.indexOf(")")>-1));a[0]=[a[0],...a.splice(1,e)].join(this.formatSeparator)}return a.reduce(((e,t)=>{const{formatName:a,formatOptions:s}=(e=>{let t=e.toLowerCase().trim();const i={};if(e.indexOf("(")>-1){const o=e.split("(");t=o[0].toLowerCase().trim();const a=o[1].substring(0,o[1].length-1);"currency"===t&&a.indexOf(":")<0?i.currency||(i.currency=a.trim()):"relativetime"===t&&a.indexOf(":")<0?i.range||(i.range=a.trim()):a.split(";").forEach((e=>{if(e){const[t,...o]=e.split(":"),a=o.join(":").trim().replace(/^'+|'+$/g,""),s=t.trim();i[s]||(i[s]=a),"false"===a&&(i[s]=!1),"true"===a&&(i[s]=!0),isNaN(a)||(i[s]=parseInt(a,10))}}))}return{formatName:t,formatOptions:i}})(t);if(this.formats[a]){let t=e;try{const r=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{};t=this.formats[a](e,r.locale||r.lng||o.locale||o.lng||i,{...s,...o,...r})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${a}`),e}),e)}}class U extends C{constructor(e,t,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=i,this.languageUtils=i.languageUtils,this.options=o,this.logger=w.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(i,o.backend,o)}queueLoad(e,t,i,o){const a={},s={},r={},n={};return e.forEach((e=>{let o=!0;t.forEach((t=>{const r=`${e}|${t}`;!i.reload&&this.store.hasResourceBundle(e,t)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===s[r]&&(s[r]=!0):(this.state[r]=1,o=!1,void 0===s[r]&&(s[r]=!0),void 0===a[r]&&(a[r]=!0),void 0===n[t]&&(n[t]=!0)))})),o||(r[e]=!0)})),(Object.keys(a).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(s),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(n)}}loaded(e,t,i){const o=e.split("|"),a=o[0],s=o[1];t&&this.emit("failedLoading",a,s,t),!t&&i&&this.store.addResourceBundle(a,s,i,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&i&&(this.state[e]=0);const r={};this.queue.forEach((i=>{((e,t,i)=>{const{obj:o,k:a}=l(e,t,Object);o[a]=o[a]||[],o[a].push(i)})(i.loaded,[a],s),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(i,e),t&&i.errors.push(t),0!==i.pendingCount||i.done||(Object.keys(i.loaded).forEach((e=>{r[e]||(r[e]={});const t=i.loaded[e];t.length&&t.forEach((t=>{void 0===r[e][t]&&(r[e][t]=!0)}))})),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((e=>!e.done))}read(e,t,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:i,tried:o,wait:a,callback:s});this.readingCalls++;const r=(r,n)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}r&&n&&o<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,i,o+1,2*a,s)}),a):s(r,n)},n=this.backend[i].bind(this.backend);if(2!==n.length)return n(e,t,r);try{const i=n(e,t);i&&"function"==typeof i.then?i.then((e=>r(null,e))).catch(r):r(null,i)}catch(e){r(e)}}prepareLoading(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();i(e)&&(e=this.languageUtils.toResolveHierarchy(e)),i(t)&&(t=[t]);const s=this.queueLoad(e,t,o,a);if(!s.toLoad.length)return s.pending.length||a(),null;s.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,i){this.prepareLoading(e,t,{},i)}reload(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const i=e.split("|"),o=i[0],a=i[1];this.read(o,a,"read",void 0,void 0,((i,s)=>{i&&this.logger.warn(`${t}loading namespace ${a} for language ${o} failed`,i),!i&&s&&this.logger.log(`${t}loaded namespace ${a} for language ${o}`,s),this.loaded(e,i,s)}))}saveMissing(e,t,i,o,a){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn(`did not save key "${i}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=i&&""!==i){if(this.backend&&this.backend.create){const n={...s,isUpdate:a},l=this.backend.create.bind(this.backend);if(l.length<6)try{let a;a=5===l.length?l(e,t,i,o,n):l(e,t,i,o),a&&"function"==typeof a.then?a.then((e=>r(null,e))).catch(r):r(null,a)}catch(e){r(e)}else l(e,t,i,o,r,n)}e&&e[0]&&this.store.addResource(e[0],t,i,o)}}}const q=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),i(e[1])&&(t.defaultValue=e[1]),i(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const i=e[3]||e[2];Object.keys(i).forEach((e=>{t[e]=i[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),V=e=>(i(e.ns)&&(e.ns=[e.ns]),i(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),i(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),G=()=>{};class H extends C{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var i;if(super(),this.options=V(e),this.services={},this.logger=w,this.modules={external:[]},i=this,Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((e=>{"function"==typeof i[e]&&(i[e]=i[e].bind(i))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(a=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&(i(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=q();this.options={...s,...this.options,...V(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;w.init(this.modules.logger?r(this.modules.logger):null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=B);const i=new k(this.options);this.store=new P(this.options.resources,this.options);const o=this.services;o.logger=w,o.resourceStore=this.store,o.languageUtils=i,o.pluralResolver=new O(i,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format||(o.formatter=r(t),o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new j(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new U(r(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(function(t){for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];e.emit(t,...o)})),this.modules.languageDetector&&(o.languageDetector=r(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=r(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new L(this.services,this.options),this.translator.on("*",(function(t){for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];e.emit(t,...o)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,a||(a=G),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=function(){return e.store[t](...arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const n=o(),l=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),n.resolve(t),a(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),n}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G;const o=i(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],i=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};o?i(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>i(e))),this.options.preload&&this.options.preload.forEach((e=>i(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,i){const a=o();return"function"==typeof e&&(i=e,e=void 0),"function"==typeof t&&(i=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),i||(i=G),this.services.backendConnector.reload(e,t,(e=>{a.resolve(),i(e)})),a}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&z.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var a=this;this.isLanguageChangingTo=e;const s=o();this.emit("languageChanging",e);const r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},n=(e,i)=>{i?(r(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,s.resolve((function(){return a.t(...arguments)})),t&&t(e,(function(){return a.t(...arguments)}))},l=t=>{e||t||!this.services.languageDetector||(t=[]);const o=i(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);o&&(this.language||r(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(o)),this.loadResources(o,(e=>{n(e,o)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(e):l(this.services.languageDetector.detect()),s}getFixedT(e,t,o){var a=this;const s=function(e,t){let i;if("object"!=typeof t){for(var r=arguments.length,n=new Array(r>2?r-2:0),l=2;l<r;l++)n[l-2]=arguments[l];i=a.options.overloadTranslationOptionHandler([e,t].concat(n))}else i={...t};i.lng=i.lng||s.lng,i.lngs=i.lngs||s.lngs,i.ns=i.ns||s.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||o||s.keyPrefix);const u=a.options.keySeparator||".";let c;return c=i.keyPrefix&&Array.isArray(e)?e.map((e=>`${i.keyPrefix}${u}${e}`)):i.keyPrefix?`${i.keyPrefix}${u}${e}`:e,a.t(c,i)};return i(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=o,s}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=t.lng||this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,a=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;const s=(e,t)=>{const i=this.services.backendConnector.state[`${e}|${t}`];return-1===i||0===i||2===i};if(t.precheck){const e=t.precheck(this,s);if(void 0!==e)return e}return!(!this.hasResourceBundle(i,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!s(i,e)||o&&!s(a,e)))}loadNamespaces(e,t){const a=o();return this.options.ns?(i(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{a.resolve(),t&&t(e)})),a):(t&&t(),Promise.resolve())}loadLanguages(e,t){const a=o();i(e)&&(e=[e]);const s=this.options.preload||[],r=e.filter((e=>s.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return r.length?(this.options.preload=s.concat(r),this.loadResources((e=>{a.resolve(),t&&t(e)})),a):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new k(q());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new H(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G;const i=e.forkResourceStore;i&&delete e.forkResourceStore;const o={...this.options,...e,isClone:!0},a=new H(o);return void 0===e.debug&&void 0===e.prefix||(a.logger=a.logger.clone(e)),["store","services","language"].forEach((e=>{a[e]=this[e]})),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},i&&(a.store=new P(this.store.data,o),a.services.resourceStore=a.store),a.translator=new L(a.services,o),a.translator.on("*",(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];a.emit(e,...i)})),a.init(o,t),a.translator.options=o,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const W=H.createInstance();function K(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_(e)}function J(e){var t=function(e){if("object"!=_(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=_(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_(t)?t:t+""}function Y(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,J(o.key),o)}}W.createInstance=H.createInstance;var X=[],Z=X.forEach,Q=X.slice;function ee(e){return Z.call(Q.call(arguments,1),(function(t){if(t)for(var i in t)void 0===e[i]&&(e[i]=t[i])})),e}var te=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,ie=function(e,t,i){var o=i||{};o.path=o.path||"/";var a=encodeURIComponent(t),s="".concat(e,"=").concat(a);if(o.maxAge>0){var r=o.maxAge-0;if(Number.isNaN(r))throw new Error("maxAge should be a Number");s+="; Max-Age=".concat(Math.floor(r))}if(o.domain){if(!te.test(o.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(o.domain)}if(o.path){if(!te.test(o.path))throw new TypeError("option path is invalid");s+="; Path=".concat(o.path)}if(o.expires){if("function"!=typeof o.expires.toUTCString)throw new TypeError("option expires is invalid");s+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(s+="; HttpOnly"),o.secure&&(s+="; Secure"),o.sameSite)switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s},oe={name:"cookie",lookup:function(e){var t;if(e.lookupCookie&&"undefined"!=typeof document){var i=function(e){for(var t="".concat(e,"="),i=document.cookie.split(";"),o=0;o<i.length;o++){for(var a=i[o];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t))return a.substring(t.length,a.length)}return null}(e.lookupCookie);i&&(t=i)}return t},cacheUserLanguage:function(e,t){t.lookupCookie&&"undefined"!=typeof document&&function(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};i&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+60*i*1e3)),o&&(a.domain=o),document.cookie=ie(e,encodeURIComponent(t),a)}(t.lookupCookie,e,t.cookieMinutes,t.cookieDomain,t.cookieOptions)}},ae={name:"querystring",lookup:function(e){var t;if("undefined"!=typeof window){var i=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=i.substring(1).split("&"),a=0;a<o.length;a++){var s=o[a].indexOf("=");s>0&&o[a].substring(0,s)===e.lookupQuerystring&&(t=o[a].substring(s+1))}}return t}},se=null,re=function(){if(null!==se)return se;try{se="undefined"!==window&&null!==window.localStorage;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){se=!1}return se},ne={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&re()){var i=window.localStorage.getItem(e.lookupLocalStorage);i&&(t=i)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&re()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},le=null,ue=function(){if(null!==le)return le;try{le="undefined"!==window&&null!==window.sessionStorage;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){le=!1}return le},ce={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&ue()){var i=window.sessionStorage.getItem(e.lookupSessionStorage);i&&(t=i)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&ue()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},de={name:"navigator",lookup:function(){var e=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var t=0;t<navigator.languages.length;t++)e.push(navigator.languages[t]);navigator.userLanguage&&e.push(navigator.userLanguage),navigator.language&&e.push(navigator.language)}return e.length>0?e:void 0}},he={name:"htmlTag",lookup:function(e){var t,i=e.htmlTag||("undefined"!=typeof document?document.documentElement:null);return i&&"function"==typeof i.getAttribute&&(t=i.getAttribute("lang")),t}},pe={name:"path",lookup:function(e){var t;if("undefined"!=typeof window){var i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(i instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof i[e.lookupFromPathIndex])return;t=i[e.lookupFromPathIndex].replace("/","")}else t=i[0].replace("/","")}return t}},me={name:"subdomain",lookup:function(e){var t="number"==typeof e.lookupFromSubdomainIndex?e.lookupFromSubdomainIndex+1:1,i="undefined"!=typeof window&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[t]}},ge=!1;try{ge=!0}catch(e){}var fe=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];function ve(){return{order:fe,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(e){return e}}}ge||fe.splice(1,1);var be,ye=function(){return e=function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};K(this,e),this.type="languageDetector",this.detectors={},this.init(t,i)},t=[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=ee(t,this.options||{},ve()),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(e){return e.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(oe),this.addDetector(ae),this.addDetector(ne),this.addDetector(ce),this.addDetector(de),this.addDetector(he),this.addDetector(pe),this.addDetector(me)}},{key:"addDetector",value:function(e){return this.detectors[e.name]=e,this}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var i=[];return e.forEach((function(e){if(t.detectors[e]){var o=t.detectors[e].lookup(t.options);o&&"string"==typeof o&&(o=[o]),o&&(i=i.concat(o))}})),i=i.map((function(e){return t.options.convertDetectedLanguage(e)})),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(e,t){var i=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){i.detectors[t]&&i.detectors[t].cacheUserLanguage(e,i.options)})))}}],t&&Y(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();ye.type="languageDetector",function(e){e.PT_BR="pt_BR",e.EN_US="en_US",e.ES_ES="es_ES"}(be||(be={}));const xe={[be.PT_BR]:{translation:{app:{collapse:"Resumir",expand:"Expandir",close:"Fechar",profile:"Perfil",warning:"Aviso",edit:"Editar",remove:"Remover",yes:"Sim",no:"Não",loading:"Carregando",apply:"Aplicar",cancel:"Cancelar",confirm:"Confirmar",ok:"OK",alerts:"Avisos",requiredInfo:" (obrigatório) *"},"ez-upload":{enable:"Arraste e solte ou clique para adicionar arquivos",disable:"Somente leitura",replaceFileTitle:"Substituir arquivo",replaceFileMessage:'Já existe um arquivo chamado "{{fileName}}". Deseja substituí-lo?',maxFilesError:"A quantidade máxima de arquivos é {{maxFiles}}.",emptyFileError:'Erro de permissão: O arquivo "{{fileName}}" não pode ser enviado.',missingUploadUrlError:"Endereço de upload não informado.",maxFileSizeError:"O tamanho máximo dos arquivos é de {{maxSize}}.",uploadErrorTitle:"Enviando arquivo",uploadingMessage:"Há arquivos sendo enviados. Por favor aguarde a conclusão ou cancele o envio."},"ez-image-input":{defaultLabel:"Enviar Imagem",imageAlt:"Imagem carregada",removeImage:"Remover imagem",invalidFileType:"O arquivo selecionado não é uma imagem válida.",fileTooLarge:"A imagem deve ter menos de {{maxSize}}.",imagePreview:"Visualizar Imagem"},"ez-calendar":{month:{0:"Janeiro",1:"Fevereiro",2:"Março",3:"Abril",4:"Maio",5:"Junho",6:"Julho",7:"Agosto",8:"Setembro",9:"Outubro",10:"Novembro",11:"Dezembro"},weekDay:{0:"D",1:"S",2:"T",3:"Q",4:"Q",5:"S",6:"S"},today:"Hoje"},"ez-collapsible-box":{confirmRemove:"Deseja realmente remover o grupo <b>{{label}}</b>?"},"ez-combo-box":{placeholder:"Selecione um item",noResults:"Nenhum resultado encontrado"},"ez-classic-combo-box":{emptyOption:"Selecione um item",noResults:"Nenhum resultado encontrado"},"ez-date-time-input":{invalidDate:"O valor digitado não é uma data e hora válida"},"ez-date-input":{invalidDate:"O valor digitado não é uma data válida"},"ez-dialog":{confirmButton:"Botão de confirmação ou OK",closeButton:"Botão de fechar ou X"},"ez-double-list":{noItemsAvailable:"Nenhum {{entity}} disponível",noItemsSelected:"Nenhum {{entity}} selecionado",moveAllTo:"Mover todos para {{list}}",moveTo:"Mover para {{list}}",moveToFirstPosition:"Mover para a primeira posição",moveUp:"Mover para cima",moveDown:"Mover para baixo",moveToLastPosition:"Mover para a última posição"},"ez-file-item":{invalidProgress:"O progresso de upload deve ser um número entre 0 e 100."},"ez-grid":{filterAppliedSuccess:"Filtro de coluna aplicado com sucesso!",cancelPagination:"Cancelar paginação",pageLabel:"Página {{currentPage}}",previousPage:"Página anterior",nextPage:"Próxima página",returnToPreviousPage:"Retorna à página anterior.",goToNextPage:"Avança para a próxima página.",remainingPageLabel:" de {{count}} ou mais",remainingTotalLabel:" de {{total}}",nextRecord:"Avança para o próximo registro.",previousRecord:"Retorna ao registro anterior.",searchColumn:"Busca por coluna.",sortAscending:"Ordenar Ascendente",sortDescending:"Ordenar Descendente",pinColumn:"Fixar coluna",unpinColumn:"Desafixar coluna",filter:"Filtrar",columnCantBeOrder:"Coluna não pode ser ordenada",filterColumnHeader:"Filtro da coluna {{columnLabel}}",clearSelection:"Limpar Seleção",page:"Página",more:"mais",to:"para",of:"de",next:"Próximo",last:"Último",first:"Primeiro",previous:"Anterior",loadingOoo:"Carregar",selectAll:"Selecionar tudo",searchOoo:"Procurar",blanks:"Vazio",filterOoo:"Filtrar",applyFilter:"Aplicar filtro",equals:"Igual",lessThan:"Menor que",greaterThan:"Maior que",contains:"Contém",startsWith:"Começa com",endsWith:"Termina com",group:"Grupo",columns:"Colunas",rowGroupColumns:"Colunas do grupo de linhas",rowGroupColumnsEmptyMessage:"Colunas do grupo de linhas vazias",valueColumns:"Valores das colunas",pivotMode:"Modo pivô",groups:"Grupos",values:"Valores",pivots:"Pivôs",valueColumnsEmptyMessage:"Valores de colunas vazias",pivotColumnsEmptyMessage:"Pivôs de colunas vazias",toolPanelButton:"Botão de painel de ferramentas",noRowsToShow:"Não há registros para mostrar.",valueAggregation:"Agregar valor",autosizeThiscolumn:"Redimensionar esta coluna",autosizeAllColumns:"Redimensionar todas colunas",groupBy:"Agrupar por",ungroupBy:"Desagrupar por",resetColumns:"Resetar colunas",expandAll:"Expandir tudo",collapseAll:"Contrair tudo",toolPanel:"Painel de ferramentas",export:"Exportar",csvExport:"Exportar para CSV",excelExport:"Exportar para Excel",pinLeft:"Fixar coluna",pinRight:"Fixar a direita",noPin:"Desfixar coluna",sum:"Soma",min:"Mínimo",max:"Máximo",none:"Nenhum",count:"Contagem",average:"Média",copy:"Copiar",copyWithHeaders:"Copiar com cabeçalho",copyWithGroupHeaders:"Copiar com cabeçalhos de grupo",ctrlC:"Ctrl+C",paste:"Colar",ctrlV:"Ctrl+V",labelSearchColumn:"Buscar colunas (Ctrl+F)"},"ez-guide-navigator":{searchGuide:"Buscar guia",hideMenu:"Ocultar menu"},"ez-list":{moveToGroup:"Mover para {{groupName}}"},"ez-modal":{close:"Fechar modal"},"ez-multi-selection-list":{selectAll:"Selecionar todos",search:"Buscar...",empty:"(Vazio)",initMessage:"Selecione os valores a serem filtrados através do campo de busca.",emptyResults:"Nenhum resultado encontrado."},"ez-number-input":{invalidNumber:"O valor digitado não é um número válido"},"ez-pagination":{previousPage:"Página anterior",nextPage:"Próxima página"},"ez-rich-text":{listShortcut:"Aplica estilo de lista ao texto selecionado.",linkShortcut:"Abre popup de link.",imageShortcut:"Abre popup de imagem.",boldShortcut:"Aplica estilo negrito ao texto selecionado.",italicShortcut:"Aplica estilo itálico ao texto selecionado.",underlineShortcut:"Aplica estilo sublinhado ao texto selecionado.",breakLineShortcut:"Aplica quebra de linha.",undoShortcut:"Desfaz a última alteração de texto.",redoShortcut:"Refaz a última alteração de texto.",edit:"Editar",preview:"Pré-visualizar",title:{preview:"Ctrl + P",edit:"Ir para modo edição",undo:"Desfazer (Ctrl + Z)",redo:"Refazer (Ctrl + X)",link:"Inserir link (Ctrl + K)",image:"Inserir imagem (Ctrl + O)",list:"Lista (Ctrl + L)",underline:"Sublinhado (Ctrl + U)",italic:"Itálico (Ctrl + I)",bold:"Negrito (Ctrl + B)"}},"ez-link-builder":{addLinkTitle:"Adicionar link",addLinkSubtitle:"Insira um link no texto para abrir novas páginas.",submit:"Enviar",urlInputLabel:"Insira a URL destino",textInputLabel:"Insira o texto a ser exibido",openInNewPage:"Abrir em uma nova página."},"ez-simple-image-uploader":{uploadTitle:"Upload de imagens",uploadSubtitle:"Envie seus arquivos preenchendo apenas 1 campo por vez.",submit:"Enviar",tooltipMessage:"O arquivo selecionado abaixo será priorizado!",urlInputLabel:"Insira a URL da imagem",orText:"OU",removeFile:"Remover arquivo",dragDropText:"Arraste e solte ou clique para adicionar arquivos",imageAlt:"Imagem",imageTooLarge:"A imagem deve ter menos de {{maxSize}}."},"ez-search":{emptyList:"Nenhum resultado encontrado",emptySearch:"Nenhum resultado de {{field}} encontrado",showMore:"Mostrar mais"},"ez-search-plus":{emptyList:"Nenhum resultado encontrado",optionLoaderNotDefined:"optionLoader não definido",defaultCodeLabel:"Cód."},"ez-sortable-list":{emptyMessage:"Nenhum item na lista",entityLabel:"item",entityLabelPlural:"itens",total:"Total de",search:"Buscar"},"ez-split-button":{moreOptions:"Mais opções"},"ez-text-edit":{emptyFieldWarning:"Não é possível salvar um campo em branco."},"ez-time-input":{invalidTime:"Favor inserir um horário válido."},"ez-sidebar":{unPinMenu:"Desafixar menu",pushPinMenu:"Fixar menu",hideMenu:"Recolher menu"},"ez-form":{mainTab:"Principal",labelSearchField:"Buscar campos (Ctrl+F)"},utils:{requiredFieldMessage:"Há pelo menos um campo obrigatório não preenchido.",requiredField:"Essa informação é obrigatória.",selectAllPage:"Selecionar apenas a página atual",loadingAllRecords:"Carregando todos os {{count}} registros",selectAllRecords:"Selecionar todos os {{total}} registros",waitForLoad:"Aguarde o carregamento para selecionar o registro de todas as páginas",allRecordsSelected:"Todos os <strong>{{selectionCount}} registros</strong> da grade estão selecionados.",selectedRecords:"Há <strong>{{selectionCount}} registro{{plural}}</strong> selecionado{{plural}} na grade."},spinner:{loading:"Carregando..."}}},[be.EN_US]:{translation:{app:{collapse:"Collapse",expand:"Expand",close:"Close",profile:"Profile",warning:"Warning",edit:"Edit",remove:"Remove",yes:"Yes",no:"No",loading:"Loading",apply:"Apply",cancel:"Cancel",confirm:"Confirm",ok:"OK",alerts:"Alerts",requiredInfo:" (required) *"},"ez-upload":{enable:"Drag and drop or click to add files",disable:"Read only",replaceFileTitle:"Replace file",replaceFileMessage:'A file named "{{fileName}}" already exists. Do you want to replace it?',maxFilesError:"The maximum number of files is {{maxFiles}}.",emptyFileError:'Permission error: The file "{{fileName}}" cannot be uploaded.',missingUploadUrlError:"Upload URL not provided.",maxFileSizeError:"The maximum file size is {{maxSize}}.",uploadErrorTitle:"Uploading file",uploadingMessage:"Files are being uploaded. Please wait for completion or cancel the upload."},"ez-image-input":{defaultLabel:"Upload Image",imageAlt:"Uploaded image",removeImage:"Remove image",invalidFileType:"The selected file is not a valid image.",fileTooLarge:"The image must be less than {{maxSize}}.",imagePreview:"Image Preview"},"ez-calendar":{month:{0:"January",1:"February",2:"March",3:"April",4:"May",5:"June",6:"July",7:"August",8:"September",9:"October",10:"November",11:"December"},weekDay:{0:"S",1:"M",2:"T",3:"W",4:"T",5:"F",6:"S"},today:"Today"},"ez-collapsible-box":{confirmRemove:"Do you really want to remove the group <b>{{label}}</b>?"},"ez-combo-box":{placeholder:"Select an item",noResults:"No results found"},"ez-classic-combo-box":{emptyOption:"Select an item",noResults:"No results found"},"ez-date-time-input":{invalidDate:"The entered value is not a valid date and time"},"ez-date-input":{invalidDate:"The entered value is not a valid date"},"ez-dialog":{confirmButton:"Confirm or OK button",closeButton:"Close or X button"},"ez-double-list":{noItemsAvailable:"No {{entity}} available",noItemsSelected:"No {{entity}} selected",moveAllTo:"Move all to {{list}}",moveTo:"Move to {{list}}",moveToFirstPosition:"Move to the first position",moveUp:"Move up",moveDown:"Move down",moveToLastPosition:"Move to the last position"},"ez-file-item":{invalidProgress:"The upload progress must be a number between 0 and 100."},"ez-grid":{filterAppliedSuccess:"Column filter applied successfully!",cancelPagination:"Cancel pagination",pageLabel:"Page {{currentPage}}",previousPage:"Previous page",nextPage:"Next page",returnToPreviousPage:"Return to the previous page.",goToNextPage:"Move to the next page.",remainingPageLabel:" from {{count}} or more",remainingTotalLabel:" from {{total}}",nextRecord:"Move to the next record.",previousRecord:"Return to the previous record.",searchColumn:"Search by column.",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",pinColumn:"Pin column",unpinColumn:"Unpin column",filter:"Filter",columnCantBeOrder:"Column cannot be sorted",filterColumnHeader:"Filter for column {{columnLabel}}",clearSelection:"Clear Selection",page:"Page",more:"more",to:"to",of:"of",next:"Next",last:"Last",first:"First",previous:"Previous",loadingOoo:"Loading",selectAll:"Select all",searchOoo:"Search",blanks:"Blanks",filterOoo:"Filter",applyFilter:"Apply filter",equals:"Equals",lessThan:"Less than",greaterThan:"Greater than",contains:"Contains",startsWith:"Starts with",endsWith:"Ends with",group:"Group",columns:"Columns",rowGroupColumns:"Row group columns",rowGroupColumnsEmptyMessage:"Row group columns empty",valueColumns:"Value columns",pivotMode:"Pivot mode",groups:"Groups",values:"Values",pivots:"Pivots",valueColumnsEmptyMessage:"Value columns empty",pivotColumnsEmptyMessage:"Pivot columns empty",toolPanelButton:"Tool panel button",noRowsToShow:"No rows to show.",valueAggregation:"Aggregate value",autosizeThiscolumn:"Autosize this column",autosizeAllColumns:"Autosize all columns",groupBy:"Group by",ungroupBy:"Ungroup by",resetColumns:"Reset columns",expandAll:"Expand all",collapseAll:"Collapse all",toolPanel:"Tool panel",export:"Export",csvExport:"Export to CSV",excelExport:"Export to Excel",pinLeft:"Pin left",pinRight:"Pin right",noPin:"Unpin column",sum:"Sum",min:"Min",max:"Max",none:"None",count:"Count",average:"Average",copy:"Copy",copyWithHeaders:"Copy with headers",copyWithGroupHeaders:"Copy with group headers",ctrlC:"Ctrl+C",paste:"Paste",ctrlV:"Ctrl+V",labelSearchColumn:"Search columns (Ctrl+F)"},"ez-guide-navigator":{searchGuide:"Search guide",hideMenu:"Hide menu"},"ez-list":{moveToGroup:"Move to {{groupName}}"},"ez-modal":{close:"Close modal"},"ez-multi-selection-list":{selectAll:"Select all",search:"Search...",empty:"(Empty)",initMessage:"Select the values to be filtered through the search field.",emptyResults:"No results found."},"ez-number-input":{invalidNumber:"The entered value is not a valid number"},"ez-pagination":{previousPage:"Previous page",nextPage:"Next page"},"ez-rich-text":{listShortcut:"Applies list style to the selected text.",linkShortcut:"Opens link popup.",imageShortcut:"Opens image popup.",boldShortcut:"Applies bold style to the selected text.",italicShortcut:"Applies italic style to the selected text.",underlineShortcut:"Applies underline style to the selected text.",breakLineShortcut:"Applies line break.",undoShortcut:"Undoes the last text change.",redoShortcut:"Redoes the last text change.",edit:"Edit",preview:"Preview",title:{preview:"Ctrl + P",edit:"Switch to edit mode",undo:"Undo (Ctrl + Z)",redo:"Redo (Ctrl + X)",link:"Insert link (Ctrl + K)",image:"Insert image (Ctrl + O)",list:"List (Ctrl + L)",underline:"Underline (Ctrl + U)",italic:"Italic (Ctrl + I)",bold:"Bold (Ctrl + B)"}},"ez-link-builder":{addLinkTitle:"Add link",addLinkSubtitle:"Insert a link into the text to open new pages.",submit:"Submit",urlInputLabel:"Enter the destination URL",textInputLabel:"Enter the text to display",openInNewPage:"Open in a new page."},"ez-simple-image-uploader":{uploadTitle:"Image Upload",uploadSubtitle:"Upload your files by filling only 1 field at a time.",submit:"Submit",tooltipMessage:"The selected file below will be prioritized!",urlInputLabel:"Enter the image URL",orText:"OR",removeFile:"Remove file",dragDropText:"Drag and drop or click to add files",imageAlt:"Image",imageTooLarge:"The image must be smaller than {{maxSize}}."},"ez-search":{emptyList:"No results found",emptySearch:"No results for {{field}} found",showMore:"Show more"},"ez-search-plus":{emptyList:"No results found",optionLoaderNotDefined:"optionLoader not defined",defaultCodeLabel:"Code"},"ez-sortable-list":{emptyMessage:"No items in the list",entityLabel:"item",entityLabelPlural:"items",total:"Total of",search:"Search"},"ez-split-button":{moreOptions:"More options"},"ez-text-edit":{emptyFieldWarning:"It is not possible to save an empty field."},"ez-time-input":{invalidTime:"Please enter a valid time."},"ez-sidebar":{unPinMenu:"Unpin menu",pushPinMenu:"Pin menu",hideMenu:"Hide menu"},"ez-form":{mainTab:"Main",labelSearchField:"Search fields (Ctrl+F)"},utils:{requiredFieldMessage:"There is at least one required field not filled.",requiredField:"This information is required.",selectAllPage:"Select only the current page",loadingAllRecords:"Loading all {{count}} records",selectAllRecords:"Select all {{total}} records",waitForLoad:"Wait for loading to select records from all pages",allRecordsSelected:"All <strong>{{selectionCount}} records</strong> in the grid are selected.",selectedRecords:"There <strong>{{selectionCount}} record{{plural}}</strong> selected in the grid."},spinner:{loading:"Loading..."}}},[be.ES_ES]:{translation:{app:{collapse:"Colapsar",expand:"Expandir",close:"Cerrar",profile:"Perfil",warning:"Aviso",edit:"Editar",remove:"Eliminar",yes:"Sí",no:"No",loading:"Cargando",apply:"Aplicar",cancel:"Cancelar",confirm:"Confirmar",ok:"OK",alerts:"Avisos",requiredInfo:" (obligatorio) *"},"ez-upload":{enable:"Arrastra y suelta o haz clic para subir archivos",disable:"Solo lectura",replaceFileTitle:"Reemplazar archivo",replaceFileMessage:'Ya existe un archivo llamado "{{fileName}}". ¿Desea reemplazarlo?',maxFilesError:"La cantidad máxima de archivos es {{maxFiles}}.",emptyFileError:'Error de permiso: El archivo "{{fileName}}" no puede ser enviado.',missingUploadUrlError:"Dirección de carga no informada.",maxFileSizeError:"El tamaño máximo de los archivos es de {{maxSize}}.",uploadErrorTitle:"Subiendo archivo",uploadingMessage:"Se están subiendo archivos. Por favor, espere a que se complete o cancele la subida."},"ez-image-input":{defaultLabel:"Subir Imagen",imageAlt:"Imagen cargada",removeImage:"Eliminar imagen",invalidFileType:"El archivo seleccionado no es una imagen válida.",fileTooLarge:"La imagen debe tener menos de {{maxSize}}.",imagePreview:"Vista Previa de Imagen"},"ez-calendar":{month:{0:"Enero",1:"Febrero",2:"Marzo",3:"Abril",4:"Mayo",5:"Junio",6:"Julio",7:"Agosto",8:"Septiembre",9:"Octubre",10:"Noviembre",11:"Diciembre"},weekDay:{0:"D",1:"L",2:"M",3:"M",4:"J",5:"V",6:"S"},today:"Hoy"},"ez-collapsible-box":{confirmRemove:"¿Realmente desea eliminar el grupo <b>{{label}}</b>?"},"ez-combo-box":{placeholder:"Seleccione un elemento",noResults:"No se encontraron resultados"},"ez-classic-combo-box":{emptyOption:"Seleccione un elemento",noResults:"No se encontraron resultados"},"ez-date-time-input":{invalidDate:"El valor ingresado no es una fecha y hora válida"},"ez-date-input":{invalidDate:"El valor ingresado no es una fecha válida"},"ez-dialog":{confirmButton:"Botón de confirmación o OK",closeButton:"Botón de cerrar o X"},"ez-double-list":{noItemsAvailable:"No hay {{entity}} disponible",noItemsSelected:"No hay {{entity}} seleccionado",moveAllTo:"Mover todos a {{list}}",moveTo:"Mover a {{list}}",moveToFirstPosition:"Mover a la primera posición",moveUp:"Mover hacia arriba",moveDown:"Mover hacia abajo",moveToLastPosition:"Mover a la última posición"},"ez-file-item":{invalidProgress:"El progreso de carga debe ser un número entre 0 y 100."},"ez-grid":{filterAppliedSuccess:"¡Filtro de columna aplicado con éxito!",cancelPagination:"Cancelar paginación",pageLabel:"Página {{currentPage}}",previousPage:"Página anterior",nextPage:"Página siguiente",returnToPreviousPage:"Volver a la página anterior.",goToNextPage:"Avanzar a la página siguiente.",remainingPageLabel:" de {{count}} o más",remainingTotalLabel:" de {{total}}",nextRecord:"Avanzar al siguiente registro.",previousRecord:"Volver al registro anterior.",searchColumn:"Buscar por columna.",sortAscending:"Ordenar Ascendente",sortDescending:"Ordenar Descendente",pinColumn:"Fijar columna",unpinColumn:"Desafijar columna",filter:"Filtrar",columnCantBeOrder:"La columna no se puede ordenar",filterColumnHeader:"Filtro de la columna {{columnLabel}}",clearSelection:"Limpiar Selección",page:"Página",more:"más",to:"a",of:"de",next:"Siguiente",last:"Último",first:"Primero",previous:"Anterior",loadingOoo:"Cargando",selectAll:"Seleccionar todo",searchOoo:"Buscar",blanks:"Vacío",filterOoo:"Filtrar",applyFilter:"Aplicar filtro",equals:"Igual",lessThan:"Menor que",greaterThan:"Mayor que",contains:"Contiene",startsWith:"Empieza con",endsWith:"Termina con",group:"Grupo",columns:"Columnas",rowGroupColumns:"Columnas del grupo de filas",rowGroupColumnsEmptyMessage:"Columnas del grupo de filas vacías",valueColumns:"Valores de las columnas",pivotMode:"Modo pivote",groups:"Grupos",values:"Valores",pivots:"Pivotes",valueColumnsEmptyMessage:"Valores de columnas vacías",pivotColumnsEmptyMessage:"Pivotes de columnas vacías",toolPanelButton:"Botón del panel de herramientas",noRowsToShow:"No hay registros para mostrar.",valueAggregation:"Agregar valor",autosizeThiscolumn:"Redimensionar esta columna",autosizeAllColumns:"Redimensionar todas las columnas",groupBy:"Agrupar por",ungroupBy:"Desagrupar por",resetColumns:"Restablecer columnas",expandAll:"Expandir todo",collapseAll:"Contraer todo",toolPanel:"Panel de herramientas",export:"Exportar",csvExport:"Exportar a CSV",excelExport:"Exportar a Excel",pinLeft:"Fijar a la izquierda",pinRight:"Fijar a la derecha",noPin:"Desfijar columna",sum:"Suma",min:"Mínimo",max:"Máximo",none:"Ninguno",count:"Conteo",average:"Promedio",copy:"Copiar",copyWithHeaders:"Copiar con encabezados",copyWithGroupHeaders:"Copiar con encabezados de grupo",ctrlC:"Ctrl+C",paste:"Pegar",ctrlV:"Ctrl+V",labelSearchColumn:"Buscar columnas (Ctrl+F)"},"ez-guide-navigator":{searchGuide:"Buscar guía",hideMenu:"Ocultar menú"},"ez-list":{moveToGroup:"Mover a {{groupName}}"},"ez-modal":{close:"Cerrar modal"},"ez-multi-selection-list":{selectAll:"Seleccionar todos",search:"Buscar...",empty:"(Vacío)",initMessage:"Seleccione los valores a filtrar a través del campo de búsqueda.",emptyResults:"No se encontraron resultados."},"ez-number-input":{invalidNumber:"El valor ingresado no es un número válido"},"ez-pagination":{previousPage:"Página anterior",nextPage:"Página siguiente"},"ez-rich-text":{listShortcut:"Aplica estilo de lista al texto seleccionado.",linkShortcut:"Abre popup de enlace.",imageShortcut:"Abre popup de imagen.",boldShortcut:"Aplica estilo negrita al texto seleccionado.",italicShortcut:"Aplica estilo cursiva al texto seleccionado.",underlineShortcut:"Aplica estilo subrayado al texto seleccionado.",breakLineShortcut:"Aplica salto de línea.",undoShortcut:"Deshace el último cambio de texto.",redoShortcut:"Rehace el último cambio de texto.",edit:"Editar",preview:"Previsualizar",title:{preview:"Ctrl + P",edit:"Ir al modo de edición",undo:"Deshacer (Ctrl + Z)",redo:"Rehacer (Ctrl + X)",link:"Insertar enlace (Ctrl + K)",image:"Insertar imagen (Ctrl + O)",list:"Lista (Ctrl + L)",underline:"Subrayado (Ctrl + U)",italic:"Cursiva (Ctrl + I)",bold:"Negrita (Ctrl + B)"}},"ez-link-builder":{addLinkTitle:"Agregar enlace",addLinkSubtitle:"Inserte un enlace en el texto para abrir nuevas páginas.",submit:"Enviar",urlInputLabel:"Ingrese la URL de destino",textInputLabel:"Ingrese el texto a mostrar",openInNewPage:"Abrir en una nueva página."},"ez-simple-image-uploader":{uploadTitle:"Subida de imágenes",uploadSubtitle:"Sube tus archivos llenando solo 1 campo a la vez.",submit:"Enviar",tooltipMessage:"¡El archivo seleccionado a continuación será priorizado!",urlInputLabel:"Ingrese la URL de la imagen",orText:"O",removeFile:"Eliminar archivo",dragDropText:"Arrastra y suelta o haz clic para agregar archivos",imageAlt:"Imagen",imageTooLarge:"La imagen debe tener menos de {{maxSize}}."},"ez-search":{emptyList:"No se encontraron resultados",emptySearch:"No se encontraron resultados de {{field}}",showMore:"Mostrar más"},"ez-search-plus":{emptyList:"No se encontraron resultados",optionLoaderNotDefined:"optionLoader no definido",defaultCodeLabel:"Cód."},"ez-sortable-list":{emptyMessage:"No hay elementos en la lista",entityLabel:"elemento",entityLabelPlural:"elementos",total:"Total de",search:"Buscar"},"ez-split-button":{moreOptions:"Más opciones"},"ez-text-edit":{emptyFieldWarning:"No es posible guardar un campo vacío."},"ez-time-input":{invalidTime:"Por favor, ingrese una hora válida."},"ez-sidebar":{unPinMenu:"Desanclar menú",pushPinMenu:"Anclar menú",hideMenu:"Ocultar menú"},"ez-form":{mainTab:"Principal",labelSearchField:"Buscar campos (Ctrl+F)"},utils:{requiredFieldMessage:"Hay al menos un campo obligatorio sin completar.",requiredField:"Esta información es obligatoria.",selectAllPage:"Seleccionar solo la página actual",loadingAllRecords:"Cargando todos los {{count}} registros",selectAllRecords:"Seleccionar todos los {{total}} registros",waitForLoad:"Espere a que se carguen para seleccionar los registros de todas las páginas",allRecordsSelected:"Todos los <strong>{{selectionCount}} registros</strong> en la cuadrícula están seleccionados.",selectedRecords:"Hay <strong>{{selectionCount}} registro{{plural}}</strong> seleccionado{{plural}} en la cuadrícula."},spinner:{loading:"Cargando..."}}}},Se="__EZ_UI_I18N_INSTANCE__";function we(){return e.getContextValue(Se)}const Ce=async i=>{let o=we();if(!o){const a=W.createInstance(),s={resources:xe,fallbackLng:be.PT_BR};await a.use(ye).init(s);const r=t.getLanguage(),n=null!=i?i:r;await a.changeLanguage(n),e.setContextValue(Se,a.t),o=a.t}return o};export{we as g,Ce as i}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,r as a,c as t,g as n,H as o}from"./p-23a36bb6.js";import{ObjectUtils as r,StringUtils as l,UserInterface as i,ElementIDUtils as s}from"@sankhyalabs/core";import{C as d}from"./p-b853763b.js";import{g as c}from"./p-98218fbc.js";function m(a,t,n,o,r){return e("div",{class:"ez-col ez-col--sd-12 ez-align--middle ez-padding-top--medium ez-padding-bottom--medium"},e("ez-check",{enabled:!n,label:t,mode:r?d.SWITCH:d.REGULAR,"data-field-name":a,"data-context-name":o,key:a}))}function h(a,t,n,o,r,l,i){return e("div",{class:"ez-col ez-col--sd-12"},e("ez-number-input",{class:"ez-input__no-margin",enabled:!n,label:t,precision:o,prettyPrecision:r,"data-field-name":a,"data-context-name":l,key:a,canShowError:i}))}const u=({name:a,label:t,readOnly:n,contextName:o,canShowError:r,props:l})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-text-input",{class:"ez-input__no-margin",label:t,"data-field-name":a,"data-context-name":o,key:a,enabled:!n,canShowError:r,mask:null==l?void 0:l.mask,"clean-value-mask":null==l?void 0:l.cleanValueMask})),p=new Map;p.set(i.CHECKBOX,(e=>m(e.name,e.label,e.readOnly,e.contextName,!1))),p.set(i.SWITCH,(e=>m(e.name,e.label,e.readOnly,e.contextName,!0))),p.set(i.OPTIONSELECTOR,(({name:a,label:t,readOnly:n,required:o,props:r,contextName:l,canShowError:i})=>{const s=null==r?void 0:r.options;let d;if("string"==typeof s){const e=JSON.parse(s);d=Object.keys(e).map((a=>({value:a,label:e[a]})))}else d=s;return e("div",{class:"ez-col ez-col--sd-12"},e("ez-combo-box",{class:"ez-input__no-margin",enabled:!n,suppressEmptyOption:o,label:t,"data-field-name":a,"data-context-name":l,key:a,options:d,canShowError:i}))})),p.set(i.DATE,(({name:a,label:t,readOnly:n,canShowError:o})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-date-input",{class:"ez-input__no-margin",enabled:!n,label:t,"data-field-name":a,key:a,canShowError:o})))),p.set(i.TIME,(({name:a,label:t,readOnly:n,canShowError:o,props:r})=>{var l;return e("div",{class:"ez-col ez-col--sd-12"},e("ez-time-input",{class:"ez-input__no-margin",enabled:!n,label:t,"data-field-name":a,key:a,canShowError:o,"show-seconds":null!==(l=null==r?void 0:r.showSeconds)&&void 0!==l&&l}))})),p.set(i.ELAPSEDTIME,(({name:a,label:t,readOnly:n,canShowError:o})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-time-input",{class:"ez-input__no-margin",enabled:!n,label:t,"data-field-name":a,key:a,canShowError:o,showSeconds:!0})))),p.set(i.DATETIME,(({name:a,label:t,readOnly:n,contextName:o,canShowError:r})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-date-time-input",{class:"ez-input__no-margin",enabled:!n,label:t,"data-field-name":a,"data-context-name":o,key:a,canShowError:r})))),p.set(i.FILE,(({name:a,label:t,readOnly:n,contextName:o,props:l})=>{const i=r.removeEmptyValues({subTitle:l.subTitle,requestHeaders:Object.assign(Object.assign({},l.STORAGESTRATEGY&&{STORAGESTRATEGY:l.STORAGESTRATEGY}),l.INTERNAL_FILENAME&&{INTERNAL_FILENAME:l.INTERNAL_FILENAME})});return e("div",{class:"ez-col ez-col--sd-12"},e("ez-upload",Object.assign({enabled:!n,label:t,"data-field-name":a,"data-context-name":o,key:a},i)))})),p.set(i.DECIMALNUMBER,(({name:e,label:a,readOnly:t,props:n,contextName:o,canShowError:r})=>{var l,i;const s=Number(null!==(l=null==n?void 0:n.precision)&&void 0!==l?l:2);return h(e,a,t,s,Number(null!==(i=null==n?void 0:n.prettyPrecision)&&void 0!==i?i:s),o,r)})),p.set(i.INTEGERNUMBER,(({name:e,label:a,readOnly:t,contextName:n,canShowError:o})=>h(e,a,t,0,0,n,o))),p.set(i.SEARCH,(({name:a,label:t,readOnly:n,required:o,contextName:r,canShowError:i,optionLoader:s,props:d})=>{var c;const m=!l.isEmpty(null==d?void 0:d.DESCRIPTIONFIELD);return e("div",{class:"ez-col ez-col--sd-12"},e("ez-search",{class:"ez-input__no-margin",enabled:!n,suppressEmptyOption:o,label:t,"data-field-name":a,"data-context-name":r,key:a,canShowError:i,optionLoader:s,ignoreLimitCharsToSearch:null!==(c=null==d?void 0:d.ignoreLimitCharsToSearch)&&void 0!==c&&c,hideDescriptionInput:!m}))})),p.set(i.SEARCHPLUS,(({name:a,label:t,readOnly:n,contextName:o,canShowError:r,optionLoader:i,props:s})=>{const d=!l.isEmpty(null==s?void 0:s.DESCRIPTIONFIELD);return e("div",{class:"ez-col ez-col--sd-12"},e("ez-search-plus",{class:"ez-input__no-margin",enabled:!n,label:t,"data-field-name":a,"data-context-name":o,key:a,canShowError:r,optionLoader:i,hideDescriptionInput:!d}))})),p.set(i.LONGTEXT,(({name:a,label:t,readOnly:n,contextName:o,rows:r,canShowError:l})=>e("div",{class:"ez-col ez-col--sd-12",key:a},e("ez-text-area",{enabled:!n,label:t,"data-field-name":a,"data-context-name":o,rows:r,canShowError:l})))),p.set(i.HTML,(({name:a,label:t,readOnly:n,contextName:o,rows:r,canShowError:l})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-rich-text",{key:a,enabled:!n,label:t,"data-field-name":a,"data-context-name":o,rows:r,canShowError:l})))),p.set(i.IMAGE,(({name:a,label:t,readOnly:n,contextName:o,props:r})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-image-input",Object.assign({enabled:!n,label:t,"data-field-name":a,"data-context-name":o,key:a,maxFileSize:1/0},r)))));const w=(e,a=new Map)=>{const t=c(),n=a.get(e.userInterface)||p.get(e.userInterface)||u,o=e.required?`${e.label}${t("app.requiredInfo")}`:e.label,r=n(Object.assign(Object.assign({},e),{label:o}));return r.t["data-form-item"]=e.name,r};class z{constructor(e){this.elem=e}addRightElement(e){this.removeRightElement(),e.classList.add("ez-padding-left--small"),e.setAttribute("data-custom-item","true"),this.elem.classList.add("ez-col--nowrap"),this.elem.appendChild(e)}removeRightElement(){Array.from(this.elem.querySelectorAll('[data-custom-item="true"]')).forEach((e=>e.remove()))}get fieldName(){return this.elem.getAttribute("data-form-item")}}class b{constructor(e,a){this.items=new Map,this.formId=a,e.forEach((e=>{const a=new z(e);this.items.set(a.fieldName,a)}))}getItem(e){return this.items.get(e)}get formName(){return this.formId}}const v=class{constructor(e){a(this,e),this.ezContentReady=t(this,"ezContentReady",7),this.formItemsReady=t(this,"formItemsReady",7),this._customEditors=new Map,this.fields=void 0,this.selectedRecord=void 0,this.singleColumn=!1,this.customUiBuilders=new Map}async showUp(){this.singleColumn||this._element.scrollIntoView({behavior:"smooth",block:"start"})}async addCustomEditor(e,a,t){const n=new Map(this._customEditors);n.set(e,{customEditor:a,detailContext:t}),this._customEditors=n}async setFieldProp(e,a,t){const n=this.fields.map((n=>(n.name!==e||!t&&0!==t||(n.props=n.props||{},n.props[a]=t),n)));this.fields=[...n]}groupFields(e){const a=new Map;return e.forEach((e=>{const t=e.group;if(t){let n=a.get(t);null==n&&(n=[],a.set(t,n)),n.push(e)}else a.set(e.name,e)})),a}componentDidRender(){this._formElements=Array.from(this._element.querySelectorAll("[data-field-name]")),this.ezContentReady.emit(this._formElements);const e=new b(Array.from(this._element.querySelectorAll("[data-form-item]")));this.formItemsReady.emit(e)}isItemFullWidth(e){return[i.FILE,i.LONGTEXT,i.HTML].includes(e)}buildFormItemElement(a,t=""){var n;if(this.isItemFullWidth(a.userInterface)&&(t+=" input-full_width"),this._customEditors.has(a.name)){const o=null===(n=this._formElements.map((e=>({name:e.dataset.fieldName,value:e.value}))).find((e=>e.name===a.name)))||void 0===n?void 0:n.value,r=this._customEditors.get(a.name).customEditor;return e("div",{class:t},e("ez-custom-form-input",{"data-field-name":a.name,customEditor:r,formViewField:a,builderFallback:e=>w(e,this.customUiBuilders),value:o,selectedRecord:this.selectedRecord}))}return e("div",{class:t},w(a,this.customUiBuilders))}render(){if(s.addIDInfoIfNotExists(this._element,"ezFormView"),null==this.fields)return;let a=[],t=Array.from(this.groupFields(this.fields).entries()).map((([t,n])=>{if(Array.isArray(n))return e("ez-collapsible-box",{id:`group-${t}`,label:t,"header-size":"large",key:t},e("div",{class:`form-view__content ${this.singleColumn&&"form-view__content--single-column"}`},n.map((e=>this.buildFormItemElement(e)))));a.push(n)})),n=a.map((e=>this.buildFormItemElement(e))),r=e("div",{class:`form-view__content ${this.singleColumn&&"form-view__content--single-column"}`},n);return e(o,null,r,t)}get _element(){return n(this)}};v.style=".sc-ez-form-view-h{display:flex;flex-wrap:wrap;width:100%;--ez-form-view__item--min-width:220px;--ez-form-view__item--max-width:440px;--ez-form-view__item--width:var(--space--small);--ez-form-view__item--padding:var(--space--small)}.form-view__content.sc-ez-form-view{display:grid;grid-template-columns:repeat(auto-fill, minmax(var(--ez-form-view__item--min-width), 1fr));gap:var(--ez-form-view__item--width);padding-inline:var(--ez-form-view__item--padding);width:100%}.form-view__content--single-column.sc-ez-form-view{grid-template-columns:repeat(1, minmax(var(--ez-form-view__item--min-width), var(--ez-form-view__item--max-width)))}.input-full_width.sc-ez-form-view{grid-column:1 / -1;width:100%}";export{v as ez_form_view}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,g as n}from"./p-23a36bb6.js";import{ArrayUtils as r}from"@sankhyalabs/core";import{i as o}from"./p-
|
|
1
|
+
import{r as t,c as e,h as i,g as n}from"./p-23a36bb6.js";import{ArrayUtils as r}from"@sankhyalabs/core";import{i as o}from"./p-98218fbc.js";
|
|
2
2
|
/**!
|
|
3
3
|
* Sortable 1.15.6
|
|
4
4
|
* @author RubaXa <trash@rubaxa.org>
|