@amirjalili1374/ui-kit 1.3.21 → 1.3.23
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/components/shared/CustomDataTable.vue.d.ts +1 -0
- package/dist/components/shared/CustomDataTable.vue.d.ts.map +1 -1
- package/dist/types/componentTypes/DataTableTypes.d.ts +1 -0
- package/dist/types/componentTypes/DataTableTypes.d.ts.map +1 -1
- package/dist/ui-kit.cjs.js +1 -1
- package/dist/ui-kit.cjs.js.map +1 -1
- package/dist/ui-kit.es.js +472 -309
- package/dist/ui-kit.es.js.map +1 -1
- package/package.json +1 -1
package/dist/ui-kit.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
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,
|
|
1
|
+
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
2
|
import { IconHome, IconArrowBadgeLeft, IconChevronDown, IconChevronRight, IconMinus, IconPlus, IconRefresh, IconChevronLeft, IconDownload, IconPrinter, IconMaximize, IconMinimize, IconX, IconFileText, IconCheck, IconPencil, IconClock } from "@tabler/icons-vue";
|
|
3
3
|
import axios from "axios";
|
|
4
4
|
import { useDebounceFn } from "@vueuse/core";
|
|
@@ -16656,6 +16656,267 @@ const VSnackbar = genericComponent()({
|
|
|
16656
16656
|
return forwardRefs({}, overlay);
|
|
16657
16657
|
}
|
|
16658
16658
|
});
|
|
16659
|
+
const makeVTextareaProps = propsFactory({
|
|
16660
|
+
autoGrow: Boolean,
|
|
16661
|
+
autofocus: Boolean,
|
|
16662
|
+
counter: [Boolean, Number, String],
|
|
16663
|
+
counterValue: Function,
|
|
16664
|
+
prefix: String,
|
|
16665
|
+
placeholder: String,
|
|
16666
|
+
persistentPlaceholder: Boolean,
|
|
16667
|
+
persistentCounter: Boolean,
|
|
16668
|
+
noResize: Boolean,
|
|
16669
|
+
rows: {
|
|
16670
|
+
type: [Number, String],
|
|
16671
|
+
default: 5,
|
|
16672
|
+
validator: (v) => !isNaN(parseFloat(v))
|
|
16673
|
+
},
|
|
16674
|
+
maxRows: {
|
|
16675
|
+
type: [Number, String],
|
|
16676
|
+
validator: (v) => !isNaN(parseFloat(v))
|
|
16677
|
+
},
|
|
16678
|
+
suffix: String,
|
|
16679
|
+
modelModifiers: Object,
|
|
16680
|
+
...makeAutocompleteProps(),
|
|
16681
|
+
...makeVInputProps(),
|
|
16682
|
+
...makeVFieldProps()
|
|
16683
|
+
}, "VTextarea");
|
|
16684
|
+
const VTextarea = genericComponent()({
|
|
16685
|
+
name: "VTextarea",
|
|
16686
|
+
directives: {
|
|
16687
|
+
vIntersect: Intersect
|
|
16688
|
+
},
|
|
16689
|
+
inheritAttrs: false,
|
|
16690
|
+
props: makeVTextareaProps(),
|
|
16691
|
+
emits: {
|
|
16692
|
+
"click:control": (e) => true,
|
|
16693
|
+
"mousedown:control": (e) => true,
|
|
16694
|
+
"update:focused": (focused) => true,
|
|
16695
|
+
"update:modelValue": (val2) => true,
|
|
16696
|
+
"update:rows": (rows) => true
|
|
16697
|
+
},
|
|
16698
|
+
setup(props, _ref) {
|
|
16699
|
+
let {
|
|
16700
|
+
attrs,
|
|
16701
|
+
emit,
|
|
16702
|
+
slots
|
|
16703
|
+
} = _ref;
|
|
16704
|
+
const model = useProxiedModel(props, "modelValue");
|
|
16705
|
+
const {
|
|
16706
|
+
isFocused,
|
|
16707
|
+
focus,
|
|
16708
|
+
blur
|
|
16709
|
+
} = useFocus(props);
|
|
16710
|
+
const {
|
|
16711
|
+
onIntersect
|
|
16712
|
+
} = useAutofocus(props);
|
|
16713
|
+
const counterValue = computed(() => {
|
|
16714
|
+
return typeof props.counterValue === "function" ? props.counterValue(model.value) : (model.value || "").toString().length;
|
|
16715
|
+
});
|
|
16716
|
+
const max = computed(() => {
|
|
16717
|
+
if (attrs.maxlength) return attrs.maxlength;
|
|
16718
|
+
if (!props.counter || typeof props.counter !== "number" && typeof props.counter !== "string") return void 0;
|
|
16719
|
+
return props.counter;
|
|
16720
|
+
});
|
|
16721
|
+
const vInputRef = ref();
|
|
16722
|
+
const vFieldRef = ref();
|
|
16723
|
+
const controlHeight = shallowRef("");
|
|
16724
|
+
const textareaRef = ref();
|
|
16725
|
+
const autocomplete = useAutocomplete(props);
|
|
16726
|
+
const isActive = computed(() => props.persistentPlaceholder || isFocused.value || props.active);
|
|
16727
|
+
function onFocus() {
|
|
16728
|
+
var _a;
|
|
16729
|
+
if (autocomplete.isSuppressing.value) {
|
|
16730
|
+
autocomplete.update();
|
|
16731
|
+
}
|
|
16732
|
+
if (textareaRef.value !== document.activeElement) {
|
|
16733
|
+
(_a = textareaRef.value) == null ? void 0 : _a.focus();
|
|
16734
|
+
}
|
|
16735
|
+
if (!isFocused.value) focus();
|
|
16736
|
+
}
|
|
16737
|
+
function onControlClick(e) {
|
|
16738
|
+
onFocus();
|
|
16739
|
+
emit("click:control", e);
|
|
16740
|
+
}
|
|
16741
|
+
function onControlMousedown(e) {
|
|
16742
|
+
emit("mousedown:control", e);
|
|
16743
|
+
}
|
|
16744
|
+
function onClear(e) {
|
|
16745
|
+
e.stopPropagation();
|
|
16746
|
+
onFocus();
|
|
16747
|
+
nextTick(() => {
|
|
16748
|
+
model.value = "";
|
|
16749
|
+
callEvent(props["onClick:clear"], e);
|
|
16750
|
+
});
|
|
16751
|
+
}
|
|
16752
|
+
function onInput(e) {
|
|
16753
|
+
var _a;
|
|
16754
|
+
const el = e.target;
|
|
16755
|
+
model.value = el.value;
|
|
16756
|
+
if ((_a = props.modelModifiers) == null ? void 0 : _a.trim) {
|
|
16757
|
+
const caretPosition = [el.selectionStart, el.selectionEnd];
|
|
16758
|
+
nextTick(() => {
|
|
16759
|
+
el.selectionStart = caretPosition[0];
|
|
16760
|
+
el.selectionEnd = caretPosition[1];
|
|
16761
|
+
});
|
|
16762
|
+
}
|
|
16763
|
+
}
|
|
16764
|
+
const sizerRef = ref();
|
|
16765
|
+
const rows = ref(Number(props.rows));
|
|
16766
|
+
const isPlainOrUnderlined = computed(() => ["plain", "underlined"].includes(props.variant));
|
|
16767
|
+
watchEffect(() => {
|
|
16768
|
+
if (!props.autoGrow) rows.value = Number(props.rows);
|
|
16769
|
+
});
|
|
16770
|
+
function calculateInputHeight() {
|
|
16771
|
+
if (!props.autoGrow) return;
|
|
16772
|
+
nextTick(() => {
|
|
16773
|
+
if (!sizerRef.value || !vFieldRef.value) return;
|
|
16774
|
+
const style = getComputedStyle(sizerRef.value);
|
|
16775
|
+
const fieldStyle = getComputedStyle(vFieldRef.value.$el);
|
|
16776
|
+
const padding = parseFloat(style.getPropertyValue("--v-field-padding-top")) + parseFloat(style.getPropertyValue("--v-input-padding-top")) + parseFloat(style.getPropertyValue("--v-field-padding-bottom"));
|
|
16777
|
+
const height2 = sizerRef.value.scrollHeight;
|
|
16778
|
+
const lineHeight = parseFloat(style.lineHeight);
|
|
16779
|
+
const minHeight = Math.max(parseFloat(props.rows) * lineHeight + padding, parseFloat(fieldStyle.getPropertyValue("--v-input-control-height")));
|
|
16780
|
+
const maxHeight = parseFloat(props.maxRows) * lineHeight + padding || Infinity;
|
|
16781
|
+
const newHeight = clamp(height2 ?? 0, minHeight, maxHeight);
|
|
16782
|
+
rows.value = Math.floor((newHeight - padding) / lineHeight);
|
|
16783
|
+
controlHeight.value = convertToUnit(newHeight);
|
|
16784
|
+
});
|
|
16785
|
+
}
|
|
16786
|
+
onMounted(calculateInputHeight);
|
|
16787
|
+
watch(model, calculateInputHeight);
|
|
16788
|
+
watch(() => props.rows, calculateInputHeight);
|
|
16789
|
+
watch(() => props.maxRows, calculateInputHeight);
|
|
16790
|
+
watch(() => props.density, calculateInputHeight);
|
|
16791
|
+
watch(rows, (val2) => {
|
|
16792
|
+
emit("update:rows", val2);
|
|
16793
|
+
});
|
|
16794
|
+
let observer;
|
|
16795
|
+
watch(sizerRef, (val2) => {
|
|
16796
|
+
if (val2) {
|
|
16797
|
+
observer = new ResizeObserver(calculateInputHeight);
|
|
16798
|
+
observer.observe(sizerRef.value);
|
|
16799
|
+
} else {
|
|
16800
|
+
observer == null ? void 0 : observer.disconnect();
|
|
16801
|
+
}
|
|
16802
|
+
});
|
|
16803
|
+
onBeforeUnmount(() => {
|
|
16804
|
+
observer == null ? void 0 : observer.disconnect();
|
|
16805
|
+
});
|
|
16806
|
+
useRender(() => {
|
|
16807
|
+
const hasCounter = !!(slots.counter || props.counter || props.counterValue);
|
|
16808
|
+
const hasDetails = !!(hasCounter || slots.details);
|
|
16809
|
+
const [rootAttrs, inputAttrs] = filterInputAttrs(attrs);
|
|
16810
|
+
const {
|
|
16811
|
+
modelValue: _,
|
|
16812
|
+
...inputProps
|
|
16813
|
+
} = VInput.filterProps(props);
|
|
16814
|
+
const fieldProps = {
|
|
16815
|
+
...VField.filterProps(props),
|
|
16816
|
+
"onClick:clear": onClear
|
|
16817
|
+
};
|
|
16818
|
+
return createVNode(VInput, mergeProps({
|
|
16819
|
+
"ref": vInputRef,
|
|
16820
|
+
"modelValue": model.value,
|
|
16821
|
+
"onUpdate:modelValue": ($event) => model.value = $event,
|
|
16822
|
+
"class": ["v-textarea v-text-field", {
|
|
16823
|
+
"v-textarea--prefixed": props.prefix,
|
|
16824
|
+
"v-textarea--suffixed": props.suffix,
|
|
16825
|
+
"v-text-field--prefixed": props.prefix,
|
|
16826
|
+
"v-text-field--suffixed": props.suffix,
|
|
16827
|
+
"v-textarea--auto-grow": props.autoGrow,
|
|
16828
|
+
"v-textarea--no-resize": props.noResize || props.autoGrow,
|
|
16829
|
+
"v-input--plain-underlined": isPlainOrUnderlined.value
|
|
16830
|
+
}, props.class],
|
|
16831
|
+
"style": props.style
|
|
16832
|
+
}, rootAttrs, inputProps, {
|
|
16833
|
+
"centerAffix": rows.value === 1 && !isPlainOrUnderlined.value,
|
|
16834
|
+
"focused": isFocused.value
|
|
16835
|
+
}), {
|
|
16836
|
+
...slots,
|
|
16837
|
+
default: (_ref2) => {
|
|
16838
|
+
let {
|
|
16839
|
+
id,
|
|
16840
|
+
isDisabled,
|
|
16841
|
+
isDirty,
|
|
16842
|
+
isReadonly,
|
|
16843
|
+
isValid,
|
|
16844
|
+
hasDetails: hasDetails2
|
|
16845
|
+
} = _ref2;
|
|
16846
|
+
return createVNode(VField, mergeProps({
|
|
16847
|
+
"ref": vFieldRef,
|
|
16848
|
+
"style": {
|
|
16849
|
+
"--v-textarea-control-height": controlHeight.value
|
|
16850
|
+
},
|
|
16851
|
+
"onClick": onControlClick,
|
|
16852
|
+
"onMousedown": onControlMousedown,
|
|
16853
|
+
"onClick:prependInner": props["onClick:prependInner"],
|
|
16854
|
+
"onClick:appendInner": props["onClick:appendInner"]
|
|
16855
|
+
}, fieldProps, {
|
|
16856
|
+
"id": id.value,
|
|
16857
|
+
"active": isActive.value || isDirty.value,
|
|
16858
|
+
"centerAffix": rows.value === 1 && !isPlainOrUnderlined.value,
|
|
16859
|
+
"dirty": isDirty.value || props.dirty,
|
|
16860
|
+
"disabled": isDisabled.value,
|
|
16861
|
+
"focused": isFocused.value,
|
|
16862
|
+
"details": hasDetails2.value,
|
|
16863
|
+
"error": isValid.value === false
|
|
16864
|
+
}), {
|
|
16865
|
+
...slots,
|
|
16866
|
+
default: (_ref3) => {
|
|
16867
|
+
let {
|
|
16868
|
+
props: {
|
|
16869
|
+
class: fieldClass,
|
|
16870
|
+
...slotProps
|
|
16871
|
+
}
|
|
16872
|
+
} = _ref3;
|
|
16873
|
+
return createElementVNode(Fragment, null, [props.prefix && createElementVNode("span", {
|
|
16874
|
+
"class": "v-text-field__prefix"
|
|
16875
|
+
}, [props.prefix]), withDirectives(createElementVNode("textarea", mergeProps({
|
|
16876
|
+
"ref": textareaRef,
|
|
16877
|
+
"class": fieldClass,
|
|
16878
|
+
"value": model.value,
|
|
16879
|
+
"onInput": onInput,
|
|
16880
|
+
"autofocus": props.autofocus,
|
|
16881
|
+
"readonly": isReadonly.value,
|
|
16882
|
+
"disabled": isDisabled.value,
|
|
16883
|
+
"placeholder": props.placeholder,
|
|
16884
|
+
"rows": props.rows,
|
|
16885
|
+
"name": autocomplete.fieldName.value,
|
|
16886
|
+
"autocomplete": autocomplete.fieldAutocomplete.value,
|
|
16887
|
+
"onFocus": onFocus,
|
|
16888
|
+
"onBlur": blur
|
|
16889
|
+
}, slotProps, inputAttrs), null), [[Intersect, {
|
|
16890
|
+
handler: onIntersect
|
|
16891
|
+
}, null, {
|
|
16892
|
+
once: true
|
|
16893
|
+
}]]), props.autoGrow && withDirectives(createElementVNode("textarea", {
|
|
16894
|
+
"class": normalizeClass([fieldClass, "v-textarea__sizer"]),
|
|
16895
|
+
"id": `${slotProps.id}-sizer`,
|
|
16896
|
+
"onUpdate:modelValue": ($event) => model.value = $event,
|
|
16897
|
+
"ref": sizerRef,
|
|
16898
|
+
"readonly": true,
|
|
16899
|
+
"aria-hidden": "true"
|
|
16900
|
+
}, null), [[vModelText, model.value]]), props.suffix && createElementVNode("span", {
|
|
16901
|
+
"class": "v-text-field__suffix"
|
|
16902
|
+
}, [props.suffix])]);
|
|
16903
|
+
}
|
|
16904
|
+
});
|
|
16905
|
+
},
|
|
16906
|
+
details: hasDetails ? (slotProps) => {
|
|
16907
|
+
var _a;
|
|
16908
|
+
return createElementVNode(Fragment, null, [(_a = slots.details) == null ? void 0 : _a.call(slots, slotProps), hasCounter && createElementVNode(Fragment, null, [createElementVNode("span", null, null), createVNode(VCounter, {
|
|
16909
|
+
"active": props.persistentCounter || isFocused.value,
|
|
16910
|
+
"value": counterValue.value,
|
|
16911
|
+
"max": max.value,
|
|
16912
|
+
"disabled": props.disabled
|
|
16913
|
+
}, slots.counter)])]);
|
|
16914
|
+
} : void 0
|
|
16915
|
+
});
|
|
16916
|
+
});
|
|
16917
|
+
return forwardRefs({}, vInputRef, vFieldRef, textareaRef);
|
|
16918
|
+
}
|
|
16919
|
+
});
|
|
16659
16920
|
const _hoisted_1$9 = {
|
|
16660
16921
|
key: 0,
|
|
16661
16922
|
class: "page-title"
|
|
@@ -16689,17 +16950,21 @@ const _hoisted_12$1 = ["onClick", "onKeydown", "aria-expanded", "aria-controls",
|
|
|
16689
16950
|
const _hoisted_13$1 = { class: "group-label" };
|
|
16690
16951
|
const _hoisted_14$1 = ["id", "aria-labelledby"];
|
|
16691
16952
|
const _hoisted_15$1 = ["tabindex", "onKeydown", "onClick"];
|
|
16692
|
-
const _hoisted_16$1 = ["
|
|
16693
|
-
const _hoisted_17 = {
|
|
16953
|
+
const _hoisted_16$1 = ["onClick"];
|
|
16954
|
+
const _hoisted_17 = { key: 1 };
|
|
16955
|
+
const _hoisted_18 = ["tabindex", "onKeydown", "onClick"];
|
|
16956
|
+
const _hoisted_19 = ["onClick"];
|
|
16957
|
+
const _hoisted_20 = { key: 1 };
|
|
16958
|
+
const _hoisted_21 = {
|
|
16694
16959
|
key: 2,
|
|
16695
16960
|
class: "d-flex justify-center align-center pa-4"
|
|
16696
16961
|
};
|
|
16697
|
-
const
|
|
16962
|
+
const _hoisted_22 = {
|
|
16698
16963
|
key: 2,
|
|
16699
16964
|
class: "pagination-wrapper"
|
|
16700
16965
|
};
|
|
16701
|
-
const
|
|
16702
|
-
const
|
|
16966
|
+
const _hoisted_23 = { class: "d-flex justify-space-between align-center pa-4" };
|
|
16967
|
+
const _hoisted_24 = { class: "text-subtitle-2" };
|
|
16703
16968
|
const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
16704
16969
|
...{ inheritAttrs: false },
|
|
16705
16970
|
__name: "CustomDataTable",
|
|
@@ -16733,7 +16998,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
16733
16998
|
defaultSelected: {},
|
|
16734
16999
|
dateWithTimezone: { type: Boolean, default: false },
|
|
16735
17000
|
bulkMode: { type: Boolean, default: false },
|
|
16736
|
-
axiosInstance: {}
|
|
17001
|
+
axiosInstance: {},
|
|
17002
|
+
maxTextLength: { default: 50 }
|
|
16737
17003
|
},
|
|
16738
17004
|
emits: ["update:selectedItems", "selection-change"],
|
|
16739
17005
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -17175,6 +17441,10 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17175
17441
|
const customActionDialog = ref(false);
|
|
17176
17442
|
const customActionComponent = shallowRef(null);
|
|
17177
17443
|
const customActionItem = ref(null);
|
|
17444
|
+
const textPreviewDialog = ref(false);
|
|
17445
|
+
const previewText = ref("");
|
|
17446
|
+
const previewTitle = ref("");
|
|
17447
|
+
const previewItem = ref(null);
|
|
17178
17448
|
__expose({
|
|
17179
17449
|
fetchData,
|
|
17180
17450
|
items,
|
|
@@ -17529,6 +17799,57 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17529
17799
|
};
|
|
17530
17800
|
return translations[value2] || value2;
|
|
17531
17801
|
};
|
|
17802
|
+
const truncateText = (text2, maxLength = props.maxTextLength) => {
|
|
17803
|
+
if (text2 === null || text2 === void 0) return "";
|
|
17804
|
+
const textStr = String(text2);
|
|
17805
|
+
if (textStr.length <= maxLength) return textStr;
|
|
17806
|
+
return textStr.substring(0, maxLength) + "...";
|
|
17807
|
+
};
|
|
17808
|
+
const shouldTruncate = (text2) => {
|
|
17809
|
+
if (text2 === null || text2 === void 0) return false;
|
|
17810
|
+
return String(text2).length > props.maxTextLength;
|
|
17811
|
+
};
|
|
17812
|
+
const openTextPreview = (text2, columnTitle, item) => {
|
|
17813
|
+
previewText.value = text2 === null || text2 === void 0 ? "" : String(text2);
|
|
17814
|
+
previewTitle.value = columnTitle;
|
|
17815
|
+
previewItem.value = item;
|
|
17816
|
+
textPreviewDialog.value = true;
|
|
17817
|
+
};
|
|
17818
|
+
const copyToClipboard = async (text2) => {
|
|
17819
|
+
try {
|
|
17820
|
+
await navigator.clipboard.writeText(text2);
|
|
17821
|
+
snackbarMessage.value = "✅ متن با موفقیت کپی شد!";
|
|
17822
|
+
snackbar.value = true;
|
|
17823
|
+
} catch (err) {
|
|
17824
|
+
console.error("Failed to copy text:", err);
|
|
17825
|
+
try {
|
|
17826
|
+
const textArea = document.createElement("textarea");
|
|
17827
|
+
textArea.value = text2;
|
|
17828
|
+
textArea.style.position = "fixed";
|
|
17829
|
+
textArea.style.opacity = "0";
|
|
17830
|
+
document.body.appendChild(textArea);
|
|
17831
|
+
textArea.select();
|
|
17832
|
+
document.execCommand("copy");
|
|
17833
|
+
document.body.removeChild(textArea);
|
|
17834
|
+
snackbarMessage.value = "✅ متن با موفقیت کپی شد!";
|
|
17835
|
+
snackbar.value = true;
|
|
17836
|
+
} catch (fallbackErr) {
|
|
17837
|
+
snackbarMessage.value = "❌ خطا در کپی کردن متن!";
|
|
17838
|
+
snackbar.value = true;
|
|
17839
|
+
}
|
|
17840
|
+
}
|
|
17841
|
+
};
|
|
17842
|
+
const copyCompleteRecord = async () => {
|
|
17843
|
+
if (!previewItem.value) return;
|
|
17844
|
+
try {
|
|
17845
|
+
const recordText = JSON.stringify(previewItem.value, null, 2);
|
|
17846
|
+
await copyToClipboard(recordText);
|
|
17847
|
+
} catch (err) {
|
|
17848
|
+
console.error("Failed to copy record:", err);
|
|
17849
|
+
snackbarMessage.value = "❌ خطا در کپی کردن رکورد!";
|
|
17850
|
+
snackbar.value = true;
|
|
17851
|
+
}
|
|
17852
|
+
};
|
|
17532
17853
|
const handleFilterApply = (filterData) => {
|
|
17533
17854
|
filterModel.value = filterData;
|
|
17534
17855
|
currentPage.value = 1;
|
|
@@ -17548,7 +17869,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17548
17869
|
class: "me-2",
|
|
17549
17870
|
onClick: _cache[0] || (_cache[0] = ($event) => openDialog())
|
|
17550
17871
|
}, {
|
|
17551
|
-
default: withCtx(() => [..._cache[
|
|
17872
|
+
default: withCtx(() => [..._cache[23] || (_cache[23] = [
|
|
17552
17873
|
createTextVNode("ایجاد ✅", -1)
|
|
17553
17874
|
])]),
|
|
17554
17875
|
_: 1
|
|
@@ -17558,7 +17879,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17558
17879
|
class: "me-2",
|
|
17559
17880
|
onClick: _cache[1] || (_cache[1] = ($event) => filterDialog.value = true)
|
|
17560
17881
|
}, {
|
|
17561
|
-
default: withCtx(() => [..._cache[
|
|
17882
|
+
default: withCtx(() => [..._cache[24] || (_cache[24] = [
|
|
17562
17883
|
createTextVNode("فیلتر 🔍", -1)
|
|
17563
17884
|
])]),
|
|
17564
17885
|
_: 1
|
|
@@ -17569,7 +17890,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17569
17890
|
onClick: unref(debouncedFetchData),
|
|
17570
17891
|
loading: loading.value
|
|
17571
17892
|
}, {
|
|
17572
|
-
default: withCtx(() => [..._cache[
|
|
17893
|
+
default: withCtx(() => [..._cache[25] || (_cache[25] = [
|
|
17573
17894
|
createTextVNode("بروزرسانی 🔄", -1)
|
|
17574
17895
|
])]),
|
|
17575
17896
|
_: 1
|
|
@@ -17590,7 +17911,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17590
17911
|
class: "me-2",
|
|
17591
17912
|
onClick: clearSelection
|
|
17592
17913
|
}, {
|
|
17593
|
-
default: withCtx(() => [..._cache[
|
|
17914
|
+
default: withCtx(() => [..._cache[26] || (_cache[26] = [
|
|
17594
17915
|
createTextVNode(" پاک کردن انتخاب ", -1)
|
|
17595
17916
|
])]),
|
|
17596
17917
|
_: 1
|
|
@@ -17610,7 +17931,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17610
17931
|
onClick: openGroupDeleteDialog
|
|
17611
17932
|
}, {
|
|
17612
17933
|
default: withCtx(() => [
|
|
17613
|
-
_cache[
|
|
17934
|
+
_cache[27] || (_cache[27] = createElementVNode("span", { class: "me-1" }, "🗑️", -1)),
|
|
17614
17935
|
createTextVNode(" حذف گروهی (" + toDisplayString(selectedCount.value) + ") ", 1)
|
|
17615
17936
|
]),
|
|
17616
17937
|
_: 1
|
|
@@ -17627,7 +17948,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17627
17948
|
class: "me-2",
|
|
17628
17949
|
onClick: ($event) => openDialog(item)
|
|
17629
17950
|
}, {
|
|
17630
|
-
default: withCtx(() => [..._cache[
|
|
17951
|
+
default: withCtx(() => [..._cache[28] || (_cache[28] = [
|
|
17631
17952
|
createElementVNode("span", { class: "me-1" }, "✏️", -1),
|
|
17632
17953
|
createTextVNode(" ویرایش ", -1)
|
|
17633
17954
|
])]),
|
|
@@ -17640,7 +17961,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17640
17961
|
class: "me-2",
|
|
17641
17962
|
onClick: ($event) => openDeleteDialog(item)
|
|
17642
17963
|
}, {
|
|
17643
|
-
default: withCtx(() => [..._cache[
|
|
17964
|
+
default: withCtx(() => [..._cache[29] || (_cache[29] = [
|
|
17644
17965
|
createElementVNode("span", { class: "me-1" }, "🗑️", -1),
|
|
17645
17966
|
createTextVNode(" حذف ", -1)
|
|
17646
17967
|
])]),
|
|
@@ -17653,7 +17974,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17653
17974
|
class: "me-2",
|
|
17654
17975
|
onClick: ($event) => goToRoute("view", item)
|
|
17655
17976
|
}, {
|
|
17656
|
-
default: withCtx(() => [..._cache[
|
|
17977
|
+
default: withCtx(() => [..._cache[30] || (_cache[30] = [
|
|
17657
17978
|
createElementVNode("span", { class: "me-1" }, "👁️", -1),
|
|
17658
17979
|
createTextVNode(" نمایش ", -1)
|
|
17659
17980
|
])]),
|
|
@@ -17668,7 +17989,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17668
17989
|
onClick: ($event) => goToRoute(routeKey, item)
|
|
17669
17990
|
}, {
|
|
17670
17991
|
default: withCtx(() => [
|
|
17671
|
-
_cache[
|
|
17992
|
+
_cache[31] || (_cache[31] = createElementVNode("span", { class: "me-1" }, "➡️", -1)),
|
|
17672
17993
|
createTextVNode(" " + toDisplayString(String(routeKey)), 1)
|
|
17673
17994
|
]),
|
|
17674
17995
|
_: 2
|
|
@@ -17682,7 +18003,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17682
18003
|
onClick: ($event) => download(key2, item)
|
|
17683
18004
|
}, {
|
|
17684
18005
|
default: withCtx(() => [
|
|
17685
|
-
_cache[
|
|
18006
|
+
_cache[32] || (_cache[32] = createElementVNode("span", { class: "me-1" }, "⬇️", -1)),
|
|
17686
18007
|
createTextVNode(" " + toDisplayString(key2), 1)
|
|
17687
18008
|
]),
|
|
17688
18009
|
_: 2
|
|
@@ -17769,7 +18090,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17769
18090
|
onClick: expandAllGroups,
|
|
17770
18091
|
class: "me-2"
|
|
17771
18092
|
}, {
|
|
17772
|
-
default: withCtx(() => [..._cache[
|
|
18093
|
+
default: withCtx(() => [..._cache[33] || (_cache[33] = [
|
|
17773
18094
|
createTextVNode(" گسترش همه ", -1)
|
|
17774
18095
|
])]),
|
|
17775
18096
|
_: 1
|
|
@@ -17780,7 +18101,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17780
18101
|
onClick: collapseAllGroups,
|
|
17781
18102
|
class: "me-2"
|
|
17782
18103
|
}, {
|
|
17783
|
-
default: withCtx(() => [..._cache[
|
|
18104
|
+
default: withCtx(() => [..._cache[34] || (_cache[34] = [
|
|
17784
18105
|
createTextVNode(" جمع کردن همه ", -1)
|
|
17785
18106
|
])]),
|
|
17786
18107
|
_: 1
|
|
@@ -17908,7 +18229,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17908
18229
|
class: "mr-2",
|
|
17909
18230
|
onClick: ($event) => openDialog(item)
|
|
17910
18231
|
}, {
|
|
17911
|
-
default: withCtx(() => [..._cache[
|
|
18232
|
+
default: withCtx(() => [..._cache[35] || (_cache[35] = [
|
|
17912
18233
|
createTextVNode(" ویرایش ✏️ ", -1)
|
|
17913
18234
|
])]),
|
|
17914
18235
|
_: 1
|
|
@@ -17920,7 +18241,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17920
18241
|
class: "mr-2",
|
|
17921
18242
|
onClick: ($event) => openDeleteDialog(item)
|
|
17922
18243
|
}, {
|
|
17923
|
-
default: withCtx(() => [..._cache[
|
|
18244
|
+
default: withCtx(() => [..._cache[36] || (_cache[36] = [
|
|
17924
18245
|
createTextVNode("حذف ❌ ", -1)
|
|
17925
18246
|
])]),
|
|
17926
18247
|
_: 1
|
|
@@ -17932,7 +18253,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
17932
18253
|
class: "mr-2",
|
|
17933
18254
|
onClick: ($event) => goToRoute("view", item)
|
|
17934
18255
|
}, {
|
|
17935
|
-
default: withCtx(() => [..._cache[
|
|
18256
|
+
default: withCtx(() => [..._cache[37] || (_cache[37] = [
|
|
17936
18257
|
createTextVNode("🔍 نمایش ", -1)
|
|
17937
18258
|
])]),
|
|
17938
18259
|
_: 1
|
|
@@ -18011,7 +18332,12 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18011
18332
|
}, 1032, ["color", "onClick"]);
|
|
18012
18333
|
}), 128))
|
|
18013
18334
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
18014
|
-
|
|
18335
|
+
shouldTruncate(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item)) ? (openBlock(), createElementBlock("span", {
|
|
18336
|
+
key: 0,
|
|
18337
|
+
class: "truncated-text",
|
|
18338
|
+
style: { cursor: "pointer", color: "rgb(var(--v-theme-primary))", textDecoration: "underline" },
|
|
18339
|
+
onClick: withModifiers(($event) => openTextPreview(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item), column.title || column.key || "", item), ["stop"])
|
|
18340
|
+
}, toDisplayString(truncateText(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item))), 9, _hoisted_16$1)) : (openBlock(), createElementBlock("span", _hoisted_17, toDisplayString(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item)), 1))
|
|
18015
18341
|
], 64))
|
|
18016
18342
|
], 4);
|
|
18017
18343
|
}), 128))
|
|
@@ -18095,7 +18421,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18095
18421
|
class: "mr-2",
|
|
18096
18422
|
onClick: ($event) => openDialog(item)
|
|
18097
18423
|
}, {
|
|
18098
|
-
default: withCtx(() => [..._cache[
|
|
18424
|
+
default: withCtx(() => [..._cache[38] || (_cache[38] = [
|
|
18099
18425
|
createTextVNode(" ویرایش ✏️ ", -1)
|
|
18100
18426
|
])]),
|
|
18101
18427
|
_: 1
|
|
@@ -18107,7 +18433,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18107
18433
|
class: "mr-2",
|
|
18108
18434
|
onClick: ($event) => openDeleteDialog(item)
|
|
18109
18435
|
}, {
|
|
18110
|
-
default: withCtx(() => [..._cache[
|
|
18436
|
+
default: withCtx(() => [..._cache[39] || (_cache[39] = [
|
|
18111
18437
|
createTextVNode("حذف ❌ ", -1)
|
|
18112
18438
|
])]),
|
|
18113
18439
|
_: 1
|
|
@@ -18119,7 +18445,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18119
18445
|
class: "mr-2",
|
|
18120
18446
|
onClick: ($event) => goToRoute("view", item)
|
|
18121
18447
|
}, {
|
|
18122
|
-
default: withCtx(() => [..._cache[
|
|
18448
|
+
default: withCtx(() => [..._cache[40] || (_cache[40] = [
|
|
18123
18449
|
createTextVNode("🔍 نمایش ", -1)
|
|
18124
18450
|
])]),
|
|
18125
18451
|
_: 1
|
|
@@ -18198,24 +18524,29 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18198
18524
|
}, 1032, ["color", "onClick"]);
|
|
18199
18525
|
}), 128))
|
|
18200
18526
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
18201
|
-
|
|
18527
|
+
shouldTruncate(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item)) ? (openBlock(), createElementBlock("span", {
|
|
18528
|
+
key: 0,
|
|
18529
|
+
class: "truncated-text",
|
|
18530
|
+
style: { cursor: "pointer", color: "rgb(var(--v-theme-primary))", textDecoration: "underline" },
|
|
18531
|
+
onClick: withModifiers(($event) => openTextPreview(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item), column.title || column.key || "", item), ["stop"])
|
|
18532
|
+
}, toDisplayString(truncateText(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item))), 9, _hoisted_19)) : (openBlock(), createElementBlock("span", _hoisted_20, toDisplayString(getTranslatedValue(getNestedValue2(item, column.key || ""), column, item)), 1))
|
|
18202
18533
|
], 64))
|
|
18203
18534
|
], 4);
|
|
18204
18535
|
}), 128))
|
|
18205
|
-
], 44,
|
|
18536
|
+
], 44, _hoisted_18)
|
|
18206
18537
|
]),
|
|
18207
18538
|
_: 1
|
|
18208
18539
|
}, 8, ["headers", "items", "items-per-page", "height"])),
|
|
18209
|
-
isLoadingMore.value ? (openBlock(), createElementBlock("div",
|
|
18540
|
+
isLoadingMore.value ? (openBlock(), createElementBlock("div", _hoisted_21, [
|
|
18210
18541
|
createVNode(VProgressCircular, {
|
|
18211
18542
|
indeterminate: "",
|
|
18212
18543
|
color: "primary"
|
|
18213
18544
|
})
|
|
18214
18545
|
])) : createCommentVNode("", true)
|
|
18215
18546
|
], 64)),
|
|
18216
|
-
props.showPagination ? (openBlock(), createElementBlock("div",
|
|
18217
|
-
createElementVNode("div",
|
|
18218
|
-
createElementVNode("div",
|
|
18547
|
+
props.showPagination ? (openBlock(), createElementBlock("div", _hoisted_22, [
|
|
18548
|
+
createElementVNode("div", _hoisted_23, [
|
|
18549
|
+
createElementVNode("div", _hoisted_24, " نمایش " + toDisplayString((currentPage.value - 1) * itemsPerPage.value + 1) + " تا " + toDisplayString(Math.min(currentPage.value * itemsPerPage.value, totalSize.value)) + " از " + toDisplayString(totalSize.value) + " رکورد ", 1),
|
|
18219
18550
|
createVNode(VPagination, {
|
|
18220
18551
|
modelValue: currentPage.value,
|
|
18221
18552
|
"onUpdate:modelValue": [
|
|
@@ -18318,7 +18649,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18318
18649
|
color: "error",
|
|
18319
18650
|
onClick: _cache[5] || (_cache[5] = ($event) => dialog.value = false)
|
|
18320
18651
|
}, {
|
|
18321
|
-
default: withCtx(() => [..._cache[
|
|
18652
|
+
default: withCtx(() => [..._cache[41] || (_cache[41] = [
|
|
18322
18653
|
createTextVNode("انصراف", -1)
|
|
18323
18654
|
])]),
|
|
18324
18655
|
_: 1
|
|
@@ -18351,13 +18682,13 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18351
18682
|
createVNode(VCard, null, {
|
|
18352
18683
|
default: withCtx(() => [
|
|
18353
18684
|
createVNode(VCardTitle, null, {
|
|
18354
|
-
default: withCtx(() => [..._cache[
|
|
18685
|
+
default: withCtx(() => [..._cache[42] || (_cache[42] = [
|
|
18355
18686
|
createTextVNode("حذف آیتم", -1)
|
|
18356
18687
|
])]),
|
|
18357
18688
|
_: 1
|
|
18358
18689
|
}),
|
|
18359
18690
|
createVNode(VCardText, null, {
|
|
18360
|
-
default: withCtx(() => [..._cache[
|
|
18691
|
+
default: withCtx(() => [..._cache[43] || (_cache[43] = [
|
|
18361
18692
|
createTextVNode(" آیا مایل به حذف این رکورد هستید ?", -1)
|
|
18362
18693
|
])]),
|
|
18363
18694
|
_: 1
|
|
@@ -18368,7 +18699,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18368
18699
|
color: "grey",
|
|
18369
18700
|
onClick: _cache[7] || (_cache[7] = ($event) => deleteDialog.value = false)
|
|
18370
18701
|
}, {
|
|
18371
|
-
default: withCtx(() => [..._cache[
|
|
18702
|
+
default: withCtx(() => [..._cache[44] || (_cache[44] = [
|
|
18372
18703
|
createTextVNode("انصراف", -1)
|
|
18373
18704
|
])]),
|
|
18374
18705
|
_: 1
|
|
@@ -18380,7 +18711,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18380
18711
|
return deleteItem(String(((_a2 = itemToDelete.value) == null ? void 0 : _a2.id) || ""));
|
|
18381
18712
|
})
|
|
18382
18713
|
}, {
|
|
18383
|
-
default: withCtx(() => [..._cache[
|
|
18714
|
+
default: withCtx(() => [..._cache[45] || (_cache[45] = [
|
|
18384
18715
|
createTextVNode("حذف", -1)
|
|
18385
18716
|
])]),
|
|
18386
18717
|
_: 1
|
|
@@ -18408,28 +18739,28 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18408
18739
|
color: "red",
|
|
18409
18740
|
class: "me-2"
|
|
18410
18741
|
}, {
|
|
18411
|
-
default: withCtx(() => [..._cache[
|
|
18742
|
+
default: withCtx(() => [..._cache[46] || (_cache[46] = [
|
|
18412
18743
|
createTextVNode("🗑️", -1)
|
|
18413
18744
|
])]),
|
|
18414
18745
|
_: 1
|
|
18415
18746
|
}),
|
|
18416
|
-
_cache[
|
|
18747
|
+
_cache[47] || (_cache[47] = createTextVNode(" حذف گروهی ", -1))
|
|
18417
18748
|
]),
|
|
18418
18749
|
_: 1
|
|
18419
18750
|
}),
|
|
18420
18751
|
createVNode(VCardText, null, {
|
|
18421
18752
|
default: withCtx(() => [
|
|
18422
18753
|
createElementVNode("p", null, [
|
|
18423
|
-
_cache[
|
|
18754
|
+
_cache[48] || (_cache[48] = createTextVNode(" آیا مایل به حذف ", -1)),
|
|
18424
18755
|
createElementVNode("strong", null, toDisplayString(selectedCount.value), 1),
|
|
18425
|
-
_cache[
|
|
18756
|
+
_cache[49] || (_cache[49] = createTextVNode(" آیتم انتخاب شده هستید؟ ", -1))
|
|
18426
18757
|
]),
|
|
18427
18758
|
createVNode(VAlert, {
|
|
18428
18759
|
type: "warning",
|
|
18429
18760
|
variant: "tonal",
|
|
18430
18761
|
class: "mt-3"
|
|
18431
18762
|
}, {
|
|
18432
|
-
default: withCtx(() => [..._cache[
|
|
18763
|
+
default: withCtx(() => [..._cache[50] || (_cache[50] = [
|
|
18433
18764
|
createTextVNode(" این عمل قابل بازگشت نیست! ", -1)
|
|
18434
18765
|
])]),
|
|
18435
18766
|
_: 1
|
|
@@ -18444,7 +18775,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18444
18775
|
color: "grey",
|
|
18445
18776
|
onClick: _cache[10] || (_cache[10] = ($event) => groupDeleteDialog.value = false)
|
|
18446
18777
|
}, {
|
|
18447
|
-
default: withCtx(() => [..._cache[
|
|
18778
|
+
default: withCtx(() => [..._cache[51] || (_cache[51] = [
|
|
18448
18779
|
createTextVNode("انصراف", -1)
|
|
18449
18780
|
])]),
|
|
18450
18781
|
_: 1
|
|
@@ -18510,7 +18841,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18510
18841
|
createVNode(VCard, null, {
|
|
18511
18842
|
default: withCtx(() => [
|
|
18512
18843
|
createVNode(VCardTitle, null, {
|
|
18513
|
-
default: withCtx(() => [..._cache[
|
|
18844
|
+
default: withCtx(() => [..._cache[52] || (_cache[52] = [
|
|
18514
18845
|
createTextVNode("فیلتر", -1)
|
|
18515
18846
|
])]),
|
|
18516
18847
|
_: 1
|
|
@@ -18535,10 +18866,103 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18535
18866
|
]),
|
|
18536
18867
|
_: 1
|
|
18537
18868
|
}, 8, ["modelValue"]),
|
|
18869
|
+
createVNode(VDialog, {
|
|
18870
|
+
modelValue: textPreviewDialog.value,
|
|
18871
|
+
"onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => textPreviewDialog.value = $event),
|
|
18872
|
+
"max-width": "800"
|
|
18873
|
+
}, {
|
|
18874
|
+
default: withCtx(() => [
|
|
18875
|
+
createVNode(VCard, null, {
|
|
18876
|
+
default: withCtx(() => [
|
|
18877
|
+
createVNode(VCardTitle, { class: "d-flex justify-space-between align-center" }, {
|
|
18878
|
+
default: withCtx(() => [
|
|
18879
|
+
createElementVNode("span", null, toDisplayString(previewTitle.value), 1),
|
|
18880
|
+
createVNode(VBtn, {
|
|
18881
|
+
icon: "",
|
|
18882
|
+
variant: "text",
|
|
18883
|
+
onClick: _cache[17] || (_cache[17] = ($event) => textPreviewDialog.value = false)
|
|
18884
|
+
}, {
|
|
18885
|
+
default: withCtx(() => [
|
|
18886
|
+
createVNode(VIcon, null, {
|
|
18887
|
+
default: withCtx(() => [..._cache[53] || (_cache[53] = [
|
|
18888
|
+
createTextVNode("mdi-close", -1)
|
|
18889
|
+
])]),
|
|
18890
|
+
_: 1
|
|
18891
|
+
})
|
|
18892
|
+
]),
|
|
18893
|
+
_: 1
|
|
18894
|
+
})
|
|
18895
|
+
]),
|
|
18896
|
+
_: 1
|
|
18897
|
+
}),
|
|
18898
|
+
createVNode(VCardText, null, {
|
|
18899
|
+
default: withCtx(() => [
|
|
18900
|
+
createVNode(VTextarea, {
|
|
18901
|
+
"model-value": previewText.value,
|
|
18902
|
+
readonly: "",
|
|
18903
|
+
"auto-grow": "",
|
|
18904
|
+
variant: "outlined",
|
|
18905
|
+
rows: "10",
|
|
18906
|
+
class: "mb-4"
|
|
18907
|
+
}, null, 8, ["model-value"])
|
|
18908
|
+
]),
|
|
18909
|
+
_: 1
|
|
18910
|
+
}),
|
|
18911
|
+
createVNode(VCardActions, null, {
|
|
18912
|
+
default: withCtx(() => [
|
|
18913
|
+
createVNode(VSpacer),
|
|
18914
|
+
createVNode(VBtn, {
|
|
18915
|
+
color: "primary",
|
|
18916
|
+
onClick: _cache[18] || (_cache[18] = ($event) => copyToClipboard(previewText.value))
|
|
18917
|
+
}, {
|
|
18918
|
+
default: withCtx(() => [
|
|
18919
|
+
createVNode(VIcon, { start: "" }, {
|
|
18920
|
+
default: withCtx(() => [..._cache[54] || (_cache[54] = [
|
|
18921
|
+
createTextVNode("mdi-content-copy", -1)
|
|
18922
|
+
])]),
|
|
18923
|
+
_: 1
|
|
18924
|
+
}),
|
|
18925
|
+
_cache[55] || (_cache[55] = createTextVNode(" کپی متن ", -1))
|
|
18926
|
+
]),
|
|
18927
|
+
_: 1
|
|
18928
|
+
}),
|
|
18929
|
+
createVNode(VBtn, {
|
|
18930
|
+
color: "success",
|
|
18931
|
+
onClick: copyCompleteRecord
|
|
18932
|
+
}, {
|
|
18933
|
+
default: withCtx(() => [
|
|
18934
|
+
createVNode(VIcon, { start: "" }, {
|
|
18935
|
+
default: withCtx(() => [..._cache[56] || (_cache[56] = [
|
|
18936
|
+
createTextVNode("mdi-content-copy", -1)
|
|
18937
|
+
])]),
|
|
18938
|
+
_: 1
|
|
18939
|
+
}),
|
|
18940
|
+
_cache[57] || (_cache[57] = createTextVNode(" کپی رکورد کامل ", -1))
|
|
18941
|
+
]),
|
|
18942
|
+
_: 1
|
|
18943
|
+
}),
|
|
18944
|
+
createVNode(VBtn, {
|
|
18945
|
+
color: "grey",
|
|
18946
|
+
onClick: _cache[19] || (_cache[19] = ($event) => textPreviewDialog.value = false)
|
|
18947
|
+
}, {
|
|
18948
|
+
default: withCtx(() => [..._cache[58] || (_cache[58] = [
|
|
18949
|
+
createTextVNode("بستن", -1)
|
|
18950
|
+
])]),
|
|
18951
|
+
_: 1
|
|
18952
|
+
})
|
|
18953
|
+
]),
|
|
18954
|
+
_: 1
|
|
18955
|
+
})
|
|
18956
|
+
]),
|
|
18957
|
+
_: 1
|
|
18958
|
+
})
|
|
18959
|
+
]),
|
|
18960
|
+
_: 1
|
|
18961
|
+
}, 8, ["modelValue"]),
|
|
18538
18962
|
snackbar.value ? (openBlock(), createBlock(VSnackbar, {
|
|
18539
18963
|
key: 1,
|
|
18540
18964
|
modelValue: snackbar.value,
|
|
18541
|
-
"onUpdate:modelValue": _cache[
|
|
18965
|
+
"onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => snackbar.value = $event),
|
|
18542
18966
|
timeout: 3e3,
|
|
18543
18967
|
location: "top"
|
|
18544
18968
|
}, {
|
|
@@ -18546,9 +18970,9 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18546
18970
|
createVNode(VBtn, {
|
|
18547
18971
|
color: "white",
|
|
18548
18972
|
variant: "text",
|
|
18549
|
-
onClick: _cache[
|
|
18973
|
+
onClick: _cache[21] || (_cache[21] = ($event) => snackbar.value = false)
|
|
18550
18974
|
}, {
|
|
18551
|
-
default: withCtx(() => [..._cache[
|
|
18975
|
+
default: withCtx(() => [..._cache[59] || (_cache[59] = [
|
|
18552
18976
|
createTextVNode(" بستن ", -1)
|
|
18553
18977
|
])]),
|
|
18554
18978
|
_: 1
|
|
@@ -18563,267 +18987,6 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
18563
18987
|
};
|
|
18564
18988
|
}
|
|
18565
18989
|
});
|
|
18566
|
-
const makeVTextareaProps = propsFactory({
|
|
18567
|
-
autoGrow: Boolean,
|
|
18568
|
-
autofocus: Boolean,
|
|
18569
|
-
counter: [Boolean, Number, String],
|
|
18570
|
-
counterValue: Function,
|
|
18571
|
-
prefix: String,
|
|
18572
|
-
placeholder: String,
|
|
18573
|
-
persistentPlaceholder: Boolean,
|
|
18574
|
-
persistentCounter: Boolean,
|
|
18575
|
-
noResize: Boolean,
|
|
18576
|
-
rows: {
|
|
18577
|
-
type: [Number, String],
|
|
18578
|
-
default: 5,
|
|
18579
|
-
validator: (v) => !isNaN(parseFloat(v))
|
|
18580
|
-
},
|
|
18581
|
-
maxRows: {
|
|
18582
|
-
type: [Number, String],
|
|
18583
|
-
validator: (v) => !isNaN(parseFloat(v))
|
|
18584
|
-
},
|
|
18585
|
-
suffix: String,
|
|
18586
|
-
modelModifiers: Object,
|
|
18587
|
-
...makeAutocompleteProps(),
|
|
18588
|
-
...makeVInputProps(),
|
|
18589
|
-
...makeVFieldProps()
|
|
18590
|
-
}, "VTextarea");
|
|
18591
|
-
const VTextarea = genericComponent()({
|
|
18592
|
-
name: "VTextarea",
|
|
18593
|
-
directives: {
|
|
18594
|
-
vIntersect: Intersect
|
|
18595
|
-
},
|
|
18596
|
-
inheritAttrs: false,
|
|
18597
|
-
props: makeVTextareaProps(),
|
|
18598
|
-
emits: {
|
|
18599
|
-
"click:control": (e) => true,
|
|
18600
|
-
"mousedown:control": (e) => true,
|
|
18601
|
-
"update:focused": (focused) => true,
|
|
18602
|
-
"update:modelValue": (val2) => true,
|
|
18603
|
-
"update:rows": (rows) => true
|
|
18604
|
-
},
|
|
18605
|
-
setup(props, _ref) {
|
|
18606
|
-
let {
|
|
18607
|
-
attrs,
|
|
18608
|
-
emit,
|
|
18609
|
-
slots
|
|
18610
|
-
} = _ref;
|
|
18611
|
-
const model = useProxiedModel(props, "modelValue");
|
|
18612
|
-
const {
|
|
18613
|
-
isFocused,
|
|
18614
|
-
focus,
|
|
18615
|
-
blur
|
|
18616
|
-
} = useFocus(props);
|
|
18617
|
-
const {
|
|
18618
|
-
onIntersect
|
|
18619
|
-
} = useAutofocus(props);
|
|
18620
|
-
const counterValue = computed(() => {
|
|
18621
|
-
return typeof props.counterValue === "function" ? props.counterValue(model.value) : (model.value || "").toString().length;
|
|
18622
|
-
});
|
|
18623
|
-
const max = computed(() => {
|
|
18624
|
-
if (attrs.maxlength) return attrs.maxlength;
|
|
18625
|
-
if (!props.counter || typeof props.counter !== "number" && typeof props.counter !== "string") return void 0;
|
|
18626
|
-
return props.counter;
|
|
18627
|
-
});
|
|
18628
|
-
const vInputRef = ref();
|
|
18629
|
-
const vFieldRef = ref();
|
|
18630
|
-
const controlHeight = shallowRef("");
|
|
18631
|
-
const textareaRef = ref();
|
|
18632
|
-
const autocomplete = useAutocomplete(props);
|
|
18633
|
-
const isActive = computed(() => props.persistentPlaceholder || isFocused.value || props.active);
|
|
18634
|
-
function onFocus() {
|
|
18635
|
-
var _a;
|
|
18636
|
-
if (autocomplete.isSuppressing.value) {
|
|
18637
|
-
autocomplete.update();
|
|
18638
|
-
}
|
|
18639
|
-
if (textareaRef.value !== document.activeElement) {
|
|
18640
|
-
(_a = textareaRef.value) == null ? void 0 : _a.focus();
|
|
18641
|
-
}
|
|
18642
|
-
if (!isFocused.value) focus();
|
|
18643
|
-
}
|
|
18644
|
-
function onControlClick(e) {
|
|
18645
|
-
onFocus();
|
|
18646
|
-
emit("click:control", e);
|
|
18647
|
-
}
|
|
18648
|
-
function onControlMousedown(e) {
|
|
18649
|
-
emit("mousedown:control", e);
|
|
18650
|
-
}
|
|
18651
|
-
function onClear(e) {
|
|
18652
|
-
e.stopPropagation();
|
|
18653
|
-
onFocus();
|
|
18654
|
-
nextTick(() => {
|
|
18655
|
-
model.value = "";
|
|
18656
|
-
callEvent(props["onClick:clear"], e);
|
|
18657
|
-
});
|
|
18658
|
-
}
|
|
18659
|
-
function onInput(e) {
|
|
18660
|
-
var _a;
|
|
18661
|
-
const el = e.target;
|
|
18662
|
-
model.value = el.value;
|
|
18663
|
-
if ((_a = props.modelModifiers) == null ? void 0 : _a.trim) {
|
|
18664
|
-
const caretPosition = [el.selectionStart, el.selectionEnd];
|
|
18665
|
-
nextTick(() => {
|
|
18666
|
-
el.selectionStart = caretPosition[0];
|
|
18667
|
-
el.selectionEnd = caretPosition[1];
|
|
18668
|
-
});
|
|
18669
|
-
}
|
|
18670
|
-
}
|
|
18671
|
-
const sizerRef = ref();
|
|
18672
|
-
const rows = ref(Number(props.rows));
|
|
18673
|
-
const isPlainOrUnderlined = computed(() => ["plain", "underlined"].includes(props.variant));
|
|
18674
|
-
watchEffect(() => {
|
|
18675
|
-
if (!props.autoGrow) rows.value = Number(props.rows);
|
|
18676
|
-
});
|
|
18677
|
-
function calculateInputHeight() {
|
|
18678
|
-
if (!props.autoGrow) return;
|
|
18679
|
-
nextTick(() => {
|
|
18680
|
-
if (!sizerRef.value || !vFieldRef.value) return;
|
|
18681
|
-
const style = getComputedStyle(sizerRef.value);
|
|
18682
|
-
const fieldStyle = getComputedStyle(vFieldRef.value.$el);
|
|
18683
|
-
const padding = parseFloat(style.getPropertyValue("--v-field-padding-top")) + parseFloat(style.getPropertyValue("--v-input-padding-top")) + parseFloat(style.getPropertyValue("--v-field-padding-bottom"));
|
|
18684
|
-
const height2 = sizerRef.value.scrollHeight;
|
|
18685
|
-
const lineHeight = parseFloat(style.lineHeight);
|
|
18686
|
-
const minHeight = Math.max(parseFloat(props.rows) * lineHeight + padding, parseFloat(fieldStyle.getPropertyValue("--v-input-control-height")));
|
|
18687
|
-
const maxHeight = parseFloat(props.maxRows) * lineHeight + padding || Infinity;
|
|
18688
|
-
const newHeight = clamp(height2 ?? 0, minHeight, maxHeight);
|
|
18689
|
-
rows.value = Math.floor((newHeight - padding) / lineHeight);
|
|
18690
|
-
controlHeight.value = convertToUnit(newHeight);
|
|
18691
|
-
});
|
|
18692
|
-
}
|
|
18693
|
-
onMounted(calculateInputHeight);
|
|
18694
|
-
watch(model, calculateInputHeight);
|
|
18695
|
-
watch(() => props.rows, calculateInputHeight);
|
|
18696
|
-
watch(() => props.maxRows, calculateInputHeight);
|
|
18697
|
-
watch(() => props.density, calculateInputHeight);
|
|
18698
|
-
watch(rows, (val2) => {
|
|
18699
|
-
emit("update:rows", val2);
|
|
18700
|
-
});
|
|
18701
|
-
let observer;
|
|
18702
|
-
watch(sizerRef, (val2) => {
|
|
18703
|
-
if (val2) {
|
|
18704
|
-
observer = new ResizeObserver(calculateInputHeight);
|
|
18705
|
-
observer.observe(sizerRef.value);
|
|
18706
|
-
} else {
|
|
18707
|
-
observer == null ? void 0 : observer.disconnect();
|
|
18708
|
-
}
|
|
18709
|
-
});
|
|
18710
|
-
onBeforeUnmount(() => {
|
|
18711
|
-
observer == null ? void 0 : observer.disconnect();
|
|
18712
|
-
});
|
|
18713
|
-
useRender(() => {
|
|
18714
|
-
const hasCounter = !!(slots.counter || props.counter || props.counterValue);
|
|
18715
|
-
const hasDetails = !!(hasCounter || slots.details);
|
|
18716
|
-
const [rootAttrs, inputAttrs] = filterInputAttrs(attrs);
|
|
18717
|
-
const {
|
|
18718
|
-
modelValue: _,
|
|
18719
|
-
...inputProps
|
|
18720
|
-
} = VInput.filterProps(props);
|
|
18721
|
-
const fieldProps = {
|
|
18722
|
-
...VField.filterProps(props),
|
|
18723
|
-
"onClick:clear": onClear
|
|
18724
|
-
};
|
|
18725
|
-
return createVNode(VInput, mergeProps({
|
|
18726
|
-
"ref": vInputRef,
|
|
18727
|
-
"modelValue": model.value,
|
|
18728
|
-
"onUpdate:modelValue": ($event) => model.value = $event,
|
|
18729
|
-
"class": ["v-textarea v-text-field", {
|
|
18730
|
-
"v-textarea--prefixed": props.prefix,
|
|
18731
|
-
"v-textarea--suffixed": props.suffix,
|
|
18732
|
-
"v-text-field--prefixed": props.prefix,
|
|
18733
|
-
"v-text-field--suffixed": props.suffix,
|
|
18734
|
-
"v-textarea--auto-grow": props.autoGrow,
|
|
18735
|
-
"v-textarea--no-resize": props.noResize || props.autoGrow,
|
|
18736
|
-
"v-input--plain-underlined": isPlainOrUnderlined.value
|
|
18737
|
-
}, props.class],
|
|
18738
|
-
"style": props.style
|
|
18739
|
-
}, rootAttrs, inputProps, {
|
|
18740
|
-
"centerAffix": rows.value === 1 && !isPlainOrUnderlined.value,
|
|
18741
|
-
"focused": isFocused.value
|
|
18742
|
-
}), {
|
|
18743
|
-
...slots,
|
|
18744
|
-
default: (_ref2) => {
|
|
18745
|
-
let {
|
|
18746
|
-
id,
|
|
18747
|
-
isDisabled,
|
|
18748
|
-
isDirty,
|
|
18749
|
-
isReadonly,
|
|
18750
|
-
isValid,
|
|
18751
|
-
hasDetails: hasDetails2
|
|
18752
|
-
} = _ref2;
|
|
18753
|
-
return createVNode(VField, mergeProps({
|
|
18754
|
-
"ref": vFieldRef,
|
|
18755
|
-
"style": {
|
|
18756
|
-
"--v-textarea-control-height": controlHeight.value
|
|
18757
|
-
},
|
|
18758
|
-
"onClick": onControlClick,
|
|
18759
|
-
"onMousedown": onControlMousedown,
|
|
18760
|
-
"onClick:prependInner": props["onClick:prependInner"],
|
|
18761
|
-
"onClick:appendInner": props["onClick:appendInner"]
|
|
18762
|
-
}, fieldProps, {
|
|
18763
|
-
"id": id.value,
|
|
18764
|
-
"active": isActive.value || isDirty.value,
|
|
18765
|
-
"centerAffix": rows.value === 1 && !isPlainOrUnderlined.value,
|
|
18766
|
-
"dirty": isDirty.value || props.dirty,
|
|
18767
|
-
"disabled": isDisabled.value,
|
|
18768
|
-
"focused": isFocused.value,
|
|
18769
|
-
"details": hasDetails2.value,
|
|
18770
|
-
"error": isValid.value === false
|
|
18771
|
-
}), {
|
|
18772
|
-
...slots,
|
|
18773
|
-
default: (_ref3) => {
|
|
18774
|
-
let {
|
|
18775
|
-
props: {
|
|
18776
|
-
class: fieldClass,
|
|
18777
|
-
...slotProps
|
|
18778
|
-
}
|
|
18779
|
-
} = _ref3;
|
|
18780
|
-
return createElementVNode(Fragment, null, [props.prefix && createElementVNode("span", {
|
|
18781
|
-
"class": "v-text-field__prefix"
|
|
18782
|
-
}, [props.prefix]), withDirectives(createElementVNode("textarea", mergeProps({
|
|
18783
|
-
"ref": textareaRef,
|
|
18784
|
-
"class": fieldClass,
|
|
18785
|
-
"value": model.value,
|
|
18786
|
-
"onInput": onInput,
|
|
18787
|
-
"autofocus": props.autofocus,
|
|
18788
|
-
"readonly": isReadonly.value,
|
|
18789
|
-
"disabled": isDisabled.value,
|
|
18790
|
-
"placeholder": props.placeholder,
|
|
18791
|
-
"rows": props.rows,
|
|
18792
|
-
"name": autocomplete.fieldName.value,
|
|
18793
|
-
"autocomplete": autocomplete.fieldAutocomplete.value,
|
|
18794
|
-
"onFocus": onFocus,
|
|
18795
|
-
"onBlur": blur
|
|
18796
|
-
}, slotProps, inputAttrs), null), [[Intersect, {
|
|
18797
|
-
handler: onIntersect
|
|
18798
|
-
}, null, {
|
|
18799
|
-
once: true
|
|
18800
|
-
}]]), props.autoGrow && withDirectives(createElementVNode("textarea", {
|
|
18801
|
-
"class": normalizeClass([fieldClass, "v-textarea__sizer"]),
|
|
18802
|
-
"id": `${slotProps.id}-sizer`,
|
|
18803
|
-
"onUpdate:modelValue": ($event) => model.value = $event,
|
|
18804
|
-
"ref": sizerRef,
|
|
18805
|
-
"readonly": true,
|
|
18806
|
-
"aria-hidden": "true"
|
|
18807
|
-
}, null), [[vModelText, model.value]]), props.suffix && createElementVNode("span", {
|
|
18808
|
-
"class": "v-text-field__suffix"
|
|
18809
|
-
}, [props.suffix])]);
|
|
18810
|
-
}
|
|
18811
|
-
});
|
|
18812
|
-
},
|
|
18813
|
-
details: hasDetails ? (slotProps) => {
|
|
18814
|
-
var _a;
|
|
18815
|
-
return createElementVNode(Fragment, null, [(_a = slots.details) == null ? void 0 : _a.call(slots, slotProps), hasCounter && createElementVNode(Fragment, null, [createElementVNode("span", null, null), createVNode(VCounter, {
|
|
18816
|
-
"active": props.persistentCounter || isFocused.value,
|
|
18817
|
-
"value": counterValue.value,
|
|
18818
|
-
"max": max.value,
|
|
18819
|
-
"disabled": props.disabled
|
|
18820
|
-
}, slots.counter)])]);
|
|
18821
|
-
} : void 0
|
|
18822
|
-
});
|
|
18823
|
-
});
|
|
18824
|
-
return forwardRefs({}, vInputRef, vFieldRef, textareaRef);
|
|
18825
|
-
}
|
|
18826
|
-
});
|
|
18827
18990
|
const _hoisted_1$8 = { class: "description-input" };
|
|
18828
18991
|
const _sfc_main$e = /* @__PURE__ */ defineComponent$1({
|
|
18829
18992
|
__name: "DescriptionInput",
|
|
@@ -37446,7 +37609,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent$1({
|
|
|
37446
37609
|
"model-value": __props.sidebarDrawer,
|
|
37447
37610
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:sidebarDrawer", $event)),
|
|
37448
37611
|
elevation: "0",
|
|
37449
|
-
"rail-width": "
|
|
37612
|
+
"rail-width": "82",
|
|
37450
37613
|
"mobile-breakpoint": "lg",
|
|
37451
37614
|
app: "",
|
|
37452
37615
|
rail: __props.miniSidebar,
|