bkui-vue 0.0.1-beta.217 → 0.0.1-beta.219
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 +40 -40
- package/dist/index.esm.js +445 -83
- package/dist/index.umd.js +54 -54
- 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 +5 -0
- package/lib/date-picker/date-picker.d.ts +2 -2
- package/lib/date-picker/date-picker.less +6 -0
- package/lib/date-picker/date-picker.variable.css +5 -0
- package/lib/date-picker/index.d.ts +4 -4
- package/lib/date-picker/index.js +1 -1
- package/lib/date-picker/interface.d.ts +3 -2
- package/lib/date-picker/panel/date-range.d.ts +39 -183
- package/lib/date-picker/panel/date.d.ts +20 -364
- package/lib/date-picker/panel/time-range.d.ts +489 -0
- package/lib/date-picker/panel/time.d.ts +1 -3
- package/lib/date-picker/props.d.ts +2 -2
- package/lib/date-picker/time-picker.d.ts +2 -2
- package/lib/menu/index.js +1 -1
- package/lib/select/index.js +1 -1
- package/lib/table/const.d.ts +2 -1
- package/lib/table/index.d.ts +16 -1
- package/lib/table/index.js +1 -1
- package/lib/table/plugins/head-filter.css +2 -3
- package/lib/table/plugins/head-filter.less +9 -10
- package/lib/table/plugins/head-filter.variable.css +2 -3
- package/lib/table/plugins/head-sort.css +6 -3
- package/lib/table/plugins/head-sort.less +6 -3
- package/lib/table/plugins/head-sort.variable.css +6 -3
- package/lib/table/props.d.ts +19 -0
- package/lib/table/table.css +8 -6
- package/lib/table/table.d.ts +7 -0
- package/lib/table/table.variable.css +8 -6
- package/lib/table/use-common.d.ts +1 -0
- package/lib/table/utils.d.ts +8 -0
- package/lib/table-column/index.js +1 -1
- package/lib/time-picker/index.d.ts +4 -4
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -15257,7 +15257,7 @@ var Component$j = defineComponent({
|
|
15257
15257
|
});
|
15258
15258
|
const filterList = computed(() => isRemoteSearch.value ? list.value : list.value.filter((item) => {
|
15259
15259
|
var _a;
|
15260
|
-
return (_a = toLowerCase(String(item[displayKey.value]))) == null ? void 0 : _a.includes(searchKey.value);
|
15260
|
+
return (_a = toLowerCase(String(item[displayKey.value]))) == null ? void 0 : _a.includes(toLowerCase(searchKey.value));
|
15261
15261
|
}));
|
15262
15262
|
const isDisabled = computed(() => disabled.value || loading2.value);
|
15263
15263
|
const selectedLabel = computed(() => selected.value.map((item) => {
|
@@ -16266,9 +16266,10 @@ var SORT_OPTION = /* @__PURE__ */ ((SORT_OPTION2) => {
|
|
16266
16266
|
SORT_OPTION2["ASC"] = "asc";
|
16267
16267
|
SORT_OPTION2["DESC"] = "desc";
|
16268
16268
|
SORT_OPTION2["NULL"] = "null";
|
16269
|
+
SORT_OPTION2["CUSTOM"] = "custom";
|
16269
16270
|
return SORT_OPTION2;
|
16270
16271
|
})(SORT_OPTION || {});
|
16271
|
-
const SORT_OPTIONS = ["asc", "desc", "null"];
|
16272
|
+
const SORT_OPTIONS = ["asc", "desc", "null", "custom"];
|
16272
16273
|
var SortScope = /* @__PURE__ */ ((SortScope2) => {
|
16273
16274
|
SortScope2["CURRENT"] = "current";
|
16274
16275
|
SortScope2["ALL"] = "all";
|
@@ -16284,7 +16285,8 @@ const IColumnType = {
|
|
16284
16285
|
showOverflowTooltip: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
|
16285
16286
|
content: PropTypes.string.def(""),
|
16286
16287
|
disabled: PropTypes.bool.def(false),
|
16287
|
-
watchCellResize: PropTypes.bool.def(true)
|
16288
|
+
watchCellResize: PropTypes.bool.def(true),
|
16289
|
+
mode: PropTypes.commonType(["static", "auto"], "showOverflowTooltipMode").def("auto")
|
16288
16290
|
})]).def(void 0),
|
16289
16291
|
type: PropTypes.commonType(["selection", "index", "expand", "none"], "columnType").def("none"),
|
16290
16292
|
resizable: PropTypes.bool.def(true),
|
@@ -16370,11 +16372,16 @@ const tableProps = {
|
|
16370
16372
|
showOverflowTooltip: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
|
16371
16373
|
content: PropTypes.string.def(""),
|
16372
16374
|
disabled: PropTypes.bool.def(false),
|
16373
|
-
watchCellResize: PropTypes.bool.def(true)
|
16375
|
+
watchCellResize: PropTypes.bool.def(true),
|
16376
|
+
mode: PropTypes.commonType(["static", "auto"], "showOverflowTooltipMode").def("auto")
|
16374
16377
|
})]).def(false),
|
16375
16378
|
asyncData: PropTypes.bool.def(false),
|
16376
16379
|
rowHover: PropTypes.oneOf(ROW_HOVER_OPTIONS).def(ROW_HOVER.HIGHLIGHT),
|
16377
|
-
defaultSort: PropTypes.shape({}).def({})
|
16380
|
+
defaultSort: PropTypes.shape({}).def({}),
|
16381
|
+
isRowSelectEnable: PropTypes.oneOfType([
|
16382
|
+
PropTypes.func.def(() => true),
|
16383
|
+
PropTypes.bool.def(true)
|
16384
|
+
]).def(true)
|
16378
16385
|
};
|
16379
16386
|
var Column = defineComponent({
|
16380
16387
|
name: "TableColumn",
|
@@ -17204,6 +17211,70 @@ const resolveCellSpan = (column, colIndex, row, rowIndex) => {
|
|
17204
17211
|
rowspan
|
17205
17212
|
};
|
17206
17213
|
};
|
17214
|
+
const getSortFn = (column, sortType) => {
|
17215
|
+
var _a, _b;
|
17216
|
+
const fieldName = column.field;
|
17217
|
+
const getVal = (row) => getRowText(row, fieldName, column);
|
17218
|
+
const sortFn0 = (a2, b2) => {
|
17219
|
+
const val0 = getVal(a2);
|
17220
|
+
const val1 = getVal(b2);
|
17221
|
+
if (typeof val0 === "number" && typeof val1 === "number") {
|
17222
|
+
return val0 - val1;
|
17223
|
+
}
|
17224
|
+
return String.prototype.localeCompare.call(val0, val1);
|
17225
|
+
};
|
17226
|
+
const sortFn = typeof ((_a = column.sort) == null ? void 0 : _a.sortFn) === "function" ? (_b = column.sort) == null ? void 0 : _b.sortFn : sortFn0;
|
17227
|
+
return sortType === SORT_OPTION.NULL ? () => true : (_a2, _b2) => sortFn(_a2, _b2) * (sortType === SORT_OPTION.DESC ? -1 : 1);
|
17228
|
+
};
|
17229
|
+
const getNextSortType = (sortType) => {
|
17230
|
+
const steps2 = {
|
17231
|
+
[SORT_OPTION.NULL]: 0,
|
17232
|
+
[SORT_OPTION.ASC]: 1,
|
17233
|
+
[SORT_OPTION.DESC]: 2
|
17234
|
+
};
|
17235
|
+
if (sortType === void 0) {
|
17236
|
+
return SORT_OPTION.NULL;
|
17237
|
+
}
|
17238
|
+
return Object.keys(steps2)[(steps2[sortType] + 1) % 3];
|
17239
|
+
};
|
17240
|
+
const resolveSort = (sort) => {
|
17241
|
+
if (typeof sort === "string") {
|
17242
|
+
return {
|
17243
|
+
value: sort
|
17244
|
+
};
|
17245
|
+
}
|
17246
|
+
if (typeof sort === "boolean" && sort) {
|
17247
|
+
return {
|
17248
|
+
value: SORT_OPTION.ASC
|
17249
|
+
};
|
17250
|
+
}
|
17251
|
+
if (typeof sort === "object" && sort !== null) {
|
17252
|
+
if (typeof sort.sortFn) {
|
17253
|
+
return __spreadValues({
|
17254
|
+
value: "custom"
|
17255
|
+
}, sort);
|
17256
|
+
}
|
17257
|
+
return sort;
|
17258
|
+
}
|
17259
|
+
return null;
|
17260
|
+
};
|
17261
|
+
const isRowSelectEnable = (props2, {
|
17262
|
+
row,
|
17263
|
+
index,
|
17264
|
+
isCheckAll
|
17265
|
+
}) => {
|
17266
|
+
if (typeof props2.isRowSelectEnable === "boolean") {
|
17267
|
+
return props2.isRowSelectEnable;
|
17268
|
+
}
|
17269
|
+
if (typeof props2.isRowSelectEnable === "function") {
|
17270
|
+
return props2.isRowSelectEnable({
|
17271
|
+
row,
|
17272
|
+
index,
|
17273
|
+
isCheckAll
|
17274
|
+
});
|
17275
|
+
}
|
17276
|
+
return true;
|
17277
|
+
};
|
17207
17278
|
var TableCell = defineComponent({
|
17208
17279
|
name: "TableCell",
|
17209
17280
|
props: {
|
@@ -17236,6 +17307,7 @@ var TableCell = defineComponent({
|
|
17236
17307
|
const resolveTooltipOption = () => {
|
17237
17308
|
let disabled = true;
|
17238
17309
|
let content = refRoot.value.innerText;
|
17310
|
+
let mode = "auto";
|
17239
17311
|
if (typeof showOverflowTooltip === "boolean") {
|
17240
17312
|
disabled = !showOverflowTooltip;
|
17241
17313
|
}
|
@@ -17245,10 +17317,12 @@ var TableCell = defineComponent({
|
|
17245
17317
|
content = showOverflowTooltip.content(props2.column, props2.row);
|
17246
17318
|
}
|
17247
17319
|
content = showOverflowTooltip.content || refRoot.value.innerText;
|
17320
|
+
mode = showOverflowTooltip.mode || "auto";
|
17248
17321
|
}
|
17249
17322
|
return {
|
17250
17323
|
disabled,
|
17251
|
-
content
|
17324
|
+
content,
|
17325
|
+
mode
|
17252
17326
|
};
|
17253
17327
|
};
|
17254
17328
|
const resolveOverflowTooltip = () => {
|
@@ -17256,14 +17330,20 @@ var TableCell = defineComponent({
|
|
17256
17330
|
return;
|
17257
17331
|
}
|
17258
17332
|
const {
|
17259
|
-
content
|
17333
|
+
content,
|
17334
|
+
mode
|
17260
17335
|
} = resolveTooltipOption();
|
17261
|
-
|
17262
|
-
|
17263
|
-
|
17264
|
-
|
17265
|
-
|
17266
|
-
|
17336
|
+
if (mode === "auto") {
|
17337
|
+
const textWidth = getElementTextWidth(refRoot.value, content);
|
17338
|
+
const cellWidth = refRoot.value.clientWidth;
|
17339
|
+
const computedStyle = window.getComputedStyle(refRoot.value);
|
17340
|
+
const paddingWidth = ["padding-left", "padding-right"].reduce((width, prop) => width + Number(computedStyle.getPropertyValue(prop).replace("px", "")), 0);
|
17341
|
+
const cellInnerWidth = cellWidth - paddingWidth;
|
17342
|
+
isTipsEnabled.value = textWidth > cellInnerWidth;
|
17343
|
+
}
|
17344
|
+
if (mode === "static") {
|
17345
|
+
isTipsEnabled.value = true;
|
17346
|
+
}
|
17267
17347
|
if (isTipsEnabled.value) {
|
17268
17348
|
const bindings = ref(resolveTooltipOption());
|
17269
17349
|
if (bkEllipsisIns === null) {
|
@@ -17499,36 +17579,28 @@ var HeadSort = defineComponent({
|
|
17499
17579
|
var _a, _b;
|
17500
17580
|
const defSort = ((_b = (_a = props2.column) == null ? void 0 : _a.sort) == null ? void 0 : _b.value) || props2.defaultSort || SORT_OPTION.NULL;
|
17501
17581
|
const sortType = ref(defSort);
|
17582
|
+
watch(() => [props2.defaultSort], ([val]) => {
|
17583
|
+
sortType.value = val;
|
17584
|
+
});
|
17502
17585
|
const handleSortClick = (e, type) => {
|
17503
|
-
var _a2, _b2;
|
17504
17586
|
e.stopImmediatePropagation();
|
17505
17587
|
e.stopPropagation();
|
17506
17588
|
e.preventDefault();
|
17507
|
-
|
17508
|
-
|
17509
|
-
|
17510
|
-
sortType.value = type;
|
17589
|
+
let currentSort = type;
|
17590
|
+
if (type === SORT_OPTION.NULL) {
|
17591
|
+
currentSort = getNextSortType(type);
|
17511
17592
|
}
|
17512
|
-
|
17513
|
-
|
17593
|
+
const sort = resolveSort(props2.column.sort);
|
17594
|
+
if ((sort == null ? void 0 : sort.value) === "custom") {
|
17595
|
+
emit("change", null, currentSort);
|
17514
17596
|
return;
|
17515
17597
|
}
|
17516
|
-
const
|
17517
|
-
|
17518
|
-
const sortFn0 = (a2, b2) => {
|
17519
|
-
const val0 = getVal(a2);
|
17520
|
-
const val1 = getVal(b2);
|
17521
|
-
if (typeof val0 === "number" && typeof val1 === "number") {
|
17522
|
-
return val0 - val1;
|
17523
|
-
}
|
17524
|
-
return String.prototype.localeCompare.call(val0, val1);
|
17525
|
-
};
|
17526
|
-
const sortFn = typeof ((_a2 = props2.column.sort) == null ? void 0 : _a2.sortFn) === "function" ? (_b2 = props2.column.sort) == null ? void 0 : _b2.sortFn : sortFn0;
|
17527
|
-
const execFn = sortType.value === SORT_OPTION.NULL ? () => true : (_a3, _b3) => sortFn(_a3, _b3) * (type === SORT_OPTION.DESC ? -1 : 1);
|
17528
|
-
emit("change", execFn, type);
|
17598
|
+
const execFn = getSortFn(props2.column, currentSort);
|
17599
|
+
emit("change", execFn, currentSort);
|
17529
17600
|
};
|
17530
17601
|
return () => createVNode("span", {
|
17531
|
-
"class": resolveClassName("head-cell-sort")
|
17602
|
+
"class": resolveClassName("head-cell-sort"),
|
17603
|
+
"onClick": (e) => handleSortClick(e, SORT_OPTION.NULL)
|
17532
17604
|
}, [createVNode(angleDownFill, {
|
17533
17605
|
"class": ["sort-action", "sort-asc", sortType.value === SORT_OPTION.ASC ? "active" : ""],
|
17534
17606
|
"onClick": (e) => handleSortClick(e, SORT_OPTION.ASC)
|
@@ -17984,14 +18056,32 @@ class TableRender {
|
|
17984
18056
|
});
|
17985
18057
|
}
|
17986
18058
|
}
|
17987
|
-
handleColumnHeadClick(index) {
|
18059
|
+
handleColumnHeadClick(index, column) {
|
17988
18060
|
if (this.props.columnPick !== "disabled") {
|
17989
18061
|
this.setColumnActive(index, this.props.columnPick === "single");
|
17990
18062
|
this.context.emit(EMIT_EVENTS.COLUMN_PICK, this.propActiveCols);
|
17991
18063
|
}
|
18064
|
+
if (column.sort && !column.filter) {
|
18065
|
+
const columnName = resolvePropVal(column, ["field", "type"], [column, index]);
|
18066
|
+
const nextSort = getNextSortType(this.reactiveProp.defaultSort[columnName]);
|
18067
|
+
Object.assign(this.reactiveProp.defaultSort, {
|
18068
|
+
[columnName]: nextSort
|
18069
|
+
});
|
18070
|
+
const sortFn = getSortFn(column, nextSort);
|
18071
|
+
this.emitEvent(EVENTS$1.ON_SORT_BY_CLICK, [{
|
18072
|
+
sortFn,
|
18073
|
+
column,
|
18074
|
+
index,
|
18075
|
+
nextSort
|
18076
|
+
}]);
|
18077
|
+
}
|
17992
18078
|
}
|
17993
18079
|
getSortCell(column, index) {
|
18080
|
+
const columnName = resolvePropVal(column, ["field", "type"], [column, index]);
|
17994
18081
|
const handleSortClick = (sortFn, type) => {
|
18082
|
+
Object.assign(this.reactiveProp.defaultSort, {
|
18083
|
+
[columnName]: type
|
18084
|
+
});
|
17995
18085
|
this.emitEvent(EVENTS$1.ON_SORT_BY_CLICK, [{
|
17996
18086
|
sortFn,
|
17997
18087
|
column,
|
@@ -17999,16 +18089,10 @@ class TableRender {
|
|
17999
18089
|
type
|
18000
18090
|
}]);
|
18001
18091
|
};
|
18002
|
-
|
18003
|
-
if (typeof this.props.defaultSort === "object" && this.props.defaultSort !== null) {
|
18004
|
-
const columnName = resolvePropVal(column, ["field", "type"], [column, index]);
|
18005
|
-
if (Object.prototype.hasOwnProperty.call(this.props.defaultSort, columnName)) {
|
18006
|
-
defaultSort = this.props.defaultSort[columnName];
|
18007
|
-
}
|
18008
|
-
}
|
18092
|
+
const nextSort = this.reactiveProp.defaultSort[columnName];
|
18009
18093
|
return createVNode(HeadSort, {
|
18010
18094
|
"column": column,
|
18011
|
-
"defaultSort":
|
18095
|
+
"defaultSort": nextSort,
|
18012
18096
|
"onChange": handleSortClick
|
18013
18097
|
}, null);
|
18014
18098
|
}
|
@@ -18085,7 +18169,7 @@ class TableRender {
|
|
18085
18169
|
"rowspan": 1,
|
18086
18170
|
"class": this.getHeadColumnClass(column, index),
|
18087
18171
|
"style": resolveFixedColumnStyle(column),
|
18088
|
-
"onClick": () => this.handleColumnHeadClick(index)
|
18172
|
+
"onClick": () => this.handleColumnHeadClick(index, column)
|
18089
18173
|
}, resolveEventListener(column)), [createVNode(TableCell, null, _isSlot$1(_slot = renderHeadCell(column, index)) ? _slot : {
|
18090
18174
|
default: () => [_slot]
|
18091
18175
|
})]);
|
@@ -18220,8 +18304,14 @@ class TableRender {
|
|
18220
18304
|
}]);
|
18221
18305
|
};
|
18222
18306
|
const indeterminate = isAll && !!this.reactiveProp.rowActions.get(TABLE_ROW_ATTRIBUTE.ROW_SELECTION_INDETERMINATE);
|
18307
|
+
const isEnable = isRowSelectEnable(this.props, {
|
18308
|
+
row,
|
18309
|
+
index,
|
18310
|
+
isCheckAll: isAll
|
18311
|
+
});
|
18223
18312
|
return createVNode(BkCheckbox, {
|
18224
18313
|
"onChange": handleChecked,
|
18314
|
+
"disabled": !isEnable,
|
18225
18315
|
"modelValue": row[TABLE_ROW_ATTRIBUTE.ROW_SELECTION],
|
18226
18316
|
"indeterminate": indeterminate
|
18227
18317
|
}, null);
|
@@ -18625,6 +18715,14 @@ const useInit = (props2, targetColumns) => {
|
|
18625
18715
|
resetResizeEvents();
|
18626
18716
|
registerResizeEvent();
|
18627
18717
|
}, { immediate: true, deep: true });
|
18718
|
+
const defSort = props2.columns.reduce((out, col, index) => {
|
18719
|
+
const columnName = resolvePropVal(col, ["field", "type"], [col, index]);
|
18720
|
+
const sort = resolveSort(col.sort);
|
18721
|
+
if (sort) {
|
18722
|
+
return __spreadProps(__spreadValues({}, out || {}), { [columnName]: sort == null ? void 0 : sort.value });
|
18723
|
+
}
|
18724
|
+
return out;
|
18725
|
+
}, null);
|
18628
18726
|
const reactiveSchema = reactive({
|
18629
18727
|
rowActions: /* @__PURE__ */ new Map(),
|
18630
18728
|
scrollTranslateY: 0,
|
@@ -18637,7 +18735,8 @@ const useInit = (props2, targetColumns) => {
|
|
18637
18735
|
setting: {
|
18638
18736
|
size: (_a = props2.settings) == null ? void 0 : _a.size,
|
18639
18737
|
height: SETTING_SIZE[(_b = props2.settings) == null ? void 0 : _b.size]
|
18640
|
-
}
|
18738
|
+
},
|
18739
|
+
defaultSort: defSort || props2.defaultSort
|
18641
18740
|
});
|
18642
18741
|
const isRowExpand = (rowId) => {
|
18643
18742
|
var _a2;
|
@@ -21100,7 +21199,6 @@ var Component$c = defineComponent({
|
|
21100
21199
|
});
|
21101
21200
|
watch(() => props2.collapse, () => {
|
21102
21201
|
collapse2.value = props2.collapse;
|
21103
|
-
console.info(props2.collapse);
|
21104
21202
|
const oldKeys = [...oldOpenKeys.value];
|
21105
21203
|
const openKeys = [...openedKeys.value];
|
21106
21204
|
openedKeys.value = collapse2.value ? [] : oldKeys;
|
@@ -21717,11 +21815,14 @@ var Confirm = defineComponent({
|
|
21717
21815
|
"class": "bk-picker-confirm",
|
21718
21816
|
"ref": "elRef",
|
21719
21817
|
"onKeydown": this.handleTab
|
21720
|
-
}, [this.showTime ? createVNode(
|
21721
|
-
"
|
21818
|
+
}, [this.showTime ? createVNode(BkButton, {
|
21819
|
+
"text": true,
|
21722
21820
|
"class": "bk-picker-confirm-time",
|
21821
|
+
"disabled": this.timeDisabled,
|
21723
21822
|
"onClick": this.handleToggleTime
|
21724
|
-
},
|
21823
|
+
}, {
|
21824
|
+
default: () => [this.labels.time]
|
21825
|
+
}) : "", this.clearable ? createVNode("a", {
|
21725
21826
|
"href": "javascript: void(0);",
|
21726
21827
|
"onClick": this.handleClear,
|
21727
21828
|
"onKeydown": this.handleClear
|
@@ -23901,7 +24002,7 @@ const formatDate = (val, type, multiple, format2) => {
|
|
23901
24002
|
const datePickerKey = Symbol("date-picker");
|
23902
24003
|
const timePickerKey = Symbol("time-picker");
|
23903
24004
|
function findChildComponents(context, componentName) {
|
23904
|
-
return context.$children.reduce((components2, child) => {
|
24005
|
+
return (context.$children || []).reduce((components2, child) => {
|
23905
24006
|
if (child.$options.name === componentName) {
|
23906
24007
|
components2.push(child);
|
23907
24008
|
}
|
@@ -23999,7 +24100,7 @@ const dateTableProps = {
|
|
23999
24100
|
type: Date,
|
24000
24101
|
required: true
|
24001
24102
|
},
|
24002
|
-
|
24103
|
+
disabledDate: Function,
|
24003
24104
|
selectionMode: {
|
24004
24105
|
type: String,
|
24005
24106
|
required: true
|
@@ -24048,7 +24149,7 @@ var DateTable = defineComponent({
|
|
24048
24149
|
const rangeStart = props2.rangeState.from && clearHours(props2.rangeState.from);
|
24049
24150
|
const rangeEnd = props2.rangeState.to && clearHours(props2.rangeState.to);
|
24050
24151
|
const isRange = props2.selectionMode === "range";
|
24051
|
-
const disableTestFn = typeof props2.
|
24152
|
+
const disableTestFn = typeof props2.disabledDate === "function" && props2.disabledDate;
|
24052
24153
|
return calendar.value(tableYear, tableMonth, (cell) => {
|
24053
24154
|
if (cell.date instanceof Date) {
|
24054
24155
|
cell.date.setTime(cell.date.getTime() + cell.date.getTimezoneOffset() * 6e4);
|
@@ -24253,7 +24354,7 @@ const datePickerProps = {
|
|
24253
24354
|
return ["simplicity", "normal"].indexOf(v2) > -1;
|
24254
24355
|
}
|
24255
24356
|
},
|
24256
|
-
|
24357
|
+
disabledDate: Function,
|
24257
24358
|
withValidate: {
|
24258
24359
|
type: Boolean,
|
24259
24360
|
default: true
|
@@ -24649,7 +24750,7 @@ const timeProps = {
|
|
24649
24750
|
}
|
24650
24751
|
};
|
24651
24752
|
var TimePanel = defineComponent({
|
24652
|
-
name: "
|
24753
|
+
name: "TimePanel",
|
24653
24754
|
props: __spreadValues(__spreadValues(__spreadValues({}, datePickerProps), timePanelProps), timeProps),
|
24654
24755
|
emits: ["pick", "pick-click"],
|
24655
24756
|
setup(props2, {
|
@@ -24792,7 +24893,6 @@ const datePanelProps = {
|
|
24792
24893
|
startDate: {
|
24793
24894
|
type: Date
|
24794
24895
|
},
|
24795
|
-
disableDate: Function,
|
24796
24896
|
focusedDate: {
|
24797
24897
|
type: Date,
|
24798
24898
|
required: true
|
@@ -24812,6 +24912,10 @@ const datePanelProps = {
|
|
24812
24912
|
disabledDate: {
|
24813
24913
|
type: Function,
|
24814
24914
|
default: () => false
|
24915
|
+
},
|
24916
|
+
timePickerOptions: {
|
24917
|
+
type: Object,
|
24918
|
+
default: () => ({})
|
24815
24919
|
}
|
24816
24920
|
};
|
24817
24921
|
var DatePanel = defineComponent({
|
@@ -24841,7 +24945,6 @@ var DatePanel = defineComponent({
|
|
24841
24945
|
const timeSpinnerRef = ref(null);
|
24842
24946
|
const timeSpinnerEndRef = ref(null);
|
24843
24947
|
watch(() => state.currentView, (val) => {
|
24844
|
-
console.error(11111, val);
|
24845
24948
|
emit("selection-mode-change", val);
|
24846
24949
|
if (state.currentView === "time") {
|
24847
24950
|
nextTick(() => {
|
@@ -24854,6 +24957,11 @@ var DatePanel = defineComponent({
|
|
24854
24957
|
state.currentView = type;
|
24855
24958
|
state.pickerTable = getTableType(type);
|
24856
24959
|
});
|
24960
|
+
watch(() => props2.modelValue, (newVal) => {
|
24961
|
+
state.dates = newVal;
|
24962
|
+
const panelDate = props2.multiple ? state.dates[state.dates.length - 1] : props2.startDate || state.dates[0];
|
24963
|
+
state.panelDate = panelDate || new Date();
|
24964
|
+
});
|
24857
24965
|
const resetView = () => {
|
24858
24966
|
setTimeout(() => {
|
24859
24967
|
state.currentView = props2.selectionMode;
|
@@ -25034,7 +25142,7 @@ var DatePanel = defineComponent({
|
|
25034
25142
|
case "date-table":
|
25035
25143
|
return createVNode(DateTable, {
|
25036
25144
|
"tableDate": this.panelDate,
|
25037
|
-
"
|
25145
|
+
"disabledDate": this.disabledDate,
|
25038
25146
|
"selectionMode": this.selectionMode,
|
25039
25147
|
"modelValue": this.dates,
|
25040
25148
|
"focusedDate": this.focusedDate,
|
@@ -25049,11 +25157,14 @@ var DatePanel = defineComponent({
|
|
25049
25157
|
"format": this.format,
|
25050
25158
|
"disabledDate": this.disabledDate,
|
25051
25159
|
"onPick": this.handlePick,
|
25160
|
+
"onPick-click": this.handlePickClick,
|
25052
25161
|
"onPick-clear": this.handlePickClear,
|
25053
|
-
"onPick-success": this.handlePickSuccess
|
25162
|
+
"onPick-success": this.handlePickSuccess,
|
25163
|
+
"onPick-toggle-time": this.handleToggleTime
|
25054
25164
|
}, null)]), this.confirm ? createVNode(Confirm, {
|
25055
25165
|
"clearable": this.clearable,
|
25056
25166
|
"showTime": this.showTime,
|
25167
|
+
"timeDisabled": this.timeDisabled,
|
25057
25168
|
"isTime": this.isTime,
|
25058
25169
|
"onPick-toggle-time": this.handleToggleTime,
|
25059
25170
|
"onPick-clear": this.handlePickClear,
|
@@ -25063,6 +25174,154 @@ var DatePanel = defineComponent({
|
|
25063
25174
|
}, [(_c = (_b = (_a = this.$slots).shortcuts) == null ? void 0 : _b.call(_a)) != null ? _c : null]) : null]);
|
25064
25175
|
}
|
25065
25176
|
});
|
25177
|
+
const timeRangeProps = {
|
25178
|
+
steps: {
|
25179
|
+
type: Array,
|
25180
|
+
default: () => []
|
25181
|
+
},
|
25182
|
+
format: {
|
25183
|
+
type: String,
|
25184
|
+
default: "HH:mm:ss"
|
25185
|
+
},
|
25186
|
+
value: {
|
25187
|
+
type: Array,
|
25188
|
+
required: true
|
25189
|
+
},
|
25190
|
+
allowCrossDay: {
|
25191
|
+
type: Boolean,
|
25192
|
+
default: false
|
25193
|
+
}
|
25194
|
+
};
|
25195
|
+
var TimeRangePanel = defineComponent({
|
25196
|
+
name: "TimeRangePanel",
|
25197
|
+
props: __spreadValues(__spreadValues(__spreadValues({}, datePickerProps), timePanelProps), timeRangeProps),
|
25198
|
+
emits: ["pick", "pick-click"],
|
25199
|
+
setup(props2, {
|
25200
|
+
emit
|
25201
|
+
}) {
|
25202
|
+
const [dateStart, dateEnd] = props2.value.slice();
|
25203
|
+
const state = reactive({
|
25204
|
+
showDate: false,
|
25205
|
+
dateStart: dateStart || initTime(),
|
25206
|
+
dateEnd: dateEnd || initTime()
|
25207
|
+
});
|
25208
|
+
const parentProvide = inject(timePickerKey);
|
25209
|
+
const showSeconds = computed(() => !(props2.format || "").match(/mm$/));
|
25210
|
+
const leftDatePanelLabel = computed(() => fecha.format(parentProvide.dates[0], props2.format));
|
25211
|
+
const rightDatePanelLabel = computed(() => fecha.format(parentProvide.dates[1], props2.format));
|
25212
|
+
watch(() => props2.value, (dates) => {
|
25213
|
+
const [dateStart2, dateEnd2] = dates.slice();
|
25214
|
+
state.dateStart = dateStart2 || initTime();
|
25215
|
+
state.dateEnd = dateEnd2 || initTime();
|
25216
|
+
});
|
25217
|
+
onMounted(() => {
|
25218
|
+
if (parentProvide && parentProvide.parentName === "DatePanel") {
|
25219
|
+
state.showDate = true;
|
25220
|
+
}
|
25221
|
+
});
|
25222
|
+
function handlePickClick() {
|
25223
|
+
emit("pick-click");
|
25224
|
+
}
|
25225
|
+
function handleChange(idx, start2, end2, isEmit = true) {
|
25226
|
+
let dateStart2 = new Date(state.dateStart);
|
25227
|
+
let dateEnd2 = new Date(state.dateEnd);
|
25228
|
+
Object.keys(start2).forEach((type) => {
|
25229
|
+
dateStart2[`set${capitalize(type)}`](start2[type]);
|
25230
|
+
});
|
25231
|
+
Object.keys(end2).forEach((type) => {
|
25232
|
+
dateEnd2[`set${capitalize(type)}`](end2[type]);
|
25233
|
+
});
|
25234
|
+
if (!props2.allowCrossDay && dateEnd2 < dateStart2) {
|
25235
|
+
if (idx === "start") {
|
25236
|
+
dateEnd2 = dateStart2;
|
25237
|
+
}
|
25238
|
+
if (idx === "end") {
|
25239
|
+
dateStart2 = dateEnd2;
|
25240
|
+
}
|
25241
|
+
}
|
25242
|
+
if (isEmit) {
|
25243
|
+
emit("pick", [dateStart2, dateEnd2], true, "time");
|
25244
|
+
}
|
25245
|
+
}
|
25246
|
+
function handleStartChange(date) {
|
25247
|
+
handleChange("start", date, {});
|
25248
|
+
}
|
25249
|
+
function handleEndChange(date) {
|
25250
|
+
handleChange("end", {}, date);
|
25251
|
+
}
|
25252
|
+
const timeSpinnerRef = ref(null);
|
25253
|
+
const timeSpinnerEndRef = ref(null);
|
25254
|
+
function updateScroll() {
|
25255
|
+
var _a, _b;
|
25256
|
+
(_a = timeSpinnerRef == null ? void 0 : timeSpinnerRef.value) == null ? void 0 : _a.updateScroll();
|
25257
|
+
(_b = timeSpinnerEndRef == null ? void 0 : timeSpinnerEndRef.value) == null ? void 0 : _b.updateScroll();
|
25258
|
+
}
|
25259
|
+
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
25260
|
+
showSeconds,
|
25261
|
+
leftDatePanelLabel,
|
25262
|
+
rightDatePanelLabel,
|
25263
|
+
handleStartChange,
|
25264
|
+
handleEndChange,
|
25265
|
+
handlePickClick,
|
25266
|
+
updateScroll,
|
25267
|
+
timeSpinnerRef,
|
25268
|
+
timeSpinnerEndRef
|
25269
|
+
});
|
25270
|
+
},
|
25271
|
+
render() {
|
25272
|
+
return createVNode("div", {
|
25273
|
+
"class": ["bk-picker-panel-body-wrapper", "bk-time-picker-with-range", this.showSeconds ? "bk-time-picker-with-seconds" : ""],
|
25274
|
+
"onMousedown": (e) => {
|
25275
|
+
e.preventDefault();
|
25276
|
+
}
|
25277
|
+
}, [createVNode("div", {
|
25278
|
+
"class": "bk-picker-panel-body",
|
25279
|
+
"style": {
|
25280
|
+
width: `${this.width * 2}px`
|
25281
|
+
}
|
25282
|
+
}, [createVNode("div", {
|
25283
|
+
"class": "bk-picker-panel-content bk-picker-panel-content-left",
|
25284
|
+
"style": {
|
25285
|
+
width: `${this.width}px`
|
25286
|
+
}
|
25287
|
+
}, [this.showDate ? createVNode("div", {
|
25288
|
+
"class": "bk-time-picker-header"
|
25289
|
+
}, [this.leftDatePanelLabel]) : "", createVNode(TimeSpinner, {
|
25290
|
+
"ref": "timeSpinnerRef",
|
25291
|
+
"steps": this.steps,
|
25292
|
+
"showSeconds": this.showSeconds,
|
25293
|
+
"hours": this.value[0] && this.dateStart.getHours(),
|
25294
|
+
"minutes": this.value[0] && this.dateStart.getMinutes(),
|
25295
|
+
"seconds": this.value[0] && this.dateStart.getSeconds(),
|
25296
|
+
"disabledHours": this.disabledHours,
|
25297
|
+
"disabledMinutes": this.disabledMinutes,
|
25298
|
+
"disabledSeconds": this.disabledSeconds,
|
25299
|
+
"hideDisabledOptions": this.hideDisabledOptions,
|
25300
|
+
"onChange": this.handleStartChange,
|
25301
|
+
"onPick-click": this.handlePickClick
|
25302
|
+
}, null)]), createVNode("div", {
|
25303
|
+
"class": "bk-picker-panel-content bk-picker-panel-content-right",
|
25304
|
+
"style": {
|
25305
|
+
width: `${this.width}px`
|
25306
|
+
}
|
25307
|
+
}, [this.showDate ? createVNode("div", {
|
25308
|
+
"class": "bk-time-picker-header"
|
25309
|
+
}, [this.rightDatePanelLabel]) : "", createVNode(TimeSpinner, {
|
25310
|
+
"ref": "timeSpinnerEndRef",
|
25311
|
+
"steps": this.steps,
|
25312
|
+
"showSeconds": this.showSeconds,
|
25313
|
+
"hours": this.value[1] && this.dateEnd.getHours(),
|
25314
|
+
"minutes": this.value[1] && this.dateEnd.getMinutes(),
|
25315
|
+
"seconds": this.value[1] && this.dateEnd.getSeconds(),
|
25316
|
+
"disabledHours": this.disabledHours,
|
25317
|
+
"disabledMinutes": this.disabledMinutes,
|
25318
|
+
"disabledSeconds": this.disabledSeconds,
|
25319
|
+
"hideDisabledOptions": this.hideDisabledOptions,
|
25320
|
+
"onChange": this.handleEndChange,
|
25321
|
+
"onPick-click": this.handlePickClick
|
25322
|
+
}, null)])])]);
|
25323
|
+
}
|
25324
|
+
});
|
25066
25325
|
const dateRangePanelProps = {
|
25067
25326
|
modelValue: {
|
25068
25327
|
type: [Date, String, Number, Array]
|
@@ -25117,7 +25376,7 @@ const dateRangePanelProps = {
|
|
25117
25376
|
type: Boolean,
|
25118
25377
|
default: false
|
25119
25378
|
},
|
25120
|
-
|
25379
|
+
disabledDate: Function,
|
25121
25380
|
focusedDate: {
|
25122
25381
|
type: Date,
|
25123
25382
|
required: true
|
@@ -25125,12 +25384,20 @@ const dateRangePanelProps = {
|
|
25125
25384
|
confirm: {
|
25126
25385
|
type: Boolean,
|
25127
25386
|
default: false
|
25387
|
+
},
|
25388
|
+
format: {
|
25389
|
+
type: String,
|
25390
|
+
default: "yyyy-MM-dd"
|
25391
|
+
},
|
25392
|
+
timePickerOptions: {
|
25393
|
+
type: Object,
|
25394
|
+
default: () => ({})
|
25128
25395
|
}
|
25129
25396
|
};
|
25130
25397
|
var DateRangePanel = defineComponent({
|
25131
25398
|
name: "DateRangePanel",
|
25132
25399
|
props: dateRangePanelProps,
|
25133
|
-
emits: ["pick", "pick-success"],
|
25400
|
+
emits: ["pick", "pick-success", "pick-clear", "pick-click"],
|
25134
25401
|
setup(props2, {
|
25135
25402
|
slots,
|
25136
25403
|
emit
|
@@ -25151,6 +25418,13 @@ var DateRangePanel = defineComponent({
|
|
25151
25418
|
upToNowEnable: false,
|
25152
25419
|
dates: props2.modelValue
|
25153
25420
|
});
|
25421
|
+
const {
|
25422
|
+
proxy
|
25423
|
+
} = getCurrentInstance();
|
25424
|
+
provide(timePickerKey, {
|
25425
|
+
dates: state.dates,
|
25426
|
+
parentName: proxy.$options.name
|
25427
|
+
});
|
25154
25428
|
const dateSorter = (a2, b2) => {
|
25155
25429
|
if (!a2 || !b2) {
|
25156
25430
|
return 0;
|
@@ -25243,7 +25517,6 @@ var DateRangePanel = defineComponent({
|
|
25243
25517
|
emit("pick", state.dates, visible, type || props2.type);
|
25244
25518
|
};
|
25245
25519
|
const handleRangePick = (val, type) => {
|
25246
|
-
console.warn("handleRangePick");
|
25247
25520
|
if (state.rangeState.selecting || state.currentView === "time") {
|
25248
25521
|
if (state.currentView === "time") {
|
25249
25522
|
state.dates = val;
|
@@ -25302,9 +25575,26 @@ var DateRangePanel = defineComponent({
|
|
25302
25575
|
const handleChangeRange = (val) => {
|
25303
25576
|
state.rangeState.to = val;
|
25304
25577
|
};
|
25578
|
+
function setPanelDates(leftPanelDate2) {
|
25579
|
+
state.leftPanelDate = leftPanelDate2;
|
25580
|
+
const rightPanelDate = new Date(leftPanelDate2.getFullYear(), leftPanelDate2.getMonth() + 1, 1);
|
25581
|
+
const splitRightPanelDate = state.dates[1] ? state.dates[1].getTime() : state.dates[1];
|
25582
|
+
state.rightPanelDate = props2.splitPanels ? new Date(Math.max(splitRightPanelDate, rightPanelDate.getTime())) : rightPanelDate;
|
25583
|
+
}
|
25305
25584
|
watch(() => props2.selectionMode, (v2) => {
|
25306
25585
|
state.currentView = v2 || "range";
|
25307
25586
|
});
|
25587
|
+
watch(() => props2.modelValue, (newVal) => {
|
25588
|
+
const minDate2 = newVal[0] ? toDate(newVal[0]) : null;
|
25589
|
+
const maxDate2 = newVal[1] ? toDate(newVal[1]) : null;
|
25590
|
+
state.dates = [minDate2, maxDate2].sort(dateSorter);
|
25591
|
+
state.rangeState = {
|
25592
|
+
from: state.dates[0],
|
25593
|
+
to: state.dates[1],
|
25594
|
+
selecting: false
|
25595
|
+
};
|
25596
|
+
setPanelDates(props2.startDate || state.dates[0] || new Date());
|
25597
|
+
});
|
25308
25598
|
const isTime = computed(() => state.currentView === "time");
|
25309
25599
|
const leftDatePanelLabel = computed(() => panelLabelConfig("left"));
|
25310
25600
|
const rightDatePanelLabel = computed(() => panelLabelConfig("right"));
|
@@ -25329,6 +25619,26 @@ var DateRangePanel = defineComponent({
|
|
25329
25619
|
var _a;
|
25330
25620
|
return slots.shortcuts || ((_a = props2.shortcuts) == null ? void 0 : _a.length);
|
25331
25621
|
});
|
25622
|
+
const handleToggleTime = () => {
|
25623
|
+
state.currentView = state.currentView === "time" ? "date" : "time";
|
25624
|
+
};
|
25625
|
+
const resetView = () => {
|
25626
|
+
setTimeout(() => {
|
25627
|
+
state.currentView = props2.selectionMode;
|
25628
|
+
}, 500);
|
25629
|
+
};
|
25630
|
+
const handlePickSuccess = () => {
|
25631
|
+
resetView();
|
25632
|
+
emit("pick-success");
|
25633
|
+
};
|
25634
|
+
const handlePickClear = () => {
|
25635
|
+
resetView();
|
25636
|
+
emit("pick-clear");
|
25637
|
+
};
|
25638
|
+
function handlePickClick() {
|
25639
|
+
emit("pick-click");
|
25640
|
+
}
|
25641
|
+
const timeDisabled = computed(() => !(state.dates[0] && state.dates[1]));
|
25332
25642
|
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
25333
25643
|
isTime,
|
25334
25644
|
hasShortcuts,
|
@@ -25346,14 +25656,39 @@ var DateRangePanel = defineComponent({
|
|
25346
25656
|
rightShowLabelSecond,
|
25347
25657
|
preSelecting,
|
25348
25658
|
panelPickerHandlers,
|
25659
|
+
timeDisabled,
|
25349
25660
|
handleShortcutClick,
|
25350
25661
|
reset: reset2,
|
25351
25662
|
onToggleVisibility,
|
25352
25663
|
handleRangePick,
|
25353
|
-
handleChangeRange
|
25664
|
+
handleChangeRange,
|
25665
|
+
handleToggleTime,
|
25666
|
+
handlePickSuccess,
|
25667
|
+
handlePickClear,
|
25668
|
+
handlePickClick
|
25354
25669
|
});
|
25355
25670
|
},
|
25356
25671
|
render() {
|
25672
|
+
let shortcuts = null;
|
25673
|
+
if (this.hasShortcuts) {
|
25674
|
+
let inner = "";
|
25675
|
+
if (this.$slots.shortcuts) {
|
25676
|
+
inner = typeof this.$slots.shortcuts === "function" ? this.$slots.shortcuts() : this.$slots.shortcuts;
|
25677
|
+
} else {
|
25678
|
+
if (this.shortcuts.length) {
|
25679
|
+
inner = createVNode("div", {
|
25680
|
+
"class": "bk-picker-panel-shortcuts"
|
25681
|
+
}, [this.shortcuts.map((item, index) => createVNode("div", {
|
25682
|
+
"key": index,
|
25683
|
+
"class": "shortcuts-item",
|
25684
|
+
"onClick": () => this.handleShortcutClick(item, index)
|
25685
|
+
}, [item.text]))]);
|
25686
|
+
}
|
25687
|
+
}
|
25688
|
+
shortcuts = createVNode("div", {
|
25689
|
+
"class": "bk-picker-panel-sidebar"
|
25690
|
+
}, [inner]);
|
25691
|
+
}
|
25357
25692
|
return createVNode("div", {
|
25358
25693
|
"class": ["bk-picker-panel-body-wrapper", "bk-date-picker-with-range", this.shortcuts.length || this.$slots.shortcuts ? "bk-picker-panel-with-sidebar" : ""],
|
25359
25694
|
"onMousedown": (e) => {
|
@@ -25410,7 +25745,7 @@ var DateRangePanel = defineComponent({
|
|
25410
25745
|
return createVNode(DateTable, {
|
25411
25746
|
"selectionMode": "range",
|
25412
25747
|
"tableDate": this.leftPanelDate,
|
25413
|
-
"
|
25748
|
+
"disabledDate": this.disabledDate,
|
25414
25749
|
"rangeState": this.rangeState,
|
25415
25750
|
"modelValue": this.preSelecting.left ? [this.dates[0]] : this.dates,
|
25416
25751
|
"focusedDate": this.focusedDate,
|
@@ -25479,7 +25814,7 @@ var DateRangePanel = defineComponent({
|
|
25479
25814
|
return createVNode(DateTable, {
|
25480
25815
|
"selectionMode": "range",
|
25481
25816
|
"tableDate": this.rightPanelDate,
|
25482
|
-
"
|
25817
|
+
"disabledDate": this.disabledDate,
|
25483
25818
|
"rangeState": this.rangeState,
|
25484
25819
|
"modelValue": this.preSelecting.right ? [this.dates[this.dates.length - 1]] : this.dates,
|
25485
25820
|
"focusedDate": this.focusedDate,
|
@@ -25489,15 +25824,25 @@ var DateRangePanel = defineComponent({
|
|
25489
25824
|
default:
|
25490
25825
|
return null;
|
25491
25826
|
}
|
25492
|
-
})() : ""]), [[vShow, !this.isTime]])
|
25493
|
-
"
|
25494
|
-
|
25495
|
-
"
|
25496
|
-
|
25497
|
-
"
|
25498
|
-
"
|
25499
|
-
"
|
25500
|
-
|
25827
|
+
})() : ""]), [[vShow, !this.isTime]]), this.isTime ? createVNode(TimeRangePanel, {
|
25828
|
+
"ref": "timePickerRef",
|
25829
|
+
"value": this.dates,
|
25830
|
+
"format": this.format,
|
25831
|
+
"disabledDate": this.disabledDate,
|
25832
|
+
"onPick": this.handleRangePick,
|
25833
|
+
"onPick-click": this.handlePickClick,
|
25834
|
+
"onPick-clear": this.handlePickClear,
|
25835
|
+
"onPick-success": this.handlePickSuccess,
|
25836
|
+
"onPick-toggle-time": this.handleToggleTime
|
25837
|
+
}, null) : "", this.confirm ? createVNode(Confirm, {
|
25838
|
+
"clearable": this.clearable,
|
25839
|
+
"showTime": this.showTime,
|
25840
|
+
"timeDisabled": this.timeDisabled,
|
25841
|
+
"isTime": this.isTime,
|
25842
|
+
"onPick-toggle-time": this.handleToggleTime,
|
25843
|
+
"onPick-clear": this.handlePickClear,
|
25844
|
+
"onPick-success": this.handlePickSuccess
|
25845
|
+
}, null) : ""]), shortcuts]);
|
25501
25846
|
}
|
25502
25847
|
});
|
25503
25848
|
var Component$a = defineComponent({
|
@@ -25729,7 +26074,7 @@ var Component$a = defineComponent({
|
|
25729
26074
|
const newValue = e.target.value;
|
25730
26075
|
const newDate = parseDate(newValue, props2.type, props2.multiple, props2.format);
|
25731
26076
|
const valueToTest = isArrayValue ? newDate : newDate[0];
|
25732
|
-
const isDisabled = (_a = props2.
|
26077
|
+
const isDisabled = (_a = props2.disabledDate) == null ? void 0 : _a.call(props2, valueToTest);
|
25733
26078
|
const isValidDate = newDate.reduce((valid, date) => valid && date instanceof Date, true);
|
25734
26079
|
if (newValue !== oldValue && !isDisabled && isValidDate) {
|
25735
26080
|
emitChange(props2.type);
|
@@ -25995,15 +26340,18 @@ var Component$a = defineComponent({
|
|
25995
26340
|
}, [(_c2 = (_b2 = (_a2 = this.$slots).header) == null ? void 0 : _b2.call(_a2)) != null ? _c2 : null]) : null, this.panel === "DateRangePanel" ? createVNode(DateRangePanel, {
|
25996
26341
|
"ref": "pickerPanelRef",
|
25997
26342
|
"type": this.type,
|
26343
|
+
"showTime": this.type === "datetime" || this.type === "datetimerange",
|
25998
26344
|
"confirm": this.isConfirm,
|
25999
26345
|
"shortcuts": this.shortcuts,
|
26000
26346
|
"shortcutClose": this.shortcutClose,
|
26001
26347
|
"modelValue": this.internalValue,
|
26002
26348
|
"selectionMode": this.selectionMode,
|
26003
26349
|
"startDate": this.startDate,
|
26004
|
-
"
|
26350
|
+
"disabledDate": this.disabledDate,
|
26005
26351
|
"focusedDate": this.focusedDate,
|
26352
|
+
"timePickerOptions": this.timePickerOptions,
|
26006
26353
|
"onPick": this.onPick,
|
26354
|
+
"onPick-clear": this.handleClear,
|
26007
26355
|
"onPick-success": this.onPickSuccess,
|
26008
26356
|
"onSelection-mode-change": this.onSelectionModeChange
|
26009
26357
|
}, shortcutsSlot) : createVNode(DatePanel, {
|
@@ -26017,8 +26365,9 @@ var Component$a = defineComponent({
|
|
26017
26365
|
"selectionMode": this.selectionMode,
|
26018
26366
|
"modelValue": this.internalValue,
|
26019
26367
|
"startDate": this.startDate,
|
26020
|
-
"
|
26368
|
+
"disabledDate": this.disabledDate,
|
26021
26369
|
"focusedDate": this.focusedDate,
|
26370
|
+
"timePickerOptions": this.timePickerOptions,
|
26022
26371
|
"onPick": this.onPick,
|
26023
26372
|
"onPick-clear": this.handleClear,
|
26024
26373
|
"onPick-success": this.onPickSuccess,
|
@@ -26268,7 +26617,7 @@ var TimePicker = defineComponent({
|
|
26268
26617
|
const newValue = e.target.value;
|
26269
26618
|
const newDate = parseDate(newValue, props2.type, props2.multiple, props2.format);
|
26270
26619
|
const valueToTest = isArrayValue ? newDate : newDate[0];
|
26271
|
-
const isDisabled = (_a = props2.
|
26620
|
+
const isDisabled = (_a = props2.disabledDate) == null ? void 0 : _a.call(props2, valueToTest);
|
26272
26621
|
const isValidDate = newDate.reduce((valid, date) => valid && date instanceof Date, true);
|
26273
26622
|
if (newValue !== oldValue && !isDisabled && isValidDate) {
|
26274
26623
|
emitChange(props2.type);
|
@@ -26290,8 +26639,8 @@ var TimePicker = defineComponent({
|
|
26290
26639
|
}
|
26291
26640
|
};
|
26292
26641
|
const reset2 = () => {
|
26293
|
-
var _a;
|
26294
|
-
(_a = pickerPanelRef == null ? void 0 : pickerPanelRef.value) == null ? void 0 : _a.reset();
|
26642
|
+
var _a, _b;
|
26643
|
+
(_b = (_a = pickerPanelRef == null ? void 0 : pickerPanelRef.value) == null ? void 0 : _a.reset) == null ? void 0 : _b.call(_a);
|
26295
26644
|
};
|
26296
26645
|
const handleBlur = (e) => {
|
26297
26646
|
var _a, _b;
|
@@ -26403,8 +26752,6 @@ var TimePicker = defineComponent({
|
|
26403
26752
|
emit("shortcut-change", state.shortcut, shortcutIndex);
|
26404
26753
|
};
|
26405
26754
|
const triggerRef = ref(null);
|
26406
|
-
console.error(panel);
|
26407
|
-
console.error(panel.value);
|
26408
26755
|
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
26409
26756
|
panel,
|
26410
26757
|
publicStringValue,
|
@@ -26538,7 +26885,22 @@ var TimePicker = defineComponent({
|
|
26538
26885
|
var _a2, _b2, _c2, _d, _e, _f;
|
26539
26886
|
return [this.hasHeader ? createVNode("div", {
|
26540
26887
|
"class": ["bk-date-picker-top-wrapper", this.headerSlotCls]
|
26541
|
-
}, [(_c2 = (_b2 = (_a2 = this.$slots).header) == null ? void 0 : _b2.call(_a2)) != null ? _c2 : null]) : null, createVNode(
|
26888
|
+
}, [(_c2 = (_b2 = (_a2 = this.$slots).header) == null ? void 0 : _b2.call(_a2)) != null ? _c2 : null]) : null, this.panel === "RangeTimePickerPanel" ? createVNode(TimeRangePanel, {
|
26889
|
+
"ref": "pickerPanelRef",
|
26890
|
+
"clearable": this.clearable,
|
26891
|
+
"shortcuts": this.shortcuts,
|
26892
|
+
"multiple": this.multiple,
|
26893
|
+
"shortcutClose": this.shortcutClose,
|
26894
|
+
"value": this.internalValue,
|
26895
|
+
"startDate": this.startDate,
|
26896
|
+
"disabledDate": this.disabledDate,
|
26897
|
+
"onPick": this.onPick,
|
26898
|
+
"onPick-clear": this.handleClear,
|
26899
|
+
"onPick-success": this.onPickSuccess,
|
26900
|
+
"disabledHours": this.ownPickerProps.disabledHours,
|
26901
|
+
"disabledMinutes": this.ownPickerProps.disabledMinutes,
|
26902
|
+
"disabledSeconds": this.ownPickerProps.disabledSeconds
|
26903
|
+
}, shortcutsSlot) : createVNode(TimePanel, {
|
26542
26904
|
"ref": "pickerPanelRef",
|
26543
26905
|
"clearable": this.clearable,
|
26544
26906
|
"confirm": this.isConfirm,
|
@@ -26547,7 +26909,7 @@ var TimePicker = defineComponent({
|
|
26547
26909
|
"shortcutClose": this.shortcutClose,
|
26548
26910
|
"value": this.internalValue,
|
26549
26911
|
"startDate": this.startDate,
|
26550
|
-
"
|
26912
|
+
"disabledDate": this.disabledDate,
|
26551
26913
|
"onPick": this.onPick,
|
26552
26914
|
"onPick-clear": this.handleClear,
|
26553
26915
|
"onPick-success": this.onPickSuccess,
|