@kodaris/krubble-app-components 1.0.6 → 1.0.8

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,5 +1,5 @@
1
1
  import { KRContextMenu, KRDialog } from '@kodaris/krubble-components';
2
- import { KRClient } from '@kodaris/krubble-data';
2
+ import { KRHttp } from '@kodaris/krubble-http';
3
3
 
4
4
  /**
5
5
  * @license
@@ -1192,10 +1192,6 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators,
1192
1192
  let KRScaffold = class KRScaffold extends i$1 {
1193
1193
  constructor() {
1194
1194
  super();
1195
- /**
1196
- * HTTP client for API calls
1197
- */
1198
- this.http = KRClient.getInstance();
1199
1195
  /**
1200
1196
  * Default icon for nav items without an icon (shown at top level)
1201
1197
  */
@@ -1245,10 +1241,7 @@ let KRScaffold = class KRScaffold extends i$1 {
1245
1241
  updated(changedProperties) {
1246
1242
  super.updated(changedProperties);
1247
1243
  if (changedProperties.has('nav') && this.nav.length > 0) {
1248
- // Only auto-set active item on initial nav load, not on subsequent updates
1249
- if (this.activeNavItemId === null) {
1250
- this.updateActiveNavItem();
1251
- }
1244
+ this.updateActiveNavItem();
1252
1245
  if (this.navExpanded && !this.navInitialized) {
1253
1246
  this.navInitialized = true;
1254
1247
  this.getComputedNav()
@@ -1558,13 +1551,14 @@ let KRScaffold = class KRScaffold extends i$1 {
1558
1551
  const url = this.pref.uuid
1559
1552
  ? `/api/system/preference/json/scaffold/${this.pref.uuid}?global=true`
1560
1553
  : `/api/system/preference/json/scaffold?global=true`;
1561
- this.http.fetch({
1554
+ KRHttp.fetch({
1562
1555
  url,
1563
1556
  method: this.pref.uuid ? 'PUT' : 'POST',
1564
1557
  body: JSON.stringify({ nav: this.pref.nav }),
1565
1558
  })
1566
- .then((response) => {
1567
- this.pref = response.data;
1559
+ .then((response) => response.json())
1560
+ .then((data) => {
1561
+ this.pref = data.data;
1568
1562
  this.isEditing = false;
1569
1563
  })
1570
1564
  .catch((error) => {
@@ -1572,12 +1566,13 @@ let KRScaffold = class KRScaffold extends i$1 {
1572
1566
  });
1573
1567
  }
1574
1568
  loadPref() {
1575
- this.http.fetch({
1569
+ KRHttp.fetch({
1576
1570
  url: '/api/system/preference/json/scaffold?global=true',
1577
1571
  method: 'GET',
1578
1572
  })
1579
- .then((response) => {
1580
- const pref = response?.data?.[0];
1573
+ .then((response) => response.json())
1574
+ .then((data) => {
1575
+ const pref = data?.data?.[0];
1581
1576
  if (pref) {
1582
1577
  this.pref = pref;
1583
1578
  }