@triptease/tt-navbar 0.0.44 → 0.0.45

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.
@@ -1,4 +1,4 @@
1
1
  /**
2
- * @triptease/tt-navbar v0.0.44
2
+ * @triptease/tt-navbar v0.0.45
3
3
  */
4
4
  //# sourceMappingURL=global.d.js.map
package/dist/web/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @triptease/tt-navbar v0.0.44
2
+ * @triptease/tt-navbar v0.0.45
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1209,7 +1209,12 @@ var TtCombobox = class extends i4 {
1209
1209
  this._selectAll = (event) => {
1210
1210
  event.preventDefault();
1211
1211
  event.stopPropagation();
1212
- if (this.value.length === this._selectableOptions.length) {
1212
+ if (this._filter !== "" && this._isAllSelected) {
1213
+ const selectedVisibleValues = Array.from(this._selectedVisibleOptions).map((option) => option.dataset.value);
1214
+ this.value = this.value.filter((value) => !selectedVisibleValues.includes(value));
1215
+ } else if (this._filter !== "") {
1216
+ this.value = Array.from(/* @__PURE__ */ new Set([...this.value, ...Array.from(this._selectableVisibleOptions).map((option) => option.dataset.value)]));
1217
+ } else if (this.value.length === this._selectableOptions.length) {
1213
1218
  this.value = [];
1214
1219
  } else {
1215
1220
  this.value = Array.from(this._selectableOptions).map((option) => option.dataset.value);
@@ -1463,9 +1468,7 @@ var TtCombobox = class extends i4 {
1463
1468
  />`;
1464
1469
  }
1465
1470
  _renderOption(option) {
1466
- if (this._filter !== "" && !option.value.toLowerCase().includes(this._filter) && !option.innerText.toLowerCase().includes(this._filter)) {
1467
- return E;
1468
- }
1471
+ const hidden = Boolean(this._filter !== "" && !option.value.toLowerCase().includes(this._filter) && !option.innerText.toLowerCase().includes(this._filter) || option.hidden);
1469
1472
  const id = `${this.id}-option-${option.value}`;
1470
1473
  const active = this._getActiveOptionId() === id;
1471
1474
  const selected = Boolean(this.multiselect && option.selected);
@@ -1479,7 +1482,7 @@ var TtCombobox = class extends i4 {
1479
1482
  @mousedown="${(event) => event.preventDefault()}"
1480
1483
  data-value="${option.value}"
1481
1484
  aria-disabled=${option.disabled}
1482
- aria-hidden=${option.hidden || E}
1485
+ aria-hidden=${hidden || E}
1483
1486
  data-deselectable=${!option.selected}
1484
1487
  part="option"
1485
1488
  >
@@ -2057,7 +2060,7 @@ var NavbarController = class {
2057
2060
  async toggle() {
2058
2061
  this._isOpen = !this._isOpen;
2059
2062
  if (window.Clerk) {
2060
- await window.Clerk.user?.update({
2063
+ window.Clerk.user?.update({
2061
2064
  unsafeMetadata: {
2062
2065
  ...window.Clerk.user?.unsafeMetadata,
2063
2066
  preferences: {