@momentum-design/components 0.133.19 → 0.133.21
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/dist/browser/index.js +91 -91
- package/dist/browser/index.js.map +3 -3
- package/dist/components/searchfield/searchfield.component.d.ts +18 -1
- package/dist/components/searchfield/searchfield.component.js +33 -6
- package/dist/components/searchfield/searchfield.types.d.ts +11 -1
- package/dist/components/searchpopover/searchpopover.component.d.ts +7 -0
- package/dist/components/searchpopover/searchpopover.component.js +7 -0
- package/dist/components/searchpopover/searchpopover.types.d.ts +2 -2
- package/dist/custom-elements.json +188 -8
- package/dist/react/searchfield/index.d.ts +7 -0
- package/dist/react/searchfield/index.js +6 -0
- package/dist/react/searchpopover/index.d.ts +15 -6
- package/dist/react/searchpopover/index.js +8 -0
- package/dist/utils/keys.d.ts +1 -0
- package/dist/utils/keys.js +1 -0
- package/package.json +1 -1
|
@@ -12,6 +12,10 @@ import { TAG_NAME } from '../../components/searchfield/searchfield.constants';
|
|
|
12
12
|
*
|
|
13
13
|
* This component is built by extending the `mdc-input` component.
|
|
14
14
|
*
|
|
15
|
+
* Searchfield supports controlled vs uncontrolled behavior for chip filters, which can be set via the `control-type` attribute:
|
|
16
|
+
* - In **uncontrolled** mode (default), when a chip is removed via the UI, it is automatically removed from the DOM and a `chipRemove` event is dispatched with the removed chip in the event detail. The consumer can listen to the `chipRemove` event but does not need to do anything to remove the chip from the DOM.
|
|
17
|
+
* - In **controlled** mode (`control-type="controlled"`), when a chip is removed via the UI, it is NOT removed from the DOM, but a `chipRemove` event is still dispatched with the "removed" chip in the event detail. The consumer must listen to the `chipRemove` event and handle removing the chip from the DOM themselves (e.g., by updating their state that controls which chips are rendered).
|
|
18
|
+
*
|
|
15
19
|
* **Accessibility:**
|
|
16
20
|
*
|
|
17
21
|
* NOTE: this component should not be used in combination with a Popover or Listbox component.
|
|
@@ -26,6 +30,7 @@ import { TAG_NAME } from '../../components/searchfield/searchfield.constants';
|
|
|
26
30
|
* @event focus - (React: onFocus) This event is dispatched when the input receives focus.
|
|
27
31
|
* @event blur - (React: onBlur) This event is dispatched when the input loses focus.
|
|
28
32
|
* @event clear - (React: onClear) This event is dispatched when the input text is cleared.
|
|
33
|
+
* @event chipRemove - (React: onChipRemove) This event is dispatched when a chip filter is removed. The removed chip element is available in event.detail.chip. In `uncontrolled` mode (default) the chip is removed from the DOM automatically; in `controlled` mode only the event is fired and the consumer is responsible for removing the chip.
|
|
29
34
|
*
|
|
30
35
|
* @slot filters - Slot for chip filters rendered inline with the input text
|
|
31
36
|
* @slot label - Slot for the label element. If not provided, the `label` property will be used to render the label.
|
|
@@ -74,6 +79,7 @@ const reactWrapper = createComponent({
|
|
|
74
79
|
elementClass: Component,
|
|
75
80
|
react: React,
|
|
76
81
|
events: {
|
|
82
|
+
onChipRemove: 'chipRemove',
|
|
77
83
|
onInput: 'input',
|
|
78
84
|
onChange: 'change',
|
|
79
85
|
onFocus: 'focus',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type EventName } from '@lit/react';
|
|
2
2
|
import Component from '../../components/searchpopover';
|
|
3
3
|
import type { Events } from '../../components/searchpopover/searchpopover.types';
|
|
4
|
-
import type { Events as
|
|
4
|
+
import type { Events as EventsInherited0 } from '../../components/input/input.types';
|
|
5
|
+
import type { Events as EventsInherited1 } from '../../components/searchfield/searchfield.types';
|
|
5
6
|
/**
|
|
6
7
|
* `mdc-searchpopover` widget is a combination of the Searchfield and Popover components, connected to ensure
|
|
7
8
|
* proper accessibility. This component should be used when search results or suggestions need to be displayed
|
|
@@ -15,6 +16,10 @@ import type { Events as EventsInherited } from '../../components/input/input.typ
|
|
|
15
16
|
*
|
|
16
17
|
* This component is built by extending the `mdc-searchfield` component & rendering the mdc-popover component inside.
|
|
17
18
|
*
|
|
19
|
+
* Searchpopover supports controlled vs uncontrolled behavior for chip filters, which can be set via the `control-type` attribute:
|
|
20
|
+
* - In **uncontrolled** mode (default), when a chip is removed via the UI, it is automatically removed from the DOM and a `chipRemove` event is dispatched with the removed chip in the event detail. The consumer can listen to the `chipRemove` event but does not need to do anything to remove the chip from the DOM.
|
|
21
|
+
* - In **controlled** mode (`control-type="controlled"`), when a chip is removed via the UI, it is NOT removed from the DOM, but a `chipRemove` event is still dispatched with the "removed" chip in the event detail. The consumer must listen to the `chipRemove` event and handle removing the chip from the DOM themselves (e.g., by updating their state that controls which chips are rendered).
|
|
22
|
+
*
|
|
18
23
|
* @tagname mdc-searchpopover
|
|
19
24
|
*
|
|
20
25
|
* @event input - (React: onInput) This event is dispatched when the value of the input field changes (every press).
|
|
@@ -22,6 +27,9 @@ import type { Events as EventsInherited } from '../../components/input/input.typ
|
|
|
22
27
|
* @event focus - (React: onFocus) This event is dispatched when the input receives focus.
|
|
23
28
|
* @event blur - (React: onBlur) This event is dispatched when the input loses focus.
|
|
24
29
|
* @event clear - (React: onClear) This event is dispatched when the input text is cleared.
|
|
30
|
+
* @event chipRemove - (React: onChipRemove) This event is dispatched when a chip filter is removed. The removed chip element is available in event.detail.chip.
|
|
31
|
+
* In **controlled** mode (`control-type="controlled"`), the chip is NOT removed from the DOM automatically — the consumer is responsible for removing it.
|
|
32
|
+
* In **uncontrolled** mode (default), the chip is removed from the DOM automatically.
|
|
25
33
|
* @event shown - (React: onShown) This event is dispatched when the popover is shown
|
|
26
34
|
* @event hidden - (React: onHidden) This event is dispatched when the popover is hidden
|
|
27
35
|
*
|
|
@@ -74,10 +82,11 @@ import type { Events as EventsInherited } from '../../components/input/input.typ
|
|
|
74
82
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
|
75
83
|
onShown: EventName<Events["onShownEvent"]>;
|
|
76
84
|
onHidden: EventName<Events["onHiddenEvent"]>;
|
|
77
|
-
onInput: EventName<
|
|
78
|
-
onChange: EventName<
|
|
79
|
-
onFocus: EventName<
|
|
80
|
-
onBlur: EventName<
|
|
81
|
-
onClear: EventName<
|
|
85
|
+
onInput: EventName<EventsInherited0["onInputEvent"]>;
|
|
86
|
+
onChange: EventName<EventsInherited0["onChangeEvent"]>;
|
|
87
|
+
onFocus: EventName<EventsInherited0["onFocusEvent"]>;
|
|
88
|
+
onBlur: EventName<EventsInherited0["onBlurEvent"]>;
|
|
89
|
+
onClear: EventName<EventsInherited0["onClearEvent"]>;
|
|
90
|
+
onChipRemove: EventName<EventsInherited1["onChipRemoveEvent"]>;
|
|
82
91
|
}>;
|
|
83
92
|
export default reactWrapper;
|
|
@@ -15,6 +15,10 @@ import { TAG_NAME } from '../../components/searchpopover/searchpopover.constants
|
|
|
15
15
|
*
|
|
16
16
|
* This component is built by extending the `mdc-searchfield` component & rendering the mdc-popover component inside.
|
|
17
17
|
*
|
|
18
|
+
* Searchpopover supports controlled vs uncontrolled behavior for chip filters, which can be set via the `control-type` attribute:
|
|
19
|
+
* - In **uncontrolled** mode (default), when a chip is removed via the UI, it is automatically removed from the DOM and a `chipRemove` event is dispatched with the removed chip in the event detail. The consumer can listen to the `chipRemove` event but does not need to do anything to remove the chip from the DOM.
|
|
20
|
+
* - In **controlled** mode (`control-type="controlled"`), when a chip is removed via the UI, it is NOT removed from the DOM, but a `chipRemove` event is still dispatched with the "removed" chip in the event detail. The consumer must listen to the `chipRemove` event and handle removing the chip from the DOM themselves (e.g., by updating their state that controls which chips are rendered).
|
|
21
|
+
*
|
|
18
22
|
* @tagname mdc-searchpopover
|
|
19
23
|
*
|
|
20
24
|
* @event input - (React: onInput) This event is dispatched when the value of the input field changes (every press).
|
|
@@ -22,6 +26,9 @@ import { TAG_NAME } from '../../components/searchpopover/searchpopover.constants
|
|
|
22
26
|
* @event focus - (React: onFocus) This event is dispatched when the input receives focus.
|
|
23
27
|
* @event blur - (React: onBlur) This event is dispatched when the input loses focus.
|
|
24
28
|
* @event clear - (React: onClear) This event is dispatched when the input text is cleared.
|
|
29
|
+
* @event chipRemove - (React: onChipRemove) This event is dispatched when a chip filter is removed. The removed chip element is available in event.detail.chip.
|
|
30
|
+
* In **controlled** mode (`control-type="controlled"`), the chip is NOT removed from the DOM automatically — the consumer is responsible for removing it.
|
|
31
|
+
* In **uncontrolled** mode (default), the chip is removed from the DOM automatically.
|
|
25
32
|
* @event shown - (React: onShown) This event is dispatched when the popover is shown
|
|
26
33
|
* @event hidden - (React: onHidden) This event is dispatched when the popover is hidden
|
|
27
34
|
*
|
|
@@ -83,6 +90,7 @@ const reactWrapper = createComponent({
|
|
|
83
90
|
onFocus: 'focus',
|
|
84
91
|
onBlur: 'blur',
|
|
85
92
|
onClear: 'clear',
|
|
93
|
+
onChipRemove: 'chipRemove',
|
|
86
94
|
},
|
|
87
95
|
displayName: 'Searchpopover',
|
|
88
96
|
});
|
package/dist/utils/keys.d.ts
CHANGED
package/dist/utils/keys.js
CHANGED