@amirjalili1374/ui-kit 1.4.12 → 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";
@@ -13036,6 +13036,112 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
13036
13036
  }
13037
13037
  });
13038
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());
@@ -16918,17 +17024,17 @@ const VTextarea = genericComponent()({
16918
17024
  return forwardRefs({}, vInputRef, vFieldRef, textareaRef);
16919
17025
  }
16920
17026
  });
16921
- const _hoisted_1$a = {
17027
+ const _hoisted_1$9 = {
16922
17028
  key: 0,
16923
17029
  class: "page-title"
16924
17030
  };
16925
- const _hoisted_2$6 = { class: "title-text" };
16926
- const _hoisted_3$4 = { class: "action-buttons" };
16927
- const _hoisted_4$2 = {
17031
+ const _hoisted_2$5 = { class: "title-text" };
17032
+ const _hoisted_3$3 = { class: "action-buttons" };
17033
+ const _hoisted_4$1 = {
16928
17034
  key: 3,
16929
17035
  class: "selection-actions"
16930
17036
  };
16931
- const _hoisted_5$2 = {
17037
+ const _hoisted_5$1 = {
16932
17038
  key: 0,
16933
17039
  class: "selected-actions"
16934
17040
  };
@@ -16976,7 +17082,7 @@ const _hoisted_24 = {
16976
17082
  };
16977
17083
  const _hoisted_25 = { class: "d-flex justify-space-between align-center pa-4" };
16978
17084
  const _hoisted_26 = { class: "text-subtitle-2" };
16979
- const _sfc_main$g = /* @__PURE__ */ defineComponent$1({
17085
+ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
16980
17086
  ...{ inheritAttrs: false },
16981
17087
  __name: "CustomDataTable",
16982
17088
  props: {
@@ -17268,19 +17374,41 @@ const _sfc_main$g = /* @__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$g = /* @__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$g = /* @__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$g = /* @__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$g = /* @__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$g = /* @__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") {
@@ -17894,10 +18025,10 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent$1({
17894
18025
  return (_ctx, _cache) => {
17895
18026
  var _a;
17896
18027
  return openBlock(), createElementBlock(Fragment, null, [
17897
- props.title ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
17898
- createElementVNode("h3", _hoisted_2$6, toDisplayString(props.title), 1)
18028
+ props.title ? (openBlock(), createElementBlock("div", _hoisted_1$9, [
18029
+ createElementVNode("h3", _hoisted_2$5, toDisplayString(props.title), 1)
17899
18030
  ])) : createCommentVNode("", true),
17900
- createElementVNode("div", _hoisted_3$4, [
18031
+ createElementVNode("div", _hoisted_3$3, [
17901
18032
  ((_a = props.actions) == null ? void 0 : _a.includes("create")) ? (openBlock(), createBlock(VBtn, {
17902
18033
  key: 0,
17903
18034
  color: "green",
@@ -17930,7 +18061,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent$1({
17930
18061
  ])]),
17931
18062
  _: 1
17932
18063
  }, 8, ["onClick", "loading"])) : createCommentVNode("", true),
17933
- props.selectable && hasSelection.value ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
18064
+ props.selectable && hasSelection.value ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
17934
18065
  createVNode(VChip, {
17935
18066
  color: "primary",
17936
18067
  class: "me-2"
@@ -17957,7 +18088,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent$1({
17957
18088
  appear: ""
17958
18089
  }, {
17959
18090
  default: withCtx(() => [
17960
- props.bulkMode && hasValidSelection.value || props.enableGroupDelete && hasSelection.value ? (openBlock(), createElementBlock("div", _hoisted_5$2, [
18091
+ props.bulkMode && hasValidSelection.value || props.enableGroupDelete && hasSelection.value ? (openBlock(), createElementBlock("div", _hoisted_5$1, [
17961
18092
  props.enableGroupDelete ? (openBlock(), createBlock(VBtn, {
17962
18093
  key: 0,
17963
18094
  color: "red",
@@ -18367,14 +18498,25 @@ const _sfc_main$g = /* @__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$g = /* @__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$g = /* @__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$g = /* @__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$g = /* @__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,
@@ -18710,11 +18871,23 @@ const _sfc_main$g = /* @__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),
@@ -19079,8 +19252,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent$1({
19079
19252
  };
19080
19253
  }
19081
19254
  });
19082
- const _hoisted_1$9 = { class: "description-input" };
19083
- const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
19255
+ const _hoisted_1$8 = { class: "description-input" };
19256
+ const _sfc_main$e = /* @__PURE__ */ defineComponent$1({
19084
19257
  __name: "DescriptionInput",
19085
19258
  props: {
19086
19259
  modelValue: { default: "" },
@@ -19179,7 +19352,7 @@ ${newLineNumber} - `;
19179
19352
  emit("change", internalValue.value);
19180
19353
  };
19181
19354
  return (_ctx, _cache) => {
19182
- return openBlock(), createElementBlock("div", _hoisted_1$9, [
19355
+ return openBlock(), createElementBlock("div", _hoisted_1$8, [
19183
19356
  createVNode(VTextarea, {
19184
19357
  modelValue: internalValue.value,
19185
19358
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => internalValue.value = $event),
@@ -19202,7 +19375,7 @@ ${newLineNumber} - `;
19202
19375
  };
19203
19376
  }
19204
19377
  });
19205
- const DescriptionInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$f, [["__scopeId", "data-v-e8b64ecb"]]);
19378
+ const DescriptionInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$e, [["__scopeId", "data-v-e8b64ecb"]]);
19206
19379
  var mdiAlertCircle = "M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z";
19207
19380
  var mdiArrowRight = "M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";
19208
19381
  var mdiCheckCircle = "M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z";
@@ -19233,8 +19406,8 @@ const icons = {
19233
19406
  cog: mdiCog,
19234
19407
  contentCopy: mdiContentCopy
19235
19408
  };
19236
- const _hoisted_1$8 = { class: "download-title" };
19237
- const _sfc_main$e = /* @__PURE__ */ defineComponent$1({
19409
+ const _hoisted_1$7 = { class: "download-title" };
19410
+ const _sfc_main$d = /* @__PURE__ */ defineComponent$1({
19238
19411
  ...{
19239
19412
  inheritAttrs: false
19240
19413
  },
@@ -19339,7 +19512,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent$1({
19339
19512
  ]),
19340
19513
  _: 1
19341
19514
  }, 8, ["start", "end", "class"])) : createCommentVNode("", true),
19342
- createElementVNode("span", _hoisted_1$8, toDisplayString(__props.title), 1),
19515
+ createElementVNode("span", _hoisted_1$7, toDisplayString(__props.title), 1),
19343
19516
  !__props.icon ? (openBlock(), createBlock(VIcon, {
19344
19517
  key: 1,
19345
19518
  start: "",
@@ -19352,18 +19525,18 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent$1({
19352
19525
  };
19353
19526
  }
19354
19527
  });
19355
- const DownloadButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$e, [["__scopeId", "data-v-0a911831"]]);
19356
- const _hoisted_1$7 = {
19528
+ const DownloadButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["__scopeId", "data-v-0a911831"]]);
19529
+ const _hoisted_1$6 = {
19357
19530
  key: 0,
19358
19531
  class: "pdf-viewer-header"
19359
19532
  };
19360
- const _hoisted_2$5 = { class: "pdf-viewer-title" };
19361
- const _hoisted_3$3 = { class: "pdf-viewer-controls" };
19362
- const _hoisted_4$1 = {
19533
+ const _hoisted_2$4 = { class: "pdf-viewer-title" };
19534
+ const _hoisted_3$2 = { class: "pdf-viewer-controls" };
19535
+ const _hoisted_4 = {
19363
19536
  key: 0,
19364
19537
  class: "zoom-controls"
19365
19538
  };
19366
- const _hoisted_5$1 = { class: "zoom-level" };
19539
+ const _hoisted_5 = { class: "zoom-level" };
19367
19540
  const _hoisted_6 = {
19368
19541
  key: 1,
19369
19542
  class: "navigation-controls"
@@ -19396,7 +19569,7 @@ const _hoisted_16 = {
19396
19569
  key: 0,
19397
19570
  class: "file-info"
19398
19571
  };
19399
- const _sfc_main$d = /* @__PURE__ */ defineComponent$1({
19572
+ const _sfc_main$c = /* @__PURE__ */ defineComponent$1({
19400
19573
  __name: "PdfViewer",
19401
19574
  props: {
19402
19575
  src: {},
@@ -19604,12 +19777,12 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent$1({
19604
19777
  return openBlock(), createElementBlock("div", {
19605
19778
  class: normalizeClass(["pdf-viewer-container", { "fullscreen": isFullscreen.value }])
19606
19779
  }, [
19607
- __props.showHeader ? (openBlock(), createElementBlock("div", _hoisted_1$7, [
19608
- createElementVNode("div", _hoisted_2$5, [
19780
+ __props.showHeader ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
19781
+ createElementVNode("div", _hoisted_2$4, [
19609
19782
  createElementVNode("h3", null, toDisplayString(__props.title || "PDF Viewer"), 1)
19610
19783
  ]),
19611
- createElementVNode("div", _hoisted_3$3, [
19612
- __props.showZoomControls ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
19784
+ createElementVNode("div", _hoisted_3$2, [
19785
+ __props.showZoomControls ? (openBlock(), createElementBlock("div", _hoisted_4, [
19613
19786
  createVNode(VBtn, {
19614
19787
  size: "small",
19615
19788
  variant: "text",
@@ -19625,7 +19798,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent$1({
19625
19798
  ]),
19626
19799
  _: 1
19627
19800
  }, 8, ["disabled"]),
19628
- createElementVNode("span", _hoisted_5$1, toDisplayString(Math.round(zoom.value * 100)) + "%", 1),
19801
+ createElementVNode("span", _hoisted_5, toDisplayString(Math.round(zoom.value * 100)) + "%", 1),
19629
19802
  createVNode(VBtn, {
19630
19803
  size: "small",
19631
19804
  variant: "text",
@@ -19823,8 +19996,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent$1({
19823
19996
  };
19824
19997
  }
19825
19998
  });
19826
- const PdfViewer = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["__scopeId", "data-v-f3e9c767"]]);
19827
- const _sfc_main$c = /* @__PURE__ */ defineComponent$1({
19999
+ const PdfViewer = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["__scopeId", "data-v-f3e9c767"]]);
20000
+ const _sfc_main$b = /* @__PURE__ */ defineComponent$1({
19828
20001
  __name: "UiChildCard",
19829
20002
  props: {
19830
20003
  title: String
@@ -19858,8 +20031,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent$1({
19858
20031
  };
19859
20032
  }
19860
20033
  });
19861
- const _hoisted_1$6 = { class: "d-sm-flex align-center justify-space-between" };
19862
- const _sfc_main$b = /* @__PURE__ */ defineComponent$1({
20034
+ const _hoisted_1$5 = { class: "d-sm-flex align-center justify-space-between" };
20035
+ const _sfc_main$a = /* @__PURE__ */ defineComponent$1({
19863
20036
  __name: "UiParentCard",
19864
20037
  props: {
19865
20038
  title: String
@@ -19871,7 +20044,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent$1({
19871
20044
  default: withCtx(() => [
19872
20045
  createVNode(VCardItem, null, {
19873
20046
  default: withCtx(() => [
19874
- createElementVNode("div", _hoisted_1$6, [
20047
+ createElementVNode("div", _hoisted_1$5, [
19875
20048
  createVNode(VCardTitle, null, {
19876
20049
  default: withCtx(() => [
19877
20050
  createTextVNode(toDisplayString(props.title), 1)
@@ -19896,7 +20069,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent$1({
19896
20069
  };
19897
20070
  }
19898
20071
  });
19899
- const _sfc_main$a = /* @__PURE__ */ defineComponent$1({
20072
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent$1({
19900
20073
  __name: "VPriceTextField",
19901
20074
  props: {
19902
20075
  modelValue: {},
@@ -19997,112 +20170,6 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent$1({
19997
20170
  };
19998
20171
  }
19999
20172
  });
20000
- const _hoisted_1$5 = { class: "mb-6" };
20001
- const _hoisted_2$4 = { class: "text-subtitle-1 font-weight-medium mb-3" };
20002
- const _hoisted_3$2 = { class: "theme-toggle-container" };
20003
- const _hoisted_4 = { class: "toggle-slider" };
20004
- const _hoisted_5 = { class: "toggle-icon" };
20005
- const _sfc_main$9 = /* @__PURE__ */ defineComponent$1({
20006
- __name: "ToggleSwitch",
20007
- props: {
20008
- modelValue: { type: [String, Boolean] },
20009
- label: {},
20010
- type: { default: "boolean" },
20011
- options: { default: () => [] },
20012
- trueLabel: {},
20013
- falseLabel: {},
20014
- trueIcon: {},
20015
- falseIcon: {},
20016
- activeColor: { default: "rgb(var(--v-theme-primary))" },
20017
- inactiveColor: { default: "#e0e0e0" }
20018
- },
20019
- emits: ["update:modelValue"],
20020
- setup(__props, { emit: __emit }) {
20021
- const props = __props;
20022
- const emit = __emit;
20023
- const isBooleanMode = computed(() => props.type === "boolean");
20024
- const isStringMode = computed(() => props.type === "string");
20025
- const isActive = computed(() => {
20026
- if (isBooleanMode.value) {
20027
- return props.modelValue === true;
20028
- }
20029
- return false;
20030
- });
20031
- const currentIndex = computed(() => {
20032
- if (isStringMode.value && props.options.length > 0) {
20033
- return props.options.findIndex((opt) => opt.value === props.modelValue);
20034
- }
20035
- return 0;
20036
- });
20037
- const handleToggle = () => {
20038
- if (isBooleanMode.value) {
20039
- emit("update:modelValue", !props.modelValue);
20040
- } else if (isStringMode.value && props.options.length > 0) {
20041
- const nextIndex = (currentIndex.value + 1) % props.options.length;
20042
- emit("update:modelValue", props.options[nextIndex].value);
20043
- }
20044
- };
20045
- const isToggleActive = computed(() => {
20046
- if (isBooleanMode.value) {
20047
- return isActive.value;
20048
- } else {
20049
- if (props.options.length >= 2) {
20050
- return currentIndex.value >= 1;
20051
- } else if (props.options.length === 1) {
20052
- return true;
20053
- }
20054
- return false;
20055
- }
20056
- });
20057
- const currentOption = computed(() => {
20058
- if (isStringMode.value && props.options.length > 0) {
20059
- return props.options[currentIndex.value] || props.options[0];
20060
- }
20061
- return null;
20062
- });
20063
- const displayIcon = computed(() => {
20064
- var _a;
20065
- if (isBooleanMode.value) {
20066
- return isActive.value ? props.trueIcon : props.falseIcon;
20067
- } else {
20068
- return (_a = currentOption.value) == null ? void 0 : _a.icon;
20069
- }
20070
- });
20071
- return (_ctx, _cache) => {
20072
- return openBlock(), createElementBlock("div", _hoisted_1$5, [
20073
- createElementVNode("h6", _hoisted_2$4, toDisplayString(__props.label), 1),
20074
- createElementVNode("div", _hoisted_3$2, [
20075
- createElementVNode("div", {
20076
- class: normalizeClass(["theme-toggle", {
20077
- "active": isToggleActive.value,
20078
- "string-mode": isStringMode.value
20079
- }]),
20080
- style: normalizeStyle({
20081
- background: isToggleActive.value ? props.activeColor : props.inactiveColor
20082
- }),
20083
- onClick: handleToggle
20084
- }, [
20085
- createElementVNode("div", _hoisted_4, [
20086
- createElementVNode("div", _hoisted_5, [
20087
- renderSlot(_ctx.$slots, "icon", {
20088
- value: __props.modelValue,
20089
- option: currentOption.value
20090
- }, () => [
20091
- displayIcon.value ? (openBlock(), createBlock(resolveDynamicComponent(displayIcon.value), {
20092
- key: 0,
20093
- size: "24",
20094
- "stroke-width": "2"
20095
- })) : createCommentVNode("", true)
20096
- ], true)
20097
- ])
20098
- ])
20099
- ], 6)
20100
- ])
20101
- ]);
20102
- };
20103
- }
20104
- });
20105
- const ToggleSwitch = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["__scopeId", "data-v-536e1a17"]]);
20106
20173
  const _hoisted_1$4 = {
20107
20174
  class: "app-stepper-root",
20108
20175
  dir: "rtl"
@@ -39538,7 +39605,7 @@ export {
39538
39605
  BooleanEnumOptions,
39539
39606
  _sfc_main$k as ConfirmDialog,
39540
39607
  CustomAutocomplete,
39541
- _sfc_main$g as CustomDataTable,
39608
+ _sfc_main$f as CustomDataTable,
39542
39609
  DateConverter,
39543
39610
  DescriptionInput,
39544
39611
  DigitLimit,
@@ -39553,9 +39620,9 @@ export {
39553
39620
  PdfViewer,
39554
39621
  ShamsiDatePicker,
39555
39622
  ToggleSwitch,
39556
- _sfc_main$c as UiChildCard,
39557
- _sfc_main$b as UiParentCard,
39558
- _sfc_main$a as VPriceTextField,
39623
+ _sfc_main$b as UiChildCard,
39624
+ _sfc_main$a as UiParentCard,
39625
+ _sfc_main$9 as VPriceTextField,
39559
39626
  bootstrapApp,
39560
39627
  configureAuth,
39561
39628
  configureAxiosInstance,