@melodicdev/components 1.0.4 → 1.0.5

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.
@@ -5564,7 +5564,7 @@ function inputTemplate(c) {
5564
5564
  "ml-input--disabled": c.disabled,
5565
5565
  "ml-input--readonly": c.readonly,
5566
5566
  "ml-input--error": !!c.error,
5567
- "ml-input--focused": c._focused
5567
+ "ml-input--focused": c.focused
5568
5568
  })}
5569
5569
  >
5570
5570
  ${when(!!c.label, () => html`
@@ -5743,7 +5743,7 @@ var InputComponent = class InputComponent$1 {
5743
5743
  this.readonly = false;
5744
5744
  this.required = false;
5745
5745
  this.autocomplete = "off";
5746
- this._focused = false;
5746
+ this.focused = false;
5747
5747
  this.handleInput = (event) => {
5748
5748
  this.value = event.target.value;
5749
5749
  this.elementRef.dispatchEvent(new CustomEvent("ml:input", {
@@ -5761,14 +5761,14 @@ var InputComponent = class InputComponent$1 {
5761
5761
  }));
5762
5762
  };
5763
5763
  this.handleFocus = () => {
5764
- this._focused = true;
5764
+ this.focused = true;
5765
5765
  this.elementRef.dispatchEvent(new CustomEvent("ml:focus", {
5766
5766
  bubbles: true,
5767
5767
  composed: true
5768
5768
  }));
5769
5769
  };
5770
5770
  this.handleBlur = () => {
5771
- this._focused = false;
5771
+ this.focused = false;
5772
5772
  this.elementRef.dispatchEvent(new CustomEvent("ml:blur", {
5773
5773
  bubbles: true,
5774
5774
  composed: true
@@ -5806,7 +5806,7 @@ function textareaTemplate(c) {
5806
5806
  "ml-textarea--disabled": c.disabled,
5807
5807
  "ml-textarea--readonly": c.readonly,
5808
5808
  "ml-textarea--error": !!c.error,
5809
- "ml-textarea--focused": c._focused,
5809
+ "ml-textarea--focused": c.focused,
5810
5810
  "ml-textarea--resize": c.resize
5811
5811
  })}
5812
5812
  >
@@ -5971,7 +5971,7 @@ var TextareaComponent = class TextareaComponent$1 {
5971
5971
  this.readonly = false;
5972
5972
  this.required = false;
5973
5973
  this.resize = false;
5974
- this._focused = false;
5974
+ this.focused = false;
5975
5975
  this.handleInput = (event) => {
5976
5976
  this.value = event.target.value;
5977
5977
  this.elementRef.dispatchEvent(new CustomEvent("ml:input", {
@@ -5989,14 +5989,14 @@ var TextareaComponent = class TextareaComponent$1 {
5989
5989
  }));
5990
5990
  };
5991
5991
  this.handleFocus = () => {
5992
- this._focused = true;
5992
+ this.focused = true;
5993
5993
  this.elementRef.dispatchEvent(new CustomEvent("ml:focus", {
5994
5994
  bubbles: true,
5995
5995
  composed: true
5996
5996
  }));
5997
5997
  };
5998
5998
  this.handleBlur = () => {
5999
- this._focused = false;
5999
+ this.focused = false;
6000
6000
  this.elementRef.dispatchEvent(new CustomEvent("ml:blur", {
6001
6001
  bubbles: true,
6002
6002
  composed: true
@@ -15894,7 +15894,7 @@ function renderNavGroup(c, group) {
15894
15894
  function renderNavItem(c, item, level) {
15895
15895
  const isActive = c.active === item.value;
15896
15896
  const hasChildren = !!item.children && item.children.length > 0;
15897
- const isExpanded = c._expandedItems.has(item.value);
15897
+ const isExpanded = c.expandedItems.has(item.value);
15898
15898
  const isCollapsed = c.collapsed;
15899
15899
  const linkClasses = classMap({
15900
15900
  "ml-sidebar__item-link": true,
@@ -15908,7 +15908,7 @@ function renderNavItem(c, item, level) {
15908
15908
  if (item.disabled) return;
15909
15909
  if (hasChildren) {
15910
15910
  event.preventDefault();
15911
- c.handleConfigToggle(item, c._expandedItems);
15911
+ c.handleConfigToggle(item);
15912
15912
  return;
15913
15913
  }
15914
15914
  c.handleConfigItemClick(item.value, item.href);
@@ -16273,10 +16273,11 @@ var SidebarComponent = class SidebarComponent$1 {
16273
16273
  this.handleConfigItemClick = (value, href) => {
16274
16274
  this.activateItem(value, href);
16275
16275
  };
16276
- this.handleConfigToggle = (item, expandedItems) => {
16277
- if (expandedItems.has(item.value)) expandedItems.delete(item.value);
16278
- else expandedItems.add(item.value);
16279
- this.elementRef.dispatchEvent(new Event("ml:internal-update"));
16276
+ this.handleConfigToggle = (item) => {
16277
+ const next = new Set(this.expandedItems);
16278
+ if (next.has(item.value)) next.delete(item.value);
16279
+ else next.add(item.value);
16280
+ this.expandedItems = next;
16280
16281
  };
16281
16282
  this.handleKeyDown = (event) => {
16282
16283
  const sidebar = this.elementRef.shadowRoot?.querySelector(".ml-sidebar__main");
@@ -16305,7 +16306,7 @@ var SidebarComponent = class SidebarComponent$1 {
16305
16306
  }
16306
16307
  if (newIndex !== currentIndex && focusable[newIndex]) focusable[newIndex].focus();
16307
16308
  };
16308
- this._expandedItems = /* @__PURE__ */ new Set();
16309
+ this.expandedItems = /* @__PURE__ */ new Set();
16309
16310
  }
16310
16311
  get hasSearch() {
16311
16312
  return this.elementRef?.querySelector("[slot=\"search\"]") !== null;
@@ -19697,8 +19698,8 @@ function appShellTemplate(c) {
19697
19698
  const sidebarRight = c["sidebar-position"] === "right";
19698
19699
  const collapsed = c["sidebar-collapsed"];
19699
19700
  const headerFixed = c["header-fixed"];
19700
- const mobileOpen = c._mobileOpen;
19701
- const isMobile = c.isMobile;
19701
+ const mobileOpen = c.mobileOpen;
19702
+ const isMobile = c.mobile;
19702
19703
  return html`
19703
19704
  <div
19704
19705
  class=${classMap({
@@ -19945,29 +19946,28 @@ var AppShellComponent = class AppShellComponent$1 {
19945
19946
  this["sidebar-position"] = "left";
19946
19947
  this["sidebar-collapsed"] = false;
19947
19948
  this["header-fixed"] = false;
19948
- this._mobileOpen = false;
19949
+ this.mobile = false;
19950
+ this.mobileOpen = false;
19949
19951
  this._mediaQuery = null;
19950
19952
  this._handleMediaChange = this.onMediaChange.bind(this);
19951
19953
  this.toggleMobileSidebar = () => {
19952
- this._mobileOpen = !this._mobileOpen;
19954
+ this.mobileOpen = !this.mobileOpen;
19953
19955
  };
19954
19956
  this.closeMobileSidebar = () => {
19955
- this._mobileOpen = false;
19957
+ this.mobileOpen = false;
19956
19958
  };
19957
19959
  }
19958
- get isMobile() {
19959
- return this._mediaQuery?.matches === false;
19960
- }
19961
19960
  onCreate() {
19962
19961
  this._mediaQuery = window.matchMedia("(min-width: 768px)");
19963
19962
  this._mediaQuery.addEventListener("change", this._handleMediaChange);
19964
- if (!this.isMobile) this._mobileOpen = false;
19963
+ this.mobile = !this._mediaQuery.matches;
19965
19964
  }
19966
19965
  onDestroy() {
19967
19966
  this._mediaQuery?.removeEventListener("change", this._handleMediaChange);
19968
19967
  }
19969
19968
  onMediaChange(event) {
19970
- if (event.matches) this._mobileOpen = false;
19969
+ this.mobile = !event.matches;
19970
+ if (event.matches) this.mobileOpen = false;
19971
19971
  }
19972
19972
  };
19973
19973
  AppShellComponent = __decorate([MelodicComponent({