@factoringplus/pl-components-pack-v3 0.1.67 → 0.1.70

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/README.md CHANGED
@@ -1,17 +1,17 @@
1
- # Библиотека компонентов Vue 3
2
-
3
- ## Установка
4
-
5
- ```bash
6
- npm i @factoringplus/pl-components-pack-v3
7
- ```
8
-
9
- ### Добавление компонентов в проект
10
-
11
- ```bash
12
- // src/main.js
13
- import components from '@factoringplus/pl-components-pack-v3';
14
- import '@factoringplus/pl-components-pack-v3/dist/style.css';
15
-
16
- app.use(components)
17
- ```
1
+ # Библиотека компонентов Vue 3
2
+
3
+ ## Установка
4
+
5
+ ```bash
6
+ npm i @factoringplus/pl-components-pack-v3
7
+ ```
8
+
9
+ ### Добавление компонентов в проект
10
+
11
+ ```bash
12
+ // src/main.js
13
+ import components from '@factoringplus/pl-components-pack-v3';
14
+ import '@factoringplus/pl-components-pack-v3/dist/style.css';
15
+
16
+ app.use(components)
17
+ ```
package/dist/CNAME CHANGED
@@ -1 +1 @@
1
- vite-starter.element-plus.org
1
+ vite-starter.element-plus.org
@@ -9888,50 +9888,50 @@ const _sfc_main$z = defineComponent({
9888
9888
  const cell = rows.value[row][column];
9889
9889
  if (cell.disabled || cell.type === "week")
9890
9890
  return;
9891
- const newDate = getDateOfCell(row, column);
9891
+ const newDate2 = getDateOfCell(row, column);
9892
9892
  if (props.selectionMode === "range") {
9893
9893
  if (!props.rangeState.selecting) {
9894
- ctx.emit("pick", { minDate: newDate, maxDate: null });
9894
+ ctx.emit("pick", { minDate: newDate2, maxDate: null });
9895
9895
  ctx.emit("select", true);
9896
9896
  } else {
9897
- if (newDate >= props.minDate) {
9898
- ctx.emit("pick", { minDate: props.minDate, maxDate: newDate });
9897
+ if (newDate2 >= props.minDate) {
9898
+ ctx.emit("pick", { minDate: props.minDate, maxDate: newDate2 });
9899
9899
  } else {
9900
- ctx.emit("pick", { minDate: newDate, maxDate: props.minDate });
9900
+ ctx.emit("pick", { minDate: newDate2, maxDate: props.minDate });
9901
9901
  }
9902
9902
  ctx.emit("select", false);
9903
9903
  }
9904
9904
  } else if (props.selectionMode === "day") {
9905
- ctx.emit("pick", newDate);
9905
+ ctx.emit("pick", newDate2);
9906
9906
  } else if (props.selectionMode === "week") {
9907
- const weekNumber = newDate.week();
9908
- const value = `${newDate.year()}w${weekNumber}`;
9907
+ const weekNumber = newDate2.week();
9908
+ const value = `${newDate2.year()}w${weekNumber}`;
9909
9909
  ctx.emit("pick", {
9910
- year: newDate.year(),
9910
+ year: newDate2.year(),
9911
9911
  week: weekNumber,
9912
9912
  value,
9913
- date: newDate.startOf("week")
9913
+ date: newDate2.startOf("week")
9914
9914
  });
9915
9915
  } else if (props.selectionMode === "dates") {
9916
- const newValue = cell.selected ? castArray(props.parsedValue).filter((_2) => _2.valueOf() !== newDate.valueOf()) : castArray(props.parsedValue).concat([newDate]);
9916
+ const newValue = cell.selected ? castArray(props.parsedValue).filter((_2) => _2.valueOf() !== newDate2.valueOf()) : castArray(props.parsedValue).concat([newDate2]);
9917
9917
  ctx.emit("pick", newValue);
9918
9918
  }
9919
9919
  };
9920
9920
  const isWeekActive = (cell) => {
9921
9921
  if (props.selectionMode !== "week")
9922
9922
  return false;
9923
- let newDate = props.date.startOf("day");
9923
+ let newDate2 = props.date.startOf("day");
9924
9924
  if (cell.type === "prev-month") {
9925
- newDate = newDate.subtract(1, "month");
9925
+ newDate2 = newDate2.subtract(1, "month");
9926
9926
  }
9927
9927
  if (cell.type === "next-month") {
9928
- newDate = newDate.add(1, "month");
9928
+ newDate2 = newDate2.add(1, "month");
9929
9929
  }
9930
- newDate = newDate.date(Number.parseInt(cell.text, 10));
9930
+ newDate2 = newDate2.date(Number.parseInt(cell.text, 10));
9931
9931
  if (props.parsedValue && !Array.isArray(props.parsedValue)) {
9932
9932
  const dayOffset = (props.parsedValue.day() - firstDayOfWeek + 7) % 7 - 1;
9933
9933
  const weekDate = props.parsedValue.subtract(dayOffset, "day");
9934
- return weekDate.isSame(newDate, "day");
9934
+ return weekDate.isSame(newDate2, "day");
9935
9935
  }
9936
9936
  return false;
9937
9937
  };
@@ -10124,16 +10124,16 @@ const _sfc_main$y = defineComponent({
10124
10124
  const column = target.cellIndex;
10125
10125
  const row = target.parentNode.rowIndex;
10126
10126
  const month = row * 4 + column;
10127
- const newDate = props.date.startOf("year").month(month);
10127
+ const newDate2 = props.date.startOf("year").month(month);
10128
10128
  if (props.selectionMode === "range") {
10129
10129
  if (!props.rangeState.selecting) {
10130
- ctx.emit("pick", { minDate: newDate, maxDate: null });
10130
+ ctx.emit("pick", { minDate: newDate2, maxDate: null });
10131
10131
  ctx.emit("select", true);
10132
10132
  } else {
10133
- if (newDate >= props.minDate) {
10134
- ctx.emit("pick", { minDate: props.minDate, maxDate: newDate });
10133
+ if (newDate2 >= props.minDate) {
10134
+ ctx.emit("pick", { minDate: props.minDate, maxDate: newDate2 });
10135
10135
  } else {
10136
- ctx.emit("pick", { minDate: newDate, maxDate: props.minDate });
10136
+ ctx.emit("pick", { minDate: newDate2, maxDate: props.minDate });
10137
10137
  }
10138
10138
  ctx.emit("select", false);
10139
10139
  }
@@ -10390,12 +10390,12 @@ const _sfc_main$w = defineComponent({
10390
10390
  };
10391
10391
  const handleDatePick = (value) => {
10392
10392
  if (selectionMode.value === "day") {
10393
- let newDate = props.parsedValue ? props.parsedValue.year(value.year()).month(value.month()).date(value.date()) : value;
10394
- if (!checkDateWithinRange(newDate)) {
10395
- newDate = selectableRange.value[0][0].year(value.year()).month(value.month()).date(value.date());
10393
+ let newDate2 = props.parsedValue ? props.parsedValue.year(value.year()).month(value.month()).date(value.date()) : value;
10394
+ if (!checkDateWithinRange(newDate2)) {
10395
+ newDate2 = selectableRange.value[0][0].year(value.year()).month(value.month()).date(value.date());
10396
10396
  }
10397
- innerDate.value = newDate;
10398
- emit(newDate, showTime.value);
10397
+ innerDate.value = newDate2;
10398
+ emit(newDate2, showTime.value);
10399
10399
  } else if (selectionMode.value === "week") {
10400
10400
  emit(value.date);
10401
10401
  } else if (selectionMode.value === "dates") {
@@ -10544,29 +10544,29 @@ const _sfc_main$w = defineComponent({
10544
10544
  timePickerVisible.value = false;
10545
10545
  };
10546
10546
  const handleTimePick = (value, visible, first) => {
10547
- const newDate = props.parsedValue ? props.parsedValue.hour(value.hour()).minute(value.minute()).second(value.second()) : value;
10548
- innerDate.value = newDate;
10547
+ const newDate2 = props.parsedValue ? props.parsedValue.hour(value.hour()).minute(value.minute()).second(value.second()) : value;
10548
+ innerDate.value = newDate2;
10549
10549
  emit(innerDate.value, true);
10550
10550
  if (!first) {
10551
10551
  timePickerVisible.value = visible;
10552
10552
  }
10553
10553
  };
10554
10554
  const handleVisibleTimeChange = (value) => {
10555
- const newDate = dayjs(value, timeFormat.value).locale(lang2.value);
10556
- if (newDate.isValid() && checkDateWithinRange(newDate)) {
10557
- innerDate.value = newDate.year(innerDate.value.year()).month(innerDate.value.month()).date(innerDate.value.date());
10555
+ const newDate2 = dayjs(value, timeFormat.value).locale(lang2.value);
10556
+ if (newDate2.isValid() && checkDateWithinRange(newDate2)) {
10557
+ innerDate.value = newDate2.year(innerDate.value.year()).month(innerDate.value.month()).date(innerDate.value.date());
10558
10558
  userInputTime.value = null;
10559
10559
  timePickerVisible.value = false;
10560
10560
  emit(innerDate.value, true);
10561
10561
  }
10562
10562
  };
10563
10563
  const handleVisibleDateChange = (value) => {
10564
- const newDate = dayjs(value, dateFormat.value).locale(lang2.value);
10565
- if (newDate.isValid()) {
10566
- if (disabledDate && disabledDate(newDate.toDate())) {
10564
+ const newDate2 = dayjs(value, dateFormat.value).locale(lang2.value);
10565
+ if (newDate2.isValid()) {
10566
+ if (disabledDate && disabledDate(newDate2.toDate())) {
10567
10567
  return;
10568
10568
  }
10569
- innerDate.value = newDate.hour(innerDate.value.hour()).minute(innerDate.value.minute()).second(innerDate.value.second());
10569
+ innerDate.value = newDate2.hour(innerDate.value.hour()).minute(innerDate.value.minute()).second(innerDate.value.second());
10570
10570
  userInputDate.value = null;
10571
10571
  emit(innerDate.value, true);
10572
10572
  }
@@ -10641,14 +10641,14 @@ const _sfc_main$w = defineComponent({
10641
10641
  offset: (date4, step) => date4.setDate(date4.getDate() + step)
10642
10642
  }
10643
10643
  };
10644
- const newDate = innerDate.value.toDate();
10645
- while (Math.abs(innerDate.value.diff(newDate, "year", true)) < 1) {
10644
+ const newDate2 = innerDate.value.toDate();
10645
+ while (Math.abs(innerDate.value.diff(newDate2, "year", true)) < 1) {
10646
10646
  const map2 = mapping[selectionMode.value];
10647
- map2.offset(newDate, map2[keyCode]);
10648
- if (disabledDate && disabledDate(newDate)) {
10647
+ map2.offset(newDate2, map2[keyCode]);
10648
+ if (disabledDate && disabledDate(newDate2)) {
10649
10649
  continue;
10650
10650
  }
10651
- const result = dayjs(newDate).locale(lang2.value);
10651
+ const result = dayjs(newDate2).locale(lang2.value);
10652
10652
  innerDate.value = result;
10653
10653
  ctx.emit("pick", result, true);
10654
10654
  break;
@@ -23262,7 +23262,7 @@ const _sfc_main$5 = {
23262
23262
  };
23263
23263
  }
23264
23264
  };
23265
- var PlButton = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-bba88be2"]]);
23265
+ var PlButton = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-3993cad6"]]);
23266
23266
  const PlButtonPlugin = {
23267
23267
  install(app) {
23268
23268
  app.component("PlButton", PlButton);
@@ -37933,7 +37933,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
37933
37933
  buttonText: { type: String, default: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B..." },
37934
37934
  accept: { type: String, default: ".doc, .docx, .pdf, .jpeg, .png, .xlsx, .xls, .txt" },
37935
37935
  fileSize: { type: Number, default: 20 },
37936
- value: { type: Array, default: () => [] },
37936
+ modelValue: { type: Array, default: () => [] },
37937
37937
  header: { type: Boolean, default: true },
37938
37938
  main: { type: Boolean, default: true },
37939
37939
  large: { type: Boolean, default: false }
@@ -37952,10 +37952,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
37952
37952
  const props = __props;
37953
37953
  const disabled = ref(false);
37954
37954
  const loadingButton = ref(false);
37955
- const fileList = ref(props.value);
37955
+ const fileList = ref(props.modelValue);
37956
37956
  const el = ref(null);
37957
- const { value } = toRefs(props);
37958
- watch(value, (newValue) => {
37957
+ const { modelValue } = toRefs(props);
37958
+ watch(modelValue, (newValue) => {
37959
37959
  fileList.value = newValue;
37960
37960
  });
37961
37961
  onMounted(() => {
@@ -38001,7 +38001,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
38001
38001
  }
38002
38002
  const currentfileSize = file.size / 1024 / 1024;
38003
38003
  if (currentfileSize > props.fileSize) {
38004
- emit("on-file-size-exceeded", file, fileList2, this.fileSize);
38004
+ emit("on-file-size-exceeded", file, fileList2, props.fileSize);
38005
38005
  fileList2.splice(-1);
38006
38006
  return;
38007
38007
  }
@@ -38085,9 +38085,104 @@ const PlUploadPlugin = {
38085
38085
  app.component("PlUpload", _sfc_main);
38086
38086
  }
38087
38087
  };
38088
+ const checkDate = (date4) => date4 instanceof Date && !Number.isNaN(Number(date4));
38089
+ const IsDate = (str2) => {
38090
+ if (!_.isString(str2)) {
38091
+ return false;
38092
+ }
38093
+ const parms = str2.split(/[\.\-\/]/);
38094
+ const yyyy = parseInt(parms[0], 10);
38095
+ if (yyyy < 1900) {
38096
+ return false;
38097
+ }
38098
+ const mm = parseInt(parms[1], 10);
38099
+ if (mm < 1 || mm > 12) {
38100
+ return false;
38101
+ }
38102
+ const dd = parseInt(parms[2], 10);
38103
+ if (dd < 1 || dd > 31) {
38104
+ return false;
38105
+ }
38106
+ const dateCheck = new Date(yyyy, mm - 1, dd);
38107
+ return dateCheck.getDate() === dd && dateCheck.getMonth() === mm - 1 && dateCheck.getFullYear() === yyyy;
38108
+ };
38109
+ const stringDate = (date4) => {
38110
+ const year = date4.getFullYear();
38111
+ let month = date4.getMonth() + 1;
38112
+ month = month < 10 ? `0${month}` : month;
38113
+ const day = date4.getDate() < 10 ? `0${date4.getDate()}` : date4.getDate();
38114
+ return `${year}-${month}-${day}`;
38115
+ };
38116
+ const newDate = (str2) => {
38117
+ let newDateVal = str2.substring(0, str2.indexOf("T"));
38118
+ newDateVal = new Date(newDateVal);
38119
+ if (newDateVal instanceof Date && !Number.isNaN(Number(newDateVal))) {
38120
+ return newDateVal;
38121
+ }
38122
+ return str2;
38123
+ };
38124
+ const formatDateObj = (parseObj, typeToString = false) => {
38125
+ let obj;
38126
+ try {
38127
+ obj = _.cloneDeep(parseObj);
38128
+ } catch {
38129
+ }
38130
+ if (!obj || _.isEmpty(obj))
38131
+ return parseObj;
38132
+ const recursiveDeep = (element, path = "") => {
38133
+ if (_.isObjectLike(element) && !checkDate(element)) {
38134
+ _.keys(element).forEach((key) => {
38135
+ const newPath = `${path}[${key}]`;
38136
+ recursiveDeep(element[key], newPath);
38137
+ });
38138
+ } else if (typeToString && checkDate(element)) {
38139
+ _.update(obj, path, (value) => stringDate(value));
38140
+ } else if (!typeToString && IsDate(element)) {
38141
+ _.update(obj, path, (value) => newDate(value));
38142
+ }
38143
+ };
38144
+ recursiveDeep(obj);
38145
+ return obj;
38146
+ };
38147
+ var ApiJs = {
38148
+ install: (app) => {
38149
+ app.config.globalProperties.$api = (optionsRequest, isGetResourse = false, token2) => {
38150
+ new Promise((resolve, reject) => {
38151
+ const options = __spreadValues({}, optionsRequest);
38152
+ axios({
38153
+ url: options.url,
38154
+ method: options.method,
38155
+ params: formatDateObj(options.params, true),
38156
+ headers: __spreadValues({
38157
+ authorization: token2
38158
+ }, options.headers),
38159
+ data: formatDateObj(options.data, true),
38160
+ responseType: options.responseType
38161
+ }).then((resourse) => {
38162
+ if (isGetResourse)
38163
+ resolve(formatDateObj(resourse));
38164
+ resolve(formatDateObj(resourse.data));
38165
+ }).catch((error2) => {
38166
+ reject(error2.response);
38167
+ });
38168
+ if (window.navigator.userAgent.indexOf("MSIE ") > -1 || window.navigator.userAgent.indexOf("Trident/") > -1) {
38169
+ axios.interceptors.request.use((config) => {
38170
+ if (config.url.indexOf("GetRequirementItems") !== -1) {
38171
+ console.log(config.url);
38172
+ config.headers.pragma = "no-cache";
38173
+ config.headers.cacheControl = "no-cache";
38174
+ config.headers.expires = "Sat, 01 Jan 2000 00:00:00 GMT";
38175
+ }
38176
+ return config;
38177
+ });
38178
+ }
38179
+ });
38180
+ };
38181
+ }
38182
+ };
38088
38183
  const PlPlugin = {
38089
38184
  install(app) {
38090
- var _a2, _b2, _c, _d, _e, _f, _g;
38185
+ var _a2, _b2, _c, _d, _e, _f, _g, _h;
38091
38186
  (_a2 = PlCurrencyPlugin.install) == null ? void 0 : _a2.call(PlCurrencyPlugin, app);
38092
38187
  (_b2 = TestViteNpmComponentPlugin.install) == null ? void 0 : _b2.call(TestViteNpmComponentPlugin, app);
38093
38188
  (_c = PlButtonPlugin.install) == null ? void 0 : _c.call(PlButtonPlugin, app);
@@ -38095,6 +38190,7 @@ const PlPlugin = {
38095
38190
  (_e = PlCertDialogPlugin.install) == null ? void 0 : _e.call(PlCertDialogPlugin, app);
38096
38191
  (_f = PlTablePlugin.install) == null ? void 0 : _f.call(PlTablePlugin, app);
38097
38192
  (_g = PlUploadPlugin.install) == null ? void 0 : _g.call(PlUploadPlugin, app);
38193
+ (_h = ApiJs.install) == null ? void 0 : _h.call(ApiJs, app);
38098
38194
  }
38099
38195
  };
38100
38196
  export { PlButton, PlButtonPlugin, _sfc_main$3 as PlCertDialog, PlCertDialogPlugin, _sfc_main$7 as PlCurrency, PlCurrencyPlugin, _sfc_main$4 as PlDatePickerRange, PlDatePickerRangePlugin, _sfc_main$2 as PlTable, _sfc_main$1 as PlTableColumn, PlTablePlugin, _sfc_main as PlUpload, PlUploadPlugin, _sfc_main$6 as TestViteNpmComponent, TestViteNpmComponentPlugin, PlPlugin as default };