@sankhyalabs/ezui 7.1.0-dev.21 → 7.1.0-dev.23
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-4fb87a9e.js → ApplicationUtils-006ca96f.js} +1 -1
- package/dist/cjs/FormLayout-fe8da83c.js +9 -0
- package/dist/cjs/{app-globals-cb31a206.js → app-globals-5cb12916.js} +1 -1
- package/dist/cjs/{ez-combo-box-list_5.cjs.entry.js → classic-search-list_7.cjs.entry.js} +212 -5
- package/dist/cjs/ez-actions-button.cjs.entry.js +4 -3
- 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-classic-combo-box.cjs.entry.js +36 -15
- package/dist/cjs/ez-classic-date-input.cjs.entry.js +201 -0
- package/dist/cjs/ez-classic-date-time-input.cjs.entry.js +246 -0
- package/dist/cjs/ez-classic-input.cjs.entry.js +99 -18
- package/dist/cjs/ez-classic-number-input.cjs.entry.js +205 -0
- package/dist/cjs/ez-classic-search-plus.cjs.entry.js +407 -0
- package/dist/cjs/ez-classic-search.cjs.entry.js +683 -0
- package/dist/cjs/ez-classic-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-classic-time-input.cjs.entry.js +197 -0
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +4 -3
- package/dist/cjs/ez-combo-box.cjs.entry.js +4 -3
- package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-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 +121 -35
- package/dist/cjs/ez-form.cjs.entry.js +11 -7
- package/dist/cjs/ez-grid.cjs.entry.js +7 -6
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-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 +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-pagination.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-search-plus.cjs.entry.js +7 -6
- package/dist/cjs/ez-search-result-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +10 -9
- 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 +13 -14
- package/dist/cjs/ez-split-item.cjs.entry.js +4 -3
- package/dist/cjs/ez-text-input.cjs.entry.js +37 -0
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-tree.cjs.entry.js +1 -1
- 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-e61642ff.js → index-350d0fa0.js} +30 -0
- package/dist/cjs/index-a7b0c73d.js +42 -18
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{search-column-51e50b59.js → search-column-fbf680d7.js} +10 -5
- package/dist/cjs/searchFormatters-051f8677.js +23 -0
- package/dist/cjs/{FormLayout-18853e70.js → types-6a5df0c7.js} +0 -6
- package/dist/collection/collection-manifest.json +58 -5
- package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.css +5 -0
- package/dist/collection/components/ez-classic-combo-box/ez-classic-combo-box.js +77 -18
- package/dist/collection/components/ez-classic-date-input/ez-classic-date-input.css +44 -0
- package/dist/collection/components/ez-classic-date-input/ez-classic-date-input.js +541 -0
- package/dist/collection/components/ez-classic-date-time-input/ez-classic-date-time-input.css +44 -0
- package/dist/collection/components/ez-classic-date-time-input/ez-classic-date-time-input.js +586 -0
- package/dist/collection/components/ez-classic-input/ez-classic-input.css +33 -5
- package/dist/collection/components/ez-classic-input/ez-classic-input.js +155 -19
- package/dist/collection/components/ez-classic-number-input/ez-classic-number-input.css +16 -0
- package/dist/collection/components/ez-classic-number-input/ez-classic-number-input.js +583 -0
- package/dist/collection/components/ez-classic-search/ez-classic-search.css +126 -0
- package/dist/collection/components/ez-classic-search/ez-classic-search.js +1330 -0
- package/dist/collection/components/ez-classic-search/subcomponent/classic-search-list/classic-search-list.css +227 -0
- package/dist/collection/components/ez-classic-search/subcomponent/classic-search-list/classic-search-list.js +316 -0
- package/dist/collection/components/ez-classic-search/utils/searchFormatters.js +18 -0
- package/dist/collection/components/ez-classic-search-plus/ez-classic-search-plus.css +406 -0
- package/dist/collection/components/ez-classic-search-plus/ez-classic-search-plus.js +988 -0
- package/dist/collection/components/ez-classic-search-plus/subcomponent/ez-search-result-list/ez-classic-search-result-list.css +221 -0
- package/dist/collection/components/ez-classic-search-plus/subcomponent/ez-search-result-list/ez-classic-search-result-list.js +298 -0
- package/dist/collection/components/ez-classic-text-area/ez-classic-text-area.css +1 -0
- package/dist/collection/components/ez-classic-time-input/ez-classic-time-input.css +14 -0
- package/dist/collection/components/ez-classic-time-input/ez-classic-time-input.js +511 -0
- package/dist/collection/components/ez-form/ez-form.js +9 -5
- package/dist/collection/components/ez-form-view/ez-form-view.css +8 -3
- package/dist/collection/components/ez-form-view/ez-form-view.js +40 -4
- package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +6 -3
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +9 -6
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +8 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +30 -6
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +12 -5
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/RichText.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +9 -3
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInputPlus.tpl.js +8 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.js +7 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +8 -1
- package/dist/collection/components/ez-form-view/structure/index.js +1 -1
- package/dist/collection/components/ez-icon/ez-icon.css +1 -0
- package/dist/collection/components/ez-rich-text/ez-rich-text.js +2 -3
- package/dist/collection/components/ez-split-button/ez-split-button.js +18 -13
- package/dist/collection/components/ez-text-input/ez-text-input.js +38 -1
- package/dist/collection/utils/form/DataBinder.js +2 -2
- package/dist/collection/utils/form/interfaces/FormLayout.js +3 -1
- package/dist/collection/utils/i18n/locales/en-us.js +10 -0
- package/dist/collection/utils/i18n/locales/es-es.js +10 -0
- package/dist/collection/utils/i18n/locales/pt-br.js +10 -0
- package/dist/collection/utils/searchColumn/search-column.js +6 -1
- package/dist/custom-elements/index.d.ts +48 -0
- package/dist/custom-elements/index.js +2722 -337
- package/dist/esm/{ApplicationUtils-985c24ae.js → ApplicationUtils-0c5cb207.js} +1 -1
- package/dist/esm/FormLayout-bda67973.js +9 -0
- package/dist/esm/{app-globals-75f8a758.js → app-globals-1db10325.js} +1 -1
- package/dist/esm/{ez-combo-box-list_5.entry.js → classic-search-list_7.entry.js} +212 -7
- package/dist/esm/ez-actions-button.entry.js +4 -3
- 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-classic-combo-box.entry.js +36 -15
- package/dist/esm/ez-classic-date-input.entry.js +197 -0
- package/dist/esm/ez-classic-date-time-input.entry.js +242 -0
- package/dist/esm/ez-classic-input.entry.js +100 -19
- package/dist/esm/ez-classic-number-input.entry.js +201 -0
- package/dist/esm/ez-classic-search-plus.entry.js +403 -0
- package/dist/esm/ez-classic-search.entry.js +679 -0
- package/dist/esm/ez-classic-text-area.entry.js +1 -1
- package/dist/esm/ez-classic-time-input.entry.js +193 -0
- package/dist/esm/ez-collapsible-box.entry.js +4 -3
- package/dist/esm/ez-combo-box.entry.js +4 -3
- package/dist/esm/ez-date-input.entry.js +1 -1
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-double-list.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +121 -35
- package/dist/esm/ez-form.entry.js +11 -7
- package/dist/esm/ez-grid.entry.js +5 -4
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-icon.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 +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-pagination.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-search-plus.entry.js +4 -3
- package/dist/esm/ez-search-result-list.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +4 -3
- 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 +13 -14
- package/dist/esm/ez-split-item.entry.js +4 -3
- package/dist/esm/ez-text-input.entry.js +37 -0
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-tree.entry.js +1 -1
- 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-a3b24b5d.js → index-225aa0c3.js} +30 -0
- package/dist/esm/index-baa5e267.js +42 -18
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{search-column-0c42248b.js → search-column-40a78cac.js} +10 -5
- package/dist/esm/searchFormatters-6d9b06e4.js +20 -0
- package/dist/esm/{FormLayout-071d324c.js → types-6f6b2650.js} +1 -7
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-1c3f43e8.entry.js → p-0248846f.entry.js} +1 -1
- package/dist/ezui/p-0625743b.entry.js +1 -0
- package/dist/ezui/p-07fb22c3.entry.js +1 -0
- package/dist/ezui/p-26cd4c2e.entry.js +1 -0
- package/dist/ezui/{p-2fd16ff2.entry.js → p-2da9faf1.entry.js} +1 -1
- package/dist/ezui/{p-1bf40959.entry.js → p-34d459e4.entry.js} +1 -1
- package/dist/ezui/p-44183c39.entry.js +1 -0
- package/dist/ezui/p-47e4a8ce.js +1 -0
- package/dist/ezui/p-4af745e1.entry.js +1 -0
- package/dist/ezui/{p-6c484770.entry.js → p-4c2a4435.entry.js} +1 -1
- package/dist/ezui/{p-782fe2e3.entry.js → p-4c76b365.entry.js} +1 -1
- package/dist/ezui/p-4e576bb9.entry.js +1 -0
- package/dist/ezui/{p-5e6de2c1.entry.js → p-4e869617.entry.js} +1 -1
- package/dist/ezui/{p-0e325699.entry.js → p-4f7ad3ee.entry.js} +1 -1
- package/dist/ezui/{p-582c3f90.entry.js → p-544605c4.entry.js} +1 -1
- package/dist/ezui/p-556bf329.entry.js +1 -0
- package/dist/ezui/{p-2676e2a3.entry.js → p-56565777.entry.js} +1 -1
- package/dist/ezui/p-57b68d43.entry.js +1 -0
- package/dist/ezui/p-5895e687.js +1 -0
- package/dist/ezui/{p-714452c7.entry.js → p-5abb220b.entry.js} +1 -1
- package/dist/ezui/p-619225ce.entry.js +1 -0
- package/dist/ezui/p-679a2942.entry.js +1 -0
- package/dist/ezui/{p-474076b3.js → p-6a794336.js} +1 -1
- package/dist/ezui/{p-4ea5c8a7.entry.js → p-6ac056d7.entry.js} +1 -1
- package/dist/ezui/p-7134726a.entry.js +1 -0
- package/dist/ezui/{p-67f9fadb.entry.js → p-729bd1be.entry.js} +1 -1
- package/dist/ezui/p-7953ecb9.entry.js +1 -0
- package/dist/ezui/{p-e2e0dd76.entry.js → p-7edc3ef7.entry.js} +1 -1
- package/dist/ezui/p-88a115b3.js +1 -0
- package/dist/ezui/{p-f45ddc1f.entry.js → p-8e5f1c74.entry.js} +1 -1
- package/dist/ezui/p-951b32a1.entry.js +1 -0
- package/dist/ezui/{p-9568a93d.entry.js → p-97312709.entry.js} +1 -1
- package/dist/ezui/{p-0ec5c128.js → p-9825c1d2.js} +1 -1
- package/dist/ezui/p-987185c4.entry.js +1 -0
- package/dist/ezui/p-a0f51b99.entry.js +1 -0
- package/dist/ezui/p-a3bad8f8.entry.js +1 -0
- package/dist/ezui/{p-6570ca10.entry.js → p-a4351519.entry.js} +1 -1
- package/dist/ezui/{p-7624767b.entry.js → p-a872c642.entry.js} +1 -1
- package/dist/ezui/p-b0a716ef.entry.js +1 -0
- package/dist/ezui/p-b36475f9.entry.js +1 -0
- package/dist/ezui/{p-2b23906a.entry.js → p-b705b342.entry.js} +1 -1
- package/dist/ezui/{p-9771ea3c.entry.js → p-b8078832.entry.js} +1 -1
- package/dist/ezui/p-c0ae79fa.entry.js +1 -0
- package/dist/ezui/{p-98218fbc.js → p-c178730b.js} +1 -1
- package/dist/ezui/{p-a1a63294.entry.js → p-c56ee8c0.entry.js} +1 -1
- package/dist/ezui/{p-3d71e8e1.entry.js → p-cd8be0c7.entry.js} +1 -1
- package/dist/ezui/{p-a13e65a4.entry.js → p-ce0a0036.entry.js} +1 -1
- package/dist/ezui/{p-0aafbc30.entry.js → p-df802548.entry.js} +1 -1
- package/dist/ezui/p-e2689b33.entry.js +1 -0
- package/dist/ezui/{p-dc192d01.entry.js → p-e2972977.entry.js} +1 -1
- package/dist/ezui/{p-47d9256e.entry.js → p-e3a42f47.entry.js} +1 -1
- package/dist/ezui/p-e3cd5080.entry.js +1 -0
- package/dist/ezui/{p-28af6826.entry.js → p-e493ad57.entry.js} +1 -1
- package/dist/ezui/{p-3fcf79c7.entry.js → p-f5552540.entry.js} +1 -1
- package/dist/ezui/p-ff4312d5.js +1 -0
- package/dist/types/components/ez-classic-combo-box/ez-classic-combo-box.d.ts +9 -3
- package/dist/types/components/ez-classic-date-input/ez-classic-date-input.d.ts +91 -0
- package/dist/types/components/ez-classic-date-time-input/ez-classic-date-time-input.d.ts +95 -0
- package/dist/types/components/ez-classic-input/ez-classic-input.d.ts +18 -1
- package/dist/types/components/ez-classic-number-input/ez-classic-number-input.d.ts +101 -0
- package/dist/types/components/ez-classic-search/ez-classic-search.d.ts +219 -0
- package/dist/types/components/ez-classic-search/subcomponent/classic-search-list/classic-search-list.d.ts +29 -0
- package/dist/types/components/ez-classic-search/utils/searchFormatters.d.ts +2 -0
- package/dist/types/components/ez-classic-search-plus/ez-classic-search-plus.d.ts +186 -0
- package/dist/types/components/ez-classic-search-plus/subcomponent/ez-search-result-list/ez-classic-search-result-list.d.ts +29 -0
- package/dist/types/components/ez-form/ez-form.d.ts +1 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +7 -0
- package/dist/types/components/ez-form-view/fieldbuilder/FieldBuilder.d.ts +7 -2
- package/dist/types/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.d.ts +3 -2
- package/dist/types/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.d.ts +2 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.d.ts +5 -4
- package/dist/types/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.d.ts +2 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.d.ts +3 -2
- package/dist/types/components/ez-form-view/fieldbuilder/templates/RichText.tpl.d.ts +2 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.d.ts +2 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/SearchInputPlus.tpl.d.ts +2 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextArea.tpl.d.ts +2 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +2 -1
- package/dist/types/components/ez-split-button/ez-split-button.d.ts +1 -2
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +4 -0
- package/dist/types/components.d.ts +2967 -1814
- package/dist/types/utils/form/interfaces/FormLayout.d.ts +3 -1
- package/dist/types/utils/i18n/locales/en-us.d.ts +10 -0
- package/dist/types/utils/i18n/locales/es-es.d.ts +10 -0
- package/dist/types/utils/i18n/locales/pt-br.d.ts +10 -0
- package/dist/types/utils/i18n/translations.d.ts +30 -0
- package/package.json +1 -1
- package/react/components.d.ts +8 -0
- package/react/components.js +8 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-2e5de2a7.entry.js +0 -1
- package/dist/ezui/p-30ffb9ed.js +0 -1
- package/dist/ezui/p-48effc69.entry.js +0 -1
- package/dist/ezui/p-6a982147.js +0 -1
- package/dist/ezui/p-6d7f2fdc.entry.js +0 -1
- package/dist/ezui/p-6f466aec.entry.js +0 -1
- package/dist/ezui/p-7fe97ef5.entry.js +0 -1
- package/dist/ezui/p-8709c4f6.entry.js +0 -1
- package/dist/ezui/p-8a8006e6.entry.js +0 -1
- package/dist/ezui/p-8d626d2b.entry.js +0 -1
- package/dist/ezui/p-9b2e6438.entry.js +0 -1
- package/dist/ezui/p-9d004e22.entry.js +0 -1
- package/dist/ezui/p-c711900a.entry.js +0 -1
- package/dist/ezui/p-dee18824.entry.js +0 -1
- package/dist/ezui/p-e4a579f2.entry.js +0 -1
- package/dist/ezui/p-e82a12c6.entry.js +0 -1
- package/dist/ezui/p-f1bbf23f.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as t,h as e,H as s,g as a}from"./p-23a36bb6.js";import{StringUtils as r,ElementIDUtils as o,ObjectUtils as l,HTMLBuilder as c,KeyboardManager as n}from"@sankhyalabs/core";import{a as h,r as d}from"./p-88a115b3.js";import{i as m}from"./p-c178730b.js";import{C as b}from"./p-5895e687.js";import{R as u,a as p}from"./p-3e767a74.js";import{p as v}from"./p-dff9862b.js";import{A as g}from"./p-9825c1d2.js";import"./p-ab574d59.js";import"./p-b853763b.js";import"./p-47e4a8ce.js";import"./p-112455b1.js";const _=class{constructor(e){i(this,e),this.changeValue=t(this,"changeValue",7),this.changePreSelection=t(this,"changePreSelection",7),this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this.MAX_HEIGHT=350,this.HEADER_MENU_HEIGHT=60,this.showLoading=void 0,this.visibleOptions=[],this.textEmptyList=void 0,this.canShowListOptions=void 0,this.value=void 0,this.showOptionValue=!0,this.preSelection=void 0}async nextOption(){const i=void 0===this.preSelection?0:Math.min(this.preSelection+1,this.visibleOptions.length-1);this.changePreSelection.emit(i),this.scrollToOption(this.visibleOptions[i])}async previousOption(){const i=void 0===this.preSelection?0:Math.max(this.preSelection-1,0);this.changePreSelection.emit(i),this.scrollToOption(this.visibleOptions[i])}selectOption(i){const t=Object.assign(Object.assign({},i),{value:h(null==i?void 0:i.value),label:h(null==i?void 0:i.label)}),e=Object.assign(Object.assign({},t),{value:d(null==t?void 0:t.value),label:d(null==t?void 0:t.label)});this.changeValue.emit(e)}createOption(i){let{key:t,title:e}=i;const s=new RegExp(this._startHighlightTag,"g"),a=new RegExp(this._endHighlightTag,"g");e=r.decodeHtmlEntities(e);const o={value:null==t?void 0:t.replace(s,"").replace(a,""),label:null==e?void 0:e.replace(s,"").replace(a,"")};this.selectOption(o)}scrollToOption(i){window.requestAnimationFrame((()=>{const t=(null==i?void 0:i.value)?this._optionsList.querySelector(`div#item_${i.value.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g,"\\$1")}`):void 0;t&&t.scrollIntoView({behavior:"smooth",block:"nearest"})}))}buildItem(i,t){i.label=i.label||i.value;const s={key:i.value,title:i.label,details:i.details};return e("div",{style:{height:"100%"},class:t===this.preSelection?"item preselected":"item",id:`item_${i.value}`,onMouseDown:()=>this.createOption(s),onMouseOver:()=>this.changePreSelection.emit(t)},e("ez-card-item",{item:s,compacted:!0,enableKey:this.showOptionValue}))}componentDidLoad(){this._optionsList&&(this._optionsList.style.maxHeight=`${this.MAX_HEIGHT}px`)}componentDidUpdate(){if(this._optionsList){const i=this._optionsList.getBoundingClientRect();window.innerHeight-i.bottom<0&&this.adjustMaxHeight(i)}}adjustMaxHeight(i){if(this._optionsList){const t=Math.min(i.top-this.HEADER_MENU_HEIGHT,this.MAX_HEIGHT);this._optionsList.style.maxHeight=`${t}px`}}cleanEmptyObjectArray(i){return i.filter((i=>void 0!==(null==i?void 0:i.value)))}render(){return e(s,null,e("ul",{class:"list-options",ref:i=>this._optionsList=i},!this.showLoading&&0===this.cleanEmptyObjectArray(this.visibleOptions).length&&e("div",{class:"message"},e("span",{class:"message__no-result"},this.textEmptyList)),this.showLoading&&e("div",{class:"message"},e("div",{class:"message__loading"})),this.canShowListOptions&&this.visibleOptions.map(((i,t)=>this.buildItem(i,t)))))}};_.style=":host{--ez-classic-search__list-title--primary:var(--title--primary, #2B3A54);--ez-classic-search__list-text--primary:var(--text--primary, #626e82);--ez-classic-search__list-height:calc(var(--ez-classic-search--font-size) + var(--ez-classic-search--space--medium) + 4px);--ez-classic-search__list-min-width:64px;--ez-classic-search__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-classic-search__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-classic-search__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-classic-search__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-classic-search__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-classic-search__scrollbar--width:var(--space--small, 6px);--ez-classic-search--border-radius-small:var(--border--radius-small, 6px);--ez-classic-search--font-size:var(--text--medium, 14px);--ez-classic-search--font-family:var(--font-pattern, Arial);--ez-classic-search--font-weight--large:var(--text-weight--large, 500);--ez-classic-search--font-weight--medium:var(--text-weight--medium, 400);--ez-classic-search--background-medium:var(--background--medium, #f0f3f7);--ez-classic-search--line-height:calc(var(--text--medium, 14px) + 4px)}.list-options{position:relative;z-index:var(--more-visible, 2);margin:var(--space--small) 0px;padding:0px;padding-inline-start:0px;box-sizing:border-box;width:100%;height:100%;max-height:350px;min-width:150px;display:flex;flex-direction:column;scroll-behavior:smooth;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--ez-classic-search__scrollbar--color-clicked) var(--ez-classic-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--scrollbar--background);width:var(--space--small);max-width:var(--space--small);min-width:var(--space--small);height:var(--space--small);max-height:var(--space--small);min-height:var(--space--small)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-classic-search__scrollbar--color-background);border-radius:var(--ez-classic-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-classic-search__scrollbar--color-default);border-radius:var(--ez-classic-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-classic-search__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-classic-search__scrollbar--color-clicked)}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;margin:var(--space--medium) 0px;min-height:var(--ez-classic-search__list-height)}.message__no-result{color:var(--ez-classic-search__list-title--primary);font-family:var(--ez-classic-search--font-family);font-size:var(--ez-classic-search--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-classic-search__list-title--primary);border-top:3px solid transparent}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-classic-search__list-title--primary);font-family:var(--ez-classic-search--font-family);font-size:var(--ez-classic-search--font-size);line-height:var(--ez-classic-search--line-height)}.item__label{font-weight:var(--ez-classic-search--font-weight--medium)}.item__label--bold{font-weight:var(--ez-classic-search--font-weight--large)}.item__value{text-align:center;color:var(--ez-classic-search__list-text--primary);font-weight:var(--ez-classic-search--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.item__list>li:hover{background-color:var(--ez-classic-search--background-medium)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-classic-search--border-radius-small);gap:var(--space--small, 6px)}.preselected{background-color:var(--background--medium)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@supports not (scrollbar-width: thin){.item{padding-right:8px}}";const x=class{constructor(e){i(this,e),this.changeValue=t(this,"changeValue",7),this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this.showLoading=void 0,this.visibleOptions=[],this.value=void 0,this.showOptionValue=!0,this._preSelection=void 0}observerVisivleOptions(i){i.length&&this.preSelectItemByIndex(0)}async nextOption(){const i=void 0===this._preSelection?0:Math.min(this._preSelection+1,this.visibleOptions.length-1);this.preSelectItemByIndex(i)}async previousOption(){const i=void 0===this._preSelection?0:Math.max(this._preSelection-1,0);this.preSelectItemByIndex(i)}preSelectItemByIndex(i){this._preSelection=i,this.scrollToOption(this.visibleOptions[i])}selectOption(i){const t=Object.assign(Object.assign({},i),{value:null==i?void 0:i.value,label:null==i?void 0:i.label}),e=Object.assign(Object.assign({},t),{value:this.removeHighLight(null==t?void 0:t.value),label:this.removeHighLight(null==t?void 0:t.label)});this.changeValue.emit(e)}removeHighLight(i){if(!i||"string"!=typeof i)return i;const t=new RegExp(this._startHighlightTag,"g"),e=new RegExp(this._endHighlightTag,"g");return i.replace(t,"").replace(e,"")}createAndSelectOption(i){let{key:t,title:e}=i;t=String(null!=t?t:""),e=r.decodeHtmlEntities(e);const s={value:this.removeHighLight(t),label:this.removeHighLight(e)};this.selectOption(s)}scrollToOption(i){(null==i?void 0:i.value)&&this._optionsList&&window.requestAnimationFrame((()=>{var t;const e=String(null!==(t=null==i?void 0:i.value)&&void 0!==t?t:""),s=e?this._optionsList.querySelector(`div#item_${e.replace(/([ #;&,.+*~':"!^$[\]()=<>|/\\])/g,"\\$1")}`):void 0;s&&s.scrollIntoView({behavior:"smooth",block:"nearest"})}))}buildItem(i,t){var s;i.label=i.label||i.value;const a={key:String(null!==(s=i.presentationValue)&&void 0!==s?s:""),title:i.presentationLabel,details:i.details};return e("div",{style:{height:"100%"},class:t===this._preSelection?"item preselected":"item",id:`item_${i.value}`,onMouseDown:()=>this.createAndSelectOption(a),onMouseOver:()=>{this._preSelection=t}},e("ez-card-item",{item:a,compacted:!0,enableKey:this.showOptionValue}))}async selectCurrentItem(){this.selectOption(this.visibleOptions[this._preSelection])}async cancelSelection(){this.cancelPreselection()}cancelPreselection(){this._preSelection=void 0}canShowListOptions(){return!this.showLoading&&this.visibleOptions.length>0}async componentWillLoad(){this.i18n=await m()}render(){return e(s,null,e("ul",{class:"list-options",ref:i=>this._optionsList=i},!this.showLoading&&0===this.visibleOptions.length&&e("div",{class:"message"},e("span",{class:"message__no-result"},this.i18n("ez-classic-search-plus.emptyList"))),this.showLoading&&e("div",{class:"loading__container"},e("ez-skeleton",{count:4,height:"20px"})),this.canShowListOptions()&&this.visibleOptions.map(((i,t)=>this.buildItem(i,t)))))}static get watchers(){return{visibleOptions:["observerVisivleOptions"]}}};x.style=":host{--ez-classic-search__list-title--primary:var(--title--primary, #2B3A54);--ez-classic-search__list-text--primary:var(--text--primary, #626e82);--ez-classic-search__list-height:calc(var(--ez-classic-search--font-size) + var(--ez-classic-search--space--medium) + 4px);--ez-classic-search__list-min-width:64px;--ez-classic-search__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-classic-search__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-classic-search__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-classic-search__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-classic-search__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-classic-search__scrollbar--width:var(--space--small, 6px);--ez-classic-search--border-radius-small:var(--border--radius-small, 6px);--ez-classic-search--font-size:var(--text--medium, 14px);--ez-classic-search--font-family:var(--font-pattern, Arial);--ez-classic-search--font-weight--large:var(--text-weight--large, 500);--ez-classic-search--font-weight--medium:var(--text-weight--medium, 400);--ez-classic-search--background-medium:var(--background--medium, #f0f3f7);--ez-classic-search--line-height:calc(var(--text--medium, 14px) + 4px)}.list-options{position:relative;z-index:var(--more-visible, 2);margin:var(--space--small) 0px;padding:0px;padding-inline-start:0px;box-sizing:border-box;width:100%;height:100%;max-height:350px;min-width:150px;display:flex;flex-direction:column;scroll-behavior:smooth;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--ez-classic-search__scrollbar--color-clicked) var(--ez-classic-search__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--scrollbar--background);width:var(--space--small);max-width:var(--space--small);min-width:var(--space--small);height:var(--space--small);max-height:var(--space--small);min-height:var(--space--small)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-classic-search__scrollbar--color-background);border-radius:var(--ez-classic-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-classic-search__scrollbar--color-default);border-radius:var(--ez-classic-search__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-classic-search__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-classic-search__scrollbar--color-clicked)}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;margin:var(--space--medium) 0px;min-height:var(--ez-classic-search__list-height)}.message__no-result{color:var(--ez-classic-search__list-title--primary);font-family:var(--ez-classic-search--font-family);font-size:var(--ez-classic-search--font-size)}.loading__container{display:flex;flex-direction:column;margin:var(--space--small)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-classic-search__list-title--primary);font-family:var(--ez-classic-search--font-family);font-size:var(--ez-classic-search--font-size);line-height:var(--ez-classic-search--line-height)}.item__label{font-weight:var(--ez-classic-search--font-weight--medium)}.item__label--bold{font-weight:var(--ez-classic-search--font-weight--large)}.item__value{text-align:center;color:var(--ez-classic-search__list-text--primary);font-weight:var(--ez-classic-search--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.item__list>li:hover{background-color:var(--ez-classic-search--background-medium)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-classic-search--border-radius-small);gap:var(--space--small, 6px)}.preselected{background-color:var(--background--medium)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@supports not (scrollbar-width: thin){.item{padding-right:8px}}";const z=class{constructor(t){i(this,t),this.showLoading=void 0,this.visibleOptions=void 0,this.textEmptyList=void 0,this.showOptionValue=void 0,this.preSelection=void 0,this.maxWidth=void 0,this.width=void 0,this.onOptionSelect=void 0,this.onOptionHover=void 0}async nextOption(){var i,t;(null===(i=this.visibleOptions)||void 0===i?void 0:i.length)&&(void 0!==this.preSelection&&this.preSelection>=this.visibleOptions.length-1||(this.preSelection=void 0===this.preSelection?0:this.preSelection+1,this.scrollToOption(this.visibleOptions[this.preSelection]),null===(t=this.onOptionHover)||void 0===t||t.call(this,this.preSelection)))}async previousOption(){var i,t;(null===(i=this.visibleOptions)||void 0===i?void 0:i.length)&&(void 0!==this.preSelection&&this.preSelection<=0||(this.preSelection=void 0===this.preSelection?this.visibleOptions.length-1:this.preSelection-1,this.scrollToOption(this.visibleOptions[this.preSelection]),null===(t=this.onOptionHover)||void 0===t||t.call(this,this.preSelection)))}async selectCurrentOption(){void 0!==this.preSelection&&(this.onOptionSelect(this.visibleOptions[this.preSelection]),this.preSelection=void 0)}observeWidth(i,t){i!==t&&this._listWrapper&&(this._listWrapper.style.width=`${this.width}px`)}observeMaxWidth(i,t){i!==t&&this._listWrapper&&(this._listWrapper.style.maxWidth=this.maxWidth?`${this.maxWidth}px`:"")}handleKeyDown(i){switch(i.key){case"ArrowDown":i.preventDefault(),i.stopPropagation(),this.nextOption();break;case"ArrowUp":i.preventDefault(),i.stopPropagation(),this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.preSelection=void 0}}buildItem(i,t){const s=this.showOptionValue&&this.maxWidth>0?`${this.maxWidth}px`:"";return i.label=i.label||i.value,e("li",{tabIndex:1,class:t===this.preSelection?"item preselected":"item",id:`item_${i.value}_${t}`,key:`item_${i.value}_${t}`,onMouseDown:()=>this.onOptionSelect(i),onMouseOver:()=>this.preSelection=t},this.showOptionValue?e("span",{class:"item__value",title:i.value,style:{width:s,minWidth:s,maxWidth:s}},i.value):void 0,e("span",{class:"item__label "+(this.showOptionValue?"item__label--bold":""),title:i.label},i.label))}scrollToOption(i){if(!(null==i?void 0:i.value)||!this._optionsList)return;const t=this.visibleOptions.indexOf(i);if(-1===t)return;const e=this._optionsList.querySelector(`li#item_${CSS.escape(i.value)}_${CSS.escape(String(t))}`);e&&e.scrollIntoView({behavior:"smooth",block:"nearest"})}async componentWillLoad(){this.i18n=await m()}componentDidLoad(){this._listWrapper.style.width=`${this.width}px`,this._listWrapper.style.maxWidth=this.maxWidth?`${this.maxWidth}px`:""}componentDidRender(){var i;null===(i=this._optionsList)||void 0===i||i.querySelectorAll(".item").forEach((i=>{o.addIDInfoIfNotExists(i,"itemComboBox")}))}render(){return e("section",{class:"list-container"},e("div",{class:"list-wrapper",ref:i=>this._listWrapper=i},e("ul",{class:"list-options",ref:i=>this._optionsList=i},!this.showLoading&&0===this.visibleOptions.length&&e("div",{class:"message"},e("span",{class:"message__no-result"},this.textEmptyList||this.i18n("ez-combo-box.noResults"))),this.showLoading&&e("div",{class:"message"},e("div",{class:"message__loading"})),this.showOptionValue&&e("span",{class:"item__value item__value--hidden"}),!this.showLoading&&this.visibleOptions.length>0&&this.visibleOptions.map(((i,t)=>this.buildItem(i,t))))))}static get watchers(){return{width:["observeWidth"],maxWidth:["observeMaxWidth"]}}};z.style=":host{--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--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box--line-height:calc(var(--text--medium, 14px) + 4px);--ez-combo-box__list-title--primary:var(--title--primary, #2B3A54);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium) + 4px);--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);--ez-combo-box__scrollbar--color-default:var(--scrollbar--default, #626e82);--ez-combo-box__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--ez-combo-box__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--ez-combo-box__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--ez-combo-box__scrollbar--border-radius:var(--border--radius-small, 6px);--ez-combo-box__scrollbar--width:var(--space--medium, 12px);--ez-combo-box__list-container--padding:var(--space--extra-small, 3px)}.list-container{padding-top:var(--ez-combo-box__list-container--padding)}.list-wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:0;z-index:var(--more-visible, 2);max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small) + 9px);background-color:var(--ez-combo-box--background-color--xlight);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow--medium, 0 8px 24px 0 rgba(43, 58, 84, 0.10));padding:var(--ez-combo-box--space--small)}.list-options{box-sizing:border-box;width:100%;height:100%;padding:0;margin:0;display:flex;flex-direction:column;scroll-behavior:smooth;overflow:auto;scrollbar-width:thin;gap:3px;scrollbar-color:var(--ez-combo-box__scrollbar--color-clicked) var(--ez-combo-box__scrollbar--color-background)}.list-options::-webkit-scrollbar{background-color:var(--ez-combo-box__scrollbar--color-background);width:var(--ez-combo-box__scrollbar--width);max-width:var(--ez-combo-box__scrollbar--width);min-width:var(--ez-combo-box__scrollbar--width)}.list-options::-webkit-scrollbar-track{background-color:var(--ez-combo-box__scrollbar--color-background);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb{background-color:var(--ez-combo-box__scrollbar--color-default);border-radius:var(--ez-combo-box__scrollbar--border-radius)}.list-options::-webkit-scrollbar-thumb:vertical:hover,.list-options::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--ez-combo-box__scrollbar--color-hover)}.list-options::-webkit-scrollbar-thumb:vertical:active,.list-options::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--ez-combo-box__scrollbar--color-clicked)}.item{display:flex;align-items:center;width:100%;box-sizing:border-box;list-style-type:none;cursor:pointer;border-radius:var(--ez-combo-box--border-radius-small);padding:var(--ez-combo-box--space--small);min-height:var(--ez-combo-box__list-height);gap:var(--space--small, 6px)}.item__value,.item__label{flex-basis:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size);line-height:var(--ez-combo-box--line-height)}.item__label{font-weight:var(--ez-combo-box--font-weight--medium)}.item__label--bold{font-weight:var(--ez-combo-box--font-weight--large)}.item__value{text-align:center;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large)}.item__value--hidden{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}.item__label{text-align:left}.message{text-align:center;display:flex;justify-content:center;align-items:center;list-style-type:none;min-height:var(--ez-combo-box__list-height)}.message__no-result{color:var(--ez-combo-box__list-title--primary);font-family:var(--ez-combo-box--font-family);font-size:var(--ez-combo-box--font-size)}.message__loading{border-radius:50%;width:14px;height:14px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border:3px solid var(--ez-combo-box__list-title--primary);border-top:3px solid transparent}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const f=class{constructor(t){i(this,t),this.gui=void 0,this.customEditor=void 0,this.formViewField=void 0,this.value=void 0,this.detailContext=void 0,this.builderFallback=void 0,this.selectedRecord=void 0}async setFocus(){var i,t;null===(t=null===(i=this.gui)||void 0===i?void 0:i.setFocus)||void 0===t||t.call(i)}async setBlur(){var i,t;null===(t=null===(i=this.gui)||void 0===i?void 0:i.setBlur)||void 0===t||t.call(i)}async isInvalid(){var i,t;return(null===(t=null===(i=this.gui)||void 0===i?void 0:i.isInvalid)||void 0===t?void 0:t.call(i))||!1}watchValue(){this.handleValue(this.gui)}watchCustomEditor(){this.getContent()}watchFormViewField(i,t){l.equals(i,t)||this.getContent()}watchDetailContext(){this.getContent()}watchBuilderFallback(){this.getContent()}watchSelectedRecord(i,t){(null==i?void 0:i.__record__id__)!==(null==t?void 0:t.__record__id__)&&this.getContent()}getContent(){var i,t,s,a,o;const l=new Map;for(const i in this.formViewField.props)l.set(i,this.formViewField.props[i]);const n={value:this.value,name:this.formViewField.name,currentEditor:this.builderFallback(this.formViewField),setValue:i=>this.setValue(i),getValue:this.getValue,record:this.selectedRecord,editorMetadata:{label:this.formViewField.label,hidden:!1===(null===(i=this.formViewField.props)||void 0===i?void 0:i.visible),userInterface:this.formViewField.userInterface,options:null===(t=this.formViewField.props)||void 0===t?void 0:t.options,props:this.formViewField.props?l:void 0,optionLoader:this.formViewField.optionLoader},source:b.FORM,detailContext:this.detailContext};let h=this.customEditor.getEditorElement(n);if(!h)return h=this.builderFallback(this.formViewField),this.handleValue(h),void(this.gui=h);if(!(h instanceof HTMLElement)&&"string"!=typeof h)return this.handleValue(h),void(this.gui=h);"string"==typeof h&&(h=c.parseElement(h));const d=null!==(o=null!==(a=null===(s=this.value)||void 0===s?void 0:s.value)&&void 0!==a?a:this.value)&&void 0!==o?o:"";h.setAttribute("value",d),this.gui=e("div",{key:r.generateUUID(),ref:i=>i&&i.appendChild(h)})}setValue(i){this.value=i}getValue(){return this.value}handleValue(i){var t;null===(t=i.i)||void 0===t||t.forEach((i=>{i.t.value=this.value}))}componentWillLoad(){this.getContent()}render(){return e(s,null,this.gui)}static get watchers(){return{value:["watchValue"],customEditor:["watchCustomEditor"],formViewField:["watchFormViewField"],detailContext:["watchDetailContext"],builderFallback:["watchBuilderFallback"],selectedRecord:["watchSelectedRecord"]}}},w=class{constructor(e){i(this,e),this.ezChange=t(this,"ezChange",7),this.ezError=t(this,"ezError",7),this.handleFileSelect=i=>{const t=i.target;t.files&&t.files[0]&&this.processFile(t.files[0])},this.handleDrop=i=>{var t;if(i.preventDefault(),i.stopPropagation(),this._isDragging=!1,!this.enabled)return;const e=null===(t=i.dataTransfer)||void 0===t?void 0:t.files;e&&e[0]&&this.processFile(e[0])},this.handleDragOver=i=>{i.preventDefault(),i.stopPropagation(),this.enabled&&(this._isDragging=!0)},this.handleDragLeave=i=>{i.preventDefault(),i.stopPropagation(),this._isDragging=!1},this.handleRemoveImage=i=>{i.stopPropagation(),this.value=void 0,this._hasImage=!1,this._inputElem&&(this._inputElem.value=""),this.ezChange.emit("")},this.handleClickDropZone=()=>{var i;this.enabled&&!this._hasImage&&(null===(i=this._inputElem)||void 0===i||i.click())},this.handleImageClick=i=>{i.stopPropagation(),this._hasImage&&this.value&&(this._showImagePopup=!0)},this.handlePopupAction=i=>{const t=i.detail;"CANCEL"!==t&&"OK"!==t||this.handleClosePopup()},this.handleClosePopup=()=>{this._showImagePopup=!1},this.enabled=!0,this.label=void 0,this.name=void 0,this.value=void 0,this.maxFileSize=20971520,this.accept="image/*",this.loading=!1,this._hasImage=!1,this._isDragging=!1,this._showImagePopup=!1}onValueChange(i,t){i!==t&&(this._hasImage=!!i),!i&&this._inputElem&&(this._inputElem.value="")}addInfoId(){this._element&&o.addIDInfo(this._element),this._inputElem&&o.addIDInfo(this._inputElem,"image-input",{id:"embedded"})}processFile(i){if(!i.type.startsWith("image/")){const i=this.i18n("ez-image-input.invalidFileType");return void this.ezError.emit(i)}if(this.maxFileSize&&i.size>this.maxFileSize){const i=(this.maxFileSize/1048576).toFixed(2),t=this.i18n("ez-image-input.fileTooLarge",{maxSize:`${i}MB`});return void this.ezError.emit(t)}const t=new FileReader;t.onload=i=>{var t;const e=null===(t=i.target)||void 0===t?void 0:t.result;this.value=e,this._hasImage=!0,this.ezChange.emit(e)},t.readAsDataURL(i)}async componentWillLoad(){this.i18n=await m(),this._hasImage=!!this.value}componentDidLoad(){this.addInfoId()}render(){if(this.loading)return e(s,null,e("ez-skeleton",{width:"280px",height:"200px"}));const i=this.label||this.i18n("ez-image-input.defaultLabel");return e(s,null,e("div",{class:{"image-input__container":!0,"image-input__container--disabled":!this.enabled,"image-input__container--dragging":this._isDragging,"image-input__container--has-image":this._hasImage},"data-enabled":this.enabled.toString(),"data-has-image":this._hasImage.toString(),onClick:this.handleClickDropZone,onDrop:this.handleDrop,onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,role:"button","aria-label":i,tabindex:this.enabled?0:-1},e("input",{ref:i=>this._inputElem=i,type:"file",accept:this.accept,name:this.name,disabled:!this.enabled,onChange:this.handleFileSelect,class:"image-input__file-input","aria-hidden":"true"}),this._hasImage&&this.value?e("div",{class:"image-input__preview"},e("img",{src:this.value,alt:this.i18n("ez-image-input.imageAlt"),class:"image-input__image",onClick:this.handleImageClick}),this.enabled&&e("ez-button",{class:"image-input__remove-button",variant:"primary",type:"button",mode:"icon",size:"small",iconName:"trash-alt",onClick:this.handleRemoveImage,"aria-label":this.i18n("ez-image-input.removeImage"),title:this.i18n("ez-image-input.removeImage")})):e("div",{class:"image-input__dropzone"},e("ez-icon",{iconName:"image",size:"x-large"}),e("span",{class:"image-input__label"},i))),e("ez-popup",{opened:this._showImagePopup,ezTitle:this.i18n("ez-image-input.imagePreview"),size:"large",heightMode:"auto",onEzPopupAction:this.handlePopupAction,onEzClosePopup:this.handleClosePopup},e("div",{class:"image-input__popup-content"},e("img",{src:this.value,alt:this.i18n("ez-image-input.imageAlt"),class:"image-input__popup-image"}))))}get _element(){return a(this)}static get watchers(){return{value:["onValueChange"]}}};w.style=":host{display:block;--ez-image-input--container-height:200px;--ez-image-input--container-width:280px;--ez-image-input--background-color:var(--color--gray-80);--ez-image-input--border-color:var(--color--gray-200);--ez-image-input--border-color-hover:var(--color--ocean-green-600);--ez-image-input--border-color-dragging:var(--color--ocean-green-500);--ez-image-input--border-color-disabled:var(--color--gray-200);--ez-image-input--label-color:var(--color--petroleum-900);--ez-image-input--icon-color:var(--color--gray-400);--ez-image-input--border-radius:var(--border--radius-24);--ez-image-input--border-width:2px;--ez-image-input--remove-button-bg:var(--color--red-600);--ez-image-input--remove-button-bg-hover:var(--color--red-700);--ez-image-input--remove-button-color:var(--color--gray-70);--ez-image-input--remove-button-border:1px solid var(--color--red-700)}.image-input__container{display:flex;align-items:center;justify-content:center;position:relative;height:var(--ez-image-input--container-height);width:var(--ez-image-input--container-width);border:var(--ez-image-input--border-width) dashed var(--ez-image-input--border-color);border-radius:var(--ez-image-input--border-radius);background-color:var(--ez-image-input--background-color);cursor:pointer;transition:all 0.3s ease;overflow:hidden}.image-input__container:hover:not(.image-input__container--disabled){border-color:var(--ez-image-input--border-color-hover)}.image-input__container--dragging{border-color:var(--ez-image-input--border-color-dragging);background-color:var(--color--ocean-green-90)}.image-input__container--disabled{cursor:not-allowed;opacity:0.6;border-color:var(--ez-image-input--border-color-disabled)}.image-input__container--has-image{border-style:solid;padding:var(--space--0)}.image-input__file-input{display:none}.image-input__dropzone{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space--16);padding:var(--space--24);text-align:center}.image-input__dropzone ez-icon{color:var(--ez-image-input--icon-color)}.image-input__label{font-family:var(--font--pattern);font-size:var(--font-size--default);font-weight:var(--font-weight--medium);color:var(--ez-image-input--label-color);line-height:var(--line-height--20)}.image-input__preview{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.image-input__image{height:100%;object-fit:cover;border-radius:calc(var(--ez-image-input--border-radius) - var(--ez-image-input--border-width))}ez-button{--ez-button--background-color:var(--ez-image-input--remove-button-bg);--ez-button--hover--background-color:var(--ez-image-input--remove-button-bg-hover);--ez-button--color:var(--ez-image-input--remove-button-color);--ez-button--border:var(--ez-image-input--remove-button-border);--ez-button--hover--border:var(--ez-image-input--remove-button-border)}.image-input__remove-button{position:absolute;top:var(--space--8);right:var(--space--8);display:flex;align-items:center;justify-content:center}.image-input__popup-content{display:flex;align-items:center;justify-content:center;padding:var(--space--16);height:100%}.image-input__popup-image{max-width:100%;max-height:70vh;object-fit:contain;border-radius:var(--border--radius-8)}.image-input__image{height:100%;object-fit:cover;border-radius:calc(var(--ez-image-input--border-radius) - var(--ez-image-input--border-width));cursor:pointer;transition:transform 0.2s ease}.image-input__image:hover{transform:scale(1.02)}ez-skeleton{--skeleton-width:var(--ez-image-input--container-width);--skeleton-height:var(--ez-image-input--container-height)}";const y=class{constructor(e){i(this,e),this.ezChange=t(this,"ezChange",7),this.historyStack=[],this.historyIndex=-1,this.previewMode=!1,this.showPreview=!0,this.value=void 0,this.label=void 0,this.mode="regular",this.enabled=!0,this.rows=6,this.errorMessage=void 0,this.canShowError=!0,this.showConfigs=!0,this.showTextFormat=!0,this.showUndoRedo=!0}observeValue(i,t){l.equals(i,t)||this.ezChange.emit(i)}observeErrorMessage(i){i&&this.previewMode&&(this.previewMode=!1)}async handleExecuteToolbarCommand(i){const{command:t,value:e}=i.detail;await this.executeCommand(t,e)}async setFocus(){this.handleFocus()}async setBlur(){var i;await(null===(i=this.textAreaRef)||void 0===i?void 0:i.setBlur())}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}bindPreview(){this._keyboardManager&&this.showPreview&&this._keyboardManager.bind("ctrl + p",(async()=>{await this.togglePreview()}),{description:"Entra em modo de pré visualização.",element:this.element})}bindConfigs(){this._keyboardManager&&this.showConfigs&&this._keyboardManager.bind("ctrl + l",(async()=>{await this.handleFormatSelection(u.LIST)}),{description:this.i18n("ez-rich-text.listShortcut"),element:this.element}).bind("ctrl + k",(async()=>{await this.handleLink()}),{description:this.i18n("ez-rich-text.linkShortcut"),element:this.element}).bind("ctrl + o",(async()=>{await this.handleImage()}),{description:this.i18n("ez-rich-text.imageShortcut"),element:this.element})}bindTextFormat(){this._keyboardManager&&this.showTextFormat&&this._keyboardManager.bind("ctrl + b",(async()=>{await this.handleFormatSelection(u.BOLD)}),{description:this.i18n("ez-rich-text.boldShortcut"),element:this.element}).bind("ctrl + i",(async()=>{await this.handleFormatSelection(u.ITALIC)}),{description:this.i18n("ez-rich-text.italicShortcut"),element:this.element}).bind("ctrl + u",(async()=>{await this.handleFormatSelection(u.UNDERLINE)}),{description:this.i18n("ez-rich-text.underlineShortcut"),element:this.element})}initKeyboardManager(){this._keyboardManager=new n({propagate:!1,element:this.element}),this._keyboardManager.bind("ctrl + Enter",(async()=>{await this.handleFormatSelection(u.BREAK_LINE)}),{description:this.i18n("ez-rich-text.breakLineShortcut"),element:this.element}).bind("ctrl + z",(async()=>{await this.handleUndo()}),{description:this.i18n("ez-rich-text.undoShortcut"),element:this.element}).bind("ctrl + x",(async()=>{await this.handleRedo()}),{description:this.i18n("ez-rich-text.redoShortcut"),element:this.element}),this.bindPreview(),this.bindConfigs(),this.bindTextFormat()}async executeCommand(i,t){switch(i){case p.FOCUS:this.handleFocus();break;case p.PREVIEW:await this.togglePreview();break;case p.FORMAT:await this.handleFormatSelection(t);break;case p.UNDO:await this.handleUndo();break;case p.REDO:await this.handleRedo();break;case p.LINK:await this.handleLink();break;case p.IMAGE:await this.handleImage()}}handleFocus(){this.previewMode=!1,requestAnimationFrame((async()=>{await this.textAreaRef.setFocus()}))}async handleLink(){this.previewMode=!1,requestAnimationFrame((async()=>{await this.linkBuilderRef.show(this.getSelectedText())}))}async handleImage(){this.previewMode=!1,await this.imageUploaderRef.show()}async handleRedo(){this.previewMode=!1,requestAnimationFrame((async()=>{this.redo(),await this.textAreaRef.setFocus()}))}async handleUndo(){this.previewMode=!1,requestAnimationFrame((async()=>{this.undo(),await this.textAreaRef.setFocus()}))}async handleFormatSelection(i){i&&(this.previewMode=!1,requestAnimationFrame((async()=>{await this.formatSelection(i),await this.textAreaRef.setFocus()})))}async togglePreview(){this.previewMode=!this.previewMode,this.previewMode&&await this.textAreaRef.setFocus()}getSelectedText(){const i=this.getTextAreaElement();if(i)return(this.textAreaRef.value||"").substring(i.selectionStart,i.selectionEnd)}getTextAreaElement(){return this.element.querySelector("ez-text-area").shadowRoot.querySelector("textarea")}async formatSelection(i){if(!this.textAreaRef)return;const t=i.replace("$selection",this.getSelectedText()||"");await this.textAreaRef.appendTextToSelection(t),this.value=this.textAreaRef.value,this.addToHistory(this.value)}addToHistory(i){this.historyIndex>=0&&i===this.historyStack[this.historyIndex]||(this.historyStack.length>=50&&this.historyStack.splice(0,this.historyStack.length-49),this.historyStack.push(i),this.historyIndex=this.historyStack.length-1)}undo(){if(!this.canExecuteUndo())return;this.historyIndex--;const i=this.historyStack[this.historyIndex];this.value=i,this.textAreaRef.value=i}canExecuteUndo(){return this.historyIndex>0}redo(){this.canExecuteRedo()&&(this.historyIndex++,this.getValueFromHistory())}canExecuteRedo(){return this.historyIndex<this.historyStack.length-1}getValueFromHistory(){const i=this.historyStack[this.historyIndex];this.value=i,this.textAreaRef.value=i}handleTextAreaChanged(i){this.value=i.detail,this.addToHistory(this.value)}async removeShortcuts(){var i;null===(i=this._keyboardManager)||void 0===i||i.unbindAllShortcutKeys()}async componentWillLoad(){this.i18n=await m()}componentDidLoad(){this.initKeyboardManager(),this.addToHistory(this.value)}async disconnectedCallback(){await this.removeShortcuts()}getSanitizedValue(){return v.sanitize(this.value,{ADD_ATTR:["target","rel"]})}renderContent(){return this.previewMode?e("div",{id:"rich-text-preview-container",class:"preview",innerHTML:this.getSanitizedValue()}):e("ez-text-area",{ref:i=>this.textAreaRef=i,label:this.label,value:this.value,enabled:this.enabled,rows:this.rows,mode:this.mode,canShowError:this.canShowError,errorMessage:this.errorMessage,onEzChange:this.handleTextAreaChanged.bind(this)})}render(){return e(s,null,e("div",{class:"editor-container bordered"},e("ez-rich-toolbar",{isPreviewMode:this.previewMode,showPreview:this.showPreview,showConfigs:this.showConfigs&&this.enabled,showTextFormat:this.showTextFormat&&this.enabled,showUndoRedo:this.showUndoRedo&&this.enabled}),this.renderContent()),e("ez-link-builder",{ref:i=>this.linkBuilderRef=i}),e("ez-simple-image-uploader",{ref:i=>this.imageUploaderRef=i}))}get element(){return a(this)}static get watchers(){return{value:["observeValue"],errorMessage:["observeErrorMessage"]}}};y.style=".sc-ez-rich-text-h{display:block;width:100%;font-family:Roboto;--ez-rich-text--box-shadow:0 0 3px 0 #DCE0E8;--ez-rich-text--shadow--outline:var(--shadow--outline) var(--color--strokes)}.editor-container.sc-ez-rich-text{width:100%;overflow:hidden;border-radius:12px;border:1px solid #DCE0E8}ez-text-area.sc-ez-rich-text{--text-area__input--border:1px solid}.preview.sc-ez-rich-text{min-height:20px;padding:12px;resize:both;overflow:auto;max-width:100%;border-top:1px solid #DCE0E8}";const k=class{constructor(e){i(this,e),this.saveEdition=t(this,"saveEdition",7),this.cancelEdition=t(this,"cancelEdition",7),this._newValue=void 0,this.value=void 0,this.styled=void 0}async applyFocusSelect(){this.calcSizeInput(this.value,!0)}calcSizeInput(i,t=!1){var e,s;const a=null===(s=null===(e=this._inputElement)||void 0===e?void 0:e.shadowRoot)||void 0===s?void 0:s.querySelector("input");if(null!=a){const e=this.getWidthValue(i);a.style.width=e+"px",t&&setTimeout((()=>a.select()),100)}}getWidthValue(i){if(null!=this._valueBasis){const t=this._valueBasis;if(null!=i){const e=2;return t.innerHTML=i,t.clientWidth>0?t.clientWidth+e:e}t.innerHTML=""}return 0}setStyledInput(){var i,t;let e="",s="",a="";null!=this.styled&&(e=this.styled.fontSize,s=this.styled.fontWeight,a=this.styled.fontFamily);const r=null===(t=null===(i=this._inputElement)||void 0===i?void 0:i.shadowRoot)||void 0===t?void 0:t.querySelector("input");null!=r&&(r.style.fontSize=e,r.style.fontWeight=s,r.style.fontFamily=a);const o=this._valueBasis;null!=o&&(o.style.fontSize=e,o.style.fontWeight=s,o.style.fontFamily=a)}handleSaveEdition(){this._newValue?this.saveEdition.emit({value:this.value,newValue:this._newValue}):g.alert(this.i18n("app.warning"),this.i18n("ez-text-edit.emptyFieldWarning")).then((()=>{this.setNewValue(this.value,!0)}))}handleCancelEdition(){this.cancelEdition.emit()}setNewValue(i,t=!1){this._newValue=i,this.calcSizeInput(this._newValue,t)}async componentWillLoad(){this.i18n=await m()}componentDidLoad(){this.applyFocusSelect(),this.setNewValue(this.value)}componentDidRender(){this.setStyledInput()}render(){return o.addIDInfoIfNotExists(this._element,"input"),e(s,null,e("span",{class:"text-edit__hidden-value",ref:i=>this._valueBasis=i}),e("ez-text-input",{"data-element-id":o.getInternalIDInfo("textInput"),onInput:()=>{this.calcSizeInput(this._newValue)},class:"text-edit__form-input",value:this._newValue,ref:i=>this._inputElement=i,mode:"slim",onEzChange:i=>this.setNewValue(null==i?void 0:i.detail),noBorder:!0}),e("ez-button",{class:"text-edit__icon-check",mode:"icon",iconName:"check",size:"small",onClick:()=>{this.handleSaveEdition()}}),e("ez-button",{class:"text-edit__icon-close",mode:"icon",iconName:"close",size:"small",onClick:()=>{this.handleCancelEdition()}}))}get _element(){return a(this)}};k.style=":host{display:flex;align-items:center;gap:5px}.text-edit__form-input{width:auto;--ez-text-input__input--padding:0px}.text-edit__hidden-value{visibility:hidden;position:absolute;white-space:nowrap;z-index:-1;top:0;left:0}";export{_ as classic_search_list,x as ez_classic_search_result_list,z as ez_combo_box_list,f as ez_custom_form_input,w as ez_image_input,y as ez_rich_text,k as ez_text_edit}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as s,g as n}from"./p-23a36bb6.js";import{DateUtils as o,TimeFormatter as a,ElementIDUtils as h}from"@sankhyalabs/core";import{C as r}from"./p-ec7db713.js";import{i as l}from"./p-98218fbc.js";const c=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.ezStartChange=i(this,"ezStartChange",7),this.ezCancelWaitingChange=i(this,"ezCancelWaitingChange",7),this._changePending=!1,this._focused=!1,this._valuePromiseCallbacks=[],this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.showSeconds=!1,this.mode="regular",this.canShowError=!0,this.autoFocus=!1,this.alternativePlaceholder=void 0}observeLabel(){this._textInput&&(this._textInput.label=this.label)}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){const e=o.validateDate(t,!0),s=o.validateDate(i,!0);if((null==e?void 0:e.getTime())!==(null==s?void 0:s.getTime())){const t=this.getTextValue(e)||"";!this.getParsedDateTime(t)&&this._focused||(this._textInput.value||"")===t||(this._textInput.value=t,this._focused=!1,this.errorMessage=""),this.ezChange.emit(null===e?void 0:e)}}this._changePending=!1}async setFocus(t){this._textInput.setFocus(t)}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async getValueAsync(){return this._changePending?new Promise((t=>{this._valuePromiseCallbacks.push(t)})):Promise.resolve(this.value)}handleKeyDown(t){const i=this._textInput.shadowRoot.querySelector("input");if(t.shiftKey&&"Tab"===t.key){if(i.selectionStart>0){let e=i.value.lastIndexOf(" ",i.selectionStart);-1!==e&&(i.setSelectionRange(0,e),t.preventDefault())}}else if("Tab"===t.key&&i.value.length!==i.selectionEnd){let e=i.value.indexOf(" ",i.selectionEnd);e=-1===e?i.selectionEnd:e+1,i.setSelectionRange(e,i.value.length),t.preventDefault()}}handleFocus(){const t=this._textInput.shadowRoot.querySelector("input");if(t.selectionStart!==t.selectionEnd){let i=t.value.indexOf(" ",t.selectionStart);i=-1===i?t.value.length:i,t.setSelectionRange(0,i)}}handleClick(){const t=this._textInput.shadowRoot.querySelector("input");let i=t.value.lastIndexOf(" ",t.selectionEnd);i=-1===i?0:i+1,i=i>t.selectionEnd?0:i;let e=0===i?t.value.indexOf(" "):t.value.length;t.setSelectionRange(i,e)}changeValue(t){const i=o.validateDate(this.value,!0),e=o.validateDate(t,!0);(null==i?void 0:i.getTime())!==(null==e?void 0:e.getTime())&&(this.value=e)}hideCalendar(){this.changeValue(this._calendar.value),this._popover.hide()}getParsedDateTime(t){var i,e;if(void 0===t&&(t=(null===(e=null===(i=this._textInput)||void 0===i?void 0:i.value)||void 0===e?void 0:e.trim())||""),!t)return;const s=t.split(" "),n=s.length>0?s[0]:t,h=a.prepareValue(s[1]?s[1]:"",this.showSeconds);return o.strToDate(n+(h&&" "+h))}handleBlur(){var t,i;if(this._changePending)try{const e=(null===(i=null===(t=this._textInput)||void 0===t?void 0:t.value)||void 0===i?void 0:i.trim())||"",s=this.getParsedDateTime();if(s||!e){this.errorMessage="";const t=o.validateDate(this.value,!0),i=o.validateDate(s,!0);(null==t?void 0:t.getTime())===(null==i?void 0:i.getTime())?(i&&(this._textInput.value=this.getTextValue(i)||"",this._focused=!1),this.ezCancelWaitingChange.emit()):this.changeValue(i)}else this.changeValue(void 0),this.ezCancelWaitingChange.emit(),this.errorMessage=this.i18n("ez-date-time-input.invalidDate")}finally{for(const t of this._valuePromiseCallbacks)t(this.value);this._valuePromiseCallbacks=[]}}getTextValue(t){if(t)return o.formatDateTime(t,this.showSeconds)}handleInput(t){const i=this.getParsedDateTime(),e=o.validateDate(this.value,!0),s=o.validateDate(i,!0);(null==e?void 0:e.getTime())!==(null==s?void 0:s.getTime())&&(this._changePending=!0,this._focused=!0,this.ezStartChange.emit({waitmessage:"",blocking:!1})),"H"!==t.data&&"h"!==t.data||this.changeValue(new Date)}setInputValue(){const t=this.getTextValue(this.value)||"";(this._textInput.value||"")!==t&&(this._textInput.value=t)}disconnectedCallback(){this._popover.hide()}async componentWillLoad(){this.i18n=await l()}componentDidLoad(){r.applyVarsTextInput(this._elem,this._textInput),this.setInputValue(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}render(){return h.addIDInfoIfNotExists(this._elem,"input"),e(s,null,e("ez-text-input",{"data-element-id":h.getInternalIDInfo("textInput"),ref:t=>this._textInput=t,"data-slave-mode":"true",label:this.label,restrict:"0123456789/: ",enabled:this.enabled,errorMessage:this.errorMessage,mode:this.mode,onKeyDown:t=>{this.handleKeyDown(t)},onBlur:()=>this.handleBlur(),onInput:t=>this.handleInput(t),onFocus:()=>this.handleFocus(),onClick:()=>this.handleClick(),canShowError:this.canShowError,alternativePlaceholder:this.alternativePlaceholder},e("button",{disabled:!this.enabled,tabindex:-1,class:"btn-open-cal",onClick:()=>{var t;return null===(t=this._popover)||void 0===t?void 0:t.showUnder(this._textInput)},slot:"leftIcon"})),e("ez-popover-plus",{ref:t=>this._popover=t,anchorElement:this._textInput,autoClose:!0,boxWidth:"fit-content",overlayType:"none","data-element-id":this._elem.getAttribute("data-element-id")},e("ez-calendar",{ref:t=>this._calendar=t,"data-element-id":h.getInternalIDInfo("calendar"),onEzChange:t=>{this.hideCalendar(),t.stopPropagation()},time:!0,showSeconds:this.showSeconds})))}get _elem(){return n(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};c.style=':host{display:block;width:100%;--ez-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-date-input__input--border-color:var(--ez-date-input__input--background-color);--ez-date-input__calendar-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="15px"><path d="M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z"/></svg>\')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:not-allowed}.btn-open-cal::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-date-input__calendar-image);mask-image:var(--ez-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-text-input{--text-input__input--background-color:var(--ez-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-date-input__input--border-color, #DCE0E8)}';export{c as ez_date_time_input}
|
|
1
|
+
import{r as t,c as i,h as e,H as s,g as n}from"./p-23a36bb6.js";import{DateUtils as o,TimeFormatter as a,ElementIDUtils as h}from"@sankhyalabs/core";import{C as r}from"./p-ec7db713.js";import{i as l}from"./p-c178730b.js";const c=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.ezStartChange=i(this,"ezStartChange",7),this.ezCancelWaitingChange=i(this,"ezCancelWaitingChange",7),this._changePending=!1,this._focused=!1,this._valuePromiseCallbacks=[],this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.showSeconds=!1,this.mode="regular",this.canShowError=!0,this.autoFocus=!1,this.alternativePlaceholder=void 0}observeLabel(){this._textInput&&(this._textInput.label=this.label)}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){const e=o.validateDate(t,!0),s=o.validateDate(i,!0);if((null==e?void 0:e.getTime())!==(null==s?void 0:s.getTime())){const t=this.getTextValue(e)||"";!this.getParsedDateTime(t)&&this._focused||(this._textInput.value||"")===t||(this._textInput.value=t,this._focused=!1,this.errorMessage=""),this.ezChange.emit(null===e?void 0:e)}}this._changePending=!1}async setFocus(t){this._textInput.setFocus(t)}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async getValueAsync(){return this._changePending?new Promise((t=>{this._valuePromiseCallbacks.push(t)})):Promise.resolve(this.value)}handleKeyDown(t){const i=this._textInput.shadowRoot.querySelector("input");if(t.shiftKey&&"Tab"===t.key){if(i.selectionStart>0){let e=i.value.lastIndexOf(" ",i.selectionStart);-1!==e&&(i.setSelectionRange(0,e),t.preventDefault())}}else if("Tab"===t.key&&i.value.length!==i.selectionEnd){let e=i.value.indexOf(" ",i.selectionEnd);e=-1===e?i.selectionEnd:e+1,i.setSelectionRange(e,i.value.length),t.preventDefault()}}handleFocus(){const t=this._textInput.shadowRoot.querySelector("input");if(t.selectionStart!==t.selectionEnd){let i=t.value.indexOf(" ",t.selectionStart);i=-1===i?t.value.length:i,t.setSelectionRange(0,i)}}handleClick(){const t=this._textInput.shadowRoot.querySelector("input");let i=t.value.lastIndexOf(" ",t.selectionEnd);i=-1===i?0:i+1,i=i>t.selectionEnd?0:i;let e=0===i?t.value.indexOf(" "):t.value.length;t.setSelectionRange(i,e)}changeValue(t){const i=o.validateDate(this.value,!0),e=o.validateDate(t,!0);(null==i?void 0:i.getTime())!==(null==e?void 0:e.getTime())&&(this.value=e)}hideCalendar(){this.changeValue(this._calendar.value),this._popover.hide()}getParsedDateTime(t){var i,e;if(void 0===t&&(t=(null===(e=null===(i=this._textInput)||void 0===i?void 0:i.value)||void 0===e?void 0:e.trim())||""),!t)return;const s=t.split(" "),n=s.length>0?s[0]:t,h=a.prepareValue(s[1]?s[1]:"",this.showSeconds);return o.strToDate(n+(h&&" "+h))}handleBlur(){var t,i;if(this._changePending)try{const e=(null===(i=null===(t=this._textInput)||void 0===t?void 0:t.value)||void 0===i?void 0:i.trim())||"",s=this.getParsedDateTime();if(s||!e){this.errorMessage="";const t=o.validateDate(this.value,!0),i=o.validateDate(s,!0);(null==t?void 0:t.getTime())===(null==i?void 0:i.getTime())?(i&&(this._textInput.value=this.getTextValue(i)||"",this._focused=!1),this.ezCancelWaitingChange.emit()):this.changeValue(i)}else this.changeValue(void 0),this.ezCancelWaitingChange.emit(),this.errorMessage=this.i18n("ez-date-time-input.invalidDate")}finally{for(const t of this._valuePromiseCallbacks)t(this.value);this._valuePromiseCallbacks=[]}}getTextValue(t){if(t)return o.formatDateTime(t,this.showSeconds)}handleInput(t){const i=this.getParsedDateTime(),e=o.validateDate(this.value,!0),s=o.validateDate(i,!0);(null==e?void 0:e.getTime())!==(null==s?void 0:s.getTime())&&(this._changePending=!0,this._focused=!0,this.ezStartChange.emit({waitmessage:"",blocking:!1})),"H"!==t.data&&"h"!==t.data||this.changeValue(new Date)}setInputValue(){const t=this.getTextValue(this.value)||"";(this._textInput.value||"")!==t&&(this._textInput.value=t)}disconnectedCallback(){this._popover.hide()}async componentWillLoad(){this.i18n=await l()}componentDidLoad(){r.applyVarsTextInput(this._elem,this._textInput),this.setInputValue(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}render(){return h.addIDInfoIfNotExists(this._elem,"input"),e(s,null,e("ez-text-input",{"data-element-id":h.getInternalIDInfo("textInput"),ref:t=>this._textInput=t,"data-slave-mode":"true",label:this.label,restrict:"0123456789/: ",enabled:this.enabled,errorMessage:this.errorMessage,mode:this.mode,onKeyDown:t=>{this.handleKeyDown(t)},onBlur:()=>this.handleBlur(),onInput:t=>this.handleInput(t),onFocus:()=>this.handleFocus(),onClick:()=>this.handleClick(),canShowError:this.canShowError,alternativePlaceholder:this.alternativePlaceholder},e("button",{disabled:!this.enabled,tabindex:-1,class:"btn-open-cal",onClick:()=>{var t;return null===(t=this._popover)||void 0===t?void 0:t.showUnder(this._textInput)},slot:"leftIcon"})),e("ez-popover-plus",{ref:t=>this._popover=t,anchorElement:this._textInput,autoClose:!0,boxWidth:"fit-content",overlayType:"none","data-element-id":this._elem.getAttribute("data-element-id")},e("ez-calendar",{ref:t=>this._calendar=t,"data-element-id":h.getInternalIDInfo("calendar"),onEzChange:t=>{this.hideCalendar(),t.stopPropagation()},time:!0,showSeconds:this.showSeconds})))}get _elem(){return n(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};c.style=':host{display:block;width:100%;--ez-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-date-input__input--border-color:var(--ez-date-input__input--background-color);--ez-date-input__calendar-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="15px"><path d="M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z"/></svg>\')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:not-allowed}.btn-open-cal::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-date-input__calendar-image);mask-image:var(--ez-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-text-input{--text-input__input--background-color:var(--ez-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-date-input__input--border-color, #DCE0E8)}';export{c as ez_date_time_input}
|
|
@@ -1 +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-
|
|
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-c178730b.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{r as t,c as i,h as s,H as e,g as a}from"./p-23a36bb6.js";import{DateUtils as n,ElementIDUtils as h}from"@sankhyalabs/core";import{C as o}from"./p-ec7db713.js";import{i as r}from"./p-c178730b.js";const l=class{constructor(s){t(this,s),this.ezChange=i(this,"ezChange",7),this.ezStartChange=i(this,"ezStartChange",7),this.ezCancelWaitingChange=i(this,"ezCancelWaitingChange",7),this.ezInput=i(this,"ezInput",7),this._changePending=!1,this._focused=!1,this._valuePromiseCallbacks=[],this.label=void 0,this.value=void 0,this.enabled=!0,this.errorMessage=void 0,this.mode="regular",this.size="default",this.required=!1,this.canShowError=!0,this.autoFocus=!1,this.alternativePlaceholder=void 0}observeLabel(){this._textInput&&(this._textInput.label=this.label)}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){const s=n.validateDate(t),e=n.validateDate(i);if((null==s?void 0:s.getTime())!==(null==e?void 0:e.getTime())){const t=this.getTextValue(s)||"";!n.strToDate(t)&&this._focused||(this._textInput.value||"")===t||(this._textInput.value=t,this._focused=!1,this.errorMessage=""),this.ezChange.emit(null===s?void 0:s)}}this._changePending=!1}async setFocus(t){this._textInput.setFocus(t)}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async getValueAsync(){return this._changePending?new Promise((t=>{this._valuePromiseCallbacks.push(t)})):Promise.resolve(this.value)}changeValue(t){const i=n.validateDate(this.value),s=n.validateDate(t);(null==i?void 0:i.getTime())!==(null==s?void 0:s.getTime())?this.value=s:this._changePending=!1}async handleChangeCalendar(t){this.changeValue(this._calendar.value),this.ezInput.emit(this._calendar.value),this._popover.hide(),await this.setFocus(),t.stopPropagation()}handleBlur(){if(this._changePending)try{const t=this._textInput.value,i=n.strToDate(t);if(i||!t){this.errorMessage="";const t=n.validateDate(this.value),s=n.validateDate(i);(null==t?void 0:t.getTime())===(null==s?void 0:s.getTime())?(s&&(this._textInput.value=this.getTextValue(s)||"",this._focused=!1),this.ezCancelWaitingChange.emit()):(this._focused=!1,this.changeValue(s))}else this.changeValue(void 0),this.ezCancelWaitingChange.emit(),this.errorMessage=this.i18n("ez-classic-date-input.invalidDate")}finally{for(const t of this._valuePromiseCallbacks)t(this.value);this._valuePromiseCallbacks=[]}}getTextValue(t){return t?n.formatDate(t):void 0}handleInput(t){const i=n.strToDate(this._textInput.value),s=n.validateDate(this.value),e=n.validateDate(i);if((null==s?void 0:s.getTime())!==(null==e?void 0:e.getTime())&&(this._changePending=!0,this._focused=!0,this.ezStartChange.emit({waitmessage:"",blocking:!1})),"H"===t.data||"h"===t.data){const t=new Date;this.ezInput.emit(t),this.changeValue(t)}}setInputValue(){const t=this.getTextValue(this.value)||"";(this._textInput.value||"")!==t&&(this._textInput.value=t)}disconnectedCallback(){this._popover.hide()}async componentWillLoad(){this.i18n=await r()}componentDidLoad(){o.applyVarsTextInput(this._elem,this._textInput),this.setInputValue(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}render(){return h.addIDInfoIfNotExists(this._elem,"input"),s(e,null,s("ez-classic-input",{"data-element-id":h.getInternalIDInfo("textInput"),ref:t=>this._textInput=t,"data-slave-mode":"true",label:this.label,onBlur:()=>this.handleBlur(),onInput:t=>this.handleInput(t),restrict:"0123456789/",enabled:this.enabled,errorMessage:this.errorMessage,mode:this.mode,size:this.size,canShowError:this.canShowError,alternativePlaceholder:this.alternativePlaceholder,required:this.required,leftIconName:"calendar",leftIconClickable:this.enabled,onIconClick:()=>{var t;return null===(t=this._popover)||void 0===t?void 0:t.showUnder(this._textInput)},onEzChange:t=>t.stopPropagation()}),s("ez-popover-plus",{ref:t=>this._popover=t,anchorElement:this._textInput,autoClose:!0,boxWidth:"fit-content",overlayType:"none","data-element-id":this._elem.getAttribute("data-element-id"),onEzVisibilityChange:t=>t.stopPropagation()},s("ez-calendar",{ref:t=>this._calendar=t,"data-element-id":h.getInternalIDInfo("calendar"),onEzChange:t=>this.handleChangeCalendar(t),value:this.value})))}get _elem(){return a(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"]}}};l.style=':host{display:block;width:100%;--ez-classic-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-classic-date-input__input--border-color:var(--ez-classic-date-input__input--background-color);--ez-classic-date-input__calendar-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="15px"><path d="M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z"/></svg>\')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:not-allowed}.btn-open-cal::after{content:\'\';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-classic-date-input__calendar-image);mask-image:var(--ez-classic-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-classic-input{--text-input__input--background-color:var(--ez-classic-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-classic-date-input__input--border-color, #DCE0E8)}';export{l as ez_classic_date_input}
|