@amirjalili1374/ui-kit 1.4.11 → 1.4.13

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.
package/dist/ui-kit.es.js CHANGED
@@ -2,7 +2,7 @@ var __defProp2 = Object.defineProperty;
2
2
  var __defNormalProp2 = (obj, key2, value2) => key2 in obj ? __defProp2(obj, key2, { enumerable: true, configurable: true, writable: true, value: value2 }) : obj[key2] = value2;
3
3
  var __publicField = (obj, key2, value2) => __defNormalProp2(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value2);
4
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";
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";
5
+ import { IconHome, IconArrowBadgeLeft, IconChevronDown, IconChevronRight, IconCheck, IconSquareX, IconMinus, IconPlus, IconRefresh, IconChevronLeft, IconDownload, IconPrinter, IconMaximize, IconMinimize, IconX, IconFileText, IconPencil, IconClock, IconMenu2, IconPalette } from "@tabler/icons-vue";
6
6
  import axios from "axios";
7
7
  import { useDebounceFn } from "@vueuse/core";
8
8
  import { useRouter as useRouter$1 } from "vue-router";
@@ -3889,10 +3889,10 @@ const VRow = genericComponent()({
3889
3889
  }
3890
3890
  });
3891
3891
  const VSpacer = createSimpleFunctional("v-spacer", "div", "VSpacer");
3892
- const _hoisted_1$d = { class: "text-h3" };
3893
- const _hoisted_2$7 = { class: "d-flex align-center gap-2" };
3894
- const _hoisted_3$5 = { class: "d-flex align-center gap-2" };
3895
- const _sfc_main$l = /* @__PURE__ */ defineComponent$1({
3892
+ const _hoisted_1$e = { class: "text-h3" };
3893
+ const _hoisted_2$8 = { class: "d-flex align-center gap-2" };
3894
+ const _hoisted_3$6 = { class: "d-flex align-center gap-2" };
3895
+ const _sfc_main$m = /* @__PURE__ */ defineComponent$1({
3896
3896
  __name: "BaseBreadcrumb",
3897
3897
  props: {
3898
3898
  title: String,
@@ -3921,7 +3921,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent$1({
3921
3921
  default: withCtx(() => [
3922
3922
  createVNode(VCol, { md: "5" }, {
3923
3923
  default: withCtx(() => [
3924
- createElementVNode("h3", _hoisted_1$d, toDisplayString(props.title), 1)
3924
+ createElementVNode("h3", _hoisted_1$e, toDisplayString(props.title), 1)
3925
3925
  ]),
3926
3926
  _: 1
3927
3927
  }),
@@ -3936,7 +3936,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent$1({
3936
3936
  class: "text-h5 justify-md-end pa-1"
3937
3937
  }, {
3938
3938
  divider: withCtx(() => [
3939
- createElementVNode("div", _hoisted_2$7, [
3939
+ createElementVNode("div", _hoisted_2$8, [
3940
3940
  createVNode(unref(IconArrowBadgeLeft), { stroke: "{2}" })
3941
3941
  ])
3942
3942
  ]),
@@ -3945,7 +3945,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent$1({
3945
3945
  size: "16",
3946
3946
  class: "text-secondary ml-2"
3947
3947
  }),
3948
- createElementVNode("div", _hoisted_3$5, [
3948
+ createElementVNode("div", _hoisted_3$6, [
3949
3949
  createVNode(unref(IconArrowBadgeLeft), { stroke: "{2}" })
3950
3950
  ])
3951
3951
  ]),
@@ -3969,7 +3969,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent$1({
3969
3969
  };
3970
3970
  }
3971
3971
  });
3972
- const _sfc_main$k = /* @__PURE__ */ defineComponent$1({
3972
+ const _sfc_main$l = /* @__PURE__ */ defineComponent$1({
3973
3973
  __name: "BaseIcon",
3974
3974
  props: {
3975
3975
  icon: {
@@ -6584,11 +6584,11 @@ const VDialog = genericComponent()({
6584
6584
  return forwardRefs({}, overlay);
6585
6585
  }
6586
6586
  });
6587
- const _hoisted_1$c = {
6587
+ const _hoisted_1$d = {
6588
6588
  key: 0,
6589
6589
  class: "mb-2"
6590
6590
  };
6591
- const _sfc_main$j = /* @__PURE__ */ defineComponent$1({
6591
+ const _sfc_main$k = /* @__PURE__ */ defineComponent$1({
6592
6592
  __name: "ConfirmDialog",
6593
6593
  props: {
6594
6594
  modelValue: { type: Boolean },
@@ -6634,7 +6634,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent$1({
6634
6634
  }),
6635
6635
  createVNode(VCardText, null, {
6636
6636
  default: withCtx(() => [
6637
- __props.message ? (openBlock(), createElementBlock("div", _hoisted_1$c, toDisplayString(__props.message), 1)) : createCommentVNode("", true),
6637
+ __props.message ? (openBlock(), createElementBlock("div", _hoisted_1$d, toDisplayString(__props.message), 1)) : createCommentVNode("", true),
6638
6638
  renderSlot(_ctx.$slots, "default")
6639
6639
  ]),
6640
6640
  _: 3
@@ -12595,17 +12595,17 @@ const VTooltip = genericComponent()({
12595
12595
  return forwardRefs({}, overlay);
12596
12596
  }
12597
12597
  });
12598
- const _hoisted_1$b = { class: "ca-item-title" };
12599
- const _hoisted_2$6 = { class: "ca-item-subtitle" };
12600
- const _hoisted_3$4 = { class: "ca-group-tooltip" };
12601
- const _hoisted_4$2 = { class: "ca-group-tooltip-header" };
12602
- const _hoisted_5$2 = { class: "ca-group-count" };
12598
+ const _hoisted_1$c = { class: "ca-item-title" };
12599
+ const _hoisted_2$7 = { class: "ca-item-subtitle" };
12600
+ const _hoisted_3$5 = { class: "ca-group-tooltip" };
12601
+ const _hoisted_4$3 = { class: "ca-group-tooltip-header" };
12602
+ const _hoisted_5$3 = { class: "ca-group-count" };
12603
12603
  const _hoisted_6$2 = { class: "ca-group-members" };
12604
12604
  const _hoisted_7$2 = { class: "ca-item-title" };
12605
12605
  const _hoisted_8$2 = { class: "ca-item-subtitle" };
12606
12606
  const _hoisted_9$2 = { class: "ca-chip-title" };
12607
12607
  const _hoisted_10$2 = { class: "ca-chip-subtitle" };
12608
- const _sfc_main$i = /* @__PURE__ */ defineComponent$1({
12608
+ const _sfc_main$j = /* @__PURE__ */ defineComponent$1({
12609
12609
  __name: "CustomAutocomplete",
12610
12610
  props: {
12611
12611
  fields: {},
@@ -12714,7 +12714,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent$1({
12714
12714
  class: { "ca-main-group": true }
12715
12715
  }), createSlots({
12716
12716
  title: withCtx(() => [
12717
- createElementVNode("div", _hoisted_1$b, [
12717
+ createElementVNode("div", _hoisted_1$c, [
12718
12718
  createTextVNode(toDisplayString(resolveTitle(item.raw ?? item)) + " ", 1),
12719
12719
  createVNode(VChip, {
12720
12720
  size: "small",
@@ -12739,7 +12739,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent$1({
12739
12739
  __props.displayStyle === "detailed" && resolveSubtitle(item.raw ?? item) ? {
12740
12740
  name: "subtitle",
12741
12741
  fn: withCtx(() => [
12742
- createElementVNode("div", _hoisted_2$6, toDisplayString(resolveSubtitle(item.raw ?? item)), 1)
12742
+ createElementVNode("div", _hoisted_2$7, toDisplayString(resolveSubtitle(item.raw ?? item)), 1)
12743
12743
  ]),
12744
12744
  key: "0"
12745
12745
  } : void 0
@@ -12750,10 +12750,10 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent$1({
12750
12750
  item: item.raw ?? item,
12751
12751
  groupMembers: getGroupMembers(item.raw ?? item)
12752
12752
  }, () => [
12753
- createElementVNode("div", _hoisted_3$4, [
12754
- createElementVNode("div", _hoisted_4$2, [
12753
+ createElementVNode("div", _hoisted_3$5, [
12754
+ createElementVNode("div", _hoisted_4$3, [
12755
12755
  createElementVNode("strong", null, toDisplayString(resolveTitle(item.raw ?? item)), 1),
12756
- createElementVNode("span", _hoisted_5$2, toDisplayString(getGroupMembers(item.raw ?? item).length) + " آیتم", 1)
12756
+ createElementVNode("span", _hoisted_5$3, toDisplayString(getGroupMembers(item.raw ?? item).length) + " آیتم", 1)
12757
12757
  ]),
12758
12758
  createElementVNode("div", _hoisted_6$2, [
12759
12759
  (openBlock(true), createElementBlock(Fragment, null, renderList(getGroupMembers(item.raw ?? item), (member, idx) => {
@@ -12816,8 +12816,8 @@ const _export_sfc$1 = (sfc, props) => {
12816
12816
  }
12817
12817
  return target;
12818
12818
  };
12819
- const CustomAutocomplete = /* @__PURE__ */ _export_sfc$1(_sfc_main$i, [["__scopeId", "data-v-4c17f7bd"]]);
12820
- const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
12819
+ const CustomAutocomplete = /* @__PURE__ */ _export_sfc$1(_sfc_main$j, [["__scopeId", "data-v-4c17f7bd"]]);
12820
+ const _sfc_main$i = /* @__PURE__ */ defineComponent$1({
12821
12821
  __name: "MoneyInput",
12822
12822
  props: {
12823
12823
  modelValue: {
@@ -12923,8 +12923,8 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
12923
12923
  };
12924
12924
  }
12925
12925
  });
12926
- const _hoisted_1$a = { class: "shamsi-date-picker" };
12927
- const _sfc_main$g = /* @__PURE__ */ defineComponent$1({
12926
+ const _hoisted_1$b = { class: "shamsi-date-picker" };
12927
+ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
12928
12928
  __name: "ShamsiDatePicker",
12929
12929
  props: {
12930
12930
  modelValue: { default: "" },
@@ -13012,7 +13012,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent$1({
13012
13012
  const isRangeMode = computed(() => props.mode === "range");
13013
13013
  return (_ctx, _cache) => {
13014
13014
  const _component_Vue3PersianDatetimePicker = resolveComponent("Vue3PersianDatetimePicker");
13015
- return openBlock(), createElementBlock("div", _hoisted_1$a, [
13015
+ return openBlock(), createElementBlock("div", _hoisted_1$b, [
13016
13016
  createVNode(_component_Vue3PersianDatetimePicker, {
13017
13017
  label: __props.label,
13018
13018
  modelValue: selectedDate.value,
@@ -13035,7 +13035,113 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent$1({
13035
13035
  };
13036
13036
  }
13037
13037
  });
13038
- const ShamsiDatePicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$g, [["__scopeId", "data-v-d56f50fe"]]);
13038
+ const ShamsiDatePicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__scopeId", "data-v-d56f50fe"]]);
13039
+ const _hoisted_1$a = { class: "mb-6" };
13040
+ const _hoisted_2$6 = { class: "text-subtitle-1 font-weight-medium mb-3" };
13041
+ const _hoisted_3$4 = { class: "theme-toggle-container" };
13042
+ const _hoisted_4$2 = { class: "toggle-slider" };
13043
+ const _hoisted_5$2 = { class: "toggle-icon" };
13044
+ const _sfc_main$g = /* @__PURE__ */ defineComponent$1({
13045
+ __name: "ToggleSwitch",
13046
+ props: {
13047
+ modelValue: { type: [String, Boolean] },
13048
+ label: {},
13049
+ type: { default: "boolean" },
13050
+ options: { default: () => [] },
13051
+ trueLabel: {},
13052
+ falseLabel: {},
13053
+ trueIcon: {},
13054
+ falseIcon: {},
13055
+ activeColor: { default: "rgb(var(--v-theme-primary))" },
13056
+ inactiveColor: { default: "#e0e0e0" }
13057
+ },
13058
+ emits: ["update:modelValue"],
13059
+ setup(__props, { emit: __emit }) {
13060
+ const props = __props;
13061
+ const emit = __emit;
13062
+ const isBooleanMode = computed(() => props.type === "boolean");
13063
+ const isStringMode = computed(() => props.type === "string");
13064
+ const isActive = computed(() => {
13065
+ if (isBooleanMode.value) {
13066
+ return props.modelValue === true;
13067
+ }
13068
+ return false;
13069
+ });
13070
+ const currentIndex = computed(() => {
13071
+ if (isStringMode.value && props.options.length > 0) {
13072
+ return props.options.findIndex((opt) => opt.value === props.modelValue);
13073
+ }
13074
+ return 0;
13075
+ });
13076
+ const handleToggle = () => {
13077
+ if (isBooleanMode.value) {
13078
+ emit("update:modelValue", !props.modelValue);
13079
+ } else if (isStringMode.value && props.options.length > 0) {
13080
+ const nextIndex = (currentIndex.value + 1) % props.options.length;
13081
+ emit("update:modelValue", props.options[nextIndex].value);
13082
+ }
13083
+ };
13084
+ const isToggleActive = computed(() => {
13085
+ if (isBooleanMode.value) {
13086
+ return isActive.value;
13087
+ } else {
13088
+ if (props.options.length >= 2) {
13089
+ return currentIndex.value >= 1;
13090
+ } else if (props.options.length === 1) {
13091
+ return true;
13092
+ }
13093
+ return false;
13094
+ }
13095
+ });
13096
+ const currentOption = computed(() => {
13097
+ if (isStringMode.value && props.options.length > 0) {
13098
+ return props.options[currentIndex.value] || props.options[0];
13099
+ }
13100
+ return null;
13101
+ });
13102
+ const displayIcon = computed(() => {
13103
+ var _a;
13104
+ if (isBooleanMode.value) {
13105
+ return isActive.value ? props.trueIcon : props.falseIcon;
13106
+ } else {
13107
+ return (_a = currentOption.value) == null ? void 0 : _a.icon;
13108
+ }
13109
+ });
13110
+ return (_ctx, _cache) => {
13111
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [
13112
+ createElementVNode("h6", _hoisted_2$6, toDisplayString(__props.label), 1),
13113
+ createElementVNode("div", _hoisted_3$4, [
13114
+ createElementVNode("div", {
13115
+ class: normalizeClass(["theme-toggle", {
13116
+ "active": isToggleActive.value,
13117
+ "string-mode": isStringMode.value
13118
+ }]),
13119
+ style: normalizeStyle({
13120
+ background: isToggleActive.value ? props.activeColor : props.inactiveColor
13121
+ }),
13122
+ onClick: handleToggle
13123
+ }, [
13124
+ createElementVNode("div", _hoisted_4$2, [
13125
+ createElementVNode("div", _hoisted_5$2, [
13126
+ renderSlot(_ctx.$slots, "icon", {
13127
+ value: __props.modelValue,
13128
+ option: currentOption.value
13129
+ }, () => [
13130
+ displayIcon.value ? (openBlock(), createBlock(resolveDynamicComponent(displayIcon.value), {
13131
+ key: 0,
13132
+ size: "24",
13133
+ "stroke-width": "2"
13134
+ })) : createCommentVNode("", true)
13135
+ ], true)
13136
+ ])
13137
+ ])
13138
+ ], 6)
13139
+ ])
13140
+ ]);
13141
+ };
13142
+ }
13143
+ });
13144
+ const ToggleSwitch = /* @__PURE__ */ _export_sfc$1(_sfc_main$g, [["__scopeId", "data-v-536e1a17"]]);
13039
13145
  function useTableSelection(items, options = {}) {
13040
13146
  const selectedItems = ref([]);
13041
13147
  const expandedGroups = ref(/* @__PURE__ */ new Set());
@@ -17268,19 +17374,41 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
17268
17374
  const formHeaders = computed(() => {
17269
17375
  return props.headers.filter((header) => !header.excludeFromForm);
17270
17376
  });
17271
- const isMoneyHeader = (header) => {
17272
- if (!header || typeof header.type !== "string") {
17273
- return false;
17377
+ const getHeaderType = (header) => {
17378
+ if (header.type) {
17379
+ return header.type.toLowerCase();
17274
17380
  }
17275
- return header.type.toLowerCase() === "money";
17381
+ if (header.isDate) return "date";
17382
+ if (header.textarea) return "textarea";
17383
+ if (header.toggleSwitch) return "toggle";
17384
+ return void 0;
17385
+ };
17386
+ const isDateHeader = (header) => {
17387
+ const type = getHeaderType(header);
17388
+ return type === "date";
17389
+ };
17390
+ const isMoneyHeader = (header) => {
17391
+ const type = getHeaderType(header);
17392
+ return type === "money";
17393
+ };
17394
+ const isTextareaHeader = (header) => {
17395
+ const type = getHeaderType(header);
17396
+ return type === "textarea";
17397
+ };
17398
+ const isToggleHeader = (header) => {
17399
+ const type = getHeaderType(header);
17400
+ return type === "toggle" || type === "toggleswitch";
17276
17401
  };
17277
17402
  const getFieldInputType = (header) => {
17278
- return typeof (header == null ? void 0 : header.type) === "string" ? header.type : void 0;
17403
+ const type = getHeaderType(header);
17404
+ if (type && !["date", "textarea", "money", "toggle", "toggleswitch", "autocomplete"].includes(type)) {
17405
+ return type;
17406
+ }
17407
+ return void 0;
17279
17408
  };
17280
17409
  const resolveHeaderKey = (header) => header.key;
17281
17410
  const resolveHeaderTitle = (header) => header.title;
17282
17411
  const isHeaderDisabled = (header) => header.editable === false;
17283
- const isTextareaHeader = (header) => header.textarea === true;
17284
17412
  const getUniqueValue = (item) => {
17285
17413
  if (typeof props.uniqueKey === "function") {
17286
17414
  return props.uniqueKey(item);
@@ -17374,7 +17502,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
17374
17502
  items.value = serverData.map((item) => {
17375
17503
  const newItem = { ...item };
17376
17504
  props.headers.forEach((header) => {
17377
- if (header.isDate && newItem[header.key]) {
17505
+ if (isDateHeader(header) && newItem[header.key]) {
17378
17506
  try {
17379
17507
  newItem[header.key] = DateConverter.toShamsi(newItem[header.key]);
17380
17508
  } catch (error2) {
@@ -17483,6 +17611,11 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
17483
17611
  if (!isEditing.value) {
17484
17612
  const defaultContext = { ...editedItem.value };
17485
17613
  for (const header of props.headers) {
17614
+ if (isToggleHeader(header) && editedItem.value[header.key] === void 0) {
17615
+ editedItem.value[header.key] = false;
17616
+ defaultContext[header.key] = false;
17617
+ continue;
17618
+ }
17486
17619
  if (header.defaultValue === void 0) {
17487
17620
  continue;
17488
17621
  }
@@ -17501,9 +17634,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
17501
17634
  const valueKey = resolveAutocompleteItemValue(header);
17502
17635
  if (enhancedHeader.autocompleteReturnObject === false) {
17503
17636
  if (Array.isArray(currentValue)) {
17504
- formModel.value[header.key] = currentValue.map(
17505
- (item2) => item2 && typeof item2 === "object" ? item2[valueKey] ?? null : item2
17506
- );
17637
+ formModel.value[header.key] = currentValue.map((item2) => item2 && typeof item2 === "object" ? item2[valueKey] ?? null : item2);
17507
17638
  } else if (currentValue && typeof currentValue === "object") {
17508
17639
  formModel.value[header.key] = currentValue[valueKey] ?? null;
17509
17640
  }
@@ -17512,7 +17643,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
17512
17643
  if (isEditing.value) {
17513
17644
  try {
17514
17645
  props.headers.forEach((header) => {
17515
- if (header.isDate) {
17646
+ if (isDateHeader(header)) {
17516
17647
  const v = formModel.value[header.key];
17517
17648
  if (typeof v === "string" && v.includes("/")) {
17518
17649
  formModel.value[header.key] = DateConverter.toGregorian(v);
@@ -17560,7 +17691,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
17560
17691
  }
17561
17692
  });
17562
17693
  props.headers.forEach((header) => {
17563
- if (header.isDate && dataToSave[header.key]) {
17694
+ if (isDateHeader(header) && dataToSave[header.key]) {
17564
17695
  try {
17565
17696
  const raw = dataToSave[header.key];
17566
17697
  if (typeof raw === "string") {
@@ -18367,14 +18498,25 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
18367
18498
  }, 1032, ["color", "onClick"]);
18368
18499
  }), 128))
18369
18500
  ], 64)) : (openBlock(), createElementBlock("div", _hoisted_16$1, [
18370
- shouldTruncate(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item), getHeaderForColumn(column.key || "")) ? (openBlock(), createElementBlock("span", {
18501
+ shouldTruncate(
18502
+ getTranslatedValue(getNestedValue2(item, column.key || ""), column, item),
18503
+ getHeaderForColumn(column.key || "")
18504
+ ) ? (openBlock(), createElementBlock("span", {
18371
18505
  key: 0,
18372
18506
  class: "truncated-text",
18373
18507
  style: { cursor: "pointer", color: "rgb(var(--v-theme-primary))", textDecoration: "underline" },
18374
- onClick: withModifiers(($event) => openTextPreview(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item), column.title || column.key || "", item), ["stop"])
18508
+ onClick: withModifiers(($event) => openTextPreview(
18509
+ getTranslatedValue(getNestedValue2(item, column.key || ""), column, item),
18510
+ column.title || column.key || "",
18511
+ item
18512
+ ), ["stop"])
18375
18513
  }, toDisplayString(truncateText(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item))), 9, _hoisted_17)) : (openBlock(), createElementBlock("span", {
18376
18514
  key: 1,
18377
- onClick: withModifiers(($event) => shouldShowCopyButton(getHeaderForColumn(column.key || "")) && openTextPreview(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item), column.title || column.key || "", item), ["stop"]),
18515
+ onClick: withModifiers(($event) => shouldShowCopyButton(getHeaderForColumn(column.key || "")) && openTextPreview(
18516
+ getTranslatedValue(getNestedValue2(item, column.key || ""), column, item),
18517
+ column.title || column.key || "",
18518
+ item
18519
+ ), ["stop"]),
18378
18520
  style: normalizeStyle({ cursor: shouldShowCopyButton(getHeaderForColumn(column.key || "")) ? "pointer" : "default" })
18379
18521
  }, toDisplayString(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item)), 13, _hoisted_18)),
18380
18522
  shouldShowCopyButton(getHeaderForColumn(column.key || "")) ? (openBlock(), createBlock(VBtn, {
@@ -18383,7 +18525,11 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
18383
18525
  size: "x-small",
18384
18526
  variant: "text",
18385
18527
  color: "primary",
18386
- onClick: withModifiers(($event) => openTextPreview(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item), column.title || column.key || "", item), ["stop"]),
18528
+ onClick: withModifiers(($event) => openTextPreview(
18529
+ getTranslatedValue(getNestedValue2(item, column.key || ""), column, item),
18530
+ column.title || column.key || "",
18531
+ item
18532
+ ), ["stop"]),
18387
18533
  style: { "min-width": "24px", "width": "24px", "height": "24px" }
18388
18534
  }, {
18389
18535
  default: withCtx(() => [
@@ -18582,14 +18728,25 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
18582
18728
  }, 1032, ["color", "onClick"]);
18583
18729
  }), 128))
18584
18730
  ], 64)) : (openBlock(), createElementBlock("div", _hoisted_20, [
18585
- shouldTruncate(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item), getHeaderForColumn(column.key || "")) ? (openBlock(), createElementBlock("span", {
18731
+ shouldTruncate(
18732
+ getTranslatedValue(getNestedValue2(item, column.key || ""), column, item),
18733
+ getHeaderForColumn(column.key || "")
18734
+ ) ? (openBlock(), createElementBlock("span", {
18586
18735
  key: 0,
18587
18736
  class: "truncated-text",
18588
18737
  style: { cursor: "pointer", color: "rgb(var(--v-theme-primary))", textDecoration: "underline" },
18589
- onClick: withModifiers(($event) => openTextPreview(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item), column.title || column.key || "", item), ["stop"])
18738
+ onClick: withModifiers(($event) => openTextPreview(
18739
+ getTranslatedValue(getNestedValue2(item, column.key || ""), column, item),
18740
+ column.title || column.key || "",
18741
+ item
18742
+ ), ["stop"])
18590
18743
  }, toDisplayString(truncateText(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item))), 9, _hoisted_21)) : (openBlock(), createElementBlock("span", {
18591
18744
  key: 1,
18592
- onClick: withModifiers(($event) => shouldShowCopyButton(getHeaderForColumn(column.key || "")) && openTextPreview(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item), column.title || column.key || "", item), ["stop"]),
18745
+ onClick: withModifiers(($event) => shouldShowCopyButton(getHeaderForColumn(column.key || "")) && openTextPreview(
18746
+ getTranslatedValue(getNestedValue2(item, column.key || ""), column, item),
18747
+ column.title || column.key || "",
18748
+ item
18749
+ ), ["stop"]),
18593
18750
  style: normalizeStyle({ cursor: shouldShowCopyButton(getHeaderForColumn(column.key || "")) ? "pointer" : "default" })
18594
18751
  }, toDisplayString(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item)), 13, _hoisted_22)),
18595
18752
  shouldShowCopyButton(getHeaderForColumn(column.key || "")) ? (openBlock(), createBlock(VBtn, {
@@ -18598,7 +18755,11 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
18598
18755
  size: "x-small",
18599
18756
  variant: "text",
18600
18757
  color: "primary",
18601
- onClick: withModifiers(($event) => openTextPreview(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item), column.title || column.key || "", item), ["stop"]),
18758
+ onClick: withModifiers(($event) => openTextPreview(
18759
+ getTranslatedValue(getNestedValue2(item, column.key || ""), column, item),
18760
+ column.title || column.key || "",
18761
+ item
18762
+ ), ["stop"]),
18602
18763
  style: { "min-width": "24px", "width": "24px", "height": "24px" }
18603
18764
  }, {
18604
18765
  default: withCtx(() => [
@@ -18673,7 +18834,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
18673
18834
  }, {
18674
18835
  default: withCtx(() => [
18675
18836
  !header.hidden ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
18676
- header.isDate ? (openBlock(), createBlock(ShamsiDatePicker, {
18837
+ isDateHeader(header) ? (openBlock(), createBlock(ShamsiDatePicker, {
18677
18838
  key: 0,
18678
18839
  modelValue: formModel.value[resolveHeaderKey(header)],
18679
18840
  "onUpdate:modelValue": ($event) => formModel.value[resolveHeaderKey(header)] = $event,
@@ -18694,7 +18855,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
18694
18855
  disabled: isHeaderDisabled(header),
18695
18856
  clearable: "",
18696
18857
  variant: "outlined"
18697
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "items", "item-title", "item-value", "return-object", "multiple", "chips", "closable-chips", "disabled"])) : isMoneyHeader(header) ? (openBlock(), createBlock(_sfc_main$h, {
18858
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "items", "item-title", "item-value", "return-object", "multiple", "chips", "closable-chips", "disabled"])) : isMoneyHeader(header) ? (openBlock(), createBlock(_sfc_main$i, {
18698
18859
  key: 2,
18699
18860
  modelValue: formModel.value[resolveHeaderKey(header)],
18700
18861
  "onUpdate:modelValue": ($event) => formModel.value[resolveHeaderKey(header)] = $event,
@@ -18710,11 +18871,23 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
18710
18871
  dir: header.dir,
18711
18872
  "auto-grow": "",
18712
18873
  rows: "3"
18713
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "disabled", "dir"])) : (openBlock(), createBlock(VTextField, {
18874
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "disabled", "dir"])) : isToggleHeader(header) ? (openBlock(), createBlock(ToggleSwitch, {
18714
18875
  key: 4,
18715
18876
  modelValue: formModel.value[resolveHeaderKey(header)],
18716
18877
  "onUpdate:modelValue": ($event) => formModel.value[resolveHeaderKey(header)] = $event,
18717
18878
  label: resolveHeaderTitle(header),
18879
+ type: "boolean",
18880
+ activeColor: "#3bd32a",
18881
+ inactiveColor: "#d32a2a",
18882
+ options: [
18883
+ { value: "true", label: "فعال", icon: unref(IconCheck) },
18884
+ { value: "false", label: "غیر فعال", icon: unref(IconSquareX) }
18885
+ ]
18886
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "options"])) : (openBlock(), createBlock(VTextField, {
18887
+ key: 5,
18888
+ modelValue: formModel.value[resolveHeaderKey(header)],
18889
+ "onUpdate:modelValue": ($event) => formModel.value[resolveHeaderKey(header)] = $event,
18890
+ label: resolveHeaderTitle(header),
18718
18891
  variant: "outlined",
18719
18892
  disabled: isHeaderDisabled(header),
18720
18893
  type: getFieldInputType(header),
@@ -39426,11 +39599,11 @@ export {
39426
39599
  AppSidebar,
39427
39600
  AppStepper,
39428
39601
  AuthModeInitializer,
39429
- _sfc_main$l as BaseBreadcrumb,
39430
- _sfc_main$k as BaseIcon,
39602
+ _sfc_main$m as BaseBreadcrumb,
39603
+ _sfc_main$l as BaseIcon,
39431
39604
  BooleanEnum,
39432
39605
  BooleanEnumOptions,
39433
- _sfc_main$j as ConfirmDialog,
39606
+ _sfc_main$k as ConfirmDialog,
39434
39607
  CustomAutocomplete,
39435
39608
  _sfc_main$f as CustomDataTable,
39436
39609
  DateConverter,
@@ -39442,10 +39615,11 @@ export {
39442
39615
  JwtInitializer,
39443
39616
  KeycloakInitializer,
39444
39617
  Loading,
39445
- _sfc_main$h as MoneyInput,
39618
+ _sfc_main$i as MoneyInput,
39446
39619
  NationalCodeValidator,
39447
39620
  PdfViewer,
39448
39621
  ShamsiDatePicker,
39622
+ ToggleSwitch,
39449
39623
  _sfc_main$b as UiChildCard,
39450
39624
  _sfc_main$a as UiParentCard,
39451
39625
  _sfc_main$9 as VPriceTextField,