@melodicdev/components 2.0.3 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/assets/melodic-components.js +5681 -4145
- package/assets/melodic-components.js.map +1 -1
- package/assets/melodic-components.min.js +6573 -5141
- package/lib/components/data-display/activity-feed/activity-feed-item.component.d.ts +15 -14
- package/lib/components/data-display/activity-feed/activity-feed-item.component.d.ts.map +1 -1
- package/lib/components/data-display/activity-feed/activity-feed-item.component.js +36 -16
- package/lib/components/data-display/activity-feed/activity-feed-item.styles.d.ts.map +1 -1
- package/lib/components/data-display/activity-feed/activity-feed-item.styles.js +4 -0
- package/lib/components/data-display/activity-feed/activity-feed-item.template.d.ts.map +1 -1
- package/lib/components/data-display/activity-feed/activity-feed-item.template.js +15 -14
- package/lib/components/data-display/avatar/avatar.component.d.ts +9 -4
- package/lib/components/data-display/avatar/avatar.component.d.ts.map +1 -1
- package/lib/components/data-display/avatar/avatar.component.js +12 -3
- package/lib/components/data-display/avatar/avatar.template.js +1 -1
- package/lib/components/data-display/badge/badge.component.d.ts +2 -3
- package/lib/components/data-display/badge/badge.component.d.ts.map +1 -1
- package/lib/components/data-display/badge/badge.styles.d.ts.map +1 -1
- package/lib/components/data-display/badge/badge.styles.js +56 -35
- package/lib/components/data-display/badge/badge.types.d.ts +2 -0
- package/lib/components/data-display/badge/badge.types.d.ts.map +1 -1
- package/lib/components/data-display/calendar-view/calendar-view.utils.d.ts +10 -0
- package/lib/components/data-display/calendar-view/calendar-view.utils.d.ts.map +1 -1
- package/lib/components/data-display/calendar-view/calendar-view.utils.js +59 -27
- package/lib/components/data-display/data-grid/data-grid.component.d.ts +6 -5
- package/lib/components/data-display/data-grid/data-grid.component.d.ts.map +1 -1
- package/lib/components/data-display/data-grid/data-grid.component.js +49 -110
- package/lib/components/data-display/data-grid/data-grid.template.d.ts.map +1 -1
- package/lib/components/data-display/data-grid/data-grid.template.js +2 -6
- package/lib/components/data-display/list/list-item.component.d.ts +15 -6
- package/lib/components/data-display/list/list-item.component.d.ts.map +1 -1
- package/lib/components/data-display/list/list-item.component.js +57 -6
- package/lib/components/data-display/list/list-item.styles.d.ts.map +1 -1
- package/lib/components/data-display/list/list-item.styles.js +5 -0
- package/lib/components/data-display/list/list-item.template.d.ts.map +1 -1
- package/lib/components/data-display/list/list-item.template.js +18 -12
- package/lib/components/data-display/profile-card/profile-card.component.d.ts +2 -2
- package/lib/components/data-display/profile-card/profile-card.component.d.ts.map +1 -1
- package/lib/components/data-display/profile-card/profile-card.component.js +17 -15
- package/lib/components/data-display/profile-card/profile-card.template.js +1 -1
- package/lib/components/data-display/stat-card/stat-card.component.d.ts +6 -6
- package/lib/components/data-display/stat-card/stat-card.component.d.ts.map +1 -1
- package/lib/components/data-display/stat-card/stat-card.component.js +14 -6
- package/lib/components/data-display/stat-card/stat-card.template.js +4 -4
- package/lib/components/data-display/table/table.component.d.ts +7 -5
- package/lib/components/data-display/table/table.component.d.ts.map +1 -1
- package/lib/components/data-display/table/table.component.js +40 -117
- package/lib/components/data-display/table/table.template.d.ts.map +1 -1
- package/lib/components/data-display/table/table.template.js +1 -6
- package/lib/components/data-display/table-core/index.d.ts +3 -0
- package/lib/components/data-display/table-core/index.d.ts.map +1 -0
- package/lib/components/data-display/table-core/index.js +2 -0
- package/lib/components/data-display/table-core/table-core.d.ts +137 -0
- package/lib/components/data-display/table-core/table-core.d.ts.map +1 -0
- package/lib/components/data-display/table-core/table-core.js +225 -0
- package/lib/components/data-display/tag/tag.component.d.ts +14 -7
- package/lib/components/data-display/tag/tag.component.d.ts.map +1 -1
- package/lib/components/data-display/tag/tag.component.js +29 -5
- package/lib/components/data-display/tag/tag.template.js +2 -2
- package/lib/components/data-display/tag/tag.types.d.ts +8 -1
- package/lib/components/data-display/tag/tag.types.d.ts.map +1 -1
- package/lib/components/feedback/alert/alert.component.d.ts +6 -3
- package/lib/components/feedback/alert/alert.component.d.ts.map +1 -1
- package/lib/components/feedback/alert/alert.component.js +13 -4
- package/lib/components/feedback/alert/alert.template.js +1 -1
- package/lib/components/feedback/progress/progress.component.d.ts +4 -0
- package/lib/components/feedback/progress/progress.component.d.ts.map +1 -1
- package/lib/components/feedback/progress/progress.component.js +9 -0
- package/lib/components/feedback/progress/progress.template.d.ts.map +1 -1
- package/lib/components/feedback/progress/progress.template.js +19 -5
- package/lib/components/feedback/toast/toast.component.d.ts +6 -3
- package/lib/components/feedback/toast/toast.component.d.ts.map +1 -1
- package/lib/components/feedback/toast/toast.component.js +13 -4
- package/lib/components/feedback/toast/toast.service.d.ts.map +1 -1
- package/lib/components/feedback/toast/toast.service.js +2 -1
- package/lib/components/feedback/toast/toast.template.js +1 -1
- package/lib/components/forms/autocomplete/autocomplete.component.d.ts +12 -4
- package/lib/components/forms/autocomplete/autocomplete.component.d.ts.map +1 -1
- package/lib/components/forms/autocomplete/autocomplete.component.js +39 -30
- package/lib/components/forms/autocomplete/autocomplete.template.d.ts.map +1 -1
- package/lib/components/forms/autocomplete/autocomplete.template.js +14 -0
- package/lib/components/forms/button/button.component.d.ts +28 -3
- package/lib/components/forms/button/button.component.d.ts.map +1 -1
- package/lib/components/forms/button/button.component.js +81 -6
- package/lib/components/forms/button/button.template.js +1 -1
- package/lib/components/forms/button/button.types.d.ts +8 -1
- package/lib/components/forms/button/button.types.d.ts.map +1 -1
- package/lib/components/forms/button-group/button-group-item.component.d.ts +2 -2
- package/lib/components/forms/button-group/button-group-item.component.d.ts.map +1 -1
- package/lib/components/forms/button-group/button-group.component.d.ts +4 -2
- package/lib/components/forms/button-group/button-group.component.d.ts.map +1 -1
- package/lib/components/forms/button-group/button-group.component.js +3 -1
- package/lib/components/forms/button-group/button-group.styles.d.ts.map +1 -1
- package/lib/components/forms/button-group/button-group.styles.js +15 -1
- package/lib/components/forms/button-group/button-group.template.d.ts.map +1 -1
- package/lib/components/forms/button-group/button-group.template.js +4 -2
- package/lib/components/forms/checkbox/checkbox.component.d.ts +4 -2
- package/lib/components/forms/checkbox/checkbox.component.d.ts.map +1 -1
- package/lib/components/forms/checkbox/checkbox.component.js +3 -1
- package/lib/components/forms/checkbox/checkbox.styles.d.ts.map +1 -1
- package/lib/components/forms/checkbox/checkbox.styles.js +19 -0
- package/lib/components/forms/checkbox/checkbox.template.d.ts.map +1 -1
- package/lib/components/forms/checkbox/checkbox.template.js +4 -2
- package/lib/components/forms/date-picker/calendar.component.js +1 -1
- package/lib/components/forms/date-picker/date-picker.component.d.ts +11 -4
- package/lib/components/forms/date-picker/date-picker.component.d.ts.map +1 -1
- package/lib/components/forms/date-picker/date-picker.component.js +99 -32
- package/lib/components/forms/date-picker/date-picker.styles.d.ts.map +1 -1
- package/lib/components/forms/date-picker/date-picker.styles.js +0 -10
- package/lib/components/forms/date-picker/date-picker.template.d.ts.map +1 -1
- package/lib/components/forms/date-picker/date-picker.template.js +3 -4
- package/lib/components/forms/file-upload/file-upload-item.component.d.ts +7 -0
- package/lib/components/forms/file-upload/file-upload-item.component.d.ts.map +1 -1
- package/lib/components/forms/file-upload/file-upload-item.component.js +15 -0
- package/lib/components/forms/file-upload/file-upload.component.d.ts +15 -0
- package/lib/components/forms/file-upload/file-upload.component.d.ts.map +1 -1
- package/lib/components/forms/file-upload/file-upload.component.js +56 -0
- package/lib/components/forms/form-field/form-field.component.d.ts +12 -4
- package/lib/components/forms/form-field/form-field.component.d.ts.map +1 -1
- package/lib/components/forms/form-field/form-field.component.js +50 -31
- package/lib/components/forms/form-field/form-field.template.js +1 -1
- package/lib/components/forms/input/input.component.d.ts +2 -2
- package/lib/components/forms/input/input.component.d.ts.map +1 -1
- package/lib/components/forms/radio/radio-group.component.d.ts +6 -0
- package/lib/components/forms/radio/radio-group.component.d.ts.map +1 -1
- package/lib/components/forms/radio/radio-group.component.js +69 -2
- package/lib/components/forms/radio/radio-group.template.js +1 -1
- package/lib/components/forms/radio/radio.component.d.ts +7 -2
- package/lib/components/forms/radio/radio.component.d.ts.map +1 -1
- package/lib/components/forms/radio/radio.component.js +5 -0
- package/lib/components/forms/radio/radio.template.d.ts.map +1 -1
- package/lib/components/forms/radio/radio.template.js +1 -0
- package/lib/components/forms/select/select.component.d.ts +21 -6
- package/lib/components/forms/select/select.component.d.ts.map +1 -1
- package/lib/components/forms/select/select.component.js +94 -36
- package/lib/components/forms/select/select.template.d.ts.map +1 -1
- package/lib/components/forms/select/select.template.js +6 -2
- package/lib/components/forms/slider/slider.component.d.ts +2 -2
- package/lib/components/forms/slider/slider.component.d.ts.map +1 -1
- package/lib/components/forms/slider/slider.component.js +5 -1
- package/lib/components/forms/textarea/textarea.component.d.ts +2 -2
- package/lib/components/forms/textarea/textarea.component.d.ts.map +1 -1
- package/lib/components/forms/toggle/toggle.component.d.ts +4 -2
- package/lib/components/forms/toggle/toggle.component.d.ts.map +1 -1
- package/lib/components/forms/toggle/toggle.component.js +3 -1
- package/lib/components/forms/toggle/toggle.styles.d.ts.map +1 -1
- package/lib/components/forms/toggle/toggle.styles.js +19 -0
- package/lib/components/forms/toggle/toggle.template.d.ts.map +1 -1
- package/lib/components/forms/toggle/toggle.template.js +11 -3
- package/lib/components/foundation/card/card.component.d.ts +7 -6
- package/lib/components/foundation/card/card.component.d.ts.map +1 -1
- package/lib/components/foundation/card/card.component.js +18 -7
- package/lib/components/foundation/card/card.styles.d.ts.map +1 -1
- package/lib/components/foundation/card/card.styles.js +5 -0
- package/lib/components/foundation/card/card.template.d.ts.map +1 -1
- package/lib/components/foundation/card/card.template.js +16 -11
- package/lib/components/foundation/divider/divider.component.d.ts +5 -4
- package/lib/components/foundation/divider/divider.component.d.ts.map +1 -1
- package/lib/components/foundation/divider/divider.component.js +11 -3
- package/lib/components/foundation/divider/divider.styles.d.ts.map +1 -1
- package/lib/components/foundation/divider/divider.styles.js +6 -0
- package/lib/components/foundation/divider/divider.template.d.ts +5 -0
- package/lib/components/foundation/divider/divider.template.d.ts.map +1 -1
- package/lib/components/foundation/divider/divider.template.js +9 -6
- package/lib/components/general/icon/icon.template.d.ts.map +1 -1
- package/lib/components/general/icon/icon.template.js +3 -1
- package/lib/components/navigation/pagination/pagination.component.d.ts +5 -0
- package/lib/components/navigation/pagination/pagination.component.d.ts.map +1 -1
- package/lib/components/navigation/pagination/pagination.component.js +22 -10
- package/lib/components/navigation/pagination/pagination.styles.d.ts.map +1 -1
- package/lib/components/navigation/pagination/pagination.styles.js +6 -4
- package/lib/components/navigation/sidebar/sidebar-item.component.d.ts +4 -4
- package/lib/components/navigation/sidebar/sidebar-item.component.d.ts.map +1 -1
- package/lib/components/navigation/sidebar/sidebar-item.component.js +11 -4
- package/lib/components/navigation/sidebar/sidebar-item.template.js +2 -2
- package/lib/components/navigation/sidebar/sidebar.component.d.ts +7 -0
- package/lib/components/navigation/sidebar/sidebar.component.d.ts.map +1 -1
- package/lib/components/navigation/sidebar/sidebar.component.js +48 -5
- package/lib/components/navigation/steps/step-panel.component.d.ts +7 -0
- package/lib/components/navigation/steps/step-panel.component.d.ts.map +1 -1
- package/lib/components/navigation/steps/step-panel.component.js +7 -0
- package/lib/components/navigation/steps/step-panel.template.d.ts +1 -1
- package/lib/components/navigation/steps/step-panel.template.d.ts.map +1 -1
- package/lib/components/navigation/steps/step-panel.template.js +2 -2
- package/lib/components/navigation/steps/step.component.d.ts +2 -2
- package/lib/components/navigation/steps/step.component.d.ts.map +1 -1
- package/lib/components/navigation/steps/step.component.js +8 -2
- package/lib/components/navigation/steps/step.template.js +1 -1
- package/lib/components/navigation/steps/steps.component.d.ts +3 -1
- package/lib/components/navigation/steps/steps.component.d.ts.map +1 -1
- package/lib/components/navigation/steps/steps.component.js +47 -14
- package/lib/components/navigation/steps/steps.template.d.ts.map +1 -1
- package/lib/components/navigation/steps/steps.template.js +5 -1
- package/lib/components/navigation/tabs/tab-panel.component.d.ts +7 -0
- package/lib/components/navigation/tabs/tab-panel.component.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tab-panel.component.js +7 -0
- package/lib/components/navigation/tabs/tab-panel.template.d.ts +1 -1
- package/lib/components/navigation/tabs/tab-panel.template.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tab-panel.template.js +2 -2
- package/lib/components/navigation/tabs/tabs.component.d.ts +5 -3
- package/lib/components/navigation/tabs/tabs.component.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tabs.component.js +49 -14
- package/lib/components/navigation/tabs/tabs.template.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tabs.template.js +6 -1
- package/lib/components/overlays/dialog/dialog-ref.class.d.ts +17 -2
- package/lib/components/overlays/dialog/dialog-ref.class.d.ts.map +1 -1
- package/lib/components/overlays/dialog/dialog-ref.class.js +52 -6
- package/lib/components/overlays/dialog/dialog.component.d.ts.map +1 -1
- package/lib/components/overlays/dialog/dialog.component.js +5 -1
- package/lib/components/overlays/dialog/dialog.service.d.ts +2 -2
- package/lib/components/overlays/dialog/dialog.service.d.ts.map +1 -1
- package/lib/components/overlays/dialog/dialog.service.js +46 -18
- package/lib/components/overlays/drawer/drawer.component.d.ts +9 -2
- package/lib/components/overlays/drawer/drawer.component.d.ts.map +1 -1
- package/lib/components/overlays/drawer/drawer.component.js +34 -4
- package/lib/components/overlays/drawer/drawer.styles.d.ts.map +1 -1
- package/lib/components/overlays/drawer/drawer.styles.js +4 -0
- package/lib/components/overlays/dropdown/dropdown-item.component.d.ts +5 -2
- package/lib/components/overlays/dropdown/dropdown-item.component.d.ts.map +1 -1
- package/lib/components/overlays/dropdown/dropdown-item.component.js +18 -0
- package/lib/components/overlays/dropdown/dropdown-item.template.d.ts.map +1 -1
- package/lib/components/overlays/dropdown/dropdown-item.template.js +0 -3
- package/lib/components/overlays/dropdown/dropdown.component.d.ts +8 -4
- package/lib/components/overlays/dropdown/dropdown.component.d.ts.map +1 -1
- package/lib/components/overlays/dropdown/dropdown.component.js +61 -60
- package/lib/components/overlays/popover/popover.component.d.ts +6 -4
- package/lib/components/overlays/popover/popover.component.d.ts.map +1 -1
- package/lib/components/overlays/popover/popover.component.js +37 -51
- package/lib/components/overlays/tooltip/tooltip.component.d.ts +29 -4
- package/lib/components/overlays/tooltip/tooltip.component.d.ts.map +1 -1
- package/lib/components/overlays/tooltip/tooltip.component.js +73 -31
- package/lib/components/overlays/tooltip/tooltip.styles.d.ts.map +1 -1
- package/lib/components/overlays/tooltip/tooltip.styles.js +22 -10
- package/lib/components/overlays/tooltip/tooltip.template.d.ts.map +1 -1
- package/lib/components/overlays/tooltip/tooltip.template.js +3 -2
- package/lib/components/pages/auth/login-page.component.d.ts +11 -4
- package/lib/components/pages/auth/login-page.component.d.ts.map +1 -1
- package/lib/components/pages/auth/login-page.component.js +18 -5
- package/lib/components/pages/auth/login-page.template.d.ts.map +1 -1
- package/lib/components/pages/auth/login-page.template.js +9 -10
- package/lib/components/pages/auth/signup-page.component.d.ts +11 -4
- package/lib/components/pages/auth/signup-page.component.d.ts.map +1 -1
- package/lib/components/pages/auth/signup-page.component.js +18 -5
- package/lib/components/pages/auth/signup-page.template.d.ts.map +1 -1
- package/lib/components/pages/auth/signup-page.template.js +9 -10
- package/lib/components/pages/dashboard/dashboard-page.component.d.ts +18 -11
- package/lib/components/pages/dashboard/dashboard-page.component.d.ts.map +1 -1
- package/lib/components/pages/dashboard/dashboard-page.component.js +55 -13
- package/lib/components/pages/dashboard/dashboard-page.template.js +1 -1
- package/lib/components/sections/app-shell/app-shell.component.d.ts +6 -6
- package/lib/components/sections/app-shell/app-shell.component.d.ts.map +1 -1
- package/lib/components/sections/app-shell/app-shell.component.js +14 -6
- package/lib/components/sections/app-shell/app-shell.template.js +3 -3
- package/lib/components/sections/hero/hero-section.component.d.ts +6 -3
- package/lib/components/sections/hero/hero-section.component.d.ts.map +1 -1
- package/lib/components/sections/hero/hero-section.component.js +13 -4
- package/lib/components/sections/hero/hero-section.template.js +2 -2
- package/lib/components/sections/page-header/page-header.component.d.ts +16 -17
- package/lib/components/sections/page-header/page-header.component.d.ts.map +1 -1
- package/lib/components/sections/page-header/page-header.component.js +36 -25
- package/lib/components/sections/page-header/page-header.styles.d.ts.map +1 -1
- package/lib/components/sections/page-header/page-header.styles.js +9 -0
- package/lib/components/sections/page-header/page-header.template.d.ts +5 -0
- package/lib/components/sections/page-header/page-header.template.d.ts.map +1 -1
- package/lib/components/sections/page-header/page-header.template.js +42 -31
- package/lib/components/sections/page-section/page-section.component.d.ts +16 -12
- package/lib/components/sections/page-section/page-section.component.d.ts.map +1 -1
- package/lib/components/sections/page-section/page-section.component.js +34 -12
- package/lib/components/sections/page-section/page-section.styles.d.ts.map +1 -1
- package/lib/components/sections/page-section/page-section.styles.js +6 -0
- package/lib/components/sections/page-section/page-section.template.d.ts +6 -0
- package/lib/components/sections/page-section/page-section.template.d.ts.map +1 -1
- package/lib/components/sections/page-section/page-section.template.js +26 -15
- package/lib/components/sections/page-section/sanitize-href.function.d.ts +12 -0
- package/lib/components/sections/page-section/sanitize-href.function.d.ts.map +1 -0
- package/lib/components/sections/page-section/sanitize-href.function.js +15 -0
- package/lib/directives/tooltip.directive.d.ts +8 -2
- package/lib/directives/tooltip.directive.d.ts.map +1 -1
- package/lib/directives/tooltip.directive.js +103 -9
- package/lib/functions/deprecation.functions.d.ts +21 -0
- package/lib/functions/deprecation.functions.d.ts.map +1 -0
- package/lib/functions/deprecation.functions.js +44 -0
- package/lib/functions/index.d.ts +2 -0
- package/lib/functions/index.d.ts.map +1 -1
- package/lib/functions/index.js +2 -0
- package/lib/functions/watch-slot-presence.function.d.ts +17 -0
- package/lib/functions/watch-slot-presence.function.d.ts.map +1 -0
- package/lib/functions/watch-slot-presence.function.js +27 -0
- package/lib/theme/functions/create-theme.function.d.ts +15 -1
- package/lib/theme/functions/create-theme.function.d.ts.map +1 -1
- package/lib/theme/functions/create-theme.function.js +57 -11
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.d.ts.map +1 -1
- package/lib/types/index.d.ts +8 -2
- package/lib/types/index.d.ts.map +1 -1
- package/lib/utils/accessibility/focus-trap.d.ts +19 -1
- package/lib/utils/accessibility/focus-trap.d.ts.map +1 -1
- package/lib/utils/accessibility/focus-trap.js +77 -8
- package/lib/utils/accessibility/index.d.ts +2 -1
- package/lib/utils/accessibility/index.d.ts.map +1 -1
- package/lib/utils/accessibility/index.js +1 -1
- package/lib/utils/accessibility/live-region.d.ts +10 -3
- package/lib/utils/accessibility/live-region.d.ts.map +1 -1
- package/lib/utils/accessibility/live-region.js +64 -35
- package/lib/utils/directives/click-outside.directive.d.ts.map +1 -1
- package/lib/utils/directives/click-outside.directive.js +5 -3
- package/lib/utils/overlay/index.d.ts +4 -0
- package/lib/utils/overlay/index.d.ts.map +1 -0
- package/lib/utils/overlay/index.js +2 -0
- package/lib/utils/overlay/overlay-positioner.d.ts +54 -0
- package/lib/utils/overlay/overlay-positioner.d.ts.map +1 -0
- package/lib/utils/overlay/overlay-positioner.js +85 -0
- package/lib/utils/overlay/toggle-dismiss-guard.d.ts +24 -0
- package/lib/utils/overlay/toggle-dismiss-guard.d.ts.map +1 -0
- package/lib/utils/overlay/toggle-dismiss-guard.js +36 -0
- package/lib/utils/positioning/auto-update.d.ts.map +1 -1
- package/lib/utils/positioning/auto-update.js +3 -0
- package/lib/utils/positioning/compute-position.d.ts.map +1 -1
- package/lib/utils/positioning/compute-position.js +8 -4
- package/lib/utils/positioning/middlewares/flip.middleware.d.ts.map +1 -1
- package/lib/utils/positioning/middlewares/flip.middleware.js +10 -3
- package/lib/utils/positioning/middlewares/offset.middleware.d.ts +15 -0
- package/lib/utils/positioning/middlewares/offset.middleware.d.ts.map +1 -1
- package/lib/utils/positioning/middlewares/offset.middleware.js +31 -1
- package/lib/utils/positioning/middlewares/shift.middleware.d.ts +13 -3
- package/lib/utils/positioning/middlewares/shift.middleware.d.ts.map +1 -1
- package/lib/utils/positioning/middlewares/shift.middleware.js +15 -7
- package/package.json +6 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IElementRef, OnCreate, OnDestroy } from '@melodicdev/core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ControlSize } from '../../../types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* ml-button-group - A group of connected toggle buttons
|
|
5
5
|
*
|
|
@@ -29,13 +29,15 @@ export declare class ButtonGroupComponent implements IElementRef, OnCreate, OnDe
|
|
|
29
29
|
/** Active state style: 'outline' (gray) or 'solid' (primary color) */
|
|
30
30
|
variant: 'outline' | 'solid';
|
|
31
31
|
/** Size variant */
|
|
32
|
-
size:
|
|
32
|
+
size: ControlSize;
|
|
33
33
|
/** Disable the entire group */
|
|
34
34
|
disabled: boolean;
|
|
35
35
|
/** Allow multiple selections */
|
|
36
36
|
multiple: boolean;
|
|
37
37
|
/** Selected values (multiple mode) */
|
|
38
38
|
values: string[];
|
|
39
|
+
/** Error message (shows error state when set; auto-populated by the forms system) */
|
|
40
|
+
error: string;
|
|
39
41
|
onCreate(): void;
|
|
40
42
|
onDestroy(): void;
|
|
41
43
|
/** Handle slot changes to sync initial state */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/button-group/button-group.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"button-group.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/button-group/button-group.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAmB3D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAMa,oBAAqB,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS;IACrE,UAAU,EAAG,WAAW,CAAC;IAEhC,uDAAuD;IAChD,KAAK,SAAM;IAElB,sEAAsE;IAC/D,OAAO,EAAE,SAAS,GAAG,OAAO,CAAa;IAEhD,mBAAmB;IACZ,IAAI,EAAE,WAAW,CAAQ;IAEhC,+BAA+B;IACxB,QAAQ,UAAS;IAExB,gCAAgC;IACzB,QAAQ,UAAS;IAExB,sCAAsC;IAC/B,MAAM,EAAE,MAAM,EAAE,CAAM;IAE7B,qFAAqF;IAC9E,KAAK,SAAM;IAEX,QAAQ,IAAI,IAAI;IAKhB,SAAS,IAAI,IAAI;IAIxB,gDAAgD;IACzC,gBAAgB,QAAO,IAAI,CAEhC;IAEF,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CA8B/B;IAEF,OAAO,CAAC,SAAS;CAYjB"}
|
|
@@ -60,6 +60,8 @@ let ButtonGroupComponent = class ButtonGroupComponent {
|
|
|
60
60
|
this.multiple = false;
|
|
61
61
|
/** Selected values (multiple mode) */
|
|
62
62
|
this.values = [];
|
|
63
|
+
/** Error message (shows error state when set; auto-populated by the forms system) */
|
|
64
|
+
this.error = '';
|
|
63
65
|
/** Handle slot changes to sync initial state */
|
|
64
66
|
this.handleSlotChange = () => {
|
|
65
67
|
this.syncItems();
|
|
@@ -117,7 +119,7 @@ ButtonGroupComponent = __decorate([
|
|
|
117
119
|
selector: 'ml-button-group',
|
|
118
120
|
template: buttonGroupTemplate,
|
|
119
121
|
styles: buttonGroupStyles,
|
|
120
|
-
attributes: ['value', 'variant', 'size', 'disabled', 'multiple']
|
|
122
|
+
attributes: ['value', 'variant', 'size', 'disabled', 'multiple', 'error']
|
|
121
123
|
})
|
|
122
124
|
], ButtonGroupComponent);
|
|
123
125
|
export { ButtonGroupComponent };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/button-group/button-group.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"button-group.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/button-group/button-group.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,iDA0C7B,CAAC"}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { css } from '@melodicdev/core';
|
|
2
2
|
export const buttonGroupStyles = () => css `
|
|
3
3
|
:host {
|
|
4
|
-
display: inline-
|
|
4
|
+
display: inline-block;
|
|
5
5
|
|
|
6
6
|
/* --- Disabled --- */
|
|
7
7
|
--ml-button-group-disabled-opacity: 0.5;
|
|
8
8
|
|
|
9
9
|
/* --- Spacing --- */
|
|
10
10
|
--ml-button-group-item-offset: -1px;
|
|
11
|
+
|
|
12
|
+
/* --- Error --- */
|
|
13
|
+
--ml-button-group-error-font-size: var(--ml-text-sm);
|
|
14
|
+
--ml-button-group-error-color: var(--ml-color-danger);
|
|
15
|
+
--ml-button-group-error-margin-top: var(--ml-space-1);
|
|
16
|
+
--ml-button-group-error-line-height: var(--ml-leading-tight);
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
.ml-button-group {
|
|
@@ -20,6 +26,14 @@ export const buttonGroupStyles = () => css `
|
|
|
20
26
|
pointer-events: none;
|
|
21
27
|
}
|
|
22
28
|
|
|
29
|
+
.ml-button-group__error {
|
|
30
|
+
display: block;
|
|
31
|
+
margin-top: var(--ml-button-group-error-margin-top);
|
|
32
|
+
font-size: var(--ml-button-group-error-font-size);
|
|
33
|
+
color: var(--ml-button-group-error-color);
|
|
34
|
+
line-height: var(--ml-button-group-error-line-height);
|
|
35
|
+
}
|
|
36
|
+
|
|
23
37
|
::slotted(ml-button-group-item) {
|
|
24
38
|
margin-left: var(--ml-button-group-item-offset);
|
|
25
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.template.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/button-group/button-group.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAExE,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"button-group.template.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/button-group/button-group.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAExE,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,oBAAoB,6CAc1D"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { html, classMap } from '@melodicdev/core';
|
|
1
|
+
import { html, classMap, when } from '@melodicdev/core';
|
|
2
2
|
export function buttonGroupTemplate(c) {
|
|
3
3
|
return html `
|
|
4
4
|
<div
|
|
5
5
|
class=${classMap({
|
|
6
6
|
'ml-button-group': true,
|
|
7
|
-
'ml-button-group--disabled': c.disabled
|
|
7
|
+
'ml-button-group--disabled': c.disabled,
|
|
8
|
+
'ml-button-group--error': !!c.error
|
|
8
9
|
})}
|
|
9
10
|
role="group"
|
|
10
11
|
>
|
|
11
12
|
<slot @slotchange=${c.handleSlotChange}></slot>
|
|
12
13
|
</div>
|
|
14
|
+
${when(!!c.error, () => html `<span class="ml-button-group__error">${c.error}</span>`)}
|
|
13
15
|
`;
|
|
14
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IElementRef } from '@melodicdev/core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ControlSize } from '../../../types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* ml-checkbox - Checkbox input component
|
|
5
5
|
*
|
|
@@ -18,8 +18,10 @@ export declare class CheckboxComponent implements IElementRef {
|
|
|
18
18
|
label: string;
|
|
19
19
|
/** Hint text below the checkbox */
|
|
20
20
|
hint: string;
|
|
21
|
+
/** Error message (shows error state when set; auto-populated by the forms system) */
|
|
22
|
+
error: string;
|
|
21
23
|
/** Checkbox size */
|
|
22
|
-
size:
|
|
24
|
+
size: ControlSize;
|
|
23
25
|
/** Checked state */
|
|
24
26
|
checked: boolean;
|
|
25
27
|
/** Indeterminate state */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/checkbox/checkbox.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"checkbox.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/checkbox/checkbox.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAY3D;;;;;;;;;;;GAWG;AACH,qBAMa,iBAAkB,YAAW,WAAW;IAC7C,UAAU,EAAG,WAAW,CAAC;IAEhC,qBAAqB;IACd,KAAK,SAAM;IAElB,mCAAmC;IAC5B,IAAI,SAAM;IAEjB,qFAAqF;IAC9E,KAAK,SAAM;IAElB,oBAAoB;IACb,IAAI,EAAE,WAAW,CAAQ;IAEhC,oBAAoB;IACb,OAAO,UAAS;IAEvB,0BAA0B;IACnB,aAAa,UAAS;IAE7B,qBAAqB;IACd,QAAQ,UAAS;IAEjB,YAAY,GAAI,OAAO,KAAK,KAAG,IAAI,CAiBxC;CACF"}
|
|
@@ -33,6 +33,8 @@ let CheckboxComponent = class CheckboxComponent {
|
|
|
33
33
|
this.label = '';
|
|
34
34
|
/** Hint text below the checkbox */
|
|
35
35
|
this.hint = '';
|
|
36
|
+
/** Error message (shows error state when set; auto-populated by the forms system) */
|
|
37
|
+
this.error = '';
|
|
36
38
|
/** Checkbox size */
|
|
37
39
|
this.size = 'md';
|
|
38
40
|
/** Checked state */
|
|
@@ -62,7 +64,7 @@ CheckboxComponent = __decorate([
|
|
|
62
64
|
selector: 'ml-checkbox',
|
|
63
65
|
template: checkboxTemplate,
|
|
64
66
|
styles: checkboxStyles,
|
|
65
|
-
attributes: ['label', 'hint', 'size', 'checked', 'indeterminate', 'disabled']
|
|
67
|
+
attributes: ['label', 'hint', 'error', 'size', 'checked', 'indeterminate', 'disabled']
|
|
66
68
|
})
|
|
67
69
|
], CheckboxComponent);
|
|
68
70
|
export { CheckboxComponent };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/checkbox/checkbox.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"checkbox.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/checkbox/checkbox.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,iDAuK1B,CAAC"}
|
|
@@ -34,6 +34,12 @@ export const checkboxStyles = () => css `
|
|
|
34
34
|
--ml-checkbox-hint-font-size: var(--ml-text-sm);
|
|
35
35
|
--ml-checkbox-hint-color: var(--ml-color-text-muted);
|
|
36
36
|
|
|
37
|
+
/* --- Error --- */
|
|
38
|
+
--ml-checkbox-error-border-color: var(--ml-color-danger);
|
|
39
|
+
--ml-checkbox-error-color: var(--ml-color-danger);
|
|
40
|
+
--ml-checkbox-error-margin-top: var(--ml-space-0-5);
|
|
41
|
+
--ml-checkbox-error-line-height: var(--ml-leading-tight);
|
|
42
|
+
|
|
37
43
|
/* --- Gap --- */
|
|
38
44
|
--ml-checkbox-gap: var(--ml-space-3);
|
|
39
45
|
|
|
@@ -111,6 +117,19 @@ export const checkboxStyles = () => css `
|
|
|
111
117
|
line-height: var(--ml-leading-tight);
|
|
112
118
|
}
|
|
113
119
|
|
|
120
|
+
.ml-checkbox__error {
|
|
121
|
+
display: block;
|
|
122
|
+
margin-top: var(--ml-checkbox-error-margin-top);
|
|
123
|
+
margin-left: calc(var(--ml-checkbox-box-size) + var(--ml-checkbox-gap));
|
|
124
|
+
font-size: var(--ml-checkbox-hint-font-size);
|
|
125
|
+
color: var(--ml-checkbox-error-color);
|
|
126
|
+
line-height: var(--ml-checkbox-error-line-height);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.ml-checkbox--error .ml-checkbox__box {
|
|
130
|
+
border-color: var(--ml-checkbox-error-border-color);
|
|
131
|
+
}
|
|
132
|
+
|
|
114
133
|
.ml-checkbox--disabled {
|
|
115
134
|
cursor: not-allowed;
|
|
116
135
|
pointer-events: none;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.template.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/checkbox/checkbox.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"checkbox.template.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/checkbox/checkbox.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,iBAAiB,6CA+CpD"}
|
|
@@ -7,7 +7,8 @@ export function checkboxTemplate(c) {
|
|
|
7
7
|
[`ml-checkbox--${c.size}`]: true,
|
|
8
8
|
'ml-checkbox--checked': c.checked,
|
|
9
9
|
'ml-checkbox--indeterminate': c.indeterminate,
|
|
10
|
-
'ml-checkbox--disabled': c.disabled
|
|
10
|
+
'ml-checkbox--disabled': c.disabled,
|
|
11
|
+
'ml-checkbox--error': !!c.error
|
|
11
12
|
})}
|
|
12
13
|
>
|
|
13
14
|
<input
|
|
@@ -16,6 +17,7 @@ export function checkboxTemplate(c) {
|
|
|
16
17
|
.checked=${c.checked}
|
|
17
18
|
.indeterminate=${c.indeterminate}
|
|
18
19
|
?disabled=${c.disabled}
|
|
20
|
+
aria-invalid=${c.error ? 'true' : undefined}
|
|
19
21
|
@change=${c.handleChange}
|
|
20
22
|
/>
|
|
21
23
|
<span class="ml-checkbox__box">
|
|
@@ -32,6 +34,6 @@ export function checkboxTemplate(c) {
|
|
|
32
34
|
</span>
|
|
33
35
|
${when(!!c.label, () => html `<span class="ml-checkbox__label">${c.label}</span>`)}
|
|
34
36
|
</label>
|
|
35
|
-
${when(!!c.hint, () => html `<span class="ml-checkbox__hint">${c.hint}</span>`)}
|
|
37
|
+
${when(!!c.error, () => html `<span class="ml-checkbox__error">${c.error}</span>`, () => html `${when(!!c.hint, () => html `<span class="ml-checkbox__hint">${c.hint}</span>`)}`)}
|
|
36
38
|
`;
|
|
37
39
|
}
|
|
@@ -357,7 +357,7 @@ let CalendarComponent = class CalendarComponent {
|
|
|
357
357
|
isSelected: selectedYear === year,
|
|
358
358
|
isCurrent: year === now,
|
|
359
359
|
isDisabled: !inRange,
|
|
360
|
-
isPlaceholder: !inRange
|
|
360
|
+
isPlaceholder: !inRange
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
363
|
return result;
|
|
@@ -2,7 +2,10 @@ import type { IElementRef, OnCreate, OnDestroy } from '@melodicdev/core';
|
|
|
2
2
|
/**
|
|
3
3
|
* ml-date-picker - Date input with calendar dropdown
|
|
4
4
|
*
|
|
5
|
-
* Users can type a date directly into the input or
|
|
5
|
+
* Users can type a date directly into the input (`MM/DD/YYYY` or `YYYY-MM-DD`)
|
|
6
|
+
* or pick from the custom calendar popover. The input is a plain text field so
|
|
7
|
+
* the native browser date picker never competes with the custom calendar.
|
|
8
|
+
* `value` is always the ISO date (`YYYY-MM-DD`).
|
|
6
9
|
*
|
|
7
10
|
* @example
|
|
8
11
|
* ```html
|
|
@@ -40,12 +43,17 @@ export declare class DatePickerComponent implements IElementRef, OnCreate, OnDes
|
|
|
40
43
|
maxYear: number | string;
|
|
41
44
|
/** Whether the calendar popover is open */
|
|
42
45
|
isOpen: boolean;
|
|
43
|
-
private
|
|
46
|
+
private readonly _positioner;
|
|
47
|
+
private _restoreFocusOnClose;
|
|
48
|
+
/** The formatted text shown in the input (MM/DD/YYYY) */
|
|
49
|
+
get displayValue(): string;
|
|
44
50
|
onCreate(): void;
|
|
45
51
|
onDestroy(): void;
|
|
46
52
|
toggleCalendar: () => void;
|
|
47
|
-
/** Called when the user types a date into the input */
|
|
53
|
+
/** Called when the user types a date into the input (on change/blur) */
|
|
48
54
|
handleInput: (event: Event) => void;
|
|
55
|
+
/** ISO dates (YYYY-MM-DD) compare correctly as strings. */
|
|
56
|
+
private isWithinRange;
|
|
49
57
|
/** Clicking the input opens the calendar */
|
|
50
58
|
handleInputClick: () => void;
|
|
51
59
|
/** Called when a day is clicked in the calendar - selects immediately and closes */
|
|
@@ -55,7 +63,6 @@ export declare class DatePickerComponent implements IElementRef, OnCreate, OnDes
|
|
|
55
63
|
private readonly _handleToggle;
|
|
56
64
|
private closePopover;
|
|
57
65
|
private startPositioning;
|
|
58
|
-
private updatePosition;
|
|
59
66
|
private returnFocus;
|
|
60
67
|
private getInputEl;
|
|
61
68
|
private getTriggerEl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/date-picker.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"date-picker.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/date-picker.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAoDzE;;;;;;;;;;;;;;;GAeG;AACH,qBAMa,mBAAoB,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS;IACpE,UAAU,EAAG,WAAW,CAAC;IAEhC,+CAA+C;IACxC,KAAK,SAAM;IAElB,uBAAuB;IAChB,WAAW,SAAiB;IAEnC,kBAAkB;IACX,KAAK,SAAM;IAElB,gBAAgB;IACT,IAAI,SAAM;IAEjB,oBAAoB;IACb,KAAK,SAAM;IAElB,iBAAiB;IACV,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAEvC,qBAAqB;IACd,QAAQ,UAAS;IAExB,qBAAqB;IACd,QAAQ,UAAS;IAExB,2CAA2C;IACpC,GAAG,SAAM;IAEhB,2CAA2C;IACpC,GAAG,SAAM;IAEhB,iFAAiF;IAC1E,OAAO,EAAE,MAAM,GAAG,MAAM,CAAM;IAErC,8EAA8E;IACvE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAM;IAErC,2CAA2C;IACpC,MAAM,UAAS;IAEtB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAGxB;IACJ,OAAO,CAAC,oBAAoB,CAAS;IAErC,yDAAyD;IACzD,IAAW,YAAY,IAAI,MAAM,CAEhC;IAEM,QAAQ,IAAI,IAAI;IAOhB,SAAS,IAAI,IAAI;IAQjB,cAAc,QAAO,IAAI,CAM9B;IAEF,wEAAwE;IACjE,WAAW,GAAI,OAAO,KAAK,KAAG,IAAI,CAuBvC;IAEF,2DAA2D;IAC3D,OAAO,CAAC,aAAa;IAMrB,4CAA4C;IACrC,gBAAgB,QAAO,IAAI,CAIhC;IAEF,oFAAoF;IAC7E,gBAAgB,GAAI,OAAO,KAAK,KAAG,IAAI,CAM5C;IAEK,aAAa,GAAI,OAAO,aAAa,KAAG,IAAI,CAYjD;IAEF,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAkB5B;IAEF,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,YAAY;CAGpB"}
|
|
@@ -6,7 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { MelodicComponent } from '@melodicdev/core';
|
|
8
8
|
import { registerAdapter } from '@melodicdev/core/forms';
|
|
9
|
-
import {
|
|
9
|
+
import { OverlayPositioner } from '../../../utils/overlay/index.js';
|
|
10
|
+
import { isDeepFocusWithin } from '../../../utils/accessibility/focus-trap.js';
|
|
10
11
|
import { datePickerTemplate } from './date-picker.template.js';
|
|
11
12
|
import { datePickerStyles } from './date-picker.styles.js';
|
|
12
13
|
registerAdapter((el) => el.tagName === 'ML-DATE-PICKER', {
|
|
@@ -16,10 +17,50 @@ registerAdapter((el) => el.tagName === 'ML-DATE-PICKER', {
|
|
|
16
17
|
setValue: (el, value) => { el.value = value !== null && value !== undefined ? String(value) : ''; },
|
|
17
18
|
setDisabled: (el, disabled) => { el.disabled = disabled; }
|
|
18
19
|
});
|
|
20
|
+
/** Format an ISO date (YYYY-MM-DD) for display as MM/DD/YYYY. */
|
|
21
|
+
function formatDisplayDate(iso) {
|
|
22
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(iso ?? '');
|
|
23
|
+
if (!match)
|
|
24
|
+
return iso ?? '';
|
|
25
|
+
return `${match[2]}/${match[3]}/${match[1]}`;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Parse typed text into an ISO date (YYYY-MM-DD).
|
|
29
|
+
* Accepts `YYYY-MM-DD`, `MM/DD/YYYY`, and `M/D/YYYY`. Returns null when invalid.
|
|
30
|
+
*/
|
|
31
|
+
function parseDateInput(text) {
|
|
32
|
+
const trimmed = text.trim();
|
|
33
|
+
let year;
|
|
34
|
+
let month;
|
|
35
|
+
let day;
|
|
36
|
+
let match = /^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(trimmed);
|
|
37
|
+
if (match) {
|
|
38
|
+
year = Number(match[1]);
|
|
39
|
+
month = Number(match[2]);
|
|
40
|
+
day = Number(match[3]);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
match = /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.exec(trimmed);
|
|
44
|
+
if (!match)
|
|
45
|
+
return null;
|
|
46
|
+
month = Number(match[1]);
|
|
47
|
+
day = Number(match[2]);
|
|
48
|
+
year = Number(match[3]);
|
|
49
|
+
}
|
|
50
|
+
if (month < 1 || month > 12)
|
|
51
|
+
return null;
|
|
52
|
+
const daysInMonth = new Date(year, month, 0).getDate();
|
|
53
|
+
if (day < 1 || day > daysInMonth)
|
|
54
|
+
return null;
|
|
55
|
+
return `${String(year).padStart(4, '0')}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`;
|
|
56
|
+
}
|
|
19
57
|
/**
|
|
20
58
|
* ml-date-picker - Date input with calendar dropdown
|
|
21
59
|
*
|
|
22
|
-
* Users can type a date directly into the input or
|
|
60
|
+
* Users can type a date directly into the input (`MM/DD/YYYY` or `YYYY-MM-DD`)
|
|
61
|
+
* or pick from the custom calendar popover. The input is a plain text field so
|
|
62
|
+
* the native browser date picker never competes with the custom calendar.
|
|
63
|
+
* `value` is always the ISO date (`YYYY-MM-DD`).
|
|
23
64
|
*
|
|
24
65
|
* @example
|
|
25
66
|
* ```html
|
|
@@ -57,7 +98,11 @@ let DatePickerComponent = class DatePickerComponent {
|
|
|
57
98
|
this.maxYear = '';
|
|
58
99
|
/** Whether the calendar popover is open */
|
|
59
100
|
this.isOpen = false;
|
|
60
|
-
this.
|
|
101
|
+
this._positioner = new OverlayPositioner(() => ({
|
|
102
|
+
placement: 'bottom-start',
|
|
103
|
+
offset: 4
|
|
104
|
+
}));
|
|
105
|
+
this._restoreFocusOnClose = false;
|
|
61
106
|
this.toggleCalendar = () => {
|
|
62
107
|
if (this.disabled)
|
|
63
108
|
return;
|
|
@@ -66,10 +111,29 @@ let DatePickerComponent = class DatePickerComponent {
|
|
|
66
111
|
popoverEl.togglePopover();
|
|
67
112
|
}
|
|
68
113
|
};
|
|
69
|
-
/** Called when the user types a date into the input */
|
|
114
|
+
/** Called when the user types a date into the input (on change/blur) */
|
|
70
115
|
this.handleInput = (event) => {
|
|
71
116
|
const input = event.target;
|
|
72
|
-
|
|
117
|
+
const text = input.value.trim();
|
|
118
|
+
if (!text) {
|
|
119
|
+
if (this.value !== '') {
|
|
120
|
+
this.commitValue('');
|
|
121
|
+
}
|
|
122
|
+
input.value = '';
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const iso = parseDateInput(text);
|
|
126
|
+
if (iso && this.isWithinRange(iso)) {
|
|
127
|
+
this.commitValue(iso);
|
|
128
|
+
// Normalize the display immediately (re-render may be skipped when the
|
|
129
|
+
// committed value is unchanged).
|
|
130
|
+
input.value = formatDisplayDate(iso);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
// Invalid or out-of-range input: revert to the last committed value,
|
|
134
|
+
// matching what the calendar enforces for min/max.
|
|
135
|
+
input.value = this.displayValue;
|
|
136
|
+
}
|
|
73
137
|
};
|
|
74
138
|
/** Clicking the input opens the calendar */
|
|
75
139
|
this.handleInputClick = () => {
|
|
@@ -82,21 +146,15 @@ let DatePickerComponent = class DatePickerComponent {
|
|
|
82
146
|
event.stopPropagation();
|
|
83
147
|
const detail = event.detail;
|
|
84
148
|
this.commitValue(detail.value);
|
|
85
|
-
|
|
149
|
+
// Dismissal originates inside the overlay — restore focus to the input.
|
|
150
|
+
this.closePopover(true);
|
|
86
151
|
};
|
|
87
152
|
this.handleKeyDown = (event) => {
|
|
88
153
|
if (event.key === 'Escape' && this.isOpen) {
|
|
89
154
|
event.preventDefault();
|
|
90
|
-
this.closePopover();
|
|
91
|
-
}
|
|
92
|
-
// Prevent Space from triggering the native date picker
|
|
93
|
-
if (event.key === ' ') {
|
|
94
|
-
event.preventDefault();
|
|
95
|
-
if (!this.isOpen) {
|
|
96
|
-
this.toggleCalendar();
|
|
97
|
-
}
|
|
155
|
+
this.closePopover(true);
|
|
98
156
|
}
|
|
99
|
-
//
|
|
157
|
+
// F4 / Alt+Down open the custom calendar (standard combobox-style keys)
|
|
100
158
|
if (event.key === 'F4' || (event.altKey && event.key === 'ArrowDown')) {
|
|
101
159
|
event.preventDefault();
|
|
102
160
|
if (!this.isOpen) {
|
|
@@ -112,12 +170,23 @@ let DatePickerComponent = class DatePickerComponent {
|
|
|
112
170
|
}
|
|
113
171
|
else {
|
|
114
172
|
this.isOpen = false;
|
|
115
|
-
this.
|
|
116
|
-
|
|
117
|
-
|
|
173
|
+
this._positioner.stop();
|
|
174
|
+
// Restore focus for keyboard (Escape) and inside-overlay dismissals —
|
|
175
|
+
// including native popover light-dismiss (e.g. Escape pressed while
|
|
176
|
+
// focus is parked in the calendar), which would otherwise drop focus
|
|
177
|
+
// to <body>. Pointer light-dismiss that moved focus elsewhere must
|
|
178
|
+
// not have it yanked back.
|
|
179
|
+
if (this._restoreFocusOnClose || isDeepFocusWithin(this.elementRef)) {
|
|
180
|
+
this.returnFocus();
|
|
181
|
+
}
|
|
182
|
+
this._restoreFocusOnClose = false;
|
|
118
183
|
}
|
|
119
184
|
};
|
|
120
185
|
}
|
|
186
|
+
/** The formatted text shown in the input (MM/DD/YYYY) */
|
|
187
|
+
get displayValue() {
|
|
188
|
+
return formatDisplayDate(this.value);
|
|
189
|
+
}
|
|
121
190
|
onCreate() {
|
|
122
191
|
const popoverEl = this.getPopoverEl();
|
|
123
192
|
if (popoverEl) {
|
|
@@ -125,12 +194,20 @@ let DatePickerComponent = class DatePickerComponent {
|
|
|
125
194
|
}
|
|
126
195
|
}
|
|
127
196
|
onDestroy() {
|
|
128
|
-
this.
|
|
197
|
+
this._positioner.stop();
|
|
129
198
|
const popoverEl = this.getPopoverEl();
|
|
130
199
|
if (popoverEl) {
|
|
131
200
|
popoverEl.removeEventListener('toggle', this._handleToggle);
|
|
132
201
|
}
|
|
133
202
|
}
|
|
203
|
+
/** ISO dates (YYYY-MM-DD) compare correctly as strings. */
|
|
204
|
+
isWithinRange(iso) {
|
|
205
|
+
if (this.min && iso < this.min)
|
|
206
|
+
return false;
|
|
207
|
+
if (this.max && iso > this.max)
|
|
208
|
+
return false;
|
|
209
|
+
return true;
|
|
210
|
+
}
|
|
134
211
|
commitValue(iso) {
|
|
135
212
|
this.value = iso;
|
|
136
213
|
this.elementRef.dispatchEvent(new CustomEvent('ml:change', {
|
|
@@ -139,9 +216,10 @@ let DatePickerComponent = class DatePickerComponent {
|
|
|
139
216
|
detail: { value: iso }
|
|
140
217
|
}));
|
|
141
218
|
}
|
|
142
|
-
closePopover() {
|
|
219
|
+
closePopover(restoreFocus = false) {
|
|
143
220
|
const popoverEl = this.getPopoverEl();
|
|
144
221
|
if (popoverEl && this.isOpen) {
|
|
222
|
+
this._restoreFocusOnClose = restoreFocus;
|
|
145
223
|
popoverEl.hidePopover();
|
|
146
224
|
}
|
|
147
225
|
}
|
|
@@ -150,18 +228,7 @@ let DatePickerComponent = class DatePickerComponent {
|
|
|
150
228
|
const popoverEl = this.getPopoverEl();
|
|
151
229
|
if (!triggerEl || !popoverEl)
|
|
152
230
|
return;
|
|
153
|
-
|
|
154
|
-
this._cleanupAutoUpdate?.();
|
|
155
|
-
this._cleanupAutoUpdate = autoUpdate(triggerEl, popoverEl, update);
|
|
156
|
-
}
|
|
157
|
-
updatePosition(triggerEl, popoverEl) {
|
|
158
|
-
const middleware = [offset(4), flip(), shift({ padding: 8 })];
|
|
159
|
-
const { x, y } = computePosition(triggerEl, popoverEl, {
|
|
160
|
-
placement: 'bottom-start',
|
|
161
|
-
middleware
|
|
162
|
-
});
|
|
163
|
-
popoverEl.style.left = `${x}px`;
|
|
164
|
-
popoverEl.style.top = `${y}px`;
|
|
231
|
+
this._positioner.start(triggerEl, popoverEl);
|
|
165
232
|
}
|
|
166
233
|
returnFocus() {
|
|
167
234
|
const inputEl = this.getInputEl();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/date-picker.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"date-picker.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/date-picker.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,iDAiO5B,CAAC"}
|
|
@@ -130,16 +130,6 @@ export const datePickerStyles = () => css `
|
|
|
130
130
|
padding: var(--ml-date-picker-padding);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
/* Hide native date picker indicator across browsers */
|
|
134
|
-
.ml-date-picker__input::-webkit-calendar-picker-indicator {
|
|
135
|
-
display: none;
|
|
136
|
-
-webkit-appearance: none;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.ml-date-picker__input::-webkit-date-and-time-value {
|
|
140
|
-
text-align: left;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
133
|
.ml-date-picker__input:disabled {
|
|
144
134
|
cursor: not-allowed;
|
|
145
135
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.template.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/date-picker.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"date-picker.template.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/date-picker.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,mBAAmB,6CA6DxD"}
|
|
@@ -17,14 +17,13 @@ export function datePickerTemplate(c) {
|
|
|
17
17
|
|
|
18
18
|
<div class="ml-date-picker__trigger">
|
|
19
19
|
<input
|
|
20
|
-
type="
|
|
20
|
+
type="text"
|
|
21
21
|
class="ml-date-picker__input"
|
|
22
|
-
.value=${c.
|
|
23
|
-
min=${c.min}
|
|
24
|
-
max=${c.max}
|
|
22
|
+
.value=${c.displayValue}
|
|
25
23
|
placeholder=${c.placeholder}
|
|
26
24
|
?disabled=${c.disabled}
|
|
27
25
|
?required=${c.required}
|
|
26
|
+
autocomplete="off"
|
|
28
27
|
aria-haspopup="dialog"
|
|
29
28
|
aria-expanded=${c.isOpen ? 'true' : 'false'}
|
|
30
29
|
@change=${c.handleInput}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { IElementRef } from '@melodicdev/core';
|
|
2
2
|
import type { FileUploadStatus } from './file-upload.types.js';
|
|
3
|
+
/**
|
|
4
|
+
* ml-file-upload-item - A single file entry in an upload list
|
|
5
|
+
*
|
|
6
|
+
* @fires ml:dismiss - Emitted when the remove button is clicked. Detail: { name, file }
|
|
7
|
+
* @fires ml:remove - Deprecated alias of ml:dismiss (kept for backwards compatibility)
|
|
8
|
+
* @fires ml:retry - Emitted when the retry button is clicked. Detail: { name, file }
|
|
9
|
+
*/
|
|
3
10
|
export declare class FileUploadItemComponent implements IElementRef {
|
|
4
11
|
elementRef: HTMLElement;
|
|
5
12
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-upload-item.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/file-upload/file-upload-item.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI/D,qBAMa,uBAAwB,YAAW,WAAW;IACnD,UAAU,EAAG,WAAW,CAAC;IAEzB,IAAI,SAAM;IACV,IAAI,SAAM;IACV,MAAM,EAAE,gBAAgB,CAAU;IAClC,QAAQ,SAAK;IACb,KAAK,SAAM;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEhC,IAAW,SAAS,IAAI,MAAM,CAG7B;IAED,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,aAAa,IAAI,MAAM,CAEjC;IAEM,YAAY,QAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"file-upload-item.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/file-upload/file-upload-item.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI/D;;;;;;GAMG;AACH,qBAMa,uBAAwB,YAAW,WAAW;IACnD,UAAU,EAAG,WAAW,CAAC;IAEzB,IAAI,SAAM;IACV,IAAI,SAAM;IACV,MAAM,EAAE,gBAAgB,CAAU;IAClC,QAAQ,SAAK;IACb,KAAK,SAAM;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEhC,IAAW,SAAS,IAAI,MAAM,CAG7B;IAED,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,aAAa,IAAI,MAAM,CAEjC;IAEM,YAAY,QAAO,IAAI,CAmB5B;IAEK,WAAW,QAAO,IAAI,CAQ3B;CACF"}
|
|
@@ -7,6 +7,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { MelodicComponent } from '@melodicdev/core';
|
|
8
8
|
import { fileUploadItemTemplate } from './file-upload-item.template.js';
|
|
9
9
|
import { fileUploadItemStyles } from './file-upload-item.styles.js';
|
|
10
|
+
/**
|
|
11
|
+
* ml-file-upload-item - A single file entry in an upload list
|
|
12
|
+
*
|
|
13
|
+
* @fires ml:dismiss - Emitted when the remove button is clicked. Detail: { name, file }
|
|
14
|
+
* @fires ml:remove - Deprecated alias of ml:dismiss (kept for backwards compatibility)
|
|
15
|
+
* @fires ml:retry - Emitted when the retry button is clicked. Detail: { name, file }
|
|
16
|
+
*/
|
|
10
17
|
let FileUploadItemComponent = class FileUploadItemComponent {
|
|
11
18
|
constructor() {
|
|
12
19
|
this.name = '';
|
|
@@ -16,6 +23,14 @@ let FileUploadItemComponent = class FileUploadItemComponent {
|
|
|
16
23
|
this.error = '';
|
|
17
24
|
this.file = null;
|
|
18
25
|
this.handleRemove = () => {
|
|
26
|
+
// Canonical dismissal event (shared vocabulary with ml-alert/ml-toast/ml-tag).
|
|
27
|
+
this.elementRef.dispatchEvent(new CustomEvent('ml:dismiss', {
|
|
28
|
+
bubbles: true,
|
|
29
|
+
composed: true,
|
|
30
|
+
detail: { name: this.name, file: this.file }
|
|
31
|
+
}));
|
|
32
|
+
// DEPRECATED: ml:remove is kept for backwards compatibility and will be
|
|
33
|
+
// removed in the next major release. Listen for ml:dismiss instead.
|
|
19
34
|
this.elementRef.dispatchEvent(new CustomEvent('ml:remove', {
|
|
20
35
|
bubbles: true,
|
|
21
36
|
composed: true,
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { IElementRef } from '@melodicdev/core';
|
|
2
|
+
/**
|
|
3
|
+
* ml-file-upload - Drag-and-drop / click-to-browse file selection dropzone
|
|
4
|
+
*
|
|
5
|
+
* @fires ml:change - Emitted when valid files are selected. Detail: { files }
|
|
6
|
+
* @fires ml:error - Emitted when files fail validation. Detail: { errors }
|
|
7
|
+
*/
|
|
2
8
|
export declare class FileUploadComponent implements IElementRef {
|
|
3
9
|
elementRef: HTMLElement;
|
|
4
10
|
accept: string;
|
|
@@ -13,6 +19,15 @@ export declare class FileUploadComponent implements IElementRef {
|
|
|
13
19
|
icon: string;
|
|
14
20
|
dragOver: boolean;
|
|
15
21
|
private _dragCounter;
|
|
22
|
+
/**
|
|
23
|
+
* The currently selected (valid) files. Accumulates across selections in
|
|
24
|
+
* `multiple` mode and is replaced by the latest selection otherwise. This
|
|
25
|
+
* backs the forms adapter, so a bound FormControl stays in sync; it can
|
|
26
|
+
* also be set programmatically (e.g. control.setValue([]) to reset).
|
|
27
|
+
*/
|
|
28
|
+
files: File[];
|
|
29
|
+
/** Remove a previously selected file (keeps a bound FormControl in sync). */
|
|
30
|
+
removeFile: (file: File) => void;
|
|
16
31
|
handleClick: () => void;
|
|
17
32
|
handleFileInput: (event: Event) => void;
|
|
18
33
|
handleDragEnter: (event: DragEvent) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-upload.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/file-upload/file-upload.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"file-upload.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/file-upload/file-upload.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAgCpD;;;;;GAKG;AACH,qBAMa,mBAAoB,YAAW,WAAW;IAC/C,UAAU,EAAG,WAAW,CAAC;IAEzB,MAAM,SAAM;IACZ,QAAQ,UAAS;IACjB,OAAO,SAAK;IACZ,QAAQ,SAAK;IACb,QAAQ,UAAS;IACjB,KAAK,SAAqB;IAC1B,QAAQ,SAAsB;IAC9B,IAAI,SAAM;IACV,KAAK,SAAM;IACX,IAAI,SAAoB;IAExB,QAAQ,UAAS;IACxB,OAAO,CAAC,YAAY,CAAK;IAEzB;;;;;OAKG;IACI,KAAK,EAAE,IAAI,EAAE,CAAM;IAE1B,6EAA6E;IACtE,UAAU,GAAI,MAAM,IAAI,KAAG,IAAI,CAUpC;IAEK,WAAW,QAAO,IAAI,CAI3B;IAEK,eAAe,GAAI,OAAO,KAAK,KAAG,IAAI,CAK3C;IAEK,eAAe,GAAI,OAAO,SAAS,KAAG,IAAI,CAQ/C;IAEK,cAAc,GAAI,OAAO,SAAS,KAAG,IAAI,CAG9C;IAEK,eAAe,GAAI,OAAO,SAAS,KAAG,IAAI,CAO/C;IAEK,UAAU,GAAI,OAAO,SAAS,KAAG,IAAI,CAS1C;IAEK,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI;CA4DxC"}
|