@nldd/design-system 0.8.78 → 0.8.80
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/custom-elements.json +1513 -476
- package/dist/components/actions/button/button.styles.d.ts.map +1 -1
- package/dist/components/actions/button/button.styles.js +4 -1
- package/dist/components/actions/button/button.styles.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.styles.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.styles.js +4 -1
- package/dist/components/actions/icon-button/icon-button.styles.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts +19 -1
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +55 -25
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.d.ts +9 -0
- package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.i18n.d.ts +1 -0
- package/dist/components/actions/toolbar/toolbar.i18n.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.i18n.js +1 -0
- package/dist/components/actions/toolbar/toolbar.i18n.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.js +20 -0
- package/dist/components/actions/toolbar/toolbar.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.js +39 -5
- package/dist/components/actions/toolbar/toolbar.styles.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.template.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.template.js +19 -1
- package/dist/components/actions/toolbar/toolbar.template.js.map +1 -1
- package/dist/components/components.js +97 -94
- package/dist/components/content/avatar/avatar.d.ts +51 -47
- package/dist/components/content/avatar/avatar.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.js +85 -75
- package/dist/components/content/avatar/avatar.js.map +1 -1
- package/dist/components/content/avatar/avatar.styles.js +2 -2
- package/dist/components/content/avatar/avatar.template.d.ts +1 -0
- package/dist/components/content/avatar/avatar.template.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.template.js +26 -18
- package/dist/components/content/avatar/avatar.template.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.d.ts +90 -0
- package/dist/components/content/avatar-group/avatar-group.d.ts.map +1 -0
- package/dist/components/content/avatar-group/avatar-group.i18n.d.ts +6 -0
- package/dist/components/content/avatar-group/avatar-group.i18n.d.ts.map +1 -0
- package/dist/components/content/avatar-group/avatar-group.i18n.js +5 -0
- package/dist/components/content/avatar-group/avatar-group.i18n.js.map +1 -0
- package/dist/components/content/avatar-group/avatar-group.js +169 -0
- package/dist/components/content/avatar-group/avatar-group.js.map +1 -0
- package/dist/components/content/avatar-group/avatar-group.styles.d.ts +2 -0
- package/dist/components/content/avatar-group/avatar-group.styles.d.ts.map +1 -0
- package/dist/components/content/avatar-group/avatar-group.styles.js +132 -0
- package/dist/components/content/avatar-group/avatar-group.styles.js.map +1 -0
- package/dist/components/content/avatar-group/avatar-group.template.d.ts +3 -0
- package/dist/components/content/avatar-group/avatar-group.template.d.ts.map +1 -0
- package/dist/components/content/avatar-group/avatar-group.template.js +50 -0
- package/dist/components/content/avatar-group/avatar-group.template.js.map +1 -0
- package/dist/components/content/blockquote/blockquote.d.ts +3 -3
- package/dist/components/content/blockquote/blockquote.d.ts.map +1 -1
- package/dist/components/content/blockquote/blockquote.js +8 -8
- package/dist/components/content/blockquote/blockquote.js.map +1 -1
- package/dist/components/content/blockquote/blockquote.styles.js +1 -1
- package/dist/components/content/blockquote/blockquote.template.js +1 -1
- package/dist/components/content/blockquote/blockquote.template.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.d.ts +4 -4
- package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.js +5 -13
- package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.styles.js +1 -1
- package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
- package/dist/components/content/icon/icon-aliases.js +18 -0
- package/dist/components/content/icon/icon-aliases.js.map +1 -1
- package/dist/components/content/icon/icon-gallery-status.d.ts.map +1 -1
- package/dist/components/content/icon/icon-gallery-status.js +65 -27
- package/dist/components/content/icon/icon-gallery-status.js.map +1 -1
- package/dist/components/content/icon/icon-registry.d.ts.map +1 -1
- package/dist/components/content/icon/icon-registry.js +16 -12
- package/dist/components/content/icon/icon-registry.js.map +1 -1
- package/dist/components/content/identity/identity.d.ts +71 -0
- package/dist/components/content/identity/identity.d.ts.map +1 -0
- package/dist/components/content/identity/identity.js +124 -0
- package/dist/components/content/identity/identity.js.map +1 -0
- package/dist/components/content/identity/identity.styles.d.ts +2 -0
- package/dist/components/content/identity/identity.styles.d.ts.map +1 -0
- package/dist/components/content/{byline/byline.styles.js → identity/identity.styles.js} +28 -47
- package/dist/components/content/identity/identity.styles.js.map +1 -0
- package/dist/components/content/identity/identity.template.d.ts +3 -0
- package/dist/components/content/identity/identity.template.d.ts.map +1 -0
- package/dist/components/content/{byline/byline.template.js → identity/identity.template.js} +12 -11
- package/dist/components/content/identity/identity.template.js.map +1 -0
- package/dist/components/content/tag/tag.d.ts +15 -10
- package/dist/components/content/tag/tag.d.ts.map +1 -1
- package/dist/components/content/tag/tag.js +15 -10
- package/dist/components/content/tag/tag.js.map +1 -1
- package/dist/components/content/title/title.d.ts +4 -4
- package/dist/components/content/title/title.js +4 -4
- package/dist/components/content/title/title.styles.js +1 -1
- package/dist/components/content/title/title.template.js +2 -2
- package/dist/components/content/token/token.d.ts +6 -2
- package/dist/components/content/token/token.d.ts.map +1 -1
- package/dist/components/content/token/token.js +6 -2
- package/dist/components/content/token/token.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.d.ts +26 -25
- package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +31 -25
- package/dist/components/content/tooltip/tooltip.js.map +1 -1
- package/dist/components/{index-v6dIt9IT.js → index-8pDDdMeW.js} +1 -1
- package/dist/components/{index-CcCKQ3Dj.js → index-C7QocEcT.js} +1 -1
- package/dist/components/{index-BNg_kPou.js → index-CDz7-C9c.js} +1 -1
- package/dist/components/{index-CU-wlUnI.js → index-CWQunWUb.js} +54096 -52492
- package/dist/components/{index-BmVf8Da6.js → index-CoY3JfIy.js} +1 -1
- package/dist/components/{index-D03jbAoU.js → index-DP9dl7P7.js} +1 -1
- package/dist/components/{index-D68oJ-Le.js → index-DV_2YpaH.js} +1 -1
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.d.ts +5 -0
- package/dist/components/inputs/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.js +8 -0
- package/dist/components/inputs/checkbox/checkbox.js.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.styles.d.ts.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.styles.js +17 -0
- package/dist/components/inputs/checkbox/checkbox.styles.js.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.template.d.ts.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.template.js +11 -0
- package/dist/components/inputs/checkbox/checkbox.template.js.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.d.ts.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.js +7 -0
- package/dist/components/inputs/combo-box/combo-box.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.styles.d.ts.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.styles.js +7 -2
- package/dist/components/inputs/date-picker/date-picker.styles.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.d.ts +112 -0
- package/dist/components/inputs/file-field/file-field.d.ts.map +1 -0
- package/dist/components/inputs/file-field/file-field.i18n.d.ts +10 -0
- package/dist/components/inputs/file-field/file-field.i18n.d.ts.map +1 -0
- package/dist/components/inputs/file-field/file-field.i18n.js +9 -0
- package/dist/components/inputs/file-field/file-field.i18n.js.map +1 -0
- package/dist/components/inputs/file-field/file-field.js +246 -0
- package/dist/components/inputs/file-field/file-field.js.map +1 -0
- package/dist/components/inputs/file-field/file-field.styles.d.ts +2 -0
- package/dist/components/inputs/file-field/file-field.styles.d.ts.map +1 -0
- package/dist/components/inputs/file-field/file-field.styles.js +134 -0
- package/dist/components/inputs/file-field/file-field.styles.js.map +1 -0
- package/dist/components/inputs/file-field/file-field.template.d.ts +7 -0
- package/dist/components/inputs/file-field/file-field.template.d.ts.map +1 -0
- package/dist/components/inputs/file-field/file-field.template.js +63 -0
- package/dist/components/inputs/file-field/file-field.template.js.map +1 -0
- package/dist/components/inputs/radio-button/radio-button.d.ts +5 -0
- package/dist/components/inputs/radio-button/radio-button.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.js +8 -0
- package/dist/components/inputs/radio-button/radio-button.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.styles.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.styles.js +11 -0
- package/dist/components/inputs/radio-button/radio-button.styles.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.template.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.template.js +10 -0
- package/dist/components/inputs/radio-button/radio-button.template.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.caret.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.caret.js +7 -1
- package/dist/components/inputs/text-editor/text-editor.caret.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.d.ts +0 -4
- package/dist/components/inputs/text-editor/text-editor.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.js +0 -6
- package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.styles.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.styles.js +1 -9
- package/dist/components/inputs/text-editor/text-editor.styles.js.map +1 -1
- package/dist/components/inputs/time-field/time-field.template.js +1 -1
- package/dist/components/inputs/time-picker/time-picker.styles.d.ts.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.styles.js +7 -2
- package/dist/components/inputs/time-picker/time-picker.styles.js.map +1 -1
- package/dist/components/layout/box/box.d.ts +17 -7
- package/dist/components/layout/box/box.d.ts.map +1 -1
- package/dist/components/layout/box/box.js +17 -7
- package/dist/components/layout/box/box.js.map +1 -1
- package/dist/components/layout/box/box.styles.d.ts.map +1 -1
- package/dist/components/layout/box/box.styles.js +9 -2
- package/dist/components/layout/box/box.styles.js.map +1 -1
- package/dist/components/layout/container/container.d.ts +10 -0
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +38 -0
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/container/container.styles.d.ts.map +1 -1
- package/dist/components/layout/container/container.styles.js +10 -1
- package/dist/components/layout/container/container.styles.js.map +1 -1
- package/dist/components/layout/page/page.styles.d.ts.map +1 -1
- package/dist/components/layout/page/page.styles.js +8 -1
- package/dist/components/layout/page/page.styles.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +32 -33
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +32 -33
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.template.js +1 -1
- package/dist/components/layout/page-sections/hero/hero.template.js.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.d.ts +7 -0
- package/dist/components/layout/page-sections/simple-section/simple-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.js +12 -0
- package/dist/components/layout/page-sections/simple-section/simple-section.js.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.styles.js +19 -0
- package/dist/components/layout/page-sections/simple-section/simple-section.styles.js.map +1 -1
- package/dist/components/layout/popover/popover.d.ts +34 -28
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +44 -31
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/layout/sheet/sheet.d.ts +2 -0
- package/dist/components/layout/sheet/sheet.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.js +12 -1
- package/dist/components/layout/sheet/sheet.js.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.styles.js +9 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js +9 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.d.ts +14 -14
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.js +13 -13
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js +13 -2
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.d.ts +8 -11
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +8 -10
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.styles.js +13 -6
- package/dist/components/lists-and-tables/list/list.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +20 -16
- package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +44 -30
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +15 -0
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js +44 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.template.d.ts.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.template.js +3 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.template.js.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.d.ts +23 -11
- package/dist/components/status-and-feedback/badge/badge.d.ts.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.js +32 -14
- package/dist/components/status-and-feedback/badge/badge.js.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.styles.js +59 -2
- package/dist/components/status-and-feedback/badge/badge.styles.js.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.template.js +6 -1
- package/dist/components/status-and-feedback/badge/badge.template.js.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.styles.js +6 -0
- package/dist/components/status-and-feedback/banner/banner.styles.js.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts +2 -0
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js +14 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notification-region.d.ts +6 -0
- package/dist/components/status-and-feedback/notification/notification-region.d.ts.map +1 -0
- package/dist/components/status-and-feedback/notification/notification-region.js +245 -0
- package/dist/components/status-and-feedback/notification/notification-region.js.map +1 -0
- package/dist/components/status-and-feedback/notification/notification.d.ts +129 -0
- package/dist/components/status-and-feedback/notification/notification.d.ts.map +1 -0
- package/dist/components/status-and-feedback/notification/notification.i18n.d.ts +6 -0
- package/dist/components/status-and-feedback/notification/notification.i18n.d.ts.map +1 -0
- package/dist/components/status-and-feedback/notification/notification.i18n.js +5 -0
- package/dist/components/status-and-feedback/notification/notification.i18n.js.map +1 -0
- package/dist/components/status-and-feedback/notification/notification.js +269 -0
- package/dist/components/status-and-feedback/notification/notification.js.map +1 -0
- package/dist/components/status-and-feedback/notification/notification.styles.d.ts +2 -0
- package/dist/components/status-and-feedback/notification/notification.styles.d.ts.map +1 -0
- package/dist/components/status-and-feedback/notification/notification.styles.js +177 -0
- package/dist/components/status-and-feedback/notification/notification.styles.js.map +1 -0
- package/dist/components/status-and-feedback/notification/notification.template.d.ts +4 -0
- package/dist/components/status-and-feedback/notification/notification.template.d.ts.map +1 -0
- package/dist/components/status-and-feedback/notification/notification.template.js +40 -0
- package/dist/components/status-and-feedback/notification/notification.template.js.map +1 -0
- package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.js +1 -0
- package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.js.map +1 -1
- package/dist/components/status-and-feedback/step-indicator/step-indicator.d.ts +30 -30
- package/dist/components/status-and-feedback/step-indicator/step-indicator.d.ts.map +1 -1
- package/dist/components/status-and-feedback/step-indicator/step-indicator.js +33 -30
- package/dist/components/status-and-feedback/step-indicator/step-indicator.js.map +1 -1
- package/dist/css/variables.css +24 -0
- package/dist/nldd.min.js +8381 -7593
- package/dist/types/vue.d.ts +257 -152
- package/dist/utilities/open-when-rendered.d.ts +21 -0
- package/dist/utilities/open-when-rendered.d.ts.map +1 -0
- package/dist/utilities/open-when-rendered.js +30 -0
- package/dist/utilities/open-when-rendered.js.map +1 -0
- package/dist/utilities/reflect-non-default.d.ts +3 -3
- package/dist/utilities/reflect-non-default.d.ts.map +1 -1
- package/dist/utilities/reflect-non-default.js +7 -4
- package/dist/utilities/reflect-non-default.js.map +1 -1
- package/dist/utilities/visibility-mixin.d.ts +5 -0
- package/dist/utilities/visibility-mixin.d.ts.map +1 -1
- package/dist/utilities/visibility-mixin.js +22 -0
- package/dist/utilities/visibility-mixin.js.map +1 -1
- package/package.json +34 -23
- package/dist/components/content/byline/byline.d.ts +0 -73
- package/dist/components/content/byline/byline.d.ts.map +0 -1
- package/dist/components/content/byline/byline.js +0 -125
- package/dist/components/content/byline/byline.js.map +0 -1
- package/dist/components/content/byline/byline.styles.d.ts +0 -2
- package/dist/components/content/byline/byline.styles.d.ts.map +0 -1
- package/dist/components/content/byline/byline.styles.js.map +0 -1
- package/dist/components/content/byline/byline.template.d.ts +0 -3
- package/dist/components/content/byline/byline.template.d.ts.map +0 -1
- package/dist/components/content/byline/byline.template.js.map +0 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Nederlandse Digitale Dienst File Field Component (Lit + TypeScript)
|
|
9
|
+
*
|
|
10
|
+
* A file picker that reads as one control: an nldd-button flush in the corner of
|
|
11
|
+
* a tinted surface, the chosen file next to it, and a dismiss button to clear it
|
|
12
|
+
* again. It wraps a hidden native `<input type="file">`, which is what makes the
|
|
13
|
+
* picker open at all — a file dialog only opens from a user gesture on a real
|
|
14
|
+
* input.
|
|
15
|
+
*
|
|
16
|
+
* The surface deliberately does not look like an input field. A border with
|
|
17
|
+
* field semantics promises you can type into it; here you can only press a
|
|
18
|
+
* button, so it uses button and surface colors instead of
|
|
19
|
+
* `--semantics-input-fields-*`. The button keeps its own tinted background and
|
|
20
|
+
* therefore sits a shade darker in the surface, which is what marks it as the
|
|
21
|
+
* thing to press.
|
|
22
|
+
*
|
|
23
|
+
* Several files are summarized, not listed: "3 bestanden" with a single cross
|
|
24
|
+
* that clears all of them. Every pick replaces the whole FileList, and rebuilding
|
|
25
|
+
* it to add or drop one file means going through DataTransfer, which does not
|
|
26
|
+
* deduplicate (even the same File object twice yields two entries) — and a File
|
|
27
|
+
* has no id, so deduplicating would come down to guessing from name, size and
|
|
28
|
+
* last-modified. A list with a cross per file would promise an edit the platform
|
|
29
|
+
* does not support. A page that does want to show the files renders its own list
|
|
30
|
+
* from the `File[]` in the change event.
|
|
31
|
+
*
|
|
32
|
+
* @element nldd-file-field
|
|
33
|
+
* @attr {string} size - Field size: 'md' (default) | 'sm'. Set automatically by nldd-form-field.
|
|
34
|
+
* @attr {string} accept - Comma-separated list of accepted file types, forwarded to the input (e.g. ".pdf,image/*")
|
|
35
|
+
* @attr {boolean} multiple - Allows choosing more than one file
|
|
36
|
+
* @attr {string} accessible-label - Accessible label forwarded to the inner input. Set automatically by nldd-form-field.
|
|
37
|
+
* @attr {string} input-id - Sets the id on the native input. Set automatically by nldd-form-field.
|
|
38
|
+
* @attr {string} error-message-ids - Ids for aria-describedby on the inner input. Set automatically by nldd-form-field.
|
|
39
|
+
* @attr {boolean} valid - Marks the field as valid; shows a check icon on the right, like nldd-dropdown
|
|
40
|
+
* @attr {boolean} invalid - Marks the field as invalid; shows an alert icon on the right, like nldd-dropdown
|
|
41
|
+
* @attr {boolean} disabled - Disabled state
|
|
42
|
+
* @attr {string} name - Name for form submission
|
|
43
|
+
* @attr {boolean} required - Marks the field required (invalid while no file is chosen)
|
|
44
|
+
* @attr {object} translations - Override translation keys; unset keys fall back to Dutch
|
|
45
|
+
*
|
|
46
|
+
* @prop {File[]} files - The chosen files. Read-only: browsers forbid setting a file input's value, so there is no `value` attribute and no way to preselect a file.
|
|
47
|
+
*
|
|
48
|
+
* @fires change - When the chosen files change, including a clear; detail: { files: File[] }
|
|
49
|
+
*/
|
|
50
|
+
import { LitElement } from 'lit';
|
|
51
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
52
|
+
import { FormAssociated } from '../../../utilities/form-associated-mixin.js';
|
|
53
|
+
import { reflectNonDefault } from '../../../utilities/reflect-non-default.js';
|
|
54
|
+
import { fileFieldStyles } from './file-field.styles.js';
|
|
55
|
+
import { fileFieldTemplate } from './file-field.template.js';
|
|
56
|
+
import { nlddFileFieldTranslations } from './file-field.i18n.js';
|
|
57
|
+
let NLDDFileField = class NLDDFileField extends FormAssociated(LitElement) {
|
|
58
|
+
constructor() {
|
|
59
|
+
super(...arguments);
|
|
60
|
+
// Property order matches the story controls.
|
|
61
|
+
this.size = 'md';
|
|
62
|
+
this.accept = '';
|
|
63
|
+
this.multiple = false;
|
|
64
|
+
/** Accessible label forwarded to the inner <input>. Set automatically by nldd-form-field. */
|
|
65
|
+
this.accessibleLabel = '';
|
|
66
|
+
this.inputId = '';
|
|
67
|
+
this.errorMessageIds = '';
|
|
68
|
+
this.valid = false;
|
|
69
|
+
this.invalid = false;
|
|
70
|
+
this.disabled = false;
|
|
71
|
+
this.name = '';
|
|
72
|
+
this.required = false;
|
|
73
|
+
this.translations = {};
|
|
74
|
+
/** The chosen files. Mirrors the input's FileList; there is no setter, because
|
|
75
|
+
* browsers refuse a programmatic file selection. */
|
|
76
|
+
this._files = [];
|
|
77
|
+
}
|
|
78
|
+
get files() {
|
|
79
|
+
return this._files;
|
|
80
|
+
}
|
|
81
|
+
/** @internal */
|
|
82
|
+
_t(key, vars) {
|
|
83
|
+
let text = this.translations[key] ?? nlddFileFieldTranslations[key];
|
|
84
|
+
if (vars) {
|
|
85
|
+
for (const [name, value] of Object.entries(vars)) {
|
|
86
|
+
text = text.split(`{${name}}`).join(String(value));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return text;
|
|
90
|
+
}
|
|
91
|
+
/** @internal */
|
|
92
|
+
_chooseLabel() {
|
|
93
|
+
return this.multiple
|
|
94
|
+
? this._t('components.file-field.to-choose-files-action')
|
|
95
|
+
: this._t('components.file-field.to-choose-file-action');
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The native input carries the field's label but is hidden, so it is not in
|
|
99
|
+
* the accessibility tree. The button is what you tab to, and on its own it
|
|
100
|
+
* only says "choose a file" — for which field is the part that matters.
|
|
101
|
+
*
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
_chooseAccessibleLabel() {
|
|
105
|
+
if (!this.accessibleLabel)
|
|
106
|
+
return '';
|
|
107
|
+
return `${this._chooseLabel()}, ${this.accessibleLabel}`;
|
|
108
|
+
}
|
|
109
|
+
/** @internal */
|
|
110
|
+
_valueLabel() {
|
|
111
|
+
if (this._files.length === 0)
|
|
112
|
+
return this._t('components.file-field.no-file-chosen-text');
|
|
113
|
+
if (this._files.length === 1)
|
|
114
|
+
return this._files[0].name;
|
|
115
|
+
return this._t('components.file-field.file-count-text', { count: this._files.length });
|
|
116
|
+
}
|
|
117
|
+
willUpdate(changed) {
|
|
118
|
+
if (changed.has('required'))
|
|
119
|
+
this._updateValidity();
|
|
120
|
+
if (changed.has('accessibleLabel'))
|
|
121
|
+
this.internals.ariaLabel = this.accessibleLabel || null;
|
|
122
|
+
}
|
|
123
|
+
/** @internal */
|
|
124
|
+
_handleChoose() {
|
|
125
|
+
this._input?.click();
|
|
126
|
+
}
|
|
127
|
+
/** @internal */
|
|
128
|
+
_handleInputChange(e) {
|
|
129
|
+
e.stopPropagation();
|
|
130
|
+
const input = e.target;
|
|
131
|
+
this._files = input.files ? Array.from(input.files) : [];
|
|
132
|
+
this._commit();
|
|
133
|
+
}
|
|
134
|
+
/** @internal */
|
|
135
|
+
_handleClear() {
|
|
136
|
+
// Clearing the input as well as the array: the element keeps the previous
|
|
137
|
+
// FileList otherwise, so choosing the same file again would fire no change.
|
|
138
|
+
if (this._input)
|
|
139
|
+
this._input.value = '';
|
|
140
|
+
this._files = [];
|
|
141
|
+
this._commit();
|
|
142
|
+
// Focus would land on the body when the cross unmounts with the last file.
|
|
143
|
+
void this.updateComplete.then(() => this.focus());
|
|
144
|
+
}
|
|
145
|
+
_commit() {
|
|
146
|
+
this.commitFormValue();
|
|
147
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
148
|
+
detail: { files: this._files },
|
|
149
|
+
bubbles: true,
|
|
150
|
+
composed: true,
|
|
151
|
+
}));
|
|
152
|
+
}
|
|
153
|
+
// — Form participation ————————————————————————————————————————————————————
|
|
154
|
+
/** Submit one entry per file under `name`, the way a native multiple file
|
|
155
|
+
* input does. A single file is submitted as itself, so a form with one file
|
|
156
|
+
* reads back as a File rather than as FormData wrapping one. */
|
|
157
|
+
formValue() {
|
|
158
|
+
if (!this.name || this._files.length === 0)
|
|
159
|
+
return null;
|
|
160
|
+
if (this._files.length === 1)
|
|
161
|
+
return this._files[0];
|
|
162
|
+
const data = new FormData();
|
|
163
|
+
for (const file of this._files)
|
|
164
|
+
data.append(this.name, file);
|
|
165
|
+
return data;
|
|
166
|
+
}
|
|
167
|
+
commitFormValue() {
|
|
168
|
+
super.commitFormValue();
|
|
169
|
+
this._updateValidity();
|
|
170
|
+
}
|
|
171
|
+
/** A required field without a file is invalid (valueMissing). */
|
|
172
|
+
_updateValidity() {
|
|
173
|
+
if (this.required && this._files.length === 0) {
|
|
174
|
+
this.internals.setValidity({ valueMissing: true }, this._t('components.file-field.required-error-text'), this._input ?? this);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
this.internals.setValidity({});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
formResetCallback() {
|
|
181
|
+
if (this._input)
|
|
182
|
+
this._input.value = '';
|
|
183
|
+
this._files = [];
|
|
184
|
+
this.commitFormValue();
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Delegates focus to the choose button rather than the hidden input: an input
|
|
188
|
+
* that is `display: none` cannot take focus, and the button is what a user
|
|
189
|
+
* sees as the control.
|
|
190
|
+
*/
|
|
191
|
+
focus(options) {
|
|
192
|
+
const button = this.shadowRoot?.querySelector('nldd-button');
|
|
193
|
+
button?.focus(options);
|
|
194
|
+
}
|
|
195
|
+
render() {
|
|
196
|
+
return fileFieldTemplate(this);
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
NLDDFileField.styles = fileFieldStyles;
|
|
200
|
+
__decorate([
|
|
201
|
+
property({ reflect: true, converter: reflectNonDefault('md') })
|
|
202
|
+
], NLDDFileField.prototype, "size", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
property({ type: String, reflect: true })
|
|
205
|
+
], NLDDFileField.prototype, "accept", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
property({ type: Boolean, reflect: true })
|
|
208
|
+
], NLDDFileField.prototype, "multiple", void 0);
|
|
209
|
+
__decorate([
|
|
210
|
+
property({ type: String, attribute: 'accessible-label' })
|
|
211
|
+
], NLDDFileField.prototype, "accessibleLabel", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
property({ type: String, attribute: 'input-id' })
|
|
214
|
+
], NLDDFileField.prototype, "inputId", void 0);
|
|
215
|
+
__decorate([
|
|
216
|
+
property({ type: String, attribute: 'error-message-ids' })
|
|
217
|
+
], NLDDFileField.prototype, "errorMessageIds", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
property({ type: Boolean, reflect: true })
|
|
220
|
+
], NLDDFileField.prototype, "valid", void 0);
|
|
221
|
+
__decorate([
|
|
222
|
+
property({ type: Boolean, reflect: true })
|
|
223
|
+
], NLDDFileField.prototype, "invalid", void 0);
|
|
224
|
+
__decorate([
|
|
225
|
+
property({ type: Boolean, reflect: true })
|
|
226
|
+
], NLDDFileField.prototype, "disabled", void 0);
|
|
227
|
+
__decorate([
|
|
228
|
+
property({ type: String, reflect: true })
|
|
229
|
+
], NLDDFileField.prototype, "name", void 0);
|
|
230
|
+
__decorate([
|
|
231
|
+
property({ type: Boolean, reflect: true })
|
|
232
|
+
], NLDDFileField.prototype, "required", void 0);
|
|
233
|
+
__decorate([
|
|
234
|
+
property({ type: Object })
|
|
235
|
+
], NLDDFileField.prototype, "translations", void 0);
|
|
236
|
+
__decorate([
|
|
237
|
+
state()
|
|
238
|
+
], NLDDFileField.prototype, "_files", void 0);
|
|
239
|
+
__decorate([
|
|
240
|
+
query('.file-field__input')
|
|
241
|
+
], NLDDFileField.prototype, "_input", void 0);
|
|
242
|
+
NLDDFileField = __decorate([
|
|
243
|
+
customElement('nldd-file-field')
|
|
244
|
+
], NLDDFileField);
|
|
245
|
+
export { NLDDFileField };
|
|
246
|
+
//# sourceMappingURL=file-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-field.js","sourceRoot":"","sources":["../../../../src/components/inputs/file-field/file-field.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EAAE,UAAU,EAAuB,MAAM,KAAK,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAkB,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAkC,MAAM,sBAAsB,CAA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AQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;8CACrC;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;sDACtC;AAGrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAC7B;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAC3B;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAChC;AAGV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAC2B;AAK9C;IADP,KAAK,EAAE;6CACoB;AAOpB;IADP,KAAK,CAAC,oBAAoB,CAAC;6CACM;AApDtB,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CAoLzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-field.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/file-field/file-field.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,yBAkI3B,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import { inheritedTextReset } from '../../../assets/styles/shadow-resets.js';
|
|
3
|
+
export const fileFieldStyles = css `
|
|
4
|
+
:host {
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/* # Host */
|
|
10
|
+
|
|
11
|
+
:host {
|
|
12
|
+
--_width: 100%;
|
|
13
|
+
--_corner-radius: var(--semantics-controls-md-corner-radius);
|
|
14
|
+
--_min-size: var(--semantics-controls-md-min-size);
|
|
15
|
+
--_inline-padding: var(--semantics-controls-md-inline-padding);
|
|
16
|
+
--_value-color: var(--components-file-field-value-color);
|
|
17
|
+
--_text-font: var(--semantics-input-fields-md-text-font);
|
|
18
|
+
--_clear-button-padding-right: calc((var(--_min-size) - var(--semantics-controls-sm-min-size)) / 2);
|
|
19
|
+
--_validation-icon-area-padding-right: var(--_inline-padding);
|
|
20
|
+
--_validation-icon-size: var(--semantics-input-fields-md-validation-icon-size);
|
|
21
|
+
|
|
22
|
+
${inheritedTextReset}
|
|
23
|
+
display: block;
|
|
24
|
+
width: var(--_width);
|
|
25
|
+
max-width: 100%;
|
|
26
|
+
min-width: 0;
|
|
27
|
+
-webkit-tap-highlight-color: transparent;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([hidden]) {
|
|
31
|
+
display: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([disabled]) {
|
|
35
|
+
opacity: var(--primitives-opacity-disabled);
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:host([size="sm"]) {
|
|
40
|
+
--_corner-radius: var(--semantics-controls-sm-corner-radius);
|
|
41
|
+
--_min-size: var(--semantics-controls-sm-min-size);
|
|
42
|
+
--_inline-padding: var(--semantics-controls-sm-inline-padding);
|
|
43
|
+
--_text-font: var(--semantics-input-fields-sm-text-font);
|
|
44
|
+
--_clear-button-padding-right: calc((var(--_min-size) - var(--semantics-controls-xs-min-size)) / 2);
|
|
45
|
+
--_validation-icon-size: var(--semantics-input-fields-sm-validation-icon-size);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
/* # Block */
|
|
50
|
+
|
|
51
|
+
.file-field {
|
|
52
|
+
box-sizing: border-box;
|
|
53
|
+
display: flex;
|
|
54
|
+
border-radius: var(--_corner-radius);
|
|
55
|
+
box-shadow: inset 0 0 0 var(--components-file-field-highlight-border-width) var(--components-file-field-highlight-border-color);
|
|
56
|
+
background-color: var(--components-file-field-background-color);
|
|
57
|
+
width: 100%;
|
|
58
|
+
min-width: 0;
|
|
59
|
+
min-height: var(--_min-size);
|
|
60
|
+
align-items: center;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
/* # Elements */
|
|
65
|
+
|
|
66
|
+
.file-field__input {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.file-field__choose-button {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-shrink: 0;
|
|
73
|
+
align-self: stretch;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.file-field__value {
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
min-width: 0;
|
|
79
|
+
padding-right: var(--_inline-padding);
|
|
80
|
+
padding-left: var(--_inline-padding);
|
|
81
|
+
flex-grow: 1;
|
|
82
|
+
color: var(--_value-color);
|
|
83
|
+
font: var(--_text-font);
|
|
84
|
+
text-overflow: ellipsis;
|
|
85
|
+
white-space: nowrap;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.file-field__value.is-empty {
|
|
90
|
+
--_value-color: var(--components-file-field-is-empty-value-color);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.file-field__clear-button {
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-shrink: 0;
|
|
96
|
+
padding-right: var(--_clear-button-padding-right);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.file-field__clear-button:not(:last-child) {
|
|
100
|
+
padding-right: var(--primitives-space-0);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.file-field__validation-icon-area {
|
|
104
|
+
display: flex;
|
|
105
|
+
height: 100%;
|
|
106
|
+
flex-shrink: 0;
|
|
107
|
+
padding-right: var(--_validation-icon-area-padding-right);
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:host([valid]) .file-field__validation-icon-area {
|
|
113
|
+
color: var(--semantics-input-fields-is-valid-icon-color);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:host([invalid]) .file-field__validation-icon-area {
|
|
117
|
+
color: var(--semantics-input-fields-is-invalid-icon-color);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.file-field__validation-icon {
|
|
121
|
+
width: var(--_validation-icon-size);
|
|
122
|
+
height: var(--_validation-icon-size);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
/* # High contrast */
|
|
127
|
+
|
|
128
|
+
@media (forced-colors: active) {
|
|
129
|
+
.file-field {
|
|
130
|
+
border: var(--components-file-field-highlight-border-width) solid CanvasText;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
`;
|
|
134
|
+
//# sourceMappingURL=file-field.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-field.styles.js","sourceRoot":"","sources":["../../../../src/components/inputs/file-field/file-field.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;IAmB9B,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+GrB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
import type { NLDDFileField } from './file-field.js';
|
|
3
|
+
import '../../actions/button/button.js';
|
|
4
|
+
import '../../actions/icon-button/icon-button.js';
|
|
5
|
+
import '../../content/icon/icon.js';
|
|
6
|
+
export declare function fileFieldTemplate(component: NLDDFileField): TemplateResult;
|
|
7
|
+
//# sourceMappingURL=file-field.template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-field.template.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/file-field/file-field.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAE,MAAM,KAAK,CAAC;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,gCAAgC,CAAC;AACxC,OAAO,0CAA0C,CAAC;AAClD,OAAO,4BAA4B,CAAC;AAepC,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,aAAa,GAAG,cAAc,CA6C1E"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { html, nothing } from 'lit';
|
|
2
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
3
|
+
import '../../actions/button/button.js';
|
|
4
|
+
import '../../actions/icon-button/icon-button.js';
|
|
5
|
+
import '../../content/icon/icon.js';
|
|
6
|
+
function renderValidationIcon(component) {
|
|
7
|
+
if (!component.invalid && !component.valid)
|
|
8
|
+
return nothing;
|
|
9
|
+
return html `
|
|
10
|
+
<div class="file-field__validation-icon-area">
|
|
11
|
+
<nldd-icon class="file-field__validation-icon"
|
|
12
|
+
name=${component.invalid ? 'invalid' : 'valid'}
|
|
13
|
+
aria-hidden="true"
|
|
14
|
+
></nldd-icon>
|
|
15
|
+
</div>
|
|
16
|
+
`;
|
|
17
|
+
}
|
|
18
|
+
export function fileFieldTemplate(component) {
|
|
19
|
+
const buttonSize = component.size === 'sm' ? 'xs' : 'sm';
|
|
20
|
+
const hasFiles = component.files.length > 0;
|
|
21
|
+
return html `
|
|
22
|
+
<div class="file-field">
|
|
23
|
+
<input class="file-field__input"
|
|
24
|
+
type="file"
|
|
25
|
+
id=${component.inputId || nothing}
|
|
26
|
+
accept=${component.accept || nothing}
|
|
27
|
+
?multiple=${component.multiple}
|
|
28
|
+
?disabled=${component.disabled}
|
|
29
|
+
?required=${component.required}
|
|
30
|
+
aria-label=${component.accessibleLabel || nothing}
|
|
31
|
+
aria-describedby=${component.errorMessageIds || nothing}
|
|
32
|
+
@change=${component._handleInputChange}
|
|
33
|
+
>
|
|
34
|
+
<div class="file-field__choose-button">
|
|
35
|
+
<nldd-button
|
|
36
|
+
variant="neutral-tinted"
|
|
37
|
+
size=${component.size}
|
|
38
|
+
text=${component._chooseLabel()}
|
|
39
|
+
accessible-label=${component._chooseAccessibleLabel() || nothing}
|
|
40
|
+
?disabled=${component.disabled}
|
|
41
|
+
@click=${component._handleChoose}
|
|
42
|
+
></nldd-button>
|
|
43
|
+
</div>
|
|
44
|
+
<span class=${classMap({ 'file-field__value': true, 'is-empty': !hasFiles })}>
|
|
45
|
+
${component._valueLabel()}
|
|
46
|
+
</span>
|
|
47
|
+
${hasFiles ? html `
|
|
48
|
+
<div class="file-field__clear-button">
|
|
49
|
+
<nldd-icon-button
|
|
50
|
+
variant="neutral-transparent"
|
|
51
|
+
size=${buttonSize}
|
|
52
|
+
icon="dismiss"
|
|
53
|
+
text=${component._t('components.file-field.clear-action')}
|
|
54
|
+
?disabled=${component.disabled}
|
|
55
|
+
@click=${component._handleClear}
|
|
56
|
+
></nldd-icon-button>
|
|
57
|
+
</div>
|
|
58
|
+
` : nothing}
|
|
59
|
+
${renderValidationIcon(component)}
|
|
60
|
+
</div>
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=file-field.template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-field.template.js","sourceRoot":"","sources":["../../../../src/components/inputs/file-field/file-field.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AACpD,OAAO,EA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,EAAE,CAAC,oCAAoC,CAAC;kBAC7C,SAAS,CAAC,QAAQ;eACrB,SAAS,CAAC,YAAY;;;IAGjC,CAAC,CAAC,CAAC,OAAO;KACT,oBAAoB,CAAC,SAAS,CAAC;;EAElC,CAAC;AACH,CAAC"}
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
* @element nldd-radio-button
|
|
15
15
|
* @attr {boolean} checked - Checked state
|
|
16
16
|
* @attr {boolean} disabled - Disabled state
|
|
17
|
+
* @attr {boolean} decorative - Renders the shape without the input: no focus, no
|
|
18
|
+
* name/value, nothing announced. For a control that owns the state elsewhere,
|
|
19
|
+
* such as a list row that is itself the radio; putting a real input in there
|
|
20
|
+
* would nest a control inside a control.
|
|
17
21
|
* @attr {boolean} required - Required state
|
|
18
22
|
* @attr {string} name - Radio group name for form submission; ties the buttons of one group together
|
|
19
23
|
* @attr {string} value - Value submitted with the form when this radio button is checked
|
|
@@ -29,6 +33,7 @@ export declare class NLDDRadioButton extends NLDDRadioButton_base {
|
|
|
29
33
|
static styles: import("lit").CSSResult;
|
|
30
34
|
private _initialChecked;
|
|
31
35
|
checked: boolean;
|
|
36
|
+
decorative: boolean;
|
|
32
37
|
disabled: boolean;
|
|
33
38
|
required: boolean;
|
|
34
39
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-button.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/radio-button/radio-button.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"radio-button.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/radio-button/radio-button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjC,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,6CAA6C,CAAC;;AAI7F,qBACa,eAAgB,SAAQ,oBAA0B;IAE9D,OAAgB,MAAM,0BAAqB;IAG3C,OAAO,CAAC,eAAe,CAAS;IAGhC,OAAO,UAAS;IAGhB,UAAU,UAAS;IAGnB,QAAQ,UAAS;IAGjB,QAAQ,UAAS;IAGjB,IAAI,SAAM;IAGV,KAAK,SAAM;IAGX,eAAe,SAAM;IAEZ,YAAY,IAAI,IAAI;IAKpB,SAAS,IAAI,SAAS;IAI/B,iBAAiB,IAAI,IAAI;IAKzB,wBAAwB,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,IAAI,GAAG,IAAI;IAI/D,MAAM,IAAI,IAAI;IAQd,aAAa,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI;IAW3B,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,mBAAmB,EAAE,eAAe,CAAC;KACrC;CACD"}
|
|
@@ -20,6 +20,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
20
20
|
* @element nldd-radio-button
|
|
21
21
|
* @attr {boolean} checked - Checked state
|
|
22
22
|
* @attr {boolean} disabled - Disabled state
|
|
23
|
+
* @attr {boolean} decorative - Renders the shape without the input: no focus, no
|
|
24
|
+
* name/value, nothing announced. For a control that owns the state elsewhere,
|
|
25
|
+
* such as a list row that is itself the radio; putting a real input in there
|
|
26
|
+
* would nest a control inside a control.
|
|
23
27
|
* @attr {boolean} required - Required state
|
|
24
28
|
* @attr {string} name - Radio group name for form submission; ties the buttons of one group together
|
|
25
29
|
* @attr {string} value - Value submitted with the form when this radio button is checked
|
|
@@ -38,6 +42,7 @@ let NLDDRadioButton = class NLDDRadioButton extends FormAssociated(LitElement) {
|
|
|
38
42
|
super(...arguments);
|
|
39
43
|
this._initialChecked = false;
|
|
40
44
|
this.checked = false;
|
|
45
|
+
this.decorative = false;
|
|
41
46
|
this.disabled = false;
|
|
42
47
|
this.required = false;
|
|
43
48
|
this.name = '';
|
|
@@ -83,6 +88,9 @@ NLDDRadioButton.styles = radioButtonStyles;
|
|
|
83
88
|
__decorate([
|
|
84
89
|
property({ type: Boolean, reflect: true })
|
|
85
90
|
], NLDDRadioButton.prototype, "checked", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
property({ type: Boolean, reflect: true })
|
|
93
|
+
], NLDDRadioButton.prototype, "decorative", void 0);
|
|
86
94
|
__decorate([
|
|
87
95
|
property({ type: Boolean, reflect: true })
|
|
88
96
|
], NLDDRadioButton.prototype, "disabled", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-button.js","sourceRoot":"","sources":["../../../../src/components/inputs/radio-button/radio-button.ts"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"radio-button.js","sourceRoot":"","sources":["../../../../src/components/inputs/radio-button/radio-button.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAkB,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAG1D,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,cAAc,CAAC,UAAU,CAAC;IAAxD;;QAKE,oBAAe,GAAG,KAAK,CAAC;QAGhC,YAAO,GAAG,KAAK,CAAC;QAGhB,eAAU,GAAG,KAAK,CAAC;QAGnB,aAAQ,GAAG,KAAK,CAAC;QAGjB,aAAQ,GAAG,KAAK,CAAC;QAGjB,SAAI,GAAG,EAAE,CAAC;QAGV,UAAK,GAAG,EAAE,CAAC;QAGX,oBAAe,GAAG,EAAE,CAAC;IA0CtB,CAAC;IAxCS,YAAY;QACpB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC;IACrC,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,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAC3B;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDACxB;AAGnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAChC;AAGV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAChB;AAGX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;wDACrC;AA1BT,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAoE3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-button.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/radio-button/radio-button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"radio-button.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/radio-button/radio-button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,yBAoH7B,CAAC"}
|
|
@@ -67,6 +67,17 @@ export const radioButtonStyles = css `
|
|
|
67
67
|
transform: translate(-50%, -50%) scale(1);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
/* Decorative has no input to hang :checked on, so the state comes from the
|
|
71
|
+
host attribute instead. */
|
|
72
|
+
:host([decorative][checked]) .radio-button__outer-shape {
|
|
73
|
+
border-color: var(--components-radio-button-is-selected-border-color);
|
|
74
|
+
background-color: var(--components-radio-button-is-selected-background-color);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host([decorative][checked]) .radio-button__inner-shape {
|
|
78
|
+
transform: translate(-50%, -50%) scale(1);
|
|
79
|
+
}
|
|
80
|
+
|
|
70
81
|
@media (hover: hover) {
|
|
71
82
|
.radio-button__input:hover:not(:disabled) ~ .radio-button__outer-shape {
|
|
72
83
|
border-color: var(--components-radio-button-is-hovered-border-color);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-button.styles.js","sourceRoot":"","sources":["../../../../src/components/inputs/radio-button/radio-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"radio-button.styles.js","sourceRoot":"","sources":["../../../../src/components/inputs/radio-button/radio-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoHnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-button.template.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/radio-button/radio-button.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAE,MAAM,KAAK,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,eAAe,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"radio-button.template.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/radio-button/radio-button.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAE,MAAM,KAAK,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,eAAe,GAAG,cAAc,CA4B9E"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { html, nothing } from 'lit';
|
|
2
2
|
export function radioButtonTemplate(component) {
|
|
3
|
+
// Decorative: the shape only. Something else owns the interaction and the
|
|
4
|
+
// state — a whole row that is itself the control, say — and an input here
|
|
5
|
+
// would be a second control inside it.
|
|
6
|
+
if (component.decorative) {
|
|
7
|
+
return html `
|
|
8
|
+
<div class="radio-button__outer-shape" aria-hidden="true">
|
|
9
|
+
<div class="radio-button__inner-shape"></div>
|
|
10
|
+
</div>
|
|
11
|
+
`;
|
|
12
|
+
}
|
|
3
13
|
return html `
|
|
4
14
|
<input class="radio-button__input"
|
|
5
15
|
type="radio"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-button.template.js","sourceRoot":"","sources":["../../../../src/components/inputs/radio-button/radio-button.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AAGpD,MAAM,UAAU,mBAAmB,CAAC,SAA0B;IAC7D,OAAO,IAAI,CAAA;;;cAGE,SAAS,CAAC,OAAO;eAChB,SAAS,CAAC,QAAQ;eAClB,SAAS,CAAC,QAAQ;UACvB,SAAS,CAAC,IAAI,IAAI,EAAE;WACnB,SAAS,CAAC,KAAK;gBACV,SAAS,CAAC,eAAe,IAAI,OAAO;aACvC,SAAS,CAAC,aAAa;;;;;;;EAOlC,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"radio-button.template.js","sourceRoot":"","sources":["../../../../src/components/inputs/radio-button/radio-button.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AAGpD,MAAM,UAAU,mBAAmB,CAAC,SAA0B;IAC7D,0EAA0E;IAC1E,0EAA0E;IAC1E,uCAAuC;IACvC,IAAI,SAAS,CAAC,UAAU,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAA;;;;GAIV,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;;;cAGE,SAAS,CAAC,OAAO;eAChB,SAAS,CAAC,QAAQ;eAClB,SAAS,CAAC,QAAQ;UACvB,SAAS,CAAC,IAAI,IAAI,EAAE;WACnB,SAAS,CAAC,KAAK;gBACV,SAAS,CAAC,eAAe,IAAI,OAAO;aACvC,SAAS,CAAC,aAAa;;;;;;;EAOlC,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-editor.caret.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/text-editor/text-editor.caret.ts"],"names":[],"mappings":"AAEA;;;;;;;aAOa;AACb,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"text-editor.caret.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/text-editor/text-editor.caret.ts"],"names":[],"mappings":"AAEA;;;;;;;aAOa;AACb,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAmBrF"}
|
|
@@ -13,11 +13,17 @@ export function textCaretBox(dom) {
|
|
|
13
13
|
return null;
|
|
14
14
|
const pos = view.posAtDOM(dom);
|
|
15
15
|
const line = view.state.doc.lineAt(pos);
|
|
16
|
+
// A widget that opens its line has no text before it to measure. Clamping to
|
|
17
|
+
// line.from would ask for the coords of the widget's own position, which sends
|
|
18
|
+
// CodeMirror right back into this coordsAt: the measure loop then never settles
|
|
19
|
+
// and spins a core for as long as the editor lives.
|
|
20
|
+
if (pos <= line.from)
|
|
21
|
+
return null;
|
|
16
22
|
// coordsAtPos reads layout; when a widget's coordsAt is itself invoked during an
|
|
17
23
|
// update/measure pass, CM forbids that reentrant read and throws. Fall back to the
|
|
18
24
|
// caller's own rect in that case rather than letting the exception escape.
|
|
19
25
|
try {
|
|
20
|
-
const coords = view.coordsAtPos(
|
|
26
|
+
const coords = view.coordsAtPos(pos - 1, 1);
|
|
21
27
|
return coords ? { top: coords.top, bottom: coords.bottom } : null;
|
|
22
28
|
}
|
|
23
29
|
catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-editor.caret.js","sourceRoot":"","sources":["../../../../src/components/inputs/text-editor/text-editor.caret.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;aAOa;AACb,MAAM,UAAU,YAAY,CAAC,GAAgB;IAC5C,MAAM,IAAI,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACxC,iFAAiF;IACjF,mFAAmF;IACnF,2EAA2E;IAC3E,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"text-editor.caret.js","sourceRoot":"","sources":["../../../../src/components/inputs/text-editor/text-editor.caret.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;aAOa;AACb,MAAM,UAAU,YAAY,CAAC,GAAgB;IAC5C,MAAM,IAAI,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACxC,6EAA6E;IAC7E,+EAA+E;IAC/E,gFAAgF;IAChF,oDAAoD;IACpD,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAClC,iFAAiF;IACjF,mFAAmF;IACnF,2EAA2E;IAC3E,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5C,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACnE,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,IAAI,CAAC;IACb,CAAC;AACF,CAAC"}
|