@amirjalili1374/ui-kit 1.5.80 → 1.5.82

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
@@ -13970,20 +13970,53 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
13970
13970
  const emit = __emit;
13971
13971
  const internalFormat = computed(() => {
13972
13972
  if (props.format) return props.format;
13973
- return props.type === "datetime" || props.type === "time" ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
13973
+ if (props.type === "datetime") return "YYYY-MM-DD HH:mm:ss";
13974
+ if (props.type === "time") return "HH:mm:ss";
13975
+ return "YYYY-MM-DD";
13974
13976
  });
13975
13977
  const internalDisplayFormat = computed(() => {
13976
13978
  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
- });
13979
+ switch (props.type) {
13980
+ case "datetime":
13981
+ return "jYYYY/jMM/jDD HH:mm";
13982
+ case "time":
13983
+ return "HH:mm";
13984
+ case "year":
13985
+ return "jYYYY";
13986
+ case "month":
13987
+ return "jMMMM jYYYY";
13988
+ default:
13989
+ return "jYYYY/jMM/jDD";
13990
+ }
13991
+ });
13992
+ const convertIsoToLocalFormat = (isoStr) => {
13993
+ if (!isoStr || !isoStr.includes("T")) return isoStr;
13994
+ const date = new Date(isoStr);
13995
+ if (isNaN(date.getTime())) return isoStr;
13996
+ const pad = (n) => String(n).padStart(2, "0");
13997
+ const y = date.getFullYear();
13998
+ const m = pad(date.getMonth() + 1);
13999
+ const d = pad(date.getDate());
14000
+ const h2 = pad(date.getHours());
14001
+ const min = pad(date.getMinutes());
14002
+ const s = pad(date.getSeconds());
14003
+ if (props.type === "datetime") return `${y}-${m}-${d} ${h2}:${min}:${s}`;
14004
+ if (props.type === "time") return `${h2}:${min}:${s}`;
14005
+ return `${y}-${m}-${d}`;
14006
+ };
13981
14007
  const selectedDate = computed({
13982
14008
  get: () => {
13983
- if (props.mode === "range" && Array.isArray(props.modelValue)) return props.modelValue;
13984
- return props.modelValue || "";
14009
+ if (!props.modelValue) return "";
14010
+ if (props.mode === "range" && Array.isArray(props.modelValue)) {
14011
+ return [convertIsoToLocalFormat(props.modelValue[0]), convertIsoToLocalFormat(props.modelValue[1])];
14012
+ }
14013
+ if (typeof props.modelValue === "string") {
14014
+ return convertIsoToLocalFormat(props.modelValue);
14015
+ }
14016
+ return props.modelValue;
13985
14017
  },
13986
- set: (value2) => emit("update:modelValue", value2)
14018
+ set: (val2) => {
14019
+ }
13987
14020
  });
13988
14021
  const formatOutput = (date) => {
13989
14022
  if (!date) return "";
@@ -14041,7 +14074,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent$1({
14041
14074
  };
14042
14075
  }
14043
14076
  });
14044
- const ShamsiDatePicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__scopeId", "data-v-dd8bcfa6"]]);
14077
+ const ShamsiDatePicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__scopeId", "data-v-e7b8c913"]]);
14045
14078
  const _hoisted_1$a = { class: "mb-6" };
14046
14079
  const _hoisted_2$6 = { class: "text-subtitle-1 font-weight-medium mb-3" };
14047
14080
  const _hoisted_3$4 = { class: "theme-toggle-container" };