bkui-vue 0.0.1-beta.423 → 0.0.1-beta.425
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/dist/index.cjs.js +30 -30
- package/dist/index.esm.js +269 -12
- package/dist/index.umd.js +35 -35
- package/lib/date-picker/base/month-table.d.ts +117 -0
- package/lib/date-picker/base/year-table.d.ts +117 -0
- package/lib/date-picker/index.js +1 -1
- package/lib/input/index.d.ts +49 -49
- package/lib/input/input.d.ts +9 -9
- package/lib/loading/index.js +1 -1
- package/lib/table/index.d.ts +4 -4
- package/lib/table/table.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -9900,9 +9900,13 @@ const vBkloading = {
|
|
9900
9900
|
}
|
9901
9901
|
},
|
9902
9902
|
updated(el, binding) {
|
9903
|
+
var _a, _b, _c;
|
9903
9904
|
const instance = el[INSTANCE_KEY];
|
9904
9905
|
const { value } = binding;
|
9905
9906
|
updateOptions(value, instance.options);
|
9907
|
+
if ((_c = (_b = (_a = instance == null ? void 0 : instance.vm) == null ? void 0 : _a.$el) == null ? void 0 : _b.parentNode) == null ? void 0 : _c.style) {
|
9908
|
+
instance.vm.$el.parentNode.style.display = value.loading ? "" : "none";
|
9909
|
+
}
|
9906
9910
|
},
|
9907
9911
|
unmounted(el) {
|
9908
9912
|
var _a, _b, _c;
|
@@ -26332,6 +26336,228 @@ var DateTable = defineComponent({
|
|
26332
26336
|
}, [createVNode("em", null, [cell.desc])]))]);
|
26333
26337
|
}
|
26334
26338
|
});
|
26339
|
+
const monthTableProps = {
|
26340
|
+
tableDate: {
|
26341
|
+
type: Date,
|
26342
|
+
required: true
|
26343
|
+
},
|
26344
|
+
disabledDate: {
|
26345
|
+
type: Function
|
26346
|
+
},
|
26347
|
+
selectionMode: {
|
26348
|
+
type: String,
|
26349
|
+
required: true
|
26350
|
+
},
|
26351
|
+
modelValue: {
|
26352
|
+
type: [Date, String, Number, Array],
|
26353
|
+
required: true
|
26354
|
+
},
|
26355
|
+
rangeState: {
|
26356
|
+
type: Object,
|
26357
|
+
default: () => ({
|
26358
|
+
from: null,
|
26359
|
+
to: null,
|
26360
|
+
selecting: false
|
26361
|
+
})
|
26362
|
+
},
|
26363
|
+
focusedDate: {
|
26364
|
+
type: Date,
|
26365
|
+
required: true
|
26366
|
+
},
|
26367
|
+
cellClass: {
|
26368
|
+
type: Function,
|
26369
|
+
default: () => ""
|
26370
|
+
}
|
26371
|
+
};
|
26372
|
+
var MonthTable = defineComponent({
|
26373
|
+
name: "MonthTable",
|
26374
|
+
props: monthTableProps,
|
26375
|
+
emits: ["pick", "pick-click", "change-range"],
|
26376
|
+
setup(props2, {
|
26377
|
+
emit
|
26378
|
+
}) {
|
26379
|
+
const dates = computed(() => {
|
26380
|
+
const {
|
26381
|
+
selectionMode,
|
26382
|
+
modelValue,
|
26383
|
+
rangeState
|
26384
|
+
} = props2;
|
26385
|
+
const rangeSelecting = selectionMode === "range" && rangeState.selecting;
|
26386
|
+
return rangeSelecting ? [rangeState.from] : modelValue;
|
26387
|
+
});
|
26388
|
+
const cells = computed(() => {
|
26389
|
+
const cells2 = [];
|
26390
|
+
const cellTmpl = {
|
26391
|
+
text: "",
|
26392
|
+
selected: false,
|
26393
|
+
disabled: false
|
26394
|
+
};
|
26395
|
+
const tableYear = props2.tableDate.getFullYear();
|
26396
|
+
const selectedDays = dates.value.filter(Boolean).map((date) => clearHours(new Date(date.getFullYear(), date.getMonth(), 1)));
|
26397
|
+
const focusedDate = clearHours(new Date(props2.focusedDate.getFullYear(), props2.focusedDate.getMonth(), 1));
|
26398
|
+
for (let i2 = 0; i2 < 12; i2++) {
|
26399
|
+
const cell = JSON.parse(JSON.stringify(cellTmpl));
|
26400
|
+
cell.date = new Date(tableYear, i2, 1);
|
26401
|
+
cell.text = tCell(i2 + 1);
|
26402
|
+
const day = clearHours(cell.date);
|
26403
|
+
cell.disabled = typeof props2.disabledDate === "function" && props2.disabledDate(cell.date) && props2.selectionMode === "month";
|
26404
|
+
cell.selected = selectedDays.includes(day);
|
26405
|
+
cell.focused = day === focusedDate;
|
26406
|
+
cells2.push(cell);
|
26407
|
+
}
|
26408
|
+
return cells2;
|
26409
|
+
});
|
26410
|
+
const tCell = (nr) => String(nr).length > 1 ? nr : `0${nr}`;
|
26411
|
+
const getCellCls = (cell) => [resolveClassName("date-picker-cells-cell"), {
|
26412
|
+
[resolveClassName("date-picker-cells-cell-selected")]: cell.selected,
|
26413
|
+
[resolveClassName("date-picker-cells-cell-disabled")]: cell.disabled,
|
26414
|
+
[resolveClassName("date-picker-cells-cell-range")]: cell.range && !cell.start && !cell.end
|
26415
|
+
}];
|
26416
|
+
const handleClick = (cell) => {
|
26417
|
+
if (cell.disabled || cell.type === "weekLabel") {
|
26418
|
+
return;
|
26419
|
+
}
|
26420
|
+
const newDate = new Date(clearHours(cell.date));
|
26421
|
+
emit("pick", newDate);
|
26422
|
+
emit("pick-click");
|
26423
|
+
};
|
26424
|
+
const handleMouseMove = (cell) => {
|
26425
|
+
if (!props2.rangeState.selecting) {
|
26426
|
+
return;
|
26427
|
+
}
|
26428
|
+
if (cell.disabled) {
|
26429
|
+
return;
|
26430
|
+
}
|
26431
|
+
const newDate = cell.date;
|
26432
|
+
emit("change-range", newDate);
|
26433
|
+
};
|
26434
|
+
return {
|
26435
|
+
cells,
|
26436
|
+
getCellCls,
|
26437
|
+
handleClick,
|
26438
|
+
handleMouseMove
|
26439
|
+
};
|
26440
|
+
},
|
26441
|
+
render() {
|
26442
|
+
return createVNode("div", {
|
26443
|
+
"class": [resolveClassName("date-picker-cells"), resolveClassName("date-picker-cells-month")]
|
26444
|
+
}, [this.cells.map((cell) => createVNode("span", {
|
26445
|
+
"class": this.getCellCls(cell),
|
26446
|
+
"onClick": () => this.handleClick(cell),
|
26447
|
+
"onMouseenter": () => this.handleMouseMove(cell)
|
26448
|
+
}, [createVNode("em", null, [cell.text])]))]);
|
26449
|
+
}
|
26450
|
+
});
|
26451
|
+
const yearTableProps = {
|
26452
|
+
tableDate: {
|
26453
|
+
type: Date,
|
26454
|
+
required: true
|
26455
|
+
},
|
26456
|
+
disabledDate: {
|
26457
|
+
type: Function
|
26458
|
+
},
|
26459
|
+
selectionMode: {
|
26460
|
+
type: String,
|
26461
|
+
required: true
|
26462
|
+
},
|
26463
|
+
modelValue: {
|
26464
|
+
type: [Date, String, Number, Array],
|
26465
|
+
required: true
|
26466
|
+
},
|
26467
|
+
rangeState: {
|
26468
|
+
type: Object,
|
26469
|
+
default: () => ({
|
26470
|
+
from: null,
|
26471
|
+
to: null,
|
26472
|
+
selecting: false
|
26473
|
+
})
|
26474
|
+
},
|
26475
|
+
focusedDate: {
|
26476
|
+
type: Date,
|
26477
|
+
required: true
|
26478
|
+
},
|
26479
|
+
cellClass: {
|
26480
|
+
type: Function,
|
26481
|
+
default: () => ""
|
26482
|
+
}
|
26483
|
+
};
|
26484
|
+
var YearTable = defineComponent({
|
26485
|
+
name: "YearTable",
|
26486
|
+
props: yearTableProps,
|
26487
|
+
emits: ["pick", "pick-click", "change-range"],
|
26488
|
+
setup(props2, {
|
26489
|
+
emit
|
26490
|
+
}) {
|
26491
|
+
const dates = computed(() => {
|
26492
|
+
const {
|
26493
|
+
selectionMode,
|
26494
|
+
modelValue,
|
26495
|
+
rangeState
|
26496
|
+
} = props2;
|
26497
|
+
const rangeSelecting = selectionMode === "range" && rangeState.selecting;
|
26498
|
+
return rangeSelecting ? [rangeState.from] : modelValue;
|
26499
|
+
});
|
26500
|
+
const startYear = computed(() => Math.floor(props2.tableDate.getFullYear() / 10) * 10);
|
26501
|
+
const cells = computed(() => {
|
26502
|
+
const cells2 = [];
|
26503
|
+
const cellTmpl = {
|
26504
|
+
text: "",
|
26505
|
+
selected: false,
|
26506
|
+
disabled: false
|
26507
|
+
};
|
26508
|
+
const selectedDays = dates.value.filter(Boolean).map((date) => clearHours(new Date(date.getFullYear(), 0, 1)));
|
26509
|
+
const focusedDate = clearHours(new Date(props2.focusedDate.getFullYear(), 0, 1));
|
26510
|
+
for (let i2 = 0; i2 < 10; i2++) {
|
26511
|
+
const cell = JSON.parse(JSON.stringify(cellTmpl));
|
26512
|
+
cell.date = new Date(startYear.value + i2, 0, 1);
|
26513
|
+
cell.disabled = typeof props2.disabledDate === "function" && props2.disabledDate(cell.date) && props2.selectionMode === "year";
|
26514
|
+
const day = clearHours(cell.date);
|
26515
|
+
cell.selected = selectedDays.includes(day);
|
26516
|
+
cell.focused = day === focusedDate;
|
26517
|
+
cells2.push(cell);
|
26518
|
+
}
|
26519
|
+
return cells2;
|
26520
|
+
});
|
26521
|
+
const getCellCls = (cell) => [resolveClassName("date-picker-cells-cell"), {
|
26522
|
+
[resolveClassName("date-picker-cells-cell-selected")]: cell.selected,
|
26523
|
+
[resolveClassName("date-picker-cells-cell-disabled")]: cell.disabled,
|
26524
|
+
[resolveClassName("date-picker-cells-cell-range")]: cell.range && !cell.start && !cell.end
|
26525
|
+
}];
|
26526
|
+
const handleClick = (cell) => {
|
26527
|
+
if (cell.disabled || cell.type === "weekLabel") {
|
26528
|
+
return;
|
26529
|
+
}
|
26530
|
+
const newDate = new Date(clearHours(cell.date));
|
26531
|
+
emit("pick", newDate);
|
26532
|
+
emit("pick-click");
|
26533
|
+
};
|
26534
|
+
const handleMouseMove = (cell) => {
|
26535
|
+
if (!props2.rangeState.selecting) {
|
26536
|
+
return;
|
26537
|
+
}
|
26538
|
+
if (cell.disabled) {
|
26539
|
+
return;
|
26540
|
+
}
|
26541
|
+
const newDate = cell.date;
|
26542
|
+
emit("change-range", newDate);
|
26543
|
+
};
|
26544
|
+
return {
|
26545
|
+
cells,
|
26546
|
+
getCellCls,
|
26547
|
+
handleClick,
|
26548
|
+
handleMouseMove
|
26549
|
+
};
|
26550
|
+
},
|
26551
|
+
render() {
|
26552
|
+
return createVNode("div", {
|
26553
|
+
"class": [resolveClassName("date-picker-cells"), resolveClassName("date-picker-cells-year")]
|
26554
|
+
}, [this.cells.map((cell) => createVNode("span", {
|
26555
|
+
"class": this.getCellCls(cell),
|
26556
|
+
"onClick": () => this.handleClick(cell),
|
26557
|
+
"onMouseenter": () => this.handleMouseMove(cell)
|
26558
|
+
}, [createVNode("em", null, [cell.date.getFullYear()])]))]);
|
26559
|
+
}
|
26560
|
+
});
|
26335
26561
|
const datePickerProps = {
|
26336
26562
|
type: {
|
26337
26563
|
type: String,
|
@@ -27224,7 +27450,8 @@ var DatePanel = defineComponent({
|
|
27224
27450
|
}, [createVNode(angleDoubleLeft, {
|
27225
27451
|
"style": {
|
27226
27452
|
fontSize: "20px",
|
27227
|
-
lineHeight: 1
|
27453
|
+
lineHeight: 1,
|
27454
|
+
verticalAlign: "text-bottom"
|
27228
27455
|
}
|
27229
27456
|
}, null)]), this.pickerTable === "date-table" ? withDirectives(createVNode("span", {
|
27230
27457
|
"class": iconBtnCls("prev"),
|
@@ -27232,7 +27459,8 @@ var DatePanel = defineComponent({
|
|
27232
27459
|
}, [createVNode(angleLeft, {
|
27233
27460
|
"style": {
|
27234
27461
|
fontSize: "20px",
|
27235
|
-
lineHeight: 1
|
27462
|
+
lineHeight: 1,
|
27463
|
+
verticalAlign: "text-bottom"
|
27236
27464
|
}
|
27237
27465
|
}, null)]), [[vShow, this.currentView === "date"]]) : "", this.datePanelLabel && Object.keys(this.datePanelLabel).length > 0 ? createVNode("span", null, [withDirectives(createVNode("span", {
|
27238
27466
|
"class": resolveClassName("date-picker-header-label"),
|
@@ -27246,7 +27474,8 @@ var DatePanel = defineComponent({
|
|
27246
27474
|
}, [createVNode(angleDoubleRight, {
|
27247
27475
|
"style": {
|
27248
27476
|
fontSize: "20px",
|
27249
|
-
lineHeight: 1
|
27477
|
+
lineHeight: 1,
|
27478
|
+
verticalAlign: "text-bottom"
|
27250
27479
|
}
|
27251
27480
|
}, null)]), this.pickerTable === "date-table" ? withDirectives(createVNode("span", {
|
27252
27481
|
"class": iconBtnCls("next"),
|
@@ -27254,7 +27483,8 @@ var DatePanel = defineComponent({
|
|
27254
27483
|
}, [createVNode(angleRight, {
|
27255
27484
|
"style": {
|
27256
27485
|
fontSize: "20px",
|
27257
|
-
lineHeight: 1
|
27486
|
+
lineHeight: 1,
|
27487
|
+
verticalAlign: "text-bottom"
|
27258
27488
|
}
|
27259
27489
|
}, null)]), [[vShow, this.currentView === "date"]]) : ""]), [[vShow, this.currentView !== "time"]]), createVNode("div", {
|
27260
27490
|
"class": resolveClassName("picker-panel-content")
|
@@ -27269,6 +27499,24 @@ var DatePanel = defineComponent({
|
|
27269
27499
|
"focusedDate": this.focusedDate,
|
27270
27500
|
"onPick": this.panelPickerHandlers
|
27271
27501
|
}, null);
|
27502
|
+
case "year-table":
|
27503
|
+
return createVNode(YearTable, {
|
27504
|
+
"tableDate": this.panelDate,
|
27505
|
+
"disabledDate": this.disabledDate,
|
27506
|
+
"selectionMode": this.selectionMode,
|
27507
|
+
"modelValue": this.dates,
|
27508
|
+
"focusedDate": this.focusedDate,
|
27509
|
+
"onPick": this.panelPickerHandlers
|
27510
|
+
}, null);
|
27511
|
+
case "month-table":
|
27512
|
+
return createVNode(MonthTable, {
|
27513
|
+
"tableDate": this.panelDate,
|
27514
|
+
"disabledDate": this.disabledDate,
|
27515
|
+
"selectionMode": this.selectionMode,
|
27516
|
+
"modelValue": this.dates,
|
27517
|
+
"focusedDate": this.focusedDate,
|
27518
|
+
"onPick": this.panelPickerHandlers
|
27519
|
+
}, null);
|
27272
27520
|
default:
|
27273
27521
|
return null;
|
27274
27522
|
}
|
@@ -27851,7 +28099,8 @@ var DateRangePanel = defineComponent({
|
|
27851
28099
|
}, [createVNode(angleDoubleLeft, {
|
27852
28100
|
"style": {
|
27853
28101
|
fontSize: "20px",
|
27854
|
-
lineHeight: 1
|
28102
|
+
lineHeight: 1,
|
28103
|
+
verticalAlign: "text-bottom"
|
27855
28104
|
}
|
27856
28105
|
}, null)]), this.leftPickerTable === "date-table" ? withDirectives(createVNode("span", {
|
27857
28106
|
"class": iconBtnCls("prev"),
|
@@ -27859,7 +28108,8 @@ var DateRangePanel = defineComponent({
|
|
27859
28108
|
}, [createVNode(angleLeft, {
|
27860
28109
|
"style": {
|
27861
28110
|
fontSize: "20px",
|
27862
|
-
lineHeight: 1
|
28111
|
+
lineHeight: 1,
|
28112
|
+
verticalAlign: "text-bottom"
|
27863
28113
|
}
|
27864
28114
|
}, null)]), [[vShow, this.currentView === "date"]]) : "", this.leftDatePanelLabel && Object.keys(this.leftDatePanelLabel).length > 0 ? createVNode("span", null, [withDirectives(createVNode("span", {
|
27865
28115
|
"class": resolveClassName("date-picker-header-label"),
|
@@ -27873,7 +28123,8 @@ var DateRangePanel = defineComponent({
|
|
27873
28123
|
}, [createVNode(angleDoubleRight, {
|
27874
28124
|
"style": {
|
27875
28125
|
fontSize: "20px",
|
27876
|
-
lineHeight: 1
|
28126
|
+
lineHeight: 1,
|
28127
|
+
verticalAlign: "text-bottom"
|
27877
28128
|
}
|
27878
28129
|
}, null)]) : "", this.splitPanels || this.leftPickerTable === "date-table" ? withDirectives(createVNode("span", {
|
27879
28130
|
"class": iconBtnCls("next"),
|
@@ -27881,7 +28132,8 @@ var DateRangePanel = defineComponent({
|
|
27881
28132
|
}, [createVNode(angleRight, {
|
27882
28133
|
"style": {
|
27883
28134
|
fontSize: "20px",
|
27884
|
-
lineHeight: 1
|
28135
|
+
lineHeight: 1,
|
28136
|
+
verticalAlign: "text-bottom"
|
27885
28137
|
}
|
27886
28138
|
}, null)]), [[vShow, this.currentView === "date"]]) : ""]), [[vShow, this.currentView !== "time"]]), this.currentView !== "time" ? (() => {
|
27887
28139
|
switch (this.leftPickerTable) {
|
@@ -27910,7 +28162,8 @@ var DateRangePanel = defineComponent({
|
|
27910
28162
|
}, [createVNode(angleDoubleLeft, {
|
27911
28163
|
"style": {
|
27912
28164
|
fontSize: "20px",
|
27913
|
-
lineHeight: 1
|
28165
|
+
lineHeight: 1,
|
28166
|
+
verticalAlign: "text-bottom"
|
27914
28167
|
}
|
27915
28168
|
}, null)]) : "", this.splitPanels && this.rightPickerTable === "date-table" ? withDirectives(createVNode("span", {
|
27916
28169
|
"class": iconBtnCls("prev", "-double"),
|
@@ -27918,7 +28171,8 @@ var DateRangePanel = defineComponent({
|
|
27918
28171
|
}, [createVNode(angleLeft, {
|
27919
28172
|
"style": {
|
27920
28173
|
fontSize: "20px",
|
27921
|
-
lineHeight: 1
|
28174
|
+
lineHeight: 1,
|
28175
|
+
verticalAlign: "text-bottom"
|
27922
28176
|
}
|
27923
28177
|
}, null)]), [[vShow, this.currentView === "date"]]) : "", this.rightDatePanelLabel && Object.keys(this.rightDatePanelLabel).length > 0 ? createVNode("span", null, [withDirectives(createVNode("span", {
|
27924
28178
|
"class": resolveClassName("date-picker-header-label"),
|
@@ -27942,7 +28196,8 @@ var DateRangePanel = defineComponent({
|
|
27942
28196
|
}, [createVNode(angleDoubleRight, {
|
27943
28197
|
"style": {
|
27944
28198
|
fontSize: "20px",
|
27945
|
-
lineHeight: 1
|
28199
|
+
lineHeight: 1,
|
28200
|
+
verticalAlign: "text-bottom"
|
27946
28201
|
}
|
27947
28202
|
}, null)]), this.rightPickerTable === "date-table" ? withDirectives(createVNode("span", {
|
27948
28203
|
"class": iconBtnCls("next"),
|
@@ -27950,7 +28205,8 @@ var DateRangePanel = defineComponent({
|
|
27950
28205
|
}, [createVNode(angleRight, {
|
27951
28206
|
"style": {
|
27952
28207
|
fontSize: "20px",
|
27953
|
-
lineHeight: 1
|
28208
|
+
lineHeight: 1,
|
28209
|
+
verticalAlign: "text-bottom"
|
27954
28210
|
}
|
27955
28211
|
}, null)]), [[vShow, this.currentView === "date"]]) : ""]), [[vShow, this.currentView !== "time"]]), this.currentView !== "time" ? (() => {
|
27956
28212
|
switch (this.rightPickerTable) {
|
@@ -28034,6 +28290,7 @@ var Component$b = defineComponent({
|
|
28034
28290
|
shortcut,
|
28035
28291
|
onSelectionModeChange
|
28036
28292
|
});
|
28293
|
+
onSelectionModeChange(props2.type);
|
28037
28294
|
function onSelectionModeChange(_type) {
|
28038
28295
|
let type = _type;
|
28039
28296
|
if (_type.match(/^date/)) {
|