bkui-vue 0.0.1-beta.229 → 0.0.1-beta.230
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 +52 -52
- package/dist/index.esm.js +37 -301
- package/dist/index.umd.js +53 -53
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/date-picker/base/date-table.d.ts +4 -4
- package/lib/date-picker/date-picker.css +0 -5
- package/lib/date-picker/date-picker.d.ts +2 -2
- package/lib/date-picker/date-picker.less +0 -6
- package/lib/date-picker/date-picker.variable.css +0 -5
- package/lib/date-picker/index.d.ts +4 -4
- package/lib/date-picker/index.js +1 -1
- package/lib/date-picker/interface.d.ts +2 -3
- package/lib/date-picker/panel/date-range.d.ts +183 -39
- package/lib/date-picker/panel/date.d.ts +364 -20
- package/lib/date-picker/panel/time.d.ts +3 -1
- package/lib/date-picker/props.d.ts +2 -2
- package/lib/date-picker/time-picker.d.ts +2 -2
- package/lib/time-picker/index.d.ts +4 -4
- package/package.json +1 -1
- package/lib/date-picker/panel/time-range.d.ts +0 -489
package/dist/index.esm.js
CHANGED
@@ -21926,14 +21926,11 @@ var Confirm = defineComponent({
|
|
21926
21926
|
"class": "bk-picker-confirm",
|
21927
21927
|
"ref": "elRef",
|
21928
21928
|
"onKeydown": this.handleTab
|
21929
|
-
}, [this.showTime ? createVNode(
|
21930
|
-
"
|
21929
|
+
}, [this.showTime ? createVNode("a", {
|
21930
|
+
"href": "javascript: void(0);",
|
21931
21931
|
"class": "bk-picker-confirm-time",
|
21932
|
-
"disabled": this.timeDisabled,
|
21933
21932
|
"onClick": this.handleToggleTime
|
21934
|
-
}, {
|
21935
|
-
default: () => [this.labels.time]
|
21936
|
-
}) : "", this.clearable ? createVNode("a", {
|
21933
|
+
}, [this.labels.time]) : "", this.clearable ? createVNode("a", {
|
21937
21934
|
"href": "javascript: void(0);",
|
21938
21935
|
"onClick": this.handleClear,
|
21939
21936
|
"onKeydown": this.handleClear
|
@@ -24113,7 +24110,7 @@ const formatDate = (val, type, multiple, format2) => {
|
|
24113
24110
|
const datePickerKey = Symbol("date-picker");
|
24114
24111
|
const timePickerKey = Symbol("time-picker");
|
24115
24112
|
function findChildComponents(context, componentName) {
|
24116
|
-
return
|
24113
|
+
return context.$children.reduce((components2, child) => {
|
24117
24114
|
if (child.$options.name === componentName) {
|
24118
24115
|
components2.push(child);
|
24119
24116
|
}
|
@@ -24211,7 +24208,7 @@ const dateTableProps = {
|
|
24211
24208
|
type: Date,
|
24212
24209
|
required: true
|
24213
24210
|
},
|
24214
|
-
|
24211
|
+
disableDate: Function,
|
24215
24212
|
selectionMode: {
|
24216
24213
|
type: String,
|
24217
24214
|
required: true
|
@@ -24260,7 +24257,7 @@ var DateTable = defineComponent({
|
|
24260
24257
|
const rangeStart = props2.rangeState.from && clearHours(props2.rangeState.from);
|
24261
24258
|
const rangeEnd = props2.rangeState.to && clearHours(props2.rangeState.to);
|
24262
24259
|
const isRange = props2.selectionMode === "range";
|
24263
|
-
const disableTestFn = typeof props2.
|
24260
|
+
const disableTestFn = typeof props2.disableDate === "function" && props2.disableDate;
|
24264
24261
|
return calendar.value(tableYear, tableMonth, (cell) => {
|
24265
24262
|
if (cell.date instanceof Date) {
|
24266
24263
|
cell.date.setTime(cell.date.getTime() + cell.date.getTimezoneOffset() * 6e4);
|
@@ -24465,7 +24462,7 @@ const datePickerProps = {
|
|
24465
24462
|
return ["simplicity", "normal"].indexOf(v2) > -1;
|
24466
24463
|
}
|
24467
24464
|
},
|
24468
|
-
|
24465
|
+
disableDate: Function,
|
24469
24466
|
withValidate: {
|
24470
24467
|
type: Boolean,
|
24471
24468
|
default: true
|
@@ -24861,7 +24858,7 @@ const timeProps = {
|
|
24861
24858
|
}
|
24862
24859
|
};
|
24863
24860
|
var TimePanel = defineComponent({
|
24864
|
-
name: "
|
24861
|
+
name: "TimePickerPanel",
|
24865
24862
|
props: __spreadValues(__spreadValues(__spreadValues({}, datePickerProps), timePanelProps), timeProps),
|
24866
24863
|
emits: ["pick", "pick-click"],
|
24867
24864
|
setup(props2, {
|
@@ -25004,6 +25001,7 @@ const datePanelProps = {
|
|
25004
25001
|
startDate: {
|
25005
25002
|
type: Date
|
25006
25003
|
},
|
25004
|
+
disableDate: Function,
|
25007
25005
|
focusedDate: {
|
25008
25006
|
type: Date,
|
25009
25007
|
required: true
|
@@ -25023,10 +25021,6 @@ const datePanelProps = {
|
|
25023
25021
|
disabledDate: {
|
25024
25022
|
type: Function,
|
25025
25023
|
default: () => false
|
25026
|
-
},
|
25027
|
-
timePickerOptions: {
|
25028
|
-
type: Object,
|
25029
|
-
default: () => ({})
|
25030
25024
|
}
|
25031
25025
|
};
|
25032
25026
|
var DatePanel = defineComponent({
|
@@ -25056,6 +25050,7 @@ var DatePanel = defineComponent({
|
|
25056
25050
|
const timeSpinnerRef = ref(null);
|
25057
25051
|
const timeSpinnerEndRef = ref(null);
|
25058
25052
|
watch(() => state.currentView, (val) => {
|
25053
|
+
console.error(11111, val);
|
25059
25054
|
emit("selection-mode-change", val);
|
25060
25055
|
if (state.currentView === "time") {
|
25061
25056
|
nextTick(() => {
|
@@ -25068,11 +25063,6 @@ var DatePanel = defineComponent({
|
|
25068
25063
|
state.currentView = type;
|
25069
25064
|
state.pickerTable = getTableType(type);
|
25070
25065
|
});
|
25071
|
-
watch(() => props2.modelValue, (newVal) => {
|
25072
|
-
state.dates = newVal;
|
25073
|
-
const panelDate = props2.multiple ? state.dates[state.dates.length - 1] : props2.startDate || state.dates[0];
|
25074
|
-
state.panelDate = panelDate || new Date();
|
25075
|
-
});
|
25076
25066
|
const resetView = () => {
|
25077
25067
|
setTimeout(() => {
|
25078
25068
|
state.currentView = props2.selectionMode;
|
@@ -25253,7 +25243,7 @@ var DatePanel = defineComponent({
|
|
25253
25243
|
case "date-table":
|
25254
25244
|
return createVNode(DateTable, {
|
25255
25245
|
"tableDate": this.panelDate,
|
25256
|
-
"
|
25246
|
+
"disableDate": this.disableDate,
|
25257
25247
|
"selectionMode": this.selectionMode,
|
25258
25248
|
"modelValue": this.dates,
|
25259
25249
|
"focusedDate": this.focusedDate,
|
@@ -25268,14 +25258,11 @@ var DatePanel = defineComponent({
|
|
25268
25258
|
"format": this.format,
|
25269
25259
|
"disabledDate": this.disabledDate,
|
25270
25260
|
"onPick": this.handlePick,
|
25271
|
-
"onPick-click": this.handlePickClick,
|
25272
25261
|
"onPick-clear": this.handlePickClear,
|
25273
|
-
"onPick-success": this.handlePickSuccess
|
25274
|
-
"onPick-toggle-time": this.handleToggleTime
|
25262
|
+
"onPick-success": this.handlePickSuccess
|
25275
25263
|
}, null)]), this.confirm ? createVNode(Confirm, {
|
25276
25264
|
"clearable": this.clearable,
|
25277
25265
|
"showTime": this.showTime,
|
25278
|
-
"timeDisabled": this.timeDisabled,
|
25279
25266
|
"isTime": this.isTime,
|
25280
25267
|
"onPick-toggle-time": this.handleToggleTime,
|
25281
25268
|
"onPick-clear": this.handlePickClear,
|
@@ -25285,154 +25272,6 @@ var DatePanel = defineComponent({
|
|
25285
25272
|
}, [(_c = (_b = (_a = this.$slots).shortcuts) == null ? void 0 : _b.call(_a)) != null ? _c : null]) : null]);
|
25286
25273
|
}
|
25287
25274
|
});
|
25288
|
-
const timeRangeProps = {
|
25289
|
-
steps: {
|
25290
|
-
type: Array,
|
25291
|
-
default: () => []
|
25292
|
-
},
|
25293
|
-
format: {
|
25294
|
-
type: String,
|
25295
|
-
default: "HH:mm:ss"
|
25296
|
-
},
|
25297
|
-
value: {
|
25298
|
-
type: Array,
|
25299
|
-
required: true
|
25300
|
-
},
|
25301
|
-
allowCrossDay: {
|
25302
|
-
type: Boolean,
|
25303
|
-
default: false
|
25304
|
-
}
|
25305
|
-
};
|
25306
|
-
var TimeRangePanel = defineComponent({
|
25307
|
-
name: "TimeRangePanel",
|
25308
|
-
props: __spreadValues(__spreadValues(__spreadValues({}, datePickerProps), timePanelProps), timeRangeProps),
|
25309
|
-
emits: ["pick", "pick-click"],
|
25310
|
-
setup(props2, {
|
25311
|
-
emit
|
25312
|
-
}) {
|
25313
|
-
const [dateStart, dateEnd] = props2.value.slice();
|
25314
|
-
const state = reactive({
|
25315
|
-
showDate: false,
|
25316
|
-
dateStart: dateStart || initTime(),
|
25317
|
-
dateEnd: dateEnd || initTime()
|
25318
|
-
});
|
25319
|
-
const parentProvide = inject(timePickerKey);
|
25320
|
-
const showSeconds = computed(() => !(props2.format || "").match(/mm$/));
|
25321
|
-
const leftDatePanelLabel = computed(() => fecha.format(parentProvide.dates[0], props2.format));
|
25322
|
-
const rightDatePanelLabel = computed(() => fecha.format(parentProvide.dates[1], props2.format));
|
25323
|
-
watch(() => props2.value, (dates) => {
|
25324
|
-
const [dateStart2, dateEnd2] = dates.slice();
|
25325
|
-
state.dateStart = dateStart2 || initTime();
|
25326
|
-
state.dateEnd = dateEnd2 || initTime();
|
25327
|
-
});
|
25328
|
-
onMounted(() => {
|
25329
|
-
if (parentProvide && parentProvide.parentName === "DatePanel") {
|
25330
|
-
state.showDate = true;
|
25331
|
-
}
|
25332
|
-
});
|
25333
|
-
function handlePickClick() {
|
25334
|
-
emit("pick-click");
|
25335
|
-
}
|
25336
|
-
function handleChange(idx, start2, end2, isEmit = true) {
|
25337
|
-
let dateStart2 = new Date(state.dateStart);
|
25338
|
-
let dateEnd2 = new Date(state.dateEnd);
|
25339
|
-
Object.keys(start2).forEach((type) => {
|
25340
|
-
dateStart2[`set${capitalize(type)}`](start2[type]);
|
25341
|
-
});
|
25342
|
-
Object.keys(end2).forEach((type) => {
|
25343
|
-
dateEnd2[`set${capitalize(type)}`](end2[type]);
|
25344
|
-
});
|
25345
|
-
if (!props2.allowCrossDay && dateEnd2 < dateStart2) {
|
25346
|
-
if (idx === "start") {
|
25347
|
-
dateEnd2 = dateStart2;
|
25348
|
-
}
|
25349
|
-
if (idx === "end") {
|
25350
|
-
dateStart2 = dateEnd2;
|
25351
|
-
}
|
25352
|
-
}
|
25353
|
-
if (isEmit) {
|
25354
|
-
emit("pick", [dateStart2, dateEnd2], true, "time");
|
25355
|
-
}
|
25356
|
-
}
|
25357
|
-
function handleStartChange(date) {
|
25358
|
-
handleChange("start", date, {});
|
25359
|
-
}
|
25360
|
-
function handleEndChange(date) {
|
25361
|
-
handleChange("end", {}, date);
|
25362
|
-
}
|
25363
|
-
const timeSpinnerRef = ref(null);
|
25364
|
-
const timeSpinnerEndRef = ref(null);
|
25365
|
-
function updateScroll() {
|
25366
|
-
var _a, _b;
|
25367
|
-
(_a = timeSpinnerRef == null ? void 0 : timeSpinnerRef.value) == null ? void 0 : _a.updateScroll();
|
25368
|
-
(_b = timeSpinnerEndRef == null ? void 0 : timeSpinnerEndRef.value) == null ? void 0 : _b.updateScroll();
|
25369
|
-
}
|
25370
|
-
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
25371
|
-
showSeconds,
|
25372
|
-
leftDatePanelLabel,
|
25373
|
-
rightDatePanelLabel,
|
25374
|
-
handleStartChange,
|
25375
|
-
handleEndChange,
|
25376
|
-
handlePickClick,
|
25377
|
-
updateScroll,
|
25378
|
-
timeSpinnerRef,
|
25379
|
-
timeSpinnerEndRef
|
25380
|
-
});
|
25381
|
-
},
|
25382
|
-
render() {
|
25383
|
-
return createVNode("div", {
|
25384
|
-
"class": ["bk-picker-panel-body-wrapper", "bk-time-picker-with-range", this.showSeconds ? "bk-time-picker-with-seconds" : ""],
|
25385
|
-
"onMousedown": (e) => {
|
25386
|
-
e.preventDefault();
|
25387
|
-
}
|
25388
|
-
}, [createVNode("div", {
|
25389
|
-
"class": "bk-picker-panel-body",
|
25390
|
-
"style": {
|
25391
|
-
width: `${this.width * 2}px`
|
25392
|
-
}
|
25393
|
-
}, [createVNode("div", {
|
25394
|
-
"class": "bk-picker-panel-content bk-picker-panel-content-left",
|
25395
|
-
"style": {
|
25396
|
-
width: `${this.width}px`
|
25397
|
-
}
|
25398
|
-
}, [this.showDate ? createVNode("div", {
|
25399
|
-
"class": "bk-time-picker-header"
|
25400
|
-
}, [this.leftDatePanelLabel]) : "", createVNode(TimeSpinner, {
|
25401
|
-
"ref": "timeSpinnerRef",
|
25402
|
-
"steps": this.steps,
|
25403
|
-
"showSeconds": this.showSeconds,
|
25404
|
-
"hours": this.value[0] && this.dateStart.getHours(),
|
25405
|
-
"minutes": this.value[0] && this.dateStart.getMinutes(),
|
25406
|
-
"seconds": this.value[0] && this.dateStart.getSeconds(),
|
25407
|
-
"disabledHours": this.disabledHours,
|
25408
|
-
"disabledMinutes": this.disabledMinutes,
|
25409
|
-
"disabledSeconds": this.disabledSeconds,
|
25410
|
-
"hideDisabledOptions": this.hideDisabledOptions,
|
25411
|
-
"onChange": this.handleStartChange,
|
25412
|
-
"onPick-click": this.handlePickClick
|
25413
|
-
}, null)]), createVNode("div", {
|
25414
|
-
"class": "bk-picker-panel-content bk-picker-panel-content-right",
|
25415
|
-
"style": {
|
25416
|
-
width: `${this.width}px`
|
25417
|
-
}
|
25418
|
-
}, [this.showDate ? createVNode("div", {
|
25419
|
-
"class": "bk-time-picker-header"
|
25420
|
-
}, [this.rightDatePanelLabel]) : "", createVNode(TimeSpinner, {
|
25421
|
-
"ref": "timeSpinnerEndRef",
|
25422
|
-
"steps": this.steps,
|
25423
|
-
"showSeconds": this.showSeconds,
|
25424
|
-
"hours": this.value[1] && this.dateEnd.getHours(),
|
25425
|
-
"minutes": this.value[1] && this.dateEnd.getMinutes(),
|
25426
|
-
"seconds": this.value[1] && this.dateEnd.getSeconds(),
|
25427
|
-
"disabledHours": this.disabledHours,
|
25428
|
-
"disabledMinutes": this.disabledMinutes,
|
25429
|
-
"disabledSeconds": this.disabledSeconds,
|
25430
|
-
"hideDisabledOptions": this.hideDisabledOptions,
|
25431
|
-
"onChange": this.handleEndChange,
|
25432
|
-
"onPick-click": this.handlePickClick
|
25433
|
-
}, null)])])]);
|
25434
|
-
}
|
25435
|
-
});
|
25436
25275
|
const dateRangePanelProps = {
|
25437
25276
|
modelValue: {
|
25438
25277
|
type: [Date, String, Number, Array]
|
@@ -25487,7 +25326,7 @@ const dateRangePanelProps = {
|
|
25487
25326
|
type: Boolean,
|
25488
25327
|
default: false
|
25489
25328
|
},
|
25490
|
-
|
25329
|
+
disableDate: Function,
|
25491
25330
|
focusedDate: {
|
25492
25331
|
type: Date,
|
25493
25332
|
required: true
|
@@ -25495,20 +25334,12 @@ const dateRangePanelProps = {
|
|
25495
25334
|
confirm: {
|
25496
25335
|
type: Boolean,
|
25497
25336
|
default: false
|
25498
|
-
},
|
25499
|
-
format: {
|
25500
|
-
type: String,
|
25501
|
-
default: "yyyy-MM-dd"
|
25502
|
-
},
|
25503
|
-
timePickerOptions: {
|
25504
|
-
type: Object,
|
25505
|
-
default: () => ({})
|
25506
25337
|
}
|
25507
25338
|
};
|
25508
25339
|
var DateRangePanel = defineComponent({
|
25509
25340
|
name: "DateRangePanel",
|
25510
25341
|
props: dateRangePanelProps,
|
25511
|
-
emits: ["pick", "pick-success"
|
25342
|
+
emits: ["pick", "pick-success"],
|
25512
25343
|
setup(props2, {
|
25513
25344
|
slots,
|
25514
25345
|
emit
|
@@ -25529,13 +25360,6 @@ var DateRangePanel = defineComponent({
|
|
25529
25360
|
upToNowEnable: false,
|
25530
25361
|
dates: props2.modelValue
|
25531
25362
|
});
|
25532
|
-
const {
|
25533
|
-
proxy
|
25534
|
-
} = getCurrentInstance();
|
25535
|
-
provide(timePickerKey, {
|
25536
|
-
dates: state.dates,
|
25537
|
-
parentName: proxy.$options.name
|
25538
|
-
});
|
25539
25363
|
const dateSorter = (a2, b2) => {
|
25540
25364
|
if (!a2 || !b2) {
|
25541
25365
|
return 0;
|
@@ -25628,6 +25452,7 @@ var DateRangePanel = defineComponent({
|
|
25628
25452
|
emit("pick", state.dates, visible, type || props2.type);
|
25629
25453
|
};
|
25630
25454
|
const handleRangePick = (val, type) => {
|
25455
|
+
console.warn("handleRangePick");
|
25631
25456
|
if (state.rangeState.selecting || state.currentView === "time") {
|
25632
25457
|
if (state.currentView === "time") {
|
25633
25458
|
state.dates = val;
|
@@ -25686,26 +25511,9 @@ var DateRangePanel = defineComponent({
|
|
25686
25511
|
const handleChangeRange = (val) => {
|
25687
25512
|
state.rangeState.to = val;
|
25688
25513
|
};
|
25689
|
-
function setPanelDates(leftPanelDate2) {
|
25690
|
-
state.leftPanelDate = leftPanelDate2;
|
25691
|
-
const rightPanelDate = new Date(leftPanelDate2.getFullYear(), leftPanelDate2.getMonth() + 1, 1);
|
25692
|
-
const splitRightPanelDate = state.dates[1] ? state.dates[1].getTime() : state.dates[1];
|
25693
|
-
state.rightPanelDate = props2.splitPanels ? new Date(Math.max(splitRightPanelDate, rightPanelDate.getTime())) : rightPanelDate;
|
25694
|
-
}
|
25695
25514
|
watch(() => props2.selectionMode, (v2) => {
|
25696
25515
|
state.currentView = v2 || "range";
|
25697
25516
|
});
|
25698
|
-
watch(() => props2.modelValue, (newVal) => {
|
25699
|
-
const minDate2 = newVal[0] ? toDate(newVal[0]) : null;
|
25700
|
-
const maxDate2 = newVal[1] ? toDate(newVal[1]) : null;
|
25701
|
-
state.dates = [minDate2, maxDate2].sort(dateSorter);
|
25702
|
-
state.rangeState = {
|
25703
|
-
from: state.dates[0],
|
25704
|
-
to: state.dates[1],
|
25705
|
-
selecting: false
|
25706
|
-
};
|
25707
|
-
setPanelDates(props2.startDate || state.dates[0] || new Date());
|
25708
|
-
});
|
25709
25517
|
const isTime = computed(() => state.currentView === "time");
|
25710
25518
|
const leftDatePanelLabel = computed(() => panelLabelConfig("left"));
|
25711
25519
|
const rightDatePanelLabel = computed(() => panelLabelConfig("right"));
|
@@ -25730,26 +25538,6 @@ var DateRangePanel = defineComponent({
|
|
25730
25538
|
var _a;
|
25731
25539
|
return slots.shortcuts || ((_a = props2.shortcuts) == null ? void 0 : _a.length);
|
25732
25540
|
});
|
25733
|
-
const handleToggleTime = () => {
|
25734
|
-
state.currentView = state.currentView === "time" ? "date" : "time";
|
25735
|
-
};
|
25736
|
-
const resetView = () => {
|
25737
|
-
setTimeout(() => {
|
25738
|
-
state.currentView = props2.selectionMode;
|
25739
|
-
}, 500);
|
25740
|
-
};
|
25741
|
-
const handlePickSuccess = () => {
|
25742
|
-
resetView();
|
25743
|
-
emit("pick-success");
|
25744
|
-
};
|
25745
|
-
const handlePickClear = () => {
|
25746
|
-
resetView();
|
25747
|
-
emit("pick-clear");
|
25748
|
-
};
|
25749
|
-
function handlePickClick() {
|
25750
|
-
emit("pick-click");
|
25751
|
-
}
|
25752
|
-
const timeDisabled = computed(() => !(state.dates[0] && state.dates[1]));
|
25753
25541
|
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
25754
25542
|
isTime,
|
25755
25543
|
hasShortcuts,
|
@@ -25767,39 +25555,14 @@ var DateRangePanel = defineComponent({
|
|
25767
25555
|
rightShowLabelSecond,
|
25768
25556
|
preSelecting,
|
25769
25557
|
panelPickerHandlers,
|
25770
|
-
timeDisabled,
|
25771
25558
|
handleShortcutClick,
|
25772
25559
|
reset: reset2,
|
25773
25560
|
onToggleVisibility,
|
25774
25561
|
handleRangePick,
|
25775
|
-
handleChangeRange
|
25776
|
-
handleToggleTime,
|
25777
|
-
handlePickSuccess,
|
25778
|
-
handlePickClear,
|
25779
|
-
handlePickClick
|
25562
|
+
handleChangeRange
|
25780
25563
|
});
|
25781
25564
|
},
|
25782
25565
|
render() {
|
25783
|
-
let shortcuts = null;
|
25784
|
-
if (this.hasShortcuts) {
|
25785
|
-
let inner = "";
|
25786
|
-
if (this.$slots.shortcuts) {
|
25787
|
-
inner = typeof this.$slots.shortcuts === "function" ? this.$slots.shortcuts() : this.$slots.shortcuts;
|
25788
|
-
} else {
|
25789
|
-
if (this.shortcuts.length) {
|
25790
|
-
inner = createVNode("div", {
|
25791
|
-
"class": "bk-picker-panel-shortcuts"
|
25792
|
-
}, [this.shortcuts.map((item, index) => createVNode("div", {
|
25793
|
-
"key": index,
|
25794
|
-
"class": "shortcuts-item",
|
25795
|
-
"onClick": () => this.handleShortcutClick(item, index)
|
25796
|
-
}, [item.text]))]);
|
25797
|
-
}
|
25798
|
-
}
|
25799
|
-
shortcuts = createVNode("div", {
|
25800
|
-
"class": "bk-picker-panel-sidebar"
|
25801
|
-
}, [inner]);
|
25802
|
-
}
|
25803
25566
|
return createVNode("div", {
|
25804
25567
|
"class": ["bk-picker-panel-body-wrapper", "bk-date-picker-with-range", this.shortcuts.length || this.$slots.shortcuts ? "bk-picker-panel-with-sidebar" : ""],
|
25805
25568
|
"onMousedown": (e) => {
|
@@ -25856,7 +25619,7 @@ var DateRangePanel = defineComponent({
|
|
25856
25619
|
return createVNode(DateTable, {
|
25857
25620
|
"selectionMode": "range",
|
25858
25621
|
"tableDate": this.leftPanelDate,
|
25859
|
-
"
|
25622
|
+
"disableDate": this.disableDate,
|
25860
25623
|
"rangeState": this.rangeState,
|
25861
25624
|
"modelValue": this.preSelecting.left ? [this.dates[0]] : this.dates,
|
25862
25625
|
"focusedDate": this.focusedDate,
|
@@ -25925,7 +25688,7 @@ var DateRangePanel = defineComponent({
|
|
25925
25688
|
return createVNode(DateTable, {
|
25926
25689
|
"selectionMode": "range",
|
25927
25690
|
"tableDate": this.rightPanelDate,
|
25928
|
-
"
|
25691
|
+
"disableDate": this.disableDate,
|
25929
25692
|
"rangeState": this.rangeState,
|
25930
25693
|
"modelValue": this.preSelecting.right ? [this.dates[this.dates.length - 1]] : this.dates,
|
25931
25694
|
"focusedDate": this.focusedDate,
|
@@ -25935,25 +25698,15 @@ var DateRangePanel = defineComponent({
|
|
25935
25698
|
default:
|
25936
25699
|
return null;
|
25937
25700
|
}
|
25938
|
-
})() : ""]), [[vShow, !this.isTime]]), this.
|
25939
|
-
"
|
25940
|
-
|
25941
|
-
"
|
25942
|
-
|
25943
|
-
"
|
25944
|
-
"
|
25945
|
-
"
|
25946
|
-
|
25947
|
-
"onPick-toggle-time": this.handleToggleTime
|
25948
|
-
}, null) : "", this.confirm ? createVNode(Confirm, {
|
25949
|
-
"clearable": this.clearable,
|
25950
|
-
"showTime": this.showTime,
|
25951
|
-
"timeDisabled": this.timeDisabled,
|
25952
|
-
"isTime": this.isTime,
|
25953
|
-
"onPick-toggle-time": this.handleToggleTime,
|
25954
|
-
"onPick-clear": this.handlePickClear,
|
25955
|
-
"onPick-success": this.handlePickSuccess
|
25956
|
-
}, null) : ""]), shortcuts]);
|
25701
|
+
})() : ""]), [[vShow, !this.isTime]])]), this.hasShortcuts ? createVNode("div", {
|
25702
|
+
"class": "bk-picker-panel-sidebar"
|
25703
|
+
}, [this.$slots.shortcuts ? typeof this.$slots.shortcuts === "function" ? this.$slots.shortcuts() : this.$slots.shortcuts : this.shortcuts.length ? createVNode("div", {
|
25704
|
+
"class": "bk-picker-panel-shortcuts"
|
25705
|
+
}, [this.shortcuts.map((item, index) => createVNode("div", {
|
25706
|
+
"key": index,
|
25707
|
+
"class": "shortcuts-item",
|
25708
|
+
"onClick": () => this.handleShortcutClick(item, index)
|
25709
|
+
}, [item.text]))]) : ""]) : null]);
|
25957
25710
|
}
|
25958
25711
|
});
|
25959
25712
|
var Component$a = defineComponent({
|
@@ -26185,7 +25938,7 @@ var Component$a = defineComponent({
|
|
26185
25938
|
const newValue = e.target.value;
|
26186
25939
|
const newDate = parseDate(newValue, props2.type, props2.multiple, props2.format);
|
26187
25940
|
const valueToTest = isArrayValue ? newDate : newDate[0];
|
26188
|
-
const isDisabled = (_a = props2.
|
25941
|
+
const isDisabled = (_a = props2.disableDate) == null ? void 0 : _a.call(props2, valueToTest);
|
26189
25942
|
const isValidDate = newDate.reduce((valid, date) => valid && date instanceof Date, true);
|
26190
25943
|
if (newValue !== oldValue && !isDisabled && isValidDate) {
|
26191
25944
|
emitChange(props2.type);
|
@@ -26451,18 +26204,15 @@ var Component$a = defineComponent({
|
|
26451
26204
|
}, [(_c2 = (_b2 = (_a2 = this.$slots).header) == null ? void 0 : _b2.call(_a2)) != null ? _c2 : null]) : null, this.panel === "DateRangePanel" ? createVNode(DateRangePanel, {
|
26452
26205
|
"ref": "pickerPanelRef",
|
26453
26206
|
"type": this.type,
|
26454
|
-
"showTime": this.type === "datetime" || this.type === "datetimerange",
|
26455
26207
|
"confirm": this.isConfirm,
|
26456
26208
|
"shortcuts": this.shortcuts,
|
26457
26209
|
"shortcutClose": this.shortcutClose,
|
26458
26210
|
"modelValue": this.internalValue,
|
26459
26211
|
"selectionMode": this.selectionMode,
|
26460
26212
|
"startDate": this.startDate,
|
26461
|
-
"
|
26213
|
+
"disableDate": this.disableDate,
|
26462
26214
|
"focusedDate": this.focusedDate,
|
26463
|
-
"timePickerOptions": this.timePickerOptions,
|
26464
26215
|
"onPick": this.onPick,
|
26465
|
-
"onPick-clear": this.handleClear,
|
26466
26216
|
"onPick-success": this.onPickSuccess,
|
26467
26217
|
"onSelection-mode-change": this.onSelectionModeChange
|
26468
26218
|
}, shortcutsSlot) : createVNode(DatePanel, {
|
@@ -26476,9 +26226,8 @@ var Component$a = defineComponent({
|
|
26476
26226
|
"selectionMode": this.selectionMode,
|
26477
26227
|
"modelValue": this.internalValue,
|
26478
26228
|
"startDate": this.startDate,
|
26479
|
-
"
|
26229
|
+
"disableDate": this.disableDate,
|
26480
26230
|
"focusedDate": this.focusedDate,
|
26481
|
-
"timePickerOptions": this.timePickerOptions,
|
26482
26231
|
"onPick": this.onPick,
|
26483
26232
|
"onPick-clear": this.handleClear,
|
26484
26233
|
"onPick-success": this.onPickSuccess,
|
@@ -26728,7 +26477,7 @@ var TimePicker = defineComponent({
|
|
26728
26477
|
const newValue = e.target.value;
|
26729
26478
|
const newDate = parseDate(newValue, props2.type, props2.multiple, props2.format);
|
26730
26479
|
const valueToTest = isArrayValue ? newDate : newDate[0];
|
26731
|
-
const isDisabled = (_a = props2.
|
26480
|
+
const isDisabled = (_a = props2.disableDate) == null ? void 0 : _a.call(props2, valueToTest);
|
26732
26481
|
const isValidDate = newDate.reduce((valid, date) => valid && date instanceof Date, true);
|
26733
26482
|
if (newValue !== oldValue && !isDisabled && isValidDate) {
|
26734
26483
|
emitChange(props2.type);
|
@@ -26750,8 +26499,8 @@ var TimePicker = defineComponent({
|
|
26750
26499
|
}
|
26751
26500
|
};
|
26752
26501
|
const reset2 = () => {
|
26753
|
-
var _a
|
26754
|
-
(
|
26502
|
+
var _a;
|
26503
|
+
(_a = pickerPanelRef == null ? void 0 : pickerPanelRef.value) == null ? void 0 : _a.reset();
|
26755
26504
|
};
|
26756
26505
|
const handleBlur = (e) => {
|
26757
26506
|
var _a, _b;
|
@@ -26863,6 +26612,8 @@ var TimePicker = defineComponent({
|
|
26863
26612
|
emit("shortcut-change", state.shortcut, shortcutIndex);
|
26864
26613
|
};
|
26865
26614
|
const triggerRef = ref(null);
|
26615
|
+
console.error(panel);
|
26616
|
+
console.error(panel.value);
|
26866
26617
|
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
26867
26618
|
panel,
|
26868
26619
|
publicStringValue,
|
@@ -26996,22 +26747,7 @@ var TimePicker = defineComponent({
|
|
26996
26747
|
var _a2, _b2, _c2, _d, _e, _f;
|
26997
26748
|
return [this.hasHeader ? createVNode("div", {
|
26998
26749
|
"class": ["bk-date-picker-top-wrapper", this.headerSlotCls]
|
26999
|
-
}, [(_c2 = (_b2 = (_a2 = this.$slots).header) == null ? void 0 : _b2.call(_a2)) != null ? _c2 : null]) : null,
|
27000
|
-
"ref": "pickerPanelRef",
|
27001
|
-
"clearable": this.clearable,
|
27002
|
-
"shortcuts": this.shortcuts,
|
27003
|
-
"multiple": this.multiple,
|
27004
|
-
"shortcutClose": this.shortcutClose,
|
27005
|
-
"value": this.internalValue,
|
27006
|
-
"startDate": this.startDate,
|
27007
|
-
"disabledDate": this.disabledDate,
|
27008
|
-
"onPick": this.onPick,
|
27009
|
-
"onPick-clear": this.handleClear,
|
27010
|
-
"onPick-success": this.onPickSuccess,
|
27011
|
-
"disabledHours": this.ownPickerProps.disabledHours,
|
27012
|
-
"disabledMinutes": this.ownPickerProps.disabledMinutes,
|
27013
|
-
"disabledSeconds": this.ownPickerProps.disabledSeconds
|
27014
|
-
}, shortcutsSlot) : createVNode(TimePanel, {
|
26750
|
+
}, [(_c2 = (_b2 = (_a2 = this.$slots).header) == null ? void 0 : _b2.call(_a2)) != null ? _c2 : null]) : null, createVNode(TimePanel, {
|
27015
26751
|
"ref": "pickerPanelRef",
|
27016
26752
|
"clearable": this.clearable,
|
27017
26753
|
"confirm": this.isConfirm,
|
@@ -27020,7 +26756,7 @@ var TimePicker = defineComponent({
|
|
27020
26756
|
"shortcutClose": this.shortcutClose,
|
27021
26757
|
"value": this.internalValue,
|
27022
26758
|
"startDate": this.startDate,
|
27023
|
-
"
|
26759
|
+
"disableDate": this.disableDate,
|
27024
26760
|
"onPick": this.onPick,
|
27025
26761
|
"onPick-clear": this.handleClear,
|
27026
26762
|
"onPick-success": this.onPickSuccess,
|