@sankhyalabs/ezui 1.2.0-beta.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ApplicationUtils-2ac1b73e.js → ApplicationUtils-edc62c5c.js} +4 -1
- package/dist/cjs/CheckMode-ecb90b87.js +7 -0
- package/dist/cjs/{DialogType-a1e288e6.js → DialogType-aa435c52.js} +1 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +68 -17
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +13 -11
- package/dist/cjs/ez-calendar.cjs.entry.js +5 -5
- package/dist/cjs/ez-card-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +11 -9
- package/dist/cjs/ez-chip.cjs.entry.js +17 -7
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +85 -7
- package/dist/cjs/ez-combo-box.cjs.entry.js +51 -20
- package/dist/cjs/ez-date-input.cjs.entry.js +13 -18
- package/dist/cjs/ez-date-time-input.cjs.entry.js +12 -17
- package/dist/cjs/ez-dialog.cjs.entry.js +43 -8
- package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +99 -486
- package/dist/cjs/ez-grid-config.cjs.entry.js +8 -9
- package/dist/cjs/ez-grid.cjs.entry.js +1073 -1168
- package/dist/cjs/ez-icon.cjs.entry.js +3 -3
- package/dist/cjs/ez-list.cjs.entry.js +2 -4
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +58 -0
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +4 -4
- package/dist/cjs/ez-popover.cjs.entry.js +6 -6
- package/dist/cjs/ez-popup.cjs.entry.js +8 -4
- package/dist/cjs/ez-radio-button.cjs.entry.js +3 -3
- package/dist/cjs/ez-scroller.cjs.entry.js +2 -2
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-select-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +8 -7
- package/dist/cjs/ez-text-area.cjs.entry.js +7 -7
- package/dist/cjs/ez-text-edit.cjs.entry.js +103 -0
- package/dist/cjs/ez-text-input.cjs.entry.js +14 -4
- package/dist/cjs/ez-time-input.cjs.entry.js +7 -7
- package/dist/cjs/ez-toast.cjs.entry.js +2 -2
- package/dist/cjs/ez-upload.cjs.entry.js +4 -4
- package/dist/cjs/ez-view-stack.cjs.entry.js +10 -7
- package/dist/cjs/ezui.cjs.js +4 -112
- package/dist/cjs/loader.cjs.js +2 -18
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/ez-actions-button/ez-actions-button.css +49 -20
- package/dist/collection/components/ez-actions-button/ez-actions-button.js +219 -23
- package/dist/collection/components/ez-button/ez-button.css +0 -6
- package/dist/collection/components/ez-button/ez-button.js +11 -9
- package/dist/collection/components/ez-calendar/ez-calendar.css +17 -20
- package/dist/collection/components/ez-check/CheckMode.js +5 -0
- package/dist/collection/components/ez-check/ez-check.css +23 -24
- package/dist/collection/components/ez-check/ez-check.js +10 -8
- package/dist/collection/components/ez-chip/ez-chip.css +4 -2
- package/dist/collection/components/ez-chip/ez-chip.js +16 -6
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +16 -0
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +226 -7
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +1 -22
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +51 -20
- package/dist/collection/components/ez-date-input/ez-date-input.js +8 -13
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +8 -13
- package/dist/collection/components/ez-dialog/DialogType.js +1 -0
- package/dist/collection/components/ez-dialog/ez-dialog.css +19 -25
- package/dist/collection/components/ez-dialog/ez-dialog.js +41 -6
- package/dist/collection/components/ez-form/DataBinder.js +1 -0
- package/dist/collection/components/ez-form/ez-form.js +22 -13
- package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +3 -3
- package/dist/collection/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.js +2 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +4 -4
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +25 -15
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +3 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +51 -15
- package/dist/collection/components/ez-grid/controller/ag-grid/components/cellRenderer.js +31 -0
- package/dist/collection/components/ez-grid/ez-grid.js +40 -3
- package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.css +38 -27
- package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.js +1 -2
- package/dist/collection/components/ez-grid/subcomponents/ez-select-box/ez-select-box.js +5 -4
- package/dist/collection/components/ez-list/ez-list.css +12 -4
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +38 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +190 -0
- package/dist/collection/components/ez-modal-container/index.js +2 -0
- package/dist/collection/components/ez-modal-container/modal-action.js +8 -0
- package/dist/collection/components/ez-modal-container/modal-button-status.js +7 -0
- package/dist/collection/components/ez-popover/ez-popover.css +1 -1
- package/dist/collection/components/ez-popup/ez-popup.css +6 -1
- package/dist/collection/components/ez-popup/ez-popup.js +26 -4
- package/dist/collection/components/ez-radio-button/ez-radio-button.css +16 -5
- package/dist/collection/components/ez-radio-button/ez-radio-button.js +1 -1
- package/dist/collection/components/ez-scroller/ez-scroller.css +3 -2
- package/dist/collection/components/ez-search/ez-search.js +6 -6
- package/dist/collection/components/ez-tabselector/ez-tabselector.css +10 -1
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +7 -3
- package/dist/collection/components/ez-text-area/ez-text-area.css +6 -3
- package/dist/collection/components/ez-text-area/ez-text-area.js +5 -5
- package/dist/collection/components/ez-text-edit/ez-text-edit.css +19 -0
- package/dist/collection/components/ez-text-edit/ez-text-edit.js +188 -0
- package/dist/collection/components/ez-text-input/ez-text-input.css +18 -2
- package/dist/collection/components/ez-text-input/ez-text-input.js +28 -0
- package/dist/collection/components/ez-toast/ez-toast.css +1 -1
- package/dist/collection/components/ez-upload/ez-upload.css +1 -1
- package/dist/collection/components/ez-view-stack/ez-view-stack.js +12 -6
- package/dist/collection/utils/ApplicationUtils.js +3 -0
- package/dist/collection/utils/index.js +1 -0
- package/dist/custom-elements/index.d.ts +12 -0
- package/dist/custom-elements/index.js +1595 -4005
- package/dist/{ezui/ApplicationUtils-30a69eb0.js → esm/ApplicationUtils-205ac4bc.js} +4 -2
- package/dist/esm/CheckMode-bdb2ec19.js +7 -0
- package/dist/esm/{DialogType-72afa679.js → DialogType-4059dc4d.js} +1 -0
- package/dist/esm/ez-actions-button.entry.js +68 -17
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +13 -11
- package/dist/esm/ez-calendar.entry.js +3 -3
- package/dist/esm/ez-card-item.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +11 -9
- package/dist/esm/ez-chip.entry.js +17 -7
- package/dist/esm/ez-collapsible-box.entry.js +85 -7
- package/dist/esm/ez-combo-box.entry.js +48 -17
- package/dist/esm/ez-date-input.entry.js +10 -15
- package/dist/esm/ez-date-time-input.entry.js +10 -15
- package/dist/esm/ez-dialog.entry.js +43 -8
- package/dist/esm/ez-filter-input.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +65 -452
- package/dist/esm/ez-grid-config.entry.js +6 -7
- package/dist/esm/ez-grid.entry.js +1039 -1134
- package/dist/esm/ez-icon.entry.js +2 -2
- package/dist/esm/ez-list.entry.js +2 -4
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +54 -0
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +2 -2
- package/dist/esm/ez-popover.entry.js +3 -3
- package/dist/esm/ez-popup.entry.js +8 -4
- package/dist/esm/ez-radio-button.entry.js +3 -3
- package/dist/esm/ez-scroller.entry.js +2 -2
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-select-box.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +8 -7
- package/dist/esm/ez-text-area.entry.js +7 -7
- package/dist/esm/ez-text-edit.entry.js +99 -0
- package/dist/esm/ez-text-input.entry.js +13 -3
- package/dist/esm/ez-time-input.entry.js +2 -2
- package/dist/esm/ez-toast.entry.js +2 -2
- package/dist/esm/ez-upload.entry.js +4 -4
- package/dist/esm/ez-view-stack.entry.js +10 -7
- package/dist/esm/ezui.js +4 -112
- package/dist/esm/loader.js +2 -18
- package/dist/ezui/ezui.esm.js +1 -125
- package/dist/ezui/index.esm.js +0 -1
- package/dist/ezui/p-04a41a44.entry.js +1 -0
- package/dist/ezui/p-0b44cf1c.js +1 -0
- package/dist/ezui/p-0c7203d5.entry.js +1 -0
- package/dist/ezui/p-2213da1f.entry.js +1 -0
- package/dist/ezui/p-2c6398b3.entry.js +1 -0
- package/dist/ezui/p-2ccad880.entry.js +1 -0
- package/dist/ezui/p-333d79c4.entry.js +1 -0
- package/dist/ezui/p-3987f8d8.entry.js +1 -0
- package/dist/ezui/{p-81eb2738.entry.js → p-42c6493e.entry.js} +1 -1
- package/dist/ezui/{p-b4ad3b15.entry.js → p-482c3dd8.entry.js} +1 -1
- package/dist/ezui/p-5bdb1a41.entry.js +1 -0
- package/dist/ezui/{p-b2cf7db2.entry.js → p-63d567cc.entry.js} +1 -1
- package/dist/ezui/p-659616e4.entry.js +1 -0
- package/dist/ezui/p-6608b9a5.entry.js +1 -0
- package/dist/ezui/p-77ec47ac.entry.js +1 -0
- package/dist/ezui/p-9b9ebf95.entry.js +1 -0
- package/dist/ezui/{p-88bfdea4.entry.js → p-ae5af8f9.entry.js} +1 -1
- package/dist/ezui/p-b853763b.js +1 -0
- package/dist/ezui/p-be06251d.entry.js +1 -0
- package/dist/ezui/{p-e7d03a0d.entry.js → p-bffae598.entry.js} +1 -1
- package/dist/ezui/p-cd4677d4.entry.js +1 -0
- package/dist/ezui/p-cfcc23e6.entry.js +1 -0
- package/dist/ezui/p-dfcf55e0.entry.js +1 -0
- package/dist/ezui/p-e1148f5c.js +1 -0
- package/dist/ezui/p-e1f2b5da.entry.js +1 -0
- package/dist/ezui/p-e230bfd2.entry.js +1 -0
- package/dist/ezui/{p-867aac16.entry.js → p-e3ee814c.entry.js} +1 -1
- package/dist/ezui/p-e697ffd5.entry.js +1 -0
- package/dist/ezui/{p-4eb273f8.entry.js → p-efa32bcc.entry.js} +1 -1
- package/dist/types/components/ez-actions-button/ez-actions-button.d.ts +42 -9
- package/dist/types/components/ez-check/CheckMode.d.ts +4 -0
- package/dist/types/components/ez-chip/ez-chip.d.ts +2 -1
- package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +46 -1
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +15 -5
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +0 -1
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +0 -1
- package/dist/types/components/ez-dialog/DialogType.d.ts +1 -0
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +3 -0
- package/dist/types/components/ez-form/DataBinder.d.ts +2 -2
- package/dist/types/components/ez-form/ez-form.d.ts +21 -11
- package/dist/types/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.d.ts +3 -3
- package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +4 -2
- package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +2 -5
- package/dist/types/components/ez-form/structure/FormSheetMetadata.d.ts +3 -3
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +4 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/cellRenderer.d.ts +9 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +8 -3
- package/dist/types/components/ez-grid/subcomponents/ez-select-box/ez-select-box.d.ts +2 -6
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +47 -0
- package/dist/types/components/ez-modal-container/index.d.ts +2 -0
- package/dist/types/components/ez-modal-container/modal-action.d.ts +7 -0
- package/dist/types/components/ez-modal-container/modal-button-status.d.ts +6 -0
- package/dist/types/components/ez-popup/ez-popup.d.ts +4 -0
- package/dist/types/components/ez-search/ez-search.d.ts +3 -3
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +2 -0
- package/dist/types/components/ez-text-edit/ez-text-edit.d.ts +39 -0
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +5 -0
- package/dist/types/components/ez-view-stack/ez-view-stack.d.ts +5 -1
- package/dist/types/components.d.ts +274 -28
- package/dist/types/utils/ApplicationUtils.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +5 -5
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/ApplicationUtils-475b50d9.js +0 -63
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/css-shim-3bfdba4f.js +0 -6
- package/dist/cjs/dom-8ac1ad03.js +0 -75
- package/dist/cjs/index-2ec1da82.js +0 -2307
- package/dist/cjs/index-55178184.js +0 -6
- package/dist/cjs/index-d9c5cb88.js +0 -3068
- package/dist/cjs/shadow-css-41d9783d.js +0 -390
- package/dist/esm/ApplicationUtils-30a69eb0.js +0 -61
- package/dist/esm/ApplicationUtils-a4a76132.js +0 -60
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/css-shim-20dbffa5.js +0 -4
- package/dist/esm/dom-c5ed0ba5.js +0 -73
- package/dist/esm/index-1e9d524f.js +0 -3031
- package/dist/esm/index-b96183c8.js +0 -2295
- package/dist/esm/index-f32470b5.js +0 -3
- package/dist/esm/shadow-css-8c625855.js +0 -388
- package/dist/ezui/CSSVarsUtils-00f67f32.js +0 -70
- package/dist/ezui/DialogType-72afa679.js +0 -8
- package/dist/ezui/app-globals-0f993ce5.js +0 -3
- package/dist/ezui/css-shim-20dbffa5.js +0 -4
- package/dist/ezui/dom-c5ed0ba5.js +0 -73
- package/dist/ezui/ez-actions-button.entry.js +0 -98
- package/dist/ezui/ez-application.entry.js +0 -22
- package/dist/ezui/ez-button.entry.js +0 -73
- package/dist/ezui/ez-calendar.entry.js +0 -219
- package/dist/ezui/ez-card-item.entry.js +0 -40
- package/dist/ezui/ez-check.entry.js +0 -72
- package/dist/ezui/ez-chip.entry.js +0 -97
- package/dist/ezui/ez-collapsible-box.entry.js +0 -57
- package/dist/ezui/ez-combo-box.entry.js +0 -439
- package/dist/ezui/ez-date-input.entry.js +0 -159
- package/dist/ezui/ez-date-time-input.entry.js +0 -214
- package/dist/ezui/ez-dialog.entry.js +0 -108
- package/dist/ezui/ez-filter-input.entry.js +0 -75
- package/dist/ezui/ez-form.entry.js +0 -1395
- package/dist/ezui/ez-grid-config.entry.js +0 -433
- package/dist/ezui/ez-grid.entry.js +0 -115419
- package/dist/ezui/ez-icon.entry.js +0 -37
- package/dist/ezui/ez-list.entry.js +0 -516
- package/dist/ezui/ez-loading-bar.entry.js +0 -24
- package/dist/ezui/ez-modal.entry.js +0 -67
- package/dist/ezui/ez-number-input.entry.js +0 -148
- package/dist/ezui/ez-popover.entry.js +0 -141
- package/dist/ezui/ez-popup.entry.js +0 -49
- package/dist/ezui/ez-radio-button.entry.js +0 -45
- package/dist/ezui/ez-scroller.entry.js +0 -101
- package/dist/ezui/ez-search.entry.js +0 -83
- package/dist/ezui/ez-select-box.entry.js +0 -18
- package/dist/ezui/ez-tabselector.entry.js +0 -195
- package/dist/ezui/ez-text-area.entry.js +0 -158
- package/dist/ezui/ez-text-input.entry.js +0 -235
- package/dist/ezui/ez-time-input.entry.js +0 -164
- package/dist/ezui/ez-toast.entry.js +0 -84
- package/dist/ezui/ez-upload.entry.js +0 -379
- package/dist/ezui/ez-view-stack.entry.js +0 -74
- package/dist/ezui/index-1e9d524f.js +0 -3031
- package/dist/ezui/index-b96183c8.js +0 -2295
- package/dist/ezui/index-f32470b5.js +0 -3
- package/dist/ezui/p-2f02347d.entry.js +0 -1
- package/dist/ezui/p-416bedbe.entry.js +0 -1
- package/dist/ezui/p-544f0c63.entry.js +0 -1
- package/dist/ezui/p-62110996.entry.js +0 -1
- package/dist/ezui/p-719e9ef9.entry.js +0 -1
- package/dist/ezui/p-787fbdfe.js +0 -1
- package/dist/ezui/p-9d5be6a7.entry.js +0 -1
- package/dist/ezui/p-a27dafa4.entry.js +0 -1
- package/dist/ezui/p-aba3fa6c.entry.js +0 -1
- package/dist/ezui/p-adbe4188.js +0 -1
- package/dist/ezui/p-af43be42.entry.js +0 -1
- package/dist/ezui/p-b7467ad6.entry.js +0 -1
- package/dist/ezui/p-c019e137.entry.js +0 -1
- package/dist/ezui/p-c9d2060e.entry.js +0 -1
- package/dist/ezui/p-cccd8cde.entry.js +0 -1
- package/dist/ezui/p-d0671e14.entry.js +0 -1
- package/dist/ezui/p-e0f06d73.entry.js +0 -1
- package/dist/ezui/p-e59adce6.entry.js +0 -1
- package/dist/ezui/p-ed835b36.entry.js +0 -1
- package/dist/ezui/shadow-css-8c625855.js +0 -388
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, e as createEvent, h, f as Host, g as getElement } from './index-1e9d524f.js';
|
|
2
|
-
|
|
3
|
-
const ezTabselectorCss = "@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}:host{display:flex;position:relative;width:100%;overflow:hidden;--tabselector--backward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--tabselector--forward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>')}.scroll{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.scroll.startHidden{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px)}.scroll.middle{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px))}.scroll.endHidden{-webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab{display:flex;border:none;min-width:100px;background-color:unset;cursor:pointer;padding:6px 12px;align-items:center;justify-content:center;color:var(--text--primary, #626e82);font-family:var(--font-pattern, \"Sora, Algerian\");font-size:var(--title--small, 14px)}.tab:focus,.forward-button,.backward-button{outline:none}.is-active{position:relative;color:var(--color--primary, #008561)}.is-active::after{content:\"\";position:absolute;width:100%;height:100%;background-color:var(--color--primary, #008561);clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out}.is-focused{border:1px dashed var(--color--primary, #000000c5)}.tab-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--text-shadow);margin-bottom:var(--space--extra-small, 3px)}.forward-button,.backward-button{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.backward-button{left:0px}.forward-button::after,.backward-button::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:10px;height:16px}.forward-button::after{-webkit-mask-image:var(--tabselector--forward-icon);mask-image:var(--tabselector--forward-icon)}.backward-button::after{-webkit-mask-image:var(--tabselector--backward-icon);mask-image:var(--tabselector--backward-icon)}.forward-button:hover::after,.backward-button:hover::after{background-color:var(--color--primary, #4e4e4e)}.hidden{display:none}.scroll::-webkit-scrollbar{display:none}";
|
|
4
|
-
|
|
5
|
-
let EzTabselector = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.ezChange = createEvent(this, "ezChange", 7);
|
|
9
|
-
this.setFocusedParam = (ev) => {
|
|
10
|
-
if (ev.key === "Enter") {
|
|
11
|
-
const selectedTab = this._processedTabs[this._focusedIndex];
|
|
12
|
-
this.handleTabClick(selectedTab);
|
|
13
|
-
ev.preventDefault();
|
|
14
|
-
this.setFocusedTab(selectedTab.index);
|
|
15
|
-
}
|
|
16
|
-
else if (ev.key === "ArrowLeft" || ev.key === "ArrowRight") {
|
|
17
|
-
let operator = undefined;
|
|
18
|
-
if (ev.key === "ArrowLeft") {
|
|
19
|
-
operator = false;
|
|
20
|
-
}
|
|
21
|
-
else if (ev.key === "ArrowRight") {
|
|
22
|
-
operator = true;
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
if (this._focusedIndex === undefined) {
|
|
28
|
-
if (operator === false) {
|
|
29
|
-
this._focusedIndex = this.selectedIndex !== undefined ? this.selectedIndex - 1 : undefined;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
this._focusedIndex = this.selectedIndex !== undefined ? this.selectedIndex + 1 : undefined;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
if (operator === false) {
|
|
37
|
-
this._focusedIndex = this._focusedIndex - 1;
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
this._focusedIndex = this._focusedIndex + 1;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
if (this._focusedIndex < 0) {
|
|
44
|
-
this._focusedIndex = 0;
|
|
45
|
-
}
|
|
46
|
-
else if (this._focusedIndex > this._processedTabs.length - 1) {
|
|
47
|
-
this._focusedIndex = this._processedTabs.length - 1;
|
|
48
|
-
}
|
|
49
|
-
this.setFocusedBtn(true, this._focusedIndex);
|
|
50
|
-
this.setFocusedTab(this._focusedIndex);
|
|
51
|
-
}
|
|
52
|
-
else if (ev.key === "Tab" || ev.key === "Escape") {
|
|
53
|
-
const currentTab = this._processedTabs[this.selectedIndex];
|
|
54
|
-
this._focusedIndex = undefined;
|
|
55
|
-
this.handleTabClick(currentTab);
|
|
56
|
-
ev.preventDefault();
|
|
57
|
-
this.setFocusedTab(this.selectedIndex);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
handleTabClick(tab) {
|
|
62
|
-
this.selectedIndex = tab.index;
|
|
63
|
-
this._focusedIndex = undefined;
|
|
64
|
-
this.selectedTab = tab.tabKey;
|
|
65
|
-
this.ezChange.emit(tab);
|
|
66
|
-
this.setFocusedBtn(false, tab.index);
|
|
67
|
-
}
|
|
68
|
-
componentWillRender() {
|
|
69
|
-
if (!this._processedTabs) {
|
|
70
|
-
this._processedTabs = [];
|
|
71
|
-
if (this.tabs) {
|
|
72
|
-
this.tabs.split(",").forEach((label) => {
|
|
73
|
-
label = label.trim();
|
|
74
|
-
this._processedTabs.push({ label, tabKey: label, index: this._processedTabs.length });
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
this._hostElem.querySelectorAll("ez-tab").forEach((elem) => {
|
|
78
|
-
const tabKey = elem.getAttribute("tabKey");
|
|
79
|
-
const label = elem.getAttribute("label");
|
|
80
|
-
const t = { label, tabKey, index: this._processedTabs.length };
|
|
81
|
-
const content = elem.firstChild;
|
|
82
|
-
if (content) {
|
|
83
|
-
content.setAttribute("slot", "tab" + t.index);
|
|
84
|
-
this._hostElem.appendChild(content);
|
|
85
|
-
}
|
|
86
|
-
this._processedTabs.push(t);
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
handleSlotChange(ev) {
|
|
91
|
-
const slot = ev.target;
|
|
92
|
-
const content = slot.assignedElements()[0];
|
|
93
|
-
if (content) {
|
|
94
|
-
content.style.marginLeft = "6px";
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
scrollBackward() {
|
|
98
|
-
const container = this._scrollContainer;
|
|
99
|
-
if (container) {
|
|
100
|
-
container.scrollLeft -= container.clientWidth;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
scrollFoward() {
|
|
104
|
-
const container = this._scrollContainer;
|
|
105
|
-
if (container) {
|
|
106
|
-
let lastTab = null;
|
|
107
|
-
container.querySelectorAll(".tab").forEach((tab) => {
|
|
108
|
-
if (tab.getBoundingClientRect().right < container.clientWidth) {
|
|
109
|
-
lastTab = tab;
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
container.scrollLeft = lastTab.offsetLeft + lastTab.offsetWidth;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
componentDidRender() {
|
|
116
|
-
this.updateScroll();
|
|
117
|
-
}
|
|
118
|
-
updateScroll() {
|
|
119
|
-
const container = this._scrollContainer;
|
|
120
|
-
if (container) {
|
|
121
|
-
const { scrollWidth, clientWidth, scrollLeft } = container;
|
|
122
|
-
const remainingScroll = scrollWidth - clientWidth - Math.ceil(scrollLeft);
|
|
123
|
-
this._startHidden = container.scrollLeft > 0;
|
|
124
|
-
this._endHidden = remainingScroll > 0;
|
|
125
|
-
if (this._startHidden) {
|
|
126
|
-
this._backwardButton.classList.remove("hidden");
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
this._backwardButton.classList.add("hidden");
|
|
130
|
-
}
|
|
131
|
-
if (this._endHidden) {
|
|
132
|
-
this._forwardButton.classList.remove("hidden");
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
this._forwardButton.classList.add("hidden");
|
|
136
|
-
}
|
|
137
|
-
const classNames = ["", "startHidden", "endHidden", "middle"];
|
|
138
|
-
const currentClass = classNames[Number(this._startHidden) | Number(this._endHidden) << 1];
|
|
139
|
-
classNames.forEach((name) => {
|
|
140
|
-
if (name !== currentClass && container.classList.contains(name)) {
|
|
141
|
-
container.classList.remove(name);
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
if (currentClass && !container.classList.contains(currentClass)) {
|
|
145
|
-
container.classList.add(currentClass);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
domScrollHandler() {
|
|
150
|
-
window.clearTimeout(this._scrollCallBack);
|
|
151
|
-
this._scrollCallBack = window.setTimeout(() => { this.updateScroll(); }, 200);
|
|
152
|
-
}
|
|
153
|
-
setFocusedTab(index) {
|
|
154
|
-
window.clearTimeout(this._scrollCallBackTest);
|
|
155
|
-
this._scrollCallBackTest = window.setTimeout(() => {
|
|
156
|
-
const tabtoscroll = this._scrollContainer.querySelector(`#tab${index}`);
|
|
157
|
-
tabtoscroll.scrollIntoView();
|
|
158
|
-
}, 200);
|
|
159
|
-
}
|
|
160
|
-
getTextWidth(text) {
|
|
161
|
-
if (this._textMesurement === undefined) {
|
|
162
|
-
this._textMesurement = this._hostElem.shadowRoot.ownerDocument.createElement("canvas");
|
|
163
|
-
}
|
|
164
|
-
const context = this._textMesurement.getContext("2d");
|
|
165
|
-
context.font = "14px Sora, Algerian";
|
|
166
|
-
return Math.min(220, 24 + context.measureText(text).width) + "px";
|
|
167
|
-
}
|
|
168
|
-
;
|
|
169
|
-
setFocusedBtn(visible, parameter) {
|
|
170
|
-
const tabsButtons = this._scrollContainer.querySelectorAll(".tab");
|
|
171
|
-
tabsButtons.forEach((el) => {
|
|
172
|
-
el.classList.remove("is-focused");
|
|
173
|
-
if (el.id === "tab" + parameter && visible) {
|
|
174
|
-
el.classList.add("is-focused");
|
|
175
|
-
}
|
|
176
|
-
;
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
render() {
|
|
180
|
-
return (h(Host, null, h("button", { class: "backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }), h("div", { class: "scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.setFocusedParam(ev) }, this._processedTabs.map((tab, index) => {
|
|
181
|
-
const labelStyle = { "min-width": this.getTextWidth(tab.label) };
|
|
182
|
-
const tabId = "tab" + index;
|
|
183
|
-
const isSelected = index === this.selectedIndex || (this.selectedTab && tab.tabKey === this.selectedTab);
|
|
184
|
-
if (isSelected) {
|
|
185
|
-
this.selectedTab = tab.tabKey;
|
|
186
|
-
this.selectedIndex = index;
|
|
187
|
-
}
|
|
188
|
-
return h("button", { id: tabId, class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab), style: labelStyle }, h("span", { class: "tab-label", title: tab.label }, tab.label), h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } }));
|
|
189
|
-
})), h("button", { class: "forward-button", ref: (el) => this._forwardButton = el, onClick: () => this.scrollFoward() })));
|
|
190
|
-
}
|
|
191
|
-
get _hostElem() { return getElement(this); }
|
|
192
|
-
};
|
|
193
|
-
EzTabselector.style = ezTabselectorCss;
|
|
194
|
-
|
|
195
|
-
export { EzTabselector as ez_tabselector };
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, e as createEvent, h, f as Host, g as getElement } from './index-1e9d524f.js';
|
|
2
|
-
|
|
3
|
-
const ezTextAreaCss = ":host{--text-area--width:100%;--text-area--border-radius:var(--border--radius-medium, 12px);--text-area--font-size:var(--text--medium, 14px);--text-area--font-family:var(--font-pattern, Arial);--text-area--font-weight:var(--text-weight--medium, 400);--text-area--color:var(--title--primary, #000);--text-area__input--background-color:var(--background--medium, #e0e0e0);--text-area__input--border:var(--border--medium, 2px solid);--text-area__input--border-color:var(--text-area__input--background-color);--text-area__input--focus--border-color:var(--color--primary, #008561);--text-area__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--text-area__input--disabled--color:var(--text--disable, #AFB6C0);--text-area__input--error--border-color:#CC2936;--text-area__message_box--font-size:var(--text--small, 12px);--text-area__message_box--info--color:var(--color--success, #22085d);--text-area__message_box--error--color:var(--color--error, #FF0000);--text-area__label--floating--top:6px;--text-area__label--padding-top:12px;--text-area__label--padding-left:14px;--text-area__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--text-area--width)}textarea{box-sizing:border-box;border:none;resize:none;margin-top:calc(var(--space--medium, 12px) + 4px);width:100%;font-weight:var(--text-area--font-weight);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);color:var(--text-area--color);padding:0;background:none}textarea:focus{outline:none}textarea:disabled{background-color:transparent;color:var(--text-area__input--disabled--color)}.textarea{width:100%;box-sizing:border-box;padding-left:var(--space--medium);padding-right:var(--space--extra-small);border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--border-color);background-color:var(--text-area__input--background-color)}.textarea--focus{border-color:var(--text-area__input--focus--border-color)}.textarea.hasError{color:var(--text-area--color);border-color:var(--text-area__input--error--border-color)}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--text-area--font-family);font-size:var(--text-area__message_box--font-size);color:var(--text-area__message_box--info--color)}.hasError{color:var(--text-area__message_box--error--color)}.textarea__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--text-area__label--padding-right));left:var(--text-area--space--medium);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color);top:var(--text-area__label--padding-top);left:var(--text-area__label--padding-left);padding-right:var(--text-area__label--padding-right)}.textarea__label--floated{font-family:var(--text-area--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--text-area__label--floating--top)}.textarea__label--disabled{color:var(--text-area__input--disabled--color)}.textarea--slim{margin-top:var(--space--small, 6px)}.textarea--slim::-webkit-input-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:-moz-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim::-moz-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:-ms-input-placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim::placeholder{font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color)}.textarea--slim:disabled::-webkit-input-placeholder{color:var(--text-area__input--disabled--color)}.textarea--slim:disabled:-moz-placeholder{color:var(--text-area__input--disabled--color)}.textarea--slim:disabled::-moz-placeholder{color:var(--text-area__input--disabled--color)}.textarea--slim:disabled:-ms-input-placeholder{color:var(--text-area__input--disabled--color)}.textarea--slim:disabled::placeholder{color:var(--text-area__input--disabled--color)}";
|
|
4
|
-
|
|
5
|
-
let EzTextArea = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.ezChange = createEvent(this, "ezChange", 7);
|
|
9
|
-
/**
|
|
10
|
-
* Deixa o campo disponível ou não para digitação.
|
|
11
|
-
*/
|
|
12
|
-
this.enabled = true;
|
|
13
|
-
/**
|
|
14
|
-
* Ajusta o número de linhas e consequentemente o height do textarea. Valor default: 4
|
|
15
|
-
*/
|
|
16
|
-
this.rows = 4;
|
|
17
|
-
/**
|
|
18
|
-
* Permite exibir a mensagem de erro.
|
|
19
|
-
*/
|
|
20
|
-
this.canShowError = true;
|
|
21
|
-
/**
|
|
22
|
-
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
23
|
-
*/
|
|
24
|
-
this.mode = "regular";
|
|
25
|
-
}
|
|
26
|
-
observeErrorMessage() {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
const hasError = typeof this.errorMessage === 'string' && this.errorMessage !== '';
|
|
29
|
-
if (hasError) {
|
|
30
|
-
this._container.classList.add('hasError');
|
|
31
|
-
(_a = this._messageBoxElem) === null || _a === void 0 ? void 0 : _a.classList.add('hasError');
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
this._container.classList.remove('hasError');
|
|
35
|
-
(_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove('hasError');
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
observeValue(newValue, oldValue) {
|
|
39
|
-
if (this._inputElem) {
|
|
40
|
-
if (newValue != oldValue) {
|
|
41
|
-
if (this.canChangeValue()) {
|
|
42
|
-
this._inputElem.value = this.value || "";
|
|
43
|
-
}
|
|
44
|
-
this.adjustFloatingLabel();
|
|
45
|
-
this.errorMessage = "";
|
|
46
|
-
this.ezChange.emit(this.value);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
observeMode() {
|
|
51
|
-
if (this._initialRows == undefined) {
|
|
52
|
-
this._initialRows = this.rows > 0 ? this.rows : undefined;
|
|
53
|
-
}
|
|
54
|
-
const rows = this._initialRows > 0 ? this._initialRows : this.mode != "slim" ? 4 : 2;
|
|
55
|
-
if (rows !== this.rows) {
|
|
56
|
-
this.rows = rows;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
observeRows() {
|
|
60
|
-
const rows = this.rows > 0 ? this.rows : this.mode != "slim" ? 4 : 2;
|
|
61
|
-
if (rows !== this.rows) {
|
|
62
|
-
this.rows = rows;
|
|
63
|
-
this._initialRows = rows;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
//---------------------------------------------
|
|
67
|
-
// Public methods
|
|
68
|
-
//---------------------------------------------
|
|
69
|
-
/**
|
|
70
|
-
* Faz o foco no componente de input
|
|
71
|
-
*/
|
|
72
|
-
async setFocus() {
|
|
73
|
-
this._inputElem.focus();
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Remove o foco no componente de input
|
|
77
|
-
*/
|
|
78
|
-
async setBlur() {
|
|
79
|
-
this._inputElem.blur();
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Retorna informando se o campo está inválido (true | false)
|
|
83
|
-
*/
|
|
84
|
-
async isInvalid() {
|
|
85
|
-
return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
|
|
86
|
-
}
|
|
87
|
-
//---------------------------------------------
|
|
88
|
-
// Private methods
|
|
89
|
-
//---------------------------------------------
|
|
90
|
-
canChangeValue() {
|
|
91
|
-
return this._inputElem && (this.value || "") !== this._inputElem.value;
|
|
92
|
-
}
|
|
93
|
-
adjustFloatingLabel() {
|
|
94
|
-
if (this.label && this._labelElem) {
|
|
95
|
-
const hasValue = this.value && this.value.toString().length > 0;
|
|
96
|
-
const containsFloatedClass = this._labelElem.classList.contains("textarea__label--floated");
|
|
97
|
-
if (hasValue || this.isFocused()) {
|
|
98
|
-
if (!containsFloatedClass) {
|
|
99
|
-
this._labelElem.classList.add("textarea__label--floated");
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
if (containsFloatedClass) {
|
|
104
|
-
this._labelElem.classList.remove("textarea__label--floated");
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
isFocused() {
|
|
110
|
-
return this._hostElement.shadowRoot.activeElement !== null;
|
|
111
|
-
}
|
|
112
|
-
//---------------------------------------------
|
|
113
|
-
// Event handlers
|
|
114
|
-
//---------------------------------------------
|
|
115
|
-
handleFocusout() {
|
|
116
|
-
this.adjustFloatingLabel();
|
|
117
|
-
if (this._container && this._container.classList.contains("textarea--focus")) {
|
|
118
|
-
this._container.classList.remove("textarea--focus");
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
handleChange() {
|
|
122
|
-
if (this.canChangeValue()) {
|
|
123
|
-
this.value = this._inputElem.value;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
handleFocus() {
|
|
127
|
-
if (this.label && this._labelElem && !this._labelElem.classList.contains("textarea__label--floated")) {
|
|
128
|
-
this._labelElem.classList.add("textarea__label--floated");
|
|
129
|
-
}
|
|
130
|
-
if (this._container && !this._container.classList.contains("textarea--focus")) {
|
|
131
|
-
this._container.classList.add("textarea--focus");
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
//---------------------------------------------
|
|
135
|
-
// Lifecycle web component
|
|
136
|
-
//---------------------------------------------
|
|
137
|
-
componentDidLoad() {
|
|
138
|
-
this.observeErrorMessage();
|
|
139
|
-
this.adjustFloatingLabel();
|
|
140
|
-
this.observeMode();
|
|
141
|
-
}
|
|
142
|
-
render() {
|
|
143
|
-
return (h(Host, null, h("div", { class: "textarea", ref: (el) => this._container = el }, this.label && this.mode != "slim" ?
|
|
144
|
-
h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "textarea__label" : "textarea__label textarea__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
145
|
-
: null, h("textarea", { onFocus: () => this.handleFocus(), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, class: this.mode === "slim" ? "textarea--slim" : "", placeholder: this.mode === "slim" && this.label ? this.label : "", onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, onKeyDown: event => event.stopPropagation(), rows: this.rows })), this.canShowError && this.mode != "slim" &&
|
|
146
|
-
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
147
|
-
}
|
|
148
|
-
get _hostElement() { return getElement(this); }
|
|
149
|
-
static get watchers() { return {
|
|
150
|
-
"errorMessage": ["observeErrorMessage"],
|
|
151
|
-
"value": ["observeValue"],
|
|
152
|
-
"mode": ["observeMode"],
|
|
153
|
-
"rows": ["observeRows"]
|
|
154
|
-
}; }
|
|
155
|
-
};
|
|
156
|
-
EzTextArea.style = ezTextAreaCss;
|
|
157
|
-
|
|
158
|
-
export { EzTextArea as ez_text_area };
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, e as createEvent, h, f as Host, g as getElement } from './index-1e9d524f.js';
|
|
2
|
-
import { M as MaskFormatter } from './index-b96183c8.js';
|
|
3
|
-
|
|
4
|
-
const ezTextInputCss = ":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--ez-text-input--height--slim:32px;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #2B3A54);--ez-text-input__input--background-color:var(--background--medium, #e0e0e0);--ez-text-input__input--border:var(--border--medium, 2px solid);--ez-text-input__input--border-color:var(--ez-text-input__input--background-color);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-text-input__input--disabled--color:var(--text--disable, #AFB6C0);--ez-text-input__input--error--border-color:#CC2936;--ez-text-input__message_box--font-size:var(--text--small, 12px);--ez-text-input__message_box--info--color:var(--color--success, #22085d);--ez-text-input__message_box--error--color:var(--color--error, #FF0000);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width)}input{width:100%;box-sizing:border-box;padding:var(--space--medium, 6px);height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color);font-weight:var(--ez-text-input--font-weight)}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color)}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color)}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:read-only{cursor:default}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input__message_box--font-size);color:var(--ez-text-input__message_box--info--color)}.hasError{color:var(--ez-text-input__message_box--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color)}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}.input--slim{padding-top:var(--space--small, 3px);padding-bottom:var(--space--small, 3px);height:var(--ez-text-input--height--slim)}.input--slim::-webkit-input-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:-moz-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim::-moz-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:-ms-input-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim::placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:disabled::-webkit-input-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled:-moz-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled::-moz-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled:-ms-input-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled::placeholder{color:var(--ez-text-input__input--disabled--color)}";
|
|
5
|
-
|
|
6
|
-
let EzTextInput = class {
|
|
7
|
-
constructor(hostRef) {
|
|
8
|
-
registerInstance(this, hostRef);
|
|
9
|
-
this.ezChange = createEvent(this, "ezChange", 7);
|
|
10
|
-
/**
|
|
11
|
-
* Deixa o campo disponível ou não para digitação.
|
|
12
|
-
*/
|
|
13
|
-
this.enabled = true;
|
|
14
|
-
/**
|
|
15
|
-
* Permite exibir a mensagem de erro.
|
|
16
|
-
*/
|
|
17
|
-
this.canShowError = true;
|
|
18
|
-
/**
|
|
19
|
-
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
20
|
-
*/
|
|
21
|
-
this.mode = "regular";
|
|
22
|
-
}
|
|
23
|
-
observeErrorMessage() {
|
|
24
|
-
if (this._inputElem) {
|
|
25
|
-
this.isInvalid().then((hasError) => {
|
|
26
|
-
var _a, _b;
|
|
27
|
-
if (hasError) {
|
|
28
|
-
this._inputElem.classList.add("hasError");
|
|
29
|
-
(_a = this._messageBoxElem) === null || _a === void 0 ? void 0 : _a.classList.add("hasError");
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
this._inputElem.classList.remove("hasError");
|
|
33
|
-
(_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove("hasError");
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
observeMask() {
|
|
39
|
-
if (this.mask) {
|
|
40
|
-
if (this._maskFormatter == undefined) {
|
|
41
|
-
this._maskFormatter = new MaskFormatter(this.mask);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
this._maskFormatter.mask = this.mask;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
observeValue(newValue, oldValue) {
|
|
49
|
-
if (this._inputElem) {
|
|
50
|
-
if (newValue != oldValue) {
|
|
51
|
-
this._inputElem.value = this.value || "";
|
|
52
|
-
this.handleChange();
|
|
53
|
-
this.adjustFloatingLabel();
|
|
54
|
-
if (!this.isSlaveMode()) {
|
|
55
|
-
this.errorMessage = "";
|
|
56
|
-
this.ezChange.emit(this.value);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
//---------------------------------------------
|
|
62
|
-
// Private methods
|
|
63
|
-
//---------------------------------------------
|
|
64
|
-
adjustFloatingLabel() {
|
|
65
|
-
if (this.label && this._labelElem) {
|
|
66
|
-
if (this._inputElem && !this._inputElem.classList.contains("input--with--label")) {
|
|
67
|
-
this._inputElem.classList.add("input--with--label");
|
|
68
|
-
}
|
|
69
|
-
const hasValue = this.value && this.value.toString().length > 0;
|
|
70
|
-
const containsFloatedClass = this._labelElem.classList.contains("input__label--floated");
|
|
71
|
-
if (hasValue || this.isFocused()) {
|
|
72
|
-
if (!containsFloatedClass) {
|
|
73
|
-
this._labelElem.classList.add("input__label--floated");
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
if (containsFloatedClass) {
|
|
78
|
-
this._labelElem.classList.remove("input__label--floated");
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
isFocused() {
|
|
84
|
-
return this._hostElement.shadowRoot.activeElement !== null;
|
|
85
|
-
}
|
|
86
|
-
isSlaveMode() {
|
|
87
|
-
var _a, _b;
|
|
88
|
-
return ((_b = (_a = this._hostElement) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.slaveMode) === "true";
|
|
89
|
-
}
|
|
90
|
-
adjustColorContentSlot(color = "") {
|
|
91
|
-
if (this._contentLeftSlot) {
|
|
92
|
-
this._contentLeftSlot.style.color = color;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
//---------------------------------------------
|
|
96
|
-
// Public methods
|
|
97
|
-
//---------------------------------------------
|
|
98
|
-
/**
|
|
99
|
-
* Faz o foco no componente de input
|
|
100
|
-
*/
|
|
101
|
-
async setFocus() {
|
|
102
|
-
this._inputElem.focus();
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Remove o foco no componente de input
|
|
106
|
-
*/
|
|
107
|
-
async setBlur() {
|
|
108
|
-
this._inputElem.blur();
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Retorna informando se o campo está inválido (true | false)
|
|
112
|
-
*/
|
|
113
|
-
async isInvalid() {
|
|
114
|
-
return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
|
|
115
|
-
}
|
|
116
|
-
//---------------------------------------------
|
|
117
|
-
// Event handlers
|
|
118
|
-
//---------------------------------------------
|
|
119
|
-
handleFocusout() {
|
|
120
|
-
const value = this._inputElem.value;
|
|
121
|
-
if (value && this._maskFormatter) {
|
|
122
|
-
try {
|
|
123
|
-
this._inputElem.value = this._maskFormatter.format(value);
|
|
124
|
-
}
|
|
125
|
-
catch (e) {
|
|
126
|
-
this.errorMessage = e.message;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
this.controlChangeValue();
|
|
130
|
-
this.adjustFloatingLabel();
|
|
131
|
-
this.adjustColorContentSlot();
|
|
132
|
-
}
|
|
133
|
-
isValidValue(value) {
|
|
134
|
-
if (this.restrict) {
|
|
135
|
-
return Array.from(value).reduce((valid, c) => valid && this.restrict.indexOf(c) > -1, true);
|
|
136
|
-
}
|
|
137
|
-
return true;
|
|
138
|
-
}
|
|
139
|
-
controlChangeValue() {
|
|
140
|
-
if (this._inputElem && (this.value || '') !== this._inputElem.value) {
|
|
141
|
-
this.value = this._inputElem.value;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
handleChange() {
|
|
145
|
-
if (!this._inputElem) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
const value = this._inputElem.value;
|
|
149
|
-
if (this.isValidValue(value)) {
|
|
150
|
-
this._lastValidValue = value;
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
this._inputElem.value = this._lastValidValue == undefined ? "" : this._lastValidValue;
|
|
154
|
-
}
|
|
155
|
-
this.controlChangeValue();
|
|
156
|
-
}
|
|
157
|
-
handleSlotChange(ev) {
|
|
158
|
-
const slot = ev.target;
|
|
159
|
-
const content = slot.assignedElements()[0];
|
|
160
|
-
if (content) {
|
|
161
|
-
content.style.position = "absolute";
|
|
162
|
-
content.style.display = "flex";
|
|
163
|
-
content.style.alignItems = "center";
|
|
164
|
-
content.style.justifyContent = "center";
|
|
165
|
-
content.style.overflow = "hidden";
|
|
166
|
-
content.style.top = "0px";
|
|
167
|
-
content.style.width = "var(--ez-text-input__icon--width)";
|
|
168
|
-
content.style.height = this.mode != "slim" ? "var(--ez-text-input--height)" : "var(--ez-text-input--height--slim)";
|
|
169
|
-
if (slot.name == "leftIcon") {
|
|
170
|
-
content.style.left = "0px";
|
|
171
|
-
content.style.borderRadius = "var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)";
|
|
172
|
-
this._inputElem.classList.add("icon--left");
|
|
173
|
-
if (this._labelElem) {
|
|
174
|
-
this._labelElem.classList.add("input__label--left");
|
|
175
|
-
}
|
|
176
|
-
this._contentLeftSlot = content;
|
|
177
|
-
}
|
|
178
|
-
else if (slot.name == "rightIcon") {
|
|
179
|
-
content.style.right = "0px";
|
|
180
|
-
content.style.borderRadius = "0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0";
|
|
181
|
-
this._inputElem.classList.add("icon--right");
|
|
182
|
-
if (this._labelElem) {
|
|
183
|
-
this._labelElem.classList.add("input__label--right");
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
this.observeErrorMessage();
|
|
188
|
-
}
|
|
189
|
-
doFocus() {
|
|
190
|
-
if (this.label && this._labelElem && !this._labelElem.classList.contains("input__label--floated")) {
|
|
191
|
-
this._labelElem.classList.add("input__label--floated");
|
|
192
|
-
}
|
|
193
|
-
this.adjustColorContentSlot("var(--ez-text-input__input--focus--border-color)");
|
|
194
|
-
}
|
|
195
|
-
//---------------------------------------------
|
|
196
|
-
// Lifecycle web component
|
|
197
|
-
//---------------------------------------------
|
|
198
|
-
componentDidLoad() {
|
|
199
|
-
this.observeErrorMessage();
|
|
200
|
-
this.observeMask();
|
|
201
|
-
this.adjustFloatingLabel();
|
|
202
|
-
}
|
|
203
|
-
componentWillLoad() {
|
|
204
|
-
this.observeMask();
|
|
205
|
-
if (this.value) {
|
|
206
|
-
if (this._maskFormatter) {
|
|
207
|
-
try {
|
|
208
|
-
this.value = this._maskFormatter.format(this.value);
|
|
209
|
-
}
|
|
210
|
-
catch (e) {
|
|
211
|
-
this.errorMessage = e.message;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
if (!this.isValidValue(this.value)) {
|
|
215
|
-
this._lastValidValue = "";
|
|
216
|
-
this.value = "";
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
render() {
|
|
221
|
-
return (h(Host, null, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label && this.mode != "slim" ?
|
|
222
|
-
h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "input__label" : "input__label input__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
223
|
-
: null, h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", class: this.mode === "slim" ? "input--slim" : "", placeholder: this.mode === "slim" && this.label ? this.label : "", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.canShowError && this.mode != "slim" &&
|
|
224
|
-
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
225
|
-
}
|
|
226
|
-
get _hostElement() { return getElement(this); }
|
|
227
|
-
static get watchers() { return {
|
|
228
|
-
"errorMessage": ["observeErrorMessage"],
|
|
229
|
-
"mask": ["observeMask"],
|
|
230
|
-
"value": ["observeValue"]
|
|
231
|
-
}; }
|
|
232
|
-
};
|
|
233
|
-
EzTextInput.style = ezTextInputCss;
|
|
234
|
-
|
|
235
|
-
export { EzTextInput as ez_text_input };
|