@factoringplus/pl-components-pack-v3 0.4.58 → 0.4.59

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.
@@ -17554,7 +17554,7 @@ const _hoisted_2$y = ["aria-current", "tabindex"];
17554
17554
  const _hoisted_3$q = ["tabindex"];
17555
17555
  const _hoisted_4$i = ["aria-current", "tabindex"];
17556
17556
  const _hoisted_5$d = ["tabindex"];
17557
- const _hoisted_6$8 = ["aria-current", "tabindex"];
17557
+ const _hoisted_6$7 = ["aria-current", "tabindex"];
17558
17558
  const __default__$j = defineComponent({
17559
17559
  name: "ElPaginationPager"
17560
17560
  });
@@ -17744,7 +17744,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
17744
17744
  ], "number"]),
17745
17745
  "aria-current": _ctx.currentPage === _ctx.pageCount,
17746
17746
  tabindex: unref(tabindex)
17747
- }, toDisplayString(_ctx.pageCount), 11, _hoisted_6$8)) : createCommentVNode("v-if", true)
17747
+ }, toDisplayString(_ctx.pageCount), 11, _hoisted_6$7)) : createCommentVNode("v-if", true)
17748
17748
  ], 42, _hoisted_1$F);
17749
17749
  };
17750
17750
  }
@@ -25314,6 +25314,10 @@ const _sfc_main$z = {
25314
25314
  type: Boolean,
25315
25315
  default: false
25316
25316
  },
25317
+ datePicker: {
25318
+ type: Boolean,
25319
+ default: false
25320
+ },
25317
25321
  maxLength: {
25318
25322
  type: Number,
25319
25323
  default: 210
@@ -25373,7 +25377,7 @@ const _sfc_main$z = {
25373
25377
  default: () => ({ min: 0 })
25374
25378
  }
25375
25379
  },
25376
- emits: ["update:modelValue", "validate", "isValid"],
25380
+ emits: ["update:modelValue", "validate"],
25377
25381
  setup(__props, { emit: emit2 }) {
25378
25382
  const props = __props;
25379
25383
  const refInput = ref();
@@ -25490,6 +25494,7 @@ const _sfc_main$z = {
25490
25494
  const _component_el_input = ElInput;
25491
25495
  const _component_el_form_item = ElFormItem;
25492
25496
  const _component_el_form = ElForm;
25497
+ const _directive_maska = resolveDirective("maska");
25493
25498
  return openBlock(), createElementBlock("div", null, [
25494
25499
  createVNode(_component_el_form, {
25495
25500
  onValidate: validateInp,
@@ -25531,15 +25536,26 @@ const _sfc_main$z = {
25531
25536
  prop: __props.prop
25532
25537
  }, {
25533
25538
  default: withCtx(() => [
25534
- !unref(currency) ? (openBlock(), createBlock(_component_el_input, mergeProps({
25539
+ __props.datePicker ? withDirectives((openBlock(), createBlock(_component_el_input, {
25535
25540
  key: 0,
25541
+ disabled: props.disabled,
25542
+ placeholder: props.placeholder,
25543
+ modelValue: unref(modelValue),
25544
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
25545
+ type: unref(getTypeInput),
25546
+ resize: "none",
25547
+ onInput: updateValue
25548
+ }, null, 8, ["disabled", "placeholder", "modelValue", "type"])), [
25549
+ [_directive_maska, "##.##.####"]
25550
+ ]) : !unref(currency) ? (openBlock(), createBlock(_component_el_input, mergeProps({
25551
+ key: 1,
25536
25552
  class: { padding: props.prefix },
25537
25553
  minlength: __props.minLength,
25538
25554
  maxlength: __props.maxLength,
25539
25555
  disabled: props.disabled,
25540
25556
  placeholder: props.placeholder,
25541
25557
  modelValue: unref(modelValue),
25542
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
25558
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
25543
25559
  type: unref(getTypeInput),
25544
25560
  resize: "none"
25545
25561
  }, _ctx.$attrs, {
@@ -25547,7 +25563,7 @@ const _sfc_main$z = {
25547
25563
  clearable: props.clearable,
25548
25564
  onInput: updateValue
25549
25565
  }), null, 16, ["class", "minlength", "maxlength", "disabled", "placeholder", "modelValue", "type", "clearable"])) : (openBlock(), createBlock(_component_el_input, mergeProps({
25550
- key: 1,
25566
+ key: 2,
25551
25567
  onKeydown: keydown,
25552
25568
  class: { padding: props.prefix },
25553
25569
  minlength: __props.minLength,
@@ -25559,14 +25575,14 @@ const _sfc_main$z = {
25559
25575
  ref_key: "inputRef",
25560
25576
  ref: inputRef,
25561
25577
  modelValue: unref(formattedValue),
25562
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(formattedValue) ? formattedValue.value = $event : null)
25578
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(formattedValue) ? formattedValue.value = $event : null)
25563
25579
  }), createSlots({ _: 2 }, [
25564
25580
  unref(currency) ? {
25565
25581
  name: "append",
25566
25582
  fn: withCtx(() => [
25567
25583
  createElementVNode("span", {
25568
25584
  class: "pl-currency__rub-icon",
25569
- onClick: _cache[1] || (_cache[1] = ($event) => throuInput($event))
25585
+ onClick: _cache[2] || (_cache[2] = ($event) => throuInput($event))
25570
25586
  }, "\u20BD")
25571
25587
  ])
25572
25588
  } : void 0
@@ -35283,7 +35299,7 @@ const _hoisted_4$f = {
35283
35299
  class: "dialog-footer"
35284
35300
  };
35285
35301
  const _hoisted_5$a = /* @__PURE__ */ createTextVNode("\u0412\u044B\u0431\u0440\u0430\u0442\u044C");
35286
- const _hoisted_6$7 = /* @__PURE__ */ createTextVNode("\u041E\u0442\u043C\u0435\u043D\u0430");
35302
+ const _hoisted_6$6 = /* @__PURE__ */ createTextVNode("\u041E\u0442\u043C\u0435\u043D\u0430");
35287
35303
  const _hoisted_7$4 = {
35288
35304
  key: 1,
35289
35305
  class: "dialog-footer"
@@ -35475,7 +35491,7 @@ const _sfc_main$s = /* @__PURE__ */ Object.assign(__default__$6, {
35475
35491
  }, 8, ["disabled"]),
35476
35492
  createVNode(_component_el_button, { onClick: hide }, {
35477
35493
  default: withCtx(() => [
35478
- _hoisted_6$7
35494
+ _hoisted_6$6
35479
35495
  ]),
35480
35496
  _: 1
35481
35497
  })
@@ -35598,7 +35614,7 @@ const _hoisted_5$9 = {
35598
35614
  key: 0,
35599
35615
  class: "d-flex pl-table-footer position-relative align-items-center justify-content-end"
35600
35616
  };
35601
- const _hoisted_6$6 = {
35617
+ const _hoisted_6$5 = {
35602
35618
  key: 0,
35603
35619
  class: "totals"
35604
35620
  };
@@ -35738,7 +35754,7 @@ const _sfc_main$r = /* @__PURE__ */ Object.assign(__default__$5, {
35738
35754
  "hide-on-single-page": true
35739
35755
  }, {
35740
35756
  default: withCtx(() => [
35741
- __props.isTotalVisible && unref(layout).includes("slot") ? (openBlock(), createElementBlock("span", _hoisted_6$6, toDisplayString(displayTotal()), 1)) : createCommentVNode("", true)
35757
+ __props.isTotalVisible && unref(layout).includes("slot") ? (openBlock(), createElementBlock("span", _hoisted_6$5, toDisplayString(displayTotal()), 1)) : createCommentVNode("", true)
35742
35758
  ]),
35743
35759
  _: 1
35744
35760
  }, 8, ["page-size", "current-page", "page-sizes", "layout", "total"]),
@@ -38120,37 +38136,12 @@ var calendar = [
38120
38136
  }
38121
38137
  ];
38122
38138
  const WEEK_DAYS = ["\u041F\u043D", "\u0412\u0442", "\u0421\u0440", "\u0427\u0442", "\u041F\u0442", "\u0421\u0431", "\u0412\u0441"];
38123
- const DISPLAY_MONTHS = [
38124
- "\u042F\u043D\u0432\u0430\u0440\u044F",
38125
- "\u0424\u0435\u0432\u0440\u0430\u043B\u044F",
38126
- "\u041C\u0430\u0440\u0442\u0430",
38127
- "\u0410\u043F\u0440\u0435\u043B\u044F",
38128
- "\u041C\u0430\u044F",
38129
- "\u0418\u044E\u043D\u044F",
38130
- "\u0418\u044E\u043B\u044F",
38131
- "\u0410\u0432\u0433\u0443\u0441\u0442\u0430",
38132
- "\u0421\u0435\u043D\u0442\u044F\u0431\u0440\u044F",
38133
- "\u041E\u043A\u0442\u044F\u0431\u0440\u044F",
38134
- "\u041D\u043E\u044F\u0431\u0440\u044F",
38135
- "\u0414\u0435\u043A\u0430\u0431\u0440\u044F"
38136
- ];
38137
38139
  var plDatePickerPlus_vue_vue_type_style_index_0_lang = "";
38138
38140
  const _hoisted_1$d = { class: "date-picker-plus" };
38139
- const _hoisted_2$c = {
38140
- key: 0,
38141
- class: "date-picker-plus__title"
38142
- };
38143
- const _hoisted_3$b = {
38144
- key: 1,
38145
- class: "date-picker-plus__placeholder"
38146
- };
38147
- const _hoisted_4$7 = /* @__PURE__ */ createElementVNode("img", {
38148
- class: "date-picker-plus__img",
38149
- src: _imports_0$4,
38150
- alt: "date-picker icon"
38151
- }, null, -1);
38152
- const _hoisted_5$6 = { class: "date-picker-plus__days" };
38153
- const _hoisted_6$5 = ["onClick"];
38141
+ const _hoisted_2$c = { class: "date-picker-plus__wrapper" };
38142
+ const _hoisted_3$b = { class: "date-picker-plus__days" };
38143
+ const _hoisted_4$7 = ["onClick"];
38144
+ const _hoisted_5$6 = { class: "field" };
38154
38145
  const _sfc_main$d = {
38155
38146
  __name: "pl-date-picker-plus",
38156
38147
  props: {
@@ -38162,6 +38153,10 @@ const _sfc_main$d = {
38162
38153
  type: String,
38163
38154
  default: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0430\u0442\u0443"
38164
38155
  },
38156
+ label: {
38157
+ type: String,
38158
+ default: ""
38159
+ },
38165
38160
  weekendsDisabled: {
38166
38161
  type: Boolean,
38167
38162
  default: true
@@ -38176,42 +38171,45 @@ const _sfc_main$d = {
38176
38171
  const selectedDate = ref(dayjs());
38177
38172
  const confirmedDate = ref(dayjs());
38178
38173
  const isOpen = ref(false);
38174
+ const datePickerRef = ref(null);
38175
+ const dateValue = ref(dayjs().format("DD.MM.YYYY"));
38179
38176
  const weekendsDate = calendar;
38180
- const displayDate = (value) => {
38181
- const dayjsDate = dayjs.isDayjs(value) ? value : dayjs(value);
38182
- return `${dayjsDate.date()} ${DISPLAY_MONTHS[dayjsDate.month()]}, ${dayjsDate.year()}`;
38183
- };
38184
38177
  const checkCurrentMonthDays = (dayItem) => {
38185
38178
  return selectedDate.value.date() === dayItem.day && selectedDate.value.month() === dayItem.month && selectedDate.value.year() === dayItem.year && dayItem.type === "current";
38186
38179
  };
38187
- const closeDatePicker = () => {
38188
- currentDate.value = confirmedDate.value;
38189
- selectedDate.value = confirmedDate.value;
38190
- isOpen.value = false;
38191
- };
38192
- const toggleDatePicker = () => {
38193
- currentDate.value = confirmedDate.value;
38194
- selectedDate.value = confirmedDate.value;
38195
- isOpen.value = !isOpen.value;
38196
- };
38197
- const target = ref(null);
38198
- onClickOutside(target, () => {
38199
- setTimeout(() => {
38200
- closeDatePicker();
38201
- });
38202
- });
38180
+ ref(null);
38181
+ const displayData = (value) => value.format("DD.MM.YYYY");
38203
38182
  const confirmDate = () => {
38204
38183
  confirmedDate.value = selectedDate.value;
38205
- currentDate.value = selectedDate.value;
38206
- emit2("update:modelValue", confirmedDate.value.toDate());
38207
- isOpen.value = false;
38184
+ dateValue.value = displayData(selectedDate.value);
38185
+ emit2("update:modelValue", selectedDate.value.format("DD.MM.YYYY"));
38208
38186
  };
38209
38187
  const selectDate = (item) => {
38210
- if (item.type === "current") {
38211
- selectedDate.value = dayjs().set("date", item.day).set("month", item.month).set("year", item.year);
38212
- confirmDate();
38188
+ selectedDate.value = dayjs().set("date", item.day).set("month", item.month).set("year", item.year);
38189
+ confirmDate();
38190
+ };
38191
+ const validate = (date4, format2) => {
38192
+ return dayjs(date4, format2).format(format2) === date4;
38193
+ };
38194
+ const savedDate = ref();
38195
+ const updateDate = (event) => {
38196
+ savedDate.value = dayjs(event.target.value.split(".").reverse().join("-"));
38197
+ if (validate(dateValue.value, "DD.MM.YYYY")) {
38198
+ console.log(savedDate.value);
38199
+ if (savedDate.value) {
38200
+ currentDate.value = savedDate.value;
38201
+ selectedDate.value = savedDate.value;
38202
+ emit2("update:modelValue", selectedDate.value.format("DD.MM.YYYY"));
38203
+ } else {
38204
+ savedDate.value = confirmedDate.value;
38205
+ }
38213
38206
  }
38214
38207
  };
38208
+ onClickOutside(datePickerRef, () => {
38209
+ setTimeout(() => {
38210
+ isOpen.value = false;
38211
+ });
38212
+ });
38215
38213
  const getArrayOfDays = () => {
38216
38214
  const prevMonthDays = [];
38217
38215
  const currMonthDays = [];
@@ -38251,24 +38249,35 @@ const _sfc_main$d = {
38251
38249
  });
38252
38250
  return (_ctx, _cache) => {
38253
38251
  return openBlock(), createElementBlock("div", _hoisted_1$d, [
38254
- createElementVNode("div", {
38255
- class: "date-picker-plus__wrapper",
38256
- onClick: toggleDatePicker
38257
- }),
38258
- __props.modelValue ? (openBlock(), createElementBlock("span", _hoisted_2$c, toDisplayString(displayDate(__props.modelValue)), 1)) : (openBlock(), createElementBlock("span", _hoisted_3$b, toDisplayString(__props.placeholder), 1)),
38259
- _hoisted_4$7,
38252
+ createElementVNode("div", _hoisted_2$c, [
38253
+ createVNode(_sfc_main$z, {
38254
+ modelValue: dateValue.value,
38255
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dateValue.value = $event),
38256
+ class: "date-picker-plus__input",
38257
+ label: __props.label,
38258
+ placeholder: __props.placeholder,
38259
+ onInput: updateDate,
38260
+ datePicker: ""
38261
+ }, null, 8, ["modelValue", "label", "placeholder"]),
38262
+ createElementVNode("img", {
38263
+ class: "date-picker-plus__img",
38264
+ src: _imports_0$4,
38265
+ alt: "date-picker icon",
38266
+ onClick: _cache[1] || (_cache[1] = ($event) => isOpen.value = !isOpen.value)
38267
+ })
38268
+ ]),
38260
38269
  isOpen.value ? (openBlock(), createElementBlock("div", {
38261
- key: 2,
38270
+ key: 0,
38262
38271
  id: "date-picker-popup",
38263
38272
  class: "date-picker-plus__popup",
38264
- ref_key: "target",
38265
- ref: target
38273
+ ref_key: "datePickerRef",
38274
+ ref: datePickerRef
38266
38275
  }, [
38267
38276
  createVNode(_sfc_main$e, {
38268
38277
  modelValue: currentDate.value,
38269
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => currentDate.value = $event)
38278
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => currentDate.value = $event)
38270
38279
  }, null, 8, ["modelValue"]),
38271
- createElementVNode("div", _hoisted_5$6, [
38280
+ createElementVNode("div", _hoisted_3$b, [
38272
38281
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(WEEK_DAYS), (item, index) => {
38273
38282
  return openBlock(), createElementBlock("div", {
38274
38283
  class: "date-picker-plus__week-day",
@@ -38285,8 +38294,10 @@ const _sfc_main$d = {
38285
38294
  { "date-picker-plus__day-item_active-item": checkCurrentMonthDays(item) }
38286
38295
  ]),
38287
38296
  key: `dd${index}`,
38288
- onClick: ($event) => item.weekend ? {} : selectDate(item)
38289
- }, toDisplayString(item.day), 11, _hoisted_6$5);
38297
+ onClick: ($event) => (item.weekend || (item.type === "previous" || item.type === "next") ? {} : selectDate(item), isOpen.value = false)
38298
+ }, [
38299
+ createElementVNode("div", _hoisted_5$6, toDisplayString(item.type !== "previous" && item.type !== "next" ? item.day : ""), 1)
38300
+ ], 10, _hoisted_4$7);
38290
38301
  }), 128))
38291
38302
  ])
38292
38303
  ], 512)) : createCommentVNode("", true)