@limetech/lime-elements 40.9.0 → 40.10.1
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 +21 -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 +3 -3
- package/dist/cjs/limel-ai-avatar.cjs.entry.js +1 -1
- package/dist/cjs/limel-badge.cjs.entry.js +2 -2
- package/dist/cjs/limel-banner.cjs.entry.js +1 -1
- package/dist/cjs/limel-breadcrumbs_6.cjs.entry.js +6 -6
- 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 +1 -1
- package/dist/cjs/limel-card.cjs.entry.js +1 -1
- package/dist/cjs/limel-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip-set.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-circular-progress.cjs.entry.js +1 -1
- package/dist/cjs/limel-code-diff.cjs.entry.js +1 -1
- package/dist/cjs/limel-code-editor.cjs.entry.js +1 -1
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +1 -1
- 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-dialog.cjs.entry.js +2 -2
- package/dist/cjs/limel-dock.cjs.entry.js +2 -2
- package/dist/cjs/limel-drag-handle.cjs.entry.js +1 -1
- package/dist/cjs/limel-email-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +2 -2
- package/dist/cjs/limel-file.cjs.entry.js +1 -1
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-flex-container.cjs.entry.js +1 -1
- package/dist/cjs/limel-form.cjs.entry.js +1 -1
- 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-content.cjs.entry.js +1 -1
- package/dist/cjs/limel-help.cjs.entry.js +2 -2
- package/dist/cjs/limel-helper-line_3.cjs.entry.js +4 -4
- package/dist/cjs/limel-hotkey_4.cjs.entry.js +231 -15
- 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 +2 -2
- 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.cjs.entry.js +1 -1
- package/dist/cjs/limel-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-popover_2.cjs.entry.js +2 -2
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
- 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 +240 -0
- package/dist/cjs/limel-scroller.cjs.entry.js +2 -2
- 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 +283 -0
- package/dist/cjs/limel-slider.cjs.entry.js +3 -3
- package/dist/cjs/limel-snackbar.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +3 -3
- package/dist/cjs/limel-text-editor.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- 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/flatpickr-adapter/flatpickr-adapter.js +1 -1
- 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/form.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/get-hotkey-aria-label.js +14 -0
- package/dist/collection/components/hotkey/hotkey.js +3 -5
- 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.css +274 -0
- package/dist/collection/components/resize-handle/resize-handle.js +210 -0
- 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.css +300 -0
- package/dist/collection/components/side-panel/side-panel.js +433 -0
- 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/description-registry.js +57 -0
- package/dist/collection/components/tooltip/get-description.js +42 -0
- package/dist/collection/components/tooltip/tooltip-content.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +53 -11
- package/dist/collection/util/drag-to-resize.js +108 -0
- package/dist/collection/util/get-deep-active-element.js +15 -0
- package/dist/collection/util/get-focus-target.js +69 -0
- package/dist/collection/util/resize-location.js +76 -0
- package/dist/esm/{keycodes-DQ5DmW_Y.js → keycodes-Bu6-QXrA.js} +1 -1
- 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 +3 -3
- package/dist/esm/limel-ai-avatar.entry.js +1 -1
- package/dist/esm/limel-badge.entry.js +2 -2
- package/dist/esm/limel-banner.entry.js +1 -1
- package/dist/esm/limel-breadcrumbs_6.entry.js +7 -7
- 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 +1 -1
- package/dist/esm/limel-card.entry.js +1 -1
- package/dist/esm/limel-checkbox.entry.js +1 -1
- package/dist/esm/limel-chip-set.entry.js +2 -2
- package/dist/esm/limel-chip_2.entry.js +2 -2
- package/dist/esm/limel-circular-progress.entry.js +1 -1
- package/dist/esm/limel-code-diff.entry.js +1 -1
- package/dist/esm/limel-code-editor.entry.js +1 -1
- package/dist/esm/limel-collapsible-section.entry.js +1 -1
- 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-dialog.entry.js +2 -2
- package/dist/esm/limel-dock.entry.js +2 -2
- package/dist/esm/limel-drag-handle.entry.js +1 -1
- package/dist/esm/limel-email-viewer.entry.js +1 -1
- package/dist/esm/limel-file-dropzone_2.entry.js +2 -2
- package/dist/esm/limel-file.entry.js +1 -1
- package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
- package/dist/esm/limel-flex-container.entry.js +1 -1
- package/dist/esm/limel-form.entry.js +1 -1
- package/dist/esm/limel-grid.entry.js +1 -1
- package/dist/esm/limel-header.entry.js +1 -1
- package/dist/esm/limel-help-content.entry.js +1 -1
- package/dist/esm/limel-help.entry.js +2 -2
- package/dist/esm/limel-helper-line_3.entry.js +4 -4
- package/dist/esm/limel-hotkey_4.entry.js +231 -15
- 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 +2 -2
- 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 -1
- package/dist/esm/limel-pagination.entry.js +1 -1
- package/dist/esm/limel-picker.entry.js +2 -2
- package/dist/esm/limel-popover_2.entry.js +3 -3
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- 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 +238 -0
- package/dist/esm/limel-scroller.entry.js +2 -2
- package/dist/esm/limel-select.entry.js +2 -2
- package/dist/esm/limel-shortcut.entry.js +1 -1
- package/dist/esm/limel-side-panel.entry.js +281 -0
- package/dist/esm/limel-slider.entry.js +3 -3
- package/dist/esm/limel-snackbar.entry.js +2 -2
- 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 +2 -2
- package/dist/esm/limel-tab-panel.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +2 -2
- package/dist/esm/limel-text-editor-link-menu.entry.js +4 -4
- package/dist/esm/limel-text-editor.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-5da47a8a.entry.js → p-065f1635.entry.js} +1 -1
- package/dist/lime-elements/{p-0e13ec91.entry.js → p-06cd9512.entry.js} +1 -1
- package/dist/lime-elements/{p-96246494.entry.js → p-07916acc.entry.js} +1 -1
- package/dist/lime-elements/{p-fdec09e9.entry.js → p-0c2ce99b.entry.js} +1 -1
- package/dist/lime-elements/{p-00c36c9e.entry.js → p-1020ca20.entry.js} +1 -1
- package/dist/lime-elements/{p-288ef79a.entry.js → p-14aff731.entry.js} +1 -1
- package/dist/lime-elements/p-1a5478e3.entry.js +1 -0
- package/dist/lime-elements/{p-2b033dfa.entry.js → p-24e5d420.entry.js} +1 -1
- package/dist/lime-elements/{p-9afa4721.entry.js → p-262a3d66.entry.js} +1 -1
- package/dist/lime-elements/{p-45461ec5.entry.js → p-29b2a176.entry.js} +1 -1
- package/dist/lime-elements/{p-e752dc7f.entry.js → p-2ba9d62f.entry.js} +1 -1
- package/dist/lime-elements/{p-a1c69e0c.entry.js → p-33ed0c68.entry.js} +1 -1
- package/dist/lime-elements/{p-efaf2616.entry.js → p-35bc5ed2.entry.js} +1 -1
- package/dist/lime-elements/{p-d37fbbd2.entry.js → p-3ee121fa.entry.js} +1 -1
- package/dist/lime-elements/{p-d1b7cc55.entry.js → p-458c131f.entry.js} +3 -3
- package/dist/lime-elements/{p-c439b68b.entry.js → p-46bf8b22.entry.js} +1 -1
- package/dist/lime-elements/{p-303edb1a.entry.js → p-4882acaa.entry.js} +1 -1
- package/dist/lime-elements/{p-7b4351f6.entry.js → p-4a7df81a.entry.js} +1 -1
- package/dist/lime-elements/{p-982a0f10.entry.js → p-527e9c95.entry.js} +1 -1
- package/dist/lime-elements/{p-5f5c6e7d.entry.js → p-54631dbf.entry.js} +1 -1
- package/dist/lime-elements/{p-d5800180.entry.js → p-5473eb74.entry.js} +1 -1
- package/dist/lime-elements/p-566750e5.entry.js +1 -0
- package/dist/lime-elements/{p-f4a0b1bc.entry.js → p-622660dd.entry.js} +1 -1
- package/dist/lime-elements/{p-d19c7a3a.entry.js → p-646731b6.entry.js} +1 -1
- package/dist/lime-elements/{p-7eab1341.entry.js → p-68542e00.entry.js} +1 -1
- package/dist/lime-elements/p-780dae0b.entry.js +1 -0
- package/dist/lime-elements/{p-8ac79ef5.entry.js → p-7a290372.entry.js} +1 -1
- package/dist/lime-elements/{p-ff1a8b2e.entry.js → p-7a2e0e18.entry.js} +1 -1
- package/dist/lime-elements/{p-7fa85785.entry.js → p-7cdbbffe.entry.js} +2 -2
- package/dist/lime-elements/{p-b6d39581.entry.js → p-887eea11.entry.js} +1 -1
- package/dist/lime-elements/{p-9c8c2fb7.entry.js → p-8a59698f.entry.js} +1 -1
- package/dist/lime-elements/p-8d567e42.entry.js +1 -0
- package/dist/lime-elements/{p-b22b52a1.entry.js → p-910807cb.entry.js} +1 -1
- package/dist/lime-elements/p-9168793f.entry.js +1 -0
- package/dist/lime-elements/{p-58b7c634.entry.js → p-9461c6bb.entry.js} +1 -1
- package/dist/lime-elements/{p-a98cbd1f.entry.js → p-9b1934fb.entry.js} +1 -1
- package/dist/lime-elements/p-9b384d62.entry.js +1 -0
- package/dist/lime-elements/{p-ee719744.entry.js → p-9ca18ba5.entry.js} +1 -1
- package/dist/lime-elements/{p-DQ5DmW_Y.js → p-Bu6-QXrA.js} +1 -1
- package/dist/lime-elements/{p-ab91cfff.entry.js → p-a317f2fa.entry.js} +1 -1
- package/dist/lime-elements/{p-32a050a3.entry.js → p-a449ca04.entry.js} +1 -1
- package/dist/lime-elements/p-a5246373.entry.js +1 -0
- package/dist/lime-elements/{p-9992b5f9.entry.js → p-a78aaf37.entry.js} +1 -1
- package/dist/lime-elements/p-abcc451a.entry.js +1 -0
- package/dist/lime-elements/{p-9e016212.entry.js → p-abed5afd.entry.js} +1 -1
- package/dist/lime-elements/{p-107654bb.entry.js → p-ae2e5e87.entry.js} +1 -1
- package/dist/lime-elements/{p-fdd674fc.entry.js → p-b69af611.entry.js} +1 -1
- package/dist/lime-elements/{p-74060535.entry.js → p-b9da0108.entry.js} +2 -2
- package/dist/lime-elements/{p-4cbcafae.entry.js → p-bf849dc9.entry.js} +1 -1
- package/dist/lime-elements/{p-0d6925f4.entry.js → p-c12fbc91.entry.js} +1 -1
- package/dist/lime-elements/{p-03cb609e.entry.js → p-cf6fab84.entry.js} +1 -1
- package/dist/lime-elements/{p-29c73bdf.entry.js → p-d3475514.entry.js} +1 -1
- package/dist/lime-elements/{p-006cfb3d.entry.js → p-d5144955.entry.js} +1 -1
- package/dist/lime-elements/{p-91a572c8.entry.js → p-d79d777e.entry.js} +1 -1
- package/dist/lime-elements/p-d7e5a4a7.entry.js +1 -0
- package/dist/lime-elements/{p-9415411e.entry.js → p-db1f9eba.entry.js} +1 -1
- package/dist/lime-elements/{p-a736ea08.entry.js → p-dd075353.entry.js} +1 -1
- package/dist/lime-elements/{p-526ede01.entry.js → p-de4d261a.entry.js} +1 -1
- package/dist/lime-elements/{p-e6a34047.entry.js → p-def7b38f.entry.js} +1 -1
- package/dist/lime-elements/{p-bc70090d.entry.js → p-e247e9fe.entry.js} +1 -1
- package/dist/lime-elements/{p-e2b074aa.entry.js → p-e25bfb2c.entry.js} +1 -1
- package/dist/lime-elements/{p-727b6c11.entry.js → p-ec74a07a.entry.js} +1 -1
- package/dist/lime-elements/{p-d1e5dd12.entry.js → p-ecded772.entry.js} +1 -1
- package/dist/types/components/hotkey/get-hotkey-aria-label.d.ts +8 -0
- package/dist/types/components/resize-handle/resize-handle.d.ts +64 -0
- package/dist/types/components/side-panel/side-panel.d.ts +134 -0
- package/dist/types/components/tooltip/description-registry.d.ts +21 -0
- package/dist/types/components/tooltip/get-description.d.ts +13 -0
- package/dist/types/components/tooltip/tooltip.d.ts +11 -3
- package/dist/types/components.d.ts +325 -6
- package/dist/types/util/drag-to-resize.d.ts +33 -0
- package/dist/types/util/get-deep-active-element.d.ts +9 -0
- package/dist/types/util/get-focus-target.d.ts +14 -0
- package/dist/types/util/resize-location.d.ts +59 -0
- package/package.json +4 -4
- package/dist/lime-elements/p-14a28a08.entry.js +0 -1
- package/dist/lime-elements/p-3d05e21f.entry.js +0 -1
- package/dist/lime-elements/p-681cb6de.entry.js +0 -1
- package/dist/lime-elements/p-a1d1470c.entry.js +0 -1
- package/dist/lime-elements/p-a2e6f16e.entry.js +0 -1
- package/dist/lime-elements/p-aa897903.entry.js +0 -1
- package/dist/lime-elements/p-de4719a6.entry.js +0 -1
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
import { h, Host, } from "@stencil/core";
|
|
2
|
+
import { getDeepActiveElement } from "../../util/get-deep-active-element";
|
|
3
|
+
import { ESCAPE } from "../../util/keycodes";
|
|
4
|
+
import { createRandomString } from "../../util/random-string";
|
|
5
|
+
/**
|
|
6
|
+
* Open panels, in the order they were connected. Only the last one handles
|
|
7
|
+
* Escape.
|
|
8
|
+
*/
|
|
9
|
+
const openPanels = [];
|
|
10
|
+
function stopEvent(event) {
|
|
11
|
+
event.stopPropagation();
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A resizable panel that is displayed on top of the right side of the page.
|
|
15
|
+
* The content is placed in the default slot, below a toolbar with a close button.
|
|
16
|
+
*
|
|
17
|
+
* The panel is positioned relative to its nearest positioned ancestor. Set
|
|
18
|
+
* `position: relative` on that element. Use `--side-panel-top-inset`,
|
|
19
|
+
* `--side-panel-right-inset` and `--side-panel-bottom-inset` to keep parts of
|
|
20
|
+
* that element visible, for example a header.
|
|
21
|
+
*
|
|
22
|
+
* The CSS custom properties can be set on the panel or on any ancestor.
|
|
23
|
+
*
|
|
24
|
+
* The panel is a dialog that does not block the rest of the page. Set `label`
|
|
25
|
+
* to give it an accessible name, which screen readers announce. When the panel
|
|
26
|
+
* opens, focus moves into it. When the panel is removed, focus returns to the
|
|
27
|
+
* element that had it before, unless focus is somewhere else by then.
|
|
28
|
+
*
|
|
29
|
+
* The panel emits `close` when the user clicks the close button, or presses
|
|
30
|
+
* Escape. It does not remove itself. The consumer must remove it from the DOM.
|
|
31
|
+
* The user can resize the panel by dragging its left edge, or with the arrow
|
|
32
|
+
* keys. The panel emits `changeWidth` when a resize is finished.
|
|
33
|
+
*
|
|
34
|
+
* See the examples for how closing and resizing work in detail.
|
|
35
|
+
*
|
|
36
|
+
* @exampleComponent limel-example-side-panel-basic
|
|
37
|
+
* @exampleComponent limel-example-side-panel-insets
|
|
38
|
+
* @exampleComponent limel-example-side-panel-escape
|
|
39
|
+
* @private
|
|
40
|
+
*/
|
|
41
|
+
export class SidePanel {
|
|
42
|
+
constructor() {
|
|
43
|
+
/**
|
|
44
|
+
* Label of the close button. Shown as a tooltip and used as the accessible
|
|
45
|
+
* name.
|
|
46
|
+
*/
|
|
47
|
+
this.closeLabel = 'Close';
|
|
48
|
+
/**
|
|
49
|
+
* Label of the resize handle. Used as the accessible name.
|
|
50
|
+
*/
|
|
51
|
+
this.resizeLabel = 'Resize';
|
|
52
|
+
/**
|
|
53
|
+
* Whether pressing Escape emits `close`. Set to `false` to let only the
|
|
54
|
+
* close button emit `close`. The panel then does not prevent the Escape
|
|
55
|
+
* event either.
|
|
56
|
+
*/
|
|
57
|
+
this.closeOnEscape = true;
|
|
58
|
+
this.closeButtonId = createRandomString();
|
|
59
|
+
this.setBody = (element) => {
|
|
60
|
+
this.body = element;
|
|
61
|
+
this.stopContentEventsInBody();
|
|
62
|
+
};
|
|
63
|
+
// Moving the panel in the DOM also disconnects it. It is then connected
|
|
64
|
+
// again before the microtask runs. Focus only returns when it was lost with
|
|
65
|
+
// the panel, and not when the user has moved it to another element.
|
|
66
|
+
this.restoreFocus = () => {
|
|
67
|
+
const hasLostFocus = !document.activeElement || document.activeElement === document.body;
|
|
68
|
+
if (this.host.isConnected || !hasLostFocus) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const element = this.focusedBefore;
|
|
72
|
+
this.focusedBefore = undefined;
|
|
73
|
+
if (element === null || element === void 0 ? void 0 : element.isConnected) {
|
|
74
|
+
element.focus();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
this.setPanel = (element) => {
|
|
78
|
+
this.panel = element;
|
|
79
|
+
};
|
|
80
|
+
this.setMinLimit = (element) => {
|
|
81
|
+
this.minLimit = element;
|
|
82
|
+
};
|
|
83
|
+
this.setMaxLimit = (element) => {
|
|
84
|
+
this.maxLimit = element;
|
|
85
|
+
};
|
|
86
|
+
this.handleKeyDown = (event) => {
|
|
87
|
+
if (!this.closeOnEscape ||
|
|
88
|
+
event.key !== ESCAPE ||
|
|
89
|
+
event.defaultPrevented ||
|
|
90
|
+
!this.isLastOpened()) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
event.preventDefault();
|
|
94
|
+
this.close.emit();
|
|
95
|
+
};
|
|
96
|
+
this.handleChangeSize = (event) => {
|
|
97
|
+
this.rememberWidthBeforeResize();
|
|
98
|
+
this.setWidth(event.detail);
|
|
99
|
+
};
|
|
100
|
+
this.handleEndResize = () => {
|
|
101
|
+
if (!this.isResizing()) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const widthBefore = this.widthBeforeResize;
|
|
105
|
+
this.widthBeforeResize = undefined;
|
|
106
|
+
this.keepClampedWidth();
|
|
107
|
+
this.updateWidthRange();
|
|
108
|
+
this.emitWidthIfChanged(widthBefore);
|
|
109
|
+
};
|
|
110
|
+
// The height of the panel, and a width that `updateWidthRange` has already
|
|
111
|
+
// measured, for example after an arrow key press, need no new measurement.
|
|
112
|
+
this.handleSizeChange = (entries) => {
|
|
113
|
+
if (entries.every(this.isMeasured)) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
this.updateWidthRange();
|
|
117
|
+
};
|
|
118
|
+
this.isMeasured = (entry) => {
|
|
119
|
+
var _a;
|
|
120
|
+
return (entry.target === this.panel &&
|
|
121
|
+
Math.round(entry.borderBoxSize[0].inlineSize) ===
|
|
122
|
+
((_a = this.widthRange) === null || _a === void 0 ? void 0 : _a.now));
|
|
123
|
+
};
|
|
124
|
+
// Reading the current width forces a layout of the content, which is slow
|
|
125
|
+
// when the content is large. The range does not change during a resize, so it
|
|
126
|
+
// is measured when the resize ends.
|
|
127
|
+
this.updateWidthRange = () => {
|
|
128
|
+
if (this.isResizing()) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
this.widthRange = this.measureWidthRange();
|
|
132
|
+
};
|
|
133
|
+
this.handleClickClose = () => {
|
|
134
|
+
this.close.emit();
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
connectedCallback() {
|
|
138
|
+
openPanels.push(this);
|
|
139
|
+
window.addEventListener('keydown', this.handleKeyDown);
|
|
140
|
+
this.rememberFocusedElement();
|
|
141
|
+
this.observeWidth();
|
|
142
|
+
}
|
|
143
|
+
componentDidLoad() {
|
|
144
|
+
this.observeWidth();
|
|
145
|
+
this.moveFocusIntoPanel();
|
|
146
|
+
}
|
|
147
|
+
disconnectedCallback() {
|
|
148
|
+
this.widthBeforeResize = undefined;
|
|
149
|
+
this.stopObservingWidth();
|
|
150
|
+
window.removeEventListener('keydown', this.handleKeyDown);
|
|
151
|
+
this.removeFromOpenPanels();
|
|
152
|
+
queueMicrotask(this.restoreFocus);
|
|
153
|
+
}
|
|
154
|
+
render() {
|
|
155
|
+
return (h(Host, { key: '1c18f40fb45731bdf157d651d4e649446de5230b' }, h("section", { key: 'e8b41bded39732750ae3db9b1daf14dc742e1cb7', ref: this.setPanel, role: "dialog", "aria-label": this.label, tabindex: "-1" }, this.renderHandle(), h("div", { key: '3cba5523e0cbe45fa328daaa40136c063a8c3ac3', class: "content" }, h("div", { key: 'b5cbc1260b4e6f31ac789179ab4b5a0281b9133b', class: "toolbar" }, this.renderCloseButton()), this.renderBody())), h("span", { key: '5fe872f05a6cc49027f84d71a765baa59a53adb9', "data-limit": "min", ref: this.setMinLimit }), h("span", { key: '5042e7437e61ae5308e13b1a30f5df24747e2cdf', "data-limit": "max", ref: this.setMaxLimit })));
|
|
156
|
+
}
|
|
157
|
+
// A native button and not `limel-icon-button`, because the hover animation
|
|
158
|
+
// styles the icon, which is inside the shadow root of `limel-icon-button`.
|
|
159
|
+
renderCloseButton() {
|
|
160
|
+
return (h("button", { class: "close", id: this.closeButtonId, "aria-label": this.closeLabel, onClick: this.handleClickClose }, h("limel-icon", { name: "multiply", "aria-hidden": "true" }), h("limel-tooltip", { elementId: this.closeButtonId, label: this.closeLabel })));
|
|
161
|
+
}
|
|
162
|
+
renderHandle() {
|
|
163
|
+
var _a, _b, _c;
|
|
164
|
+
return (h("limel-resize-handle", { class: "handle", label: this.resizeLabel, value: (_a = this.widthRange) === null || _a === void 0 ? void 0 : _a.now, min: (_b = this.widthRange) === null || _b === void 0 ? void 0 : _b.min, max: (_c = this.widthRange) === null || _c === void 0 ? void 0 : _c.max, onChangeSize: this.handleChangeSize, onEndResize: this.handleEndResize }));
|
|
165
|
+
}
|
|
166
|
+
renderBody() {
|
|
167
|
+
return (h("div", { class: "body", ref: this.setBody }, h("slot", null)));
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Components in the content can emit events with the same names as the
|
|
171
|
+
* panel's events, for example `close` from `limel-dialog` or
|
|
172
|
+
* `limel-collapsible-section`. Events from slotted content pass through
|
|
173
|
+
* `.body` before they reach the host, so they are stopped there. The panel's
|
|
174
|
+
* own events are dispatched on the host, so they are not affected.
|
|
175
|
+
*
|
|
176
|
+
* Keep the event names in sync with {@link SidePanel.stopContentEventAtHost}.
|
|
177
|
+
*/
|
|
178
|
+
stopContentEventsInBody() {
|
|
179
|
+
var _a, _b;
|
|
180
|
+
// Adding the same listener again has no effect, so re-renders are safe.
|
|
181
|
+
(_a = this.body) === null || _a === void 0 ? void 0 : _a.addEventListener('close', stopEvent);
|
|
182
|
+
(_b = this.body) === null || _b === void 0 ? void 0 : _b.addEventListener('changeWidth', stopEvent);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Fallback for {@link SidePanel.stopContentEventsInBody}.
|
|
186
|
+
* Stops `close` and `changeWidth` events that reach the host from any
|
|
187
|
+
* element other than the host.
|
|
188
|
+
*
|
|
189
|
+
* This does not replace the slot listener. A consumer listener that is added
|
|
190
|
+
* before the panel is connected runs before this one, and would still
|
|
191
|
+
* receive the event.
|
|
192
|
+
*
|
|
193
|
+
* @param event - the event
|
|
194
|
+
*/
|
|
195
|
+
stopContentEventAtHost(event) {
|
|
196
|
+
if (event.target === this.host) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
event.stopImmediatePropagation();
|
|
200
|
+
}
|
|
201
|
+
moveFocusIntoPanel() {
|
|
202
|
+
this.panel.focus({ preventScroll: true });
|
|
203
|
+
}
|
|
204
|
+
rememberFocusedElement() {
|
|
205
|
+
const element = getDeepActiveElement();
|
|
206
|
+
if (!element || element === document.body) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
this.focusedBefore = element;
|
|
210
|
+
}
|
|
211
|
+
removeFromOpenPanels() {
|
|
212
|
+
const index = openPanels.indexOf(this);
|
|
213
|
+
if (index === -1) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
openPanels.splice(index, 1);
|
|
217
|
+
}
|
|
218
|
+
isLastOpened() {
|
|
219
|
+
return openPanels.at(-1) === this;
|
|
220
|
+
}
|
|
221
|
+
// An inline width wins over `--side-panel-width`, and is still limited by
|
|
222
|
+
// `min-width` and `max-width`. The width is set on the element and not with
|
|
223
|
+
// a state, because a render and a measurement on each pointer move make
|
|
224
|
+
// the drag slow when the content is large.
|
|
225
|
+
setWidth(width) {
|
|
226
|
+
this.panel.style.width = `${width}px`;
|
|
227
|
+
}
|
|
228
|
+
rememberWidthBeforeResize() {
|
|
229
|
+
if (this.isResizing()) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
this.widthBeforeResize = this.currentWidth();
|
|
233
|
+
}
|
|
234
|
+
isResizing() {
|
|
235
|
+
return this.widthBeforeResize !== undefined;
|
|
236
|
+
}
|
|
237
|
+
// A drag past a limit sets a width that CSS clamps. Without the clamped
|
|
238
|
+
// width, the panel grows when its container grows.
|
|
239
|
+
keepClampedWidth() {
|
|
240
|
+
this.setWidth(this.currentWidth());
|
|
241
|
+
}
|
|
242
|
+
emitWidthIfChanged(widthBefore) {
|
|
243
|
+
const width = this.currentWidth();
|
|
244
|
+
if (width === widthBefore) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
this.changeWidth.emit(width);
|
|
248
|
+
}
|
|
249
|
+
// A focusable separator must always have its values. The width changes when
|
|
250
|
+
// the consumer sets `--side-panel-width`, and the limits change with the
|
|
251
|
+
// width of the positioned ancestor, so the range is measured when the panel
|
|
252
|
+
// or an element for the limits changes size.
|
|
253
|
+
observeWidth() {
|
|
254
|
+
this.stopObservingWidth();
|
|
255
|
+
if (!this.panel) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
this.widthObserver = new ResizeObserver(this.handleSizeChange);
|
|
259
|
+
for (const element of [this.panel, this.minLimit, this.maxLimit]) {
|
|
260
|
+
if (element) {
|
|
261
|
+
this.widthObserver.observe(element);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
stopObservingWidth() {
|
|
266
|
+
var _a;
|
|
267
|
+
(_a = this.widthObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
268
|
+
this.widthObserver = undefined;
|
|
269
|
+
}
|
|
270
|
+
measureWidthRange() {
|
|
271
|
+
const min = this.minLimit.offsetWidth;
|
|
272
|
+
const max = Math.max(min, this.maxLimit.offsetWidth);
|
|
273
|
+
return {
|
|
274
|
+
now: Math.round(this.currentWidth()),
|
|
275
|
+
min: Math.round(min),
|
|
276
|
+
max: Math.round(max),
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
// `offsetWidth` and not `getBoundingClientRect`, because the opening
|
|
280
|
+
// animation scales the panel with a transform.
|
|
281
|
+
currentWidth() {
|
|
282
|
+
return this.panel.offsetWidth;
|
|
283
|
+
}
|
|
284
|
+
static get is() { return "limel-side-panel"; }
|
|
285
|
+
static get encapsulation() { return "shadow"; }
|
|
286
|
+
static get originalStyleUrls() {
|
|
287
|
+
return {
|
|
288
|
+
"$": ["side-panel.scss"]
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
static get styleUrls() {
|
|
292
|
+
return {
|
|
293
|
+
"$": ["side-panel.css"]
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
static get properties() {
|
|
297
|
+
return {
|
|
298
|
+
"label": {
|
|
299
|
+
"type": "string",
|
|
300
|
+
"mutable": false,
|
|
301
|
+
"complexType": {
|
|
302
|
+
"original": "string",
|
|
303
|
+
"resolved": "string",
|
|
304
|
+
"references": {}
|
|
305
|
+
},
|
|
306
|
+
"required": false,
|
|
307
|
+
"optional": true,
|
|
308
|
+
"docs": {
|
|
309
|
+
"tags": [],
|
|
310
|
+
"text": "Accessible name of the panel. Screen readers announce it. Set it to\nsomething that tells the user what the panel is for."
|
|
311
|
+
},
|
|
312
|
+
"getter": false,
|
|
313
|
+
"setter": false,
|
|
314
|
+
"reflect": false,
|
|
315
|
+
"attribute": "label"
|
|
316
|
+
},
|
|
317
|
+
"closeLabel": {
|
|
318
|
+
"type": "string",
|
|
319
|
+
"mutable": false,
|
|
320
|
+
"complexType": {
|
|
321
|
+
"original": "string",
|
|
322
|
+
"resolved": "string",
|
|
323
|
+
"references": {}
|
|
324
|
+
},
|
|
325
|
+
"required": false,
|
|
326
|
+
"optional": false,
|
|
327
|
+
"docs": {
|
|
328
|
+
"tags": [],
|
|
329
|
+
"text": "Label of the close button. Shown as a tooltip and used as the accessible\nname."
|
|
330
|
+
},
|
|
331
|
+
"getter": false,
|
|
332
|
+
"setter": false,
|
|
333
|
+
"reflect": false,
|
|
334
|
+
"attribute": "close-label",
|
|
335
|
+
"defaultValue": "'Close'"
|
|
336
|
+
},
|
|
337
|
+
"resizeLabel": {
|
|
338
|
+
"type": "string",
|
|
339
|
+
"mutable": false,
|
|
340
|
+
"complexType": {
|
|
341
|
+
"original": "string",
|
|
342
|
+
"resolved": "string",
|
|
343
|
+
"references": {}
|
|
344
|
+
},
|
|
345
|
+
"required": false,
|
|
346
|
+
"optional": false,
|
|
347
|
+
"docs": {
|
|
348
|
+
"tags": [],
|
|
349
|
+
"text": "Label of the resize handle. Used as the accessible name."
|
|
350
|
+
},
|
|
351
|
+
"getter": false,
|
|
352
|
+
"setter": false,
|
|
353
|
+
"reflect": false,
|
|
354
|
+
"attribute": "resize-label",
|
|
355
|
+
"defaultValue": "'Resize'"
|
|
356
|
+
},
|
|
357
|
+
"closeOnEscape": {
|
|
358
|
+
"type": "boolean",
|
|
359
|
+
"mutable": false,
|
|
360
|
+
"complexType": {
|
|
361
|
+
"original": "boolean",
|
|
362
|
+
"resolved": "boolean",
|
|
363
|
+
"references": {}
|
|
364
|
+
},
|
|
365
|
+
"required": false,
|
|
366
|
+
"optional": false,
|
|
367
|
+
"docs": {
|
|
368
|
+
"tags": [],
|
|
369
|
+
"text": "Whether pressing Escape emits `close`. Set to `false` to let only the\nclose button emit `close`. The panel then does not prevent the Escape\nevent either."
|
|
370
|
+
},
|
|
371
|
+
"getter": false,
|
|
372
|
+
"setter": false,
|
|
373
|
+
"reflect": false,
|
|
374
|
+
"attribute": "close-on-escape",
|
|
375
|
+
"defaultValue": "true"
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
static get states() {
|
|
380
|
+
return {
|
|
381
|
+
"widthRange": {}
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
static get events() {
|
|
385
|
+
return [{
|
|
386
|
+
"method": "close",
|
|
387
|
+
"name": "close",
|
|
388
|
+
"bubbles": true,
|
|
389
|
+
"cancelable": true,
|
|
390
|
+
"composed": true,
|
|
391
|
+
"docs": {
|
|
392
|
+
"tags": [],
|
|
393
|
+
"text": "Emitted when the close button is clicked, or when Escape is pressed and\n`closeOnEscape` is `true`."
|
|
394
|
+
},
|
|
395
|
+
"complexType": {
|
|
396
|
+
"original": "void",
|
|
397
|
+
"resolved": "void",
|
|
398
|
+
"references": {}
|
|
399
|
+
}
|
|
400
|
+
}, {
|
|
401
|
+
"method": "changeWidth",
|
|
402
|
+
"name": "changeWidth",
|
|
403
|
+
"bubbles": true,
|
|
404
|
+
"cancelable": true,
|
|
405
|
+
"composed": true,
|
|
406
|
+
"docs": {
|
|
407
|
+
"tags": [],
|
|
408
|
+
"text": "Emitted when the user has finished a resize that changed the width. The\ndetail is the new width in pixels. The panel already uses the new width. Store the value to\nrestore the width with `--side-panel-width` the next time the panel opens."
|
|
409
|
+
},
|
|
410
|
+
"complexType": {
|
|
411
|
+
"original": "number",
|
|
412
|
+
"resolved": "number",
|
|
413
|
+
"references": {}
|
|
414
|
+
}
|
|
415
|
+
}];
|
|
416
|
+
}
|
|
417
|
+
static get elementRef() { return "host"; }
|
|
418
|
+
static get listeners() {
|
|
419
|
+
return [{
|
|
420
|
+
"name": "close",
|
|
421
|
+
"method": "stopContentEventAtHost",
|
|
422
|
+
"target": undefined,
|
|
423
|
+
"capture": false,
|
|
424
|
+
"passive": false
|
|
425
|
+
}, {
|
|
426
|
+
"name": "changeWidth",
|
|
427
|
+
"method": "stopContentEventAtHost",
|
|
428
|
+
"target": undefined,
|
|
429
|
+
"capture": false,
|
|
430
|
+
"passive": false
|
|
431
|
+
}];
|
|
432
|
+
}
|
|
433
|
+
}
|
|
@@ -270,15 +270,15 @@ export class Slider {
|
|
|
270
270
|
if (this.disabled || this.readonly) {
|
|
271
271
|
inputProps.disabled = true;
|
|
272
272
|
}
|
|
273
|
-
return (h(Host, { key: '
|
|
273
|
+
return (h(Host, { key: '6d910879894ffc7ff36df228e4252e4758622ab9', class: this.getContainerClassList() }, h("limel-notched-outline", { key: '56e3b4dbc963b6923c63a33acb21895f4e86c947', labelId: this.labelId, label: this.label, required: this.required, invalid: this.invalid, disabled: this.disabled, readonly: this.readonly, hasValue: !this.isUnset, hasFloatingLabel: true }, h("div", { key: 'f74ef31e0b7d67dcc8a231a05f9b00b84de50b33', slot: "content" }, h("div", { key: '4a4018ac095977f89cba99a0222603469d11ce30', class: "slider", style: { '--slider-fraction': `${fraction}` } }, h("input", Object.assign({ key: '8e45c543c4ba524e5257169f79d0e86b4cf95635', type: "range", min: min, max: max, value: this.displayValue, "aria-labelledby": this.labelId, "aria-describedby": this.helperText
|
|
274
274
|
? this.helperTextId
|
|
275
275
|
: undefined, "aria-valuetext": this.isUnset
|
|
276
276
|
? translate.get('value-not-set', this.language)
|
|
277
277
|
: undefined, ref: (el) => {
|
|
278
278
|
this.inputElement = el;
|
|
279
|
-
}, onInput: this.handleInput, onChange: this.handleChange, onClick: this.handleClick }, inputProps)), h("div", { key: '
|
|
279
|
+
}, onInput: this.handleInput, onChange: this.handleChange, onClick: this.handleClick }, inputProps)), h("div", { key: '83a5600495635b0fd19cb93be94b59a333f574a5', class: "track" }, h("div", { key: '771452b79092adfea7aa82ab87d18910fe6bda8c', class: "active" }), this.renderStepDots(min, max)), h("div", { key: 'f3819b77285addfdd15b378943ca2ef16748f319', class: "thumb" }, h("div", { key: '46802964d1de2d5ee42faa6f02c1a51f6e35d37e', class: "knob" }), h("div", { key: '273328b017f98f7d581331b0ea1817d370b402f0', class: "indicator", "aria-hidden": "true" }, this.isUnset
|
|
280
280
|
? '\u{2194}\u{FE0E}'
|
|
281
|
-
: this.displayValue))), h("div", { key: '
|
|
281
|
+
: this.displayValue))), h("div", { key: '92b16e21ce4cbf4e78136f5475581dc82c7aaac7', class: "range-labels" }, h("span", { key: 'be3be26585786ed002a4ad8678cc4f759b2ff510', class: "min" }, this.multiplyByFactor(this.valuemin), this.unit), h("span", { key: 'abe4058f7a055ec348971ebf5a5d26c3a5ccb0f5', class: "max" }, this.multiplyByFactor(this.valuemax), this.unit)))), this.renderClearButton(), this.renderHelperLine()));
|
|
282
282
|
}
|
|
283
283
|
watchValue() {
|
|
284
284
|
this.syncStateFromValue();
|
|
@@ -122,14 +122,14 @@ export class Snackbar {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
render() {
|
|
125
|
-
return (h("aside", { key: '
|
|
125
|
+
return (h("aside", { key: 'afddc11b55b4f3bdf05bc9ff50ed8c05851d53ac', popover: "manual", style: {
|
|
126
126
|
'--snackbar-timeout': `${Math.max(this.timeout || 0, 0)}ms`,
|
|
127
127
|
'--snackbar-distance-to-top-edge': `${this.offset}px`,
|
|
128
128
|
}, class: {
|
|
129
129
|
open: this.open,
|
|
130
130
|
'is-closing': this.closing,
|
|
131
131
|
'limel-portal--parent': true,
|
|
132
|
-
}, id: this.snackbarId, role: this.setAriaRoles(), "aria-atomic": this.open ? 'true' : undefined, "aria-relevant": this.open ? 'additions' : undefined }, h("div", { key: '
|
|
132
|
+
}, id: this.snackbarId, role: this.setAriaRoles(), "aria-atomic": this.open ? 'true' : undefined, "aria-relevant": this.open ? 'additions' : undefined }, h("div", { key: 'ea4aff6aba7f089e34e48aeb91a2a2d7382f3ca4', class: "surface" }, h("limel-markdown", { key: '3b2cc771e74d951a2dc2118e179c5a7670e2eab2', class: "label", value: this.message }), this.renderActions(this.actionText), this.renderDismissButton(this.dismissible))));
|
|
133
133
|
}
|
|
134
134
|
setAriaRoles() {
|
|
135
135
|
if (!this.open) {
|
|
@@ -16,7 +16,7 @@ export class Spinner {
|
|
|
16
16
|
this.limeBranded = false;
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: 'ce772c5c7083690c8350e05720a5a1ba3a9119dd' }, h("svg", { key: 'd89a035b940a7cdb9e4f994a94301e91d242605e', viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, this.renderSpinner())));
|
|
20
20
|
}
|
|
21
21
|
renderSpinner() {
|
|
22
22
|
if (!this.limeBranded) {
|
|
@@ -55,9 +55,9 @@ export class SplitButton {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
render() {
|
|
58
|
-
return (h(Host, { key: '
|
|
58
|
+
return (h(Host, { key: 'cb82f37e28c686da8dbdd1d5e0dafc00f5f47f4d', class: {
|
|
59
59
|
'has-menu': this.items.length > 0,
|
|
60
|
-
}, onClick: this.filterClickWhenDisabled }, h("limel-button", { key: '
|
|
60
|
+
}, onClick: this.filterClickWhenDisabled }, h("limel-button", { key: '227c768350a7e822f766043c31f4d3ccb5d5181c', label: this.label, primary: this.primary, icon: this.icon, disabled: this.disabled, loading: this.loading, loadingFailed: this.loadingFailed }), this.renderMenu()));
|
|
61
61
|
}
|
|
62
62
|
static get is() { return "limel-split-button"; }
|
|
63
63
|
static get encapsulation() { return "shadow"; }
|
|
@@ -78,7 +78,7 @@ export class Switch {
|
|
|
78
78
|
removeEnterClickable(this.host);
|
|
79
79
|
}
|
|
80
80
|
render() {
|
|
81
|
-
return (h(Host, { key: '
|
|
81
|
+
return (h(Host, { key: '5193987be5def9c42517ecbc1affc9cbb08d6ff6' }, this.readonly
|
|
82
82
|
? this.renderReadonly()
|
|
83
83
|
: this.renderInteractive(), this.renderHelperLine()));
|
|
84
84
|
}
|
|
@@ -62,7 +62,7 @@ export class TabBar {
|
|
|
62
62
|
}
|
|
63
63
|
render() {
|
|
64
64
|
const tabStop = findTabStop(this.tabs, this.tabs.findIndex((tab) => tab.active), this.getNavigationOptions());
|
|
65
|
-
return (h("div", { key: '
|
|
65
|
+
return (h("div", { key: 'f4a760e69615d4d4d87ad3e176d109dbcdf2ea34', role: "tablist", "aria-orientation": this.getOrientation(), onKeyDown: this.handleKeyDown }, h("limel-scroller", { key: 'f3ff8810cf0a248c13aa2d9840c80c6f6270df68', orientation: this.getOrientation() }, this.tabs.map((tab, index) => this.renderTab(tab, index, index === tabStop)))));
|
|
66
66
|
}
|
|
67
67
|
tabsChanged(newTabs = [], oldTabs = []) {
|
|
68
68
|
const newIds = newTabs.map((tab) => tab.id);
|
|
@@ -64,7 +64,7 @@ export class TabPanel {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
render() {
|
|
67
|
-
return (h(Host, { key: '
|
|
67
|
+
return (h(Host, { key: '69b4a7ee8bbe366dd3a001e2d63a96c1680660c1', onChangeTab: this.handleChangeTabs }, h("div", { key: '5844651fd25248b2767127f6ca6ab5f02f03c347', class: "tab-panel" }, h("limel-tab-bar", { key: '0ef45e1bead572d950148b0e4f8b53c8d9f567ce', tabs: this.tabs, orientation: this.orientation }), h("div", { key: 'a8b336877c2bc9b1ebda32fd726d76be3957bbf3', class: "tab-content" }, h("slot", { key: '97e10533292738d2b4d0914eb9922cac0b396bb6' })))));
|
|
68
68
|
}
|
|
69
69
|
setSlotElements() {
|
|
70
70
|
const slot = this.getSlot();
|
|
@@ -757,13 +757,13 @@ export class Table {
|
|
|
757
757
|
render() {
|
|
758
758
|
var _a, _b;
|
|
759
759
|
const totalRows = (_a = this.totalRows) !== null && _a !== void 0 ? _a : this.data.length;
|
|
760
|
-
return (h(Host, { key: '
|
|
760
|
+
return (h(Host, { key: '8e8d0bcd487ff3a97c2a94b69c4501f941908ee1', class: {
|
|
761
761
|
'has-low-density': this.layout === 'lowDensity',
|
|
762
762
|
'has-pagination-on-top': this.paginationLocation === 'top',
|
|
763
763
|
'has-aggregation': this.hasAggregation(this.columns),
|
|
764
764
|
'has-pagination': totalRows > this.pageSize,
|
|
765
765
|
'has-selection': (_b = this.tableSelection) === null || _b === void 0 ? void 0 : _b.hasSelection,
|
|
766
|
-
} }, h("div", { key: '
|
|
766
|
+
} }, h("div", { key: '9e28778ef0d76065191837fb3f86293c3ba4c482', id: "tabulator-container" }, h("div", { key: '4f5ffbe1d9c61a7557fe2f91ce71f599f7443445', id: "tabulator-loader", style: { display: this.loading ? 'flex' : 'none' } }, h("limel-spinner", { key: 'd758f28e7e2fa0db7e5550e4786b1855f94e2bca', size: "large" })), this.renderEmptyMessage(), this.renderSelectAll(), h("div", { key: 'f936473386dd1ad3163a7726cb8203f93c7d3528', id: "tabulator-table" }))));
|
|
767
767
|
}
|
|
768
768
|
renderSelectAll() {
|
|
769
769
|
var _a, _b, _c;
|
|
@@ -107,9 +107,9 @@ export class TextEditorLinkMenu {
|
|
|
107
107
|
var _a, _b;
|
|
108
108
|
const isValid = this.isValid(this.link.href);
|
|
109
109
|
return [
|
|
110
|
-
h("limel-input-field", { key: '
|
|
111
|
-
h("limel-input-field", { key: '
|
|
112
|
-
h("div", { key: '
|
|
110
|
+
h("limel-input-field", { key: 'b56e8cc8a92687def175a89ac65ae50dc8d20117', label: this.getTranslation('editor-link-menu.text'), value: ((_a = this.link) === null || _a === void 0 ? void 0 : _a.text) || '', leadingIcon: "text_cursor", onChange: this.handleLinkTitleChange, onKeyDown: this.handleKeyDown }),
|
|
111
|
+
h("limel-input-field", { key: '15e93737de2593e18e834574fc2ea6c1ae674750', label: this.getTranslation('editor-link-menu.link'), value: ((_b = this.link) === null || _b === void 0 ? void 0 : _b.href) || '', type: "text", leadingIcon: "-lime-text-link", trailingIcon: "external_link", invalid: !isValid, onChange: this.handleLinkValueChange, onAction: this.handleLinkInputAction, onKeyDown: this.handleKeyDown, ref: (el) => (this.linkInput = el) }),
|
|
112
|
+
h("div", { key: 'e26f28d12a340a6a6a6812e538ece24e542435b7', class: "actions" }, h("limel-button", { key: 'db02d851b128ef963d505cb27c604105aaa5a55d', label: this.getTranslation('cancel'), onClick: this.handleCancel }), h("limel-button", { key: '3bb20785677384693a20963c493a1cfd9b8fabcb', primary: true, label: this.getTranslation('save'), disabled: !isValid, onClick: this.handleSave, ref: (el) => (this.saveButton = el), slot: "button" })),
|
|
113
113
|
];
|
|
114
114
|
}
|
|
115
115
|
static get is() { return "limel-text-editor-link-menu"; }
|
|
@@ -308,7 +308,7 @@ export class ProsemirrorAdapter {
|
|
|
308
308
|
(_e = this.view) === null || _e === void 0 ? void 0 : _e.destroy();
|
|
309
309
|
}
|
|
310
310
|
render() {
|
|
311
|
-
return (h(Host, { key: '
|
|
311
|
+
return (h(Host, { key: '6c92f1576fdd862e592d0ccf6779c6d3da806808', onFocus: this.handleFocus }, h("div", { key: '0b1b90a7c68b62ecffed21f4c49fced5333f0d83', id: "editor" }), this.renderToolbar(), this.renderLinkMenu()));
|
|
312
312
|
}
|
|
313
313
|
renderToolbar() {
|
|
314
314
|
if (this.actionBarItems.length === 0 || this.ui === 'no-toolbar') {
|
|
@@ -176,7 +176,7 @@ export class TextEditor {
|
|
|
176
176
|
await ((_a = this.adapterElement) === null || _a === void 0 ? void 0 : _a.clear());
|
|
177
177
|
}
|
|
178
178
|
render() {
|
|
179
|
-
return (h(Host, { key: '
|
|
179
|
+
return (h(Host, { key: '8a5ca6c89305056819747e51cd808f35036c8666' }, h("limel-notched-outline", { key: 'eb4bd944033212a2ec88d664aa1096fc3b07a5cf', labelId: this.editorId, label: this.label, required: this.required, invalid: this.invalid, disabled: this.disabled, readonly: this.readonly, hasValue: !!this.value, hasFloatingLabel: true }, this.renderEditor(), this.renderPlaceholder()), this.renderHelperLine()));
|
|
180
180
|
}
|
|
181
181
|
renderEditor() {
|
|
182
182
|
if (this.readonly) {
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const entries = new WeakMap();
|
|
2
|
+
/**
|
|
3
|
+
* Set the `aria-description` of an element on behalf of an owner. The
|
|
4
|
+
* description that the element had before is kept, for when the last owner
|
|
5
|
+
* stops describing it.
|
|
6
|
+
*
|
|
7
|
+
* @param element
|
|
8
|
+
* @param owner
|
|
9
|
+
* @param text
|
|
10
|
+
*/
|
|
11
|
+
export function setDescription(element, owner, text) {
|
|
12
|
+
let entry = entries.get(element);
|
|
13
|
+
if (!entry) {
|
|
14
|
+
entry = {
|
|
15
|
+
original: element.getAttribute('aria-description'),
|
|
16
|
+
texts: new Map(),
|
|
17
|
+
};
|
|
18
|
+
entries.set(element, entry);
|
|
19
|
+
}
|
|
20
|
+
entry.texts.delete(owner);
|
|
21
|
+
entry.texts.set(owner, text);
|
|
22
|
+
element.setAttribute('aria-description', text);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Stop describing an element on behalf of an owner. The text of the owner
|
|
26
|
+
* that described it most recently stays, and when none is left, the
|
|
27
|
+
* description that the element had before is put back. Nothing is changed
|
|
28
|
+
* if the attribute has been changed by someone else.
|
|
29
|
+
*
|
|
30
|
+
* @param element
|
|
31
|
+
* @param owner
|
|
32
|
+
*/
|
|
33
|
+
export function clearDescription(element, owner) {
|
|
34
|
+
const entry = entries.get(element);
|
|
35
|
+
const text = entry === null || entry === void 0 ? void 0 : entry.texts.get(owner);
|
|
36
|
+
if (!entry || text === undefined) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
entry.texts.delete(owner);
|
|
40
|
+
const isCurrent = element.getAttribute('aria-description') === text;
|
|
41
|
+
const remaining = [...entry.texts.values()].at(-1);
|
|
42
|
+
if (remaining !== undefined) {
|
|
43
|
+
if (isCurrent) {
|
|
44
|
+
element.setAttribute('aria-description', remaining);
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
entries.delete(element);
|
|
49
|
+
if (!isCurrent) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (entry.original === null) {
|
|
53
|
+
element.removeAttribute('aria-description');
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
element.setAttribute('aria-description', entry.original);
|
|
57
|
+
}
|