@getflip/swirl-components 0.38.1 → 0.38.3

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/components.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-04-14T11:17:41",
2
+ "timestamp": "2023-04-14T12:16:23",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "3.0.0",
@@ -3211,7 +3211,9 @@ const SwirlOptionList = class {
3211
3211
  this.items = utils.querySelectorAllDeep(this.el, "swirl-option-list-item");
3212
3212
  }
3213
3213
  setItemDisabledState() {
3214
- this.items.forEach((item) => (item.disabled = this.disabled));
3214
+ if (this.disabled) {
3215
+ this.items.forEach((item) => (item.disabled = true));
3216
+ }
3215
3217
  }
3216
3218
  setItemContext() {
3217
3219
  if (this.multiSelect) {
@@ -3309,7 +3311,8 @@ const SwirlOptionList = class {
3309
3311
  }
3310
3312
  }
3311
3313
  syncItemsWithValue() {
3312
- this.items.forEach((item) => (item.selected = this.value.includes(item.value)));
3314
+ var _a;
3315
+ (_a = this.items) === null || _a === void 0 ? void 0 : _a.forEach((item) => (item.selected = this.value.includes(item.value)));
3313
3316
  }
3314
3317
  focusItem(index) {
3315
3318
  var _a;
@@ -107,6 +107,13 @@ const SwirlTable = class {
107
107
  this.scrolled = undefined;
108
108
  this.scrolledToEnd = undefined;
109
109
  }
110
+ componentDidLoad() {
111
+ this.observeColumnChanges();
112
+ }
113
+ disconnectedCallback() {
114
+ var _a;
115
+ (_a = this.columnObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
116
+ }
110
117
  async componentDidRender() {
111
118
  await this.updateLayout();
112
119
  this.updateScrolledState();
@@ -116,6 +123,18 @@ const SwirlTable = class {
116
123
  await this.updateLayout();
117
124
  this.updateScrolledState();
118
125
  }
126
+ observeColumnChanges() {
127
+ var _a, _b, _c;
128
+ this.columnObserver = new MutationObserver(this.onSlotChange);
129
+ const columnsContainer = (_c = (_b = (_a = this.el.shadowRoot
130
+ .querySelector('slot[name="columns"]')).assignedElements) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c[0];
131
+ if (!Boolean(columnsContainer)) {
132
+ return;
133
+ }
134
+ this.columnObserver.observe(columnsContainer, {
135
+ childList: true,
136
+ });
137
+ }
119
138
  updateScrolledState() {
120
139
  const isMobile = utils.isMobileViewport();
121
140
  const scrollable = this.container.scrollWidth > this.container.clientWidth;