@melodicdev/components 3.1.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/melodic-components.js +8081 -5910
- package/assets/melodic-components.js.map +1 -1
- package/assets/melodic-components.min.js +9250 -7326
- 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 +83 -78
- package/lib/components/data-display/activity-feed/activity-feed.styles.d.ts.map +1 -1
- package/lib/components/data-display/activity-feed/activity-feed.styles.js +10 -5
- package/lib/components/data-display/avatar/avatar.styles.d.ts.map +1 -1
- package/lib/components/data-display/avatar/avatar.styles.js +23 -18
- package/lib/components/data-display/badge/badge.styles.d.ts.map +1 -1
- package/lib/components/data-display/badge/badge.styles.js +54 -48
- package/lib/components/data-display/badge-group/badge-group.styles.d.ts.map +1 -1
- package/lib/components/data-display/badge-group/badge-group.styles.js +34 -29
- package/lib/components/data-display/calendar-view/calendar-view-month.template.d.ts.map +1 -1
- package/lib/components/data-display/calendar-view/calendar-view-month.template.js +17 -0
- package/lib/components/data-display/calendar-view/calendar-view.component.d.ts +23 -3
- package/lib/components/data-display/calendar-view/calendar-view.component.d.ts.map +1 -1
- package/lib/components/data-display/calendar-view/calendar-view.component.js +76 -21
- package/lib/components/data-display/calendar-view/calendar-view.styles.d.ts.map +1 -1
- package/lib/components/data-display/calendar-view/calendar-view.styles.js +160 -155
- package/lib/components/data-display/calendar-view/calendar-view.utils.d.ts +9 -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 +68 -19
- package/lib/components/data-display/data-grid/data-grid.component.d.ts +24 -0
- 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 +104 -31
- package/lib/components/data-display/data-grid/data-grid.styles.d.ts.map +1 -1
- package/lib/components/data-display/data-grid/data-grid.styles.js +122 -117
- 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 +3 -0
- package/lib/components/data-display/list/list-item.styles.d.ts.map +1 -1
- package/lib/components/data-display/list/list-item.styles.js +39 -34
- package/lib/components/data-display/list/list.styles.d.ts.map +1 -1
- package/lib/components/data-display/list/list.styles.js +10 -5
- package/lib/components/data-display/profile-card/profile-card.styles.d.ts.map +1 -1
- package/lib/components/data-display/profile-card/profile-card.styles.js +71 -66
- package/lib/components/data-display/stat-card/stat-card.styles.d.ts.map +1 -1
- package/lib/components/data-display/stat-card/stat-card.styles.js +67 -63
- package/lib/components/data-display/table/table.component.d.ts +7 -0
- package/lib/components/data-display/table/table.component.d.ts.map +1 -1
- package/lib/components/data-display/table/table.component.js +20 -5
- package/lib/components/data-display/table/table.styles.d.ts.map +1 -1
- package/lib/components/data-display/table/table.styles.js +94 -89
- package/lib/components/data-display/table/table.template.d.ts.map +1 -1
- package/lib/components/data-display/table/table.template.js +3 -0
- package/lib/components/data-display/table-core/index.d.ts +1 -0
- package/lib/components/data-display/table-core/index.d.ts.map +1 -1
- package/lib/components/data-display/table-core/index.js +1 -0
- package/lib/components/data-display/table-core/memo.d.ts +10 -0
- package/lib/components/data-display/table-core/memo.d.ts.map +1 -0
- package/lib/components/data-display/table-core/memo.js +20 -0
- package/lib/components/data-display/tag/tag.styles.d.ts.map +1 -1
- package/lib/components/data-display/tag/tag.styles.js +67 -62
- package/lib/components/feedback/alert/alert.styles.d.ts.map +1 -1
- package/lib/components/feedback/alert/alert.styles.js +83 -56
- package/lib/components/feedback/progress/progress.styles.d.ts.map +1 -1
- package/lib/components/feedback/progress/progress.styles.js +110 -101
- package/lib/components/feedback/spinner/spinner.styles.d.ts.map +1 -1
- package/lib/components/feedback/spinner/spinner.styles.js +20 -24
- package/lib/components/feedback/toast/toast-container.template.d.ts.map +1 -1
- package/lib/components/feedback/toast/toast-container.template.js +4 -0
- package/lib/components/feedback/toast/toast.component.d.ts +3 -2
- package/lib/components/feedback/toast/toast.component.d.ts.map +1 -1
- package/lib/components/feedback/toast/toast.component.js +10 -0
- package/lib/components/feedback/toast/toast.service.d.ts +26 -6
- package/lib/components/feedback/toast/toast.service.d.ts.map +1 -1
- package/lib/components/feedback/toast/toast.service.js +53 -18
- package/lib/components/feedback/toast/toast.styles.d.ts.map +1 -1
- package/lib/components/feedback/toast/toast.styles.js +74 -69
- package/lib/components/feedback/toast/toast.template.js +1 -1
- package/lib/components/forms/autocomplete/autocomplete.component.d.ts +7 -0
- package/lib/components/forms/autocomplete/autocomplete.component.d.ts.map +1 -1
- package/lib/components/forms/autocomplete/autocomplete.component.js +39 -0
- package/lib/components/forms/autocomplete/autocomplete.styles.d.ts.map +1 -1
- package/lib/components/forms/autocomplete/autocomplete.styles.js +169 -164
- package/lib/components/forms/autocomplete/autocomplete.template.d.ts.map +1 -1
- package/lib/components/forms/autocomplete/autocomplete.template.js +5 -1
- package/lib/components/forms/button/button.styles.d.ts.map +1 -1
- package/lib/components/forms/button/button.styles.js +62 -57
- package/lib/components/forms/button-group/button-group.component.d.ts +3 -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 +11 -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 +23 -18
- package/lib/components/forms/checkbox/checkbox.component.d.ts +4 -0
- package/lib/components/forms/checkbox/checkbox.component.d.ts.map +1 -1
- package/lib/components/forms/checkbox/checkbox.component.js +5 -1
- package/lib/components/forms/checkbox/checkbox.styles.d.ts.map +1 -1
- package/lib/components/forms/checkbox/checkbox.styles.js +83 -78
- package/lib/components/forms/checkbox/checkbox.template.d.ts.map +1 -1
- package/lib/components/forms/checkbox/checkbox.template.js +2 -0
- package/lib/components/forms/date-picker/calendar.component.d.ts +21 -0
- package/lib/components/forms/date-picker/calendar.component.d.ts.map +1 -1
- package/lib/components/forms/date-picker/calendar.component.js +69 -2
- package/lib/components/forms/date-picker/calendar.styles.d.ts.map +1 -1
- package/lib/components/forms/date-picker/calendar.styles.js +152 -147
- package/lib/components/forms/date-picker/calendar.template.d.ts.map +1 -1
- package/lib/components/forms/date-picker/calendar.template.js +6 -3
- package/lib/components/forms/date-picker/date-picker.component.d.ts +6 -0
- package/lib/components/forms/date-picker/date-picker.component.d.ts.map +1 -1
- package/lib/components/forms/date-picker/date-picker.component.js +41 -12
- package/lib/components/forms/date-picker/date-picker.styles.d.ts.map +1 -1
- package/lib/components/forms/date-picker/date-picker.styles.js +97 -91
- package/lib/components/forms/date-time-picker/date-time-picker.styles.d.ts.map +1 -1
- package/lib/components/forms/date-time-picker/date-time-picker.styles.js +87 -82
- package/lib/components/forms/file-upload/file-upload.component.d.ts.map +1 -1
- package/lib/components/forms/file-upload/file-upload.component.js +15 -5
- package/lib/components/forms/file-upload/file-upload.styles.d.ts.map +1 -1
- package/lib/components/forms/file-upload/file-upload.styles.js +97 -92
- package/lib/components/forms/form-field/form-field.component.d.ts +8 -0
- package/lib/components/forms/form-field/form-field.component.d.ts.map +1 -1
- package/lib/components/forms/form-field/form-field.component.js +41 -6
- package/lib/components/forms/form-field/form-field.styles.d.ts.map +1 -1
- package/lib/components/forms/form-field/form-field.styles.js +77 -72
- package/lib/components/forms/form-field/form-field.template.js +1 -1
- package/lib/components/forms/input/input.component.d.ts +26 -3
- package/lib/components/forms/input/input.component.d.ts.map +1 -1
- package/lib/components/forms/input/input.component.js +46 -6
- package/lib/components/forms/input/input.styles.d.ts.map +1 -1
- package/lib/components/forms/input/input.styles.js +86 -81
- package/lib/components/forms/input/input.template.d.ts.map +1 -1
- package/lib/components/forms/input/input.template.js +9 -0
- package/lib/components/forms/radio/radio.styles.d.ts.map +1 -1
- package/lib/components/forms/radio/radio.styles.js +78 -73
- package/lib/components/forms/radio-card-group/radio-card-group.component.d.ts +6 -0
- package/lib/components/forms/radio-card-group/radio-card-group.component.d.ts.map +1 -1
- package/lib/components/forms/radio-card-group/radio-card-group.component.js +34 -0
- package/lib/components/forms/radio-card-group/radio-card-group.styles.d.ts.map +1 -1
- package/lib/components/forms/radio-card-group/radio-card-group.styles.js +39 -34
- package/lib/components/forms/radio-card-group/radio-card.component.d.ts +6 -0
- package/lib/components/forms/radio-card-group/radio-card.component.d.ts.map +1 -1
- package/lib/components/forms/radio-card-group/radio-card.component.js +7 -1
- package/lib/components/forms/radio-card-group/radio-card.styles.d.ts.map +1 -1
- package/lib/components/forms/radio-card-group/radio-card.styles.js +113 -108
- package/lib/components/forms/radio-card-group/radio-card.template.js +1 -1
- package/lib/components/forms/select/select.component.d.ts.map +1 -1
- package/lib/components/forms/select/select.component.js +13 -1
- package/lib/components/forms/select/select.styles.d.ts.map +1 -1
- package/lib/components/forms/select/select.styles.js +158 -153
- package/lib/components/forms/select/select.template.d.ts.map +1 -1
- package/lib/components/forms/select/select.template.js +5 -1
- package/lib/components/forms/slider/slider.styles.d.ts.map +1 -1
- package/lib/components/forms/slider/slider.styles.js +82 -77
- package/lib/components/forms/textarea/textarea.component.d.ts +10 -3
- package/lib/components/forms/textarea/textarea.component.d.ts.map +1 -1
- package/lib/components/forms/textarea/textarea.component.js +10 -5
- package/lib/components/forms/textarea/textarea.styles.d.ts.map +1 -1
- package/lib/components/forms/textarea/textarea.styles.js +84 -79
- package/lib/components/forms/textarea/textarea.template.d.ts.map +1 -1
- package/lib/components/forms/textarea/textarea.template.js +2 -0
- package/lib/components/forms/time-picker/time-picker.component.d.ts +16 -0
- package/lib/components/forms/time-picker/time-picker.component.d.ts.map +1 -1
- package/lib/components/forms/time-picker/time-picker.component.js +43 -3
- package/lib/components/forms/time-picker/time-picker.styles.d.ts.map +1 -1
- package/lib/components/forms/time-picker/time-picker.styles.js +197 -191
- package/lib/components/forms/toggle/toggle.styles.d.ts.map +1 -1
- package/lib/components/forms/toggle/toggle.styles.js +84 -79
- package/lib/components/foundation/card/card.styles.d.ts.map +1 -1
- package/lib/components/foundation/card/card.styles.js +51 -46
- package/lib/components/foundation/container/container.component.js +5 -5
- package/lib/components/foundation/container/container.styles.d.ts.map +1 -1
- package/lib/components/foundation/container/container.styles.js +15 -0
- package/lib/components/foundation/divider/divider.styles.d.ts.map +1 -1
- package/lib/components/foundation/divider/divider.styles.js +29 -24
- package/lib/components/foundation/stack/stack.component.d.ts +6 -0
- package/lib/components/foundation/stack/stack.component.d.ts.map +1 -1
- package/lib/components/foundation/stack/stack.component.js +11 -5
- package/lib/components/foundation/stack/stack.styles.d.ts.map +1 -1
- package/lib/components/foundation/stack/stack.styles.js +20 -0
- package/lib/components/general/icon/icon.styles.d.ts.map +1 -1
- package/lib/components/general/icon/icon.styles.js +12 -8
- package/lib/components/general/icon/icon.template.d.ts.map +1 -1
- package/lib/components/general/icon/icon.template.js +7 -1
- package/lib/components/navigation/breadcrumb/breadcrumb-item.template.d.ts.map +1 -1
- package/lib/components/navigation/breadcrumb/breadcrumb-item.template.js +2 -1
- package/lib/components/navigation/breadcrumb/breadcrumb.styles.d.ts.map +1 -1
- package/lib/components/navigation/breadcrumb/breadcrumb.styles.js +9 -4
- package/lib/components/navigation/functions/match-by-route.function.d.ts +16 -0
- package/lib/components/navigation/functions/match-by-route.function.d.ts.map +1 -0
- package/lib/components/navigation/functions/match-by-route.function.js +34 -0
- package/lib/components/navigation/functions/route-link.function.d.ts +20 -0
- package/lib/components/navigation/functions/route-link.function.d.ts.map +1 -0
- package/lib/components/navigation/functions/route-link.function.js +34 -0
- package/lib/components/navigation/pagination/pagination.component.d.ts +8 -0
- package/lib/components/navigation/pagination/pagination.component.d.ts.map +1 -1
- package/lib/components/navigation/pagination/pagination.component.js +12 -2
- package/lib/components/navigation/pagination/pagination.styles.d.ts.map +1 -1
- package/lib/components/navigation/pagination/pagination.styles.js +77 -62
- package/lib/components/navigation/pagination/pagination.template.js +2 -2
- package/lib/components/navigation/sidebar/sidebar-group.styles.d.ts.map +1 -1
- package/lib/components/navigation/sidebar/sidebar-group.styles.js +23 -18
- package/lib/components/navigation/sidebar/sidebar-item.styles.d.ts.map +1 -1
- package/lib/components/navigation/sidebar/sidebar-item.styles.js +104 -99
- package/lib/components/navigation/sidebar/sidebar-item.template.d.ts.map +1 -1
- package/lib/components/navigation/sidebar/sidebar-item.template.js +5 -1
- package/lib/components/navigation/sidebar/sidebar.component.d.ts +12 -6
- package/lib/components/navigation/sidebar/sidebar.component.d.ts.map +1 -1
- package/lib/components/navigation/sidebar/sidebar.component.js +20 -12
- package/lib/components/navigation/sidebar/sidebar.styles.d.ts.map +1 -1
- package/lib/components/navigation/sidebar/sidebar.styles.js +179 -174
- package/lib/components/navigation/sidebar/sidebar.template.d.ts.map +1 -1
- package/lib/components/navigation/sidebar/sidebar.template.js +5 -1
- package/lib/components/navigation/steps/step.component.d.ts.map +1 -1
- package/lib/components/navigation/steps/step.component.js +19 -1
- package/lib/components/navigation/steps/step.styles.d.ts.map +1 -1
- package/lib/components/navigation/steps/step.styles.js +154 -149
- package/lib/components/navigation/steps/step.template.d.ts.map +1 -1
- package/lib/components/navigation/steps/step.template.js +6 -0
- package/lib/components/navigation/steps/steps.component.d.ts +10 -0
- package/lib/components/navigation/steps/steps.component.d.ts.map +1 -1
- package/lib/components/navigation/steps/steps.component.js +42 -9
- package/lib/components/navigation/steps/steps.styles.d.ts.map +1 -1
- package/lib/components/navigation/steps/steps.styles.js +174 -169
- package/lib/components/navigation/steps/steps.template.js +9 -0
- package/lib/components/navigation/tabs/tab-panel.styles.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tab-panel.styles.js +12 -2
- package/lib/components/navigation/tabs/tab.styles.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tab.styles.js +41 -36
- package/lib/components/navigation/tabs/tabs.component.d.ts +10 -0
- package/lib/components/navigation/tabs/tabs.component.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tabs.component.js +36 -7
- package/lib/components/navigation/tabs/tabs.styles.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tabs.styles.js +131 -126
- package/lib/components/overlays/dialog/dialog-ref.class.d.ts +19 -9
- package/lib/components/overlays/dialog/dialog-ref.class.d.ts.map +1 -1
- package/lib/components/overlays/dialog/dialog-ref.class.js +37 -5
- package/lib/components/overlays/dialog/dialog.styles.d.ts.map +1 -1
- package/lib/components/overlays/dialog/dialog.styles.js +78 -73
- package/lib/components/overlays/drawer/drawer.styles.d.ts.map +1 -1
- package/lib/components/overlays/drawer/drawer.styles.js +82 -77
- package/lib/components/overlays/dropdown/dropdown-item.styles.d.ts.map +1 -1
- package/lib/components/overlays/dropdown/dropdown-item.styles.js +48 -43
- package/lib/components/overlays/dropdown/dropdown.component.d.ts +7 -0
- package/lib/components/overlays/dropdown/dropdown.component.d.ts.map +1 -1
- package/lib/components/overlays/dropdown/dropdown.component.js +26 -11
- package/lib/components/overlays/dropdown/dropdown.styles.d.ts.map +1 -1
- package/lib/components/overlays/dropdown/dropdown.styles.js +35 -30
- package/lib/components/overlays/popover/popover.component.d.ts +8 -0
- package/lib/components/overlays/popover/popover.component.d.ts.map +1 -1
- package/lib/components/overlays/popover/popover.component.js +17 -0
- package/lib/components/overlays/popover/popover.styles.d.ts.map +1 -1
- package/lib/components/overlays/popover/popover.styles.js +36 -31
- package/lib/components/overlays/tooltip/tooltip.component.d.ts +6 -5
- package/lib/components/overlays/tooltip/tooltip.component.d.ts.map +1 -1
- package/lib/components/overlays/tooltip/tooltip.component.js +14 -10
- package/lib/components/overlays/tooltip/tooltip.styles.d.ts.map +1 -1
- package/lib/components/overlays/tooltip/tooltip.styles.js +34 -28
- package/lib/components/pages/auth/auth-layout.styles.d.ts +1 -1
- package/lib/components/pages/auth/auth-layout.styles.d.ts.map +1 -1
- package/lib/components/pages/auth/auth-layout.styles.js +86 -81
- package/lib/components/pages/dashboard/dashboard-page.styles.d.ts.map +1 -1
- package/lib/components/pages/dashboard/dashboard-page.styles.js +39 -34
- package/lib/components/sections/app-shell/app-shell.component.d.ts +13 -0
- package/lib/components/sections/app-shell/app-shell.component.d.ts.map +1 -1
- package/lib/components/sections/app-shell/app-shell.component.js +45 -1
- package/lib/components/sections/app-shell/app-shell.styles.d.ts.map +1 -1
- package/lib/components/sections/app-shell/app-shell.styles.js +74 -53
- package/lib/components/sections/app-shell/app-shell.template.d.ts.map +1 -1
- package/lib/components/sections/app-shell/app-shell.template.js +5 -0
- package/lib/components/sections/hero/hero-section.styles.js +97 -97
- package/lib/components/sections/page-header/page-header.styles.d.ts.map +1 -1
- package/lib/components/sections/page-header/page-header.styles.js +69 -64
- package/lib/components/sections/page-section/page-section.styles.d.ts.map +1 -1
- package/lib/components/sections/page-section/page-section.styles.js +56 -51
- package/lib/components/sections/page-section/page-section.template.d.ts.map +1 -1
- package/lib/components/sections/page-section/page-section.template.js +6 -1
- package/lib/directives/tooltip.directive.d.ts.map +1 -1
- package/lib/directives/tooltip.directive.js +39 -6
- package/lib/theme/functions/apply-theme.function.d.ts +4 -1
- package/lib/theme/functions/apply-theme.function.d.ts.map +1 -1
- package/lib/theme/functions/apply-theme.function.js +20 -4
- package/lib/theme/functions/create-theme.function.js +0 -1
- package/lib/utils/accessibility/cross-root-aria.d.ts +40 -0
- package/lib/utils/accessibility/cross-root-aria.d.ts.map +1 -0
- package/lib/utils/accessibility/cross-root-aria.js +97 -0
- package/lib/utils/accessibility/index.d.ts +1 -0
- package/lib/utils/accessibility/index.d.ts.map +1 -1
- package/lib/utils/accessibility/index.js +1 -0
- package/lib/utils/directives/index.d.ts +1 -0
- package/lib/utils/directives/index.d.ts.map +1 -1
- package/lib/utils/directives/index.js +1 -0
- package/lib/utils/directives/watch-light-slots.d.ts +20 -0
- package/lib/utils/directives/watch-light-slots.d.ts.map +1 -0
- package/lib/utils/directives/watch-light-slots.js +36 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IElementRef, OnCreate } from '@melodicdev/core';
|
|
1
|
+
import type { IElementRef, OnCreate, OnDestroy } from '@melodicdev/core';
|
|
2
2
|
import type { ToastVariant } from './toast-config.interface.js';
|
|
3
3
|
/**
|
|
4
4
|
* ml-toast - Individual toast notification
|
|
@@ -10,7 +10,7 @@ import type { ToastVariant } from './toast-config.interface.js';
|
|
|
10
10
|
*
|
|
11
11
|
* @fires ml:dismiss - Emitted when the toast is dismissed
|
|
12
12
|
*/
|
|
13
|
-
export declare class ToastComponent implements IElementRef, OnCreate {
|
|
13
|
+
export declare class ToastComponent implements IElementRef, OnCreate, OnDestroy {
|
|
14
14
|
elementRef: HTMLElement;
|
|
15
15
|
/** Toast variant */
|
|
16
16
|
variant: ToastVariant;
|
|
@@ -27,6 +27,7 @@ export declare class ToastComponent implements IElementRef, OnCreate {
|
|
|
27
27
|
get title(): string;
|
|
28
28
|
set title(value: string);
|
|
29
29
|
onCreate(): void;
|
|
30
|
+
onDestroy(): void;
|
|
30
31
|
dismiss: () => void;
|
|
31
32
|
renderIcon: () => import("@melodicdev/core").TemplateResult;
|
|
32
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.component.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/toast/toast.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"toast.component.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/toast/toast.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAKhE;;;;;;;;;GASG;AACH,qBAMa,cAAe,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS;IAC/D,UAAU,EAAG,WAAW,CAAC;IAEhC,oBAAoB;IACb,OAAO,EAAE,YAAY,CAAU;IAEtC,2CAA2C;IACpC,UAAU,SAAM;IAEvB,oBAAoB;IACb,OAAO,SAAM;IAEpB,wDAAwD;IACjD,QAAQ,SAAQ;IAEvB,0BAA0B;IACnB,WAAW,UAAQ;IAE1B,OAAO,CAAC,MAAM,CAA8C;IAE5D,+GAA+G;IAC/G,IAAW,KAAK,IAAI,MAAM,CAEzB;IACD,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAG7B;IAEM,QAAQ,IAAI,IAAI;IAMhB,SAAS,IAAI,IAAI;IAWjB,OAAO,QAAO,IAAI,CAcvB;IAEK,UAAU,kDASf;CACF"}
|
|
@@ -65,6 +65,16 @@ let ToastComponent = class ToastComponent {
|
|
|
65
65
|
this._timer = setTimeout(() => this.dismiss(), this.duration);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
+
onDestroy() {
|
|
69
|
+
// A toast removed before its timer fires (dismissAll, a route change,
|
|
70
|
+
// the container being torn down) left the timer armed; it then ran
|
|
71
|
+
// dismiss() on a detached element and kept the component alive until
|
|
72
|
+
// it fired.
|
|
73
|
+
if (this._timer) {
|
|
74
|
+
clearTimeout(this._timer);
|
|
75
|
+
this._timer = null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
68
78
|
};
|
|
69
79
|
ToastComponent = __decorate([
|
|
70
80
|
MelodicComponent({
|
|
@@ -12,21 +12,41 @@ import type { IToastConfig, ToastPosition } from './toast-config.interface.js';
|
|
|
12
12
|
* this._toastService.show({ variant: 'warning', title: 'Warning', message: '...' });
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
|
+
/** Handle to a shown toast, so the caller can dismiss it early. */
|
|
16
|
+
export interface IToastRef {
|
|
17
|
+
/** Remove the toast now. Safe to call more than once. */
|
|
18
|
+
dismiss(): void;
|
|
19
|
+
/** The toast element, for consumers that need to reach into it. */
|
|
20
|
+
readonly element: HTMLElement;
|
|
21
|
+
}
|
|
15
22
|
export declare class ToastService {
|
|
16
23
|
private _containerEl;
|
|
17
24
|
private _position;
|
|
25
|
+
/** Toasts currently on screen, oldest first. */
|
|
26
|
+
private readonly _active;
|
|
27
|
+
private _maxVisible;
|
|
28
|
+
/**
|
|
29
|
+
* Cap the number of toasts on screen at once (default 5, 0 = unlimited).
|
|
30
|
+
* Without a cap, a failing poll could stack hundreds of toasts over the
|
|
31
|
+
* whole viewport.
|
|
32
|
+
*/
|
|
33
|
+
setMaxVisible(max: number): void;
|
|
18
34
|
/** Set the default position for all toasts */
|
|
19
35
|
setPosition(position: ToastPosition): void;
|
|
20
|
-
/** Show a toast with full configuration */
|
|
21
|
-
show(config: IToastConfig):
|
|
36
|
+
/** Show a toast with full configuration. Returns a handle for dismissing it. */
|
|
37
|
+
show(config: IToastConfig): IToastRef;
|
|
22
38
|
/** Show an info toast */
|
|
23
|
-
info(title: string, message?: string):
|
|
39
|
+
info(title: string, message?: string): IToastRef;
|
|
24
40
|
/** Show a success toast */
|
|
25
|
-
success(title: string, message?: string):
|
|
41
|
+
success(title: string, message?: string): IToastRef;
|
|
26
42
|
/** Show a warning toast */
|
|
27
|
-
warning(title: string, message?: string):
|
|
43
|
+
warning(title: string, message?: string): IToastRef;
|
|
28
44
|
/** Show an error toast */
|
|
29
|
-
error(title: string, message?: string):
|
|
45
|
+
error(title: string, message?: string): IToastRef;
|
|
46
|
+
/** Remove every toast currently on screen. */
|
|
47
|
+
dismissAll(): void;
|
|
48
|
+
private forget;
|
|
49
|
+
private enforceMaxVisible;
|
|
30
50
|
private ensureContainer;
|
|
31
51
|
}
|
|
32
52
|
//# sourceMappingURL=toast.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.service.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/toast/toast.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE/E;;;;;;;;;;;;GAYG;AACH,qBACa,YAAY;IACxB,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,SAAS,CAA8B;
|
|
1
|
+
{"version":3,"file":"toast.service.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/toast/toast.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE/E;;;;;;;;;;;;GAYG;AACH,mEAAmE;AACnE,MAAM,WAAW,SAAS;IACzB,yDAAyD;IACzD,OAAO,IAAI,IAAI,CAAC;IAChB,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;CAC9B;AAED,qBACa,YAAY;IACxB,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,SAAS,CAA8B;IAC/C,gDAAgD;IAChD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,WAAW,CAAK;IAExB;;;;OAIG;IACI,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAKvC,8CAA8C;IACvC,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAQjD,gFAAgF;IACzE,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS;IA8B5C,yBAAyB;IAClB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS;IAIvD,2BAA2B;IACpB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS;IAI1D,2BAA2B;IACpB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS;IAI1D,0BAA0B;IACnB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS;IAIxD,8CAA8C;IACvC,UAAU,IAAI,IAAI;IAOzB,OAAO,CAAC,MAAM;IAOd,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,eAAe;CAWvB"}
|
|
@@ -5,23 +5,22 @@ 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 { Injectable } from '@melodicdev/core';
|
|
8
|
-
/**
|
|
9
|
-
* ToastService - Injectable singleton for showing toast notifications from anywhere
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* @Service(ToastService)
|
|
14
|
-
* private readonly _toastService!: ToastService;
|
|
15
|
-
*
|
|
16
|
-
* this._toastService.success('Saved', 'Your changes have been saved.');
|
|
17
|
-
* this._toastService.error('Error', 'Something went wrong.');
|
|
18
|
-
* this._toastService.show({ variant: 'warning', title: 'Warning', message: '...' });
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
8
|
let ToastService = class ToastService {
|
|
22
9
|
constructor() {
|
|
23
10
|
this._containerEl = null;
|
|
24
11
|
this._position = 'top-right';
|
|
12
|
+
/** Toasts currently on screen, oldest first. */
|
|
13
|
+
this._active = [];
|
|
14
|
+
this._maxVisible = 5;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Cap the number of toasts on screen at once (default 5, 0 = unlimited).
|
|
18
|
+
* Without a cap, a failing poll could stack hundreds of toasts over the
|
|
19
|
+
* whole viewport.
|
|
20
|
+
*/
|
|
21
|
+
setMaxVisible(max) {
|
|
22
|
+
this._maxVisible = Math.max(0, max);
|
|
23
|
+
this.enforceMaxVisible();
|
|
25
24
|
}
|
|
26
25
|
/** Set the default position for all toasts */
|
|
27
26
|
setPosition(position) {
|
|
@@ -30,7 +29,7 @@ let ToastService = class ToastService {
|
|
|
30
29
|
this._containerEl.setAttribute('position', position);
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
|
-
/** Show a toast with full configuration */
|
|
32
|
+
/** Show a toast with full configuration. Returns a handle for dismissing it. */
|
|
34
33
|
show(config) {
|
|
35
34
|
const container = this.ensureContainer();
|
|
36
35
|
const toast = document.createElement('ml-toast');
|
|
@@ -45,23 +44,59 @@ let ToastService = class ToastService {
|
|
|
45
44
|
toast.setAttribute('duration', String(config.duration));
|
|
46
45
|
if (config.dismissible === false)
|
|
47
46
|
toast.setAttribute('dismissible', 'false');
|
|
47
|
+
// An error toast is assertive; anything else is polite, so a success
|
|
48
|
+
// message does not interrupt what the user is reading. Every toast used
|
|
49
|
+
// to be role="alert", which interrupts.
|
|
50
|
+
toast.setAttribute('role', config.variant === 'error' ? 'alert' : 'status');
|
|
48
51
|
container.appendChild(toast);
|
|
52
|
+
this._active.push(toast);
|
|
53
|
+
toast.addEventListener('ml:dismiss', () => this.forget(toast), { once: true });
|
|
54
|
+
this.enforceMaxVisible();
|
|
55
|
+
return {
|
|
56
|
+
element: toast,
|
|
57
|
+
dismiss: () => {
|
|
58
|
+
this.forget(toast);
|
|
59
|
+
toast.remove();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
49
62
|
}
|
|
50
63
|
/** Show an info toast */
|
|
51
64
|
info(title, message) {
|
|
52
|
-
this.show({ variant: 'info', title, message });
|
|
65
|
+
return this.show({ variant: 'info', title, message });
|
|
53
66
|
}
|
|
54
67
|
/** Show a success toast */
|
|
55
68
|
success(title, message) {
|
|
56
|
-
this.show({ variant: 'success', title, message });
|
|
69
|
+
return this.show({ variant: 'success', title, message });
|
|
57
70
|
}
|
|
58
71
|
/** Show a warning toast */
|
|
59
72
|
warning(title, message) {
|
|
60
|
-
this.show({ variant: 'warning', title, message });
|
|
73
|
+
return this.show({ variant: 'warning', title, message });
|
|
61
74
|
}
|
|
62
75
|
/** Show an error toast */
|
|
63
76
|
error(title, message) {
|
|
64
|
-
this.show({ variant: 'error', title, message });
|
|
77
|
+
return this.show({ variant: 'error', title, message });
|
|
78
|
+
}
|
|
79
|
+
/** Remove every toast currently on screen. */
|
|
80
|
+
dismissAll() {
|
|
81
|
+
for (const toast of [...this._active]) {
|
|
82
|
+
toast.remove();
|
|
83
|
+
}
|
|
84
|
+
this._active.length = 0;
|
|
85
|
+
}
|
|
86
|
+
forget(toast) {
|
|
87
|
+
const index = this._active.indexOf(toast);
|
|
88
|
+
if (index !== -1) {
|
|
89
|
+
this._active.splice(index, 1);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
enforceMaxVisible() {
|
|
93
|
+
if (this._maxVisible === 0) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
while (this._active.length > this._maxVisible) {
|
|
97
|
+
const oldest = this._active.shift();
|
|
98
|
+
oldest?.remove();
|
|
99
|
+
}
|
|
65
100
|
}
|
|
66
101
|
ensureContainer() {
|
|
67
102
|
if (this._containerEl && document.body.contains(this._containerEl)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/toast/toast.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"toast.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/feedback/toast/toast.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,iDA4IvB,CAAC"}
|
|
@@ -1,64 +1,69 @@
|
|
|
1
1
|
import { css } from '@melodicdev/core';
|
|
2
2
|
export const toastStyles = () => css `
|
|
3
|
+
/*
|
|
4
|
+
* Tokens. Rules read each one with its default as the var() fallback,
|
|
5
|
+
* so a value set on the element or inherited from any ancestor wins.
|
|
6
|
+
*
|
|
7
|
+
* Background & border
|
|
8
|
+
* --ml-toast-bg: var(--ml-color-surface)
|
|
9
|
+
* --ml-toast-border-color: var(--ml-color-border)
|
|
10
|
+
* --ml-toast-border-radius: var(--ml-radius-lg)
|
|
11
|
+
* --ml-toast-shadow: var(--ml-shadow-lg)
|
|
12
|
+
*
|
|
13
|
+
* Spacing
|
|
14
|
+
* --ml-toast-gap: var(--ml-space-3)
|
|
15
|
+
* --ml-toast-padding: var(--ml-space-4)
|
|
16
|
+
* --ml-toast-min-width: 320px
|
|
17
|
+
* --ml-toast-max-width: 420px
|
|
18
|
+
*
|
|
19
|
+
* Title
|
|
20
|
+
* --ml-toast-title-font-size: var(--ml-text-sm)
|
|
21
|
+
* --ml-toast-title-font-weight: var(--ml-font-semibold)
|
|
22
|
+
* --ml-toast-title-color: var(--ml-color-text)
|
|
23
|
+
* --ml-toast-title-line-height: var(--ml-leading-tight)
|
|
24
|
+
*
|
|
25
|
+
* Message
|
|
26
|
+
* --ml-toast-message-font-size: var(--ml-text-sm)
|
|
27
|
+
* --ml-toast-message-color: var(--ml-color-text-secondary)
|
|
28
|
+
* --ml-toast-message-line-height: var(--ml-leading-relaxed)
|
|
29
|
+
* --ml-toast-message-margin-top: var(--ml-space-1)
|
|
30
|
+
*
|
|
31
|
+
* Icon variant colors
|
|
32
|
+
* --ml-toast-info-icon-color: var(--ml-color-primary)
|
|
33
|
+
* --ml-toast-success-icon-color: var(--ml-color-success)
|
|
34
|
+
* --ml-toast-warning-icon-color: var(--ml-color-warning)
|
|
35
|
+
* --ml-toast-error-icon-color: var(--ml-color-danger)
|
|
36
|
+
*
|
|
37
|
+
* Dismiss button
|
|
38
|
+
* --ml-toast-dismiss-border-radius: var(--ml-radius-sm)
|
|
39
|
+
* --ml-toast-dismiss-color: var(--ml-color-text-tertiary)
|
|
40
|
+
* --ml-toast-dismiss-hover-color: var(--ml-color-text)
|
|
41
|
+
*
|
|
42
|
+
* Transition
|
|
43
|
+
* --ml-toast-transition-duration: var(--ml-duration-150)
|
|
44
|
+
* --ml-toast-transition-easing: var(--ml-ease-in-out)
|
|
45
|
+
*
|
|
46
|
+
* Animation
|
|
47
|
+
* --ml-toast-animation-duration: var(--ml-duration-300)
|
|
48
|
+
* --ml-toast-animation-easing: var(--ml-ease-out)
|
|
49
|
+
*/
|
|
50
|
+
|
|
3
51
|
:host {
|
|
4
52
|
display: block;
|
|
5
|
-
|
|
6
|
-
/* Background & border */
|
|
7
|
-
--ml-toast-bg: var(--ml-color-surface);
|
|
8
|
-
--ml-toast-border-color: var(--ml-color-border);
|
|
9
|
-
--ml-toast-border-radius: var(--ml-radius-lg);
|
|
10
|
-
--ml-toast-shadow: var(--ml-shadow-lg);
|
|
11
|
-
|
|
12
|
-
/* Spacing */
|
|
13
|
-
--ml-toast-gap: var(--ml-space-3);
|
|
14
|
-
--ml-toast-padding: var(--ml-space-4);
|
|
15
|
-
--ml-toast-min-width: 320px;
|
|
16
|
-
--ml-toast-max-width: 420px;
|
|
17
|
-
|
|
18
|
-
/* Title */
|
|
19
|
-
--ml-toast-title-font-size: var(--ml-text-sm);
|
|
20
|
-
--ml-toast-title-font-weight: var(--ml-font-semibold);
|
|
21
|
-
--ml-toast-title-color: var(--ml-color-text);
|
|
22
|
-
--ml-toast-title-line-height: var(--ml-leading-tight);
|
|
23
|
-
|
|
24
|
-
/* Message */
|
|
25
|
-
--ml-toast-message-font-size: var(--ml-text-sm);
|
|
26
|
-
--ml-toast-message-color: var(--ml-color-text-secondary);
|
|
27
|
-
--ml-toast-message-line-height: var(--ml-leading-relaxed);
|
|
28
|
-
--ml-toast-message-margin-top: var(--ml-space-1);
|
|
29
|
-
|
|
30
|
-
/* Icon variant colors */
|
|
31
|
-
--ml-toast-info-icon-color: var(--ml-color-primary);
|
|
32
|
-
--ml-toast-success-icon-color: var(--ml-color-success);
|
|
33
|
-
--ml-toast-warning-icon-color: var(--ml-color-warning);
|
|
34
|
-
--ml-toast-error-icon-color: var(--ml-color-danger);
|
|
35
|
-
|
|
36
|
-
/* Dismiss button */
|
|
37
|
-
--ml-toast-dismiss-border-radius: var(--ml-radius-sm);
|
|
38
|
-
--ml-toast-dismiss-color: var(--ml-color-text-tertiary);
|
|
39
|
-
--ml-toast-dismiss-hover-color: var(--ml-color-text);
|
|
40
|
-
|
|
41
|
-
/* Transition */
|
|
42
|
-
--ml-toast-transition-duration: var(--ml-duration-150);
|
|
43
|
-
--ml-toast-transition-easing: var(--ml-ease-in-out);
|
|
44
|
-
|
|
45
|
-
/* Animation */
|
|
46
|
-
--ml-toast-animation-duration: var(--ml-duration-300);
|
|
47
|
-
--ml-toast-animation-easing: var(--ml-ease-out);
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
.ml-toast {
|
|
51
56
|
display: flex;
|
|
52
57
|
align-items: flex-start;
|
|
53
|
-
gap: var(--ml-toast-gap);
|
|
54
|
-
padding: var(--ml-toast-padding);
|
|
55
|
-
background-color: var(--ml-toast-bg);
|
|
56
|
-
border: 1px solid var(--ml-toast-border-color);
|
|
57
|
-
border-radius: var(--ml-toast-border-radius);
|
|
58
|
-
box-shadow: var(--ml-toast-shadow);
|
|
59
|
-
min-width: var(--ml-toast-min-width);
|
|
60
|
-
max-width: var(--ml-toast-max-width);
|
|
61
|
-
animation: ml-toast-in var(--ml-toast-animation-duration) var(--ml-toast-animation-easing);
|
|
58
|
+
gap: var(--ml-toast-gap, var(--ml-space-3));
|
|
59
|
+
padding: var(--ml-toast-padding, var(--ml-space-4));
|
|
60
|
+
background-color: var(--ml-toast-bg, var(--ml-color-surface));
|
|
61
|
+
border: 1px solid var(--ml-toast-border-color, var(--ml-color-border));
|
|
62
|
+
border-radius: var(--ml-toast-border-radius, var(--ml-radius-lg));
|
|
63
|
+
box-shadow: var(--ml-toast-shadow, var(--ml-shadow-lg));
|
|
64
|
+
min-width: var(--ml-toast-min-width, 320px);
|
|
65
|
+
max-width: var(--ml-toast-max-width, 420px);
|
|
66
|
+
animation: ml-toast-in var(--ml-toast-animation-duration, var(--ml-duration-300)) var(--ml-toast-animation-easing, var(--ml-ease-out));
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
@keyframes ml-toast-in {
|
|
@@ -79,19 +84,19 @@ export const toastStyles = () => css `
|
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
.ml-toast--info .ml-toast__icon {
|
|
82
|
-
color: var(--ml-toast-info-icon-color);
|
|
87
|
+
color: var(--ml-toast-info-icon-color, var(--ml-color-primary));
|
|
83
88
|
}
|
|
84
89
|
|
|
85
90
|
.ml-toast--success .ml-toast__icon {
|
|
86
|
-
color: var(--ml-toast-success-icon-color);
|
|
91
|
+
color: var(--ml-toast-success-icon-color, var(--ml-color-success));
|
|
87
92
|
}
|
|
88
93
|
|
|
89
94
|
.ml-toast--warning .ml-toast__icon {
|
|
90
|
-
color: var(--ml-toast-warning-icon-color);
|
|
95
|
+
color: var(--ml-toast-warning-icon-color, var(--ml-color-warning));
|
|
91
96
|
}
|
|
92
97
|
|
|
93
98
|
.ml-toast--error .ml-toast__icon {
|
|
94
|
-
color: var(--ml-toast-error-icon-color);
|
|
99
|
+
color: var(--ml-toast-error-icon-color, var(--ml-color-danger));
|
|
95
100
|
}
|
|
96
101
|
|
|
97
102
|
.ml-toast__content {
|
|
@@ -100,21 +105,21 @@ export const toastStyles = () => css `
|
|
|
100
105
|
}
|
|
101
106
|
|
|
102
107
|
.ml-toast__title {
|
|
103
|
-
font-size: var(--ml-toast-title-font-size);
|
|
104
|
-
font-weight: var(--ml-toast-title-font-weight);
|
|
105
|
-
color: var(--ml-toast-title-color);
|
|
106
|
-
line-height: var(--ml-toast-title-line-height);
|
|
108
|
+
font-size: var(--ml-toast-title-font-size, var(--ml-text-sm));
|
|
109
|
+
font-weight: var(--ml-toast-title-font-weight, var(--ml-font-semibold));
|
|
110
|
+
color: var(--ml-toast-title-color, var(--ml-color-text));
|
|
111
|
+
line-height: var(--ml-toast-title-line-height, var(--ml-leading-tight));
|
|
107
112
|
}
|
|
108
113
|
|
|
109
114
|
.ml-toast__message {
|
|
110
|
-
font-size: var(--ml-toast-message-font-size);
|
|
111
|
-
color: var(--ml-toast-message-color);
|
|
112
|
-
line-height: var(--ml-toast-message-line-height);
|
|
113
|
-
margin-top: var(--ml-toast-message-margin-top);
|
|
115
|
+
font-size: var(--ml-toast-message-font-size, var(--ml-text-sm));
|
|
116
|
+
color: var(--ml-toast-message-color, var(--ml-color-text-secondary));
|
|
117
|
+
line-height: var(--ml-toast-message-line-height, var(--ml-leading-relaxed));
|
|
118
|
+
margin-top: var(--ml-toast-message-margin-top, var(--ml-space-1));
|
|
114
119
|
}
|
|
115
120
|
|
|
116
121
|
.ml-toast__title + .ml-toast__message {
|
|
117
|
-
margin-top: var(--ml-toast-message-margin-top);
|
|
122
|
+
margin-top: var(--ml-toast-message-margin-top, var(--ml-space-1));
|
|
118
123
|
}
|
|
119
124
|
|
|
120
125
|
.ml-toast__dismiss {
|
|
@@ -125,13 +130,13 @@ export const toastStyles = () => css `
|
|
|
125
130
|
padding: 0;
|
|
126
131
|
background: none;
|
|
127
132
|
border: none;
|
|
128
|
-
border-radius: var(--ml-toast-dismiss-border-radius);
|
|
133
|
+
border-radius: var(--ml-toast-dismiss-border-radius, var(--ml-radius-sm));
|
|
129
134
|
cursor: pointer;
|
|
130
|
-
color: var(--ml-toast-dismiss-color);
|
|
131
|
-
transition: color var(--ml-toast-transition-duration) var(--ml-toast-transition-easing);
|
|
135
|
+
color: var(--ml-toast-dismiss-color, var(--ml-color-text-tertiary));
|
|
136
|
+
transition: color var(--ml-toast-transition-duration, var(--ml-duration-150)) var(--ml-toast-transition-easing, var(--ml-ease-in-out));
|
|
132
137
|
}
|
|
133
138
|
|
|
134
139
|
.ml-toast__dismiss:hover {
|
|
135
|
-
color: var(--ml-toast-dismiss-hover-color);
|
|
140
|
+
color: var(--ml-toast-dismiss-hover-color, var(--ml-color-text));
|
|
136
141
|
}
|
|
137
142
|
`;
|
|
@@ -102,6 +102,13 @@ export declare class AutocompleteComponent implements IElementRef, OnCreate, OnD
|
|
|
102
102
|
get activeDescendant(): string | undefined;
|
|
103
103
|
/** Display text for the input in single mode */
|
|
104
104
|
get displayText(): string;
|
|
105
|
+
/**
|
|
106
|
+
* The platform can hide a popover without going through `close()` — a
|
|
107
|
+
* dialog closing above it, another popover taking the top layer, the
|
|
108
|
+
* element being removed. Without observing `toggle`, `isOpen` stayed true
|
|
109
|
+
* and the component refused to reopen.
|
|
110
|
+
*/
|
|
111
|
+
private readonly handlePopoverToggle;
|
|
105
112
|
/** Open the dropdown */
|
|
106
113
|
open: () => void;
|
|
107
114
|
/** Close the dropdown */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/autocomplete/autocomplete.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAqBxF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAMa,qBAAsB,YAAW,WAAW,EAAE,QAAQ,EAAE,SAAS;IACtE,UAAU,EAAG,WAAW,CAAC;IAEhC,iBAAiB;IACV,KAAK,SAAM;IAElB,uBAAuB;IAChB,WAAW,SAAY;IAE9B,kCAAkC;IAC3B,IAAI,SAAM;IAEjB,iDAAiD;IAC1C,KAAK,SAAM;IAElB,qBAAqB;IACd,IAAI,EAAE,IAAI,CAAQ;IAEzB,4BAA4B;IACrB,QAAQ,UAAS;IAExB,uBAAuB;IAChB,QAAQ,UAAS;IAExB,+BAA+B;IACxB,QAAQ,UAAS;IAExB,6CAA6C;IACtC,KAAK,SAAM;IAElB,6CAA6C;IACtC,MAAM,EAAE,MAAM,EAAE,CAAM;IAE7B,0BAA0B;IACnB,OAAO,EAAE,kBAAkB,EAAE,CAAM;IAE1C,4BAA4B;IACrB,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAAQ;IAEpD,mCAAmC;IAC5B,QAAQ,SAAO;IAEtB,qDAAqD;IAC9C,QAAQ,SAAK;IAEpB,mDAAmD;IAC5C,WAAW,UAAQ;IAE1B,uBAAuB;IAChB,QAAQ,UAAQ;IAEvB,2BAA2B;IACpB,MAAM,SAAM;IAEnB,+BAA+B;IACxB,MAAM,UAAS;IAEtB,qCAAqC;IAC9B,YAAY,SAAM;IAEzB,qCAAqC;IAC9B,OAAO,UAAS;IAEvB,6BAA6B;IACtB,YAAY,EAAE,kBAAkB,EAAE,CAAM;IAE/C,4EAA4E;IACrE,aAAa,EAAE,kBAAkB,GAAG,IAAI,CAAQ;IAEvD,8EAA8E;IACvE,cAAc,EAAE,kBAAkB,EAAE,CAAM;IAEjD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6B;IAC5D,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAmC;IACxE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAW;IAChC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAIxB;IACJ,OAAO,CAAC,cAAc,CAA8C;IACpE,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,cAAc,CAAS;IAExB,QAAQ,IAAI,IAAI;IAIhB,SAAS,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"autocomplete.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/autocomplete/autocomplete.component.ts"],"names":[],"mappings":"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"}
|
|
@@ -115,6 +115,21 @@ let AutocompleteComponent = class AutocompleteComponent {
|
|
|
115
115
|
this.optionId = (index) => {
|
|
116
116
|
return `${this.listboxId}-option-${index}`;
|
|
117
117
|
};
|
|
118
|
+
/**
|
|
119
|
+
* The platform can hide a popover without going through `close()` — a
|
|
120
|
+
* dialog closing above it, another popover taking the top layer, the
|
|
121
|
+
* element being removed. Without observing `toggle`, `isOpen` stayed true
|
|
122
|
+
* and the component refused to reopen.
|
|
123
|
+
*/
|
|
124
|
+
this.handlePopoverToggle = (event) => {
|
|
125
|
+
const state = event.newState;
|
|
126
|
+
if (state === 'closed' && this.isOpen) {
|
|
127
|
+
this.isOpen = false;
|
|
128
|
+
this.focusedIndex = -1;
|
|
129
|
+
this.stopPositioning();
|
|
130
|
+
this.removeDocumentClickListener();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
118
133
|
/** Open the dropdown */
|
|
119
134
|
this.open = () => {
|
|
120
135
|
if (this.disabled || this.isOpen)
|
|
@@ -124,6 +139,7 @@ let AutocompleteComponent = class AutocompleteComponent {
|
|
|
124
139
|
const dropdownEl = this.getDropdownEl();
|
|
125
140
|
if (!dropdownEl)
|
|
126
141
|
return;
|
|
142
|
+
dropdownEl.addEventListener('toggle', this.handlePopoverToggle);
|
|
127
143
|
dropdownEl.showPopover();
|
|
128
144
|
this.isOpen = true;
|
|
129
145
|
this.focusedIndex = this.findFirstEnabledIndex();
|
|
@@ -255,6 +271,7 @@ let AutocompleteComponent = class AutocompleteComponent {
|
|
|
255
271
|
}
|
|
256
272
|
onDestroy() {
|
|
257
273
|
this.elementRef.removeEventListener('keydown', this._handleKeyDown);
|
|
274
|
+
this.getDropdownEl()?.removeEventListener('toggle', this.handlePopoverToggle);
|
|
258
275
|
this.stopPositioning();
|
|
259
276
|
this.removeDocumentClickListener();
|
|
260
277
|
if (this._debounceTimer) {
|
|
@@ -398,6 +415,21 @@ let AutocompleteComponent = class AutocompleteComponent {
|
|
|
398
415
|
this.asyncOptions = results;
|
|
399
416
|
this.focusedIndex = this.findFirstEnabledIndex();
|
|
400
417
|
}
|
|
418
|
+
catch (error) {
|
|
419
|
+
// A rejected searchFn used to become an unhandled rejection and
|
|
420
|
+
// leave the spinner running forever. Report it as an event the app
|
|
421
|
+
// can surface, show no results, and clear loading in `finally`.
|
|
422
|
+
if (generation === this._searchGeneration) {
|
|
423
|
+
this.asyncOptions = [];
|
|
424
|
+
this.focusedIndex = -1;
|
|
425
|
+
this.elementRef.dispatchEvent(new CustomEvent('ml:search-error', {
|
|
426
|
+
bubbles: true,
|
|
427
|
+
composed: true,
|
|
428
|
+
detail: { query, error }
|
|
429
|
+
}));
|
|
430
|
+
}
|
|
431
|
+
console.error(`[Melodic] ml-autocomplete search failed for '${query}':`, error);
|
|
432
|
+
}
|
|
401
433
|
finally {
|
|
402
434
|
if (generation === this._searchGeneration) {
|
|
403
435
|
this.loading = false;
|
|
@@ -445,6 +477,13 @@ let AutocompleteComponent = class AutocompleteComponent {
|
|
|
445
477
|
}
|
|
446
478
|
break;
|
|
447
479
|
case 'Escape':
|
|
480
|
+
// Only claim Escape while the listbox is actually open.
|
|
481
|
+
// preventDefault() on a closed control cancelled the platform's
|
|
482
|
+
// close-watcher, so an enclosing dialog or drawer could not be
|
|
483
|
+
// dismissed with Escape while focus sat on this field.
|
|
484
|
+
if (!this.isOpen) {
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
448
487
|
event.preventDefault();
|
|
449
488
|
this.close();
|
|
450
489
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/autocomplete/autocomplete.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"autocomplete.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/autocomplete/autocomplete.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,iDA6b9B,CAAC"}
|