@limetech/lime-elements 40.22.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 +19 -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 +266 -19
- 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/filled-defaults.js +132 -0
- package/dist/collection/components/form/form.js +122 -17
- package/dist/collection/components/form/form.test-schemas.js +61 -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 +266 -19
- 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-9b2623fe.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/filled-defaults.d.ts +12 -0
- package/dist/types/components/form/form.d.ts +19 -0
- package/dist/types/components/form/form.test-schemas.d.ts +3 -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 +46 -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 +4 -4
- 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
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { h, } from "@stencil/core";
|
|
2
|
+
import { createLiveMessage } from "../../util/live-message";
|
|
2
3
|
import { createRandomString } from "../../util/random-string";
|
|
3
4
|
import { isAndroidDevice, isIOSDevice } from "../../util/device";
|
|
4
5
|
import { DateFormatter } from "./date-formatter";
|
|
5
6
|
import { MDCTextField } from "@material/textfield";
|
|
7
|
+
import translate from "../../global/translations";
|
|
6
8
|
// tslint:disable:no-duplicate-string
|
|
7
9
|
const nativeTypeForConsumerType = {
|
|
8
10
|
date: 'date',
|
|
@@ -37,6 +39,7 @@ const nativeFormatForType = {
|
|
|
37
39
|
* @exampleComponent limel-example-date-picker-programmatic-change
|
|
38
40
|
* @exampleComponent limel-example-date-picker-composite
|
|
39
41
|
* @exampleComponent limel-example-date-picker-custom-formatter
|
|
42
|
+
* @exampleComponent limel-example-date-picker-typed-input
|
|
40
43
|
*/
|
|
41
44
|
export class DatePicker {
|
|
42
45
|
constructor() {
|
|
@@ -55,7 +58,8 @@ export class DatePicker {
|
|
|
55
58
|
this.readonly = false;
|
|
56
59
|
/**
|
|
57
60
|
* Set to `true` to indicate that the current value of the date picker is
|
|
58
|
-
* invalid.
|
|
61
|
+
* invalid. Typed text that is not a valid date is flagged by the
|
|
62
|
+
* component itself, whatever this is set to.
|
|
59
63
|
*/
|
|
60
64
|
this.invalid = false;
|
|
61
65
|
/**
|
|
@@ -72,15 +76,85 @@ export class DatePicker {
|
|
|
72
76
|
*/
|
|
73
77
|
this.language = 'en';
|
|
74
78
|
this.showPortal = false;
|
|
79
|
+
this.parseError = false;
|
|
80
|
+
this.isEditing = false;
|
|
75
81
|
this.portalId = `date-picker-calendar-${createRandomString()}`;
|
|
82
|
+
// Screen readers don't announce a changed description of the focused
|
|
83
|
+
// field, so the error is spoken through a live region.
|
|
84
|
+
this.errorMessage = createLiveMessage(() => this.parseError ? this.getHelperText() : '');
|
|
76
85
|
this.documentClickListener = (event) => {
|
|
77
86
|
if (event.composedPath().includes(this.textField)) {
|
|
78
87
|
return;
|
|
79
88
|
}
|
|
80
89
|
const element = document.querySelector(`#${this.portalId}`);
|
|
81
|
-
if (
|
|
82
|
-
|
|
90
|
+
if (element.contains(event.target)) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
// The input's own blur, which follows, closes the calendar with the
|
|
94
|
+
// final typed text.
|
|
95
|
+
if (this.textField.shadowRoot.activeElement === this.inputElement) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this.hideCalendar();
|
|
99
|
+
};
|
|
100
|
+
this.handleKeyDown = (event) => {
|
|
101
|
+
var _a;
|
|
102
|
+
if (this.disabled || this.readonly) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
this.discardedText = undefined;
|
|
106
|
+
const handlers = {
|
|
107
|
+
ArrowDown: this.handleArrowDown,
|
|
108
|
+
Escape: this.handleEscape,
|
|
109
|
+
Enter: this.handleEnter,
|
|
110
|
+
Backspace: this.handleDelete,
|
|
111
|
+
Delete: this.handleDelete,
|
|
112
|
+
};
|
|
113
|
+
(_a = handlers[event.key]) === null || _a === void 0 ? void 0 : _a.call(handlers, event);
|
|
114
|
+
};
|
|
115
|
+
this.handleArrowDown = async (event) => {
|
|
116
|
+
var _a;
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
if (!this.showPortal) {
|
|
119
|
+
this.showPortal = true;
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
await ((_a = this.datePickerCalendar) === null || _a === void 0 ? void 0 : _a.focusDay());
|
|
123
|
+
};
|
|
124
|
+
// The first Escape discards typed text, the next closes the calendar.
|
|
125
|
+
// Stopping it keeps a surrounding dialog open.
|
|
126
|
+
this.handleEscape = (event) => {
|
|
127
|
+
if (this.hasTypedText()) {
|
|
128
|
+
this.discardTypedText();
|
|
129
|
+
}
|
|
130
|
+
else if (this.showPortal) {
|
|
131
|
+
this.showPortal = false;
|
|
83
132
|
}
|
|
133
|
+
else {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
event.stopPropagation();
|
|
138
|
+
};
|
|
139
|
+
// Reads the input, since the input field emits its text debounced.
|
|
140
|
+
this.handleEnter = () => {
|
|
141
|
+
var _a, _b;
|
|
142
|
+
if (!this.acceptsTypedInput()) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const currentText = (_b = (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
|
|
146
|
+
this.rawInputValue = currentText;
|
|
147
|
+
if (currentText !== '' && !this.parseText(currentText)) {
|
|
148
|
+
this.parseError = true;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
this.commitTypedText();
|
|
152
|
+
};
|
|
153
|
+
this.handleDelete = () => {
|
|
154
|
+
if (this.acceptsTypedInput() || !this.value) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
this.clearValue();
|
|
84
158
|
};
|
|
85
159
|
this.formatValue = (value) => this.dateFormatter.formatDate(value, this.internalFormat);
|
|
86
160
|
this.handleCalendarChange = this.handleCalendarChange.bind(this);
|
|
@@ -94,6 +168,8 @@ export class DatePicker {
|
|
|
94
168
|
this.nativeChangeHandler = this.nativeChangeHandler.bind(this);
|
|
95
169
|
this.preventBlurFromCalendarContainer =
|
|
96
170
|
this.preventBlurFromCalendarContainer.bind(this);
|
|
171
|
+
this.commitTypedText = this.commitTypedText.bind(this);
|
|
172
|
+
this.handleInputBlur = this.handleInputBlur.bind(this);
|
|
97
173
|
}
|
|
98
174
|
componentWillLoad() {
|
|
99
175
|
this.useNative = !this.readonly && (isIOSDevice() || isAndroidDevice());
|
|
@@ -103,7 +179,28 @@ export class DatePicker {
|
|
|
103
179
|
this.updateInternalFormatAndType();
|
|
104
180
|
}
|
|
105
181
|
disconnectedCallback() {
|
|
182
|
+
var _a;
|
|
106
183
|
this.removeDocumentListeners();
|
|
184
|
+
(_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.removeEventListener('blur', this.handleInputBlur);
|
|
185
|
+
this.errorMessage.update.cancel();
|
|
186
|
+
}
|
|
187
|
+
// Consumers such as `limel-form` pass a new `Date` on every render.
|
|
188
|
+
watchValue(newValue, oldValue) {
|
|
189
|
+
if ((newValue === null || newValue === void 0 ? void 0 : newValue.getTime()) === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.getTime())) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
this.resetTypedText();
|
|
193
|
+
}
|
|
194
|
+
watchParseError() {
|
|
195
|
+
this.errorMessage.update();
|
|
196
|
+
this.invalidInput.emit(this.parseError ? this.getInvalidInputMessage() : null);
|
|
197
|
+
}
|
|
198
|
+
watchFormatInputs() {
|
|
199
|
+
this.resetTypedText();
|
|
200
|
+
}
|
|
201
|
+
watchLanguage() {
|
|
202
|
+
this.dateFormatter = new DateFormatter(this.language);
|
|
203
|
+
this.resetTypedText();
|
|
107
204
|
}
|
|
108
205
|
render() {
|
|
109
206
|
const inputProps = {
|
|
@@ -112,24 +209,56 @@ export class DatePicker {
|
|
|
112
209
|
if (this.value && !this.readonly && !this.disabled) {
|
|
113
210
|
inputProps.trailingIcon = 'clear_symbol';
|
|
114
211
|
}
|
|
115
|
-
const helperText = this.
|
|
212
|
+
const helperText = this.getHelperText();
|
|
116
213
|
if (this.useNative) {
|
|
117
214
|
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 }));
|
|
118
215
|
}
|
|
119
216
|
const dropdownZIndex = getComputedStyle(this.host).getPropertyValue('--dropdown-z-index');
|
|
120
217
|
const formatter = this.formatter || this.formatValue;
|
|
121
218
|
return [
|
|
122
|
-
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.
|
|
123
|
-
h("
|
|
219
|
+
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)),
|
|
220
|
+
h("span", { class: "error-message", "aria-live": "polite", ref: this.errorMessage.setElement }),
|
|
221
|
+
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 })),
|
|
124
222
|
];
|
|
125
223
|
}
|
|
224
|
+
getDisplayValue(formatter) {
|
|
225
|
+
if (this.rawInputValue !== undefined) {
|
|
226
|
+
return this.rawInputValue;
|
|
227
|
+
}
|
|
228
|
+
if (!this.value) {
|
|
229
|
+
return '';
|
|
230
|
+
}
|
|
231
|
+
return this.isEditing && this.acceptsTypedInput()
|
|
232
|
+
? this.formatValue(this.value)
|
|
233
|
+
: formatter(this.value);
|
|
234
|
+
}
|
|
235
|
+
acceptsTypedInput() {
|
|
236
|
+
return !this.formatter || !!this.format;
|
|
237
|
+
}
|
|
238
|
+
getHelperText() {
|
|
239
|
+
if (this.parseError) {
|
|
240
|
+
return this.getInvalidInputMessage();
|
|
241
|
+
}
|
|
242
|
+
if (this.disabled || this.readonly) {
|
|
243
|
+
return undefined;
|
|
244
|
+
}
|
|
245
|
+
return this.helperText;
|
|
246
|
+
}
|
|
247
|
+
getInvalidInputMessage() {
|
|
248
|
+
const key = this.type === 'time'
|
|
249
|
+
? 'date-picker.invalid-time-format'
|
|
250
|
+
: 'date-picker.invalid-format';
|
|
251
|
+
return translate.get(key, this.language, {
|
|
252
|
+
example: this.formatValue(new Date()),
|
|
253
|
+
});
|
|
254
|
+
}
|
|
126
255
|
updateInternalFormatAndType() {
|
|
127
256
|
this.nativeType = nativeTypeForConsumerType[this.type || 'default'];
|
|
128
257
|
this.nativeFormat = nativeFormatForType[this.nativeType];
|
|
129
258
|
if (this.useNative) {
|
|
130
259
|
this.internalFormat = this.nativeFormat;
|
|
131
260
|
}
|
|
132
|
-
else if (this.
|
|
261
|
+
else if (this.format) {
|
|
133
262
|
this.internalFormat = this.format;
|
|
134
263
|
}
|
|
135
264
|
else {
|
|
@@ -138,19 +267,27 @@ export class DatePicker {
|
|
|
138
267
|
}
|
|
139
268
|
nativeChangeHandler(event) {
|
|
140
269
|
event.stopPropagation();
|
|
141
|
-
|
|
142
|
-
|
|
270
|
+
if (event.detail === '') {
|
|
271
|
+
this.clearValue();
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
const date = this.parseText(event.detail);
|
|
275
|
+
if (date) {
|
|
276
|
+
this.change.emit(date);
|
|
277
|
+
}
|
|
143
278
|
}
|
|
144
279
|
showCalendar(event) {
|
|
145
280
|
if (this.disabled || this.readonly) {
|
|
146
281
|
event.stopPropagation();
|
|
147
282
|
return;
|
|
148
283
|
}
|
|
284
|
+
this.isEditing = true;
|
|
149
285
|
this.showPortal = true;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
286
|
+
this.setUpInputElement();
|
|
287
|
+
// Wait for the adapter to render. This creates the calendar.
|
|
288
|
+
queueMicrotask(() => {
|
|
289
|
+
this.datePickerCalendar.inputElement = this.inputElement;
|
|
290
|
+
});
|
|
154
291
|
event.stopPropagation();
|
|
155
292
|
document.addEventListener('mousedown', this.documentClickListener, {
|
|
156
293
|
passive: true,
|
|
@@ -159,6 +296,25 @@ export class DatePicker {
|
|
|
159
296
|
capture: true,
|
|
160
297
|
});
|
|
161
298
|
}
|
|
299
|
+
// Tabbing to the clear icon doesn't blur the input field, only its
|
|
300
|
+
// input. Its `readonly` prop would also stop the calendar from opening.
|
|
301
|
+
setUpInputElement() {
|
|
302
|
+
this.inputElement = this.textField.shadowRoot.querySelector('input');
|
|
303
|
+
this.inputElement.readOnly = !this.acceptsTypedInput();
|
|
304
|
+
this.inputElement.addEventListener('blur', this.handleInputBlur);
|
|
305
|
+
}
|
|
306
|
+
handleInputBlur(event) {
|
|
307
|
+
const nextFocus = event.relatedTarget;
|
|
308
|
+
this.commitTypedText();
|
|
309
|
+
if (!nextFocus) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
requestAnimationFrame(() => {
|
|
313
|
+
if (!nextFocus.isConnected) {
|
|
314
|
+
this.inputElement.focus();
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}
|
|
162
318
|
preventBlurFromCalendarContainer(event) {
|
|
163
319
|
// We don't want the input element to lose focus when we pick
|
|
164
320
|
// a date in the calendar container.
|
|
@@ -170,6 +326,8 @@ export class DatePicker {
|
|
|
170
326
|
}
|
|
171
327
|
}
|
|
172
328
|
hideCalendar() {
|
|
329
|
+
this.isEditing = false;
|
|
330
|
+
this.commitTypedText();
|
|
173
331
|
setTimeout(() => {
|
|
174
332
|
this.showPortal = false;
|
|
175
333
|
}, 0);
|
|
@@ -192,15 +350,21 @@ export class DatePicker {
|
|
|
192
350
|
}
|
|
193
351
|
const mdcTextField = new MDCTextField(root);
|
|
194
352
|
mdcTextField.getDefaultFoundation().deactivateFocus();
|
|
195
|
-
mdcTextField.valid = !this.invalid;
|
|
353
|
+
mdcTextField.valid = !(this.invalid || this.parseError);
|
|
354
|
+
// Removes the listeners but keeps the classes set above.
|
|
355
|
+
mdcTextField.destroy();
|
|
196
356
|
}
|
|
197
357
|
handleCalendarChange(event) {
|
|
198
|
-
|
|
358
|
+
var _a;
|
|
199
359
|
event.stopPropagation();
|
|
360
|
+
// Reset before hiding, or text typed earlier is committed over the
|
|
361
|
+
// pick. Preview the pick until the consumer echoes it back.
|
|
362
|
+
this.resetTypedText();
|
|
363
|
+
this.previewValue = (_a = event.detail) !== null && _a !== void 0 ? _a : undefined;
|
|
200
364
|
if (this.pickerIsAutoClosing()) {
|
|
201
365
|
this.hideCalendar();
|
|
202
366
|
}
|
|
203
|
-
this.change.emit(
|
|
367
|
+
this.change.emit(event.detail);
|
|
204
368
|
}
|
|
205
369
|
onInputClick(event) {
|
|
206
370
|
if (this.disabled || this.readonly || this.showPortal) {
|
|
@@ -209,19 +373,99 @@ export class DatePicker {
|
|
|
209
373
|
this.showCalendar(event);
|
|
210
374
|
}
|
|
211
375
|
handleInputElementChange(event) {
|
|
212
|
-
|
|
213
|
-
|
|
376
|
+
event.stopPropagation();
|
|
377
|
+
if (this.disabled || this.readonly || !this.acceptsTypedInput()) {
|
|
214
378
|
return;
|
|
215
379
|
}
|
|
216
|
-
|
|
217
|
-
|
|
380
|
+
const text = event.detail;
|
|
381
|
+
if (text === this.discardedText) {
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
const date = text === '' ? null : this.parseText(text);
|
|
385
|
+
this.rawInputValue = text;
|
|
386
|
+
this.previewValue = date !== null && date !== void 0 ? date : undefined;
|
|
387
|
+
// Half-typed text is only flagged on commit.
|
|
388
|
+
if (date || text === '') {
|
|
389
|
+
this.parseError = false;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
hasTypedText() {
|
|
393
|
+
var _a;
|
|
394
|
+
return (this.rawInputValue !== undefined ||
|
|
395
|
+
((_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value) !== this.getCommittedText());
|
|
396
|
+
}
|
|
397
|
+
// The input field only rewrites its text when its `value` changes.
|
|
398
|
+
discardTypedText() {
|
|
399
|
+
var _a;
|
|
400
|
+
this.discardedText = (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value;
|
|
401
|
+
this.resetTypedText();
|
|
402
|
+
if (this.inputElement) {
|
|
403
|
+
this.inputElement.value = this.getCommittedText();
|
|
218
404
|
}
|
|
219
|
-
|
|
405
|
+
}
|
|
406
|
+
getCommittedText() {
|
|
407
|
+
return this.getDisplayValue(this.formatter || this.formatValue);
|
|
408
|
+
}
|
|
409
|
+
commitTypedText() {
|
|
410
|
+
const text = this.rawInputValue;
|
|
411
|
+
if (text === undefined || text === this.committedText) {
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
const currentText = this.value ? this.formatValue(this.value) : '';
|
|
415
|
+
if (text === currentText) {
|
|
416
|
+
this.resetTypedText();
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
if (text === '') {
|
|
420
|
+
this.commitEmptyText();
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
this.commitDate(text);
|
|
424
|
+
}
|
|
425
|
+
commitEmptyText() {
|
|
426
|
+
this.parseError = false;
|
|
427
|
+
if (this.value) {
|
|
428
|
+
this.emitCommitted('', null);
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
this.rawInputValue = undefined;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
commitDate(text) {
|
|
435
|
+
var _a;
|
|
436
|
+
const date = this.parseText(text);
|
|
437
|
+
if (!date) {
|
|
438
|
+
this.parseError = true;
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
if (date.getTime() === ((_a = this.value) === null || _a === void 0 ? void 0 : _a.getTime())) {
|
|
442
|
+
this.resetTypedText();
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
this.parseError = false;
|
|
446
|
+
this.emitCommitted(text, date);
|
|
447
|
+
}
|
|
448
|
+
// Keeps `rawInputValue` until `watchValue` resets it, or the old value
|
|
449
|
+
// flashes.
|
|
450
|
+
emitCommitted(text, date) {
|
|
451
|
+
this.committedText = text;
|
|
452
|
+
this.change.emit(date);
|
|
453
|
+
}
|
|
454
|
+
parseText(text) {
|
|
455
|
+
const date = this.dateFormatter.parseDate(text, this.internalFormat);
|
|
456
|
+
return date && !Number.isNaN(date.getTime()) ? date : null;
|
|
457
|
+
}
|
|
458
|
+
resetTypedText() {
|
|
459
|
+
this.parseError = false;
|
|
460
|
+
this.committedText = undefined;
|
|
461
|
+
this.rawInputValue = undefined;
|
|
462
|
+
this.previewValue = undefined;
|
|
220
463
|
}
|
|
221
464
|
pickerIsAutoClosing() {
|
|
222
465
|
return this.type !== 'datetime' && this.type !== 'time';
|
|
223
466
|
}
|
|
224
467
|
clearValue() {
|
|
468
|
+
this.resetTypedText();
|
|
225
469
|
this.change.emit(null);
|
|
226
470
|
}
|
|
227
471
|
static get is() { return "limel-date-picker"; }
|
|
@@ -290,7 +534,7 @@ export class DatePicker {
|
|
|
290
534
|
"optional": false,
|
|
291
535
|
"docs": {
|
|
292
536
|
"tags": [],
|
|
293
|
-
"text": "Set to `true` to indicate that the current value of the date picker is\ninvalid."
|
|
537
|
+
"text": "Set to `true` to indicate that the current value of the date picker is\ninvalid. Typed text that is not a valid date is flagged by the\ncomponent itself, whatever this is set to."
|
|
294
538
|
},
|
|
295
539
|
"getter": false,
|
|
296
540
|
"setter": false,
|
|
@@ -348,7 +592,7 @@ export class DatePicker {
|
|
|
348
592
|
"optional": false,
|
|
349
593
|
"docs": {
|
|
350
594
|
"tags": [],
|
|
351
|
-
"text": "Optional helper text to display below the input field when it has focus.\nScreen readers read it as the description of the field, so use it for\nwhat the user needs to know, such as the format of the value or a\nrequirement."
|
|
595
|
+
"text": "Optional helper text to display below the input field when it has focus.\nScreen readers read it as the description of the field, so use it for\nwhat the user needs to know, such as the format of the value or a\nrequirement.\n\nWhile the typed text is not a valid date, an error with an example\nof the expected format is shown instead."
|
|
352
596
|
},
|
|
353
597
|
"getter": false,
|
|
354
598
|
"setter": false,
|
|
@@ -487,7 +731,7 @@ export class DatePicker {
|
|
|
487
731
|
"optional": true,
|
|
488
732
|
"docs": {
|
|
489
733
|
"tags": [],
|
|
490
|
-
"text": "Custom formatting function. Will be used for date formatting.\n\n:::note\noverrides `format` and `language`\n:::"
|
|
734
|
+
"text": "Custom formatting function. Will be used for date formatting.\n\n:::note\noverrides `format` and `language`. A date can only be typed into the\nfield when `format` is set as well, to the pattern your `formatter`\nproduces. Typed text is parsed with `format` and `language`, and the\nfield shows the value in `format` while it is being edited.\n:::"
|
|
491
735
|
},
|
|
492
736
|
"getter": false,
|
|
493
737
|
"setter": false
|
|
@@ -497,7 +741,11 @@ export class DatePicker {
|
|
|
497
741
|
static get states() {
|
|
498
742
|
return {
|
|
499
743
|
"internalFormat": {},
|
|
500
|
-
"showPortal": {}
|
|
744
|
+
"showPortal": {},
|
|
745
|
+
"parseError": {},
|
|
746
|
+
"rawInputValue": {},
|
|
747
|
+
"previewValue": {},
|
|
748
|
+
"isEditing": {}
|
|
501
749
|
};
|
|
502
750
|
}
|
|
503
751
|
static get events() {
|
|
@@ -509,7 +757,7 @@ export class DatePicker {
|
|
|
509
757
|
"composed": true,
|
|
510
758
|
"docs": {
|
|
511
759
|
"tags": [],
|
|
512
|
-
"text": "Emitted when the date
|
|
760
|
+
"text": "Emitted when a typed date is committed (on blur or `Enter`), when a\ndate is picked in the calendar, and with `null` when the field is\ncleared. Typed text that is not a valid date is not emitted, so\n`value` keeps the last valid date, and `invalidInput` is emitted\ninstead.\n\nA two-digit year is read as a full year, so `1/24/20` is 2020."
|
|
513
761
|
},
|
|
514
762
|
"complexType": {
|
|
515
763
|
"original": "Date",
|
|
@@ -521,7 +769,40 @@ export class DatePicker {
|
|
|
521
769
|
}
|
|
522
770
|
}
|
|
523
771
|
}
|
|
772
|
+
}, {
|
|
773
|
+
"method": "invalidInput",
|
|
774
|
+
"name": "invalidInput",
|
|
775
|
+
"bubbles": true,
|
|
776
|
+
"cancelable": true,
|
|
777
|
+
"composed": true,
|
|
778
|
+
"docs": {
|
|
779
|
+
"tags": [],
|
|
780
|
+
"text": "Emitted with the error message when typed text that is not a valid\ndate is committed, and with `null` when the field no longer holds\nsuch text."
|
|
781
|
+
},
|
|
782
|
+
"complexType": {
|
|
783
|
+
"original": "string | null",
|
|
784
|
+
"resolved": "string",
|
|
785
|
+
"references": {}
|
|
786
|
+
}
|
|
524
787
|
}];
|
|
525
788
|
}
|
|
526
789
|
static get elementRef() { return "host"; }
|
|
790
|
+
static get watchers() {
|
|
791
|
+
return [{
|
|
792
|
+
"propName": "value",
|
|
793
|
+
"methodName": "watchValue"
|
|
794
|
+
}, {
|
|
795
|
+
"propName": "parseError",
|
|
796
|
+
"methodName": "watchParseError"
|
|
797
|
+
}, {
|
|
798
|
+
"propName": "format",
|
|
799
|
+
"methodName": "watchFormatInputs"
|
|
800
|
+
}, {
|
|
801
|
+
"propName": "type",
|
|
802
|
+
"methodName": "watchFormatInputs"
|
|
803
|
+
}, {
|
|
804
|
+
"propName": "language",
|
|
805
|
+
"methodName": "watchLanguage"
|
|
806
|
+
}];
|
|
807
|
+
}
|
|
527
808
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
1
|
+
import { h, Host, } from "@stencil/core";
|
|
2
2
|
import translate from "../../../global/translations";
|
|
3
3
|
import { DatePicker as DateOnlyPicker } from "../pickers/date-picker";
|
|
4
4
|
import { DatetimePicker } from "../pickers/datetime-picker";
|
|
@@ -60,9 +60,14 @@ export class DatePickerCalendar {
|
|
|
60
60
|
break;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
}
|
|
64
|
+
// `componentDidUpdate` ignores `value` while the calendar is open.
|
|
65
|
+
watchPreviewValue() {
|
|
66
|
+
var _a;
|
|
67
|
+
if (!this.isOpen) {
|
|
68
|
+
return;
|
|
65
69
|
}
|
|
70
|
+
this.picker.setValue((_a = this.previewValue) !== null && _a !== void 0 ? _a : this.value);
|
|
66
71
|
}
|
|
67
72
|
componentDidUpdate() {
|
|
68
73
|
if (!this.flatPickrCreated) {
|
|
@@ -73,7 +78,7 @@ export class DatePickerCalendar {
|
|
|
73
78
|
}
|
|
74
79
|
}
|
|
75
80
|
createFlatpickr() {
|
|
76
|
-
var _a, _b;
|
|
81
|
+
var _a, _b, _c;
|
|
77
82
|
if (!this.inputElement) {
|
|
78
83
|
// The input element is programatically set on this element
|
|
79
84
|
// after its been rendered.
|
|
@@ -83,9 +88,21 @@ export class DatePickerCalendar {
|
|
|
83
88
|
((_b = (_a = this.container).checkVisibility) === null || _b === void 0 ? void 0 : _b.call(_a)) === false) {
|
|
84
89
|
return;
|
|
85
90
|
}
|
|
86
|
-
|
|
91
|
+
// Flatpickr focuses the input it is bound to on Escape, Shift+Tab
|
|
92
|
+
// and closing, but the proxy is hidden and can't take focus.
|
|
93
|
+
this.proxyInput.focus = () => this.inputElement.focus();
|
|
94
|
+
this.picker.init(this.proxyInput, this.container, (_c = this.previewValue) !== null && _c !== void 0 ? _c : this.value);
|
|
87
95
|
this.flatPickrCreated = true;
|
|
88
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Moves focus to the selected day, else today, else the first day of
|
|
99
|
+
* the month.
|
|
100
|
+
* @returns `false` when the calendar has no day grid
|
|
101
|
+
*/
|
|
102
|
+
async focusDay() {
|
|
103
|
+
var _a, _b;
|
|
104
|
+
return (_b = (_a = this.picker) === null || _a === void 0 ? void 0 : _a.focusDay()) !== null && _b !== void 0 ? _b : false;
|
|
105
|
+
}
|
|
89
106
|
connectedCallback() {
|
|
90
107
|
this.deferredDestroy.cancel();
|
|
91
108
|
}
|
|
@@ -96,9 +113,9 @@ export class DatePickerCalendar {
|
|
|
96
113
|
});
|
|
97
114
|
}
|
|
98
115
|
render() {
|
|
99
|
-
return (h("div", { key: '
|
|
116
|
+
return (h(Host, { key: 'ceea5193e673dbf06b5b39f74ebeaa4f9dfac3be' }, h("input", { key: 'bb62c924bdf96790303f5930e8e0e30b00139e35', type: "text", tabindex: -1, "aria-hidden": "true", hidden: true, ref: (el) => (this.proxyInput = el) }), h("div", { key: '6e6fd47d001c10ef107a8049f27eccd0f4721463', class: "container", ref: (el) => (this.container = el), style: {
|
|
100
117
|
'--today-label': `"${translate.get('date-picker.today', this.language)}"`,
|
|
101
|
-
} }));
|
|
118
|
+
} })));
|
|
102
119
|
}
|
|
103
120
|
static get is() { return "limel-flatpickr-adapter"; }
|
|
104
121
|
static get encapsulation() { return "shadow"; }
|
|
@@ -136,6 +153,28 @@ export class DatePickerCalendar {
|
|
|
136
153
|
"getter": false,
|
|
137
154
|
"setter": false
|
|
138
155
|
},
|
|
156
|
+
"previewValue": {
|
|
157
|
+
"type": "unknown",
|
|
158
|
+
"mutable": false,
|
|
159
|
+
"complexType": {
|
|
160
|
+
"original": "Date",
|
|
161
|
+
"resolved": "Date",
|
|
162
|
+
"references": {
|
|
163
|
+
"Date": {
|
|
164
|
+
"location": "global",
|
|
165
|
+
"id": "global::Date"
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"required": false,
|
|
170
|
+
"optional": true,
|
|
171
|
+
"docs": {
|
|
172
|
+
"tags": [],
|
|
173
|
+
"text": "Shown as selected instead of `value` while set."
|
|
174
|
+
},
|
|
175
|
+
"getter": false,
|
|
176
|
+
"setter": false
|
|
177
|
+
},
|
|
139
178
|
"type": {
|
|
140
179
|
"type": "string",
|
|
141
180
|
"mutable": false,
|
|
@@ -218,7 +257,7 @@ export class DatePickerCalendar {
|
|
|
218
257
|
"optional": false,
|
|
219
258
|
"docs": {
|
|
220
259
|
"tags": [],
|
|
221
|
-
"text": "The
|
|
260
|
+
"text": "The input the user types into. Setting it creates the calendar."
|
|
222
261
|
},
|
|
223
262
|
"getter": false,
|
|
224
263
|
"setter": false
|
|
@@ -249,28 +288,6 @@ export class DatePickerCalendar {
|
|
|
249
288
|
"reflect": false,
|
|
250
289
|
"attribute": "language",
|
|
251
290
|
"defaultValue": "'en'"
|
|
252
|
-
},
|
|
253
|
-
"formatter": {
|
|
254
|
-
"type": "unknown",
|
|
255
|
-
"mutable": false,
|
|
256
|
-
"complexType": {
|
|
257
|
-
"original": "(date: Date) => string",
|
|
258
|
-
"resolved": "(date: Date) => string",
|
|
259
|
-
"references": {
|
|
260
|
-
"Date": {
|
|
261
|
-
"location": "global",
|
|
262
|
-
"id": "global::Date"
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
},
|
|
266
|
-
"required": true,
|
|
267
|
-
"optional": false,
|
|
268
|
-
"docs": {
|
|
269
|
-
"tags": [],
|
|
270
|
-
"text": ""
|
|
271
|
-
},
|
|
272
|
-
"getter": false,
|
|
273
|
-
"setter": false
|
|
274
291
|
}
|
|
275
292
|
};
|
|
276
293
|
}
|
|
@@ -297,4 +314,34 @@ export class DatePickerCalendar {
|
|
|
297
314
|
}
|
|
298
315
|
}];
|
|
299
316
|
}
|
|
317
|
+
static get methods() {
|
|
318
|
+
return {
|
|
319
|
+
"focusDay": {
|
|
320
|
+
"complexType": {
|
|
321
|
+
"signature": "() => Promise<boolean>",
|
|
322
|
+
"parameters": [],
|
|
323
|
+
"references": {
|
|
324
|
+
"Promise": {
|
|
325
|
+
"location": "global",
|
|
326
|
+
"id": "global::Promise"
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
"return": "Promise<boolean>"
|
|
330
|
+
},
|
|
331
|
+
"docs": {
|
|
332
|
+
"text": "Moves focus to the selected day, else today, else the first day of\nthe month.",
|
|
333
|
+
"tags": [{
|
|
334
|
+
"name": "returns",
|
|
335
|
+
"text": "`false` when the calendar has no day grid"
|
|
336
|
+
}]
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
static get watchers() {
|
|
342
|
+
return [{
|
|
343
|
+
"propName": "previewValue",
|
|
344
|
+
"methodName": "watchPreviewValue"
|
|
345
|
+
}];
|
|
346
|
+
}
|
|
300
347
|
}
|
|
@@ -45,6 +45,9 @@ export class MonthPicker extends Picker {
|
|
|
45
45
|
}
|
|
46
46
|
async handleClose(selectedDates) {
|
|
47
47
|
await super.handleClose(selectedDates);
|
|
48
|
+
this.redrawSelection();
|
|
49
|
+
}
|
|
50
|
+
redrawSelection() {
|
|
48
51
|
this.selectMonth(this.flatpickr.selectedDates, this.flatpickr.input.value, this.flatpickr);
|
|
49
52
|
}
|
|
50
53
|
handleReady(_, __, fp) {
|