@momentum-design/components 0.104.17 → 0.105.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.
Files changed (43) hide show
  1. package/dist/browser/index.js +292 -275
  2. package/dist/browser/index.js.map +4 -4
  3. package/dist/components/input/input.types.d.ts +8 -5
  4. package/dist/components/listbox/index.d.ts +7 -0
  5. package/dist/components/listbox/index.js +4 -0
  6. package/dist/components/listbox/listbox.component.d.ts +94 -0
  7. package/dist/components/listbox/listbox.component.js +198 -0
  8. package/dist/components/listbox/listbox.constants.d.ts +2 -0
  9. package/dist/components/listbox/listbox.constants.js +3 -0
  10. package/dist/components/listbox/listbox.styles.d.ts +2 -0
  11. package/dist/components/listbox/listbox.styles.js +20 -0
  12. package/dist/components/listbox/listbox.types.d.ts +7 -0
  13. package/dist/components/listbox/listbox.types.js +1 -0
  14. package/dist/components/listitem/listitem.component.d.ts +1 -2
  15. package/dist/components/listitem/listitem.component.js +4 -6
  16. package/dist/components/option/option.component.js +1 -0
  17. package/dist/custom-elements.json +2765 -1992
  18. package/dist/index.d.ts +4 -2
  19. package/dist/index.js +2 -1
  20. package/dist/react/index.d.ts +4 -3
  21. package/dist/react/index.js +4 -3
  22. package/dist/react/input/index.d.ts +3 -3
  23. package/dist/react/listbox/index.d.ts +30 -0
  24. package/dist/react/listbox/index.js +38 -0
  25. package/dist/react/password/index.d.ts +3 -3
  26. package/dist/react/searchfield/index.d.ts +3 -3
  27. package/dist/utils/controllers/ElementStore.d.ts +153 -0
  28. package/dist/utils/controllers/ElementStore.js +171 -0
  29. package/dist/utils/dom.d.ts +13 -0
  30. package/dist/utils/dom.js +14 -0
  31. package/dist/utils/mixins/ItemCollectionMixin.d.ts +68 -0
  32. package/dist/utils/mixins/ItemCollectionMixin.js +89 -0
  33. package/dist/utils/mixins/ListNavigationMixin.d.ts +28 -0
  34. package/dist/utils/mixins/ListNavigationMixin.js +199 -0
  35. package/dist/utils/mixins/lifecycle/CaptureDestroyEventForChildElement.d.ts +30 -0
  36. package/dist/utils/mixins/lifecycle/CaptureDestroyEventForChildElement.js +65 -0
  37. package/dist/utils/mixins/lifecycle/LifeCycleMixin.d.ts +33 -0
  38. package/dist/utils/mixins/lifecycle/LifeCycleMixin.js +41 -0
  39. package/dist/utils/mixins/lifecycle/LifeCycleModifiedEvent.d.ts +19 -0
  40. package/dist/utils/mixins/lifecycle/LifeCycleModifiedEvent.js +1 -0
  41. package/dist/utils/mixins/lifecycle/lifecycle.contants.d.ts +5 -0
  42. package/dist/utils/mixins/lifecycle/lifecycle.contants.js +5 -0
  43. package/package.json +1 -1
@@ -0,0 +1,89 @@
1
+ import { isBefore } from '../dom';
2
+ import { LIFE_CYCLE_EVENTS } from './lifecycle/lifecycle.contants';
3
+ /**
4
+ * This mixin collects and cache items based on the `created` and `destroyed` lifecycle events.
5
+ * Also provides methods to manage the item cache.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * // Add and remove item based on the disabled state
10
+ * class ListBox extends ItemCollectionMixin<Option, typeof Component>(Component) {
11
+ * constructor() {
12
+ * super();
13
+ * this.addEventListener('modified', this.handleModifiedEvent);
14
+ * }
15
+ *
16
+ * handleModifiedEvent(event: LifeCycleModifiedEvent) {
17
+ * if (event.details.change === 'enabled') {
18
+ * this.addItemToCacheAt(event.target);
19
+ * } else if (event.details.change === 'disabled') {
20
+ * this.removeItemFromCache(event.target)
21
+ * }
22
+ * }
23
+ * }
24
+ * ```
25
+ *
26
+ * @param superClass - The class to extend with the mixin.
27
+ */
28
+ export const ItemCollectionMixin = (superClass) => {
29
+ class InnerMixinClass extends superClass {
30
+ /** @see ItemCollectionMixinInterface.items */
31
+ get items() {
32
+ return this.itemCache;
33
+ }
34
+ constructor(...rest) {
35
+ super(...rest);
36
+ this.itemCache = [];
37
+ this.addEventListener(LIFE_CYCLE_EVENTS.CREATED, this.itemCreationHandler);
38
+ this.addEventListener(LIFE_CYCLE_EVENTS.DESTROYED, this.itemDestroyHandler);
39
+ }
40
+ /**
41
+ * Handles the item creation event.
42
+ *
43
+ * @param event - The event triggered when an item is created.
44
+ */
45
+ itemCreationHandler(event) {
46
+ const newItem = event.target;
47
+ this.addItemToCacheAt(newItem);
48
+ }
49
+ /**
50
+ * Handles the item destroy event.
51
+ *
52
+ * @param event - The event triggered when an item is destroyed.
53
+ */
54
+ itemDestroyHandler(event) {
55
+ const removedItem = event.target;
56
+ this.removeItemFromCache(removedItem);
57
+ }
58
+ /** @see ItemCollectionMixinInterface.isValidItem */
59
+ isValidItem(item) {
60
+ return !!item;
61
+ }
62
+ /** @see ItemCollectionMixinInterface.addItemToCacheAt */
63
+ addItemToCacheAt(newItem, index) {
64
+ if (this.isValidItem(newItem) && !this.itemCache.includes(newItem)) {
65
+ const idx = index === undefined ? this.itemCache.findIndex(e => isBefore(newItem, e)) : index;
66
+ if (idx === -1) {
67
+ this.itemCache.push(newItem);
68
+ }
69
+ else if (idx >= 0) {
70
+ this.itemCache.splice(idx, 0, newItem);
71
+ }
72
+ }
73
+ }
74
+ /** @see ItemCollectionMixinInterface.removeItemFromCache */
75
+ removeItemFromCache(item) {
76
+ const idx = this.itemCache.indexOf(item);
77
+ if (idx !== -1) {
78
+ this.itemCache.splice(idx, 1);
79
+ }
80
+ }
81
+ /** @see ItemCollectionMixinInterface.setItemCache */
82
+ setItemCache(items) {
83
+ this.itemCache.length = 0;
84
+ this.itemCache.push(...(items || []));
85
+ }
86
+ }
87
+ // Cast return type to your mixin's interface intersected with the superClass type
88
+ return InnerMixinClass;
89
+ };
@@ -0,0 +1,28 @@
1
+ import type { Component } from '../../models';
2
+ import type { Constructor } from './index.types';
3
+ export declare abstract class ListNavigationMixinInterface {
4
+ protected loop: boolean;
5
+ protected propagateAllKeyEvents: boolean;
6
+ protected resetTabIndexes(index: number): void;
7
+ protected abstract get navItems(): HTMLElement[];
8
+ protected resetTabIndexAndSetFocus(newIndex: number, oldIndex?: number, focusNewItem?: boolean): void;
9
+ }
10
+ /**
11
+ * This mixin extends the passed class with list like navigation capabilities.
12
+ *
13
+ * It handles up and down arrow keys, home and end keys to navigate through a list of items.
14
+ * Key mapping aligned to reading direction (RTL or LTR).
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * class MyComponent extends ListNavigationMixin(Component) {
19
+ * protected override loop = false; // Enable looping navigation
20
+ *
21
+ * protected get navItems() {
22
+ * return this.shadowRoot?.querySelectorAll('.mdc-listitem') || [];
23
+ * }
24
+ * }
25
+ * ```
26
+ * @param superClass - The class to extend with the mixin.
27
+ */
28
+ export declare const ListNavigationMixin: <T extends Constructor<Component>>(superClass: T) => Constructor<Component & ListNavigationMixinInterface> & T;
@@ -0,0 +1,199 @@
1
+ import { KEYS } from '../keys';
2
+ /**
3
+ * This mixin extends the passed class with list like navigation capabilities.
4
+ *
5
+ * It handles up and down arrow keys, home and end keys to navigate through a list of items.
6
+ * Key mapping aligned to reading direction (RTL or LTR).
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * class MyComponent extends ListNavigationMixin(Component) {
11
+ * protected override loop = false; // Enable looping navigation
12
+ *
13
+ * protected get navItems() {
14
+ * return this.shadowRoot?.querySelectorAll('.mdc-listitem') || [];
15
+ * }
16
+ * }
17
+ * ```
18
+ * @param superClass - The class to extend with the mixin.
19
+ */
20
+ export const ListNavigationMixin = (superClass) => {
21
+ class InnerMixinClass extends superClass {
22
+ constructor(...rest) {
23
+ super(...rest);
24
+ /**
25
+ * Whether to loop navigation when reaching the end of the list.
26
+ * If true, pressing the down arrow on the last item will focus the first item,
27
+ * and pressing the up arrow on the first item will focus the last item.
28
+ * If false, navigation will stop at the first or last item.
29
+ *
30
+ * @default true
31
+ * @internal
32
+ */
33
+ this.loop = true;
34
+ /**
35
+ * Whether to propagate all key events to parent components.
36
+ * If true, all key events will bubble up and can be handled by parent components.
37
+ * If false, navigation key events handled by this mixin will not propagate further.
38
+ *
39
+ * @default false
40
+ * @internal
41
+ */
42
+ this.propagateAllKeyEvents = false;
43
+ /**
44
+ * Handles keydown events for navigation within the list.
45
+ * It allows users to navigate through the list items using arrow keys, home, and end keys.
46
+ * The navigation is based on the current focused item and the direction of the layout (RTL or LTR).
47
+ *
48
+ * By default, it will stop propagation for key events which are handled by the component.
49
+ * Check the mixin options to change this behavior.
50
+ *
51
+ * @param event - The keyboard event triggered by user interaction.
52
+ * @internal
53
+ */
54
+ this.handleNavigationKeyDown = (event) => {
55
+ let isKeyHandled = false;
56
+ const target = event.target;
57
+ const currentIndex = this.getCurrentIndex(target);
58
+ if (currentIndex === -1)
59
+ return;
60
+ this.resetTabIndexes(currentIndex);
61
+ const isRtl = window.getComputedStyle(this).direction === 'rtl';
62
+ const targetKey = this.resolveDirectionKey(event.key, isRtl);
63
+ switch (targetKey) {
64
+ case KEYS.HOME: {
65
+ // Move focus to the first item
66
+ this.resetTabIndexAndSetFocus(0, currentIndex);
67
+ isKeyHandled = true;
68
+ break;
69
+ }
70
+ case KEYS.END: {
71
+ // Move focus to the last item
72
+ this.resetTabIndexAndSetFocus(this.navItems.length - 1, currentIndex);
73
+ isKeyHandled = true;
74
+ break;
75
+ }
76
+ case KEYS.ARROW_DOWN: {
77
+ // Move focus to the next item
78
+ const eolIndex = this.loop ? 0 : currentIndex;
79
+ const newIndex = currentIndex + 1 === this.navItems.length ? eolIndex : currentIndex + 1;
80
+ this.resetTabIndexAndSetFocus(newIndex, currentIndex);
81
+ isKeyHandled = true;
82
+ break;
83
+ }
84
+ case KEYS.ARROW_UP: {
85
+ // Move focus to the prev item
86
+ const eolIndex = this.loop ? this.navItems.length - 1 : currentIndex;
87
+ const newIndex = currentIndex - 1 === -1 ? eolIndex : currentIndex - 1;
88
+ this.resetTabIndexAndSetFocus(newIndex, currentIndex);
89
+ isKeyHandled = true;
90
+ break;
91
+ }
92
+ default:
93
+ break;
94
+ }
95
+ // When the component consume any of the pressed key, we need to stop propagation
96
+ // to prevent the event from bubbling up and being handled by parent components which might use the same key.
97
+ if (isKeyHandled && !this.propagateAllKeyEvents) {
98
+ event.stopPropagation();
99
+ event.preventDefault();
100
+ }
101
+ };
102
+ /**
103
+ * Handles click events on the navigation items.
104
+ * It retrieves the index of the clicked item and resets the tabindex accordingly.
105
+ *
106
+ * @param event - The mouse event triggered by user interaction.
107
+ * @internal
108
+ */
109
+ this.handleNavigationClick = (event) => {
110
+ const newIndex = this.getCurrentIndex(event.target);
111
+ this.resetTabIndexes(newIndex);
112
+ };
113
+ this.addEventListener('keydown', this.handleNavigationKeyDown);
114
+ this.addEventListener('click', this.handleNavigationClick);
115
+ }
116
+ /**
117
+ * Reset tabindex and set focus to the first item in the list after the component is first updated.
118
+ *
119
+ * @param changedProperties - The properties that have changed since the last update.
120
+ */
121
+ async firstUpdated(changedProperties) {
122
+ super.firstUpdated(changedProperties);
123
+ this.resetTabIndexAndSetFocus(0, undefined, false);
124
+ }
125
+ /**
126
+ * Retrieves the current index of the item that triggered the event.
127
+ *
128
+ * @param target - The target element that triggered the event.
129
+ * @returns - The index of the current item in the `navItems` array.
130
+ */
131
+ getCurrentIndex(target) {
132
+ return this.navItems.findIndex(node => node === target);
133
+ }
134
+ /**
135
+ * Reset all tabindex to -1 and set the tabindex of the current item to 0
136
+ *
137
+ * @param index - The index of the currently focused item.
138
+ */
139
+ resetTabIndexes(index) {
140
+ if (this.navItems.length > 0) {
141
+ this.navItems.forEach(item => item.setAttribute('tabindex', '-1'));
142
+ const currentIndex = this.navItems[index] ? index : 0;
143
+ this.navItems[currentIndex].setAttribute('tabindex', '0');
144
+ this.navItems[currentIndex].focus();
145
+ }
146
+ }
147
+ /**
148
+ * Resets the tabindex of the currently focused item and sets focus to a new item.
149
+ *
150
+ * @param newIndex - The index of the new item to focus.
151
+ * @param oldIndex - The index of the currently focused item.
152
+ * @param focusNewItem - Call focus() on the new item or not. It should be false during firstUpdate
153
+ * @returns - This method does not return anything.
154
+ */
155
+ resetTabIndexAndSetFocus(newIndex, oldIndex, focusNewItem = true) {
156
+ const { navItems } = this;
157
+ if (navItems.length === 0)
158
+ return;
159
+ // Ensure newIndex is valid
160
+ const newIdx = navItems[newIndex] ? newIndex : 0;
161
+ const newItem = navItems[newIdx];
162
+ if (newIndex === oldIndex && newItem && newItem.getAttribute('tabindex') === '0') {
163
+ return;
164
+ }
165
+ if (oldIndex !== undefined && navItems[oldIndex]) {
166
+ // Reset tabindex of the old item
167
+ navItems[oldIndex].setAttribute('tabindex', '-1');
168
+ }
169
+ newItem.setAttribute('tabindex', '0');
170
+ if (focusNewItem) {
171
+ newItem.focus();
172
+ }
173
+ }
174
+ /**
175
+ * Resolves the key pressed by the user based on the direction of the layout.
176
+ * This method is used to handle keyboard navigation in a right-to-left (RTL) layout.
177
+ * It checks if the layout is RTL and adjusts the arrow keys accordingly.
178
+ * For example, in RTL, the left arrow key behaves like the right arrow key and vice versa.
179
+ *
180
+ * @param key - The key pressed by the user.
181
+ * @param isRtl - A boolean indicating if the layout is right-to-left (RTL).
182
+ * @returns - The resolved key based on the direction.
183
+ */
184
+ resolveDirectionKey(key, isRtl) {
185
+ if (!isRtl)
186
+ return key;
187
+ switch (key) {
188
+ case KEYS.ARROW_LEFT:
189
+ return KEYS.ARROW_RIGHT;
190
+ case KEYS.ARROW_RIGHT:
191
+ return KEYS.ARROW_LEFT;
192
+ default:
193
+ return key;
194
+ }
195
+ }
196
+ }
197
+ // Cast return type to your mixin's interface intersected with the superClass type
198
+ return InnerMixinClass;
199
+ };
@@ -0,0 +1,30 @@
1
+ import type { LitElement } from 'lit';
2
+ import type { Constructor } from '../index.types';
3
+ export declare class CaptureDestroyEventForChildElementInterface {
4
+ }
5
+ /**
6
+ * Mixin to re-dispatch elements destroy event.
7
+ *
8
+ *
9
+ * It is necessary because `destroyed` event emitted in the `disconnectedCallback` of the item
10
+ * it executes after the item disconnected from the DOM tree. The event can not bubble up to the
11
+ * parent component, but we still can listen to it when we do it directly on it.
12
+ *
13
+ * Use {@link LifeCycleMixin} on the child component to emit the `created` and `destroyed` events
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * // Add created and destroyed event listeners
18
+ * class MyComponent extends DestroyItemMixin(Component) {
19
+ * constructor() {
20
+ * super();
21
+ * this.addEventListener('created' this.handleItemCreation);
22
+ * this.addEventListener('destroyed', this.handleItemRemovedEvent);
23
+ * }
24
+ * // ...
25
+ * }
26
+ * ```
27
+ *
28
+ * @param superClass - The class to extend with the mixin.
29
+ */
30
+ export declare const CaptureDestroyEventForChildElement: <T extends Constructor<LitElement>>(superClass: T) => Constructor<CaptureDestroyEventForChildElementInterface> & T;
@@ -0,0 +1,65 @@
1
+ import { LIFE_CYCLE_EVENTS } from './lifecycle.contants';
2
+ /**
3
+ * Mixin to re-dispatch elements destroy event.
4
+ *
5
+ *
6
+ * It is necessary because `destroyed` event emitted in the `disconnectedCallback` of the item
7
+ * it executes after the item disconnected from the DOM tree. The event can not bubble up to the
8
+ * parent component, but we still can listen to it when we do it directly on it.
9
+ *
10
+ * Use {@link LifeCycleMixin} on the child component to emit the `created` and `destroyed` events
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * // Add created and destroyed event listeners
15
+ * class MyComponent extends DestroyItemMixin(Component) {
16
+ * constructor() {
17
+ * super();
18
+ * this.addEventListener('created' this.handleItemCreation);
19
+ * this.addEventListener('destroyed', this.handleItemRemovedEvent);
20
+ * }
21
+ * // ...
22
+ * }
23
+ * ```
24
+ *
25
+ * @param superClass - The class to extend with the mixin.
26
+ */
27
+ export const CaptureDestroyEventForChildElement = (superClass) => {
28
+ class InnerMixinClass extends superClass {
29
+ constructor(...rest) {
30
+ super(...rest);
31
+ /**
32
+ * Register destroy event listener on the item when it is created.
33
+ *
34
+ * @param event - The event triggered when an item is created.
35
+ */
36
+ this.handleItemCreation = (event) => {
37
+ const item = event.target;
38
+ if (item) {
39
+ item.addEventListener(LIFE_CYCLE_EVENTS.DESTROYED, this.handleItemRemovedEvent);
40
+ }
41
+ };
42
+ /**
43
+ * Handles the item removed event to clean up listeners and re-dispatch the destroy event.
44
+ *
45
+ * @param event - The event triggered when an item is changed.
46
+ */
47
+ this.handleItemRemovedEvent = (event) => {
48
+ event.stopImmediatePropagation();
49
+ if (event.target && event.type === LIFE_CYCLE_EVENTS.DESTROYED) {
50
+ event.target.removeEventListener(LIFE_CYCLE_EVENTS.DESTROYED, this.handleItemRemovedEvent);
51
+ // Re-dispatch the destroy event to allow parent components to handle it.
52
+ // We need to create a new event instance, otherwise we will get an error:
53
+ // Uncaught InvalidStateError: Failed to execute 'dispatchEvent' on 'EventTarget': The event is already being dispatched.
54
+ const evt = new Event(event.type, { bubbles: event.bubbles, composed: event.composed });
55
+ // Also, we need to make sure `dispatchEvent` will not change the target of the event.
56
+ Object.defineProperty(evt, 'target', { set() { }, get: () => event.target });
57
+ this.dispatchEvent(evt);
58
+ }
59
+ };
60
+ this.addEventListener(LIFE_CYCLE_EVENTS.CREATED, this.handleItemCreation);
61
+ }
62
+ }
63
+ // Cast return type to your mixin's interface intersected with the superClass type
64
+ return InnerMixinClass;
65
+ };
@@ -0,0 +1,33 @@
1
+ import type { LitElement } from 'lit';
2
+ import type { Constructor } from '../index.types';
3
+ export declare class LifeCycleMixinInterface {
4
+ /**
5
+ * Dispatches a 'LifeCycleModifiedEvent' event for the passed changed type.
6
+ *
7
+ * @param change - The type of change that occurred, e.g., 'disabled'.
8
+ */
9
+ protected dispatchModifiedEvent(change: string): void;
10
+ }
11
+ /**
12
+ * Mixin to create Lifecycle Manager compatible events for the component.
13
+ *
14
+ * Emits 'created' and 'destroyed' events when the component is connected or disconnected from the DOM.
15
+ * Also provides a method to dispatch 'LifeCycleModifiedEvent' for changes in the component's state.
16
+ *
17
+ * Use {@link CaptureDestroyEventForChildElement} to propagate the "destroyed" events to the parent component.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * // Add disabled state change event
22
+ * class ItemComponent extends LifeCycleMixin(Component) {
23
+ * public override update(changedProperties: PropertyValues): void {
24
+ * super.update(changedProperties);
25
+ *
26
+ * if (changedProperties.has('disabled')) {
27
+ * this.dispatchModifiedEvent(this.disabled ? 'disabled' : 'enabled');
28
+ * }
29
+ * }
30
+ * }
31
+ * ```
32
+ */
33
+ export declare const LifeCycleMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<LifeCycleMixinInterface> & T;
@@ -0,0 +1,41 @@
1
+ import { LIFE_CYCLE_EVENTS } from './lifecycle.contants';
2
+ /**
3
+ * Mixin to create Lifecycle Manager compatible events for the component.
4
+ *
5
+ * Emits 'created' and 'destroyed' events when the component is connected or disconnected from the DOM.
6
+ * Also provides a method to dispatch 'LifeCycleModifiedEvent' for changes in the component's state.
7
+ *
8
+ * Use {@link CaptureDestroyEventForChildElement} to propagate the "destroyed" events to the parent component.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * // Add disabled state change event
13
+ * class ItemComponent extends LifeCycleMixin(Component) {
14
+ * public override update(changedProperties: PropertyValues): void {
15
+ * super.update(changedProperties);
16
+ *
17
+ * if (changedProperties.has('disabled')) {
18
+ * this.dispatchModifiedEvent(this.disabled ? 'disabled' : 'enabled');
19
+ * }
20
+ * }
21
+ * }
22
+ * ```
23
+ */
24
+ export const LifeCycleMixin = (superClass) => {
25
+ class InnerMixinClass extends superClass {
26
+ connectedCallback() {
27
+ super.connectedCallback();
28
+ this.dispatchEvent(new Event(LIFE_CYCLE_EVENTS.CREATED, { bubbles: true, composed: true }));
29
+ }
30
+ disconnectedCallback() {
31
+ super.disconnectedCallback();
32
+ this.dispatchEvent(new Event(LIFE_CYCLE_EVENTS.DESTROYED, { bubbles: true, composed: true }));
33
+ }
34
+ /** @see LifeCycleMixinInterface.dispatchModifiedEvent */
35
+ dispatchModifiedEvent(change) {
36
+ this.dispatchEvent(new CustomEvent(LIFE_CYCLE_EVENTS.MODIFIED, { detail: { change }, bubbles: true, composed: true }));
37
+ }
38
+ }
39
+ // Cast return type to your mixin's interface intersected with the superClass type
40
+ return InnerMixinClass;
41
+ };
@@ -0,0 +1,19 @@
1
+ import { TypedCustomEvent } from '../../types';
2
+ /**
3
+ * Event fired when a modification occurs in the managed component.
4
+ *
5
+ * For example, when an item disabled, etc.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * this.dispatchEvent(new CustomEvent('modified', {change: 'disabled'}));
10
+ * ```
11
+ */
12
+ export type LifeCycleModifiedEvent = TypedCustomEvent<Element, {
13
+ change: string;
14
+ }>;
15
+ declare global {
16
+ interface GlobalEventHandlersEventMap {
17
+ modified: LifeCycleModifiedEvent;
18
+ }
19
+ }
@@ -0,0 +1,5 @@
1
+ export declare const LIFE_CYCLE_EVENTS: {
2
+ CREATED: string;
3
+ DESTROYED: string;
4
+ MODIFIED: string;
5
+ };
@@ -0,0 +1,5 @@
1
+ export const LIFE_CYCLE_EVENTS = {
2
+ CREATED: 'created',
3
+ DESTROYED: 'destroyed',
4
+ MODIFIED: 'modified',
5
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@momentum-design/components",
3
3
  "packageManager": "yarn@3.2.4",
4
- "version": "0.104.17",
4
+ "version": "0.105.1",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"