@amirjalili1374/ui-kit 1.5.81 → 1.5.83
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 +1 -0
- package/dist/components/shared/ShamsiDatePicker.vue.d.ts.map +1 -1
- package/dist/style.css +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 +27 -22
- package/dist/ui-kit.es.js.map +1 -1
- package/package.json +1 -1
package/dist/ui-kit.es.js
CHANGED
|
@@ -13962,7 +13962,8 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
|
|
|
13962
13962
|
type: { default: "date" },
|
|
13963
13963
|
outputFormat: { default: "iso" },
|
|
13964
13964
|
format: {},
|
|
13965
|
-
displayFormat: {}
|
|
13965
|
+
displayFormat: {},
|
|
13966
|
+
disabledDates: {}
|
|
13966
13967
|
},
|
|
13967
13968
|
emits: ["update:modelValue"],
|
|
13968
13969
|
setup(__props, { emit: __emit }) {
|
|
@@ -13970,7 +13971,9 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
|
|
|
13970
13971
|
const emit = __emit;
|
|
13971
13972
|
const internalFormat = computed(() => {
|
|
13972
13973
|
if (props.format) return props.format;
|
|
13973
|
-
|
|
13974
|
+
if (props.type === "datetime") return "YYYY-MM-DD HH:mm:ss";
|
|
13975
|
+
if (props.type === "time") return "HH:mm:ss";
|
|
13976
|
+
return "YYYY-MM-DD";
|
|
13974
13977
|
});
|
|
13975
13978
|
const internalDisplayFormat = computed(() => {
|
|
13976
13979
|
if (props.displayFormat) return props.displayFormat;
|
|
@@ -13987,31 +13990,33 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
|
|
|
13987
13990
|
return "jYYYY/jMM/jDD";
|
|
13988
13991
|
}
|
|
13989
13992
|
});
|
|
13993
|
+
const convertIsoToLocalFormat = (isoStr) => {
|
|
13994
|
+
if (!isoStr || !isoStr.includes("T")) return isoStr;
|
|
13995
|
+
const date = new Date(isoStr);
|
|
13996
|
+
if (isNaN(date.getTime())) return isoStr;
|
|
13997
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
13998
|
+
const y = date.getFullYear();
|
|
13999
|
+
const m = pad(date.getMonth() + 1);
|
|
14000
|
+
const d = pad(date.getDate());
|
|
14001
|
+
const h2 = pad(date.getHours());
|
|
14002
|
+
const min = pad(date.getMinutes());
|
|
14003
|
+
const s = pad(date.getSeconds());
|
|
14004
|
+
if (props.type === "datetime") return `${y}-${m}-${d} ${h2}:${min}:${s}`;
|
|
14005
|
+
if (props.type === "time") return `${h2}:${min}:${s}`;
|
|
14006
|
+
return `${y}-${m}-${d}`;
|
|
14007
|
+
};
|
|
13990
14008
|
const selectedDate = computed({
|
|
13991
14009
|
get: () => {
|
|
13992
14010
|
if (!props.modelValue) return "";
|
|
13993
14011
|
if (props.mode === "range" && Array.isArray(props.modelValue)) {
|
|
13994
|
-
return props.modelValue;
|
|
14012
|
+
return [convertIsoToLocalFormat(props.modelValue[0]), convertIsoToLocalFormat(props.modelValue[1])];
|
|
13995
14013
|
}
|
|
13996
|
-
if (typeof props.modelValue === "string"
|
|
13997
|
-
|
|
13998
|
-
if (!isNaN(date.getTime())) {
|
|
13999
|
-
const pad = (n) => String(n).padStart(2, "0");
|
|
14000
|
-
const y = date.getFullYear();
|
|
14001
|
-
const m = pad(date.getMonth() + 1);
|
|
14002
|
-
const d = pad(date.getDate());
|
|
14003
|
-
const h2 = pad(date.getHours());
|
|
14004
|
-
const min = pad(date.getMinutes());
|
|
14005
|
-
const s = pad(date.getSeconds());
|
|
14006
|
-
if (props.type === "datetime" || props.type === "time") {
|
|
14007
|
-
return `${y}-${m}-${d} ${h2}:${min}:${s}`;
|
|
14008
|
-
}
|
|
14009
|
-
return `${y}-${m}-${d}`;
|
|
14010
|
-
}
|
|
14014
|
+
if (typeof props.modelValue === "string") {
|
|
14015
|
+
return convertIsoToLocalFormat(props.modelValue);
|
|
14011
14016
|
}
|
|
14012
14017
|
return props.modelValue;
|
|
14013
14018
|
},
|
|
14014
|
-
set: (
|
|
14019
|
+
set: (val2) => {
|
|
14015
14020
|
}
|
|
14016
14021
|
});
|
|
14017
14022
|
const formatOutput = (date) => {
|
|
@@ -14056,7 +14061,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
|
|
|
14056
14061
|
"display-format": internalDisplayFormat.value,
|
|
14057
14062
|
editable: false,
|
|
14058
14063
|
clearable: __props.clearable,
|
|
14059
|
-
|
|
14064
|
+
disable: __props.disabledDates,
|
|
14060
14065
|
min: __props.minDate,
|
|
14061
14066
|
max: __props.maxDate,
|
|
14062
14067
|
placeholder: __props.placeholder,
|
|
@@ -14065,12 +14070,12 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
|
|
|
14065
14070
|
range: isRangeMode.value,
|
|
14066
14071
|
color: __props.color,
|
|
14067
14072
|
onChange: onDateChange
|
|
14068
|
-
}, null, 8, ["label", "modelValue", "type", "format", "display-format", "clearable", "
|
|
14073
|
+
}, null, 8, ["label", "modelValue", "type", "format", "display-format", "clearable", "disable", "min", "max", "placeholder", "input-class", "wrapper-class", "range", "color"])
|
|
14069
14074
|
]);
|
|
14070
14075
|
};
|
|
14071
14076
|
}
|
|
14072
14077
|
});
|
|
14073
|
-
const ShamsiDatePicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__scopeId", "data-v-
|
|
14078
|
+
const ShamsiDatePicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__scopeId", "data-v-aa4ee32a"]]);
|
|
14074
14079
|
const _hoisted_1$a = { class: "mb-6" };
|
|
14075
14080
|
const _hoisted_2$6 = { class: "text-subtitle-1 font-weight-medium mb-3" };
|
|
14076
14081
|
const _hoisted_3$4 = { class: "theme-toggle-container" };
|