@limetech/lime-elements 40.23.0 → 40.25.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 +20 -0
- package/dist/cjs/{checkbox.template-CNJ29zDR.js → checkbox.template-DgiUCPna.js} +1 -1
- package/dist/cjs/dom-BWMDM6En.js +32 -0
- package/dist/cjs/{image.template-DlF-f23b.js → image.template-B_HZH9t-.js} +1 -1
- package/dist/cjs/{index-BlsqxTB1.js → index-CQn9p_mp.js} +12 -0
- package/dist/cjs/lime-elements.cjs.js +2 -2
- package/dist/cjs/limel-3d-hover-effect-glow.cjs.entry.js +2 -2
- package/dist/cjs/limel-action-bar_3.cjs.entry.js +5 -6
- package/dist/cjs/limel-ai-avatar.cjs.entry.js +3 -4
- package/dist/cjs/limel-badge_7.cjs.entry.js +13 -13
- package/dist/cjs/limel-banner.cjs.entry.js +2 -2
- package/dist/cjs/limel-button-group.cjs.entry.js +2 -2
- package/dist/cjs/limel-button.cjs.entry.js +3 -3
- package/dist/cjs/limel-callout.cjs.entry.js +3 -4
- package/dist/cjs/limel-card.cjs.entry.js +3 -3
- package/dist/cjs/limel-chart.cjs.entry.js +782 -180
- package/dist/cjs/limel-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/limel-chip-set.cjs.entry.js +3 -4
- package/dist/cjs/limel-chip_2.cjs.entry.js +4 -5
- package/dist/cjs/limel-circular-progress.cjs.entry.js +2 -2
- package/dist/cjs/limel-code-diff.cjs.entry.js +3 -4
- package/dist/cjs/limel-code-editor.cjs.entry.js +3 -4
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +3 -4
- package/dist/cjs/limel-color-picker-palette.cjs.entry.js +3 -3
- package/dist/cjs/limel-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/limel-config.cjs.entry.js +1 -1
- package/dist/cjs/limel-date-picker.cjs.entry.js +439 -28
- package/dist/cjs/limel-dialog.cjs.entry.js +3 -3
- package/dist/cjs/limel-dock-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-dock.cjs.entry.js +4 -5
- package/dist/cjs/limel-drag-handle_2.cjs.entry.js +5 -6
- package/dist/cjs/limel-dynamic-label.cjs.entry.js +1 -1
- package/dist/cjs/limel-email-viewer.cjs.entry.js +3 -4
- package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +3 -3
- package/dist/cjs/limel-file-viewer.cjs.entry.js +3 -4
- package/dist/cjs/limel-file.cjs.entry.js +3 -4
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +124 -16
- package/dist/cjs/limel-flex-container.cjs.entry.js +2 -2
- package/dist/cjs/limel-form-header.cjs.entry.js +2 -2
- package/dist/cjs/limel-form.cjs.entry.js +66 -6
- package/dist/cjs/limel-grid.cjs.entry.js +2 -2
- package/dist/cjs/limel-header.cjs.entry.js +2 -2
- package/dist/cjs/limel-help_2.cjs.entry.js +4 -4
- package/dist/cjs/limel-helper-line_3.cjs.entry.js +5 -5
- package/dist/cjs/limel-hotkey_4.cjs.entry.js +6 -6
- package/dist/cjs/limel-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/limel-icon.cjs.entry.js +2 -2
- package/dist/cjs/limel-info-tile.cjs.entry.js +3 -3
- package/dist/cjs/limel-list-item.cjs.entry.js +7 -8
- package/dist/cjs/limel-markdown.cjs.entry.js +2 -2
- package/dist/cjs/limel-masonry-layout.cjs.entry.js +2 -2
- package/dist/cjs/limel-menu-item-meta.cjs.entry.js +2 -2
- package/dist/cjs/limel-pagination-jump.cjs.entry.js +2 -3
- package/dist/cjs/limel-pagination.cjs.entry.js +7 -8
- package/dist/cjs/limel-picker.cjs.entry.js +7 -7
- package/dist/cjs/limel-popover_2.cjs.entry.js +3 -3
- package/dist/cjs/limel-profile-picture.cjs.entry.js +3 -4
- package/dist/cjs/limel-progress-flow-item.cjs.entry.js +1 -1
- package/dist/cjs/limel-progress-flow.cjs.entry.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +3 -4
- package/dist/cjs/limel-radio-button-group.cjs.entry.js +2 -2
- package/dist/cjs/limel-radio-button.cjs.entry.js +3 -3
- package/dist/cjs/limel-resize-handle.cjs.entry.js +3 -4
- package/dist/cjs/limel-select.cjs.entry.js +3 -3
- package/dist/cjs/limel-shortcut.cjs.entry.js +2 -2
- package/dist/cjs/limel-side-panel.cjs.entry.js +3 -4
- package/dist/cjs/limel-slider.cjs.entry.js +5 -6
- package/dist/cjs/limel-snackbar.cjs.entry.js +4 -5
- package/dist/cjs/limel-split-button.cjs.entry.js +3 -3
- package/dist/cjs/limel-switch.cjs.entry.js +2 -2
- package/dist/cjs/limel-tab-bar.cjs.entry.js +2 -2
- package/dist/cjs/limel-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/limel-table.cjs.entry.js +4 -5
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +5 -6
- package/dist/cjs/limel-text-editor.cjs.entry.js +2 -2
- package/dist/cjs/{live-message-BNl3Ihcz.js → live-message-CwxlKd60.js} +0 -30
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{render-list-component-BtAliHQp.js → render-list-component-BOYFHMFE.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/chart/chart.css +29 -0
- package/dist/collection/components/chart/chart.js +352 -67
- package/dist/collection/components/chart/options.js +342 -109
- package/dist/collection/components/chart/scale.js +25 -2
- package/dist/collection/components/chart/series.js +110 -0
- 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/{checkbox.template-CAja2LKZ.js → checkbox.template-BJJmiDJP.js} +1 -1
- package/dist/esm/dom-B9Ofc5RB.js +30 -0
- package/dist/esm/{image.template-BGjw97m_.js → image.template-Cw2q5IS7.js} +1 -1
- package/dist/esm/{index-BU9IJqli.js → index-D3SUrFhp.js} +12 -1
- package/dist/esm/{keyboard-navigation-BF7IKmnG.js → keyboard-navigation-DeMxdkNf.js} +1 -1
- package/dist/esm/lime-elements.js +3 -3
- package/dist/esm/limel-3d-hover-effect-glow.entry.js +2 -2
- package/dist/esm/limel-action-bar_3.entry.js +5 -6
- package/dist/esm/limel-ai-avatar.entry.js +3 -4
- package/dist/esm/limel-badge_7.entry.js +12 -12
- package/dist/esm/limel-banner.entry.js +2 -2
- package/dist/esm/limel-button-group.entry.js +2 -2
- package/dist/esm/limel-button.entry.js +3 -3
- package/dist/esm/limel-callout.entry.js +3 -4
- package/dist/esm/limel-card.entry.js +3 -3
- package/dist/esm/limel-chart.entry.js +779 -177
- package/dist/esm/limel-checkbox.entry.js +3 -3
- package/dist/esm/limel-chip-set.entry.js +3 -4
- package/dist/esm/limel-chip_2.entry.js +4 -5
- package/dist/esm/limel-circular-progress.entry.js +2 -2
- package/dist/esm/limel-code-diff.entry.js +3 -4
- package/dist/esm/limel-code-editor.entry.js +3 -4
- package/dist/esm/limel-collapsible-section.entry.js +3 -4
- package/dist/esm/limel-color-picker-palette.entry.js +3 -3
- package/dist/esm/limel-color-picker.entry.js +2 -2
- package/dist/esm/limel-config.entry.js +1 -1
- package/dist/esm/limel-date-picker.entry.js +436 -25
- package/dist/esm/limel-dialog.entry.js +3 -3
- package/dist/esm/limel-dock-button.entry.js +1 -1
- package/dist/esm/limel-dock.entry.js +4 -5
- package/dist/esm/limel-drag-handle_2.entry.js +5 -6
- package/dist/esm/limel-dynamic-label.entry.js +1 -1
- package/dist/esm/limel-email-viewer.entry.js +3 -4
- package/dist/esm/limel-file-dropzone_2.entry.js +3 -3
- package/dist/esm/limel-file-viewer.entry.js +3 -4
- package/dist/esm/limel-file.entry.js +3 -4
- package/dist/esm/limel-flatpickr-adapter.entry.js +118 -10
- package/dist/esm/limel-flex-container.entry.js +2 -2
- package/dist/esm/limel-form-header.entry.js +2 -2
- package/dist/esm/limel-form.entry.js +66 -6
- package/dist/esm/limel-grid.entry.js +2 -2
- package/dist/esm/limel-header.entry.js +2 -2
- package/dist/esm/limel-help_2.entry.js +4 -4
- package/dist/esm/limel-helper-line_3.entry.js +5 -5
- package/dist/esm/limel-hotkey_4.entry.js +6 -6
- package/dist/esm/limel-icon-button.entry.js +2 -2
- package/dist/esm/limel-icon.entry.js +2 -2
- package/dist/esm/limel-info-tile.entry.js +3 -3
- package/dist/esm/limel-list-item.entry.js +7 -8
- package/dist/esm/limel-markdown.entry.js +2 -2
- package/dist/esm/limel-masonry-layout.entry.js +2 -2
- package/dist/esm/limel-menu-item-meta.entry.js +2 -2
- package/dist/esm/limel-pagination-jump.entry.js +2 -3
- package/dist/esm/limel-pagination.entry.js +3 -4
- package/dist/esm/limel-picker.entry.js +5 -5
- package/dist/esm/limel-popover_2.entry.js +3 -3
- package/dist/esm/limel-profile-picture.entry.js +3 -4
- package/dist/esm/limel-progress-flow-item.entry.js +1 -1
- package/dist/esm/limel-progress-flow.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +3 -4
- package/dist/esm/limel-radio-button-group.entry.js +2 -2
- package/dist/esm/limel-radio-button.entry.js +3 -3
- package/dist/esm/limel-resize-handle.entry.js +3 -4
- package/dist/esm/limel-select.entry.js +3 -3
- package/dist/esm/limel-shortcut.entry.js +2 -2
- package/dist/esm/limel-side-panel.entry.js +3 -4
- package/dist/esm/limel-slider.entry.js +5 -6
- package/dist/esm/limel-snackbar.entry.js +4 -5
- package/dist/esm/limel-split-button.entry.js +3 -3
- package/dist/esm/limel-switch.entry.js +2 -2
- package/dist/esm/limel-tab-bar.entry.js +3 -3
- package/dist/esm/limel-tab-panel.entry.js +2 -2
- package/dist/esm/limel-table.entry.js +4 -5
- package/dist/esm/limel-text-editor-link-menu.entry.js +5 -6
- package/dist/esm/limel-text-editor.entry.js +2 -2
- package/dist/esm/{live-message-BQAYeNiX.js → live-message-BKB4vu28.js} +1 -30
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{render-list-component-J1IzNpbv.js → render-list-component-CnMNjOaj.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-07961d4f.entry.js +1 -0
- package/dist/lime-elements/p-099e9e1a.entry.js +1 -0
- package/dist/lime-elements/p-0dd5cb25.entry.js +1 -0
- package/dist/lime-elements/{p-40940a6c.entry.js → p-1d57370e.entry.js} +1 -1
- package/dist/lime-elements/p-1ef92aa3.entry.js +1 -0
- package/dist/lime-elements/p-1eff9347.entry.js +56 -0
- package/dist/lime-elements/{p-6053608a.entry.js → p-22458db2.entry.js} +2 -2
- package/dist/lime-elements/{p-db9cb7ef.entry.js → p-2520a91b.entry.js} +1 -1
- package/dist/lime-elements/{p-85318636.entry.js → p-25473848.entry.js} +1 -1
- package/dist/lime-elements/p-27000dfb.entry.js +1 -0
- package/dist/lime-elements/p-29800b71.entry.js +1 -0
- package/dist/lime-elements/{p-438fe49b.entry.js → p-2e1fd8c4.entry.js} +1 -1
- package/dist/lime-elements/p-2f6ee1b0.entry.js +1 -0
- package/dist/lime-elements/{p-c61e9b83.entry.js → p-427a3da3.entry.js} +1 -1
- package/dist/lime-elements/p-447a2633.entry.js +1 -0
- package/dist/lime-elements/{p-909466b8.entry.js → p-4c54780d.entry.js} +1 -1
- package/dist/lime-elements/p-4f81f0b4.entry.js +1 -0
- package/dist/lime-elements/{p-7d0ffc60.entry.js → p-5062b51a.entry.js} +1 -1
- package/dist/lime-elements/p-5295b4c7.entry.js +1 -0
- package/dist/lime-elements/p-5a1b7f4d.entry.js +1 -0
- package/dist/lime-elements/{p-a6387dc7.entry.js → p-5b9c1f8f.entry.js} +1 -1
- package/dist/lime-elements/p-5be1e9e8.entry.js +159 -0
- package/dist/lime-elements/p-5c6589aa.entry.js +1 -0
- package/dist/lime-elements/{p-3f7fa772.entry.js → p-5e7ca1fd.entry.js} +1 -1
- package/dist/lime-elements/{p-95a486c8.entry.js → p-5f66e497.entry.js} +1 -1
- package/dist/lime-elements/p-667759da.entry.js +1 -0
- package/dist/lime-elements/{p-48a412ed.entry.js → p-6a340609.entry.js} +1 -1
- package/dist/lime-elements/{p-a891f3e8.entry.js → p-6d3cde2e.entry.js} +1 -1
- package/dist/lime-elements/{p-f59447bf.entry.js → p-6e529563.entry.js} +1 -1
- package/dist/lime-elements/{p-c2056ebc.entry.js → p-743f014f.entry.js} +1 -1
- package/dist/lime-elements/{p-c6b3448c.entry.js → p-7aa034e2.entry.js} +1 -1
- package/dist/lime-elements/p-7b2ec934.entry.js +1 -0
- package/dist/lime-elements/p-7b99624f.entry.js +1 -0
- package/dist/lime-elements/p-7ea96b80.entry.js +1 -0
- package/dist/lime-elements/{p-e5abe390.entry.js → p-7fe1d9ad.entry.js} +1 -1
- package/dist/lime-elements/p-842694af.entry.js +1 -0
- package/dist/lime-elements/{p-d3f13124.entry.js → p-848aeaa6.entry.js} +1 -1
- package/dist/lime-elements/{p-1e0ced6a.entry.js → p-868a8b12.entry.js} +1 -1
- package/dist/lime-elements/p-891f6a07.entry.js +1 -0
- package/dist/lime-elements/{p-28957b5c.entry.js → p-8dcb9ef1.entry.js} +1 -1
- package/dist/lime-elements/p-92f79a62.entry.js +1 -0
- package/dist/lime-elements/p-93907698.entry.js +16 -0
- package/dist/lime-elements/{p-c0ebf7cc.entry.js → p-9b3c7341.entry.js} +1 -1
- package/dist/lime-elements/p-B9Ofc5RB.js +1 -0
- package/dist/lime-elements/{p-_1yBt1pG.js → p-BJrZuSu3.js} +1 -1
- package/dist/lime-elements/{p-Cadm4-WZ.js → p-BzHrLZdr.js} +1 -1
- package/dist/lime-elements/p-CMedqTpE.js +1 -0
- package/dist/lime-elements/{p-BU9IJqli.js → p-D3SUrFhp.js} +2 -2
- package/dist/lime-elements/p-DpXrxCh5.js +1 -0
- package/dist/lime-elements/p-DwxRLqY6.js +1 -0
- package/dist/lime-elements/{p-c8a34cef.entry.js → p-a0501e84.entry.js} +1 -1
- package/dist/lime-elements/p-a5419b44.entry.js +1 -0
- package/dist/lime-elements/{p-ce71c5b9.entry.js → p-abd612b3.entry.js} +1 -1
- package/dist/lime-elements/{p-f3b93ce8.entry.js → p-aeac9588.entry.js} +2 -2
- package/dist/lime-elements/p-b01e8af9.entry.js +1 -0
- package/dist/lime-elements/{p-f97ec7a5.entry.js → p-b08c9b52.entry.js} +1 -1
- package/dist/lime-elements/{p-54537c85.entry.js → p-b1f6412e.entry.js} +1 -1
- package/dist/lime-elements/{p-6ae093c8.entry.js → p-b3967ab3.entry.js} +1 -1
- package/dist/lime-elements/{p-5dce791c.entry.js → p-b8bfec0e.entry.js} +1 -1
- package/dist/lime-elements/p-ba4b44ad.entry.js +1 -0
- package/dist/lime-elements/{p-783fd221.entry.js → p-bf726f16.entry.js} +1 -1
- package/dist/lime-elements/p-c2f27d2a.entry.js +1 -0
- package/dist/lime-elements/{p-271662d4.entry.js → p-c3bd19ea.entry.js} +1 -1
- package/dist/lime-elements/p-cc560bbd.entry.js +1 -0
- package/dist/lime-elements/{p-0319f07f.entry.js → p-d2953c11.entry.js} +1 -1
- package/dist/lime-elements/{p-764d2f86.entry.js → p-d3d01dd4.entry.js} +1 -1
- package/dist/lime-elements/{p-4b75e653.entry.js → p-d9e6175b.entry.js} +1 -1
- package/dist/lime-elements/p-dab5421d.entry.js +1 -0
- package/dist/lime-elements/p-dcaeefc9.entry.js +1 -0
- package/dist/lime-elements/{p-f71fbc9e.entry.js → p-df8aa135.entry.js} +4 -4
- package/dist/lime-elements/p-e2fb2af4.entry.js +1 -0
- package/dist/lime-elements/p-e929fc64.entry.js +1 -0
- package/dist/lime-elements/p-ea02dade.entry.js +1 -0
- package/dist/lime-elements/p-ecd633cb.entry.js +1 -0
- package/dist/lime-elements/{p-39d1e157.entry.js → p-f5cd53e8.entry.js} +1 -1
- package/dist/lime-elements/{p-8fe28845.entry.js → p-f7cae25a.entry.js} +1 -1
- package/dist/types/components/chart/chart.d.ts +59 -8
- package/dist/types/components/chart/chart.types.d.ts +23 -0
- package/dist/types/components/chart/options.d.ts +83 -8
- package/dist/types/components/chart/scale.d.ts +10 -0
- package/dist/types/components/chart/series.d.ts +71 -0
- 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 +73 -26
- 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 +3 -3
- 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-8e80a884.entry.js +0 -56
- 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-N9vxZMhe.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-cf2d43c7.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-eF09GxA_.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
|
@@ -15,12 +15,21 @@ const WHOLE_TYPES = new Set([
|
|
|
15
15
|
'doughnut',
|
|
16
16
|
'ring',
|
|
17
17
|
]);
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Types that draw their values along an axis, against the texts of the items
|
|
20
|
+
* along another one.
|
|
21
|
+
*/
|
|
22
|
+
const AXIS_TYPES = new Set([
|
|
19
23
|
'bar',
|
|
20
24
|
'dot',
|
|
21
25
|
'area',
|
|
22
26
|
'line',
|
|
23
27
|
]);
|
|
28
|
+
const STACK_TYPES = new Set([
|
|
29
|
+
'bar',
|
|
30
|
+
'area',
|
|
31
|
+
'line',
|
|
32
|
+
]);
|
|
24
33
|
/**
|
|
25
34
|
* Whether the items of a chart of this type are parts of one whole.
|
|
26
35
|
* @param type - the chart type
|
|
@@ -34,7 +43,21 @@ export function isPartOfWhole(type) {
|
|
|
34
43
|
* @param type - the chart type
|
|
35
44
|
*/
|
|
36
45
|
export function usesAxisIncrement(type) {
|
|
37
|
-
return
|
|
46
|
+
return AXIS_TYPES.has(type);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Whether a chart of this type can draw `series`.
|
|
50
|
+
* @param type - the chart type
|
|
51
|
+
*/
|
|
52
|
+
export function canDrawSeries(type) {
|
|
53
|
+
return AXIS_TYPES.has(type);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Whether a chart of this type can stack its `series` on each other.
|
|
57
|
+
* @param type - the chart type
|
|
58
|
+
*/
|
|
59
|
+
export function canStack(type) {
|
|
60
|
+
return STACK_TYPES.has(type);
|
|
38
61
|
}
|
|
39
62
|
/**
|
|
40
63
|
* Whether the item has a `[start, end]` range, or an `[x, y]` point in a
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { getValueSpan } from "./scale";
|
|
2
|
+
/**
|
|
3
|
+
* Lines up the items of the series by their text, since items of different
|
|
4
|
+
* series that have the same text belong to the same category. When a series
|
|
5
|
+
* has several items with the same text, its second item with that text lines
|
|
6
|
+
* up with the second one of the other series, and so on.
|
|
7
|
+
* @param series - the series
|
|
8
|
+
*/
|
|
9
|
+
export function alignSeries(series) {
|
|
10
|
+
const categories = [];
|
|
11
|
+
const placesOfTexts = new Map();
|
|
12
|
+
const placedSeries = series.map((current) => {
|
|
13
|
+
var _a;
|
|
14
|
+
const timesSeen = new Map();
|
|
15
|
+
return ((_a = current.items) !== null && _a !== void 0 ? _a : []).map((item) => {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
const occurrence = (_a = timesSeen.get(item.text)) !== null && _a !== void 0 ? _a : 0;
|
|
18
|
+
timesSeen.set(item.text, occurrence + 1);
|
|
19
|
+
const places = (_b = placesOfTexts.get(item.text)) !== null && _b !== void 0 ? _b : [];
|
|
20
|
+
placesOfTexts.set(item.text, places);
|
|
21
|
+
if (occurrence === places.length) {
|
|
22
|
+
places.push(categories.length);
|
|
23
|
+
categories.push(item.text);
|
|
24
|
+
}
|
|
25
|
+
return { item: item, index: places[occurrence] };
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
categories: categories,
|
|
30
|
+
series: series.map((current, index) => {
|
|
31
|
+
const itemsByCategory = new Map(placedSeries[index].map((placed) => [placed.index, placed.item]));
|
|
32
|
+
return {
|
|
33
|
+
text: current.text,
|
|
34
|
+
color: current.color,
|
|
35
|
+
items: categories.map((_, category) => itemsByCategory.get(category)),
|
|
36
|
+
};
|
|
37
|
+
}),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The item at a position, if there is one.
|
|
42
|
+
* @param grid - the series
|
|
43
|
+
* @param position - where the item is
|
|
44
|
+
*/
|
|
45
|
+
export function getItemAt(grid, position) {
|
|
46
|
+
var _a;
|
|
47
|
+
return (_a = grid.series[position.series]) === null || _a === void 0 ? void 0 : _a.items[position.index];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The series that has an item at a place on the axis and is nearest to a
|
|
51
|
+
* series: the series itself when it has an item there, otherwise the closest
|
|
52
|
+
* one, and the earlier of two that are as close.
|
|
53
|
+
* @param grid - the series
|
|
54
|
+
* @param position - the place on the axis, and the series to start from
|
|
55
|
+
*/
|
|
56
|
+
export function getNearestSeries(grid, position) {
|
|
57
|
+
const distance = (series) => Math.abs(series - position.series);
|
|
58
|
+
const [nearest] = [...grid.series.keys()]
|
|
59
|
+
.filter((series) => getItemAt(grid, Object.assign(Object.assign({}, position), { series: series })))
|
|
60
|
+
.sort((a, b) => distance(a) - distance(b));
|
|
61
|
+
return nearest;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The items of every series, in no particular order.
|
|
65
|
+
* @param grid - the series
|
|
66
|
+
*/
|
|
67
|
+
export function getAllItems(grid) {
|
|
68
|
+
return grid.series.flatMap((series) => series.items.filter((item) => item !== undefined));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The items that the value axis has to reach: every item, or, when the
|
|
72
|
+
* series are stacked, the two ends of the stack at each place on the axis.
|
|
73
|
+
* Positive and negative values are stacked on their own side of zero, and a
|
|
74
|
+
* range adds its extent to the stack.
|
|
75
|
+
* @param grid - the series
|
|
76
|
+
* @param stacked - whether the series are stacked on each other
|
|
77
|
+
*/
|
|
78
|
+
export function getAxisItems(grid, stacked) {
|
|
79
|
+
if (!stacked) {
|
|
80
|
+
return getAllItems(grid);
|
|
81
|
+
}
|
|
82
|
+
return grid.categories.flatMap((text, index) => {
|
|
83
|
+
const values = grid.series
|
|
84
|
+
.map((series) => series.items[index])
|
|
85
|
+
.filter((item) => item !== undefined)
|
|
86
|
+
.map((item) => getValueSpan(item));
|
|
87
|
+
const sum = (side) => values.filter((value) => side(value)).reduce((a, b) => a + b, 0);
|
|
88
|
+
return [
|
|
89
|
+
{ text: text, value: sum((value) => value > 0) },
|
|
90
|
+
{ text: text, value: sum((value) => value < 0) },
|
|
91
|
+
];
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Whether the item at a position ends its stack, since no later series has
|
|
96
|
+
* an item on the same side of zero at that place on the axis.
|
|
97
|
+
* @param grid - the stacked series
|
|
98
|
+
* @param position - where the item is
|
|
99
|
+
*/
|
|
100
|
+
export function endsStack(grid, position) {
|
|
101
|
+
const side = Math.sign(getStackedValue(grid, position));
|
|
102
|
+
return grid.series.slice(position.series + 1).every((_, offset) => Math.sign(getStackedValue(grid, {
|
|
103
|
+
series: position.series + 1 + offset,
|
|
104
|
+
index: position.index,
|
|
105
|
+
})) !== side);
|
|
106
|
+
}
|
|
107
|
+
function getStackedValue(grid, position) {
|
|
108
|
+
const item = getItemAt(grid, position);
|
|
109
|
+
return item ? getValueSpan(item) : 0;
|
|
110
|
+
}
|
|
@@ -136,7 +136,7 @@ export class Checkbox {
|
|
|
136
136
|
this.destroyMDCInstances();
|
|
137
137
|
}
|
|
138
138
|
render() {
|
|
139
|
-
return (h(CheckboxTemplate, { key: '
|
|
139
|
+
return (h(CheckboxTemplate, { key: '5c6124e776b86e4564459699235b59b7dbdf7d37', disabled: this.disabled || this.readonly, label: this.label, readonlyLabels: this.readonlyLabels, helperText: this.helperText, helperTextId: this.helperTextId, checked: this.checked || this.indeterminate, indeterminate: this.indeterminate, required: this.required, readonly: this.readonly, invalid: this.isInvalid(), onChange: this.onChange, id: this.inputId }));
|
|
140
140
|
}
|
|
141
141
|
static get is() { return "limel-checkbox"; }
|
|
142
142
|
static get encapsulation() { return "shadow"; }
|
|
@@ -176,7 +176,7 @@ export class Chip {
|
|
|
176
176
|
removeEnterClickable(this.host);
|
|
177
177
|
}
|
|
178
178
|
render() {
|
|
179
|
-
return (h(Host, { key: '
|
|
179
|
+
return (h(Host, { key: '510961df8f97561393d1f2bb7d3190bc025db123', onClick: this.filterClickWhenDisabled }, this.link ? this.renderAsLink() : this.renderAsButton()));
|
|
180
180
|
}
|
|
181
181
|
renderPicture() {
|
|
182
182
|
var _a, _b;
|
|
@@ -301,7 +301,7 @@ export class ChipSet {
|
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
303
|
const value = this.getValue();
|
|
304
|
-
return (h(Host, { key: '
|
|
304
|
+
return (h(Host, { key: 'd4e28dbf131f6c7a4e6c2ac5ef652d84b1b31128' }, h("limel-notched-outline", { key: '99984cd858b75275b4839a7af2a7197bbb9aa07f', labelId: this.labelId, label: this.label, required: this.required, invalid: this.isOutlineInvalid(), disabled: this.disabled, readonly: this.readonly, hasValue: !!((_a = this.value) === null || _a === void 0 ? void 0 : _a.length), hasLeadingIcon: !!this.leadingIcon, hasFloatingLabel: this.floatLabelAbove() }, h("div", Object.assign({ key: '81507f4715081ae8da9c7cbeddebb9a65925a5e5', slot: "content" }, this.getContentProps(), { class: classes }), this.renderContent(value))), this.renderHelperLine()));
|
|
305
305
|
}
|
|
306
306
|
getContentProps() {
|
|
307
307
|
if (this.type === 'input') {
|
|
@@ -60,7 +60,7 @@ export class CircularProgress {
|
|
|
60
60
|
};
|
|
61
61
|
const currentPercentage = (this.value * PERCENT) / this.maxValue + '%';
|
|
62
62
|
const value = Math.round(this.value * 10) / 10;
|
|
63
|
-
return (h("div", { key: '
|
|
63
|
+
return (h("div", { key: '7c5826b486db28b3db114074c74dec6a00c82eec', role: "progressbar", class: classList, "aria-label": "%", "aria-valuemin": "0", "aria-valuemax": this.maxValue, "aria-valuenow": this.value, style: { '--percentage': currentPercentage } }, this.renderPrefix(), h("span", { key: '02675e706ef2e037d94c46f477034220743faa05', class: "value" }, abbreviate(value), h("span", { key: 'f9c5d2b680609df19dd50464bfc0ae5238f9ecda', class: "suffix" }, this.suffix))));
|
|
64
64
|
}
|
|
65
65
|
static get is() { return "limel-circular-progress"; }
|
|
66
66
|
static get encapsulation() { return "shadow"; }
|
|
@@ -117,7 +117,7 @@ export class CodeDiff {
|
|
|
117
117
|
// Capture total matches after rendering completes
|
|
118
118
|
this.totalSearchMatches = this.searchMatchCounter;
|
|
119
119
|
const lineNumberWidth = this.computeLineNumberWidth();
|
|
120
|
-
return (h(Host, { key: '
|
|
120
|
+
return (h(Host, { key: '4f95b652097189ca18f6486da86c095a6225077e', style: { '--limel-line-number-min-width': lineNumberWidth } }, this.renderHeader(), this.renderScreenReaderSummary(), this.searchVisible && this.renderSearchBar(), h("div", { key: '1273e9ad6770c09c8c1d48d77fdd819f33ed21fc', class: "diff-body", role: "table", "aria-label": this.getTranslation('code-diff.table-label'), tabindex: "0", onKeyDown: (event) => this.handleKeyDown(event) }, diffContent), h("div", { key: 'f52eb88a4f615912cb568f5984e7ba770fcee035', class: "screen-reader-only", role: "status", "aria-live": "polite", "aria-atomic": "true" }, this.liveAnnouncement)));
|
|
121
121
|
}
|
|
122
122
|
watchInputs() {
|
|
123
123
|
this.recomputeDiff();
|
|
@@ -251,7 +251,7 @@ export class CodeEditor {
|
|
|
251
251
|
'is-dark-mode': this.isDarkMode(),
|
|
252
252
|
'is-light-mode': !this.isDarkMode(),
|
|
253
253
|
};
|
|
254
|
-
return (h(Host, { key: '
|
|
254
|
+
return (h(Host, { key: '3ea2a91bc83f9eb45ddf171a3c8b47065dd99b1a' }, this.renderCopyButton(), h("limel-notched-outline", { key: '67e1801691befcb6907cbe68b7be73dec2399fb9', labelId: this.labelId, label: this.label, required: this.required, invalid: this.invalid, disabled: this.disabled, readonly: this.readonly, hasValue: !!this.value, hasFloatingLabel: true }, h("div", { key: '8c38b9688f5ae57a15ce3e3c5dec2071482e0e4b', slot: "content", class: classList })), this.renderHelperLine()));
|
|
255
255
|
}
|
|
256
256
|
forceRedraw() {
|
|
257
257
|
// eslint-disable-next-line sonarjs/pseudo-random
|
|
@@ -130,7 +130,7 @@ export class CollapsibleSection {
|
|
|
130
130
|
removeEnterClickable(button);
|
|
131
131
|
}
|
|
132
132
|
render() {
|
|
133
|
-
return (h("section", { key: '
|
|
133
|
+
return (h("section", { key: '344db924bc0c26408eea3fb117f0d9de49eee6dc', class: `${this.isOpen ? 'open' : ''}`, "aria-invalid": this.invalid, "aria-labelledby": this.header ? this.headingId : null }, h("header", { key: '66a925680b0ceef7084b96cc3ebd7fc069103a44' }, h("button", { key: '6ee2b6bed98540670d3f057e1d8d29d84f68927f', class: "open-close-toggle", onClick: this.onClick, "aria-controls": this.bodyId, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-label": this.getCollapsibleSectionAriaLabel(), type: "button" }), this.renderExpandCollapseSign(), this.renderIcon(), this.renderHeading(), h("div", { key: 'c5a9134f223618c04799292aff931cc1c8b2b248', class: "divider-line", role: "presentation" }), this.renderHeaderSlot(), this.renderActions()), h("div", { key: '7def8a322ecec125efe20c7012e5e04ceac8f032', class: "body", inert: !this.isOpen, "aria-hidden": String(!this.isOpen), id: this.bodyId, role: "region" }, h("slot", { key: '0d957d90133c2d8a0f7a7bf8aeb148b4a87bc9b1' }))));
|
|
134
134
|
}
|
|
135
135
|
getHeadingLevel() {
|
|
136
136
|
return isHeadingLevel(this.headingLevel)
|
|
@@ -39,10 +39,10 @@ export class Palette {
|
|
|
39
39
|
render() {
|
|
40
40
|
const background = this.value ? { '--background': this.value } : {};
|
|
41
41
|
return [
|
|
42
|
-
h("div", { key: '
|
|
42
|
+
h("div", { key: '69d11a1f2b5515985edd256b9bccc757d68816b6', class: "color-picker-palette", style: {
|
|
43
43
|
'--color-picker-column-count': `${this.getColumnCount()}`,
|
|
44
44
|
} }, this.renderSwatches()),
|
|
45
|
-
h("div", { key: '
|
|
45
|
+
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 })),
|
|
46
46
|
];
|
|
47
47
|
}
|
|
48
48
|
getPalette() {
|
|
@@ -87,7 +87,7 @@ export class ColorPicker {
|
|
|
87
87
|
(_a = this.contentElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
88
88
|
}
|
|
89
89
|
render() {
|
|
90
|
-
return (h(Host, { key: '
|
|
90
|
+
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 })));
|
|
91
91
|
}
|
|
92
92
|
static get is() { return "limel-color-picker"; }
|
|
93
93
|
static get encapsulation() { return "shadow"; }
|
|
@@ -7,6 +7,150 @@ import "moment/locale/nl";
|
|
|
7
7
|
import "moment/locale/sv";
|
|
8
8
|
import moment from "moment/moment";
|
|
9
9
|
import { getPrimarySubtag } from "../../util/language";
|
|
10
|
+
// Literals first, so an `l` inside `[...]` is not expanded. Then longest
|
|
11
|
+
// first, since alternation takes the first match, not the longest.
|
|
12
|
+
const LONG_DATE_FORMAT_TOKENS = /\[[^\][]*\]|LTS|LLLL|LLL|LL|LT|L|lts|llll|lll|ll|lt|l/g;
|
|
13
|
+
// Literals, tokens (runs of one repeated letter) and separators.
|
|
14
|
+
const FORMAT_PARTS = /\[[^\][]*\]|([a-zA-Z])\1*|[^a-zA-Z[]+/g;
|
|
15
|
+
// Tokens moment parses leniently as one or two digits.
|
|
16
|
+
const ONE_OR_TWO_DIGIT_TOKENS = /^([MDHhkmsWw])\1?$/;
|
|
17
|
+
// Includes the narrow no-break space `Intl` puts before AM/PM.
|
|
18
|
+
const WHITESPACE = /\s+/g;
|
|
19
|
+
// ` - ` or `, ` between a date and a time. Separators inside a date, such
|
|
20
|
+
// as `-` in `YYYY-MM-DD`, must still be typed as in the format.
|
|
21
|
+
const DATE_TIME_JOINER = / ?, ?| - /g;
|
|
22
|
+
const TIME_SEPARATOR = /([Hhk]{1,2}|m{1,2})([:.])(?=m{1,2}|s{1,2})/g;
|
|
23
|
+
// Such as `[w]` in `[w] W GGGG`.
|
|
24
|
+
const WEEK_PREFIX = /^\[[^\][]*\]\s*(?=[Ww])/;
|
|
25
|
+
/**
|
|
26
|
+
* Expands localized tokens, e.g. `L` to `MM/DD/YYYY` for `en`.
|
|
27
|
+
* @param format - the moment format to expand, e.g. `L` or `L - LT`
|
|
28
|
+
* @param locale - the moment locale to expand it for
|
|
29
|
+
*/
|
|
30
|
+
function expandLongDateFormatTokens(format, locale) {
|
|
31
|
+
if (!format) {
|
|
32
|
+
return format;
|
|
33
|
+
}
|
|
34
|
+
const localeData = moment.localeData(locale);
|
|
35
|
+
return format.replaceAll(LONG_DATE_FORMAT_TOKENS, (token) => {
|
|
36
|
+
if (token.startsWith('[')) {
|
|
37
|
+
return token;
|
|
38
|
+
}
|
|
39
|
+
return (localeData.longDateFormat(token) ||
|
|
40
|
+
token);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Accepts fewer digits than the format has, e.g. `1/24/20` for
|
|
45
|
+
* `MM/DD/YYYY`, but rejects text that leaves part of the format unmatched.
|
|
46
|
+
* Moment's lenient mode alone accepts "01" as a complete date.
|
|
47
|
+
*
|
|
48
|
+
* Times and weeks are accepted in more forms than their format, e.g.
|
|
49
|
+
* `15.30` for `HH:mm` and `v. 4 26` for `[w] W GGGG`.
|
|
50
|
+
* @param date - the raw text to parse
|
|
51
|
+
* @param format - the moment format to parse it against
|
|
52
|
+
* @param locale - the moment locale to parse it in
|
|
53
|
+
*/
|
|
54
|
+
export function parseComplete(date, format, locale) {
|
|
55
|
+
const text = normalizeSeparators(date);
|
|
56
|
+
const expandedFormat = normalizeSeparators(expandLongDateFormatTokens(format, locale));
|
|
57
|
+
for (const candidate of getTimeSeparatorVariants(expandedFormat)) {
|
|
58
|
+
const parsed = parseLeniently(text, candidate, locale);
|
|
59
|
+
if (parsed) {
|
|
60
|
+
return parsed;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
function parseLeniently(date, format, locale) {
|
|
66
|
+
const [weekText, weekFormat] = dropWeekPrefix(date, format);
|
|
67
|
+
const text = pivotWeekYears(weekText, weekFormat);
|
|
68
|
+
const parsed = moment(text, weekFormat, locale, false);
|
|
69
|
+
if (!parsed.isValid()) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
const flags = parsed.parsingFlags();
|
|
73
|
+
if (flags.charsLeftOver > 0 ||
|
|
74
|
+
flags.unusedTokens.length > 0 ||
|
|
75
|
+
hasAmbiguousYear(text, weekFormat)) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
return parsed.toDate();
|
|
79
|
+
}
|
|
80
|
+
// Applied to both the text and the format, so they stay aligned.
|
|
81
|
+
function normalizeSeparators(text) {
|
|
82
|
+
return text
|
|
83
|
+
.trim()
|
|
84
|
+
.replaceAll(WHITESPACE, ' ')
|
|
85
|
+
.replaceAll(DATE_TIME_JOINER, ' ');
|
|
86
|
+
}
|
|
87
|
+
function getTimeSeparatorVariants(format) {
|
|
88
|
+
const swapped = format.replaceAll(TIME_SEPARATOR, (_, part, separator) => part + (separator === ':' ? '.' : ':'));
|
|
89
|
+
return swapped === format ? [format] : [format, swapped];
|
|
90
|
+
}
|
|
91
|
+
// Accepts any prefix, e.g. `v.`, `w` or none, for `[w] W GGGG`.
|
|
92
|
+
function dropWeekPrefix(date, format) {
|
|
93
|
+
if (!WEEK_PREFIX.test(format)) {
|
|
94
|
+
return [date, format];
|
|
95
|
+
}
|
|
96
|
+
return [date.replace(/^\D*/, ''), format.replace(WEEK_PREFIX, '')];
|
|
97
|
+
}
|
|
98
|
+
// Moment pivots a 2-digit `YYYY`, e.g. `26` to 2026, but not `GGGG`.
|
|
99
|
+
function pivotWeekYears(date, format) {
|
|
100
|
+
const twoDigitWeekYears = findYears(date, format).filter(({ token, start, end }) => token === 'GGGG' && end - start === 2);
|
|
101
|
+
return twoDigitWeekYears.reduceRight((text, { start, end }) => text.slice(0, start) +
|
|
102
|
+
moment.parseTwoDigitYear(text.slice(start, end)) +
|
|
103
|
+
text.slice(end), date);
|
|
104
|
+
}
|
|
105
|
+
// Lenient parsing reads a half-typed year such as "1/24/2" as year 2.
|
|
106
|
+
function hasAmbiguousYear(date, format) {
|
|
107
|
+
return findYears(date, format).some(({ start, end }) => {
|
|
108
|
+
const digitCount = end - start;
|
|
109
|
+
return digitCount !== 2 && digitCount !== 4;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function findYears(date, format) {
|
|
113
|
+
const formatParts = format.match(FORMAT_PARTS) || [];
|
|
114
|
+
const inputPattern = formatParts.map(formatPartToPattern).join('');
|
|
115
|
+
const match = new RegExp(`^${inputPattern}$`, 'd').exec(date);
|
|
116
|
+
if (!match) {
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
119
|
+
return formatParts.filter(isYearToken).map((token, index) => {
|
|
120
|
+
const [start, end] = match.indices[index + 1];
|
|
121
|
+
return { token: token, start: start, end: end };
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function isYearToken(part) {
|
|
125
|
+
return part === 'YYYY' || part === 'GGGG';
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Literals and separators are optional, since lenient parsing skips them
|
|
129
|
+
* when they are not typed, e.g. `01242026` for `MM/DD/YYYY`.
|
|
130
|
+
* @param part - a literal, token or separator of the format
|
|
131
|
+
*/
|
|
132
|
+
function formatPartToPattern(part) {
|
|
133
|
+
if (part.startsWith('[')) {
|
|
134
|
+
return optional(part.slice(1, -1));
|
|
135
|
+
}
|
|
136
|
+
if (isYearToken(part)) {
|
|
137
|
+
return String.raw `(\d{1,4})`;
|
|
138
|
+
}
|
|
139
|
+
if (ONE_OR_TWO_DIGIT_TOKENS.test(part)) {
|
|
140
|
+
return String.raw `\d{1,2}`;
|
|
141
|
+
}
|
|
142
|
+
if (/^[a-zA-Z]+$/.test(part)) {
|
|
143
|
+
return '.+?';
|
|
144
|
+
}
|
|
145
|
+
// Moment matches each separator character on its own.
|
|
146
|
+
return [...part].map(optional).join('');
|
|
147
|
+
}
|
|
148
|
+
function optional(text) {
|
|
149
|
+
return `(?:${escapeRegExp(text)})?`;
|
|
150
|
+
}
|
|
151
|
+
function escapeRegExp(text) {
|
|
152
|
+
return text.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw `\$&`);
|
|
153
|
+
}
|
|
10
154
|
export class DateFormatter {
|
|
11
155
|
constructor(language = 'en') {
|
|
12
156
|
this.language = language;
|
|
@@ -19,7 +163,9 @@ export class DateFormatter {
|
|
|
19
163
|
}
|
|
20
164
|
parseDate(date, dateFormat) {
|
|
21
165
|
if (date) {
|
|
22
|
-
|
|
166
|
+
// Importing the moment locales changes moment's global default
|
|
167
|
+
// locale, so tokens like `L` must be parsed with ours.
|
|
168
|
+
return parseComplete(date, dateFormat, this.getLanguage());
|
|
23
169
|
}
|
|
24
170
|
return null;
|
|
25
171
|
}
|
|
@@ -1,3 +1,102 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/**
|
|
3
|
+
* Note! This file is forwarded via `src/style/exports.scss`
|
|
4
|
+
* and exposed to consumers through the root `index.scss`.
|
|
5
|
+
*
|
|
6
|
+
* Consumers import it using:
|
|
7
|
+
* `@use '@limetech/lime-elements' as lime-elements;`
|
|
8
|
+
*
|
|
9
|
+
* Legacy import paths (`dist/scss/mixins`) are maintained
|
|
10
|
+
* for backward compatibility via copy rules in the Stencil config.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Neutralizes the user-agent styles that browsers apply to `<button>` elements
|
|
14
|
+
* (their default background, border, padding, font, etc.), without stripping
|
|
15
|
+
* the useful defaults that `all: unset;` would also remove
|
|
16
|
+
* (such as `display`, `cursor`, and focus behavior).
|
|
17
|
+
*
|
|
18
|
+
* Prefer this mixin over `all: unset;` on `<button>` elements, then layer
|
|
19
|
+
* the styling you want on top — often one of the `is-*-clickable` mixins.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* This can be used on a trigger element that opens a dropdown menu or a popover.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* This mixin will mask out the content that is close to
|
|
26
|
+
* the edges of a scrollable area.
|
|
27
|
+
* - If the scrollable content has `overflow-y`, use `vertically`
|
|
28
|
+
* as an argument for `$direction`.
|
|
29
|
+
- If the scrollable content has `overflow-x`, use `horizontally`
|
|
30
|
+
* as an argument for `$direction`.
|
|
31
|
+
*
|
|
32
|
+
* For the visual effect to work smoothly, we need to make sure that
|
|
33
|
+
* the size of the fade-out edge effect is the same as the
|
|
34
|
+
* internal paddings of the scrollable area. Otherwise, content of a
|
|
35
|
+
* scrollable area that does not have a padding will fade out before
|
|
36
|
+
* any scrolling has been done.
|
|
37
|
+
* This is why this mixin already adds paddings, which automatically
|
|
38
|
+
* default to the size of the fade-out effect.
|
|
39
|
+
* This size defaults to `1rem`, but to override the size use
|
|
40
|
+
* `--limel-top-edge-fade-height` & `--limel-bottom-edge-fade-height`
|
|
41
|
+
* when `vertically` argument is set, and use
|
|
42
|
+
* `--limel-left-edge-fade-width` & `--limel-right-edge-fade-width`
|
|
43
|
+
* when `horizontally` argument is set.
|
|
44
|
+
* Of course you can also programmatically increase and decrease the
|
|
45
|
+
* size of these variables for each edge, based on the amount of
|
|
46
|
+
* scrolling that has been done by the user. In this case, make sure
|
|
47
|
+
* to add a custom padding where the mixin is used, to override
|
|
48
|
+
* the paddings that are automatically added by the mixin in the
|
|
49
|
+
* compiled CSS code.
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* This mixin will add an animated underline to the bottom of an `a` elements.
|
|
53
|
+
* Note that you may need to add `all: unset;` –depending on your use case–
|
|
54
|
+
* before using this mixin.
|
|
55
|
+
*/
|
|
56
|
+
/**
|
|
57
|
+
* This mixin creates a cross-browser font stack.
|
|
58
|
+
* - `sans-serif` can be used for the UI of the components.
|
|
59
|
+
* - `monospace` can be used for code.
|
|
60
|
+
*
|
|
61
|
+
* ⚠️ If we change the font stacks, we need to update
|
|
62
|
+
* 1. the consumer documentation in `README.md`, and
|
|
63
|
+
* 2. the CSS variables of `--kompendium-example-font-family`
|
|
64
|
+
* in the `<style>` tag of `index.html`.
|
|
65
|
+
*/
|
|
66
|
+
/**
|
|
67
|
+
* This mixin is a hack, using old CSS syntax
|
|
68
|
+
* to enable you to truncate a piece of text,
|
|
69
|
+
* after a certain number of lines.
|
|
70
|
+
*/
|
|
71
|
+
/**
|
|
72
|
+
* This mixin will add a chessboard background pattern,
|
|
73
|
+
* typically used to visualize transparency.
|
|
74
|
+
*/
|
|
75
|
+
/**
|
|
76
|
+
* Make a container resizable by the user.
|
|
77
|
+
* This is used in the documentations and examples
|
|
78
|
+
* of some components, to demonstrate how the component
|
|
79
|
+
* behaves in a resizable container.
|
|
80
|
+
*/
|
|
81
|
+
/**
|
|
82
|
+
* Drag to reorder mixins
|
|
83
|
+
*/
|
|
84
|
+
/**
|
|
85
|
+
* The breakpoints below are used to create responsive designs
|
|
86
|
+
* in Lime's products. Therefore, they are here to get distributed
|
|
87
|
+
* to all components in other private repos, which rely on this `mixins`
|
|
88
|
+
* file, to create consistent styles.
|
|
89
|
+
*
|
|
90
|
+
* :::important
|
|
91
|
+
* In very rare cases you should used media queries!
|
|
92
|
+
* Nowadays, there are many better ways of achieving responsive design
|
|
93
|
+
* without media queries. For example, using CSS Grid, Flexbox, and their features.
|
|
94
|
+
* :::
|
|
95
|
+
*/
|
|
96
|
+
/**
|
|
97
|
+
* Media query mixins for responsive design based on screen width.
|
|
98
|
+
* Note that these mixins do not detect the device type!
|
|
99
|
+
*/
|
|
1
100
|
/**
|
|
2
101
|
* @prop --dropdown-z-index: z-index of the dropdown menu.
|
|
3
102
|
*/
|
|
@@ -8,4 +107,17 @@
|
|
|
8
107
|
limel-input-field[disabled],
|
|
9
108
|
limel-input-field[readonly] {
|
|
10
109
|
pointer-events: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.error-message {
|
|
113
|
+
position: absolute;
|
|
114
|
+
width: 0;
|
|
115
|
+
height: 0;
|
|
116
|
+
margin: -1px;
|
|
117
|
+
padding: 0;
|
|
118
|
+
border: 0;
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
clip: rect(0, 0, 0, 0);
|
|
121
|
+
clip-path: inset(50%);
|
|
122
|
+
white-space: nowrap;
|
|
11
123
|
}
|