aq-fe-framework 0.1.619 → 0.1.620

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.
@@ -14359,21 +14359,37 @@ function BasicAppShell({ children, menu, extraTopRight, title, logoutRedirect, i
14359
14359
  var _a, _b, _c;
14360
14360
  if (!pageContentQuery.data) return;
14361
14361
  const currentItem = allChildItems.find((item) => pathname.includes(item.link));
14362
- const currentPermission = (_a = permissionStore.state.permission) == null ? void 0 : _a.find((item) => item.pageId == (currentItem == null ? void 0 : currentItem.pageId));
14363
- setIsLoadingPermission(false);
14364
14362
  if (!currentItem) return;
14363
+ const currentPermission = (_a = permissionStore.state.permission) == null ? void 0 : _a.find((item) => item.pageId === currentItem.pageId);
14365
14364
  const breadcrumb = findBreadcrumbPath(filteredMenu, currentItem.link);
14366
- appShellStore.setProperty("description", (_c = (_b = pageContentQuery.data) == null ? void 0 : _b.find((item) => item.id == currentItem.pageId)) == null ? void 0 : _c.description);
14367
- appShellStore.setProperty("currentPageId", currentItem.pageId);
14368
- appShellStore.setProperty("breadcrumb", breadcrumb);
14369
- appShellStore.setProperty("title", currentItem.label);
14370
- appShellStore.setProperty("menuCode", currentItem.link);
14371
- appShellStore.setProperty("note", currentItem.note);
14372
- appShellStore.setProperty("status", currentItem.status);
14373
- setIsAccessible(currentItem.pageId ? readablePageIds.has(currentItem.pageId) : false);
14374
- permissionStore.setProperty("currentPermissionPage", currentPermission);
14365
+ const description = (_c = (_b = pageContentQuery.data) == null ? void 0 : _b.find((item) => item.id === currentItem.pageId)) == null ? void 0 : _c.description;
14366
+ const { state: appShellState, setProperty: setAppShellProperty } = appShellStore;
14367
+ const { state: permissionState, setProperty: setPermissionProperty } = permissionStore;
14368
+ if (appShellState.description !== description) {
14369
+ setAppShellProperty("description", description);
14370
+ }
14371
+ if (appShellState.currentPageId !== currentItem.pageId) {
14372
+ setAppShellProperty("currentPageId", currentItem.pageId);
14373
+ }
14374
+ if (JSON.stringify(appShellState.breadcrumb) !== JSON.stringify(breadcrumb)) {
14375
+ setAppShellProperty("breadcrumb", breadcrumb);
14376
+ }
14377
+ if (appShellState.title !== currentItem.label) {
14378
+ setAppShellProperty("title", currentItem.label);
14379
+ }
14380
+ if (appShellState.menuCode !== currentItem.link) {
14381
+ setAppShellProperty("menuCode", currentItem.link);
14382
+ }
14383
+ if (appShellState.note !== currentItem.note) {
14384
+ setAppShellProperty("note", currentItem.note);
14385
+ }
14386
+ if (appShellState.status !== currentItem.status) {
14387
+ setAppShellProperty("status", currentItem.status);
14388
+ }
14389
+ const newAccessible = currentItem.pageId ? readablePageIds.has(currentItem.pageId) : false;
14390
+ setIsAccessible(newAccessible);
14375
14391
  if (isDev) {
14376
- permissionStore.setProperty("currentPermissionPage", {
14392
+ const devPermission = {
14377
14393
  isCreate: true,
14378
14394
  isRead: true,
14379
14395
  isDelete: true,
@@ -14381,9 +14397,17 @@ function BasicAppShell({ children, menu, extraTopRight, title, logoutRedirect, i
14381
14397
  isPrint: true,
14382
14398
  isUpdate: true,
14383
14399
  pageId: currentItem == null ? void 0 : currentItem.pageId
14384
- });
14400
+ };
14401
+ if (JSON.stringify(permissionState.currentPermissionPage) !== JSON.stringify(devPermission)) {
14402
+ setPermissionProperty("currentPermissionPage", devPermission);
14403
+ }
14404
+ } else {
14405
+ if (JSON.stringify(permissionState.currentPermissionPage) !== JSON.stringify(currentPermission)) {
14406
+ setPermissionProperty("currentPermissionPage", currentPermission);
14407
+ }
14385
14408
  }
14386
- }, [pathname, allChildItems, filteredMenu, readablePageIds, pageContentQuery.data]);
14409
+ setIsLoadingPermission(false);
14410
+ }, [pathname, allChildItems, filteredMenu, readablePageIds, pageContentQuery.data, isDev]);
14387
14411
  const renderHeader = () => /* @__PURE__ */ jsx197(AppShell.Header, { children: media ? /* @__PURE__ */ jsxs112(Group23, { h: "100%", px: "md", justify: "space-between", children: [
14388
14412
  /* @__PURE__ */ jsxs112(Group23, { h: "100%", children: [
14389
14413
  /* @__PURE__ */ jsx197(Tooltip6, { label: appShellStore.state.opened ? "\u1EA8n thanh menu" : "Hi\u1EC7n thanh menu", children: /* @__PURE__ */ jsx197(ActionIcon14, { variant: "default", size: "lg", radius: "md", onClick: appShellStore.toggle, children: appShellStore.state.opened ? /* @__PURE__ */ jsx197(IconLayoutSidebarLeftExpand, {}) : /* @__PURE__ */ jsx197(IconLayoutSidebarLeftCollapse, {}) }) }),
@@ -68,7 +68,7 @@ import {
68
68
  useHeaderMegaMenuStore,
69
69
  useS_ButtonImport,
70
70
  useStore_BasicAppShell
71
- } from "../chunk-SVWLCEYL.mjs";
71
+ } from "../chunk-EB7FHBHN.mjs";
72
72
  import "../chunk-PW6WTEVB.mjs";
73
73
  import "../chunk-5COIJ2CE.mjs";
74
74
  import "../chunk-7PUDC2WF.mjs";
@@ -23,7 +23,7 @@ import {
23
23
  MyStatsCard,
24
24
  MyTextInput2 as MyTextInput,
25
25
  MyWeeklySessionSchedulerPicker
26
- } from "../chunk-SVWLCEYL.mjs";
26
+ } from "../chunk-EB7FHBHN.mjs";
27
27
  import "../chunk-PW6WTEVB.mjs";
28
28
  import "../chunk-5COIJ2CE.mjs";
29
29
  import "../chunk-7PUDC2WF.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MyModalDelete
3
- } from "../chunk-SVWLCEYL.mjs";
3
+ } from "../chunk-EB7FHBHN.mjs";
4
4
  import "../chunk-PW6WTEVB.mjs";
5
5
  import "../chunk-5COIJ2CE.mjs";
6
6
  import "../chunk-7PUDC2WF.mjs";
@@ -102,7 +102,7 @@ import {
102
102
  Feat_accessControlLevel,
103
103
  useS_authenticate,
104
104
  useS_moduleConfig
105
- } from "../chunk-SVWLCEYL.mjs";
105
+ } from "../chunk-EB7FHBHN.mjs";
106
106
  import "../chunk-PW6WTEVB.mjs";
107
107
  import "../chunk-5COIJ2CE.mjs";
108
108
  import "../chunk-7PUDC2WF.mjs";
package/package.json CHANGED
@@ -50,7 +50,7 @@
50
50
  "types": "./dist/types/index.d.mts"
51
51
  }
52
52
  },
53
- "version": "0.1.619",
53
+ "version": "0.1.620",
54
54
  "private": false,
55
55
  "files": [
56
56
  "dist"