@factoringplus/pl-components-pack-v3 0.1.68 → 0.1.71
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 +17 -17
- package/dist/CNAME +1 -1
- package/dist/pl-components-pack-v3.es.js +135 -43
- package/dist/pl-components-pack-v3.umd.js +12 -12
- package/dist/style.css +2 -2
- package/package.json +65 -65
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
|
|
9891
|
+
const newDate2 = getDateOfCell(row, column);
|
|
9892
9892
|
if (props.selectionMode === "range") {
|
|
9893
9893
|
if (!props.rangeState.selecting) {
|
|
9894
|
-
ctx.emit("pick", { minDate:
|
|
9894
|
+
ctx.emit("pick", { minDate: newDate2, maxDate: null });
|
|
9895
9895
|
ctx.emit("select", true);
|
|
9896
9896
|
} else {
|
|
9897
|
-
if (
|
|
9898
|
-
ctx.emit("pick", { minDate: props.minDate, maxDate:
|
|
9897
|
+
if (newDate2 >= props.minDate) {
|
|
9898
|
+
ctx.emit("pick", { minDate: props.minDate, maxDate: newDate2 });
|
|
9899
9899
|
} else {
|
|
9900
|
-
ctx.emit("pick", { 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",
|
|
9905
|
+
ctx.emit("pick", newDate2);
|
|
9906
9906
|
} else if (props.selectionMode === "week") {
|
|
9907
|
-
const weekNumber =
|
|
9908
|
-
const value = `${
|
|
9907
|
+
const weekNumber = newDate2.week();
|
|
9908
|
+
const value = `${newDate2.year()}w${weekNumber}`;
|
|
9909
9909
|
ctx.emit("pick", {
|
|
9910
|
-
year:
|
|
9910
|
+
year: newDate2.year(),
|
|
9911
9911
|
week: weekNumber,
|
|
9912
9912
|
value,
|
|
9913
|
-
date:
|
|
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() !==
|
|
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
|
|
9923
|
+
let newDate2 = props.date.startOf("day");
|
|
9924
9924
|
if (cell.type === "prev-month") {
|
|
9925
|
-
|
|
9925
|
+
newDate2 = newDate2.subtract(1, "month");
|
|
9926
9926
|
}
|
|
9927
9927
|
if (cell.type === "next-month") {
|
|
9928
|
-
|
|
9928
|
+
newDate2 = newDate2.add(1, "month");
|
|
9929
9929
|
}
|
|
9930
|
-
|
|
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(
|
|
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
|
|
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:
|
|
10130
|
+
ctx.emit("pick", { minDate: newDate2, maxDate: null });
|
|
10131
10131
|
ctx.emit("select", true);
|
|
10132
10132
|
} else {
|
|
10133
|
-
if (
|
|
10134
|
-
ctx.emit("pick", { minDate: props.minDate, maxDate:
|
|
10133
|
+
if (newDate2 >= props.minDate) {
|
|
10134
|
+
ctx.emit("pick", { minDate: props.minDate, maxDate: newDate2 });
|
|
10135
10135
|
} else {
|
|
10136
|
-
ctx.emit("pick", { 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
|
|
10394
|
-
if (!checkDateWithinRange(
|
|
10395
|
-
|
|
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 =
|
|
10398
|
-
emit(
|
|
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
|
|
10548
|
-
innerDate.value =
|
|
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
|
|
10556
|
-
if (
|
|
10557
|
-
innerDate.value =
|
|
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
|
|
10565
|
-
if (
|
|
10566
|
-
if (disabledDate && disabledDate(
|
|
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 =
|
|
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
|
|
10645
|
-
while (Math.abs(innerDate.value.diff(
|
|
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(
|
|
10648
|
-
if (disabledDate && disabledDate(
|
|
10647
|
+
map2.offset(newDate2, map2[keyCode]);
|
|
10648
|
+
if (disabledDate && disabledDate(newDate2)) {
|
|
10649
10649
|
continue;
|
|
10650
10650
|
}
|
|
10651
|
-
const result = dayjs(
|
|
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-
|
|
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);
|
|
@@ -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,
|
|
38004
|
+
emit("on-file-size-exceeded", file, fileList2, props.fileSize);
|
|
38005
38005
|
fileList2.splice(-1);
|
|
38006
38006
|
return;
|
|
38007
38007
|
}
|
|
@@ -38085,6 +38085,97 @@ 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
|
+
function ApiJs(optionsRequest, isGetResourse = false, token2) {
|
|
38148
|
+
return new Promise((resolve, reject) => {
|
|
38149
|
+
const options = __spreadValues({}, optionsRequest);
|
|
38150
|
+
axios({
|
|
38151
|
+
url: options.url,
|
|
38152
|
+
method: options.method,
|
|
38153
|
+
params: formatDateObj(options.params, true),
|
|
38154
|
+
headers: __spreadValues({
|
|
38155
|
+
authorization: token2
|
|
38156
|
+
}, options.headers),
|
|
38157
|
+
data: formatDateObj(options.data, true),
|
|
38158
|
+
responseType: options.responseType
|
|
38159
|
+
}).then((resourse) => {
|
|
38160
|
+
if (isGetResourse)
|
|
38161
|
+
resolve(formatDateObj(resourse));
|
|
38162
|
+
resolve(formatDateObj(resourse.data));
|
|
38163
|
+
}).catch((error2) => {
|
|
38164
|
+
reject(error2.response);
|
|
38165
|
+
});
|
|
38166
|
+
if (window.navigator.userAgent.indexOf("MSIE ") > -1 || window.navigator.userAgent.indexOf("Trident/") > -1) {
|
|
38167
|
+
axios.interceptors.request.use((config) => {
|
|
38168
|
+
if (config.url.indexOf("GetRequirementItems") !== -1) {
|
|
38169
|
+
console.log(config.url);
|
|
38170
|
+
config.headers.pragma = "no-cache";
|
|
38171
|
+
config.headers.cacheControl = "no-cache";
|
|
38172
|
+
config.headers.expires = "Sat, 01 Jan 2000 00:00:00 GMT";
|
|
38173
|
+
}
|
|
38174
|
+
return config;
|
|
38175
|
+
});
|
|
38176
|
+
}
|
|
38177
|
+
});
|
|
38178
|
+
}
|
|
38088
38179
|
const PlPlugin = {
|
|
38089
38180
|
install(app) {
|
|
38090
38181
|
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
@@ -38095,6 +38186,7 @@ const PlPlugin = {
|
|
|
38095
38186
|
(_e = PlCertDialogPlugin.install) == null ? void 0 : _e.call(PlCertDialogPlugin, app);
|
|
38096
38187
|
(_f = PlTablePlugin.install) == null ? void 0 : _f.call(PlTablePlugin, app);
|
|
38097
38188
|
(_g = PlUploadPlugin.install) == null ? void 0 : _g.call(PlUploadPlugin, app);
|
|
38098
|
-
}
|
|
38189
|
+
},
|
|
38190
|
+
$apiJs: ApiJs
|
|
38099
38191
|
};
|
|
38100
38192
|
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 };
|