@melodicdev/components 2.0.2 → 3.0.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 +5568 -4145
- package/assets/melodic-components.js.map +1 -1
- package/assets/melodic-components.min.js +6469 -5147
- 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.styles.d.ts.map +1 -1
- package/lib/components/data-display/table/table.styles.js +5 -2
- 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 +13 -6
- package/lib/components/forms/select/select.component.d.ts.map +1 -1
- package/lib/components/forms/select/select.component.js +32 -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,22 +1,28 @@
|
|
|
1
|
-
import { html, when } from '@melodicdev/core';
|
|
1
|
+
import { html, classMap, when } from '@melodicdev/core';
|
|
2
|
+
// The role (listitem, or button when interactive) lives on the HOST element,
|
|
3
|
+
// managed by the component. The named slots are ALWAYS rendered — hiding them
|
|
4
|
+
// with a class instead of `when` keeps slotchange firing, so content inserted
|
|
5
|
+
// after mount still projects.
|
|
2
6
|
export function listItemTemplate(c) {
|
|
3
7
|
return html `
|
|
4
|
-
<div class="ml-li"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
<div class="ml-li">
|
|
9
|
+
<div class=${classMap({
|
|
10
|
+
'ml-li__leading': true,
|
|
11
|
+
'ml-li__leading--hidden': !c.hasLeadingSlot
|
|
12
|
+
})}>
|
|
13
|
+
<slot name="leading"></slot>
|
|
14
|
+
</div>
|
|
10
15
|
<div class="ml-li__content">
|
|
11
16
|
${when(!!c.primary, () => html `<span class="ml-li__primary">${c.primary}</span>`)}
|
|
12
17
|
${when(!!c.secondary, () => html `<span class="ml-li__secondary">${c.secondary}</span>`)}
|
|
13
18
|
<slot></slot>
|
|
14
19
|
</div>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
<div class=${classMap({
|
|
21
|
+
'ml-li__trailing': true,
|
|
22
|
+
'ml-li__trailing--hidden': !c.hasTrailingSlot
|
|
23
|
+
})}>
|
|
24
|
+
<slot name="trailing"></slot>
|
|
25
|
+
</div>
|
|
20
26
|
</div>
|
|
21
27
|
`;
|
|
22
28
|
}
|
|
@@ -47,8 +47,8 @@ export declare class ProfileCardComponent implements IElementRef, OnCreate {
|
|
|
47
47
|
subtitle: string;
|
|
48
48
|
/** Avatar image URL — falls back to initials derived from name */
|
|
49
49
|
avatar: string;
|
|
50
|
-
/** Avatar size */
|
|
51
|
-
|
|
50
|
+
/** Avatar size (attribute: avatar-size) */
|
|
51
|
+
avatarSize: Size;
|
|
52
52
|
/** Slot visibility flags (toggled via slotchange) */
|
|
53
53
|
hasDetails: boolean;
|
|
54
54
|
hasTags: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-card.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/profile-card/profile-card.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"profile-card.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/profile-card/profile-card.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAKpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAMa,oBAAqB,YAAW,WAAW,EAAE,QAAQ;IAC1D,UAAU,EAAG,WAAW,CAAC;IAEhC,kBAAkB;IACX,IAAI,SAAM;IAEjB,kDAAkD;IAC3C,QAAQ,SAAM;IAErB,kEAAkE;IAC3D,MAAM,SAAM;IAEnB,2CAA2C;IACpC,UAAU,EAAE,IAAI,CAAQ;IAE/B,qDAAqD;IAC9C,UAAU,UAAS;IACnB,OAAO,UAAS;IAChB,UAAU,UAAS;IACnB,OAAO,UAAS;IAEvB,gCAAgC;IAChC,IAAW,QAAQ,IAAI,MAAM,CAO5B;IAEM,QAAQ,IAAI,IAAI;CAUvB"}
|
|
@@ -5,6 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { MelodicComponent } from '@melodicdev/core';
|
|
8
|
+
import { watchSlotPresence, defineLegacyAliases } from '../../../functions/index.js';
|
|
8
9
|
import { profileCardTemplate } from './profile-card.template.js';
|
|
9
10
|
import { profileCardStyles } from './profile-card.styles.js';
|
|
10
11
|
/**
|
|
@@ -54,8 +55,8 @@ let ProfileCardComponent = class ProfileCardComponent {
|
|
|
54
55
|
this.subtitle = '';
|
|
55
56
|
/** Avatar image URL — falls back to initials derived from name */
|
|
56
57
|
this.avatar = '';
|
|
57
|
-
/** Avatar size */
|
|
58
|
-
this
|
|
58
|
+
/** Avatar size (attribute: avatar-size) */
|
|
59
|
+
this.avatarSize = 'lg';
|
|
59
60
|
/** Slot visibility flags (toggled via slotchange) */
|
|
60
61
|
this.hasDetails = false;
|
|
61
62
|
this.hasTags = false;
|
|
@@ -75,19 +76,15 @@ let ProfileCardComponent = class ProfileCardComponent {
|
|
|
75
76
|
const shadow = this.elementRef.shadowRoot;
|
|
76
77
|
if (!shadow)
|
|
77
78
|
return;
|
|
78
|
-
shadow
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
this.hasActions = hasContent;
|
|
88
|
-
else if (name === 'meta')
|
|
89
|
-
this.hasMeta = hasContent;
|
|
90
|
-
});
|
|
79
|
+
watchSlotPresence(shadow, (name, hasContent) => {
|
|
80
|
+
if (name === 'details')
|
|
81
|
+
this.hasDetails = hasContent;
|
|
82
|
+
else if (name === 'tags')
|
|
83
|
+
this.hasTags = hasContent;
|
|
84
|
+
else if (name === 'actions')
|
|
85
|
+
this.hasActions = hasContent;
|
|
86
|
+
else if (name === 'meta')
|
|
87
|
+
this.hasMeta = hasContent;
|
|
91
88
|
});
|
|
92
89
|
}
|
|
93
90
|
};
|
|
@@ -100,3 +97,8 @@ ProfileCardComponent = __decorate([
|
|
|
100
97
|
})
|
|
101
98
|
], ProfileCardComponent);
|
|
102
99
|
export { ProfileCardComponent };
|
|
100
|
+
// Deprecated quoted kebab-case property aliases (warn once on first write;
|
|
101
|
+
// removed in the next major release).
|
|
102
|
+
defineLegacyAliases(ProfileCardComponent.prototype, 'ml-profile-card', {
|
|
103
|
+
'avatar-size': 'avatarSize'
|
|
104
|
+
});
|
|
@@ -32,14 +32,14 @@ export declare class StatCardComponent implements IElementRef {
|
|
|
32
32
|
value: string | number;
|
|
33
33
|
/** Trend text (e.g. "+6 this month") */
|
|
34
34
|
trend: string;
|
|
35
|
-
/** Trend direction for styling */
|
|
36
|
-
|
|
35
|
+
/** Trend direction for styling (attribute: trend-direction) */
|
|
36
|
+
trendDirection: TrendDirection;
|
|
37
37
|
/** Icon name (Phosphor icon) */
|
|
38
38
|
icon: string;
|
|
39
|
-
/** Icon color — CSS color value or token */
|
|
40
|
-
|
|
41
|
-
/** Value font family */
|
|
42
|
-
|
|
39
|
+
/** Icon color — CSS color value or token (attribute: icon-color) */
|
|
40
|
+
iconColor: string;
|
|
41
|
+
/** Value font family (attribute: value-font) */
|
|
42
|
+
valueFont: ValueFont;
|
|
43
43
|
}
|
|
44
44
|
export {};
|
|
45
45
|
//# sourceMappingURL=stat-card.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-card.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/stat-card/stat-card.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"stat-card.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/stat-card/stat-card.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAKpD,KAAK,cAAc,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;AAChD,KAAK,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAMa,iBAAkB,YAAW,WAAW;IAC7C,UAAU,EAAG,WAAW,CAAC;IAEhC,mBAAmB;IACZ,KAAK,SAAM;IAElB,oBAAoB;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,CAAM;IAEnC,wCAAwC;IACjC,KAAK,SAAM;IAElB,+DAA+D;IACxD,cAAc,EAAE,cAAc,CAAa;IAElD,gCAAgC;IACzB,IAAI,SAAM;IAEjB,oEAAoE;IAC7D,SAAS,SAAM;IAEtB,gDAAgD;IACzC,SAAS,EAAE,SAAS,CAAW;CACtC"}
|
|
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { MelodicComponent } from '@melodicdev/core';
|
|
8
8
|
import { statCardTemplate } from './stat-card.template.js';
|
|
9
9
|
import { statCardStyles } from './stat-card.styles.js';
|
|
10
|
+
import { defineLegacyAliases } from '../../../functions/index.js';
|
|
10
11
|
/**
|
|
11
12
|
* ml-stat-card - Dashboard metric card with label, value, optional trend, and icon
|
|
12
13
|
*
|
|
@@ -38,14 +39,14 @@ let StatCardComponent = class StatCardComponent {
|
|
|
38
39
|
this.value = '';
|
|
39
40
|
/** Trend text (e.g. "+6 this month") */
|
|
40
41
|
this.trend = '';
|
|
41
|
-
/** Trend direction for styling */
|
|
42
|
-
this
|
|
42
|
+
/** Trend direction for styling (attribute: trend-direction) */
|
|
43
|
+
this.trendDirection = 'neutral';
|
|
43
44
|
/** Icon name (Phosphor icon) */
|
|
44
45
|
this.icon = '';
|
|
45
|
-
/** Icon color — CSS color value or token */
|
|
46
|
-
this
|
|
47
|
-
/** Value font family */
|
|
48
|
-
this
|
|
46
|
+
/** Icon color — CSS color value or token (attribute: icon-color) */
|
|
47
|
+
this.iconColor = '';
|
|
48
|
+
/** Value font family (attribute: value-font) */
|
|
49
|
+
this.valueFont = 'serif';
|
|
49
50
|
}
|
|
50
51
|
};
|
|
51
52
|
StatCardComponent = __decorate([
|
|
@@ -57,3 +58,10 @@ StatCardComponent = __decorate([
|
|
|
57
58
|
})
|
|
58
59
|
], StatCardComponent);
|
|
59
60
|
export { StatCardComponent };
|
|
61
|
+
// Deprecated quoted kebab-case property aliases (warn once on first write;
|
|
62
|
+
// removed in the next major release).
|
|
63
|
+
defineLegacyAliases(StatCardComponent.prototype, 'ml-stat-card', {
|
|
64
|
+
'trend-direction': 'trendDirection',
|
|
65
|
+
'icon-color': 'iconColor',
|
|
66
|
+
'value-font': 'valueFont'
|
|
67
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html, classMap, when } from '@melodicdev/core';
|
|
2
2
|
export function statCardTemplate(c) {
|
|
3
|
-
const iconStyle = c
|
|
3
|
+
const iconStyle = c.iconColor ? `--ml-stat-card-icon-color: ${c.iconColor}` : '';
|
|
4
4
|
return html `
|
|
5
5
|
<div class="ml-stat-card">
|
|
6
6
|
<div class="ml-stat-card__header">
|
|
@@ -13,13 +13,13 @@ export function statCardTemplate(c) {
|
|
|
13
13
|
</div>
|
|
14
14
|
<div class=${classMap({
|
|
15
15
|
'ml-stat-card__value': true,
|
|
16
|
-
'ml-stat-card__value--serif': c
|
|
17
|
-
'ml-stat-card__value--sans': c
|
|
16
|
+
'ml-stat-card__value--serif': c.valueFont === 'serif',
|
|
17
|
+
'ml-stat-card__value--sans': c.valueFont === 'sans'
|
|
18
18
|
})}>${c.value}</div>
|
|
19
19
|
${when(!!c.trend, () => html `
|
|
20
20
|
<div class=${classMap({
|
|
21
21
|
'ml-stat-card__trend': true,
|
|
22
|
-
[`ml-stat-card__trend--${c
|
|
22
|
+
[`ml-stat-card__trend--${c.trendDirection}`]: true
|
|
23
23
|
})}>${c.trend}</div>
|
|
24
24
|
`)}
|
|
25
25
|
</div>
|
|
@@ -19,7 +19,11 @@ import type { TableColumn, SortDirection } from './table.types.js';
|
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
21
21
|
* @fires ml:sort - Emitted when a sortable column header is clicked. Detail: { key, direction }
|
|
22
|
-
* @fires ml:select - Emitted when row selection changes
|
|
22
|
+
* @fires ml:select - Emitted when row selection changes (including when sorting clears a
|
|
23
|
+
* non-empty selection). Detail: { selectedRows, selectedIndices, allSelected } where
|
|
24
|
+
* `selectedRows` contains the selected row OBJECTS and `selectedIndices` their indices
|
|
25
|
+
* in the original `rows` array (consumer order, independent of the current sort).
|
|
26
|
+
* BREAKING (2.x): `selectedRows` previously contained sorted-order indices.
|
|
23
27
|
* @fires ml:row-click - Emitted when a row is clicked. Detail: { row, index }
|
|
24
28
|
*
|
|
25
29
|
* @slot footer - Content for the table footer area (e.g. pagination)
|
|
@@ -72,14 +76,13 @@ export declare class TableComponent implements IElementRef, OnCreate, OnDestroy,
|
|
|
72
76
|
selectedIndices: number[];
|
|
73
77
|
startIndex: number;
|
|
74
78
|
endIndex: number;
|
|
75
|
-
|
|
76
|
-
private
|
|
79
|
+
/** Shared table pipeline: sorting, selection, ml:* events, virtual window. */
|
|
80
|
+
private _core;
|
|
77
81
|
get rowHeight(): number;
|
|
78
82
|
onPropertyChange(name: string, _oldVal: unknown, _newVal: unknown): void;
|
|
79
83
|
onCreate(): void;
|
|
80
84
|
onRender(): void;
|
|
81
85
|
onDestroy(): void;
|
|
82
|
-
private _attachScroller;
|
|
83
86
|
/** Rows sorted by current sort key/direction */
|
|
84
87
|
get sortedRows(): Record<string, unknown>[];
|
|
85
88
|
get visibleRows(): Record<string, unknown>[];
|
|
@@ -93,6 +96,5 @@ export declare class TableComponent implements IElementRef, OnCreate, OnDestroy,
|
|
|
93
96
|
handleSelectAll: () => void;
|
|
94
97
|
handleSelectRow: (index: number, event: Event) => void;
|
|
95
98
|
handleRowClick: (row: Record<string, unknown>, index: number) => void;
|
|
96
|
-
private emitSelect;
|
|
97
99
|
}
|
|
98
100
|
//# sourceMappingURL=table.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table/table.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"table.component.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table/table.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAMa,cAAe,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB;IAC3F,UAAU,EAAG,WAAW,CAAC;IAEhC;;;;OAIG;IACI,aAAa,UAAS;IAE7B,0CAA0C;IACnC,SAAS,UAAS;IAEzB,kDAAkD;IAC3C,gBAAgB,UAAS;IAEhC,0CAA0C;IACnC,UAAU,UAAS;IAE1B,kCAAkC;IAC3B,OAAO,UAAS;IAEvB,8BAA8B;IACvB,SAAS,UAAQ;IAExB,0BAA0B;IACnB,YAAY,UAAS;IAE5B,iBAAiB;IACV,IAAI,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEhC,yBAAyB;IAClB,UAAU,SAAM;IAEvB,+BAA+B;IACxB,WAAW,SAAM;IAExB,2DAA2D;IACpD,OAAO,UAAS;IAEvB;;;;;OAKG;IACI,UAAU,UAAS;IAE1B,yBAAyB;IAClB,OAAO,EAAE,WAAW,EAAE,CAAM;IAEnC,eAAe;IACR,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAM;IAE5C,kCAAkC;IAC3B,OAAO,SAAM;IAEpB,6BAA6B;IACtB,aAAa,EAAE,aAAa,CAAS;IAE5C,+BAA+B;IACxB,eAAe,EAAE,MAAM,EAAE,CAAM;IAI/B,UAAU,SAAK;IACf,QAAQ,SAAM;IAIrB,8EAA8E;IAC9E,OAAO,CAAC,KAAK,CAGV;IAIH,IAAW,SAAS,IAAI,MAAM,CAE7B;IAIM,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAaxE,QAAQ,IAAI,IAAI;IAUhB,QAAQ,IAAI,IAAI;IAIhB,SAAS,IAAI,IAAI;IAMxB,gDAAgD;IAChD,IAAW,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAGjD;IAED,IAAW,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAElD;IAED,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,kBAAkB,IAAI,MAAM,CAEtC;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,WAAW,IAAI,OAAO,CAEhC;IAED,IAAW,YAAY,IAAI,OAAO,CAEjC;IAEM,aAAa,GAAI,OAAO,MAAM,KAAG,OAAO,CAE7C;IAIK,UAAU,GAAI,QAAQ,WAAW,KAAG,IAAI,CAE7C;IAEK,eAAe,QAAO,IAAI,CAE/B;IAEK,eAAe,GAAI,OAAO,MAAM,EAAE,OAAO,KAAK,KAAG,IAAI,CAE1D;IAEK,cAAc,GAAI,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,MAAM,KAAG,IAAI,CAEzE;CACF"}
|
|
@@ -5,9 +5,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { MelodicComponent } from '@melodicdev/core';
|
|
8
|
+
import { watchSlotPresence } from '../../../functions/index.js';
|
|
8
9
|
import { tableTemplate } from './table.template.js';
|
|
9
10
|
import { tableStyles } from './table.styles.js';
|
|
10
|
-
import {
|
|
11
|
+
import { TableCore } from '../table-core/index.js';
|
|
11
12
|
/**
|
|
12
13
|
* ml-table - Data table with sorting, selection, and custom cell rendering
|
|
13
14
|
*
|
|
@@ -27,7 +28,11 @@ import { VirtualScroller } from '../../../utils/virtual-scroll/index.js';
|
|
|
27
28
|
* ```
|
|
28
29
|
*
|
|
29
30
|
* @fires ml:sort - Emitted when a sortable column header is clicked. Detail: { key, direction }
|
|
30
|
-
* @fires ml:select - Emitted when row selection changes
|
|
31
|
+
* @fires ml:select - Emitted when row selection changes (including when sorting clears a
|
|
32
|
+
* non-empty selection). Detail: { selectedRows, selectedIndices, allSelected } where
|
|
33
|
+
* `selectedRows` contains the selected row OBJECTS and `selectedIndices` their indices
|
|
34
|
+
* in the original `rows` array (consumer order, independent of the current sort).
|
|
35
|
+
* BREAKING (2.x): `selectedRows` previously contained sorted-order indices.
|
|
31
36
|
* @fires ml:row-click - Emitted when a row is clicked. Detail: { row, index }
|
|
32
37
|
*
|
|
33
38
|
* @slot footer - Content for the table footer area (e.g. pagination)
|
|
@@ -82,55 +87,26 @@ let TableComponent = class TableComponent {
|
|
|
82
87
|
this.startIndex = 0;
|
|
83
88
|
this.endIndex = 50;
|
|
84
89
|
// ── Private ──────────────────────────────────────────────────────────────────
|
|
85
|
-
|
|
86
|
-
this.
|
|
90
|
+
/** Shared table pipeline: sorting, selection, ml:* events, virtual window. */
|
|
91
|
+
this._core = new TableCore(this, {
|
|
92
|
+
viewportSelector: '.ml-table__wrapper',
|
|
93
|
+
displayRows: () => this.sortedRows
|
|
94
|
+
});
|
|
87
95
|
this.isRowSelected = (index) => {
|
|
88
|
-
return this.
|
|
96
|
+
return this._core.isRowSelected(index);
|
|
89
97
|
};
|
|
90
98
|
// ── Event handlers ────────────────────────────────────────────────────────────
|
|
91
99
|
this.handleSort = (column) => {
|
|
92
|
-
|
|
93
|
-
return;
|
|
94
|
-
if (this.sortKey === column.key) {
|
|
95
|
-
this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
this.sortKey = column.key;
|
|
99
|
-
this.sortDirection = 'asc';
|
|
100
|
-
}
|
|
101
|
-
this.selectedIndices = [];
|
|
102
|
-
this._scroller.invalidate();
|
|
103
|
-
this.elementRef.dispatchEvent(new CustomEvent('ml:sort', {
|
|
104
|
-
bubbles: true,
|
|
105
|
-
composed: true,
|
|
106
|
-
detail: { key: this.sortKey, direction: this.sortDirection }
|
|
107
|
-
}));
|
|
100
|
+
this._core.handleSortClick(column);
|
|
108
101
|
};
|
|
109
102
|
this.handleSelectAll = () => {
|
|
110
|
-
|
|
111
|
-
this.selectedIndices = [];
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
this.selectedIndices = this.rows.map((_, i) => i);
|
|
115
|
-
}
|
|
116
|
-
this.emitSelect();
|
|
103
|
+
this._core.toggleSelectAll();
|
|
117
104
|
};
|
|
118
105
|
this.handleSelectRow = (index, event) => {
|
|
119
|
-
|
|
120
|
-
if (this.selectedIndices.includes(index)) {
|
|
121
|
-
this.selectedIndices = this.selectedIndices.filter(i => i !== index);
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
this.selectedIndices = [...this.selectedIndices, index];
|
|
125
|
-
}
|
|
126
|
-
this.emitSelect();
|
|
106
|
+
this._core.toggleSelectRow(index, event);
|
|
127
107
|
};
|
|
128
108
|
this.handleRowClick = (row, index) => {
|
|
129
|
-
this.
|
|
130
|
-
bubbles: true,
|
|
131
|
-
composed: true,
|
|
132
|
-
detail: { row, index }
|
|
133
|
-
}));
|
|
109
|
+
this._core.emitRowClick(row, index);
|
|
134
110
|
};
|
|
135
111
|
}
|
|
136
112
|
// ── Row height by size ────────────────────────────────────────────────────────
|
|
@@ -139,111 +115,58 @@ let TableComponent = class TableComponent {
|
|
|
139
115
|
}
|
|
140
116
|
// ── Lifecycle ─────────────────────────────────────────────────────────────────
|
|
141
117
|
onPropertyChange(name, _oldVal, _newVal) {
|
|
142
|
-
if (name === '
|
|
143
|
-
this.
|
|
118
|
+
if (name === 'columns') {
|
|
119
|
+
this._core.invalidateScroller();
|
|
120
|
+
}
|
|
121
|
+
if (name === 'rows') {
|
|
122
|
+
// Selection is positional; a new dataset invalidates it. Reset silently
|
|
123
|
+
// (the consumer initiated the change) and recompute the virtual window
|
|
124
|
+
// after the new value commits — same behavior as ml-data-grid.
|
|
125
|
+
this._core.handleRowsChange();
|
|
144
126
|
}
|
|
145
127
|
}
|
|
146
128
|
onCreate() {
|
|
147
129
|
const shadow = this.elementRef.shadowRoot;
|
|
148
130
|
if (!shadow)
|
|
149
131
|
return;
|
|
150
|
-
shadow
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
else if (name === 'header-actions') {
|
|
157
|
-
this.hasHeaderActions = slot.assignedNodes().length > 0;
|
|
158
|
-
}
|
|
159
|
-
});
|
|
132
|
+
watchSlotPresence(shadow, (name, hasContent) => {
|
|
133
|
+
if (name === 'footer')
|
|
134
|
+
this.hasFooter = hasContent;
|
|
135
|
+
else if (name === 'header-actions')
|
|
136
|
+
this.hasHeaderActions = hasContent;
|
|
160
137
|
});
|
|
161
|
-
this.
|
|
138
|
+
this._core.attachScroller();
|
|
162
139
|
}
|
|
163
140
|
onRender() {
|
|
164
|
-
this.
|
|
165
|
-
// Compute initial end index when viewport height not yet known
|
|
166
|
-
if (this.virtual && this._viewport && this._viewport.clientHeight === 0 && this.sortedRows.length > 0) {
|
|
167
|
-
const approxEnd = Math.min(this.sortedRows.length, Math.ceil(600 / this.rowHeight) + 6);
|
|
168
|
-
if (approxEnd !== this.endIndex) {
|
|
169
|
-
this.endIndex = approxEnd;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
if (!this.virtual) {
|
|
173
|
-
const total = this.sortedRows.length;
|
|
174
|
-
if (this.endIndex !== total)
|
|
175
|
-
this.endIndex = total;
|
|
176
|
-
}
|
|
141
|
+
this._core.syncRenderWindow();
|
|
177
142
|
}
|
|
178
143
|
onDestroy() {
|
|
179
|
-
this.
|
|
180
|
-
this._viewport = null;
|
|
181
|
-
}
|
|
182
|
-
// ── Private helpers ───────────────────────────────────────────────────────────
|
|
183
|
-
_attachScroller() {
|
|
184
|
-
if (this._viewport)
|
|
185
|
-
return; // already attached
|
|
186
|
-
const shadow = this.elementRef.shadowRoot;
|
|
187
|
-
if (!shadow)
|
|
188
|
-
return;
|
|
189
|
-
this._viewport = shadow.querySelector('.ml-table__wrapper');
|
|
190
|
-
if (!this._viewport)
|
|
191
|
-
return;
|
|
192
|
-
this._scroller.attach(this._viewport, {
|
|
193
|
-
rowHeight: () => this.rowHeight,
|
|
194
|
-
itemCount: () => this.sortedRows.length,
|
|
195
|
-
onUpdate: (start, end) => { this.startIndex = start; this.endIndex = end; },
|
|
196
|
-
enabled: () => this.virtual,
|
|
197
|
-
});
|
|
144
|
+
this._core.detach();
|
|
198
145
|
}
|
|
199
146
|
// ── Data ──────────────────────────────────────────────────────────────────────
|
|
200
147
|
/** Rows sorted by current sort key/direction */
|
|
201
148
|
get sortedRows() {
|
|
202
|
-
if (this.manualSort
|
|
149
|
+
if (this.manualSort)
|
|
203
150
|
return this.rows;
|
|
204
|
-
|
|
205
|
-
const dir = this.sortDirection === 'asc' ? 1 : -1;
|
|
206
|
-
return [...this.rows].sort((a, b) => {
|
|
207
|
-
const aVal = a[key];
|
|
208
|
-
const bVal = b[key];
|
|
209
|
-
if (aVal === undefined || aVal === null) {
|
|
210
|
-
return (bVal === undefined || bVal === null) ? 0 : 1;
|
|
211
|
-
}
|
|
212
|
-
if (bVal === undefined || bVal === null)
|
|
213
|
-
return -1;
|
|
214
|
-
if (typeof aVal === 'number' && typeof bVal === 'number')
|
|
215
|
-
return (aVal - bVal) * dir;
|
|
216
|
-
return String(aVal).localeCompare(String(bVal)) * dir;
|
|
217
|
-
});
|
|
151
|
+
return this._core.sortRows(this.rows);
|
|
218
152
|
}
|
|
219
153
|
get visibleRows() {
|
|
220
|
-
|
|
221
|
-
return this.sortedRows;
|
|
222
|
-
return this.sortedRows.slice(this.startIndex, this.endIndex);
|
|
154
|
+
return this._core.visibleRows;
|
|
223
155
|
}
|
|
224
156
|
get topSpacerHeight() {
|
|
225
|
-
return this.
|
|
157
|
+
return this._core.topSpacerHeight;
|
|
226
158
|
}
|
|
227
159
|
get bottomSpacerHeight() {
|
|
228
|
-
|
|
229
|
-
return 0;
|
|
230
|
-
return Math.max(0, (this.sortedRows.length - this.endIndex) * this.rowHeight);
|
|
160
|
+
return this._core.bottomSpacerHeight;
|
|
231
161
|
}
|
|
232
162
|
get colCount() {
|
|
233
163
|
return this.columns.length + (this.selectable ? 1 : 0);
|
|
234
164
|
}
|
|
235
165
|
get allSelected() {
|
|
236
|
-
return this.
|
|
166
|
+
return this._core.allSelected;
|
|
237
167
|
}
|
|
238
168
|
get someSelected() {
|
|
239
|
-
return this.
|
|
240
|
-
}
|
|
241
|
-
emitSelect() {
|
|
242
|
-
this.elementRef.dispatchEvent(new CustomEvent('ml:select', {
|
|
243
|
-
bubbles: true,
|
|
244
|
-
composed: true,
|
|
245
|
-
detail: { selectedRows: this.selectedIndices, allSelected: this.allSelected }
|
|
246
|
-
}));
|
|
169
|
+
return this._core.someSelected;
|
|
247
170
|
}
|
|
248
171
|
};
|
|
249
172
|
TableComponent = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table/table.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"table.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table/table.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,iDAoTvB,CAAC"}
|
|
@@ -177,13 +177,16 @@ export const tableStyles = () => css `
|
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
/* ── Body rows ── */
|
|
180
|
+
/* Divider rendered as an inset box-shadow (not border-bottom) so it never
|
|
181
|
+
participates in layout — hover/selected/striped state changes can't
|
|
182
|
+
collapse it and shift rows below by 1px. */
|
|
180
183
|
.ml-table__row {
|
|
181
|
-
|
|
184
|
+
box-shadow: inset 0 calc(-1 * var(--ml-table-divider-width)) 0 var(--ml-table-divider-color);
|
|
182
185
|
transition: background-color var(--ml-duration-150) var(--ml-ease-in-out);
|
|
183
186
|
}
|
|
184
187
|
|
|
185
188
|
.ml-table__row:last-child {
|
|
186
|
-
|
|
189
|
+
box-shadow: none;
|
|
187
190
|
}
|
|
188
191
|
|
|
189
192
|
.ml-table--hoverable .ml-table__row:hover {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.template.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table/table.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"table.template.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table/table.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAI3D,wBAAgB,aAAa,CAAC,CAAC,EAAE,cAAc,6CA+H9C"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { html, classMap, when, repeat } from '@melodicdev/core';
|
|
2
|
-
|
|
3
|
-
if (column.render) {
|
|
4
|
-
return column.render(row[column.key], row, index);
|
|
5
|
-
}
|
|
6
|
-
return row[column.key] ?? '';
|
|
7
|
-
}
|
|
2
|
+
import { renderCell } from '../table-core/index.js';
|
|
8
3
|
export function tableTemplate(c) {
|
|
9
4
|
return html `
|
|
10
5
|
<div class=${classMap({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/table-core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACxD,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|