@limetech/lime-elements 40.23.0 → 40.24.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/CHANGELOG.md +12 -0
- package/dist/cjs/dom-BWMDM6En.js +32 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-3d-hover-effect-glow.cjs.entry.js +1 -1
- package/dist/cjs/limel-action-bar_3.cjs.entry.js +4 -5
- package/dist/cjs/limel-ai-avatar.cjs.entry.js +2 -3
- package/dist/cjs/limel-badge_7.cjs.entry.js +12 -12
- package/dist/cjs/limel-banner.cjs.entry.js +1 -1
- package/dist/cjs/limel-button-group.cjs.entry.js +1 -1
- package/dist/cjs/limel-button.cjs.entry.js +2 -2
- package/dist/cjs/limel-callout.cjs.entry.js +2 -3
- package/dist/cjs/limel-card.cjs.entry.js +1 -1
- package/dist/cjs/limel-chart.cjs.entry.js +5 -6
- package/dist/cjs/limel-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip-set.cjs.entry.js +2 -3
- package/dist/cjs/limel-chip_2.cjs.entry.js +2 -3
- package/dist/cjs/limel-circular-progress.cjs.entry.js +1 -1
- package/dist/cjs/limel-code-diff.cjs.entry.js +2 -3
- package/dist/cjs/limel-code-editor.cjs.entry.js +2 -3
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +2 -3
- package/dist/cjs/limel-color-picker-palette.cjs.entry.js +2 -2
- package/dist/cjs/limel-color-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-date-picker.cjs.entry.js +438 -27
- package/dist/cjs/limel-dialog.cjs.entry.js +2 -2
- package/dist/cjs/limel-dock.cjs.entry.js +3 -4
- package/dist/cjs/limel-drag-handle_2.cjs.entry.js +4 -5
- package/dist/cjs/limel-email-viewer.cjs.entry.js +2 -3
- package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +2 -2
- package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -2
- package/dist/cjs/limel-file.cjs.entry.js +2 -3
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +123 -15
- package/dist/cjs/limel-flex-container.cjs.entry.js +1 -1
- package/dist/cjs/limel-form-header.cjs.entry.js +1 -1
- package/dist/cjs/limel-form.cjs.entry.js +65 -5
- package/dist/cjs/limel-grid.cjs.entry.js +1 -1
- package/dist/cjs/limel-header.cjs.entry.js +1 -1
- package/dist/cjs/limel-help_2.cjs.entry.js +3 -3
- package/dist/cjs/limel-helper-line_3.cjs.entry.js +4 -4
- package/dist/cjs/limel-hotkey_4.cjs.entry.js +5 -5
- package/dist/cjs/limel-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-icon.cjs.entry.js +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js +2 -2
- package/dist/cjs/limel-list-item.cjs.entry.js +3 -4
- package/dist/cjs/limel-markdown.cjs.entry.js +1 -1
- package/dist/cjs/limel-masonry-layout.cjs.entry.js +1 -1
- package/dist/cjs/limel-menu-item-meta.cjs.entry.js +1 -1
- package/dist/cjs/limel-pagination-jump.cjs.entry.js +1 -2
- package/dist/cjs/limel-pagination.cjs.entry.js +6 -7
- package/dist/cjs/limel-picker.cjs.entry.js +6 -6
- package/dist/cjs/limel-popover_2.cjs.entry.js +2 -2
- package/dist/cjs/limel-profile-picture.cjs.entry.js +1 -2
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +2 -3
- package/dist/cjs/limel-radio-button-group.cjs.entry.js +1 -1
- package/dist/cjs/limel-radio-button.cjs.entry.js +2 -2
- package/dist/cjs/limel-resize-handle.cjs.entry.js +2 -3
- package/dist/cjs/limel-select.cjs.entry.js +1 -1
- package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
- package/dist/cjs/limel-side-panel.cjs.entry.js +2 -3
- package/dist/cjs/limel-slider.cjs.entry.js +4 -5
- package/dist/cjs/limel-snackbar.cjs.entry.js +3 -4
- package/dist/cjs/limel-split-button.cjs.entry.js +2 -2
- package/dist/cjs/limel-switch.cjs.entry.js +1 -1
- package/dist/cjs/limel-tab-bar.cjs.entry.js +1 -1
- package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +3 -4
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +4 -5
- package/dist/cjs/limel-text-editor.cjs.entry.js +1 -1
- package/dist/cjs/{live-message-BNl3Ihcz.js → live-message-CwxlKd60.js} +0 -30
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{translations-JLP5icQ9.js → translations-BPsptVkN.js} +73 -3
- package/dist/collection/components/3d-hover-effect-glow/3d-hover-effect-glow.js +1 -1
- package/dist/collection/components/action-bar/action-bar-item/action-bar-overflow-menu.js +1 -1
- package/dist/collection/components/action-bar/action-bar.js +2 -2
- package/dist/collection/components/ai-avatar/ai-avatar.js +1 -1
- package/dist/collection/components/badge/badge.js +2 -2
- package/dist/collection/components/banner/banner.js +1 -1
- package/dist/collection/components/breadcrumbs/breadcrumbs.js +1 -1
- package/dist/collection/components/button/button.js +2 -2
- package/dist/collection/components/button-group/button-group.js +1 -1
- package/dist/collection/components/callout/callout.js +1 -1
- package/dist/collection/components/card/card.js +1 -1
- package/dist/collection/components/checkbox/checkbox.js +1 -1
- package/dist/collection/components/chip/chip.js +1 -1
- package/dist/collection/components/chip-set/chip-set.js +1 -1
- package/dist/collection/components/circular-progress/circular-progress.js +1 -1
- package/dist/collection/components/code-diff/code-diff.js +1 -1
- package/dist/collection/components/code-editor/code-editor.js +1 -1
- package/dist/collection/components/collapsible-section/collapsible-section.js +1 -1
- package/dist/collection/components/color-picker/color-picker-palette.js +2 -2
- package/dist/collection/components/color-picker/color-picker.js +1 -1
- package/dist/collection/components/date-picker/date-formatter.js +147 -1
- package/dist/collection/components/date-picker/date-picker.css +112 -0
- package/dist/collection/components/date-picker/date-picker.js +307 -26
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js +77 -30
- package/dist/collection/components/date-picker/pickers/month-picker.js +3 -0
- package/dist/collection/components/date-picker/pickers/picker.js +37 -1
- package/dist/collection/components/date-picker/pickers/quarter-picker.js +3 -0
- package/dist/collection/components/date-picker/pickers/week-picker.js +21 -0
- package/dist/collection/components/date-picker/pickers/year-picker.js +24 -0
- package/dist/collection/components/dialog/dialog.js +2 -2
- package/dist/collection/components/dock/dock.js +2 -2
- package/dist/collection/components/drag-handle/drag-handle.js +1 -1
- package/dist/collection/components/email-viewer/email-viewer.js +1 -1
- package/dist/collection/components/file/file.js +1 -1
- package/dist/collection/components/file-dropzone/file-dropzone.js +1 -1
- package/dist/collection/components/file-input/file-input.js +1 -1
- package/dist/collection/components/flex-container/flex-container.js +1 -1
- package/dist/collection/components/form/fields/schema-field.js +19 -1
- package/dist/collection/components/form/form.js +30 -3
- package/dist/collection/components/form/form.test-schemas.js +11 -0
- package/dist/collection/components/form/invalid-input.js +14 -0
- package/dist/collection/components/form/widgets/date-picker.js +3 -1
- package/dist/collection/components/form-header/form-header.js +1 -1
- package/dist/collection/components/grid/grid.js +1 -1
- package/dist/collection/components/header/header.js +1 -1
- package/dist/collection/components/help/help-content.js +1 -1
- package/dist/collection/components/help/help.js +2 -2
- package/dist/collection/components/helper-line/helper-line.js +2 -2
- package/dist/collection/components/hotkey/hotkey.js +1 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon-button/icon-button.js +1 -1
- package/dist/collection/components/info-tile/info-tile.js +2 -2
- package/dist/collection/components/input-field/input-field.js +1 -1
- package/dist/collection/components/list/list.js +1 -1
- package/dist/collection/components/list-item/list-item.js +2 -2
- package/dist/collection/components/list-item/menu-item-meta/menu-item-meta.js +1 -1
- package/dist/collection/components/markdown/markdown.js +1 -1
- package/dist/collection/components/masonry-layout/masonry-layout.js +1 -1
- package/dist/collection/components/menu/menu.js +1 -1
- package/dist/collection/components/menu-list/menu-list.js +1 -1
- package/dist/collection/components/menu-surface/menu-surface.js +1 -1
- package/dist/collection/components/notched-outline/notched-outline.js +1 -1
- package/dist/collection/components/pagination/pagination.js +1 -1
- package/dist/collection/components/picker/picker.js +1 -1
- package/dist/collection/components/popover/popover.js +1 -1
- package/dist/collection/components/popover-surface/popover-surface.js +1 -1
- package/dist/collection/components/portal/portal.js +1 -1
- package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
- package/dist/collection/components/radio-button-group/radio-button.js +2 -2
- package/dist/collection/components/resize-handle/resize-handle.js +1 -1
- package/dist/collection/components/scroller/scroller.js +2 -2
- package/dist/collection/components/select/select.js +1 -1
- package/dist/collection/components/shortcut/shortcut.js +1 -1
- package/dist/collection/components/side-panel/side-panel.js +1 -1
- package/dist/collection/components/slider/slider.js +3 -3
- package/dist/collection/components/snackbar/snackbar.js +2 -2
- package/dist/collection/components/spinner/spinner.js +1 -1
- package/dist/collection/components/split-button/split-button.js +2 -2
- package/dist/collection/components/switch/switch.js +1 -1
- package/dist/collection/components/tab-bar/tab-bar.js +1 -1
- package/dist/collection/components/tab-panel/tab-panel.js +1 -1
- package/dist/collection/components/table/table.js +2 -2
- package/dist/collection/components/text-editor/link-menu/editor-link-menu.js +3 -3
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +1 -1
- package/dist/collection/components/text-editor/text-editor.js +1 -1
- package/dist/collection/components/tooltip/tooltip-content.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/collection/translations/da.js +2 -0
- package/dist/collection/translations/de.js +2 -0
- package/dist/collection/translations/en.js +2 -0
- package/dist/collection/translations/fi.js +2 -0
- package/dist/collection/translations/fr.js +2 -0
- package/dist/collection/translations/nl.js +2 -0
- package/dist/collection/translations/no.js +2 -0
- package/dist/collection/translations/sv.js +2 -0
- package/dist/esm/dom-B9Ofc5RB.js +30 -0
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-3d-hover-effect-glow.entry.js +1 -1
- package/dist/esm/limel-action-bar_3.entry.js +4 -5
- package/dist/esm/limel-ai-avatar.entry.js +2 -3
- package/dist/esm/limel-badge_7.entry.js +11 -11
- package/dist/esm/limel-banner.entry.js +1 -1
- package/dist/esm/limel-button-group.entry.js +1 -1
- package/dist/esm/limel-button.entry.js +2 -2
- package/dist/esm/limel-callout.entry.js +2 -3
- package/dist/esm/limel-card.entry.js +1 -1
- package/dist/esm/limel-chart.entry.js +1 -2
- package/dist/esm/limel-checkbox.entry.js +1 -1
- package/dist/esm/limel-chip-set.entry.js +2 -3
- package/dist/esm/limel-chip_2.entry.js +2 -3
- package/dist/esm/limel-circular-progress.entry.js +1 -1
- package/dist/esm/limel-code-diff.entry.js +2 -3
- package/dist/esm/limel-code-editor.entry.js +2 -3
- package/dist/esm/limel-collapsible-section.entry.js +2 -3
- package/dist/esm/limel-color-picker-palette.entry.js +2 -2
- package/dist/esm/limel-color-picker.entry.js +1 -1
- package/dist/esm/limel-date-picker.entry.js +435 -24
- package/dist/esm/limel-dialog.entry.js +2 -2
- package/dist/esm/limel-dock.entry.js +3 -4
- package/dist/esm/limel-drag-handle_2.entry.js +4 -5
- package/dist/esm/limel-email-viewer.entry.js +2 -3
- package/dist/esm/limel-file-dropzone_2.entry.js +2 -2
- package/dist/esm/limel-file-viewer.entry.js +1 -2
- package/dist/esm/limel-file.entry.js +2 -3
- package/dist/esm/limel-flatpickr-adapter.entry.js +118 -10
- package/dist/esm/limel-flex-container.entry.js +1 -1
- package/dist/esm/limel-form-header.entry.js +1 -1
- package/dist/esm/limel-form.entry.js +65 -5
- package/dist/esm/limel-grid.entry.js +1 -1
- package/dist/esm/limel-header.entry.js +1 -1
- package/dist/esm/limel-help_2.entry.js +3 -3
- package/dist/esm/limel-helper-line_3.entry.js +4 -4
- package/dist/esm/limel-hotkey_4.entry.js +5 -5
- package/dist/esm/limel-icon-button.entry.js +1 -1
- package/dist/esm/limel-icon.entry.js +1 -1
- package/dist/esm/limel-info-tile.entry.js +2 -2
- package/dist/esm/limel-list-item.entry.js +3 -4
- package/dist/esm/limel-markdown.entry.js +1 -1
- package/dist/esm/limel-masonry-layout.entry.js +1 -1
- package/dist/esm/limel-menu-item-meta.entry.js +1 -1
- package/dist/esm/limel-pagination-jump.entry.js +1 -2
- package/dist/esm/limel-pagination.entry.js +2 -3
- package/dist/esm/limel-picker.entry.js +4 -4
- package/dist/esm/limel-popover_2.entry.js +2 -2
- package/dist/esm/limel-profile-picture.entry.js +1 -2
- package/dist/esm/limel-prosemirror-adapter.entry.js +2 -3
- package/dist/esm/limel-radio-button-group.entry.js +1 -1
- package/dist/esm/limel-radio-button.entry.js +2 -2
- package/dist/esm/limel-resize-handle.entry.js +2 -3
- package/dist/esm/limel-select.entry.js +1 -1
- package/dist/esm/limel-shortcut.entry.js +1 -1
- package/dist/esm/limel-side-panel.entry.js +2 -3
- package/dist/esm/limel-slider.entry.js +4 -5
- package/dist/esm/limel-snackbar.entry.js +3 -4
- package/dist/esm/limel-split-button.entry.js +2 -2
- package/dist/esm/limel-switch.entry.js +1 -1
- package/dist/esm/limel-tab-bar.entry.js +1 -1
- package/dist/esm/limel-tab-panel.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +3 -4
- package/dist/esm/limel-text-editor-link-menu.entry.js +4 -5
- package/dist/esm/limel-text-editor.entry.js +1 -1
- package/dist/esm/{live-message-BQAYeNiX.js → live-message-BKB4vu28.js} +1 -30
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{translations-D9ZGrMhe.js → translations--i932i_D.js} +70 -2
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p--i932i_D.js +1 -0
- package/dist/lime-elements/p-0700e83f.entry.js +1 -0
- package/dist/lime-elements/{p-95a486c8.entry.js → p-083aa41f.entry.js} +1 -1
- package/dist/lime-elements/p-08b1bfad.entry.js +1 -0
- package/dist/lime-elements/{p-8fe28845.entry.js → p-127ff801.entry.js} +1 -1
- package/dist/lime-elements/{p-764d2f86.entry.js → p-156ea100.entry.js} +1 -1
- package/dist/lime-elements/{p-1e0ced6a.entry.js → p-15f5e45e.entry.js} +1 -1
- package/dist/lime-elements/p-1c7fcafc.entry.js +1 -0
- package/dist/lime-elements/p-1e699935.entry.js +1 -0
- package/dist/lime-elements/{p-f71fbc9e.entry.js → p-1fa0fd7a.entry.js} +4 -4
- package/dist/lime-elements/{p-ce71c5b9.entry.js → p-22aaa1ae.entry.js} +1 -1
- package/dist/lime-elements/p-2a5113ef.entry.js +1 -0
- package/dist/lime-elements/p-2d698983.entry.js +1 -0
- package/dist/lime-elements/p-373032c0.entry.js +1 -0
- package/dist/lime-elements/{p-8e80a884.entry.js → p-391305a7.entry.js} +3 -3
- package/dist/lime-elements/p-391a227e.entry.js +1 -0
- package/dist/lime-elements/p-3a421be9.entry.js +1 -0
- package/dist/lime-elements/p-3d6ba932.entry.js +1 -0
- package/dist/lime-elements/{p-c8a34cef.entry.js → p-3f9acb22.entry.js} +1 -1
- package/dist/lime-elements/p-46695dd3.entry.js +1 -0
- package/dist/lime-elements/p-490ac19d.entry.js +1 -0
- package/dist/lime-elements/p-4bc550e5.entry.js +1 -0
- package/dist/lime-elements/{p-438fe49b.entry.js → p-4de3b35b.entry.js} +1 -1
- package/dist/lime-elements/p-4eee17f7.entry.js +1 -0
- package/dist/lime-elements/p-507965d9.entry.js +1 -0
- package/dist/lime-elements/p-51fde63a.entry.js +1 -0
- package/dist/lime-elements/{p-db9cb7ef.entry.js → p-557f0e46.entry.js} +1 -1
- package/dist/lime-elements/p-558a7e27.entry.js +1 -0
- package/dist/lime-elements/{p-c6b3448c.entry.js → p-5fcb39b8.entry.js} +1 -1
- package/dist/lime-elements/p-61c81d09.entry.js +16 -0
- package/dist/lime-elements/{p-f59447bf.entry.js → p-63f2f0b7.entry.js} +1 -1
- package/dist/lime-elements/p-65199efa.entry.js +1 -0
- package/dist/lime-elements/p-6567de01.entry.js +1 -0
- package/dist/lime-elements/{p-a6387dc7.entry.js → p-664dbc43.entry.js} +1 -1
- package/dist/lime-elements/{p-6ae093c8.entry.js → p-6b6b8ffe.entry.js} +1 -1
- package/dist/lime-elements/p-6f8305ac.entry.js +1 -0
- package/dist/lime-elements/{p-c0ebf7cc.entry.js → p-718431c1.entry.js} +1 -1
- package/dist/lime-elements/p-71ed9466.entry.js +1 -0
- package/dist/lime-elements/{p-7d0ffc60.entry.js → p-81c43fe9.entry.js} +1 -1
- package/dist/lime-elements/p-8e46d111.entry.js +1 -0
- package/dist/lime-elements/{p-d3f13124.entry.js → p-9cbfedad.entry.js} +1 -1
- package/dist/lime-elements/p-9e5a15d1.entry.js +1 -0
- package/dist/lime-elements/p-B9Ofc5RB.js +1 -0
- package/dist/lime-elements/p-CMedqTpE.js +1 -0
- package/dist/lime-elements/{p-e5abe390.entry.js → p-a1cd0dc0.entry.js} +1 -1
- package/dist/lime-elements/p-a5aa8c06.entry.js +1 -0
- package/dist/lime-elements/{p-c61e9b83.entry.js → p-ae634a68.entry.js} +1 -1
- package/dist/lime-elements/{p-c2056ebc.entry.js → p-b6334f4b.entry.js} +1 -1
- package/dist/lime-elements/{p-28957b5c.entry.js → p-b810b854.entry.js} +1 -1
- package/dist/lime-elements/{p-cf2d43c7.entry.js → p-bb45a5bb.entry.js} +1 -1
- package/dist/lime-elements/{p-54537c85.entry.js → p-be653ca9.entry.js} +1 -1
- package/dist/lime-elements/{p-40940a6c.entry.js → p-bfb98b0e.entry.js} +1 -1
- package/dist/lime-elements/{p-3f7fa772.entry.js → p-c1dbad1e.entry.js} +1 -1
- package/dist/lime-elements/{p-39d1e157.entry.js → p-c3b86df2.entry.js} +1 -1
- package/dist/lime-elements/p-c3d1aa57.entry.js +1 -0
- package/dist/lime-elements/p-c63d294b.entry.js +1 -0
- package/dist/lime-elements/{p-f3b93ce8.entry.js → p-c6eed240.entry.js} +1 -1
- package/dist/lime-elements/p-c7bcae67.entry.js +1 -0
- package/dist/lime-elements/p-ce418df1.entry.js +159 -0
- package/dist/lime-elements/{p-6053608a.entry.js → p-d078ea89.entry.js} +1 -1
- package/dist/lime-elements/p-d2f784a8.entry.js +1 -0
- package/dist/lime-elements/{p-48a412ed.entry.js → p-d51bf98b.entry.js} +1 -1
- package/dist/lime-elements/p-da9be21e.entry.js +1 -0
- package/dist/lime-elements/{p-a891f3e8.entry.js → p-e3cf45ed.entry.js} +1 -1
- package/dist/lime-elements/{p-909466b8.entry.js → p-e481fb53.entry.js} +1 -1
- package/dist/lime-elements/{p-0319f07f.entry.js → p-e8665e99.entry.js} +1 -1
- package/dist/lime-elements/{p-5dce791c.entry.js → p-eb812303.entry.js} +1 -1
- package/dist/types/components/date-picker/date-formatter.d.ts +12 -0
- package/dist/types/components/date-picker/date-picker.d.ts +59 -3
- package/dist/types/components/date-picker/flatpickr-adapter/flatpickr-adapter.d.ts +13 -2
- package/dist/types/components/date-picker/pickers/month-picker.d.ts +1 -0
- package/dist/types/components/date-picker/pickers/picker.d.ts +8 -1
- package/dist/types/components/date-picker/pickers/quarter-picker.d.ts +1 -0
- package/dist/types/components/date-picker/pickers/week-picker.d.ts +4 -0
- package/dist/types/components/date-picker/pickers/year-picker.d.ts +7 -0
- package/dist/types/components/form/fields/schema-field.d.ts +2 -0
- package/dist/types/components/form/form.d.ts +2 -0
- package/dist/types/components/form/form.test-schemas.d.ts +1 -0
- package/dist/types/components/form/invalid-input.d.ts +14 -0
- package/dist/types/components/form/widgets/date-picker.d.ts +1 -0
- package/dist/types/components.d.ts +31 -11
- package/dist/types/translations/da.d.ts +2 -0
- package/dist/types/translations/de.d.ts +2 -0
- package/dist/types/translations/en.d.ts +2 -0
- package/dist/types/translations/fi.d.ts +2 -0
- package/dist/types/translations/fr.d.ts +2 -0
- package/dist/types/translations/nl.d.ts +2 -0
- package/dist/types/translations/no.d.ts +2 -0
- package/dist/types/translations/sv.d.ts +2 -0
- package/package.json +2 -2
- package/dist/cjs/language-s0bKUCvO.js +0 -58
- package/dist/esm/language-VamkUr90.js +0 -55
- package/dist/lime-elements/p-0a7cbdc3.entry.js +0 -1
- package/dist/lime-elements/p-0f96e94d.entry.js +0 -1
- package/dist/lime-elements/p-1a0c5e45.entry.js +0 -1
- package/dist/lime-elements/p-401d5c92.entry.js +0 -1
- package/dist/lime-elements/p-430db3b9.entry.js +0 -1
- package/dist/lime-elements/p-43b62587.entry.js +0 -1
- package/dist/lime-elements/p-48dccb83.entry.js +0 -1
- package/dist/lime-elements/p-5c918155.entry.js +0 -1
- package/dist/lime-elements/p-66101ed6.entry.js +0 -1
- package/dist/lime-elements/p-7ab72b52.entry.js +0 -1
- package/dist/lime-elements/p-8d602078.entry.js +0 -1
- package/dist/lime-elements/p-8d9a2a22.entry.js +0 -1
- package/dist/lime-elements/p-8de4f0f3.entry.js +0 -1
- package/dist/lime-elements/p-99984c66.entry.js +0 -1
- package/dist/lime-elements/p-9d46f720.entry.js +0 -1
- package/dist/lime-elements/p-9e2b426c.entry.js +0 -1
- package/dist/lime-elements/p-C9dBa_Im.js +0 -1
- package/dist/lime-elements/p-Cw7VQSGU.js +0 -1
- package/dist/lime-elements/p-VamkUr90.js +0 -1
- package/dist/lime-elements/p-b1c7033b.entry.js +0 -16
- package/dist/lime-elements/p-b5451350.entry.js +0 -1
- package/dist/lime-elements/p-c75f3b0d.entry.js +0 -1
- package/dist/lime-elements/p-ca4247c4.entry.js +0 -1
- package/dist/lime-elements/p-d53421af.entry.js +0 -1
- package/dist/lime-elements/p-d8901e39.entry.js +0 -1
- package/dist/lime-elements/p-d89553b3.entry.js +0 -1
- package/dist/lime-elements/p-d93b8ce0.entry.js +0 -1
- package/dist/lime-elements/p-e97340c4.entry.js +0 -1
- package/dist/lime-elements/p-ec0c113d.entry.js +0 -1
- package/dist/lime-elements/p-f036ad27.entry.js +0 -1
- package/dist/lime-elements/p-f197000b.entry.js +0 -159
- package/dist/lime-elements/p-f5bb17eb.entry.js +0 -1
- package/dist/lime-elements/p-f6bc6658.entry.js +0 -1
- package/dist/lime-elements/p-fa1aa440.entry.js +0 -1
|
@@ -101,10 +101,10 @@ const Palette = class {
|
|
|
101
101
|
render() {
|
|
102
102
|
const background = this.value ? { '--background': this.value } : {};
|
|
103
103
|
return [
|
|
104
|
-
h("div", { key: '
|
|
104
|
+
h("div", { key: '69d11a1f2b5515985edd256b9bccc757d68816b6', class: "color-picker-palette", style: {
|
|
105
105
|
'--color-picker-column-count': `${this.getColumnCount()}`,
|
|
106
106
|
} }, this.renderSwatches()),
|
|
107
|
-
h("div", { key: '
|
|
107
|
+
h("div", { key: 'e1035bad5fff4c8c62e74c6e54040a6844302e62', class: "chosen-color-name" }, h("limel-input-field", { key: 'ec2ce0ae13a0d6da53a1632f9d8de40c44ab07e5', label: this.label, helperText: this.helperText, value: this.value, onChange: this.handleChange, required: this.required, invalid: this.invalid, placeholder: this.placeholder, disabled: !this.manualInput }), h("div", { key: '611d1c42636b277fa3bac83b842f786840486f03', class: "chosen-color-preview", style: background })),
|
|
108
108
|
];
|
|
109
109
|
}
|
|
110
110
|
getPalette() {
|
|
@@ -76,7 +76,7 @@ const ColorPicker = class {
|
|
|
76
76
|
(_a = this.contentElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
77
77
|
}
|
|
78
78
|
render() {
|
|
79
|
-
return (h(Host, { key: '
|
|
79
|
+
return (h(Host, { key: '881853460bcb6da0b123b7fe67a7bd0d16bb3613' }, this.renderTooltip(), this.renderPickerPalette(), h("limel-input-field", { key: '0c1e832b5e4273228a1ac6c922c8a219ac9ca82c', label: this.label, helperText: this.helperText, value: this.value, onChange: this.handleChange, required: this.required, readonly: this.readonly, disabled: this.disabled || !this.manualInput, invalid: this.invalid, placeholder: this.placeholder })));
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
ColorPicker.style = colorPickerCss();
|
|
@@ -1,15 +1,165 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as getElement } from './index-BU9IJqli.js';
|
|
2
|
+
import { c as createLiveMessage } from './live-message-BKB4vu28.js';
|
|
2
3
|
import { c as createRandomString } from './random-string-BrjD-ITe.js';
|
|
3
4
|
import { i as isIOSDevice, a as isAndroidDevice } from './device-B-tmXAXV.js';
|
|
4
5
|
import './sv-DpsDSi7k.js';
|
|
5
6
|
import { m as moment } from './moment-_DadZLWp.js';
|
|
6
|
-
import { a as getPrimarySubtag } from './
|
|
7
|
+
import { a as getPrimarySubtag, t as translations } from './translations--i932i_D.js';
|
|
7
8
|
import { M as MDCTextField } from './component-CVihTrav.js';
|
|
9
|
+
import './debounce-B67JMchz.js';
|
|
10
|
+
import './isObject-BJQylLSL.js';
|
|
11
|
+
import './toNumber-D6JYpQI9.js';
|
|
12
|
+
import './isSymbol-ClAke5ga.js';
|
|
13
|
+
import './isObjectLike-oiMYqRQ0.js';
|
|
8
14
|
import './_commonjsHelpers-B85MJLTf.js';
|
|
9
15
|
import './ponyfill-6YuZiAPi.js';
|
|
10
16
|
import './component-CrjPGt1I.js';
|
|
11
17
|
import './component-CyFeUQ0l.js';
|
|
12
18
|
|
|
19
|
+
// Literals first, so an `l` inside `[...]` is not expanded. Then longest
|
|
20
|
+
// first, since alternation takes the first match, not the longest.
|
|
21
|
+
const LONG_DATE_FORMAT_TOKENS = /\[[^\][]*\]|LTS|LLLL|LLL|LL|LT|L|lts|llll|lll|ll|lt|l/g;
|
|
22
|
+
// Literals, tokens (runs of one repeated letter) and separators.
|
|
23
|
+
const FORMAT_PARTS = /\[[^\][]*\]|([a-zA-Z])\1*|[^a-zA-Z[]+/g;
|
|
24
|
+
// Tokens moment parses leniently as one or two digits.
|
|
25
|
+
const ONE_OR_TWO_DIGIT_TOKENS = /^([MDHhkmsWw])\1?$/;
|
|
26
|
+
// Includes the narrow no-break space `Intl` puts before AM/PM.
|
|
27
|
+
const WHITESPACE = /\s+/g;
|
|
28
|
+
// ` - ` or `, ` between a date and a time. Separators inside a date, such
|
|
29
|
+
// as `-` in `YYYY-MM-DD`, must still be typed as in the format.
|
|
30
|
+
const DATE_TIME_JOINER = / ?, ?| - /g;
|
|
31
|
+
const TIME_SEPARATOR = /([Hhk]{1,2}|m{1,2})([:.])(?=m{1,2}|s{1,2})/g;
|
|
32
|
+
// Such as `[w]` in `[w] W GGGG`.
|
|
33
|
+
const WEEK_PREFIX = /^\[[^\][]*\]\s*(?=[Ww])/;
|
|
34
|
+
/**
|
|
35
|
+
* Expands localized tokens, e.g. `L` to `MM/DD/YYYY` for `en`.
|
|
36
|
+
* @param format - the moment format to expand, e.g. `L` or `L - LT`
|
|
37
|
+
* @param locale - the moment locale to expand it for
|
|
38
|
+
*/
|
|
39
|
+
function expandLongDateFormatTokens(format, locale) {
|
|
40
|
+
if (!format) {
|
|
41
|
+
return format;
|
|
42
|
+
}
|
|
43
|
+
const localeData = moment.localeData(locale);
|
|
44
|
+
return format.replaceAll(LONG_DATE_FORMAT_TOKENS, (token) => {
|
|
45
|
+
if (token.startsWith('[')) {
|
|
46
|
+
return token;
|
|
47
|
+
}
|
|
48
|
+
return (localeData.longDateFormat(token) ||
|
|
49
|
+
token);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Accepts fewer digits than the format has, e.g. `1/24/20` for
|
|
54
|
+
* `MM/DD/YYYY`, but rejects text that leaves part of the format unmatched.
|
|
55
|
+
* Moment's lenient mode alone accepts "01" as a complete date.
|
|
56
|
+
*
|
|
57
|
+
* Times and weeks are accepted in more forms than their format, e.g.
|
|
58
|
+
* `15.30` for `HH:mm` and `v. 4 26` for `[w] W GGGG`.
|
|
59
|
+
* @param date - the raw text to parse
|
|
60
|
+
* @param format - the moment format to parse it against
|
|
61
|
+
* @param locale - the moment locale to parse it in
|
|
62
|
+
*/
|
|
63
|
+
function parseComplete(date, format, locale) {
|
|
64
|
+
const text = normalizeSeparators(date);
|
|
65
|
+
const expandedFormat = normalizeSeparators(expandLongDateFormatTokens(format, locale));
|
|
66
|
+
for (const candidate of getTimeSeparatorVariants(expandedFormat)) {
|
|
67
|
+
const parsed = parseLeniently(text, candidate, locale);
|
|
68
|
+
if (parsed) {
|
|
69
|
+
return parsed;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
function parseLeniently(date, format, locale) {
|
|
75
|
+
const [weekText, weekFormat] = dropWeekPrefix(date, format);
|
|
76
|
+
const text = pivotWeekYears(weekText, weekFormat);
|
|
77
|
+
const parsed = moment(text, weekFormat, locale, false);
|
|
78
|
+
if (!parsed.isValid()) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const flags = parsed.parsingFlags();
|
|
82
|
+
if (flags.charsLeftOver > 0 ||
|
|
83
|
+
flags.unusedTokens.length > 0 ||
|
|
84
|
+
hasAmbiguousYear(text, weekFormat)) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
return parsed.toDate();
|
|
88
|
+
}
|
|
89
|
+
// Applied to both the text and the format, so they stay aligned.
|
|
90
|
+
function normalizeSeparators(text) {
|
|
91
|
+
return text
|
|
92
|
+
.trim()
|
|
93
|
+
.replaceAll(WHITESPACE, ' ')
|
|
94
|
+
.replaceAll(DATE_TIME_JOINER, ' ');
|
|
95
|
+
}
|
|
96
|
+
function getTimeSeparatorVariants(format) {
|
|
97
|
+
const swapped = format.replaceAll(TIME_SEPARATOR, (_, part, separator) => part + (separator === ':' ? '.' : ':'));
|
|
98
|
+
return swapped === format ? [format] : [format, swapped];
|
|
99
|
+
}
|
|
100
|
+
// Accepts any prefix, e.g. `v.`, `w` or none, for `[w] W GGGG`.
|
|
101
|
+
function dropWeekPrefix(date, format) {
|
|
102
|
+
if (!WEEK_PREFIX.test(format)) {
|
|
103
|
+
return [date, format];
|
|
104
|
+
}
|
|
105
|
+
return [date.replace(/^\D*/, ''), format.replace(WEEK_PREFIX, '')];
|
|
106
|
+
}
|
|
107
|
+
// Moment pivots a 2-digit `YYYY`, e.g. `26` to 2026, but not `GGGG`.
|
|
108
|
+
function pivotWeekYears(date, format) {
|
|
109
|
+
const twoDigitWeekYears = findYears(date, format).filter(({ token, start, end }) => token === 'GGGG' && end - start === 2);
|
|
110
|
+
return twoDigitWeekYears.reduceRight((text, { start, end }) => text.slice(0, start) +
|
|
111
|
+
moment.parseTwoDigitYear(text.slice(start, end)) +
|
|
112
|
+
text.slice(end), date);
|
|
113
|
+
}
|
|
114
|
+
// Lenient parsing reads a half-typed year such as "1/24/2" as year 2.
|
|
115
|
+
function hasAmbiguousYear(date, format) {
|
|
116
|
+
return findYears(date, format).some(({ start, end }) => {
|
|
117
|
+
const digitCount = end - start;
|
|
118
|
+
return digitCount !== 2 && digitCount !== 4;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function findYears(date, format) {
|
|
122
|
+
const formatParts = format.match(FORMAT_PARTS) || [];
|
|
123
|
+
const inputPattern = formatParts.map(formatPartToPattern).join('');
|
|
124
|
+
const match = new RegExp(`^${inputPattern}$`, 'd').exec(date);
|
|
125
|
+
if (!match) {
|
|
126
|
+
return [];
|
|
127
|
+
}
|
|
128
|
+
return formatParts.filter(isYearToken).map((token, index) => {
|
|
129
|
+
const [start, end] = match.indices[index + 1];
|
|
130
|
+
return { token: token, start: start, end: end };
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function isYearToken(part) {
|
|
134
|
+
return part === 'YYYY' || part === 'GGGG';
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Literals and separators are optional, since lenient parsing skips them
|
|
138
|
+
* when they are not typed, e.g. `01242026` for `MM/DD/YYYY`.
|
|
139
|
+
* @param part - a literal, token or separator of the format
|
|
140
|
+
*/
|
|
141
|
+
function formatPartToPattern(part) {
|
|
142
|
+
if (part.startsWith('[')) {
|
|
143
|
+
return optional(part.slice(1, -1));
|
|
144
|
+
}
|
|
145
|
+
if (isYearToken(part)) {
|
|
146
|
+
return String.raw `(\d{1,4})`;
|
|
147
|
+
}
|
|
148
|
+
if (ONE_OR_TWO_DIGIT_TOKENS.test(part)) {
|
|
149
|
+
return String.raw `\d{1,2}`;
|
|
150
|
+
}
|
|
151
|
+
if (/^[a-zA-Z]+$/.test(part)) {
|
|
152
|
+
return '.+?';
|
|
153
|
+
}
|
|
154
|
+
// Moment matches each separator character on its own.
|
|
155
|
+
return [...part].map(optional).join('');
|
|
156
|
+
}
|
|
157
|
+
function optional(text) {
|
|
158
|
+
return `(?:${escapeRegExp(text)})?`;
|
|
159
|
+
}
|
|
160
|
+
function escapeRegExp(text) {
|
|
161
|
+
return text.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw `\$&`);
|
|
162
|
+
}
|
|
13
163
|
class DateFormatter {
|
|
14
164
|
constructor(language = 'en') {
|
|
15
165
|
this.language = language;
|
|
@@ -22,7 +172,9 @@ class DateFormatter {
|
|
|
22
172
|
}
|
|
23
173
|
parseDate(date, dateFormat) {
|
|
24
174
|
if (date) {
|
|
25
|
-
|
|
175
|
+
// Importing the moment locales changes moment's global default
|
|
176
|
+
// locale, so tokens like `L` must be parsed with ours.
|
|
177
|
+
return parseComplete(date, dateFormat, this.getLanguage());
|
|
26
178
|
}
|
|
27
179
|
return null;
|
|
28
180
|
}
|
|
@@ -46,7 +198,7 @@ class DateFormatter {
|
|
|
46
198
|
}
|
|
47
199
|
}
|
|
48
200
|
|
|
49
|
-
const datePickerCss = () =>
|
|
201
|
+
const datePickerCss = () => `@charset "UTF-8";:host(limel-date-picker){position:relative}limel-input-field[disabled],limel-input-field[readonly]{pointer-events:none}.error-message{position:absolute;width:0;height:0;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0, 0, 0, 0);clip-path:inset(50%);white-space:nowrap}`;
|
|
50
202
|
|
|
51
203
|
// tslint:disable:no-duplicate-string
|
|
52
204
|
const nativeTypeForConsumerType = {
|
|
@@ -73,6 +225,7 @@ const DatePicker = class {
|
|
|
73
225
|
constructor(hostRef) {
|
|
74
226
|
registerInstance(this, hostRef);
|
|
75
227
|
this.change = createEvent(this, "change", 7);
|
|
228
|
+
this.invalidInput = createEvent(this, "invalidInput", 7);
|
|
76
229
|
/**
|
|
77
230
|
* Set to `true` to disable the field.
|
|
78
231
|
* Use `disabled` to indicate that the field can normally be interacted
|
|
@@ -88,7 +241,8 @@ const DatePicker = class {
|
|
|
88
241
|
this.readonly = false;
|
|
89
242
|
/**
|
|
90
243
|
* Set to `true` to indicate that the current value of the date picker is
|
|
91
|
-
* invalid.
|
|
244
|
+
* invalid. Typed text that is not a valid date is flagged by the
|
|
245
|
+
* component itself, whatever this is set to.
|
|
92
246
|
*/
|
|
93
247
|
this.invalid = false;
|
|
94
248
|
/**
|
|
@@ -105,15 +259,85 @@ const DatePicker = class {
|
|
|
105
259
|
*/
|
|
106
260
|
this.language = 'en';
|
|
107
261
|
this.showPortal = false;
|
|
262
|
+
this.parseError = false;
|
|
263
|
+
this.isEditing = false;
|
|
108
264
|
this.portalId = `date-picker-calendar-${createRandomString()}`;
|
|
265
|
+
// Screen readers don't announce a changed description of the focused
|
|
266
|
+
// field, so the error is spoken through a live region.
|
|
267
|
+
this.errorMessage = createLiveMessage(() => this.parseError ? this.getHelperText() : '');
|
|
109
268
|
this.documentClickListener = (event) => {
|
|
110
269
|
if (event.composedPath().includes(this.textField)) {
|
|
111
270
|
return;
|
|
112
271
|
}
|
|
113
272
|
const element = document.querySelector(`#${this.portalId}`);
|
|
114
|
-
if (
|
|
115
|
-
|
|
273
|
+
if (element.contains(event.target)) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
// The input's own blur, which follows, closes the calendar with the
|
|
277
|
+
// final typed text.
|
|
278
|
+
if (this.textField.shadowRoot.activeElement === this.inputElement) {
|
|
279
|
+
return;
|
|
116
280
|
}
|
|
281
|
+
this.hideCalendar();
|
|
282
|
+
};
|
|
283
|
+
this.handleKeyDown = (event) => {
|
|
284
|
+
var _a;
|
|
285
|
+
if (this.disabled || this.readonly) {
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
this.discardedText = undefined;
|
|
289
|
+
const handlers = {
|
|
290
|
+
ArrowDown: this.handleArrowDown,
|
|
291
|
+
Escape: this.handleEscape,
|
|
292
|
+
Enter: this.handleEnter,
|
|
293
|
+
Backspace: this.handleDelete,
|
|
294
|
+
Delete: this.handleDelete,
|
|
295
|
+
};
|
|
296
|
+
(_a = handlers[event.key]) === null || _a === void 0 ? void 0 : _a.call(handlers, event);
|
|
297
|
+
};
|
|
298
|
+
this.handleArrowDown = async (event) => {
|
|
299
|
+
var _a;
|
|
300
|
+
event.preventDefault();
|
|
301
|
+
if (!this.showPortal) {
|
|
302
|
+
this.showPortal = true;
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
await ((_a = this.datePickerCalendar) === null || _a === void 0 ? void 0 : _a.focusDay());
|
|
306
|
+
};
|
|
307
|
+
// The first Escape discards typed text, the next closes the calendar.
|
|
308
|
+
// Stopping it keeps a surrounding dialog open.
|
|
309
|
+
this.handleEscape = (event) => {
|
|
310
|
+
if (this.hasTypedText()) {
|
|
311
|
+
this.discardTypedText();
|
|
312
|
+
}
|
|
313
|
+
else if (this.showPortal) {
|
|
314
|
+
this.showPortal = false;
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
event.preventDefault();
|
|
320
|
+
event.stopPropagation();
|
|
321
|
+
};
|
|
322
|
+
// Reads the input, since the input field emits its text debounced.
|
|
323
|
+
this.handleEnter = () => {
|
|
324
|
+
var _a, _b;
|
|
325
|
+
if (!this.acceptsTypedInput()) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
const currentText = (_b = (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
|
|
329
|
+
this.rawInputValue = currentText;
|
|
330
|
+
if (currentText !== '' && !this.parseText(currentText)) {
|
|
331
|
+
this.parseError = true;
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
this.commitTypedText();
|
|
335
|
+
};
|
|
336
|
+
this.handleDelete = () => {
|
|
337
|
+
if (this.acceptsTypedInput() || !this.value) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
this.clearValue();
|
|
117
341
|
};
|
|
118
342
|
this.formatValue = (value) => this.dateFormatter.formatDate(value, this.internalFormat);
|
|
119
343
|
this.handleCalendarChange = this.handleCalendarChange.bind(this);
|
|
@@ -127,6 +351,8 @@ const DatePicker = class {
|
|
|
127
351
|
this.nativeChangeHandler = this.nativeChangeHandler.bind(this);
|
|
128
352
|
this.preventBlurFromCalendarContainer =
|
|
129
353
|
this.preventBlurFromCalendarContainer.bind(this);
|
|
354
|
+
this.commitTypedText = this.commitTypedText.bind(this);
|
|
355
|
+
this.handleInputBlur = this.handleInputBlur.bind(this);
|
|
130
356
|
}
|
|
131
357
|
componentWillLoad() {
|
|
132
358
|
this.useNative = !this.readonly && (isIOSDevice() || isAndroidDevice());
|
|
@@ -136,7 +362,28 @@ const DatePicker = class {
|
|
|
136
362
|
this.updateInternalFormatAndType();
|
|
137
363
|
}
|
|
138
364
|
disconnectedCallback() {
|
|
365
|
+
var _a;
|
|
139
366
|
this.removeDocumentListeners();
|
|
367
|
+
(_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.removeEventListener('blur', this.handleInputBlur);
|
|
368
|
+
this.errorMessage.update.cancel();
|
|
369
|
+
}
|
|
370
|
+
// Consumers such as `limel-form` pass a new `Date` on every render.
|
|
371
|
+
watchValue(newValue, oldValue) {
|
|
372
|
+
if ((newValue === null || newValue === void 0 ? void 0 : newValue.getTime()) === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.getTime())) {
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
this.resetTypedText();
|
|
376
|
+
}
|
|
377
|
+
watchParseError() {
|
|
378
|
+
this.errorMessage.update();
|
|
379
|
+
this.invalidInput.emit(this.parseError ? this.getInvalidInputMessage() : null);
|
|
380
|
+
}
|
|
381
|
+
watchFormatInputs() {
|
|
382
|
+
this.resetTypedText();
|
|
383
|
+
}
|
|
384
|
+
watchLanguage() {
|
|
385
|
+
this.dateFormatter = new DateFormatter(this.language);
|
|
386
|
+
this.resetTypedText();
|
|
140
387
|
}
|
|
141
388
|
render() {
|
|
142
389
|
const inputProps = {
|
|
@@ -145,24 +392,56 @@ const DatePicker = class {
|
|
|
145
392
|
if (this.value && !this.readonly && !this.disabled) {
|
|
146
393
|
inputProps.trailingIcon = 'clear_symbol';
|
|
147
394
|
}
|
|
148
|
-
const helperText = this.
|
|
395
|
+
const helperText = this.getHelperText();
|
|
149
396
|
if (this.useNative) {
|
|
150
397
|
return (h("limel-input-field", { disabled: this.disabled, readonly: this.readonly, invalid: this.invalid, label: this.label, helperText: helperText, required: this.required, value: this.formatValue(this.value), type: this.nativeType, onChange: this.nativeChangeHandler }));
|
|
151
398
|
}
|
|
152
399
|
const dropdownZIndex = getComputedStyle(this.host).getPropertyValue('--dropdown-z-index');
|
|
153
400
|
const formatter = this.formatter || this.formatValue;
|
|
154
401
|
return [
|
|
155
|
-
h("limel-input-field", Object.assign({ disabled: this.disabled, readonly: this.readonly, invalid: this.invalid, label: this.label, placeholder: this.placeholder, helperText: helperText, required: this.required, value: this.
|
|
156
|
-
h("
|
|
402
|
+
h("limel-input-field", Object.assign({ disabled: this.disabled, readonly: this.readonly, invalid: this.invalid || this.parseError, label: this.label, placeholder: this.placeholder, helperText: helperText, required: this.required, value: this.getDisplayValue(formatter), onFocus: this.showCalendar, onBlur: this.hideCalendar, onClick: this.onInputClick, onChange: this.handleInputElementChange, onKeyDown: this.handleKeyDown, ref: (el) => (this.textField = el) }, inputProps)),
|
|
403
|
+
h("span", { class: "error-message", "aria-live": "polite", ref: this.errorMessage.setElement }),
|
|
404
|
+
h("limel-portal", { containerId: this.portalId, visible: this.showPortal, containerStyle: { 'z-index': dropdownZIndex } }, h("limel-flatpickr-adapter", { format: this.internalFormat, language: this.language, type: this.type, value: this.value, previewValue: this.previewValue, ref: (el) => (this.datePickerCalendar = el), isOpen: this.showPortal, onChange: this.handleCalendarChange })),
|
|
157
405
|
];
|
|
158
406
|
}
|
|
407
|
+
getDisplayValue(formatter) {
|
|
408
|
+
if (this.rawInputValue !== undefined) {
|
|
409
|
+
return this.rawInputValue;
|
|
410
|
+
}
|
|
411
|
+
if (!this.value) {
|
|
412
|
+
return '';
|
|
413
|
+
}
|
|
414
|
+
return this.isEditing && this.acceptsTypedInput()
|
|
415
|
+
? this.formatValue(this.value)
|
|
416
|
+
: formatter(this.value);
|
|
417
|
+
}
|
|
418
|
+
acceptsTypedInput() {
|
|
419
|
+
return !this.formatter || !!this.format;
|
|
420
|
+
}
|
|
421
|
+
getHelperText() {
|
|
422
|
+
if (this.parseError) {
|
|
423
|
+
return this.getInvalidInputMessage();
|
|
424
|
+
}
|
|
425
|
+
if (this.disabled || this.readonly) {
|
|
426
|
+
return undefined;
|
|
427
|
+
}
|
|
428
|
+
return this.helperText;
|
|
429
|
+
}
|
|
430
|
+
getInvalidInputMessage() {
|
|
431
|
+
const key = this.type === 'time'
|
|
432
|
+
? 'date-picker.invalid-time-format'
|
|
433
|
+
: 'date-picker.invalid-format';
|
|
434
|
+
return translations.get(key, this.language, {
|
|
435
|
+
example: this.formatValue(new Date()),
|
|
436
|
+
});
|
|
437
|
+
}
|
|
159
438
|
updateInternalFormatAndType() {
|
|
160
439
|
this.nativeType = nativeTypeForConsumerType[this.type || 'default'];
|
|
161
440
|
this.nativeFormat = nativeFormatForType[this.nativeType];
|
|
162
441
|
if (this.useNative) {
|
|
163
442
|
this.internalFormat = this.nativeFormat;
|
|
164
443
|
}
|
|
165
|
-
else if (this.
|
|
444
|
+
else if (this.format) {
|
|
166
445
|
this.internalFormat = this.format;
|
|
167
446
|
}
|
|
168
447
|
else {
|
|
@@ -171,19 +450,27 @@ const DatePicker = class {
|
|
|
171
450
|
}
|
|
172
451
|
nativeChangeHandler(event) {
|
|
173
452
|
event.stopPropagation();
|
|
174
|
-
|
|
175
|
-
|
|
453
|
+
if (event.detail === '') {
|
|
454
|
+
this.clearValue();
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
const date = this.parseText(event.detail);
|
|
458
|
+
if (date) {
|
|
459
|
+
this.change.emit(date);
|
|
460
|
+
}
|
|
176
461
|
}
|
|
177
462
|
showCalendar(event) {
|
|
178
463
|
if (this.disabled || this.readonly) {
|
|
179
464
|
event.stopPropagation();
|
|
180
465
|
return;
|
|
181
466
|
}
|
|
467
|
+
this.isEditing = true;
|
|
182
468
|
this.showPortal = true;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
469
|
+
this.setUpInputElement();
|
|
470
|
+
// Wait for the adapter to render. This creates the calendar.
|
|
471
|
+
queueMicrotask(() => {
|
|
472
|
+
this.datePickerCalendar.inputElement = this.inputElement;
|
|
473
|
+
});
|
|
187
474
|
event.stopPropagation();
|
|
188
475
|
document.addEventListener('mousedown', this.documentClickListener, {
|
|
189
476
|
passive: true,
|
|
@@ -192,6 +479,25 @@ const DatePicker = class {
|
|
|
192
479
|
capture: true,
|
|
193
480
|
});
|
|
194
481
|
}
|
|
482
|
+
// Tabbing to the clear icon doesn't blur the input field, only its
|
|
483
|
+
// input. Its `readonly` prop would also stop the calendar from opening.
|
|
484
|
+
setUpInputElement() {
|
|
485
|
+
this.inputElement = this.textField.shadowRoot.querySelector('input');
|
|
486
|
+
this.inputElement.readOnly = !this.acceptsTypedInput();
|
|
487
|
+
this.inputElement.addEventListener('blur', this.handleInputBlur);
|
|
488
|
+
}
|
|
489
|
+
handleInputBlur(event) {
|
|
490
|
+
const nextFocus = event.relatedTarget;
|
|
491
|
+
this.commitTypedText();
|
|
492
|
+
if (!nextFocus) {
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
requestAnimationFrame(() => {
|
|
496
|
+
if (!nextFocus.isConnected) {
|
|
497
|
+
this.inputElement.focus();
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
}
|
|
195
501
|
preventBlurFromCalendarContainer(event) {
|
|
196
502
|
// We don't want the input element to lose focus when we pick
|
|
197
503
|
// a date in the calendar container.
|
|
@@ -203,6 +509,8 @@ const DatePicker = class {
|
|
|
203
509
|
}
|
|
204
510
|
}
|
|
205
511
|
hideCalendar() {
|
|
512
|
+
this.isEditing = false;
|
|
513
|
+
this.commitTypedText();
|
|
206
514
|
setTimeout(() => {
|
|
207
515
|
this.showPortal = false;
|
|
208
516
|
}, 0);
|
|
@@ -225,15 +533,21 @@ const DatePicker = class {
|
|
|
225
533
|
}
|
|
226
534
|
const mdcTextField = new MDCTextField(root);
|
|
227
535
|
mdcTextField.getDefaultFoundation().deactivateFocus();
|
|
228
|
-
mdcTextField.valid = !this.invalid;
|
|
536
|
+
mdcTextField.valid = !(this.invalid || this.parseError);
|
|
537
|
+
// Removes the listeners but keeps the classes set above.
|
|
538
|
+
mdcTextField.destroy();
|
|
229
539
|
}
|
|
230
540
|
handleCalendarChange(event) {
|
|
231
|
-
|
|
541
|
+
var _a;
|
|
232
542
|
event.stopPropagation();
|
|
543
|
+
// Reset before hiding, or text typed earlier is committed over the
|
|
544
|
+
// pick. Preview the pick until the consumer echoes it back.
|
|
545
|
+
this.resetTypedText();
|
|
546
|
+
this.previewValue = (_a = event.detail) !== null && _a !== void 0 ? _a : undefined;
|
|
233
547
|
if (this.pickerIsAutoClosing()) {
|
|
234
548
|
this.hideCalendar();
|
|
235
549
|
}
|
|
236
|
-
this.change.emit(
|
|
550
|
+
this.change.emit(event.detail);
|
|
237
551
|
}
|
|
238
552
|
onInputClick(event) {
|
|
239
553
|
if (this.disabled || this.readonly || this.showPortal) {
|
|
@@ -242,22 +556,119 @@ const DatePicker = class {
|
|
|
242
556
|
this.showCalendar(event);
|
|
243
557
|
}
|
|
244
558
|
handleInputElementChange(event) {
|
|
245
|
-
|
|
246
|
-
|
|
559
|
+
event.stopPropagation();
|
|
560
|
+
if (this.disabled || this.readonly || !this.acceptsTypedInput()) {
|
|
247
561
|
return;
|
|
248
562
|
}
|
|
249
|
-
|
|
250
|
-
|
|
563
|
+
const text = event.detail;
|
|
564
|
+
if (text === this.discardedText) {
|
|
565
|
+
return;
|
|
251
566
|
}
|
|
252
|
-
|
|
567
|
+
const date = text === '' ? null : this.parseText(text);
|
|
568
|
+
this.rawInputValue = text;
|
|
569
|
+
this.previewValue = date !== null && date !== void 0 ? date : undefined;
|
|
570
|
+
// Half-typed text is only flagged on commit.
|
|
571
|
+
if (date || text === '') {
|
|
572
|
+
this.parseError = false;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
hasTypedText() {
|
|
576
|
+
var _a;
|
|
577
|
+
return (this.rawInputValue !== undefined ||
|
|
578
|
+
((_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value) !== this.getCommittedText());
|
|
579
|
+
}
|
|
580
|
+
// The input field only rewrites its text when its `value` changes.
|
|
581
|
+
discardTypedText() {
|
|
582
|
+
var _a;
|
|
583
|
+
this.discardedText = (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value;
|
|
584
|
+
this.resetTypedText();
|
|
585
|
+
if (this.inputElement) {
|
|
586
|
+
this.inputElement.value = this.getCommittedText();
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
getCommittedText() {
|
|
590
|
+
return this.getDisplayValue(this.formatter || this.formatValue);
|
|
591
|
+
}
|
|
592
|
+
commitTypedText() {
|
|
593
|
+
const text = this.rawInputValue;
|
|
594
|
+
if (text === undefined || text === this.committedText) {
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
const currentText = this.value ? this.formatValue(this.value) : '';
|
|
598
|
+
if (text === currentText) {
|
|
599
|
+
this.resetTypedText();
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
if (text === '') {
|
|
603
|
+
this.commitEmptyText();
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
this.commitDate(text);
|
|
607
|
+
}
|
|
608
|
+
commitEmptyText() {
|
|
609
|
+
this.parseError = false;
|
|
610
|
+
if (this.value) {
|
|
611
|
+
this.emitCommitted('', null);
|
|
612
|
+
}
|
|
613
|
+
else {
|
|
614
|
+
this.rawInputValue = undefined;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
commitDate(text) {
|
|
618
|
+
var _a;
|
|
619
|
+
const date = this.parseText(text);
|
|
620
|
+
if (!date) {
|
|
621
|
+
this.parseError = true;
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
if (date.getTime() === ((_a = this.value) === null || _a === void 0 ? void 0 : _a.getTime())) {
|
|
625
|
+
this.resetTypedText();
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
this.parseError = false;
|
|
629
|
+
this.emitCommitted(text, date);
|
|
630
|
+
}
|
|
631
|
+
// Keeps `rawInputValue` until `watchValue` resets it, or the old value
|
|
632
|
+
// flashes.
|
|
633
|
+
emitCommitted(text, date) {
|
|
634
|
+
this.committedText = text;
|
|
635
|
+
this.change.emit(date);
|
|
636
|
+
}
|
|
637
|
+
parseText(text) {
|
|
638
|
+
const date = this.dateFormatter.parseDate(text, this.internalFormat);
|
|
639
|
+
return date && !Number.isNaN(date.getTime()) ? date : null;
|
|
640
|
+
}
|
|
641
|
+
resetTypedText() {
|
|
642
|
+
this.parseError = false;
|
|
643
|
+
this.committedText = undefined;
|
|
644
|
+
this.rawInputValue = undefined;
|
|
645
|
+
this.previewValue = undefined;
|
|
253
646
|
}
|
|
254
647
|
pickerIsAutoClosing() {
|
|
255
648
|
return this.type !== 'datetime' && this.type !== 'time';
|
|
256
649
|
}
|
|
257
650
|
clearValue() {
|
|
651
|
+
this.resetTypedText();
|
|
258
652
|
this.change.emit(null);
|
|
259
653
|
}
|
|
260
654
|
get host() { return getElement(this); }
|
|
655
|
+
static get watchers() { return {
|
|
656
|
+
"value": [{
|
|
657
|
+
"watchValue": 0
|
|
658
|
+
}],
|
|
659
|
+
"parseError": [{
|
|
660
|
+
"watchParseError": 0
|
|
661
|
+
}],
|
|
662
|
+
"format": [{
|
|
663
|
+
"watchFormatInputs": 0
|
|
664
|
+
}],
|
|
665
|
+
"type": [{
|
|
666
|
+
"watchFormatInputs": 0
|
|
667
|
+
}],
|
|
668
|
+
"language": [{
|
|
669
|
+
"watchLanguage": 0
|
|
670
|
+
}]
|
|
671
|
+
}; }
|
|
261
672
|
};
|
|
262
673
|
DatePicker.style = datePickerCss();
|
|
263
674
|
|
|
@@ -1018,10 +1018,10 @@ const Dialog = class {
|
|
|
1018
1018
|
this.mdcDialog.destroy();
|
|
1019
1019
|
}
|
|
1020
1020
|
render() {
|
|
1021
|
-
return (h("div", { key: '
|
|
1021
|
+
return (h("div", { key: '3e1a6defb45d3a7db6569742226cb0f6f417fb6e', class: {
|
|
1022
1022
|
'mdc-dialog': true,
|
|
1023
1023
|
'full-screen': !!this.fullscreen,
|
|
1024
|
-
}, role: "alertdialog", "aria-modal": "true", "aria-labelledby": 'limel-dialog-title-' + this.id, "aria-describedby": 'limel-dialog-content-' + this.id }, h("input", { key: '
|
|
1024
|
+
}, role: "alertdialog", "aria-modal": "true", "aria-labelledby": 'limel-dialog-title-' + this.id, "aria-describedby": 'limel-dialog-content-' + this.id }, h("input", { key: '4a5f5cbd39cefc237854e87a3bd26c9a371d0703', hidden: true, id: "initialFocusEl" }), h("div", { key: 'cea96e7efebe5f92b65c36f9e9ff4b4814cf6245', class: "mdc-dialog__container" }, h("div", { key: '2002f463e8289d8e11974818e8339cd8506d9172', class: "mdc-dialog__surface" }, h("input", { key: 'ff0f029260dcd53f59f0ac7882b917e7fdff41a1', type: "button", id: "initialFocusElement" }), this.renderHeading(), h("div", { key: 'd2f23c68ef6fa558c7d40b7a729173bfc6c1e120', class: "mdc-dialog__content", id: 'limel-dialog-content-' + this.id }, h("slot", { key: '7b990ba91a610dad210627c1e6075b4db6ecd0c8' })), this.renderFooter())), h("div", { key: 'b878b47719571bac33c5f8f04e6271d11fd7bf69', class: "mdc-dialog__scrim" })));
|
|
1025
1025
|
}
|
|
1026
1026
|
watchHandler(newValue, oldValue) {
|
|
1027
1027
|
if (oldValue === newValue || !this.mdcDialog) {
|