@factoringplus/pl-components-pack-v3 0.4.82 → 0.4.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.
@@ -25945,7 +25945,6 @@ const _sfc_main$u = {
25945
25945
  dayjs.extend(objectSupport);
25946
25946
  const { isOpen } = toRefs(props);
25947
25947
  const regMask = /^(?:(?:31(\/|-|\.)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(\/|-|\.)(?:0?[1,3-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(\/|-|\.)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(\/|-|\.)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{4})$/g;
25948
- const dateValue = ref(props.modelValue);
25949
25948
  const currentDate = ref(dayjs());
25950
25949
  const startDate = ref(dayjs());
25951
25950
  const endDate = ref(dayjs());
@@ -25954,6 +25953,29 @@ const _sfc_main$u = {
25954
25953
  const rangeEndDateValue = ref(dayjs().format("DD.MM.YYYY"));
25955
25954
  const WEEK_DAYS2 = ["\u041F\u043D", "\u0412\u0442", "\u0421\u0440", "\u0427\u0442", "\u041F\u0442", "\u0421\u0431", "\u0412\u0441"];
25956
25955
  let range3 = [];
25956
+ const dateValue = computed$1({
25957
+ get: () => props.modelValue,
25958
+ set: (val) => {
25959
+ emit2("update:modelValue", val);
25960
+ }
25961
+ });
25962
+ watch(dateValue, (value) => {
25963
+ for (let i2 = 0; i2 < value.split("-").length; i2++) {
25964
+ if (regMask.test(value.split("-")[i2])) {
25965
+ if (i2 === 0)
25966
+ startDate.value = dayjs(value.split("-")[i2].split(".").reverse().join("-"));
25967
+ if (i2 === 1)
25968
+ endDate.value = dayjs(value.split("-")[i2].split(".").reverse().join("-"));
25969
+ }
25970
+ }
25971
+ range3 = [startDate.value, endDate.value];
25972
+ if (startDate.value.isAfter(endDate.value)) {
25973
+ endDate.value = range3[0];
25974
+ startDate.value = range3[1];
25975
+ range3 = [startDate.value, endDate.value];
25976
+ }
25977
+ setupUpdate();
25978
+ });
25957
25979
  const updateDate = (event, flag) => {
25958
25980
  if (regMask.test(event.target.value)) {
25959
25981
  if (flag) {
@@ -26072,10 +26094,10 @@ const _sfc_main$u = {
26072
26094
  }
26073
26095
  if (startDate.value.isAfter(endDate.value)) {
26074
26096
  dateValue.value = endDate.value.format("DD.MM.YYYY") + "-" + startDate.value.format("DD.MM.YYYY");
26075
- emit2("update:modelValue", endDate.value.format("DD.MM.YY") + "-" + startDate.value.format("DD.MM.YY"));
26097
+ emit2("update:modelValue", endDate.value.format("DD.MM.YYYY") + "-" + startDate.value.format("DD.MM.YYYY"));
26076
26098
  } else {
26077
26099
  dateValue.value = startDate.value.format("DD.MM.YYYY") + "-" + endDate.value.format("DD.MM.YYYY");
26078
- emit2("update:modelValue", startDate.value.format("DD.MM.YY") + "-" + endDate.value.format("DD.MM.YY"));
26100
+ emit2("update:modelValue", startDate.value.format("DD.MM.YYYY") + "-" + endDate.value.format("DD.MM.YYYY"));
26079
26101
  }
26080
26102
  emit2("changeOpen", true);
26081
26103
  };
@@ -26162,10 +26184,16 @@ const _sfc_main$u = {
26162
26184
  let isBefore = false;
26163
26185
  let isDayBetween = false;
26164
26186
  let checkEndDay = [];
26187
+ let currentCount = 0;
26165
26188
  const updateSelection = (i2, flag) => {
26166
26189
  if (selecting) {
26190
+ currentCount = 0;
26167
26191
  checkEndDay.push(i2);
26168
- if (checkEndDay.length - 1 === daysData.value.length) {
26192
+ for (let i3 = 0; i3 < daysData.value.length; i3++) {
26193
+ if (daysData.value[i3].type === "current")
26194
+ currentCount += 1;
26195
+ }
26196
+ if (checkEndDay.length - 1 === currentCount) {
26169
26197
  end = checkEndDay[0];
26170
26198
  } else {
26171
26199
  end = i2;
@@ -26210,8 +26238,8 @@ const _sfc_main$u = {
26210
26238
  __props.showInput ? (openBlock(), createElementBlock("div", _hoisted_2$q, [
26211
26239
  createVNode(_sfc_main$z, {
26212
26240
  mask: "##.##.####-##.##.####",
26213
- modelValue: dateValue.value,
26214
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dateValue.value = $event),
26241
+ modelValue: unref(dateValue),
26242
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(dateValue) ? dateValue.value = $event : null),
26215
26243
  label: __props.label,
26216
26244
  placeholder: __props.placeholder,
26217
26245
  onInput: updateDate,
@@ -26305,7 +26333,7 @@ const _sfc_main$u = {
26305
26333
  "pl-date-picker__day-item_disabled": item.type !== "current"
26306
26334
  },
26307
26335
  {
26308
- "pl-date-picker__day-item_svg-circle-background": activeDay(item)
26336
+ "pl-date-picker__day-item_svg-circle-background": activeDay(item) && item.type === "current"
26309
26337
  },
26310
26338
  {
26311
26339
  "pl-date-picker__background-range": item.type !== "previous" && item.type !== "next" ? updateSelection(item, true) : ""