@factoringplus/pl-components-pack-v3 0.1.81 → 0.1.85

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;
@@ -22245,6 +22245,14 @@ const vLoading = {
22245
22245
  (_a2 = el[INSTANCE_KEY]) == null ? void 0 : _a2.instance.close();
22246
22246
  }
22247
22247
  };
22248
+ const ElLoading = {
22249
+ install(app) {
22250
+ app.directive("loading", vLoading);
22251
+ app.config.globalProperties.$loading = Loading;
22252
+ },
22253
+ directive: vLoading,
22254
+ service: Loading
22255
+ };
22248
22256
  const messageTypes = ["success", "info", "warning", "error"];
22249
22257
  const messageProps = buildProps({
22250
22258
  customClass: {
@@ -23262,7 +23270,7 @@ const _sfc_main$5 = {
23262
23270
  };
23263
23271
  }
23264
23272
  };
23265
- var PlButton = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-bba88be2"]]);
23273
+ var PlButton = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-3a43898d"]]);
23266
23274
  const PlButtonPlugin = {
23267
23275
  install(app) {
23268
23276
  app.component("PlButton", PlButton);
@@ -36478,14 +36486,10 @@ const _sfc_main$3 = /* @__PURE__ */ Object.assign(__default__$3, {
36478
36486
  const hide2 = () => visible.value = false;
36479
36487
  const onAppendClickSingle = () => {
36480
36488
  hide2();
36481
- const certInfo = _.find(validCerts.value, [
36482
- "thumbprint",
36483
- dataForm.thumbprint
36484
- ]);
36489
+ const certInfo = _.find(validCerts.value, ["thumbprint", dataForm.thumbprint]);
36485
36490
  if (certInfo == null) {
36486
36491
  ElMessage.error("\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E \u043E \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u0435.");
36487
36492
  } else {
36488
- console.log("onAppendClickSingle", "onAppendClickSingle");
36489
36493
  emit("cert-selected", {
36490
36494
  thumbprint: certInfo.thumbprint,
36491
36495
  validTo: certInfo.validTo,
@@ -36497,10 +36501,7 @@ const _sfc_main$3 = /* @__PURE__ */ Object.assign(__default__$3, {
36497
36501
  form2.value.validate((isFormValid) => {
36498
36502
  if (isFormValid) {
36499
36503
  hide2();
36500
- const certInfo = _.find(validCerts.value, [
36501
- "thumbprint",
36502
- dataForm.thumbprint
36503
- ]);
36504
+ const certInfo = _.find(validCerts.value, ["thumbprint", dataForm.thumbprint]);
36504
36505
  if (certInfo == null) {
36505
36506
  ElMessage.error("\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E \u043E \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u0435.");
36506
36507
  } else {
@@ -37938,7 +37939,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
37938
37939
  drag: { type: Boolean, default: true },
37939
37940
  multiple: { type: Boolean, default: true },
37940
37941
  buttonText: { type: String, default: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B..." },
37941
- accept: { type: String, default: ".doc, .docx, .pdf, .jpeg, .jpg, .png, .xlsx, .xls, .txt" },
37942
+ accept: { type: String, default: ".doc, .docx, .pdf, .jpeg, .png, .xlsx, .xls, .txt" },
37942
37943
  fileSize: { type: Number, default: 20 },
37943
37944
  modelValue: { type: Array, default: () => [] },
37944
37945
  header: { type: Boolean, default: true },
@@ -37998,7 +37999,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
37998
37999
  }
37999
38000
  if (props.accept !== "any" || props.accept !== "\u043B\u044E\u0431\u043E\u0439") {
38000
38001
  const fileArr = file.name.split(".");
38001
- const fileExtension = "." + fileArr[fileArr.length - 1].toLowerCase();
38002
+ const fileExtension = "." + fileArr[fileArr.length - 1];
38002
38003
  const acceptedArr = props.accept.split(", ");
38003
38004
  if (acceptedArr.indexOf(fileExtension) === -1) {
38004
38005
  fileList2.splice(-1);
@@ -38092,6 +38093,140 @@ const PlUploadPlugin = {
38092
38093
  app.component("PlUpload", _sfc_main);
38093
38094
  }
38094
38095
  };
38096
+ const checkDate = (date4) => date4 instanceof Date && !Number.isNaN(Number(date4));
38097
+ const IsDate = (str2) => {
38098
+ if (!_.isString(str2)) {
38099
+ return false;
38100
+ }
38101
+ const parms = str2.split(/[\.\-\/]/);
38102
+ const yyyy = parseInt(parms[0], 10);
38103
+ if (yyyy < 1900) {
38104
+ return false;
38105
+ }
38106
+ const mm = parseInt(parms[1], 10);
38107
+ if (mm < 1 || mm > 12) {
38108
+ return false;
38109
+ }
38110
+ const dd = parseInt(parms[2], 10);
38111
+ if (dd < 1 || dd > 31) {
38112
+ return false;
38113
+ }
38114
+ const dateCheck = new Date(yyyy, mm - 1, dd);
38115
+ return dateCheck.getDate() === dd && dateCheck.getMonth() === mm - 1 && dateCheck.getFullYear() === yyyy;
38116
+ };
38117
+ const stringDate = (date4) => {
38118
+ const year = date4.getFullYear();
38119
+ let month = date4.getMonth() + 1;
38120
+ month = month < 10 ? `0${month}` : month;
38121
+ const day = date4.getDate() < 10 ? `0${date4.getDate()}` : date4.getDate();
38122
+ return `${year}-${month}-${day}`;
38123
+ };
38124
+ const newDate = (str2) => {
38125
+ let newDateVal = str2.substring(0, str2.indexOf("T"));
38126
+ newDateVal = new Date(newDateVal);
38127
+ if (newDateVal instanceof Date && !Number.isNaN(Number(newDateVal))) {
38128
+ return newDateVal;
38129
+ }
38130
+ return str2;
38131
+ };
38132
+ const formatDateObj = (parseObj, typeToString = false) => {
38133
+ let obj;
38134
+ try {
38135
+ obj = _.cloneDeep(parseObj);
38136
+ } catch {
38137
+ }
38138
+ if (!obj || _.isEmpty(obj))
38139
+ return parseObj;
38140
+ const recursiveDeep = (element, path = "") => {
38141
+ if (_.isObjectLike(element) && !checkDate(element)) {
38142
+ _.keys(element).forEach((key) => {
38143
+ const newPath = `${path}[${key}]`;
38144
+ recursiveDeep(element[key], newPath);
38145
+ });
38146
+ } else if (typeToString && checkDate(element)) {
38147
+ _.update(obj, path, (value) => stringDate(value));
38148
+ } else if (!typeToString && IsDate(element)) {
38149
+ _.update(obj, path, (value) => newDate(value));
38150
+ }
38151
+ };
38152
+ recursiveDeep(obj);
38153
+ return obj;
38154
+ };
38155
+ const ApiJs = function(optionsRequest, isGetResourse = false, token2) {
38156
+ return new Promise((resolve, reject) => {
38157
+ const options = __spreadValues({}, optionsRequest);
38158
+ axios({
38159
+ url: options.url,
38160
+ method: options.method,
38161
+ params: formatDateObj(options.params, true),
38162
+ headers: __spreadValues({
38163
+ authorization: token2
38164
+ }, options.headers),
38165
+ data: formatDateObj(options.data, true),
38166
+ responseType: options.responseType
38167
+ }).then((resourse) => {
38168
+ if (isGetResourse)
38169
+ resolve(formatDateObj(resourse));
38170
+ resolve(formatDateObj(resourse.data));
38171
+ }).catch((error2) => {
38172
+ reject(error2.response);
38173
+ });
38174
+ if (window.navigator.userAgent.indexOf("MSIE ") > -1 || window.navigator.userAgent.indexOf("Trident/") > -1) {
38175
+ axios.interceptors.request.use((config) => {
38176
+ if (config.url.indexOf("GetRequirementItems") !== -1) {
38177
+ console.log(config.url);
38178
+ config.headers.pragma = "no-cache";
38179
+ config.headers.cacheControl = "no-cache";
38180
+ config.headers.expires = "Sat, 01 Jan 2000 00:00:00 GMT";
38181
+ }
38182
+ return config;
38183
+ });
38184
+ }
38185
+ });
38186
+ };
38187
+ const addGetSet = (addWord, method4) => {
38188
+ const arrStr = method4.split("/");
38189
+ const returnStr = arrStr[arrStr.length - 1][0].toUpperCase() + arrStr[arrStr.length - 1].slice(1);
38190
+ return arrStr.length === 1 ? addWord + returnStr : `${arrStr[0]}/${addWord}${returnStr}`;
38191
+ };
38192
+ const parseMessageAlert = (error2) => {
38193
+ let value = "\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u043E\u0448\u0438\u0431\u043A\u0430";
38194
+ if (!(error2 == null ? void 0 : error2.message)) {
38195
+ if (error2.status === 401 || error2.status === 403) {
38196
+ value = "\u041D\u0435\u0434\u043E\u0441\u0442\u0430\u0442\u043E\u0447\u043D\u043E \u043F\u0440\u0430\u0432 \u0434\u043B\u044F \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438.";
38197
+ } else if (error2.status === 500) {
38198
+ value = "\u0421\u0435\u0440\u0432\u0435\u0440 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D.";
38199
+ }
38200
+ } else {
38201
+ value = error2.message;
38202
+ }
38203
+ ElMessage.error(value);
38204
+ };
38205
+ function loadingAndSetup(bindData, apiCall, apiParams, loadingArr, fastResponse = false, store) {
38206
+ let loadingInstanceArr = null;
38207
+ if (fastResponse) {
38208
+ bindData.value = store.getters[addGetSet("get", apiCall)];
38209
+ } else {
38210
+ loadingInstanceArr = loadingArr.map((element) => ElLoading.service({
38211
+ target: document.getElementById(element)
38212
+ }));
38213
+ }
38214
+ return store.dispatch(apiCall, apiParams).then((res) => {
38215
+ bindData.value = res.data ? res.data : res;
38216
+ store.commit(addGetSet("set", apiCall), bindData.value);
38217
+ return Promise.resolve(res, apiParams);
38218
+ }).catch((error2) => {
38219
+ var _a2;
38220
+ console.error(error2);
38221
+ if ((_a2 = error2.data) == null ? void 0 : _a2.message)
38222
+ parseMessageAlert(error2.data);
38223
+ return Promise.reject(error2, apiParams);
38224
+ }).finally(() => {
38225
+ if (loadingInstanceArr) {
38226
+ loadingInstanceArr.forEach((element) => element.close());
38227
+ }
38228
+ });
38229
+ }
38095
38230
  const PlPlugin = {
38096
38231
  install(app) {
38097
38232
  var _a2, _b2, _c, _d, _e, _f, _g;
@@ -38102,6 +38237,9 @@ const PlPlugin = {
38102
38237
  (_e = PlCertDialogPlugin.install) == null ? void 0 : _e.call(PlCertDialogPlugin, app);
38103
38238
  (_f = PlTablePlugin.install) == null ? void 0 : _f.call(PlTablePlugin, app);
38104
38239
  (_g = PlUploadPlugin.install) == null ? void 0 : _g.call(PlUploadPlugin, app);
38105
- }
38240
+ },
38241
+ apiJs: ApiJs,
38242
+ loader: loadingAndSetup,
38243
+ test: "test"
38106
38244
  };
38107
38245
  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 };