@amirjalili1374/ui-kit 1.3.34 → 1.4.1

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.
Files changed (62) hide show
  1. package/dist/components/layout/AppHeader.vue.d.ts.map +1 -1
  2. package/dist/components/shared/ConfirmDialog.vue.d.ts +1 -1
  3. package/dist/components/shared/CustomAutocomplete.vue.d.ts +2 -2
  4. package/dist/components/shared/CustomDataTable.vue.d.ts +1 -1
  5. package/dist/components/shared/DescriptionInput.vue.d.ts +3 -3
  6. package/dist/components/shared/MoneyInput.vue.d.ts +4 -4
  7. package/dist/components/shared/PdfViewer.vue.d.ts +1 -1
  8. package/dist/components/shared/ShamsiDatePicker.vue.d.ts +8 -8
  9. package/dist/index.d.ts +4 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/plugins/key-clock.d.ts +70 -0
  12. package/dist/plugins/key-clock.d.ts.map +1 -0
  13. package/dist/plugins/vuetify.d.ts +92 -0
  14. package/dist/plugins/vuetify.d.ts.map +1 -0
  15. package/dist/style.css +1 -1
  16. package/dist/theme/darkThemes/DarkModernTheme.d.ts +4 -0
  17. package/dist/theme/darkThemes/DarkModernTheme.d.ts.map +1 -0
  18. package/dist/theme/darkThemes/DarkOrangeTheme.d.ts +4 -0
  19. package/dist/theme/darkThemes/DarkOrangeTheme.d.ts.map +1 -0
  20. package/dist/theme/darkThemes/DarkPurpleTheme.d.ts +4 -0
  21. package/dist/theme/darkThemes/DarkPurpleTheme.d.ts.map +1 -0
  22. package/dist/theme/darkThemes/DarkRedTheme.d.ts +4 -0
  23. package/dist/theme/darkThemes/DarkRedTheme.d.ts.map +1 -0
  24. package/dist/theme/darkThemes/DarkSilverTheme.d.ts +4 -0
  25. package/dist/theme/darkThemes/DarkSilverTheme.d.ts.map +1 -0
  26. package/dist/theme/darkThemes/DarkSteelTealGreen.d.ts +4 -0
  27. package/dist/theme/darkThemes/DarkSteelTealGreen.d.ts.map +1 -0
  28. package/dist/theme/darkThemes/DarkTealTheme.d.ts +4 -0
  29. package/dist/theme/darkThemes/DarkTealTheme.d.ts.map +1 -0
  30. package/dist/theme/lightThemes/ModernTheme.d.ts +4 -0
  31. package/dist/theme/lightThemes/ModernTheme.d.ts.map +1 -0
  32. package/dist/theme/lightThemes/OrangeTheme.d.ts +4 -0
  33. package/dist/theme/lightThemes/OrangeTheme.d.ts.map +1 -0
  34. package/dist/theme/lightThemes/PurpleTheme.d.ts +4 -0
  35. package/dist/theme/lightThemes/PurpleTheme.d.ts.map +1 -0
  36. package/dist/theme/lightThemes/RedTheme.d.ts +4 -0
  37. package/dist/theme/lightThemes/RedTheme.d.ts.map +1 -0
  38. package/dist/theme/lightThemes/SilverTheme.d.ts +4 -0
  39. package/dist/theme/lightThemes/SilverTheme.d.ts.map +1 -0
  40. package/dist/theme/lightThemes/SteelTealGreen.d.ts +4 -0
  41. package/dist/theme/lightThemes/SteelTealGreen.d.ts.map +1 -0
  42. package/dist/theme/lightThemes/TealTheme.d.ts +4 -0
  43. package/dist/theme/lightThemes/TealTheme.d.ts.map +1 -0
  44. package/dist/types/themeTypes/ThemeType.d.ts +47 -0
  45. package/dist/types/themeTypes/ThemeType.d.ts.map +1 -0
  46. package/dist/ui-kit.cjs.js +1 -1
  47. package/dist/ui-kit.cjs.js.map +1 -1
  48. package/dist/ui-kit.es.js +521 -171
  49. package/dist/ui-kit.es.js.map +1 -1
  50. package/dist/utils/appInitializer/AppBootstrap.d.ts +90 -0
  51. package/dist/utils/appInitializer/AppBootstrap.d.ts.map +1 -0
  52. package/dist/utils/appInitializer/AuthModeInitializer.d.ts +38 -0
  53. package/dist/utils/appInitializer/AuthModeInitializer.d.ts.map +1 -0
  54. package/dist/utils/appInitializer/InitializerModeInitializer.d.ts +29 -0
  55. package/dist/utils/appInitializer/InitializerModeInitializer.d.ts.map +1 -0
  56. package/dist/utils/appInitializer/JwtInitializer.d.ts +21 -0
  57. package/dist/utils/appInitializer/JwtInitializer.d.ts.map +1 -0
  58. package/dist/utils/appInitializer/KeycloakInitializer.d.ts +18 -0
  59. package/dist/utils/appInitializer/KeycloakInitializer.d.ts.map +1 -0
  60. package/dist/utils/appInitializer/index.d.ts +17 -0
  61. package/dist/utils/appInitializer/index.d.ts.map +1 -0
  62. package/package.json +5 -1
package/dist/ui-kit.es.js CHANGED
@@ -1,9 +1,13 @@
1
+ var __defProp2 = Object.defineProperty;
2
+ var __defNormalProp2 = (obj, key2, value2) => key2 in obj ? __defProp2(obj, key2, { enumerable: true, configurable: true, writable: true, value: value2 }) : obj[key2] = value2;
3
+ var __publicField = (obj, key2, value2) => __defNormalProp2(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value2);
1
4
  import { capitalize, reactive, watchEffect, toRef, shallowRef, Fragment, camelize, isVNode, Comment, unref, warn, getCurrentInstance as getCurrentInstance$1, ref, computed, provide, inject, defineComponent as defineComponent$1, h, createElementVNode, normalizeStyle, normalizeClass, toValue, resolveDynamicComponent, nextTick, onScopeDispose, createVNode, mergeProps, toRefs, Text, isRef, TransitionGroup, Transition, watch, onBeforeMount, onBeforeUnmount, withDirectives, vShow, toDisplayString, effectScope, toRaw, readonly, createBlock, openBlock, withCtx, createCommentVNode, useId, onMounted, onUpdated, Teleport, createTextVNode, createElementBlock, renderSlot, onDeactivated, cloneVNode, renderList, createSlots, normalizeProps, guardReactiveProps, resolveComponent, onActivated, onBeforeUpdate, withModifiers, vModelText, withKeys, onUnmounted } from "vue";
2
5
  import { IconHome, IconArrowBadgeLeft, IconChevronDown, IconChevronRight, IconMinus, IconPlus, IconRefresh, IconChevronLeft, IconDownload, IconPrinter, IconMaximize, IconMinimize, IconX, IconFileText, IconCheck, IconPencil, IconClock, IconMenu2, IconPalette } from "@tabler/icons-vue";
3
6
  import axios from "axios";
4
7
  import { useDebounceFn } from "@vueuse/core";
5
8
  import { useRouter as useRouter$1 } from "vue-router";
6
9
  import { defineStore } from "pinia";
10
+ import VueKeycloakJs from "@dsb-norge/vue-keycloak-js";
7
11
  function propsFactory(props, source) {
8
12
  return (defaults) => {
9
13
  return Object.keys(props).reduce((obj, prop) => {
@@ -3887,7 +3891,7 @@ const VRow = genericComponent()({
3887
3891
  const VSpacer = createSimpleFunctional("v-spacer", "div", "VSpacer");
3888
3892
  const _hoisted_1$d = { class: "text-h3" };
3889
3893
  const _hoisted_2$7 = { class: "d-flex align-center gap-2" };
3890
- const _hoisted_3$5 = { class: "d-flex align-center gap-2" };
3894
+ const _hoisted_3$6 = { class: "d-flex align-center gap-2" };
3891
3895
  const _sfc_main$l = /* @__PURE__ */ defineComponent$1({
3892
3896
  __name: "BaseBreadcrumb",
3893
3897
  props: {
@@ -3941,7 +3945,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent$1({
3941
3945
  size: "16",
3942
3946
  class: "text-secondary ml-2"
3943
3947
  }),
3944
- createElementVNode("div", _hoisted_3$5, [
3948
+ createElementVNode("div", _hoisted_3$6, [
3945
3949
  createVNode(unref(IconArrowBadgeLeft), { stroke: "{2}" })
3946
3950
  ])
3947
3951
  ]),
@@ -12593,7 +12597,7 @@ const VTooltip = genericComponent()({
12593
12597
  });
12594
12598
  const _hoisted_1$b = { class: "ca-item-title" };
12595
12599
  const _hoisted_2$6 = { class: "ca-item-subtitle" };
12596
- const _hoisted_3$4 = { class: "ca-group-tooltip" };
12600
+ const _hoisted_3$5 = { class: "ca-group-tooltip" };
12597
12601
  const _hoisted_4$2 = { class: "ca-group-tooltip-header" };
12598
12602
  const _hoisted_5$2 = { class: "ca-group-count" };
12599
12603
  const _hoisted_6$2 = { class: "ca-group-members" };
@@ -12746,7 +12750,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent$1({
12746
12750
  item: item.raw ?? item,
12747
12751
  groupMembers: getGroupMembers(item.raw ?? item)
12748
12752
  }, () => [
12749
- createElementVNode("div", _hoisted_3$4, [
12753
+ createElementVNode("div", _hoisted_3$5, [
12750
12754
  createElementVNode("div", _hoisted_4$2, [
12751
12755
  createElementVNode("strong", null, toDisplayString(resolveTitle(item.raw ?? item)), 1),
12752
12756
  createElementVNode("span", _hoisted_5$2, toDisplayString(getGroupMembers(item.raw ?? item).length) + " آیتم", 1)
@@ -16922,7 +16926,7 @@ const _hoisted_1$9 = {
16922
16926
  class: "page-title"
16923
16927
  };
16924
16928
  const _hoisted_2$5 = { class: "title-text" };
16925
- const _hoisted_3$3 = { class: "action-buttons" };
16929
+ const _hoisted_3$4 = { class: "action-buttons" };
16926
16930
  const _hoisted_4$1 = {
16927
16931
  key: 3,
16928
16932
  class: "selection-actions"
@@ -17887,7 +17891,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
17887
17891
  props.title ? (openBlock(), createElementBlock("div", _hoisted_1$9, [
17888
17892
  createElementVNode("h3", _hoisted_2$5, toDisplayString(props.title), 1)
17889
17893
  ])) : createCommentVNode("", true),
17890
- createElementVNode("div", _hoisted_3$3, [
17894
+ createElementVNode("div", _hoisted_3$4, [
17891
17895
  ((_a = props.actions) == null ? void 0 : _a.includes("create")) ? (openBlock(), createBlock(VBtn, {
17892
17896
  key: 0,
17893
17897
  color: "green",
@@ -19348,7 +19352,7 @@ const _hoisted_1$6 = {
19348
19352
  class: "pdf-viewer-header"
19349
19353
  };
19350
19354
  const _hoisted_2$4 = { class: "pdf-viewer-title" };
19351
- const _hoisted_3$2 = { class: "pdf-viewer-controls" };
19355
+ const _hoisted_3$3 = { class: "pdf-viewer-controls" };
19352
19356
  const _hoisted_4 = {
19353
19357
  key: 0,
19354
19358
  class: "zoom-controls"
@@ -19598,7 +19602,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent$1({
19598
19602
  createElementVNode("div", _hoisted_2$4, [
19599
19603
  createElementVNode("h3", null, toDisplayString(__props.title || "PDF Viewer"), 1)
19600
19604
  ]),
19601
- createElementVNode("div", _hoisted_3$2, [
19605
+ createElementVNode("div", _hoisted_3$3, [
19602
19606
  __props.showZoomControls ? (openBlock(), createElementBlock("div", _hoisted_4, [
19603
19607
  createVNode(VBtn, {
19604
19608
  size: "small",
@@ -19992,7 +19996,7 @@ const _hoisted_1$4 = {
19992
19996
  dir: "rtl"
19993
19997
  };
19994
19998
  const _hoisted_2$3 = { class: "app-stepper-header-card" };
19995
- const _hoisted_3$1 = { class: "app-stepper-title" };
19999
+ const _hoisted_3$2 = { class: "app-stepper-title" };
19996
20000
  const _sfc_main$8 = /* @__PURE__ */ defineComponent$1({
19997
20001
  __name: "AppStepper",
19998
20002
  props: {
@@ -20087,7 +20091,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent$1({
20087
20091
  }))
20088
20092
  ], true)
20089
20093
  ], 2),
20090
- createElementVNode("span", _hoisted_3$1, toDisplayString(step.title), 1),
20094
+ createElementVNode("span", _hoisted_3$2, toDisplayString(step.title), 1),
20091
20095
  index2 < __props.steps.length - 1 ? (openBlock(), createElementBlock("span", {
20092
20096
  key: 0,
20093
20097
  class: normalizeClass([
@@ -36919,7 +36923,7 @@ const _hoisted_1$3 = {
36919
36923
  class: "loading-overlay"
36920
36924
  };
36921
36925
  const _hoisted_2$2 = { class: "loading-wrapper" };
36922
- const _hoisted_3 = { key: 0 };
36926
+ const _hoisted_3$1 = { key: 0 };
36923
36927
  const _sfc_main$6 = /* @__PURE__ */ defineComponent$1({
36924
36928
  __name: "Loading",
36925
36929
  setup(__props) {
@@ -36937,7 +36941,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent$1({
36937
36941
  }),
36938
36942
  createVNode(Transition, { name: "fade-slide" }, {
36939
36943
  default: withCtx(() => [
36940
- unref(customizer).loading ? (openBlock(), createElementBlock("span", _hoisted_3, "لطفا منتظر بمانید")) : createCommentVNode("", true)
36944
+ unref(customizer).loading ? (openBlock(), createElementBlock("span", _hoisted_3$1, "لطفا منتظر بمانید")) : createCommentVNode("", true)
36941
36945
  ]),
36942
36946
  _: 1
36943
36947
  })
@@ -38133,11 +38137,12 @@ const VAppBar = genericComponent()({
38133
38137
  return {};
38134
38138
  }
38135
38139
  });
38136
- const _hoisted_1$1 = {
38140
+ const _hoisted_1$1 = { class: "header-left-section" };
38141
+ const _hoisted_2 = {
38137
38142
  key: 1,
38138
38143
  class: "header-menu-container"
38139
38144
  };
38140
- const _hoisted_2 = { class: "mr-2" };
38145
+ const _hoisted_3 = { class: "mr-2" };
38141
38146
  const _sfc_main$1 = /* @__PURE__ */ defineComponent$1({
38142
38147
  __name: "AppHeader",
38143
38148
  props: {
@@ -38184,163 +38189,165 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent$1({
38184
38189
  class: "app-header topbar"
38185
38190
  }, {
38186
38191
  default: withCtx(() => [
38187
- __props.menuOrientation === "vertical" ? (openBlock(), createBlock(VBtn, {
38188
- key: 0,
38189
- class: "hidden-md-and-down text-secondary",
38190
- color: "lightsecondary",
38191
- icon: "",
38192
- rounded: "sm",
38193
- variant: "flat",
38194
- size: "small",
38195
- onClick: _cache[0] || (_cache[0] = withModifiers(($event) => props.onToggleMiniSidebar && props.onToggleMiniSidebar(), ["stop"]))
38196
- }, {
38197
- default: withCtx(() => [
38198
- createVNode(unref(IconMenu2), {
38199
- size: "20",
38200
- "stroke-width": "1.5"
38201
- })
38202
- ]),
38203
- _: 1
38204
- })) : createCommentVNode("", true),
38205
- createVNode(VBtn, {
38206
- class: "hidden-lg-and-up text-secondary ms-3",
38207
- color: "lightsecondary",
38208
- icon: "",
38209
- rounded: "sm",
38210
- variant: "flat",
38211
- size: "small",
38212
- onClick: _cache[1] || (_cache[1] = withModifiers(($event) => props.onToggleSidebarDrawer && props.onToggleSidebarDrawer(), ["stop"]))
38213
- }, {
38214
- default: withCtx(() => [
38215
- createVNode(unref(IconMenu2), {
38216
- size: "20",
38217
- "stroke-width": "1.5"
38218
- })
38219
- ]),
38220
- _: 1
38221
- }),
38222
- createVNode(VBtn, {
38223
- class: "hidden-md-and-down text-secondary mr-2 ml-2",
38224
- color: "lightsecondary",
38225
- icon: "",
38226
- rounded: "sm",
38227
- variant: "flat",
38228
- size: "small",
38229
- onClick: _cache[2] || (_cache[2] = withModifiers(($event) => props.onToggleCustomizer && props.onToggleCustomizer(), ["stop"]))
38230
- }, {
38231
- default: withCtx(() => [
38232
- createVNode(unref(IconPalette), {
38233
- size: "20",
38234
- "stroke-width": "1.5"
38235
- })
38236
- ]),
38237
- _: 1
38238
- }),
38239
- __props.menuOrientation === "horizontal" ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
38240
- (openBlock(true), createElementBlock(Fragment, null, renderList(computedHeaderMenu.value, (item, i) => {
38241
- return openBlock(), createElementBlock(Fragment, { key: i }, [
38242
- !item.children && !item.header && !item.divider ? (openBlock(), createBlock(VBtn, {
38243
- key: 0,
38244
- to: item.type === "external" ? "" : item.to,
38245
- href: item.type === "external" ? item.to : "",
38246
- target: item.type === "external" ? "_blank" : "",
38247
- variant: "text",
38248
- disabled: item.disabled,
38249
- class: "header-menu-btn mr-3",
38250
- color: "primary"
38251
- }, {
38252
- default: withCtx(() => [
38253
- item.icon ? (openBlock(), createBlock(resolveDynamicComponent(item.icon), {
38254
- key: 0,
38255
- class: "ml-2",
38256
- size: "18"
38257
- })) : createCommentVNode("", true),
38258
- createElementVNode("span", null, toDisplayString(item.title), 1),
38259
- item.chip ? (openBlock(), createBlock(VChip, {
38260
- key: 1,
38261
- color: item.chipColor,
38262
- size: item.chipIcon ? "small" : "default",
38263
- variant: item.chipVariant,
38264
- "prepend-icon": item.chipIcon,
38265
- class: "ml-2"
38266
- }, {
38267
- default: withCtx(() => [
38268
- createTextVNode(toDisplayString(item.chip), 1)
38269
- ]),
38270
- _: 2
38271
- }, 1032, ["color", "size", "variant", "prepend-icon"])) : createCommentVNode("", true)
38272
- ]),
38273
- _: 2
38274
- }, 1032, ["to", "href", "target", "disabled"])) : item.children && item.children.length > 0 ? (openBlock(), createBlock(VMenu, {
38275
- key: 1,
38276
- "offset-y": ""
38277
- }, {
38278
- activator: withCtx(({ props: mprops }) => [
38279
- createVNode(VBtn, mergeProps({ ref_for: true }, mprops, {
38280
- variant: "text",
38281
- disabled: item.disabled,
38282
- class: "header-menu-btn",
38283
- color: "primary mr-3"
38284
- }), {
38285
- default: withCtx(() => [
38286
- item.icon ? (openBlock(), createBlock(resolveDynamicComponent(item.icon), {
38287
- key: 0,
38288
- class: "mr-2",
38289
- size: "18"
38290
- })) : createCommentVNode("", true),
38291
- createElementVNode("span", _hoisted_2, toDisplayString(item.title), 1),
38292
- createVNode(unref(IconChevronDown), {
38293
- size: "20",
38294
- class: "ml-2",
38295
- "stroke-width": "1.5"
38296
- })
38297
- ]),
38298
- _: 2
38299
- }, 1040, ["disabled"])
38300
- ]),
38301
- default: withCtx(() => [
38302
- createVNode(VList, null, {
38303
- default: withCtx(() => [
38304
- (openBlock(true), createElementBlock(Fragment, null, renderList(item.children, (child, childIndex) => {
38305
- return openBlock(), createBlock(VListItem, {
38306
- key: childIndex,
38307
- to: child.type === "external" ? "" : child.to,
38308
- href: child.type === "external" ? child.to : "",
38309
- target: child.type === "external" ? "_blank" : "",
38310
- disabled: child.disabled
38311
- }, createSlots({
38312
- default: withCtx(() => [
38313
- createVNode(VListItemTitle, null, {
38314
- default: withCtx(() => [
38315
- createTextVNode(toDisplayString(child.title), 1)
38316
- ]),
38317
- _: 2
38318
- }, 1024)
38319
- ]),
38320
- _: 2
38321
- }, [
38322
- child.icon ? {
38323
- name: "prepend",
38324
- fn: withCtx(() => [
38325
- (openBlock(), createBlock(resolveDynamicComponent(child.icon), { size: "18" }))
38192
+ createElementVNode("div", _hoisted_1$1, [
38193
+ __props.menuOrientation === "vertical" ? (openBlock(), createBlock(VBtn, {
38194
+ key: 0,
38195
+ class: "hidden-md-and-down text-secondary",
38196
+ color: "lightsecondary",
38197
+ icon: "",
38198
+ rounded: "sm",
38199
+ variant: "flat",
38200
+ size: "small",
38201
+ onClick: _cache[0] || (_cache[0] = withModifiers(($event) => props.onToggleMiniSidebar && props.onToggleMiniSidebar(), ["stop"]))
38202
+ }, {
38203
+ default: withCtx(() => [
38204
+ createVNode(unref(IconMenu2), {
38205
+ size: "20",
38206
+ "stroke-width": "1.5"
38207
+ })
38208
+ ]),
38209
+ _: 1
38210
+ })) : createCommentVNode("", true),
38211
+ createVNode(VBtn, {
38212
+ class: "hidden-lg-and-up text-secondary ms-3",
38213
+ color: "lightsecondary",
38214
+ icon: "",
38215
+ rounded: "sm",
38216
+ variant: "flat",
38217
+ size: "small",
38218
+ onClick: _cache[1] || (_cache[1] = withModifiers(($event) => props.onToggleSidebarDrawer && props.onToggleSidebarDrawer(), ["stop"]))
38219
+ }, {
38220
+ default: withCtx(() => [
38221
+ createVNode(unref(IconMenu2), {
38222
+ size: "20",
38223
+ "stroke-width": "1.5"
38224
+ })
38225
+ ]),
38226
+ _: 1
38227
+ }),
38228
+ createVNode(VBtn, {
38229
+ class: "hidden-md-and-down text-secondary ml-2",
38230
+ color: "lightsecondary",
38231
+ icon: "",
38232
+ rounded: "sm",
38233
+ variant: "flat",
38234
+ size: "small",
38235
+ onClick: _cache[2] || (_cache[2] = withModifiers(($event) => props.onToggleCustomizer && props.onToggleCustomizer(), ["stop"]))
38236
+ }, {
38237
+ default: withCtx(() => [
38238
+ createVNode(unref(IconPalette), {
38239
+ size: "20",
38240
+ "stroke-width": "1.5"
38241
+ })
38242
+ ]),
38243
+ _: 1
38244
+ }),
38245
+ __props.menuOrientation === "horizontal" ? (openBlock(), createElementBlock("div", _hoisted_2, [
38246
+ (openBlock(true), createElementBlock(Fragment, null, renderList(computedHeaderMenu.value, (item, i) => {
38247
+ return openBlock(), createElementBlock(Fragment, { key: i }, [
38248
+ !item.children && !item.header && !item.divider ? (openBlock(), createBlock(VBtn, {
38249
+ key: 0,
38250
+ to: item.type === "external" ? "" : item.to,
38251
+ href: item.type === "external" ? item.to : "",
38252
+ target: item.type === "external" ? "_blank" : "",
38253
+ variant: "text",
38254
+ disabled: item.disabled,
38255
+ class: "header-menu-btn mr-3",
38256
+ color: "primary"
38257
+ }, {
38258
+ default: withCtx(() => [
38259
+ item.icon ? (openBlock(), createBlock(resolveDynamicComponent(item.icon), {
38260
+ key: 0,
38261
+ class: "ml-2",
38262
+ size: "18"
38263
+ })) : createCommentVNode("", true),
38264
+ createElementVNode("span", null, toDisplayString(item.title), 1),
38265
+ item.chip ? (openBlock(), createBlock(VChip, {
38266
+ key: 1,
38267
+ color: item.chipColor,
38268
+ size: item.chipIcon ? "small" : "default",
38269
+ variant: item.chipVariant,
38270
+ "prepend-icon": item.chipIcon,
38271
+ class: "ml-2"
38272
+ }, {
38273
+ default: withCtx(() => [
38274
+ createTextVNode(toDisplayString(item.chip), 1)
38275
+ ]),
38276
+ _: 2
38277
+ }, 1032, ["color", "size", "variant", "prepend-icon"])) : createCommentVNode("", true)
38278
+ ]),
38279
+ _: 2
38280
+ }, 1032, ["to", "href", "target", "disabled"])) : item.children && item.children.length > 0 ? (openBlock(), createBlock(VMenu, {
38281
+ key: 1,
38282
+ "offset-y": ""
38283
+ }, {
38284
+ activator: withCtx(({ props: mprops }) => [
38285
+ createVNode(VBtn, mergeProps({ ref_for: true }, mprops, {
38286
+ variant: "text",
38287
+ disabled: item.disabled,
38288
+ class: "header-menu-btn",
38289
+ color: "primary mr-3"
38290
+ }), {
38291
+ default: withCtx(() => [
38292
+ item.icon ? (openBlock(), createBlock(resolveDynamicComponent(item.icon), {
38293
+ key: 0,
38294
+ class: "mr-2",
38295
+ size: "18"
38296
+ })) : createCommentVNode("", true),
38297
+ createElementVNode("span", _hoisted_3, toDisplayString(item.title), 1),
38298
+ createVNode(unref(IconChevronDown), {
38299
+ size: "20",
38300
+ class: "ml-2",
38301
+ "stroke-width": "1.5"
38302
+ })
38303
+ ]),
38304
+ _: 2
38305
+ }, 1040, ["disabled"])
38306
+ ]),
38307
+ default: withCtx(() => [
38308
+ createVNode(VList, null, {
38309
+ default: withCtx(() => [
38310
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.children, (child, childIndex) => {
38311
+ return openBlock(), createBlock(VListItem, {
38312
+ key: childIndex,
38313
+ to: child.type === "external" ? "" : child.to,
38314
+ href: child.type === "external" ? child.to : "",
38315
+ target: child.type === "external" ? "_blank" : "",
38316
+ disabled: child.disabled
38317
+ }, createSlots({
38318
+ default: withCtx(() => [
38319
+ createVNode(VListItemTitle, null, {
38320
+ default: withCtx(() => [
38321
+ createTextVNode(toDisplayString(child.title), 1)
38322
+ ]),
38323
+ _: 2
38324
+ }, 1024)
38326
38325
  ]),
38327
- key: "0"
38328
- } : void 0
38329
- ]), 1032, ["to", "href", "target", "disabled"]);
38330
- }), 128))
38331
- ]),
38332
- _: 2
38333
- }, 1024)
38334
- ]),
38335
- _: 2
38336
- }, 1024)) : item.divider ? (openBlock(), createBlock(VDivider, {
38337
- key: 2,
38338
- vertical: "",
38339
- class: "mx-2"
38340
- })) : createCommentVNode("", true)
38341
- ], 64);
38342
- }), 128))
38343
- ])) : createCommentVNode("", true),
38326
+ _: 2
38327
+ }, [
38328
+ child.icon ? {
38329
+ name: "prepend",
38330
+ fn: withCtx(() => [
38331
+ (openBlock(), createBlock(resolveDynamicComponent(child.icon), { size: "18" }))
38332
+ ]),
38333
+ key: "0"
38334
+ } : void 0
38335
+ ]), 1032, ["to", "href", "target", "disabled"]);
38336
+ }), 128))
38337
+ ]),
38338
+ _: 2
38339
+ }, 1024)
38340
+ ]),
38341
+ _: 2
38342
+ }, 1024)) : item.divider ? (openBlock(), createBlock(VDivider, {
38343
+ key: 2,
38344
+ vertical: "",
38345
+ class: "mx-2"
38346
+ })) : createCommentVNode("", true)
38347
+ ], 64);
38348
+ }), 128))
38349
+ ])) : createCommentVNode("", true)
38350
+ ]),
38344
38351
  createVNode(VSpacer),
38345
38352
  renderSlot(_ctx.$slots, "notifications", {}, () => [
38346
38353
  createVNode(VBtn, {
@@ -38386,7 +38393,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent$1({
38386
38393
  };
38387
38394
  }
38388
38395
  });
38389
- const AppHeader = /* @__PURE__ */ _export_sfc$1(_sfc_main$1, [["__scopeId", "data-v-9b94743b"]]);
38396
+ const AppHeader = /* @__PURE__ */ _export_sfc$1(_sfc_main$1, [["__scopeId", "data-v-83d3eb65"]]);
38390
38397
  const makeVAppProps = propsFactory({
38391
38398
  ...makeComponentProps(),
38392
38399
  ...omit(makeLayoutProps(), ["fullHeight"]),
@@ -39054,6 +39061,342 @@ function handleResponse(response) {
39054
39061
  return data2;
39055
39062
  });
39056
39063
  }
39064
+ function setupKeycloak(app, options) {
39065
+ const {
39066
+ config,
39067
+ init = {
39068
+ flow: "standard",
39069
+ checkLoginIframe: false,
39070
+ onLoad: "login-required",
39071
+ pkceMethod: "S256"
39072
+ },
39073
+ logout = {
39074
+ redirectUri: window.location.origin
39075
+ },
39076
+ callbacks = {},
39077
+ exposeGlobally = true
39078
+ } = options;
39079
+ const pluginOptions = {
39080
+ config,
39081
+ init,
39082
+ logout,
39083
+ onAuthLogout: callbacks.onAuthLogout || (() => {
39084
+ if (init.enableLogging) {
39085
+ console.log("User logged out from Keycloak");
39086
+ }
39087
+ }),
39088
+ onReady: (keycloakInstance) => {
39089
+ var _a;
39090
+ if (exposeGlobally) {
39091
+ window.$keycloak = keycloakInstance;
39092
+ if (init.enableLogging) {
39093
+ console.log("Keycloak ready, instance exposed globally");
39094
+ }
39095
+ }
39096
+ (_a = callbacks.onReady) == null ? void 0 : _a.call(callbacks, keycloakInstance);
39097
+ },
39098
+ onInitError: (error) => {
39099
+ var _a;
39100
+ if (init.enableLogging !== false) {
39101
+ console.error("Keycloak initialization error:", error);
39102
+ }
39103
+ (_a = callbacks.onInitError) == null ? void 0 : _a.call(callbacks, error);
39104
+ }
39105
+ };
39106
+ if (callbacks.onAuthSuccess) {
39107
+ pluginOptions.onAuthSuccess = callbacks.onAuthSuccess;
39108
+ }
39109
+ if (callbacks.onAuthError) {
39110
+ pluginOptions.onAuthError = callbacks.onAuthError;
39111
+ }
39112
+ return app.use(VueKeycloakJs, pluginOptions);
39113
+ }
39114
+ class AuthModeInitializer {
39115
+ constructor(config) {
39116
+ __publicField(this, "config");
39117
+ this.config = config;
39118
+ }
39119
+ /**
39120
+ * Check if this initializer should handle the given mode
39121
+ */
39122
+ canHandle(mode) {
39123
+ return this.getMode() === mode;
39124
+ }
39125
+ /**
39126
+ * Handle errors during initialization
39127
+ */
39128
+ handleError(error) {
39129
+ if (this.config.onError) {
39130
+ this.config.onError(error);
39131
+ } else {
39132
+ console.error(`[${this.getMode()}] Initialization error:`, error);
39133
+ }
39134
+ }
39135
+ /**
39136
+ * Handle successful initialization
39137
+ */
39138
+ handleSuccess() {
39139
+ if (this.config.onSuccess) {
39140
+ this.config.onSuccess();
39141
+ }
39142
+ }
39143
+ }
39144
+ class KeycloakInitializer extends AuthModeInitializer {
39145
+ constructor(app, config) {
39146
+ super(config);
39147
+ __publicField(this, "app");
39148
+ __publicField(this, "keycloakOptions");
39149
+ this.app = app;
39150
+ this.keycloakOptions = config.keycloakOptions;
39151
+ }
39152
+ getMode() {
39153
+ return "keycloak";
39154
+ }
39155
+ async initialize() {
39156
+ try {
39157
+ console.log("🔐 Initializing Keycloak authentication...");
39158
+ setupKeycloak(this.app, this.keycloakOptions);
39159
+ console.log("✅ Keycloak initialized successfully");
39160
+ this.handleSuccess();
39161
+ } catch (error) {
39162
+ this.handleError(error);
39163
+ throw error;
39164
+ }
39165
+ }
39166
+ }
39167
+ class JwtInitializer extends AuthModeInitializer {
39168
+ constructor(config) {
39169
+ super(config);
39170
+ }
39171
+ get jwtConfig() {
39172
+ return this.config;
39173
+ }
39174
+ getMode() {
39175
+ return "jwt";
39176
+ }
39177
+ async initialize() {
39178
+ var _a, _b;
39179
+ try {
39180
+ console.log("🔐 Initializing JWT authentication...");
39181
+ const response = await this.jwtConfig.getUserInfo();
39182
+ if (response == null ? void 0 : response.data) {
39183
+ this.jwtConfig.setUser(response.data);
39184
+ if (this.jwtConfig.setUserInStorage) {
39185
+ this.jwtConfig.setUserInStorage(response.data);
39186
+ }
39187
+ console.log("✅ JWT authentication initialized successfully");
39188
+ this.handleSuccess();
39189
+ } else {
39190
+ throw new Error("No user data received from getUserInfo");
39191
+ }
39192
+ } catch (error) {
39193
+ if (((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.status) === 401) {
39194
+ console.log("ℹ️ User not authenticated (401), continuing...");
39195
+ this.handleSuccess();
39196
+ return;
39197
+ }
39198
+ if (((_b = error == null ? void 0 : error.response) == null ? void 0 : _b.status) !== 401) {
39199
+ console.warn("⚠️ getUserInfo API call failed:", (error == null ? void 0 : error.message) ?? error);
39200
+ }
39201
+ this.handleError(error);
39202
+ }
39203
+ }
39204
+ }
39205
+ class InitializerModeInitializer extends AuthModeInitializer {
39206
+ constructor(app, config) {
39207
+ super(config);
39208
+ __publicField(this, "app");
39209
+ this.app = app;
39210
+ }
39211
+ get initializerConfig() {
39212
+ return this.config;
39213
+ }
39214
+ getMode() {
39215
+ return this.initializerConfig.mode;
39216
+ }
39217
+ async initialize() {
39218
+ try {
39219
+ console.log("📱 Initializing app via AppInitializer...");
39220
+ const initPromise = this.initializerConfig.appInitializer.initializeApp();
39221
+ if (this.initializerConfig.setLoading) {
39222
+ this.initializerConfig.setLoading(true);
39223
+ }
39224
+ try {
39225
+ await this.initializerConfig.appInitializer.startInitialization();
39226
+ await initPromise;
39227
+ console.log("✅ App initialization completed successfully");
39228
+ if (this.initializerConfig.mode === "dev") {
39229
+ console.log("🔧 Dev mode: forcing loading false");
39230
+ if (this.initializerConfig.setLoading) {
39231
+ this.initializerConfig.setLoading(false);
39232
+ setTimeout(() => {
39233
+ if (this.initializerConfig.setLoading) {
39234
+ this.initializerConfig.setLoading(false);
39235
+ }
39236
+ }, 100);
39237
+ }
39238
+ }
39239
+ this.handleSuccess();
39240
+ } catch (error) {
39241
+ console.error("❌ App initialization failed:", error);
39242
+ if (this.initializerConfig.redirectToLogin) {
39243
+ const currentPath = this.initializerConfig.currentRoutePath || "";
39244
+ const loginPath = this.initializerConfig.loginRoutePath || "/auth/login";
39245
+ if (currentPath !== loginPath) {
39246
+ await this.initializerConfig.redirectToLogin();
39247
+ }
39248
+ }
39249
+ this.handleError(error);
39250
+ throw error;
39251
+ } finally {
39252
+ if (this.initializerConfig.setLoading) {
39253
+ this.initializerConfig.setLoading(false);
39254
+ }
39255
+ }
39256
+ } catch (error) {
39257
+ this.handleError(error);
39258
+ throw error;
39259
+ }
39260
+ }
39261
+ }
39262
+ class AppBootstrap {
39263
+ constructor(config) {
39264
+ __publicField(this, "app");
39265
+ __publicField(this, "authMode");
39266
+ __publicField(this, "authConfig");
39267
+ __publicField(this, "plugins");
39268
+ __publicField(this, "directives");
39269
+ __publicField(this, "components");
39270
+ __publicField(this, "onBootstrapStart");
39271
+ __publicField(this, "onBootstrapComplete");
39272
+ __publicField(this, "onBootstrapError");
39273
+ this.app = config.app;
39274
+ this.authMode = config.authMode;
39275
+ this.authConfig = config.authConfig;
39276
+ this.plugins = config.plugins;
39277
+ this.directives = config.directives;
39278
+ this.components = config.components;
39279
+ this.onBootstrapStart = config.onBootstrapStart;
39280
+ this.onBootstrapComplete = config.onBootstrapComplete;
39281
+ this.onBootstrapError = config.onBootstrapError;
39282
+ }
39283
+ /**
39284
+ * Start the bootstrap process
39285
+ */
39286
+ async bootstrap() {
39287
+ var _a, _b, _c;
39288
+ try {
39289
+ (_a = this.onBootstrapStart) == null ? void 0 : _a.call(this);
39290
+ console.log("🚀 Bootstrap starting with authMode:", this.authMode);
39291
+ await this.initializeAuth();
39292
+ this.registerPlugins();
39293
+ this.registerDirectives();
39294
+ this.registerComponents();
39295
+ this.mountApp();
39296
+ (_b = this.onBootstrapComplete) == null ? void 0 : _b.call(this);
39297
+ console.log("✅ Bootstrap completed successfully");
39298
+ } catch (error) {
39299
+ console.error("❌ Bootstrap error:", error);
39300
+ (_c = this.onBootstrapError) == null ? void 0 : _c.call(this, error);
39301
+ throw error;
39302
+ }
39303
+ }
39304
+ /**
39305
+ * Initialize authentication based on mode
39306
+ */
39307
+ async initializeAuth() {
39308
+ let initializer;
39309
+ switch (this.authMode) {
39310
+ case "keycloak":
39311
+ if (!("keycloakOptions" in this.authConfig)) {
39312
+ throw new Error("Keycloak config must include keycloakOptions");
39313
+ }
39314
+ initializer = new KeycloakInitializer(this.app, this.authConfig);
39315
+ break;
39316
+ case "jwt":
39317
+ initializer = new JwtInitializer(this.authConfig);
39318
+ break;
39319
+ case "initializer":
39320
+ case "dev":
39321
+ initializer = new InitializerModeInitializer(this.app, this.authConfig);
39322
+ break;
39323
+ default:
39324
+ throw new Error(`Unknown auth mode: ${this.authMode}`);
39325
+ }
39326
+ await initializer.initialize();
39327
+ }
39328
+ /**
39329
+ * Register Vue plugins
39330
+ */
39331
+ registerPlugins() {
39332
+ if (!this.plugins) return;
39333
+ if (this.plugins.router) {
39334
+ this.app.use(this.plugins.router);
39335
+ }
39336
+ if (this.plugins.perfectScrollbar) {
39337
+ this.app.use(this.plugins.perfectScrollbar);
39338
+ }
39339
+ if (this.plugins.print) {
39340
+ this.app.use(this.plugins.print);
39341
+ }
39342
+ if (this.plugins.vueApexCharts) {
39343
+ this.app.use(this.plugins.vueApexCharts);
39344
+ }
39345
+ if (this.plugins.vuetify) {
39346
+ this.app.use(this.plugins.vuetify);
39347
+ }
39348
+ if (this.plugins.customPlugins) {
39349
+ this.plugins.customPlugins.forEach(({ plugin, options }) => {
39350
+ if (options) {
39351
+ this.app.use(plugin, options);
39352
+ } else {
39353
+ this.app.use(plugin);
39354
+ }
39355
+ });
39356
+ }
39357
+ }
39358
+ /**
39359
+ * Register Vue directives
39360
+ */
39361
+ registerDirectives() {
39362
+ if (!this.directives) return;
39363
+ if (this.directives.digitLimit) {
39364
+ this.app.directive("digit-limit", this.directives.digitLimit);
39365
+ }
39366
+ if (this.directives.permission) {
39367
+ this.app.directive("permission", this.directives.permission);
39368
+ }
39369
+ if (this.directives.customDirectives) {
39370
+ this.directives.customDirectives.forEach(({ name: name2, directive: directive2 }) => {
39371
+ this.app.directive(name2, directive2);
39372
+ });
39373
+ }
39374
+ }
39375
+ /**
39376
+ * Register Vue components
39377
+ */
39378
+ registerComponents() {
39379
+ if (!this.components) return;
39380
+ if (this.components.vue3PersianDatetimePicker) {
39381
+ this.app.component("Vue3PersianDatetimePicker", this.components.vue3PersianDatetimePicker);
39382
+ }
39383
+ if (this.components.customComponents) {
39384
+ this.components.customComponents.forEach(({ name: name2, component }) => {
39385
+ this.app.component(name2, component);
39386
+ });
39387
+ }
39388
+ }
39389
+ /**
39390
+ * Mount the Vue app
39391
+ */
39392
+ mountApp() {
39393
+ this.app.mount("#app");
39394
+ }
39395
+ }
39396
+ async function bootstrapApp(config) {
39397
+ const bootstrap = new AppBootstrap(config);
39398
+ await bootstrap.bootstrap();
39399
+ }
39057
39400
  function nationalCodeRule(nationalCode, customerType) {
39058
39401
  if (!NationalCodeValidator.isValid(nationalCode, customerType)) return "کد ملی نامعتبر است";
39059
39402
  return false;
@@ -39073,10 +39416,12 @@ const index = {
39073
39416
  install
39074
39417
  };
39075
39418
  export {
39419
+ AppBootstrap,
39076
39420
  AppHeader,
39077
39421
  AppLayout,
39078
39422
  _sfc_main$2 as AppSidebar,
39079
39423
  AppStepper,
39424
+ AuthModeInitializer,
39080
39425
  _sfc_main$l as BaseBreadcrumb,
39081
39426
  _sfc_main$k as BaseIcon,
39082
39427
  BooleanEnum,
@@ -39089,6 +39434,9 @@ export {
39089
39434
  DigitLimit,
39090
39435
  DownloadButton,
39091
39436
  GreetingUtils,
39437
+ InitializerModeInitializer,
39438
+ JwtInitializer,
39439
+ KeycloakInitializer,
39092
39440
  Loading,
39093
39441
  _sfc_main$h as MoneyInput,
39094
39442
  NationalCodeValidator,
@@ -39097,6 +39445,7 @@ export {
39097
39445
  _sfc_main$b as UiChildCard,
39098
39446
  _sfc_main$a as UiParentCard,
39099
39447
  _sfc_main$9 as VPriceTextField,
39448
+ bootstrapApp,
39100
39449
  configureAuth,
39101
39450
  configureAxiosInstance,
39102
39451
  index as default,
@@ -39106,6 +39455,7 @@ export {
39106
39455
  getAxiosInstance,
39107
39456
  install,
39108
39457
  nationalCodeRule,
39458
+ setupKeycloak,
39109
39459
  useCustomizerStore,
39110
39460
  useDataTable,
39111
39461
  useTableActions,