@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
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TableCore — shared internals for ml-table and ml-data-grid.
|
|
3
|
+
*
|
|
4
|
+
* Both components render the same data pipeline — sort → (grid only:
|
|
5
|
+
* filter/page) → virtual window — with identical selection semantics and
|
|
6
|
+
* event contracts (ml:sort, ml:select, ml:row-click). TableCore owns that
|
|
7
|
+
* shared pipeline; each component instantiates one (composition, mirroring
|
|
8
|
+
* how both already compose VirtualScroller) and delegates to it.
|
|
9
|
+
*
|
|
10
|
+
* Component-specific features stay in the components: ml-table keeps manual
|
|
11
|
+
* sort and footer/header-actions slots; ml-data-grid keeps filtering,
|
|
12
|
+
* pagination, column resize/reorder, and pinned columns.
|
|
13
|
+
*
|
|
14
|
+
* INTERNAL: not exported from the package root — implementation detail only.
|
|
15
|
+
*/
|
|
16
|
+
export type SortDirection = 'asc' | 'desc';
|
|
17
|
+
/** Minimal structural column contract shared by TableColumn and DataGridColumn. */
|
|
18
|
+
export interface TableCoreColumn {
|
|
19
|
+
/** Property key to read from row data */
|
|
20
|
+
key: string;
|
|
21
|
+
/** Whether column is sortable */
|
|
22
|
+
sortable?: boolean;
|
|
23
|
+
/** Custom cell renderer — return a TemplateResult or string */
|
|
24
|
+
render?: (value: unknown, row: Record<string, unknown>, index: number) => unknown;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The component state TableCore reads and writes. Both components pass
|
|
28
|
+
* themselves as the host: writes go through the framework's observed setters,
|
|
29
|
+
* so state changes made by the core schedule re-renders exactly like the
|
|
30
|
+
* component's own writes.
|
|
31
|
+
*/
|
|
32
|
+
export interface TableCoreHost {
|
|
33
|
+
/** The custom element — event dispatch target and shadow-root owner */
|
|
34
|
+
readonly elementRef: HTMLElement;
|
|
35
|
+
/** Consumer-provided rows in original order (the ml:select index basis) */
|
|
36
|
+
readonly rows: Record<string, unknown>[];
|
|
37
|
+
/** Whether virtual scrolling is enabled */
|
|
38
|
+
readonly virtual: boolean;
|
|
39
|
+
/** Fixed row height in px for the current size variant */
|
|
40
|
+
readonly rowHeight: number;
|
|
41
|
+
/** Currently sorted column key ('' = unsorted) */
|
|
42
|
+
sortKey: string;
|
|
43
|
+
/** Current sort direction */
|
|
44
|
+
sortDirection: SortDirection;
|
|
45
|
+
/** Positional selection indices into the display (render-order) rows */
|
|
46
|
+
selectedIndices: number[];
|
|
47
|
+
/** First rendered row index (virtual window) */
|
|
48
|
+
startIndex: number;
|
|
49
|
+
/** One past the last rendered row index (virtual window) */
|
|
50
|
+
endIndex: number;
|
|
51
|
+
}
|
|
52
|
+
export interface TableCoreOptions {
|
|
53
|
+
/** Shadow-root selector for the scrollable viewport element */
|
|
54
|
+
viewportSelector: string;
|
|
55
|
+
/**
|
|
56
|
+
* Rows in final render order after the component's full pipeline
|
|
57
|
+
* (table: sortedRows; grid: processedRows = filter → sort → page).
|
|
58
|
+
*/
|
|
59
|
+
displayRows: () => Record<string, unknown>[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Default cell renderer: the column's render callback when present, otherwise
|
|
63
|
+
* the raw value (blank for null/undefined).
|
|
64
|
+
*/
|
|
65
|
+
export declare function renderCell(column: TableCoreColumn, row: Record<string, unknown>, index: number): unknown;
|
|
66
|
+
export declare class TableCore {
|
|
67
|
+
private readonly _host;
|
|
68
|
+
private readonly _options;
|
|
69
|
+
private readonly _scroller;
|
|
70
|
+
private _viewport;
|
|
71
|
+
constructor(host: TableCoreHost, options: TableCoreOptions);
|
|
72
|
+
/**
|
|
73
|
+
* Sort rows by the host's current sortKey/sortDirection. Returns the input
|
|
74
|
+
* untouched when no sort key is active. null/undefined values sort last
|
|
75
|
+
* regardless of direction; numbers sort numerically, everything else by
|
|
76
|
+
* locale-aware string comparison.
|
|
77
|
+
*/
|
|
78
|
+
sortRows(rows: Record<string, unknown>[]): Record<string, unknown>[];
|
|
79
|
+
/**
|
|
80
|
+
* Header-click sort cycle: toggles direction on the active column, resets
|
|
81
|
+
* to ascending on a new column. Selection is positional; sorting reorders
|
|
82
|
+
* rows, so it is cleared. Fires ml:sort, then — when a non-empty selection
|
|
83
|
+
* was cleared — ml:select, so consumers holding the previous selection
|
|
84
|
+
* stay in sync.
|
|
85
|
+
*
|
|
86
|
+
* @param beforeDispatch component hook applied after the sort state updates
|
|
87
|
+
* and before events fire (the grid resets its page here).
|
|
88
|
+
*/
|
|
89
|
+
handleSortClick(column: TableCoreColumn, beforeDispatch?: () => void): void;
|
|
90
|
+
get allSelected(): boolean;
|
|
91
|
+
get someSelected(): boolean;
|
|
92
|
+
isRowSelected(index: number): boolean;
|
|
93
|
+
toggleSelectAll(): void;
|
|
94
|
+
toggleSelectRow(index: number, event: Event): void;
|
|
95
|
+
/**
|
|
96
|
+
* Clear the positional selection (the rows changed or reordered under it).
|
|
97
|
+
* Returns whether a non-empty selection was cleared so the caller can
|
|
98
|
+
* announce it via emitSelect() AFTER dispatching its own event.
|
|
99
|
+
*/
|
|
100
|
+
clearSelection(): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* ml:select contract: internal selection state is display-order positional
|
|
103
|
+
* (it mirrors what is rendered); the public detail carries the selected row
|
|
104
|
+
* OBJECTS plus their indices in the consumer's original `rows` array, so
|
|
105
|
+
* selections survive re-sorting/filtering/paging on the consumer side.
|
|
106
|
+
*/
|
|
107
|
+
emitSelect(): void;
|
|
108
|
+
emitRowClick(row: Record<string, unknown>, index: number): void;
|
|
109
|
+
/** Attach the VirtualScroller to the shadow viewport (idempotent). */
|
|
110
|
+
attachScroller(): void;
|
|
111
|
+
/** Tear down the scroller (call from onDestroy). */
|
|
112
|
+
detach(): void;
|
|
113
|
+
/** Recompute the virtual window (item count or row height changed). */
|
|
114
|
+
invalidateScroller(): void;
|
|
115
|
+
/** Scroll the viewport back to the top (e.g. on page change). */
|
|
116
|
+
scrollViewportToTop(): void;
|
|
117
|
+
/**
|
|
118
|
+
* Handle an external `rows` replacement (called from onPropertyChange,
|
|
119
|
+
* which fires BEFORE the new value commits). Positional selection is
|
|
120
|
+
* invalidated by a new dataset — reset silently (the consumer initiated
|
|
121
|
+
* the change). The virtual window is recomputed on a microtask so it sees
|
|
122
|
+
* the committed rows, after the component's own post-commit adjustment
|
|
123
|
+
* (the grid clamps its page here) has run.
|
|
124
|
+
*/
|
|
125
|
+
handleRowsChange(afterCommit?: () => void): void;
|
|
126
|
+
/**
|
|
127
|
+
* Per-render window maintenance (call from onRender): attaches the
|
|
128
|
+
* scroller once the viewport exists, seeds an approximate end index while
|
|
129
|
+
* the viewport height is still unknown (virtual mode), and pins endIndex
|
|
130
|
+
* to the full row count in non-virtual mode.
|
|
131
|
+
*/
|
|
132
|
+
syncRenderWindow(): void;
|
|
133
|
+
get visibleRows(): Record<string, unknown>[];
|
|
134
|
+
get topSpacerHeight(): number;
|
|
135
|
+
get bottomSpacerHeight(): number;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=table-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-core.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table-core/table-core.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C,mFAAmF;AACnF,MAAM,WAAW,eAAe;IAC/B,yCAAyC;IACzC,GAAG,EAAE,MAAM,CAAC;IAEZ,iCAAiC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;CAClF;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC7B,uEAAuE;IACvE,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IAEjC,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAEzC,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAEhB,6BAA6B;IAC7B,aAAa,EAAE,aAAa,CAAC;IAE7B,wEAAwE;IACxE,eAAe,EAAE,MAAM,EAAE,CAAC;IAE1B,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IAEnB,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAChC,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,WAAW,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CAC7C;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAKxG;AAED,qBAAa,SAAS;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IACnD,OAAO,CAAC,SAAS,CAA4B;gBAEjC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,gBAAgB;IAO1D;;;;;OAKG;IACI,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;IAc3E;;;;;;;;;OASG;IACI,eAAe,CAAC,MAAM,EAAE,eAAe,EAAE,cAAc,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI;IAuBlF,IAAW,WAAW,IAAI,OAAO,CAGhC;IAED,IAAW,YAAY,IAAI,OAAO,CAEjC;IAEM,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIrC,eAAe,IAAI,IAAI;IAOvB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAQzD;;;;OAIG;IACI,cAAc,IAAI,OAAO;IAMhC;;;;;OAKG;IACI,UAAU,IAAI,IAAI;IAyBlB,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAYtE,sEAAsE;IAC/D,cAAc,IAAI,IAAI;IAc7B,oDAAoD;IAC7C,MAAM,IAAI,IAAI;IAKrB,uEAAuE;IAChE,kBAAkB,IAAI,IAAI;IAIjC,iEAAiE;IAC1D,mBAAmB,IAAI,IAAI;IAIlC;;;;;;;OAOG;IACI,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI;IAQvD;;;;;OAKG;IACI,gBAAgB,IAAI,IAAI;IAkB/B,IAAW,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAIlD;IAED,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,kBAAkB,IAAI,MAAM,CAGtC;CACD"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { VirtualScroller } from '../../../utils/virtual-scroll/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Default cell renderer: the column's render callback when present, otherwise
|
|
4
|
+
* the raw value (blank for null/undefined).
|
|
5
|
+
*/
|
|
6
|
+
export function renderCell(column, row, index) {
|
|
7
|
+
if (column.render) {
|
|
8
|
+
return column.render(row[column.key], row, index);
|
|
9
|
+
}
|
|
10
|
+
return row[column.key] ?? '';
|
|
11
|
+
}
|
|
12
|
+
export class TableCore {
|
|
13
|
+
constructor(host, options) {
|
|
14
|
+
this._scroller = new VirtualScroller();
|
|
15
|
+
this._viewport = null;
|
|
16
|
+
this._host = host;
|
|
17
|
+
this._options = options;
|
|
18
|
+
}
|
|
19
|
+
// ── Sorting ───────────────────────────────────────────────────────────────────
|
|
20
|
+
/**
|
|
21
|
+
* Sort rows by the host's current sortKey/sortDirection. Returns the input
|
|
22
|
+
* untouched when no sort key is active. null/undefined values sort last
|
|
23
|
+
* regardless of direction; numbers sort numerically, everything else by
|
|
24
|
+
* locale-aware string comparison.
|
|
25
|
+
*/
|
|
26
|
+
sortRows(rows) {
|
|
27
|
+
const key = this._host.sortKey;
|
|
28
|
+
if (!key)
|
|
29
|
+
return rows;
|
|
30
|
+
const dir = this._host.sortDirection === 'asc' ? 1 : -1;
|
|
31
|
+
return [...rows].sort((a, b) => {
|
|
32
|
+
const aVal = a[key];
|
|
33
|
+
const bVal = b[key];
|
|
34
|
+
if (aVal == null)
|
|
35
|
+
return bVal == null ? 0 : 1;
|
|
36
|
+
if (bVal == null)
|
|
37
|
+
return -1;
|
|
38
|
+
if (typeof aVal === 'number' && typeof bVal === 'number')
|
|
39
|
+
return (aVal - bVal) * dir;
|
|
40
|
+
return String(aVal).localeCompare(String(bVal)) * dir;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Header-click sort cycle: toggles direction on the active column, resets
|
|
45
|
+
* to ascending on a new column. Selection is positional; sorting reorders
|
|
46
|
+
* rows, so it is cleared. Fires ml:sort, then — when a non-empty selection
|
|
47
|
+
* was cleared — ml:select, so consumers holding the previous selection
|
|
48
|
+
* stay in sync.
|
|
49
|
+
*
|
|
50
|
+
* @param beforeDispatch component hook applied after the sort state updates
|
|
51
|
+
* and before events fire (the grid resets its page here).
|
|
52
|
+
*/
|
|
53
|
+
handleSortClick(column, beforeDispatch) {
|
|
54
|
+
if (!column.sortable)
|
|
55
|
+
return;
|
|
56
|
+
if (this._host.sortKey === column.key) {
|
|
57
|
+
this._host.sortDirection = this._host.sortDirection === 'asc' ? 'desc' : 'asc';
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
this._host.sortKey = column.key;
|
|
61
|
+
this._host.sortDirection = 'asc';
|
|
62
|
+
}
|
|
63
|
+
beforeDispatch?.();
|
|
64
|
+
const hadSelection = this.clearSelection();
|
|
65
|
+
this._scroller.invalidate();
|
|
66
|
+
this._host.elementRef.dispatchEvent(new CustomEvent('ml:sort', {
|
|
67
|
+
bubbles: true,
|
|
68
|
+
composed: true,
|
|
69
|
+
detail: { key: this._host.sortKey, direction: this._host.sortDirection }
|
|
70
|
+
}));
|
|
71
|
+
if (hadSelection)
|
|
72
|
+
this.emitSelect();
|
|
73
|
+
}
|
|
74
|
+
// ── Selection ─────────────────────────────────────────────────────────────────
|
|
75
|
+
get allSelected() {
|
|
76
|
+
const total = this._options.displayRows().length;
|
|
77
|
+
return total > 0 && this._host.selectedIndices.length === total;
|
|
78
|
+
}
|
|
79
|
+
get someSelected() {
|
|
80
|
+
return this._host.selectedIndices.length > 0 && !this.allSelected;
|
|
81
|
+
}
|
|
82
|
+
isRowSelected(index) {
|
|
83
|
+
return this._host.selectedIndices.includes(index);
|
|
84
|
+
}
|
|
85
|
+
toggleSelectAll() {
|
|
86
|
+
this._host.selectedIndices = this.allSelected
|
|
87
|
+
? []
|
|
88
|
+
: this._options.displayRows().map((_, i) => i);
|
|
89
|
+
this.emitSelect();
|
|
90
|
+
}
|
|
91
|
+
toggleSelectRow(index, event) {
|
|
92
|
+
event.stopPropagation();
|
|
93
|
+
this._host.selectedIndices = this._host.selectedIndices.includes(index)
|
|
94
|
+
? this._host.selectedIndices.filter(i => i !== index)
|
|
95
|
+
: [...this._host.selectedIndices, index];
|
|
96
|
+
this.emitSelect();
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Clear the positional selection (the rows changed or reordered under it).
|
|
100
|
+
* Returns whether a non-empty selection was cleared so the caller can
|
|
101
|
+
* announce it via emitSelect() AFTER dispatching its own event.
|
|
102
|
+
*/
|
|
103
|
+
clearSelection() {
|
|
104
|
+
const hadSelection = this._host.selectedIndices.length > 0;
|
|
105
|
+
this._host.selectedIndices = [];
|
|
106
|
+
return hadSelection;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* ml:select contract: internal selection state is display-order positional
|
|
110
|
+
* (it mirrors what is rendered); the public detail carries the selected row
|
|
111
|
+
* OBJECTS plus their indices in the consumer's original `rows` array, so
|
|
112
|
+
* selections survive re-sorting/filtering/paging on the consumer side.
|
|
113
|
+
*/
|
|
114
|
+
emitSelect() {
|
|
115
|
+
const display = this._options.displayRows();
|
|
116
|
+
const selectedRows = this._host.selectedIndices
|
|
117
|
+
.map((i) => display[i])
|
|
118
|
+
.filter((row) => row !== undefined);
|
|
119
|
+
const indexByRow = new Map();
|
|
120
|
+
this._host.rows.forEach((row, i) => {
|
|
121
|
+
if (!indexByRow.has(row))
|
|
122
|
+
indexByRow.set(row, i);
|
|
123
|
+
});
|
|
124
|
+
const selectedIndices = selectedRows
|
|
125
|
+
.map((row) => indexByRow.get(row))
|
|
126
|
+
.filter((i) => i !== undefined);
|
|
127
|
+
this._host.elementRef.dispatchEvent(new CustomEvent('ml:select', {
|
|
128
|
+
bubbles: true,
|
|
129
|
+
composed: true,
|
|
130
|
+
detail: { selectedRows, selectedIndices, allSelected: this.allSelected }
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
// ── Row click ─────────────────────────────────────────────────────────────────
|
|
134
|
+
emitRowClick(row, index) {
|
|
135
|
+
this._host.elementRef.dispatchEvent(new CustomEvent('ml:row-click', {
|
|
136
|
+
bubbles: true,
|
|
137
|
+
composed: true,
|
|
138
|
+
detail: { row, index }
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
// ── Virtual scrolling ─────────────────────────────────────────────────────────
|
|
142
|
+
/** Attach the VirtualScroller to the shadow viewport (idempotent). */
|
|
143
|
+
attachScroller() {
|
|
144
|
+
if (this._viewport)
|
|
145
|
+
return; // already attached
|
|
146
|
+
const shadow = this._host.elementRef.shadowRoot;
|
|
147
|
+
if (!shadow)
|
|
148
|
+
return;
|
|
149
|
+
this._viewport = shadow.querySelector(this._options.viewportSelector);
|
|
150
|
+
if (!this._viewport)
|
|
151
|
+
return;
|
|
152
|
+
this._scroller.attach(this._viewport, {
|
|
153
|
+
rowHeight: () => this._host.rowHeight,
|
|
154
|
+
itemCount: () => this._options.displayRows().length,
|
|
155
|
+
onUpdate: (start, end) => { this._host.startIndex = start; this._host.endIndex = end; },
|
|
156
|
+
enabled: () => this._host.virtual,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
/** Tear down the scroller (call from onDestroy). */
|
|
160
|
+
detach() {
|
|
161
|
+
this._scroller.detach();
|
|
162
|
+
this._viewport = null;
|
|
163
|
+
}
|
|
164
|
+
/** Recompute the virtual window (item count or row height changed). */
|
|
165
|
+
invalidateScroller() {
|
|
166
|
+
this._scroller.invalidate();
|
|
167
|
+
}
|
|
168
|
+
/** Scroll the viewport back to the top (e.g. on page change). */
|
|
169
|
+
scrollViewportToTop() {
|
|
170
|
+
if (this._viewport)
|
|
171
|
+
this._viewport.scrollTop = 0;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Handle an external `rows` replacement (called from onPropertyChange,
|
|
175
|
+
* which fires BEFORE the new value commits). Positional selection is
|
|
176
|
+
* invalidated by a new dataset — reset silently (the consumer initiated
|
|
177
|
+
* the change). The virtual window is recomputed on a microtask so it sees
|
|
178
|
+
* the committed rows, after the component's own post-commit adjustment
|
|
179
|
+
* (the grid clamps its page here) has run.
|
|
180
|
+
*/
|
|
181
|
+
handleRowsChange(afterCommit) {
|
|
182
|
+
this._host.selectedIndices = [];
|
|
183
|
+
queueMicrotask(() => {
|
|
184
|
+
afterCommit?.();
|
|
185
|
+
this._scroller.invalidate();
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Per-render window maintenance (call from onRender): attaches the
|
|
190
|
+
* scroller once the viewport exists, seeds an approximate end index while
|
|
191
|
+
* the viewport height is still unknown (virtual mode), and pins endIndex
|
|
192
|
+
* to the full row count in non-virtual mode.
|
|
193
|
+
*/
|
|
194
|
+
syncRenderWindow() {
|
|
195
|
+
this.attachScroller();
|
|
196
|
+
const total = this._options.displayRows().length;
|
|
197
|
+
if (this._host.virtual) {
|
|
198
|
+
// Compute initial end index when viewport height not yet known
|
|
199
|
+
if (this._viewport && this._viewport.clientHeight === 0 && total > 0) {
|
|
200
|
+
const approxEnd = Math.min(total, Math.ceil(600 / this._host.rowHeight) + 6);
|
|
201
|
+
if (approxEnd !== this._host.endIndex) {
|
|
202
|
+
this._host.endIndex = approxEnd;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
else if (this._host.endIndex !== total) {
|
|
207
|
+
this._host.endIndex = total;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
// ── Render window ─────────────────────────────────────────────────────────────
|
|
211
|
+
get visibleRows() {
|
|
212
|
+
const display = this._options.displayRows();
|
|
213
|
+
if (!this._host.virtual)
|
|
214
|
+
return display;
|
|
215
|
+
return display.slice(this._host.startIndex, this._host.endIndex);
|
|
216
|
+
}
|
|
217
|
+
get topSpacerHeight() {
|
|
218
|
+
return this._host.virtual ? this._host.startIndex * this._host.rowHeight : 0;
|
|
219
|
+
}
|
|
220
|
+
get bottomSpacerHeight() {
|
|
221
|
+
if (!this._host.virtual)
|
|
222
|
+
return 0;
|
|
223
|
+
return Math.max(0, (this._options.displayRows().length - this._host.endIndex) * this._host.rowHeight);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -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
|
import type { TagDotColor } from './tag.types.js';
|
|
4
4
|
/**
|
|
5
5
|
* ml-tag - Compact element for labeling, categorizing, and organizing items
|
|
@@ -14,21 +14,22 @@ import type { TagDotColor } from './tag.types.js';
|
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
16
|
* @slot default - Tag label content
|
|
17
|
-
* @fires ml:
|
|
17
|
+
* @fires ml:dismiss - Fired when the close button is clicked
|
|
18
|
+
* @fires ml:close - Deprecated alias of ml:dismiss (kept for backwards compatibility)
|
|
18
19
|
* @fires ml:change - Fired when checkbox state changes (when checkable)
|
|
19
20
|
*/
|
|
20
21
|
export declare class TagComponent implements IElementRef {
|
|
21
22
|
elementRef: HTMLElement;
|
|
22
23
|
/** Tag size */
|
|
23
|
-
size:
|
|
24
|
+
size: ControlSize;
|
|
24
25
|
/** Show dot indicator */
|
|
25
26
|
dot: boolean;
|
|
26
|
-
/** Dot color */
|
|
27
|
-
|
|
27
|
+
/** Dot color (attribute: dot-color) */
|
|
28
|
+
dotColor: TagDotColor;
|
|
28
29
|
/** Show close button */
|
|
29
30
|
closable: boolean;
|
|
30
|
-
/** Avatar image source */
|
|
31
|
-
|
|
31
|
+
/** Avatar image source (attribute: avatar-src) */
|
|
32
|
+
avatarSrc: string;
|
|
32
33
|
/** Icon name (Phosphor icon) */
|
|
33
34
|
icon: string;
|
|
34
35
|
/** Count value displayed on the right */
|
|
@@ -39,6 +40,12 @@ export declare class TagComponent implements IElementRef {
|
|
|
39
40
|
checked: boolean;
|
|
40
41
|
/** Disabled state */
|
|
41
42
|
disabled: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Dot color with the canonical 'error' name resolved to this component's
|
|
45
|
+
* historical 'danger' style class. The two are interchangeable aliases;
|
|
46
|
+
* the stylesheet keys off `ml-tag__dot--danger`.
|
|
47
|
+
*/
|
|
48
|
+
get resolvedDotColor(): TagDotColor;
|
|
42
49
|
/** Handle close button click */
|
|
43
50
|
handleClose: (event: Event) => void;
|
|
44
51
|
/** Handle checkbox change */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/tag/tag.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"tag.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/tag/tag.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAMa,YAAa,YAAW,WAAW;IACxC,UAAU,EAAG,WAAW,CAAC;IAEhC,eAAe;IACR,IAAI,EAAE,WAAW,CAAQ;IAEhC,yBAAyB;IAClB,GAAG,UAAS;IAEnB,uCAAuC;IAChC,QAAQ,EAAE,WAAW,CAAa;IAEzC,wBAAwB;IACjB,QAAQ,UAAS;IAExB,kDAAkD;IAC3C,SAAS,SAAM;IAEtB,gCAAgC;IACzB,IAAI,SAAM;IAEjB,yCAAyC;IAClC,KAAK,SAAM;IAElB,oBAAoB;IACb,SAAS,UAAS;IAEzB,6BAA6B;IACtB,OAAO,UAAS;IAEvB,qBAAqB;IACd,QAAQ,UAAS;IAExB;;;;OAIG;IACH,IAAW,gBAAgB,IAAI,WAAW,CAGzC;IAED,gCAAgC;IACzB,WAAW,GAAI,OAAO,KAAK,KAAG,IAAI,CAoBvC;IAEF,6BAA6B;IACtB,WAAW,GAAI,OAAO,KAAK,KAAG,IAAI,CAYvC;CACF"}
|
|
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { MelodicComponent } from '@melodicdev/core';
|
|
8
8
|
import { tagTemplate } from './tag.template.js';
|
|
9
9
|
import { tagStyles } from './tag.styles.js';
|
|
10
|
+
import { defineLegacyAliases } from '../../../functions/index.js';
|
|
10
11
|
/**
|
|
11
12
|
* ml-tag - Compact element for labeling, categorizing, and organizing items
|
|
12
13
|
*
|
|
@@ -20,7 +21,8 @@ import { tagStyles } from './tag.styles.js';
|
|
|
20
21
|
* ```
|
|
21
22
|
*
|
|
22
23
|
* @slot default - Tag label content
|
|
23
|
-
* @fires ml:
|
|
24
|
+
* @fires ml:dismiss - Fired when the close button is clicked
|
|
25
|
+
* @fires ml:close - Deprecated alias of ml:dismiss (kept for backwards compatibility)
|
|
24
26
|
* @fires ml:change - Fired when checkbox state changes (when checkable)
|
|
25
27
|
*/
|
|
26
28
|
let TagComponent = class TagComponent {
|
|
@@ -29,12 +31,12 @@ let TagComponent = class TagComponent {
|
|
|
29
31
|
this.size = 'md';
|
|
30
32
|
/** Show dot indicator */
|
|
31
33
|
this.dot = false;
|
|
32
|
-
/** Dot color */
|
|
33
|
-
this
|
|
34
|
+
/** Dot color (attribute: dot-color) */
|
|
35
|
+
this.dotColor = 'success';
|
|
34
36
|
/** Show close button */
|
|
35
37
|
this.closable = false;
|
|
36
|
-
/** Avatar image source */
|
|
37
|
-
this
|
|
38
|
+
/** Avatar image source (attribute: avatar-src) */
|
|
39
|
+
this.avatarSrc = '';
|
|
38
40
|
/** Icon name (Phosphor icon) */
|
|
39
41
|
this.icon = '';
|
|
40
42
|
/** Count value displayed on the right */
|
|
@@ -50,6 +52,13 @@ let TagComponent = class TagComponent {
|
|
|
50
52
|
event.stopPropagation();
|
|
51
53
|
if (this.disabled)
|
|
52
54
|
return;
|
|
55
|
+
// Canonical dismissal event (shared vocabulary with ml-alert/ml-toast).
|
|
56
|
+
this.elementRef.dispatchEvent(new CustomEvent('ml:dismiss', {
|
|
57
|
+
bubbles: true,
|
|
58
|
+
composed: true
|
|
59
|
+
}));
|
|
60
|
+
// DEPRECATED: ml:close is kept for backwards compatibility and will be
|
|
61
|
+
// removed in the next major release. Listen for ml:dismiss instead.
|
|
53
62
|
this.elementRef.dispatchEvent(new CustomEvent('ml:close', {
|
|
54
63
|
bubbles: true,
|
|
55
64
|
composed: true
|
|
@@ -68,6 +77,15 @@ let TagComponent = class TagComponent {
|
|
|
68
77
|
}));
|
|
69
78
|
};
|
|
70
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Dot color with the canonical 'error' name resolved to this component's
|
|
82
|
+
* historical 'danger' style class. The two are interchangeable aliases;
|
|
83
|
+
* the stylesheet keys off `ml-tag__dot--danger`.
|
|
84
|
+
*/
|
|
85
|
+
get resolvedDotColor() {
|
|
86
|
+
const color = this.dotColor;
|
|
87
|
+
return color === 'error' ? 'danger' : color;
|
|
88
|
+
}
|
|
71
89
|
};
|
|
72
90
|
TagComponent = __decorate([
|
|
73
91
|
MelodicComponent({
|
|
@@ -78,3 +96,9 @@ TagComponent = __decorate([
|
|
|
78
96
|
})
|
|
79
97
|
], TagComponent);
|
|
80
98
|
export { TagComponent };
|
|
99
|
+
// Deprecated quoted kebab-case property aliases (warn once on first write;
|
|
100
|
+
// removed in the next major release).
|
|
101
|
+
defineLegacyAliases(TagComponent.prototype, 'ml-tag', {
|
|
102
|
+
'dot-color': 'dotColor',
|
|
103
|
+
'avatar-src': 'avatarSrc'
|
|
104
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { html, classMap } from '@melodicdev/core';
|
|
2
2
|
export function tagTemplate(c) {
|
|
3
|
-
const avatarSrc = c
|
|
4
|
-
const dotColor = c
|
|
3
|
+
const avatarSrc = c.avatarSrc;
|
|
4
|
+
const dotColor = c.resolvedDotColor;
|
|
5
5
|
return html `
|
|
6
6
|
<span
|
|
7
7
|
class=${classMap({
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Tag dot indicator color.
|
|
3
|
+
*
|
|
4
|
+
* 'error' is the library-wide canonical name for the destructive/failure
|
|
5
|
+
* color (matching alert/toast/badge/progress); 'danger' is a deprecated
|
|
6
|
+
* alias kept for backwards compatibility and renders identically.
|
|
7
|
+
*/
|
|
8
|
+
export type TagDotColor = 'success' | 'warning' | 'danger' | 'error' | 'info' | 'primary' | 'secondary';
|
|
2
9
|
//# sourceMappingURL=tag.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.types.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/tag/tag.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"tag.types.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/tag/tag.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC"}
|
|
@@ -5,7 +5,7 @@ import type { AlertVariant } from './alert.types.js';
|
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```html
|
|
8
|
-
* <ml-alert variant="info" title="Information">
|
|
8
|
+
* <ml-alert variant="info" alert-title="Information">
|
|
9
9
|
* This is an informational message.
|
|
10
10
|
* </ml-alert>
|
|
11
11
|
*
|
|
@@ -22,10 +22,13 @@ export declare class AlertComponent implements IElementRef {
|
|
|
22
22
|
elementRef: HTMLElement;
|
|
23
23
|
/** Alert variant/type */
|
|
24
24
|
variant: AlertVariant;
|
|
25
|
-
/** Optional title */
|
|
26
|
-
|
|
25
|
+
/** Optional title (attribute: alert-title) */
|
|
26
|
+
alertTitle: string;
|
|
27
27
|
/** Show dismiss button */
|
|
28
28
|
dismissible: boolean;
|
|
29
|
+
/** @deprecated Use `alertTitle` (attribute `alert-title`); `title` collides with the global HTML attribute. */
|
|
30
|
+
get title(): string;
|
|
31
|
+
set title(value: string);
|
|
29
32
|
handleDismiss: () => void;
|
|
30
33
|
renderDefaultIcon: () => import("@melodicdev/core").TemplateResult;
|
|
31
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.component.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/alert/alert.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"alert.component.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/alert/alert.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAKrD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAMa,cAAe,YAAW,WAAW;IAC1C,UAAU,EAAG,WAAW,CAAC;IAEhC,yBAAyB;IAClB,OAAO,EAAE,YAAY,CAAU;IAEtC,8CAA8C;IACvC,UAAU,SAAM;IAEvB,0BAA0B;IACnB,WAAW,UAAS;IAE3B,+GAA+G;IAC/G,IAAW,KAAK,IAAI,MAAM,CAEzB;IACD,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAG7B;IAEM,aAAa,QAAO,IAAI,CAS7B;IAEK,iBAAiB,kDAStB;CACF"}
|
|
@@ -7,12 +7,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { MelodicComponent, html } from '@melodicdev/core';
|
|
8
8
|
import { alertTemplate } from './alert.template.js';
|
|
9
9
|
import { alertStyles } from './alert.styles.js';
|
|
10
|
+
import { warnDeprecatedTitleOnce } from '../../../functions/index.js';
|
|
10
11
|
/**
|
|
11
12
|
* ml-alert - Alert/notification banner component
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```html
|
|
15
|
-
* <ml-alert variant="info" title="Information">
|
|
16
|
+
* <ml-alert variant="info" alert-title="Information">
|
|
16
17
|
* This is an informational message.
|
|
17
18
|
* </ml-alert>
|
|
18
19
|
*
|
|
@@ -29,8 +30,8 @@ let AlertComponent = class AlertComponent {
|
|
|
29
30
|
constructor() {
|
|
30
31
|
/** Alert variant/type */
|
|
31
32
|
this.variant = 'info';
|
|
32
|
-
/** Optional title */
|
|
33
|
-
this.
|
|
33
|
+
/** Optional title (attribute: alert-title) */
|
|
34
|
+
this.alertTitle = '';
|
|
34
35
|
/** Show dismiss button */
|
|
35
36
|
this.dismissible = false;
|
|
36
37
|
this.handleDismiss = () => {
|
|
@@ -51,13 +52,21 @@ let AlertComponent = class AlertComponent {
|
|
|
51
52
|
return html `<ml-icon icon="${icons[this.variant]}"></ml-icon>`;
|
|
52
53
|
};
|
|
53
54
|
}
|
|
55
|
+
/** @deprecated Use `alertTitle` (attribute `alert-title`); `title` collides with the global HTML attribute. */
|
|
56
|
+
get title() {
|
|
57
|
+
return this.alertTitle;
|
|
58
|
+
}
|
|
59
|
+
set title(value) {
|
|
60
|
+
warnDeprecatedTitleOnce('ml-alert', 'alert-title');
|
|
61
|
+
this.alertTitle = value;
|
|
62
|
+
}
|
|
54
63
|
};
|
|
55
64
|
AlertComponent = __decorate([
|
|
56
65
|
MelodicComponent({
|
|
57
66
|
selector: 'ml-alert',
|
|
58
67
|
template: alertTemplate,
|
|
59
68
|
styles: alertStyles,
|
|
60
|
-
attributes: ['variant', 'title', 'dismissible']
|
|
69
|
+
attributes: ['variant', 'alert-title', 'title', 'dismissible']
|
|
61
70
|
})
|
|
62
71
|
], AlertComponent);
|
|
63
72
|
export { AlertComponent };
|
|
@@ -13,7 +13,7 @@ export function alertTemplate(c) {
|
|
|
13
13
|
</div>
|
|
14
14
|
|
|
15
15
|
<div class="ml-alert__content">
|
|
16
|
-
${when(!!c.
|
|
16
|
+
${when(!!c.alertTitle, () => html `<div class="ml-alert__title">${c.alertTitle}</div>`)}
|
|
17
17
|
<div class="ml-alert__message">
|
|
18
18
|
<slot></slot>
|
|
19
19
|
</div>
|
|
@@ -33,6 +33,10 @@ export declare class ProgressComponent implements IElementRef {
|
|
|
33
33
|
/** Label position for linear bars */
|
|
34
34
|
labelPosition: ProgressLabelPosition;
|
|
35
35
|
get percentage(): number;
|
|
36
|
+
/** Value clamped to the 0..max range — used for aria-valuenow so it never exceeds aria-valuemax */
|
|
37
|
+
get clampedValue(): number;
|
|
38
|
+
/** Maximum reported to assistive technology (floored at 1 like the visual math) */
|
|
39
|
+
get ariaMax(): number;
|
|
36
40
|
get displayValue(): string;
|
|
37
41
|
/** SVG circle radius based on size */
|
|
38
42
|
get circleRadius(): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.component.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/progress/progress.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIpD,KAAK,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AACnE,KAAK,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACvC,KAAK,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,aAAa,CAAC;AACzD,KAAK,qBAAqB,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,cAAc,GAAG,iBAAiB,GAAG,MAAM,CAAC;AAEtG;;;;;;;;;;GAUG;AACH,qBAMa,iBAAkB,YAAW,WAAW;IAC7C,UAAU,EAAG,WAAW,CAAC;IAEhC,4BAA4B;IACrB,KAAK,SAAK;IAEjB,oBAAoB;IACb,GAAG,SAAO;IAEjB,oBAAoB;IACb,OAAO,EAAE,eAAe,CAAa;IAE5C,+BAA+B;IACxB,IAAI,EAAE,YAAY,CAAQ;IAEjC,qBAAqB;IACd,KAAK,SAAM;IAElB,2BAA2B;IACpB,SAAS,UAAS;IAEzB,qDAAqD;IAC9C,KAAK,EAAE,aAAa,CAAY;IAEvC,qCAAqC;IAC9B,aAAa,EAAE,qBAAqB,CAAS;IAEpD,IAAW,UAAU,IAAI,MAAM,CAG9B;IAED,IAAW,YAAY,IAAI,MAAM,CAEhC;IAED,sCAAsC;IACtC,IAAW,YAAY,IAAI,MAAM,CAIhC;IAED,qCAAqC;IACrC,IAAW,YAAY,IAAI,MAAM,CAIhC;IAED,8CAA8C;IAC9C,IAAW,aAAa,IAAI,MAAM,CAEjC;IAED,yCAAyC;IACzC,IAAW,iBAAiB,IAAI,MAAM,CAErC;IAED,kCAAkC;IAClC,IAAW,gBAAgB,IAAI,MAAM,CAEpC;IAED,kCAAkC;IAClC,IAAW,oBAAoB,IAAI,MAAM,CAExC;IAED,uBAAuB;IACvB,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED,uBAAuB;IACvB,IAAW,SAAS,IAAI,MAAM,CAE7B;CACD"}
|
|
1
|
+
{"version":3,"file":"progress.component.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/progress/progress.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIpD,KAAK,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AACnE,KAAK,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACvC,KAAK,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,aAAa,CAAC;AACzD,KAAK,qBAAqB,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,cAAc,GAAG,iBAAiB,GAAG,MAAM,CAAC;AAEtG;;;;;;;;;;GAUG;AACH,qBAMa,iBAAkB,YAAW,WAAW;IAC7C,UAAU,EAAG,WAAW,CAAC;IAEhC,4BAA4B;IACrB,KAAK,SAAK;IAEjB,oBAAoB;IACb,GAAG,SAAO;IAEjB,oBAAoB;IACb,OAAO,EAAE,eAAe,CAAa;IAE5C,+BAA+B;IACxB,IAAI,EAAE,YAAY,CAAQ;IAEjC,qBAAqB;IACd,KAAK,SAAM;IAElB,2BAA2B;IACpB,SAAS,UAAS;IAEzB,qDAAqD;IAC9C,KAAK,EAAE,aAAa,CAAY;IAEvC,qCAAqC;IAC9B,aAAa,EAAE,qBAAqB,CAAS;IAEpD,IAAW,UAAU,IAAI,MAAM,CAG9B;IAED,mGAAmG;IACnG,IAAW,YAAY,IAAI,MAAM,CAGhC;IAED,mFAAmF;IACnF,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED,IAAW,YAAY,IAAI,MAAM,CAEhC;IAED,sCAAsC;IACtC,IAAW,YAAY,IAAI,MAAM,CAIhC;IAED,qCAAqC;IACrC,IAAW,YAAY,IAAI,MAAM,CAIhC;IAED,8CAA8C;IAC9C,IAAW,aAAa,IAAI,MAAM,CAEjC;IAED,yCAAyC;IACzC,IAAW,iBAAiB,IAAI,MAAM,CAErC;IAED,kCAAkC;IAClC,IAAW,gBAAgB,IAAI,MAAM,CAEpC;IAED,kCAAkC;IAClC,IAAW,oBAAoB,IAAI,MAAM,CAExC;IAED,uBAAuB;IACvB,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED,uBAAuB;IACvB,IAAW,SAAS,IAAI,MAAM,CAE7B;CACD"}
|
|
@@ -41,6 +41,15 @@ let ProgressComponent = class ProgressComponent {
|
|
|
41
41
|
const max = Math.max(this.max, 1);
|
|
42
42
|
return Math.min(Math.max((this.value / max) * 100, 0), 100);
|
|
43
43
|
}
|
|
44
|
+
/** Value clamped to the 0..max range — used for aria-valuenow so it never exceeds aria-valuemax */
|
|
45
|
+
get clampedValue() {
|
|
46
|
+
const max = Math.max(this.max, 1);
|
|
47
|
+
return Math.min(Math.max(this.value, 0), max);
|
|
48
|
+
}
|
|
49
|
+
/** Maximum reported to assistive technology (floored at 1 like the visual math) */
|
|
50
|
+
get ariaMax() {
|
|
51
|
+
return Math.max(this.max, 1);
|
|
52
|
+
}
|
|
44
53
|
get displayValue() {
|
|
45
54
|
return `${Math.round(this.percentage)}%`;
|
|
46
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.template.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/progress/progress.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"progress.template.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/progress/progress.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAsJjE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,iBAAiB,6CAIpD"}
|