@momentum-design/components 0.133.20 → 0.133.22

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.
@@ -801,7 +801,10 @@ class Popover extends KeyDownHandledMixin(KeyToActionMixin(BackdropMixin(Prevent
801
801
  this.setAttribute('color', Object.values(COLOR).includes(this.color) ? this.color : DEFAULTS.COLOR);
802
802
  }
803
803
  if (changedProperties.has('appendTo')) {
804
- if (this.appendTo) {
804
+ // only setup appendTo when the component is connected to the DOM
805
+ // this fixes an issue which causes popovers to be orphaned in the DOM without the appendTo logic being cleaned up,
806
+ // cause of Lit deferring the updated() to fire after a disconnect
807
+ if (this.appendTo && this.isConnected) {
805
808
  this.utils.setupAppendTo();
806
809
  }
807
810
  else {
@@ -110,6 +110,12 @@ declare class Searchfield extends Searchfield_base {
110
110
  * @param event - Keyboard event
111
111
  */
112
112
  handleKeyDown(event: KeyboardEvent): void;
113
+ /**
114
+ * Overrides the focus method to allow programmatically focusing the input field.
115
+ * Delegate focus didn't work as expect since we have a scrollable container that contains both chips and the input, and we want to focus the input when the component itself is focused. We need to override the focus method to achieve this behavior.
116
+ * @param options - Focus options
117
+ */
118
+ focus(options?: FocusOptions): void;
113
119
  disconnectedCallback(): void;
114
120
  connectedCallback(): void;
115
121
  /**
@@ -234,6 +234,15 @@ class Searchfield extends ControlTypeMixin(KeyDownHandledMixin(Input)) {
234
234
  this.keyDownEventHandled();
235
235
  }
236
236
  }
237
+ /**
238
+ * Overrides the focus method to allow programmatically focusing the input field.
239
+ * Delegate focus didn't work as expect since we have a scrollable container that contains both chips and the input, and we want to focus the input when the component itself is focused. We need to override the focus method to achieve this behavior.
240
+ * @param options - Focus options
241
+ */
242
+ focus(options) {
243
+ var _a;
244
+ (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.focus(options);
245
+ }
237
246
  disconnectedCallback() {
238
247
  var _a;
239
248
  super.disconnectedCallback();
@@ -38747,6 +38747,26 @@
38747
38747
  "module": "components/formfieldwrapper/formfieldwrapper.component.js"
38748
38748
  }
38749
38749
  },
38750
+ {
38751
+ "kind": "method",
38752
+ "name": "focus",
38753
+ "return": {
38754
+ "type": {
38755
+ "text": "void"
38756
+ }
38757
+ },
38758
+ "parameters": [
38759
+ {
38760
+ "name": "options",
38761
+ "optional": true,
38762
+ "type": {
38763
+ "text": "FocusOptions"
38764
+ },
38765
+ "description": "Focus options"
38766
+ }
38767
+ ],
38768
+ "description": "Overrides the focus method to allow programmatically focusing the input field.\nDelegate focus didn't work as expect since we have a scrollable container that contains both chips and the input, and we want to focus the input when the component itself is focused. We need to override the focus method to achieve this behavior."
38769
+ },
38750
38770
  {
38751
38771
  "kind": "field",
38752
38772
  "name": "handleFilterContainerClick"
@@ -40354,6 +40374,30 @@
40354
40374
  "attribute": "display-popover",
40355
40375
  "reflects": true
40356
40376
  },
40377
+ {
40378
+ "kind": "method",
40379
+ "name": "focus",
40380
+ "return": {
40381
+ "type": {
40382
+ "text": "void"
40383
+ }
40384
+ },
40385
+ "parameters": [
40386
+ {
40387
+ "name": "options",
40388
+ "optional": true,
40389
+ "type": {
40390
+ "text": "FocusOptions"
40391
+ },
40392
+ "description": "Focus options"
40393
+ }
40394
+ ],
40395
+ "description": "Overrides the focus method to allow programmatically focusing the input field.\nDelegate focus didn't work as expect since we have a scrollable container that contains both chips and the input, and we want to focus the input when the component itself is focused. We need to override the focus method to achieve this behavior.",
40396
+ "inheritedFrom": {
40397
+ "name": "Searchfield",
40398
+ "module": "components/searchfield/searchfield.component.js"
40399
+ }
40400
+ },
40357
40401
  {
40358
40402
  "kind": "field",
40359
40403
  "name": "handleFilterContainerClick",
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.133.20",
4
+ "version": "0.133.22",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"