@amirjalili1374/ui-kit 1.5.77 → 1.5.80
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/ShamsiDatePicker.vue.d.ts +5 -22
- package/dist/components/shared/ShamsiDatePicker.vue.d.ts.map +1 -1
- package/dist/style.css +2 -2
- package/dist/ui-kit.cjs.js +1 -1
- package/dist/ui-kit.cjs.js.map +1 -1
- package/dist/ui-kit.es.js +46 -78
- package/dist/ui-kit.es.js.map +1 -1
- package/package.json +1 -1
package/dist/ui-kit.es.js
CHANGED
|
@@ -13952,102 +13952,69 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
|
|
|
13952
13952
|
props: {
|
|
13953
13953
|
modelValue: { default: "" },
|
|
13954
13954
|
label: { default: "تاریخ" },
|
|
13955
|
-
placeholder: { default: "
|
|
13956
|
-
variant: { default: "outlined" },
|
|
13957
|
-
density: { default: "compact" },
|
|
13955
|
+
placeholder: { default: "انتخاب کنید" },
|
|
13958
13956
|
color: { default: "primary" },
|
|
13959
13957
|
disabled: { type: Boolean, default: false },
|
|
13960
|
-
readonly: { type: Boolean, default: false },
|
|
13961
13958
|
clearable: { type: Boolean, default: true },
|
|
13962
|
-
|
|
13963
|
-
|
|
13964
|
-
prependInnerIcon: { default: "" },
|
|
13965
|
-
appendInnerIcon: { default: "" },
|
|
13966
|
-
format: { default: "YYYY-MM-DD" },
|
|
13967
|
-
displayFormat: { default: "jYYYY/jMM/jDD" },
|
|
13968
|
-
minDate: { default: "" },
|
|
13969
|
-
maxDate: { default: "" },
|
|
13959
|
+
minDate: {},
|
|
13960
|
+
maxDate: {},
|
|
13970
13961
|
mode: { default: "single" },
|
|
13971
|
-
|
|
13972
|
-
outputFormat: { default: "iso" }
|
|
13962
|
+
type: { default: "date" },
|
|
13963
|
+
outputFormat: { default: "iso" },
|
|
13964
|
+
format: {},
|
|
13965
|
+
displayFormat: {}
|
|
13973
13966
|
},
|
|
13974
13967
|
emits: ["update:modelValue"],
|
|
13975
13968
|
setup(__props, { emit: __emit }) {
|
|
13976
13969
|
const props = __props;
|
|
13977
13970
|
const emit = __emit;
|
|
13971
|
+
const internalFormat = computed(() => {
|
|
13972
|
+
if (props.format) return props.format;
|
|
13973
|
+
return props.type === "datetime" || props.type === "time" ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
13974
|
+
});
|
|
13975
|
+
const internalDisplayFormat = computed(() => {
|
|
13976
|
+
if (props.displayFormat) return props.displayFormat;
|
|
13977
|
+
if (props.type === "datetime") return "jYYYY/jMM/jDD HH:mm";
|
|
13978
|
+
if (props.type === "time") return "HH:mm";
|
|
13979
|
+
return "jYYYY/jMM/jDD";
|
|
13980
|
+
});
|
|
13978
13981
|
const selectedDate = computed({
|
|
13979
13982
|
get: () => {
|
|
13980
|
-
if (props.mode === "range" && Array.isArray(props.modelValue))
|
|
13981
|
-
|
|
13982
|
-
} else if (typeof props.modelValue === "string" && props.modelValue) {
|
|
13983
|
-
if (props.modelValue.includes("T")) {
|
|
13984
|
-
const date = new Date(props.modelValue);
|
|
13985
|
-
const localDate = date.getFullYear() + "-" + String(date.getMonth() + 1).padStart(2, "0") + "-" + String(date.getDate()).padStart(2, "0");
|
|
13986
|
-
return localDate;
|
|
13987
|
-
}
|
|
13988
|
-
return props.modelValue;
|
|
13989
|
-
}
|
|
13990
|
-
return props.modelValue;
|
|
13983
|
+
if (props.mode === "range" && Array.isArray(props.modelValue)) return props.modelValue;
|
|
13984
|
+
return props.modelValue || "";
|
|
13991
13985
|
},
|
|
13992
|
-
set: (value2) =>
|
|
13993
|
-
emit("update:modelValue", value2);
|
|
13994
|
-
}
|
|
13986
|
+
set: (value2) => emit("update:modelValue", value2)
|
|
13995
13987
|
});
|
|
13988
|
+
const formatOutput = (date) => {
|
|
13989
|
+
if (!date) return "";
|
|
13990
|
+
let dateObj;
|
|
13991
|
+
if (date._isAMomentObject) dateObj = date.toDate();
|
|
13992
|
+
else if (typeof date === "string") dateObj = new Date(date);
|
|
13993
|
+
else if (date instanceof Date) dateObj = date;
|
|
13994
|
+
else return "";
|
|
13995
|
+
if (isNaN(dateObj.getTime())) return "";
|
|
13996
|
+
if (props.outputFormat === "date-only" && props.type === "date") {
|
|
13997
|
+
const y = dateObj.getFullYear();
|
|
13998
|
+
const m = String(dateObj.getMonth() + 1).padStart(2, "0");
|
|
13999
|
+
const d = String(dateObj.getDate()).padStart(2, "0");
|
|
14000
|
+
return `${y}-${m}-${d}`;
|
|
14001
|
+
}
|
|
14002
|
+
return dateObj.toISOString();
|
|
14003
|
+
};
|
|
13996
14004
|
const onDateChange = (date) => {
|
|
13997
14005
|
if (props.mode === "range") {
|
|
13998
14006
|
if (Array.isArray(date) && date.length === 2) {
|
|
13999
|
-
|
|
14000
|
-
const gregorianStart = formatOutput(startDate);
|
|
14001
|
-
const gregorianEnd = formatOutput(endDate);
|
|
14002
|
-
emit("update:modelValue", [gregorianStart, gregorianEnd]);
|
|
14007
|
+
emit("update:modelValue", [formatOutput(date[0]), formatOutput(date[1])]);
|
|
14003
14008
|
} else {
|
|
14004
14009
|
emit("update:modelValue", null);
|
|
14005
14010
|
}
|
|
14006
14011
|
} else {
|
|
14007
|
-
|
|
14008
|
-
const formattedDate = formatOutput(date);
|
|
14009
|
-
emit("update:modelValue", formattedDate);
|
|
14010
|
-
} else {
|
|
14011
|
-
emit("update:modelValue", "");
|
|
14012
|
-
}
|
|
14013
|
-
}
|
|
14014
|
-
};
|
|
14015
|
-
const formatOutput = (date) => {
|
|
14016
|
-
if (!date) return "";
|
|
14017
|
-
let dateObj;
|
|
14018
|
-
if (date._isAMomentObject && date.isValid()) {
|
|
14019
|
-
dateObj = date.toDate();
|
|
14020
|
-
} else if (typeof date === "string") {
|
|
14021
|
-
dateObj = new Date(date);
|
|
14022
|
-
} else if (date instanceof Date) {
|
|
14023
|
-
dateObj = date;
|
|
14024
|
-
} else {
|
|
14025
|
-
return "";
|
|
14026
|
-
}
|
|
14027
|
-
if (isNaN(dateObj.getTime())) return "";
|
|
14028
|
-
const year = dateObj.getFullYear();
|
|
14029
|
-
const month = dateObj.getMonth();
|
|
14030
|
-
const day = dateObj.getDate();
|
|
14031
|
-
if (props.outputFormat === "date-only") {
|
|
14032
|
-
const m = String(month + 1).padStart(2, "0");
|
|
14033
|
-
const d = String(day).padStart(2, "0");
|
|
14034
|
-
return `${year}-${m}-${d}`;
|
|
14035
|
-
} else {
|
|
14036
|
-
const utcDate = new Date(Date.UTC(year, month, day, 0, 0, 0, 0));
|
|
14037
|
-
return utcDate.toISOString();
|
|
14012
|
+
emit("update:modelValue", date ? formatOutput(date) : "");
|
|
14038
14013
|
}
|
|
14039
14014
|
};
|
|
14040
|
-
const inputClass = computed(() => {
|
|
14041
|
-
const classes = ["v-text-field", "v-input", "v-input--density-comfortable"];
|
|
14042
|
-
if (props.variant === "outlined") {
|
|
14043
|
-
classes.push("v-text-field--variant-outlined");
|
|
14044
|
-
}
|
|
14045
|
-
return classes.join(" ");
|
|
14046
|
-
});
|
|
14047
|
-
const wrapperClass = computed(() => {
|
|
14048
|
-
return "v-field v-field--variant-outlined v-field--density-comfortable";
|
|
14049
|
-
});
|
|
14050
14015
|
const isRangeMode = computed(() => props.mode === "range");
|
|
14016
|
+
const inputClass = computed(() => "v-text-field v-input v-input--density-comfortable v-text-field--variant-outlined");
|
|
14017
|
+
const wrapperClass = computed(() => "v-field v-field--variant-outlined v-field--density-comfortable");
|
|
14051
14018
|
return (_ctx, _cache) => {
|
|
14052
14019
|
const _component_Vue3PersianDatetimePicker = resolveComponent("Vue3PersianDatetimePicker");
|
|
14053
14020
|
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
@@ -14055,8 +14022,9 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
|
|
|
14055
14022
|
label: __props.label,
|
|
14056
14023
|
modelValue: selectedDate.value,
|
|
14057
14024
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedDate.value = $event),
|
|
14058
|
-
|
|
14059
|
-
|
|
14025
|
+
type: __props.type,
|
|
14026
|
+
format: internalFormat.value,
|
|
14027
|
+
"display-format": internalDisplayFormat.value,
|
|
14060
14028
|
editable: false,
|
|
14061
14029
|
clearable: __props.clearable,
|
|
14062
14030
|
disabled: __props.disabled,
|
|
@@ -14068,12 +14036,12 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
|
|
|
14068
14036
|
range: isRangeMode.value,
|
|
14069
14037
|
color: __props.color,
|
|
14070
14038
|
onChange: onDateChange
|
|
14071
|
-
}, null, 8, ["label", "modelValue", "format", "display-format", "clearable", "disabled", "min", "max", "placeholder", "input-class", "wrapper-class", "range", "color"])
|
|
14039
|
+
}, null, 8, ["label", "modelValue", "type", "format", "display-format", "clearable", "disabled", "min", "max", "placeholder", "input-class", "wrapper-class", "range", "color"])
|
|
14072
14040
|
]);
|
|
14073
14041
|
};
|
|
14074
14042
|
}
|
|
14075
14043
|
});
|
|
14076
|
-
const ShamsiDatePicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__scopeId", "data-v-
|
|
14044
|
+
const ShamsiDatePicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__scopeId", "data-v-dd8bcfa6"]]);
|
|
14077
14045
|
const _hoisted_1$a = { class: "mb-6" };
|
|
14078
14046
|
const _hoisted_2$6 = { class: "text-subtitle-1 font-weight-medium mb-3" };
|
|
14079
14047
|
const _hoisted_3$4 = { class: "theme-toggle-container" };
|
|
@@ -20259,7 +20227,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent$1({
|
|
|
20259
20227
|
}, [
|
|
20260
20228
|
!action.condition || action.condition(item) ? (openBlock(), createBlock(VBtn, {
|
|
20261
20229
|
key: 0,
|
|
20262
|
-
color: "
|
|
20230
|
+
color: "primary",
|
|
20263
20231
|
size: "small",
|
|
20264
20232
|
class: "mr-2",
|
|
20265
20233
|
onClick: ($event) => openCustomActionDialog(action, item)
|