bkui-vue 0.0.1-beta.159 → 0.0.1-beta.161
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 +41 -41
- package/dist/index.esm.js +1395 -237
- package/dist/index.umd.js +41 -41
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/cascader/cascader.css +1 -1
- package/lib/cascader/cascader.d.ts +4 -5
- package/lib/cascader/cascader.less +1 -1
- package/lib/cascader/cascader.variable.css +1 -1
- package/lib/cascader/index.d.ts +12 -15
- package/lib/cascader/index.js +1 -1
- package/lib/components.d.ts +1 -0
- package/lib/components.js +1 -1
- package/lib/date-picker/date-picker.css +15 -0
- package/lib/date-picker/date-picker.d.ts +1 -1
- package/lib/date-picker/date-picker.less +18 -0
- package/lib/date-picker/date-picker.variable.css +15 -0
- package/lib/date-picker/index.d.ts +5 -3
- package/lib/date-picker/index.js +1 -1
- package/lib/date-picker/interface.d.ts +9 -0
- package/lib/date-picker/props.d.ts +39 -0
- package/lib/date-picker/time-picker.d.ts +381 -0
- package/lib/date-picker/utils.d.ts +22 -1
- package/lib/icon/enlarge-line.d.ts +4 -0
- package/lib/icon/enlarge-line.js +1 -0
- package/lib/icon/filliscreen-line.d.ts +4 -0
- package/lib/icon/filliscreen-line.js +1 -0
- package/lib/icon/folder.js +1 -0
- package/lib/icon/funnel.js +1 -1
- package/lib/icon/help-document-fill.js +1 -1
- package/lib/icon/help-fill.js +1 -1
- package/lib/icon/img-error.d.ts +4 -0
- package/lib/icon/img-error.js +1 -0
- package/lib/icon/img-placehoulder.d.ts +4 -0
- package/lib/icon/img-placehoulder.js +1 -0
- package/lib/icon/index.d.ts +9 -0
- package/lib/icon/index.js +1 -1
- package/lib/icon/left-turn-line.d.ts +4 -0
- package/lib/icon/left-turn-line.js +1 -0
- package/lib/icon/narrow-line.d.ts +4 -0
- package/lib/icon/narrow-line.js +1 -0
- package/lib/icon/original .d.ts +4 -0
- package/lib/icon/original .js +1 -0
- package/lib/icon/right-turn-line.d.ts +4 -0
- package/lib/icon/{help.js → right-turn-line.js} +1 -1
- package/lib/icon/unfull-screen.d.ts +4 -0
- package/lib/icon/unfull-screen.js +1 -0
- package/lib/image/image-viewer.css +142 -0
- package/lib/image/image-viewer.d.ts +73 -0
- package/lib/image/image-viewer.less +168 -0
- package/lib/image/image-viewer.variable.css +142 -0
- package/lib/image/image.css +37 -0
- package/lib/image/image.d.ts +93 -0
- package/lib/image/image.less +44 -0
- package/lib/image/image.variable.css +37 -0
- package/lib/image/index.d.ts +246 -0
- package/lib/image/index.js +1 -0
- package/lib/image/props.d.ts +71 -0
- package/lib/message/messageConstructor.d.ts +1 -1
- package/lib/notify/notifyConstructor.d.ts +2 -2
- package/lib/popover/index.d.ts +5 -5
- package/lib/popover/popover.d.ts +2 -2
- package/lib/popover2/index.d.ts +6 -0
- package/lib/popover2/index.js +1 -1
- package/lib/popover2/popover2.d.ts +2 -0
- package/lib/shared/dom.d.ts +1 -0
- package/lib/shared/index.js +1 -1
- package/lib/steps/index.d.ts +4 -4
- package/lib/steps/steps.d.ts +1 -1
- package/lib/styles/index.d.ts +1 -0
- package/lib/time-picker/index.d.ts +904 -0
- package/lib/time-picker/index.js +1 -0
- package/lib/time-picker/time-picker.css +215 -0
- package/lib/time-picker/time-picker.less +260 -0
- package/lib/time-picker/time-picker.variable.css +328 -0
- package/lib/upload/index.d.ts +27 -27
- package/lib/upload/index.js +1 -1
- package/lib/upload/upload.d.ts +7 -7
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -87,6 +87,7 @@ var tagInput = "";
|
|
87
87
|
var container = "";
|
88
88
|
var cascader = "";
|
89
89
|
var colorPicker = "";
|
90
|
+
var timePicker = "";
|
90
91
|
const BKLAYERD_INDEX_EFAULT_VALUE = {
|
91
92
|
["bottom"]: 0,
|
92
93
|
["content"]: 1,
|
@@ -797,10 +798,10 @@ function getOppositeVariationPlacement(placement) {
|
|
797
798
|
function getWindowScroll(node) {
|
798
799
|
var win = getWindow$1(node);
|
799
800
|
var scrollLeft = win.pageXOffset;
|
800
|
-
var
|
801
|
+
var scrollTop2 = win.pageYOffset;
|
801
802
|
return {
|
802
803
|
scrollLeft,
|
803
|
-
scrollTop
|
804
|
+
scrollTop: scrollTop2
|
804
805
|
};
|
805
806
|
}
|
806
807
|
function getWindowScrollBarX$1(element) {
|
@@ -6385,9 +6386,9 @@ var lodash = { exports: {} };
|
|
6385
6386
|
}
|
6386
6387
|
var camelCase = createCompounder(function(result2, word2, index) {
|
6387
6388
|
word2 = word2.toLowerCase();
|
6388
|
-
return result2 + (index ?
|
6389
|
+
return result2 + (index ? capitalize2(word2) : word2);
|
6389
6390
|
});
|
6390
|
-
function
|
6391
|
+
function capitalize2(string) {
|
6391
6392
|
return upperFirst(toString(string).toLowerCase());
|
6392
6393
|
}
|
6393
6394
|
function deburr(string) {
|
@@ -6993,7 +6994,7 @@ var lodash = { exports: {} };
|
|
6993
6994
|
lodash2.add = add;
|
6994
6995
|
lodash2.attempt = attempt;
|
6995
6996
|
lodash2.camelCase = camelCase;
|
6996
|
-
lodash2.capitalize =
|
6997
|
+
lodash2.capitalize = capitalize2;
|
6997
6998
|
lodash2.ceil = ceil;
|
6998
6999
|
lodash2.clamp = clamp2;
|
6999
7000
|
lodash2.clone = clone2;
|
@@ -7934,6 +7935,27 @@ const off$2 = (() => {
|
|
7934
7935
|
}
|
7935
7936
|
};
|
7936
7937
|
})();
|
7938
|
+
function scrollTop(el, from = 0, to, duration = 500, endCallback) {
|
7939
|
+
const difference = Math.abs(from - to);
|
7940
|
+
const step = Math.ceil(difference / duration * 50);
|
7941
|
+
function scroll(start2, end2, step2) {
|
7942
|
+
if (start2 === end2) {
|
7943
|
+
endCallback == null ? void 0 : endCallback();
|
7944
|
+
return;
|
7945
|
+
}
|
7946
|
+
let d2 = start2 + step2 > end2 ? end2 : start2 + step2;
|
7947
|
+
if (start2 > end2) {
|
7948
|
+
d2 = start2 - step2 < end2 ? end2 : start2 - step2;
|
7949
|
+
}
|
7950
|
+
if (el === window) {
|
7951
|
+
window.scrollTo(d2, d2);
|
7952
|
+
} else {
|
7953
|
+
el.scrollTop = d2;
|
7954
|
+
}
|
7955
|
+
window.requestAnimationFrame(() => scroll(d2, end2, step2));
|
7956
|
+
}
|
7957
|
+
scroll(from, to, step);
|
7958
|
+
}
|
7937
7959
|
function classes(dynamicCls, constCls = "") {
|
7938
7960
|
return Object.entries(dynamicCls).filter((entry) => entry[1]).map((entry) => entry[0]).join(" ").concat(constCls ? ` ${constCls}` : "");
|
7939
7961
|
}
|
@@ -8276,6 +8298,7 @@ const ellipsis = (props2, context) => {
|
|
8276
8298
|
};
|
8277
8299
|
ellipsis.displayName = "ellipsis";
|
8278
8300
|
ellipsis.inheritAttrs = false;
|
8301
|
+
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M885.76 840.64l-148.96-149.12a344.16 344.16 0 1 0-45.28 45.28l149.12 148.96a32 32 0 1 0 45.12-45.12ZM472 752A280 280 0 1 1 752 472 280.32 280.32 0 0 1 472 752Z"}},{"type":"element","name":"path","attributes":{"d":"M576 448H496V368a32 32 0 0 0-64 0v80H352a32 32 0 0 0 0 64h80v80a32 32 0 0 0 64 0V512h80a32 32 0 0 0 0-64Z"}}]}');
|
8279
8302
|
const data$l = JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"fill-rule":"evenodd","d":"M452.7573333333333 510.91200000000003L225.83338666666668 737.8346666666666 286.1730133333333 798.1738666666666 513.0965333333334 571.2511999999999 739.8399999999999 797.9946666666666 797.9946666666666 739.8399999999999 571.2511999999999 513.0965333333334 798.1738666666666 286.1730133333333 737.8346666666666 225.83338666666668 510.91200000000003 452.7573333333333 283.9867733333333 225.83338666666668 225.83338666666668 283.9867733333333 452.7573333333333 510.91200000000003Z","clip-rule":"evenodd"}}]}');
|
8280
8303
|
const error = (props2, context) => {
|
8281
8304
|
const p2 = __spreadValues(__spreadValues({}, props2), context.attrs);
|
@@ -8307,6 +8330,7 @@ const eye = (props2, context) => {
|
|
8307
8330
|
};
|
8308
8331
|
eye.displayName = "eye";
|
8309
8332
|
eye.inheritAttrs = false;
|
8333
|
+
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M128 384L192 384 192 192 384 192 384 128 128 128 128 384Z"}},{"type":"element","name":"path","attributes":{"d":"M640 128L640 192 832 192 832 384 896 384 896 128 640 128Z"}},{"type":"element","name":"path","attributes":{"d":"M192 640L128 640 128 896 384 896 384 832 192 832 192 640Z"}},{"type":"element","name":"path","attributes":{"d":"M832 832L640 832 640 896 896 896 896 640 832 640 832 832Z"}}]}');
|
8310
8334
|
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M928 320h-35.199999999999996c-15.402666666666665-73.55733333333333-79.744-128-156.75733333333332-128 0 0-0.042666666666666665 0-0.042666666666666665 0h-288v-32c0-53.034666666666666-42.96533333333333-96-96-96h-256c-53.034666666666666 0-96 42.96533333333333-96 96v640c0 88.36266666666667 71.63733333333333 160 160 160h704c0.38399999999999995 0 0.8533333333333333 0 1.3226666666666667 0 51.199999999999996 0 92.88533333333334-40.61866666666666 94.67733333333332-91.34933333333333l64-452.65066666666667c0-53.034666666666666-42.96533333333333-96-96-96zM64 800v-640c0-17.663999999999998 14.336-32 32-32h256c17.663999999999998 0 32 14.336 32 32v64c0 17.663999999999998 14.336 32 32 32h320c41.42933333333333 0.128 76.71466666666666 26.496 90.02666666666666 63.31733333333333l-538.0266666666666 0.6826666666666666c-0.38399999999999995 0-0.8533333333333333 0-1.3226666666666667 0-51.199999999999996 0-92.88533333333334 40.61866666666666-94.67733333333332 91.34933333333333l-64 452.65066666666667c0.128 9.856 1.7493333333333334 19.328 4.650666666666666 28.202666666666666-39.97866666666667-12.842666666666666-68.47999999999999-49.151999999999994-68.65066666666667-92.16zM896 864c0 17.663999999999998-14.336 32-32 32h-640c-0.08533333333333333 0-0.21333333333333332 0-0.29866666666666664 0-16.08533333333333 0-29.39733333333333-11.861333333333334-31.658666666666665-27.349333333333334l64-452.65066666666667c0-17.663999999999998 14.336-32 32-32h640c0.08533333333333333 0 0.21333333333333332 0 0.29866666666666664 0 16.08533333333333 0 29.39733333333333 11.861333333333334 31.658666666666665 27.349333333333334z"}}]}');
|
8311
8335
|
const data$i = JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M202.24 421.11999999999995c1.792-56.23466666666667 47.78666666666667-101.12 104.27733333333333-101.12 0.46933333333333327 0 0.9386666666666665 0 1.408 0l568.2346666666666 0c0.17066666666666666 0 0.38399999999999995 0 0.5973333333333333 0 7.082666666666666 0 12.799999999999999-5.717333333333333 12.799999999999999-12.799999999999999 0-1.3653333333333333-0.21333333333333332-2.6879999999999997-0.6399999999999999-3.925333333333333-21.205333333333332-65.024-81.40799999999999-111.27466666666666-152.40533333333332-111.27466666666666-0.17066666666666666 0-0.38399999999999995 0-0.5546666666666666 0h-287.9573333333333v-32c0-53.034666666666666-42.96533333333333-96-96-96h-256c-53.034666666666666 0-96 42.96533333333333-96 96v640c0 0.9813333333333333-0.042666666666666665 2.0906666666666665-0.042666666666666665 3.2426666666666666 0 77.056 54.44266666666667 141.39733333333334 126.976 156.58666666666664 0.896-1.92 0.8106666666666666-4.394666666666666 0.8106666666666666-6.8693333333333335s0.08533333333333333-4.949333333333334 0.256-7.381333333333332z"}},{"type":"element","name":"path","attributes":{"d":"M960 384h-652.16c-22.954666666666668 0-41.599999999999994 18.645333333333333-41.599999999999994 41.599999999999994l-74.24 521.5999999999999c-0.42666666666666664 1.92-0.6399999999999999 4.1386666666666665-0.6399999999999999 6.3999999999999995s0.256 4.4799999999999995 0.6826666666666666 6.613333333333333l703.9573333333333-0.21333333333333332c35.327999999999996 0 64-28.672 64-64l64-448c0-35.327999999999996-28.672-64-64-64z"}}]}');
|
8312
8336
|
const folderShapeOpen = (props2, context) => {
|
@@ -8343,6 +8367,8 @@ const imageFill = (props2, context) => {
|
|
8343
8367
|
};
|
8344
8368
|
imageFill.displayName = "imageFill";
|
8345
8369
|
imageFill.inheritAttrs = false;
|
8370
|
+
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M752 512A176 176 0 1 0 928 688 176 176 0 0 0 752 512Zm0 299.2a30.88 30.88 0 1 1 30.88-30.88A30.72 30.72 0 0 1 752 811.2Zm16.96-92.32a17.12 17.12 0 0 1-33.92 0s-13.76-118.72-13.76-123.2a30.88 30.88 0 1 1 61.6 0C782.88 600.16 768.96 718.88 768.96 718.88Z"}},{"type":"element","name":"path","attributes":{"d":"M800 176H480l-44.32 89.44-23.36 89.44-70.24 85.6 30.88-85.6-46.88-89.44L336 240h0v-0.96L359.52 176H160a96 96 0 0 0-96 96V752a96 96 0 0 0 96 96H573.44A238.88 238.88 0 0 1 512 688a243.2 243.2 0 0 1 8.16-61.44L356.8 519.84a46.72 46.72 0 0 0-70.72 2.56L128 656V272a32 32 0 0 1 32-32h118.4L272 283.36l70.08 71.52L327.36 480l108.32-107.36L530.4 240H800a32 32 0 0 1 32 32V461.92A241.92 241.92 0 0 1 896 496V272A96 96 0 0 0 800 176Z"}},{"type":"element","name":"path","attributes":{"d":"M720 400A80 80 0 0 1 640 480 80 80 0 0 1 560 400 80 80 0 0 1 720 400z"}}]}');
|
8371
|
+
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M864 176H160a96 96 0 0 0-96 96V752a96 96 0 0 0 96 96H864a96 96 0 0 0 96-96V272A96 96 0 0 0 864 176ZM128 272a32 32 0 0 1 32-32H864a32 32 0 0 1 32 32V688l-144-114.72a57.76 57.76 0 0 0-56.32 0L592 672 356.8 439.84a46.72 46.72 0 0 0-70.72 2.56L128 656Z"}},{"type":"element","name":"path","attributes":{"d":"M752 400A96 96 0 0 1 656 496 96 96 0 0 1 560 400 96 96 0 0 1 752 400z"}}]}');
|
8346
8372
|
const data$f = JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","class":"bk-icon","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;","overflow":"hidden","viewBox":"0 0 1024 1024"},"elements":[{"type":"element","name":"path","attributes":{"d":"M512 64C264 64 64 264 64 512s200 448 448 448 448-200 448-448S760 64 512 64zM512 896C299.2 896 128 724.8 128 512S299.2 128 512 128s384 171.2 384 384S724.8 896 512 896z"}},{"type":"element","name":"path","attributes":{"d":"M494.4 403.2c-28.8 6.4-56 20.8-76.8 41.6-24 22.4 1.6 44.8 16 27.2 9.6-12.8 24-22.4 40-28.8 11.2-1.6 17.6 1.6 19.2 9.6 1.6 14.4 0 27.2-4.8 41.6-4.8 19.2-14.4 51.2-25.6 94.4-22.4 76.8-33.6 124.8-30.4 140.8 3.2 17.6 12.8 32 28.8 41.6 17.6 8 38.4 9.6 57.6 4.8 30.4-6.4 57.6-22.4 80-44.8 25.6-25.6-3.2-43.2-17.6-28.8-9.6 12.8-24 22.4-40 25.6-14.4 3.2-22.4-3.2-25.6-16-1.6-14.4 1.6-28.8 6.4-41.6 40-136 57.6-212.8 52.8-232-3.2-14.4-12.8-27.2-25.6-33.6C532.8 398.4 512 398.4 494.4 403.2z"}},{"type":"element","name":"path","attributes":{"d":"M608 304A48 48 0 0 1 560 352 48 48 0 0 1 512 304 48 48 0 0 1 608 304z"}}]}');
|
8347
8373
|
const infoLine = (props2, context) => {
|
8348
8374
|
const p2 = __spreadValues(__spreadValues({}, props2), context.attrs);
|
@@ -8373,6 +8399,9 @@ const leftShape = (props2, context) => {
|
|
8373
8399
|
};
|
8374
8400
|
leftShape.displayName = "leftShape";
|
8375
8401
|
leftShape.inheritAttrs = false;
|
8402
|
+
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M192 512a320 320 0 1 0 76.96-208H352v64H160V176h64v82.08A384 384 0 1 1 128 512Z"}}]}');
|
8403
|
+
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M886.56 841.28l-149.12-149.12a344.64 344.64 0 1 0-45.28 45.28l149.12 149.12A32 32 0 0 0 864 896a32 32 0 0 0 22.56-54.72ZM472.32 752A280.32 280.32 0 1 1 752 472.32 280.64 280.64 0 0 1 472.32 752Z"}},{"type":"element","name":"path","attributes":{"d":"M576 448H352a32 32 0 0 0 0 64H576a32 32 0 0 0 0-64Z"}}]}');
|
8404
|
+
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M896 176H128a64 64 0 0 0-64 64V784a64 64 0 0 0 64 64H896a64 64 0 0 0 64-64V240A64 64 0 0 0 896 176Zm0 608H128V240H896Z"}},{"type":"element","name":"path","attributes":{"d":"M327.84 649.28h52.64V373.28H337.76A97.12 97.12 0 0 1 304 417.28a150.56 150.56 0 0 1-44.8 25.6v48a182.56 182.56 0 0 0 68.16-40Z"}},{"type":"element","name":"path","attributes":{"d":"M480.64 450.24H533.28V502.88H480.64V450.24z"}},{"type":"element","name":"path","attributes":{"d":"M480.64 596.64H533.28V649.28H480.64V596.64z"}},{"type":"element","name":"path","attributes":{"d":"M669.28 649.28h52.64V373.28H679.2a97.12 97.12 0 0 1-33.28 44 150.56 150.56 0 0 1-44.8 25.6v48a182.56 182.56 0 0 0 68.16-40Z"}}]}');
|
8376
8405
|
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1303.273","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"fill-rule":"evenodd","d":"M1010.3272727272728 326.8363636363636C1019.0545454545455 335.56363636363636 1024 347.3454545454546 1024 359.70909090909095L1024 1256.7272727272727C1024 1282.4727272727273 1003.2 1303.2727272727273 977.4545454545455 1303.2727272727273L46.54545454545455 1303.2727272727273C20.80000000000002 1303.2727272727273 0 1282.4727272727273 0 1256.7272727272727L0 46.54545454545455C0 20.799999999999997 20.80000000000002 0 46.54545454545455 0L664.2909090909092 0C676.6545454545455 0 688.5818181818182 4.945454545454554 697.3090909090909 13.67272727272728L1010.3272727272728 326.8363636363636ZM916.6545454545455 381.0909090909091L642.9090909090909 107.34545454545456 642.9090909090909 381.0909090909091 916.6545454545455 381.0909090909091ZM688.3156340363636 833.8269090909091C666.2443659636364 833.1156340363638 642.7679976727273 834.8014545454546 616.0974568727273 838.1381818181819 580.7549114181819 816.3389114181817 556.9643659636364 786.3825454545455 540.0625477818182 742.389820509091 540.4698158545455 740.714179490909 541.3134568727273 737.2436386909092 541.6087272727273 736.0189114181819 542.2981818181819 733.1709114181818 542.8698158545455 730.7912750545455 543.4167295999999 728.4770909090909 549.661090909091 702.1061818181818 553.0385454545456 682.8654545454546 554.0349114181819 663.4661841454545 554.788361309091 648.8130932363637 553.9767249454546 635.2945477818182 551.3774545454546 622.7738205090909 546.5803636363637 595.7425477818182 527.4443636363637 579.933090909091 503.3469067636364 578.9541841454546 480.8799976727273 578.0421818181818 460.2210909090909 590.5803636363637 454.9381818181818 610.0421818181818 446.33745221818185 641.4778181818182 451.37454545454545 682.8712727272729 469.6 753.4341818181819 446.3796363636364 808.7883636363637 415.70618181818185 873.6683659636363 395.1229067636363 909.8545477818182 367.65381818181817 924.021820509091 346.2443659636364 936.9163636363637 328.28218181818187 951.2029090909091 304.5687296 970.0625454545454 289.7658181818182 989.4429090909091 285.6843636363637 1009.8298181818183 283.71345221818177 1019.2552727272729 286.69090909090914 1031.5985454545455 293.4807272727272 1041.7018181818182 301.184 1053.1621841454546 312.8 1060.597820509091 326.7243659636364 1061.6800023272726 361.85454312727273 1064.4101818181819 405.02254312727274 1028.1905477818182 452.6734522181818 946.3956386909091 457.4661818181818 944.8101841454546 462.5352704 943.1127272727273 468.71127040000005 941.0283659636364 472.09018181818186 939.8894545454546 483.9316340363637 935.8821841454546 486.0349114181819 935.1723659636364 496.9745454545455 931.4778205090909 504.9149114181818 928.8305477818183 512.7636340363636 926.2763659636363 546.7941794909092 915.2043659636364 572.5396340363636 908.1978181818182 595.9781794909092 904.221090909091 636.6661818181818 926.0000023272728 683.7105477818181 940.288 715.3934522181818 940.288 741.5447272727273 940.288 759.2130885818183 926.7330932363637 765.5970909090909 905.4007296 771.2072704000001 886.6574568727273 766.7520000000001 864.9294568727273 754.7272704 852.9149114181819 742.2763613090909 840.6821841454545 719.3818205090909 834.8290932363636 688.3156340363636 833.8269090909091L688.3156340363636 833.8269090909091ZM327.61017716363637 1020.6196363636365L327.61017716363637 1020.0960000000001 327.79345454545455 1019.6043636363636C329.6479976727273 1014.6283613090909 332.38545221818185 1009.4109090909092 335.93890909090914 1003.9563636363637 342.17018181818185 994.3912727272727 350.7359976727273 984.32 361.3527272727273 973.6072704000001 367.0545454545455 967.8545454545455 372.992 962.2618158545456 379.9563636363637 955.9781794909092 381.5170885818182 954.5687272727273 391.46181818181816 945.7105454545456 393.32217949090904 943.9781841454546L409.5781794909091 928.8407272727272 397.76727040000003 947.6538181818181C379.8385431272727 976.2181818181818 363.6436340363636 996.7883636363637 349.74836363636365 1010.2050909090909 344.64727039999997 1015.1316340363637 340.1483636363636 1018.7869090909091 336.52508858181824 1021.121452218182 335.0312727272727 1022.0843613090909 333.7381794909091 1022.7854522181817 332.72436363636365 1023.1927249454546 332.1294522181818 1023.4298181818182 331.6029067636364 1023.5825431272726 331.0807272727273 1023.6319976727274 330.5281303272728 1023.6968587636364 329.9681698909091 1023.6166516363637 329.4559976727273 1023.3992704 328.3361233454546 1022.9301666909092 327.6080779636364 1021.8337931636364 327.61017716363637 1020.6196363636365ZM510.7869090909091 703.1374568727272L507.4996363636364 708.9658181818182 505.47781818181824 702.5876340363636C500.94836363636364 688.2909090909092 497.6421841454545 666.7461818181819 496.72727272727275 647.3192727272727 495.6858181818182 625.2145431272728 497.44000000000005 611.9403659636364 504.416 611.9403659636364 514.2196363636363 611.9403659636364 518.715638690909 627.6610885818181 519.072 651.2901818181818 519.3861818181817 672.0610909090909 516.1192727272727 693.6785454545454 510.7869090909091 703.1374568727272ZM502.336 788.1760023272727L504.5672727272727 782.2850932363638 507.60436363636364 787.805090909091C524.6080000000001 818.7069114181819 546.6705454545455 844.4843659636364 570.9323636363636 862.4450932363636L576.1614522181818 866.3170932363636 569.7905431272727 867.6320023272727C546.0407296000001 872.5367296000001 523.9083659636365 879.9330909090909 493.6596340363636 892.1294568727272 496.82181585454543 890.8552750545455 462.20799999999997 905.021090909091 453.45890676363643 908.3752727272728L445.81963403636365 911.3032750545455 449.89527039999996 904.2094545454546C467.85891141818183 872.9425454545456 484.452361309091 835.3716363636364 502.3345477818182 788.1760023272727L502.336 788.1760023272727ZM731.6101818181818 899.1010909090909C720.1716363636365 903.616 695.5709067636365 899.5796340363637 652.2370932363636 881.0836340363636L641.2392727272727 876.3898181818182 653.1650885818183 875.5069067636365C687.0487272727273 872.9992704 711.0661818181818 874.8669067636364 725.0516340363637 879.9869067636363 731.0007249454545 882.165820509091 734.9774522181818 884.9149114181819 736.7418181818182 888.064 738.6472727272728 891.4618181818182 737.7745454545455 895.0603636363637 734.7607272727273 897.2421818181818 734.109090909091 897.8632704 733.0807295999999 898.5221818181819 731.6101818181818 899.1010909090909L731.6101818181818 899.1010909090909Z"}}]}');
|
8377
8406
|
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M827.9893333333332 482.73066666666665l-585.1306666666667-474.7093333333333c-6.229333333333333-5.418666666666667-14.421333333333333-8.746666666666666-23.381333333333334-8.789333333333332-20.223999999999997 0-36.56533333333333 16.384-36.56533333333333 36.56533333333333v950.8693333333333c0 20.18133333333333 16.384 36.56533333333333 36.56533333333333 36.56533333333333 0 0 0.042666666666666665 0 0.042666666666666665 0 8.618666666666666 0 16.512-3.0293333333333328 22.698666666666668-8.106666666666666l585.088-474.66666666666663c8.874666666666666-6.741333333333333 14.506666666666668-17.28 14.506666666666668-29.184 0-11.562666666666667-5.333333333333333-21.845333333333333-13.696-28.544z"}}]}');
|
8378
8407
|
const data$c = JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M736 480L544 480 544 288 480 288 480 480 288 480 288 544 480 544 480 736 544 736 544 544 736 544z"}}]}');
|
@@ -8397,6 +8426,7 @@ const rightShape = (props2, context) => {
|
|
8397
8426
|
};
|
8398
8427
|
rightShape.displayName = "rightShape";
|
8399
8428
|
rightShape.inheritAttrs = false;
|
8429
|
+
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M832 512a320 320 0 1 1-76.96-208H672v64H864V176H800v82.08A384 384 0 1 0 896 512Z"}}]}');
|
8400
8430
|
const data$a = JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M842.56 797.28l-151.52-151.52a336 336 0 1 0-45.28 45.28l151.52 151.52a32 32 0 0 0 45.28-45.28ZM432 704A272 272 0 1 1 704 432 272 272 0 0 1 432 704Z"}}]}');
|
8401
8431
|
const search = (props2, context) => {
|
8402
8432
|
const p2 = __spreadValues(__spreadValues({}, props2), context.attrs);
|
@@ -8468,6 +8498,7 @@ const treeApplicationShape = (props2, context) => {
|
|
8468
8498
|
};
|
8469
8499
|
treeApplicationShape.displayName = "treeApplicationShape";
|
8470
8500
|
treeApplicationShape.inheritAttrs = false;
|
8501
|
+
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M384 896L320 896 320 704 128 704 128 640 384 640 384 896Z"}},{"type":"element","name":"path","attributes":{"d":"M896 640L896 704 704 704 704 896 640 896 640 640 896 640Z"}},{"type":"element","name":"path","attributes":{"d":"M320 128L384 128 384 384 128 384 128 320 320 320 320 128Z"}},{"type":"element","name":"path","attributes":{"d":"M704 320L896 320 896 384 640 384 640 128 704 128 704 320Z"}}]}');
|
8471
8502
|
const data$3 = JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M500.16 304a355.04 355.04 0 0 1 128 24.8l48-48.96a426.08 426.08 0 0 0-176-39.84v64Z"}},{"type":"element","name":"path","attributes":{"d":"M763.2 328.8l-46.08 46.08a822.24 822.24 0 0 1 160 138.88 807.52 807.52 0 0 1-86.88 85.12C723.84 654.24 620.48 720 502.56 720a331.52 331.52 0 0 1-111.04-19.52l-49.44 49.28a402.4 402.4 0 0 0 160 34.24C768 784 960 512 960 512A962.56 962.56 0 0 0 763.2 328.8Z"}},{"type":"element","name":"path","attributes":{"d":"M254.88 701.12l46.08-46.08a706.56 706.56 0 0 1-156.64-144C197.44 442.88 328.16 304 500.16 304V240h0C234.72 240 64 512 64 512A838.72 838.72 0 0 0 254.88 701.12Z"}},{"type":"element","name":"path","attributes":{"d":"M512 640a128 128 0 0 0 110.24-192.96L888 181.28A32 32 0 1 0 842.72 136L576.96 401.76a128 128 0 0 0-176 176L136 842.72a32 32 0 1 0 45.28 45.28L447.04 622.24A128 128 0 0 0 512 640Zm64-128a64 64 0 0 1-64 64 60.96 60.96 0 0 1-16-2.4L573.6 496A60.96 60.96 0 0 1 576 512Zm-64-64a60.96 60.96 0 0 1 16 2.4L450.4 528A60.96 60.96 0 0 1 448 512 64 64 0 0 1 512 448Z"}}]}');
|
8472
8503
|
const unvisible = (props2, context) => {
|
8473
8504
|
const p2 = __spreadValues(__spreadValues({}, props2), context.attrs);
|
@@ -8792,7 +8823,7 @@ var Component$C = defineComponent({
|
|
8792
8823
|
const scrollHandler = lodash.exports.throttle(() => {
|
8793
8824
|
visible.value = el.value.scrollTop >= props2.visibilityHeight;
|
8794
8825
|
}, 30);
|
8795
|
-
const
|
8826
|
+
const scrollTop2 = () => {
|
8796
8827
|
el.value.scrollTo({
|
8797
8828
|
top: 0,
|
8798
8829
|
behavior: "smooth"
|
@@ -8828,7 +8859,7 @@ var Component$C = defineComponent({
|
|
8828
8859
|
bottom: styleBottom,
|
8829
8860
|
zIndex: zIndex.value
|
8830
8861
|
},
|
8831
|
-
"onClick":
|
8862
|
+
"onClick": scrollTop2
|
8832
8863
|
}, [(_b = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : createVNode(angleUp, {
|
8833
8864
|
"class": "bk-backtop-icon"
|
8834
8865
|
}, null)]) : ""];
|
@@ -12791,7 +12822,7 @@ var useFloating = (props2, ctx, refReference, refContent, refArrow, refRoot) =>
|
|
12791
12822
|
elContent.style.setProperty("z-index", `${props2.zIndex ? props2.zIndex : bkZIndexManager.getModalNextIndex()}`);
|
12792
12823
|
updatePopover();
|
12793
12824
|
ctx.emit("afterShow", {
|
12794
|
-
|
12825
|
+
isShow: true
|
12795
12826
|
});
|
12796
12827
|
};
|
12797
12828
|
const handlePopoverHide = () => {
|
@@ -12799,7 +12830,7 @@ var useFloating = (props2, ctx, refReference, refContent, refArrow, refRoot) =>
|
|
12799
12830
|
const elContent = resolveTargetElement((_a = refContent.value) == null ? void 0 : _a.$el);
|
12800
12831
|
elContent.style.setProperty("display", "none");
|
12801
12832
|
ctx.emit("afterHidden", {
|
12802
|
-
|
12833
|
+
isShow: false
|
12803
12834
|
});
|
12804
12835
|
};
|
12805
12836
|
const triggerPopover = () => {
|
@@ -13075,10 +13106,6 @@ var Component$p = defineComponent({
|
|
13075
13106
|
beforeInstanceUnmount();
|
13076
13107
|
document.body.removeEventListener("fullscreenchange", handleFullscrennChange);
|
13077
13108
|
});
|
13078
|
-
ctx.expose({
|
13079
|
-
show: show2,
|
13080
|
-
hide: hide2
|
13081
|
-
});
|
13082
13109
|
const handleClickOutside = (_e) => {
|
13083
13110
|
ctx.emit(EMITEVENTS$1.CLICK_OUTSIDE, {
|
13084
13111
|
isShow: localIsShow.value,
|
@@ -13101,7 +13128,9 @@ var Component$p = defineComponent({
|
|
13101
13128
|
content,
|
13102
13129
|
theme,
|
13103
13130
|
transBoundary,
|
13104
|
-
handleClickOutside
|
13131
|
+
handleClickOutside,
|
13132
|
+
hide: hide2,
|
13133
|
+
show: show2
|
13105
13134
|
};
|
13106
13135
|
},
|
13107
13136
|
render() {
|
@@ -14608,11 +14637,11 @@ var Component$j = defineComponent({
|
|
14608
14637
|
};
|
14609
14638
|
const handleScroll = (e) => {
|
14610
14639
|
const {
|
14611
|
-
scrollTop,
|
14640
|
+
scrollTop: scrollTop2,
|
14612
14641
|
clientHeight,
|
14613
14642
|
scrollHeight
|
14614
14643
|
} = e.target;
|
14615
|
-
if (
|
14644
|
+
if (scrollTop2 + clientHeight === scrollHeight) {
|
14616
14645
|
emit("scroll-end");
|
14617
14646
|
}
|
14618
14647
|
};
|
@@ -15349,7 +15378,7 @@ function computedVirtualIndex(lineHeight, callback, pagination2, el, event) {
|
|
15349
15378
|
}
|
15350
15379
|
const elScrollTop = el.scrollTop;
|
15351
15380
|
const elScrollLeft = el.scrollLeft;
|
15352
|
-
const { scrollTop, count, groupItemCount, startIndex, endIndex } = pagination2;
|
15381
|
+
const { scrollTop: scrollTop2, count, groupItemCount, startIndex, endIndex } = pagination2;
|
15353
15382
|
const { offsetHeight } = el;
|
15354
15383
|
let targetStartIndex = 0;
|
15355
15384
|
let targetEndIndex = 0;
|
@@ -15366,7 +15395,7 @@ function computedVirtualIndex(lineHeight, callback, pagination2, el, event) {
|
|
15366
15395
|
const endValue = getMatchedIndex(count, offsetHeight, groupItemCount, lineHeight);
|
15367
15396
|
targetEndIndex = endValue.startIndex + targetStartIndex + 1;
|
15368
15397
|
}
|
15369
|
-
if (elScrollTop !==
|
15398
|
+
if (elScrollTop !== scrollTop2 || targetStartIndex !== startIndex || targetEndIndex !== endIndex) {
|
15370
15399
|
const bottom2 = el.scrollHeight - el.offsetHeight - el.scrollTop;
|
15371
15400
|
typeof callback === "function" && callback(event, targetStartIndex, targetEndIndex, elScrollTop, translateY, elScrollLeft, { bottom: bottom2 >= 0 ? bottom2 : 0 });
|
15372
15401
|
}
|
@@ -15380,8 +15409,8 @@ function visibleRender(e, wrapper, binding) {
|
|
15380
15409
|
handleScrollCallback(e, null, null, elScrollTop, elScrollTop, elScrollLeft, { bottom: bottom2 >= 0 ? bottom2 : 0 });
|
15381
15410
|
return;
|
15382
15411
|
}
|
15383
|
-
const { startIndex, endIndex, groupItemCount, count, scrollTop } = pagination2;
|
15384
|
-
computedVirtualIndex(lineHeight, handleScrollCallback, { scrollTop, startIndex, endIndex, groupItemCount, count }, wrapper, e);
|
15412
|
+
const { startIndex, endIndex, groupItemCount, count, scrollTop: scrollTop2 } = pagination2;
|
15413
|
+
computedVirtualIndex(lineHeight, handleScrollCallback, { scrollTop: scrollTop2, startIndex, endIndex, groupItemCount, count }, wrapper, e);
|
15385
15414
|
}
|
15386
15415
|
const throttledRender = (delay = 60) => lodash.exports.throttle((e, wrapper, binding) => visibleRender(e, wrapper, binding), delay);
|
15387
15416
|
const executeThrottledRender = (e, wrapper, binding, delay = 60) => {
|
@@ -15443,10 +15472,10 @@ var Component$f = defineComponent({
|
|
15443
15472
|
pos: {},
|
15444
15473
|
groupItemCount: props2.groupItemCount
|
15445
15474
|
});
|
15446
|
-
const handleScrollCallback = (event, startIndex, endIndex,
|
15475
|
+
const handleScrollCallback = (event, startIndex, endIndex, scrollTop2, translateY, scrollLeft, pos) => {
|
15447
15476
|
pagination2.startIndex = startIndex;
|
15448
15477
|
pagination2.endIndex = endIndex;
|
15449
|
-
pagination2.scrollTop =
|
15478
|
+
pagination2.scrollTop = scrollTop2;
|
15450
15479
|
pagination2.translateY = translateY;
|
15451
15480
|
pagination2.translateX = scrollLeft;
|
15452
15481
|
pagination2.pos = pos;
|
@@ -15497,11 +15526,11 @@ var Component$f = defineComponent({
|
|
15497
15526
|
innerHeight.value = props2.abosuteHeight;
|
15498
15527
|
}
|
15499
15528
|
};
|
15500
|
-
const afterListDataReset = (
|
15529
|
+
const afterListDataReset = (scrollTop2 = true) => {
|
15501
15530
|
var _a;
|
15502
15531
|
const el = (_a = refRoot.value) == null ? void 0 : _a.parentNode;
|
15503
15532
|
computedVirtualIndex(props2.lineHeight, handleScrollCallback, pagination2, el, null);
|
15504
|
-
if (
|
15533
|
+
if (scrollTop2 && refRoot.value) {
|
15505
15534
|
refRoot.value.scrollTo(0, 0);
|
15506
15535
|
}
|
15507
15536
|
};
|
@@ -18151,11 +18180,11 @@ var Component$c = defineComponent({
|
|
18151
18180
|
return;
|
18152
18181
|
}
|
18153
18182
|
const {
|
18154
|
-
scrollTop,
|
18183
|
+
scrollTop: scrollTop2,
|
18155
18184
|
offsetHeight,
|
18156
18185
|
scrollHeight
|
18157
18186
|
} = selectorListRef.value;
|
18158
|
-
if (
|
18187
|
+
if (scrollTop2 + offsetHeight >= scrollHeight) {
|
18159
18188
|
const curPage = pageState.curPage + 1;
|
18160
18189
|
if (curPage <= pageState.totalPage) {
|
18161
18190
|
pageState.isPageLoading = true;
|
@@ -20388,7 +20417,6 @@ var Confirm = defineComponent({
|
|
20388
20417
|
}, [this.showTime ? createVNode("a", {
|
20389
20418
|
"href": "javascript: void(0);",
|
20390
20419
|
"class": "bk-picker-confirm-time",
|
20391
|
-
"disabled": this.timeDisabled,
|
20392
20420
|
"onClick": this.handleToggleTime
|
20393
20421
|
}, [this.labels.time]) : "", this.clearable ? createVNode("a", {
|
20394
20422
|
"href": "javascript: void(0);",
|
@@ -22568,6 +22596,16 @@ const formatDate = (val, type, multiple, format2) => {
|
|
22568
22596
|
return formatter(val, format2 || f2);
|
22569
22597
|
};
|
22570
22598
|
const datePickerKey = Symbol("date-picker");
|
22599
|
+
const timePickerKey = Symbol("time-picker");
|
22600
|
+
function findChildComponents(context, componentName) {
|
22601
|
+
return context.$children.reduce((components2, child) => {
|
22602
|
+
if (child.$options.name === componentName) {
|
22603
|
+
components2.push(child);
|
22604
|
+
}
|
22605
|
+
const foundChilds = findChildComponents(child, componentName);
|
22606
|
+
return components2.concat(foundChilds);
|
22607
|
+
}, []);
|
22608
|
+
}
|
22571
22609
|
function iconBtnCls(direction, type = "") {
|
22572
22610
|
return [
|
22573
22611
|
"bk-picker-panel-icon-btn",
|
@@ -22643,6 +22681,17 @@ const isInRange = (time, a2, b2) => {
|
|
22643
22681
|
const [start2, end2] = [a2, b2].sort();
|
22644
22682
|
return time >= start2 && time <= end2;
|
22645
22683
|
};
|
22684
|
+
function firstUpperCase(str) {
|
22685
|
+
return str.toString()[0].toUpperCase() + str.toString().slice(1);
|
22686
|
+
}
|
22687
|
+
const mergeDateHMS = (date, ...hms) => {
|
22688
|
+
const newDate = new Date(date.getTime());
|
22689
|
+
newDate.setHours(hms[0]);
|
22690
|
+
newDate.setMinutes(hms[1]);
|
22691
|
+
newDate.setSeconds(hms[2]);
|
22692
|
+
return newDate;
|
22693
|
+
};
|
22694
|
+
const capitalize = (str) => str[0].toUpperCase() + str.slice(1);
|
22646
22695
|
const dateTableProps = {
|
22647
22696
|
tableDate: {
|
22648
22697
|
type: Date,
|
@@ -22760,6 +22809,652 @@ var DateTable = defineComponent({
|
|
22760
22809
|
}, [createVNode("em", null, [cell.desc])]))]);
|
22761
22810
|
}
|
22762
22811
|
});
|
22812
|
+
const datePickerProps = {
|
22813
|
+
type: {
|
22814
|
+
type: String,
|
22815
|
+
default: "date",
|
22816
|
+
validator(value) {
|
22817
|
+
const validList = ["year", "month", "date", "daterange", "datetime", "datetimerange", "time", "timerange"];
|
22818
|
+
if (validList.indexOf(value) < 0) {
|
22819
|
+
console.error(`type property is not valid: '${value}'`);
|
22820
|
+
return false;
|
22821
|
+
}
|
22822
|
+
return true;
|
22823
|
+
}
|
22824
|
+
},
|
22825
|
+
extPopoverCls: {
|
22826
|
+
type: String,
|
22827
|
+
default: ""
|
22828
|
+
},
|
22829
|
+
format: String,
|
22830
|
+
readonly: {
|
22831
|
+
type: Boolean,
|
22832
|
+
default: false
|
22833
|
+
},
|
22834
|
+
disabled: {
|
22835
|
+
type: Boolean,
|
22836
|
+
default: false
|
22837
|
+
},
|
22838
|
+
editable: {
|
22839
|
+
type: Boolean,
|
22840
|
+
default: true
|
22841
|
+
},
|
22842
|
+
clearable: {
|
22843
|
+
type: Boolean,
|
22844
|
+
default: true
|
22845
|
+
},
|
22846
|
+
open: {
|
22847
|
+
type: Boolean,
|
22848
|
+
default: null
|
22849
|
+
},
|
22850
|
+
multiple: {
|
22851
|
+
type: Boolean,
|
22852
|
+
default: false
|
22853
|
+
},
|
22854
|
+
timePickerOptions: {
|
22855
|
+
type: Object,
|
22856
|
+
default: () => ({})
|
22857
|
+
},
|
22858
|
+
splitPanels: {
|
22859
|
+
type: Boolean,
|
22860
|
+
default: true
|
22861
|
+
},
|
22862
|
+
startDate: Date,
|
22863
|
+
placeholder: {
|
22864
|
+
type: String,
|
22865
|
+
default: ""
|
22866
|
+
},
|
22867
|
+
placement: {
|
22868
|
+
type: String,
|
22869
|
+
default: "bottom-start",
|
22870
|
+
validator: (value) => {
|
22871
|
+
const validList = [
|
22872
|
+
"top",
|
22873
|
+
"top-start",
|
22874
|
+
"top-end",
|
22875
|
+
"bottom",
|
22876
|
+
"bottom-start",
|
22877
|
+
"bottom-end",
|
22878
|
+
"left",
|
22879
|
+
"left-start",
|
22880
|
+
"left-end",
|
22881
|
+
"right",
|
22882
|
+
"right-start",
|
22883
|
+
"right-end"
|
22884
|
+
];
|
22885
|
+
if (validList.indexOf(value) < 0) {
|
22886
|
+
console.error(`placement property is not valid: '${value}'`);
|
22887
|
+
return false;
|
22888
|
+
}
|
22889
|
+
return true;
|
22890
|
+
}
|
22891
|
+
},
|
22892
|
+
transfer: {
|
22893
|
+
type: Boolean,
|
22894
|
+
default: false
|
22895
|
+
},
|
22896
|
+
appendToBody: {
|
22897
|
+
type: Boolean,
|
22898
|
+
default: false
|
22899
|
+
},
|
22900
|
+
shortcuts: {
|
22901
|
+
type: Array,
|
22902
|
+
default: () => []
|
22903
|
+
},
|
22904
|
+
shortcutClose: {
|
22905
|
+
type: Boolean,
|
22906
|
+
default: false
|
22907
|
+
},
|
22908
|
+
modelValue: {
|
22909
|
+
type: [Date, String, Number, Array]
|
22910
|
+
},
|
22911
|
+
value: {
|
22912
|
+
type: [Date, String, Number, Array]
|
22913
|
+
},
|
22914
|
+
options: {
|
22915
|
+
type: Object,
|
22916
|
+
default: () => ({})
|
22917
|
+
},
|
22918
|
+
fontSize: {
|
22919
|
+
type: String,
|
22920
|
+
default: "normal"
|
22921
|
+
},
|
22922
|
+
upToNow: {
|
22923
|
+
type: Boolean,
|
22924
|
+
default: false
|
22925
|
+
},
|
22926
|
+
useShortcutText: {
|
22927
|
+
type: Boolean,
|
22928
|
+
default: false
|
22929
|
+
},
|
22930
|
+
shortcutSelectedIndex: {
|
22931
|
+
type: Number,
|
22932
|
+
default: -1
|
22933
|
+
},
|
22934
|
+
headerSlotCls: {
|
22935
|
+
type: String,
|
22936
|
+
default: ""
|
22937
|
+
},
|
22938
|
+
footerSlotCls: {
|
22939
|
+
type: String,
|
22940
|
+
default: ""
|
22941
|
+
},
|
22942
|
+
allowCrossDay: {
|
22943
|
+
type: Boolean,
|
22944
|
+
default: false
|
22945
|
+
},
|
22946
|
+
behavior: {
|
22947
|
+
type: String,
|
22948
|
+
default: "normal",
|
22949
|
+
validator(v2) {
|
22950
|
+
return ["simplicity", "normal"].indexOf(v2) > -1;
|
22951
|
+
}
|
22952
|
+
},
|
22953
|
+
disableDate: Function,
|
22954
|
+
withValidate: {
|
22955
|
+
type: Boolean,
|
22956
|
+
default: true
|
22957
|
+
}
|
22958
|
+
};
|
22959
|
+
const timePanelProps = {
|
22960
|
+
disabledHours: {
|
22961
|
+
type: Array,
|
22962
|
+
default: () => []
|
22963
|
+
},
|
22964
|
+
disabledMinutes: {
|
22965
|
+
type: Array,
|
22966
|
+
default: () => []
|
22967
|
+
},
|
22968
|
+
disabledSeconds: {
|
22969
|
+
type: Array,
|
22970
|
+
default: () => []
|
22971
|
+
},
|
22972
|
+
hideDisabledOptions: {
|
22973
|
+
type: Boolean,
|
22974
|
+
default: false
|
22975
|
+
},
|
22976
|
+
width: {
|
22977
|
+
type: Number,
|
22978
|
+
default: 261
|
22979
|
+
},
|
22980
|
+
enterMode: {
|
22981
|
+
type: Boolean,
|
22982
|
+
default: true
|
22983
|
+
}
|
22984
|
+
};
|
22985
|
+
const timePickerProps = {
|
22986
|
+
type: {
|
22987
|
+
type: String,
|
22988
|
+
default: "time",
|
22989
|
+
validator(value) {
|
22990
|
+
const validList = ["time", "timerange"];
|
22991
|
+
if (validList.indexOf(value) < 0) {
|
22992
|
+
console.error(`type property is not valid: '${value}'`);
|
22993
|
+
return false;
|
22994
|
+
}
|
22995
|
+
return true;
|
22996
|
+
}
|
22997
|
+
},
|
22998
|
+
allowCrossDay: {
|
22999
|
+
type: Boolean,
|
23000
|
+
default: false
|
23001
|
+
}
|
23002
|
+
};
|
23003
|
+
const timeSpinnerProps = {
|
23004
|
+
hours: {
|
23005
|
+
type: [Number, String],
|
23006
|
+
default: NaN
|
23007
|
+
},
|
23008
|
+
minutes: {
|
23009
|
+
type: [Number, String],
|
23010
|
+
default: NaN
|
23011
|
+
},
|
23012
|
+
seconds: {
|
23013
|
+
type: [Number, String],
|
23014
|
+
default: NaN
|
23015
|
+
},
|
23016
|
+
showSeconds: {
|
23017
|
+
type: Boolean,
|
23018
|
+
default: true
|
23019
|
+
},
|
23020
|
+
steps: {
|
23021
|
+
type: Array,
|
23022
|
+
default: () => []
|
23023
|
+
}
|
23024
|
+
};
|
23025
|
+
const timeParts = ["hours", "minutes", "seconds"];
|
23026
|
+
var TimeSpinner = defineComponent({
|
23027
|
+
name: "TimeSpinner",
|
23028
|
+
props: __spreadValues(__spreadValues({}, timeSpinnerProps), timePanelProps),
|
23029
|
+
emits: ["change", "pick-click"],
|
23030
|
+
setup(props2, {
|
23031
|
+
emit
|
23032
|
+
}) {
|
23033
|
+
const state = reactive({
|
23034
|
+
spinerSteps: [1, 1, 1].map((one, i2) => Math.abs(props2.steps[i2]) || one),
|
23035
|
+
compiled: false,
|
23036
|
+
focusedColumn: -1,
|
23037
|
+
focusedTime: [0, 0, 0]
|
23038
|
+
});
|
23039
|
+
const hoursList = computed(() => {
|
23040
|
+
const hours = [];
|
23041
|
+
const step = state.spinerSteps[0];
|
23042
|
+
const focusedHour = state.focusedColumn === 0 && state.focusedTime[0];
|
23043
|
+
const hourTmpl = {
|
23044
|
+
text: 0,
|
23045
|
+
selected: false,
|
23046
|
+
disabled: false,
|
23047
|
+
hide: false
|
23048
|
+
};
|
23049
|
+
for (let i2 = 0; i2 < 24; i2 += step) {
|
23050
|
+
const hour = JSON.parse(JSON.stringify(hourTmpl));
|
23051
|
+
hour.text = i2;
|
23052
|
+
hour.focused = i2 === focusedHour;
|
23053
|
+
if (props2.disabledHours.length && props2.disabledHours.indexOf(i2) > -1) {
|
23054
|
+
hour.disabled = true;
|
23055
|
+
if (props2.hideDisabledOptions) {
|
23056
|
+
hour.hide = true;
|
23057
|
+
}
|
23058
|
+
}
|
23059
|
+
if (props2.hours === i2) {
|
23060
|
+
hour.selected = true;
|
23061
|
+
}
|
23062
|
+
hours.push(hour);
|
23063
|
+
}
|
23064
|
+
return hours;
|
23065
|
+
});
|
23066
|
+
const minutesList = computed(() => {
|
23067
|
+
const minutes = [];
|
23068
|
+
const step = state.spinerSteps[1];
|
23069
|
+
const focusedMinute = state.focusedColumn === 1 && state.focusedTime[1];
|
23070
|
+
const minuteTmpl = {
|
23071
|
+
text: 0,
|
23072
|
+
selected: false,
|
23073
|
+
disabled: false,
|
23074
|
+
hide: false
|
23075
|
+
};
|
23076
|
+
for (let i2 = 0; i2 < 60; i2 += step) {
|
23077
|
+
const minute = JSON.parse(JSON.stringify(minuteTmpl));
|
23078
|
+
minute.text = i2;
|
23079
|
+
minute.focused = i2 === focusedMinute;
|
23080
|
+
if (props2.disabledMinutes.length && props2.disabledMinutes.indexOf(i2) > -1) {
|
23081
|
+
minute.disabled = true;
|
23082
|
+
if (props2.hideDisabledOptions) {
|
23083
|
+
minute.hide = true;
|
23084
|
+
}
|
23085
|
+
}
|
23086
|
+
if (props2.minutes === i2) {
|
23087
|
+
minute.selected = true;
|
23088
|
+
}
|
23089
|
+
minutes.push(minute);
|
23090
|
+
}
|
23091
|
+
return minutes;
|
23092
|
+
});
|
23093
|
+
const secondsList = computed(() => {
|
23094
|
+
const seconds = [];
|
23095
|
+
const step = state.spinerSteps[2];
|
23096
|
+
const focusedMinute = state.focusedColumn === 2 && state.focusedTime[2];
|
23097
|
+
const secondTmpl = {
|
23098
|
+
text: 0,
|
23099
|
+
selected: false,
|
23100
|
+
disabled: false,
|
23101
|
+
hide: false
|
23102
|
+
};
|
23103
|
+
for (let i2 = 0; i2 < 60; i2 += step) {
|
23104
|
+
const second = JSON.parse(JSON.stringify(secondTmpl));
|
23105
|
+
second.text = i2;
|
23106
|
+
second.focused = i2 === focusedMinute;
|
23107
|
+
if (props2.disabledSeconds.length && props2.disabledSeconds.indexOf(i2) > -1) {
|
23108
|
+
second.disabled = true;
|
23109
|
+
if (props2.hideDisabledOptions) {
|
23110
|
+
second.hide = true;
|
23111
|
+
}
|
23112
|
+
}
|
23113
|
+
if (props2.seconds === i2) {
|
23114
|
+
second.selected = true;
|
23115
|
+
}
|
23116
|
+
seconds.push(second);
|
23117
|
+
}
|
23118
|
+
return seconds;
|
23119
|
+
});
|
23120
|
+
const styles = computed(() => ({
|
23121
|
+
width: props2.showSeconds ? "33.33%" : "50%"
|
23122
|
+
}));
|
23123
|
+
watch(() => props2.hours, (val) => {
|
23124
|
+
if (!state.compiled) {
|
23125
|
+
return;
|
23126
|
+
}
|
23127
|
+
scroll("hours", hoursList.value.findIndex((obj) => obj.text === val));
|
23128
|
+
});
|
23129
|
+
watch(() => props2.minutes, (val) => {
|
23130
|
+
if (!state.compiled) {
|
23131
|
+
return;
|
23132
|
+
}
|
23133
|
+
scroll("minutes", minutesList.value.findIndex((obj) => obj.text === val));
|
23134
|
+
});
|
23135
|
+
watch(() => props2.seconds, (val) => {
|
23136
|
+
if (!state.compiled) {
|
23137
|
+
return;
|
23138
|
+
}
|
23139
|
+
scroll("seconds", minutesList.value.findIndex((obj) => obj.text === val));
|
23140
|
+
});
|
23141
|
+
watch(() => state.focusedTime, (updated, old) => {
|
23142
|
+
timeParts.forEach((part, i2) => {
|
23143
|
+
if (updated[i2] === old[i2] || typeof updated[i2] === "undefined") {
|
23144
|
+
return;
|
23145
|
+
}
|
23146
|
+
const valueIndex = this[`${part}List`].findIndex((obj) => obj.text === updated[i2]);
|
23147
|
+
scroll(part, valueIndex);
|
23148
|
+
});
|
23149
|
+
});
|
23150
|
+
onMounted(() => {
|
23151
|
+
nextTick(() => {
|
23152
|
+
state.compiled = true;
|
23153
|
+
bindWheelEvent();
|
23154
|
+
});
|
23155
|
+
});
|
23156
|
+
function getDomRef(type) {
|
23157
|
+
let domRef;
|
23158
|
+
if (type === "hours") {
|
23159
|
+
domRef = hoursRef;
|
23160
|
+
} else if (type === "minutes") {
|
23161
|
+
domRef = minutesRef;
|
23162
|
+
} else {
|
23163
|
+
domRef = secondsRef;
|
23164
|
+
}
|
23165
|
+
return domRef.value;
|
23166
|
+
}
|
23167
|
+
function getCellCls(cell) {
|
23168
|
+
return ["bk-time-picker-cells-cell", {
|
23169
|
+
["bk-time-picker-cells-cell-selected"]: cell.selected,
|
23170
|
+
["bk-time-picker-cells-cell-focused"]: cell.focused,
|
23171
|
+
["bk-time-picker-cells-cell-disabled"]: cell.disabled
|
23172
|
+
}];
|
23173
|
+
}
|
23174
|
+
function bindWheelEvent() {
|
23175
|
+
const bindFunction = (type) => {
|
23176
|
+
const domRef = getDomRef(type);
|
23177
|
+
domRef.addEventListener("wheel", lodash.exports.debounce(() => {
|
23178
|
+
handleWheel(type);
|
23179
|
+
}, 32), {
|
23180
|
+
passive: true
|
23181
|
+
});
|
23182
|
+
};
|
23183
|
+
bindFunction("hours");
|
23184
|
+
bindFunction("minutes");
|
23185
|
+
bindFunction("seconds");
|
23186
|
+
}
|
23187
|
+
function typeItemHeight(type) {
|
23188
|
+
const domRef = getDomRef(type);
|
23189
|
+
return domRef.querySelector("li").offsetHeight;
|
23190
|
+
}
|
23191
|
+
function scrollBarHeight(type) {
|
23192
|
+
const domRef = getDomRef(type);
|
23193
|
+
return domRef.offsetHeight;
|
23194
|
+
}
|
23195
|
+
function handleWheel(type) {
|
23196
|
+
const domRef = getDomRef(type);
|
23197
|
+
const value = Math.min(Math.round((domRef.scrollTop - (scrollBarHeight(type) * 0.5 - 10) / typeItemHeight(type) + 3) / typeItemHeight(type)), type === "hours" ? 23 : 59);
|
23198
|
+
let list;
|
23199
|
+
if (type === "hours") {
|
23200
|
+
list = hoursList;
|
23201
|
+
} else if (type === "minutes") {
|
23202
|
+
list = minutesList;
|
23203
|
+
} else {
|
23204
|
+
list = secondsList;
|
23205
|
+
}
|
23206
|
+
const item = list.value.find((data2) => data2.text === value);
|
23207
|
+
if (item.disabled) {
|
23208
|
+
return false;
|
23209
|
+
}
|
23210
|
+
nextTick(() => {
|
23211
|
+
emitChange({
|
23212
|
+
[type]: value
|
23213
|
+
});
|
23214
|
+
});
|
23215
|
+
}
|
23216
|
+
function handleClick(type, cell) {
|
23217
|
+
if (cell.disabled) {
|
23218
|
+
return;
|
23219
|
+
}
|
23220
|
+
const data2 = {
|
23221
|
+
[type]: cell.text
|
23222
|
+
};
|
23223
|
+
emitChange(data2);
|
23224
|
+
}
|
23225
|
+
function emitChange(changes) {
|
23226
|
+
emit("change", changes);
|
23227
|
+
emit("pick-click");
|
23228
|
+
}
|
23229
|
+
function scroll(type, index) {
|
23230
|
+
const domRef = getDomRef(type);
|
23231
|
+
const from = domRef.scrollTop;
|
23232
|
+
const to = 32 * getScrollIndex(type, index);
|
23233
|
+
scrollTop(domRef, from, to, 500);
|
23234
|
+
}
|
23235
|
+
function getScrollIndex(type, index) {
|
23236
|
+
const t2 = firstUpperCase(type);
|
23237
|
+
const disabled = props2[`disabled${t2}`];
|
23238
|
+
let ret = index;
|
23239
|
+
if (disabled.length && props2.hideDisabledOptions) {
|
23240
|
+
let count = 0;
|
23241
|
+
disabled.forEach((item) => item <= index ? count += 1 : "");
|
23242
|
+
ret -= count;
|
23243
|
+
}
|
23244
|
+
return ret;
|
23245
|
+
}
|
23246
|
+
function updateScroll() {
|
23247
|
+
nextTick(() => {
|
23248
|
+
timeParts.forEach((type) => {
|
23249
|
+
const domRef = getDomRef(type);
|
23250
|
+
let list;
|
23251
|
+
if (type === "hours") {
|
23252
|
+
list = hoursList;
|
23253
|
+
} else if (type === "minutes") {
|
23254
|
+
list = minutesList;
|
23255
|
+
} else {
|
23256
|
+
list = secondsList;
|
23257
|
+
}
|
23258
|
+
domRef.scrollTop = 32 * list.value.findIndex((obj) => obj.text === props2[type]);
|
23259
|
+
});
|
23260
|
+
});
|
23261
|
+
}
|
23262
|
+
function padTime(text) {
|
23263
|
+
return text < 10 ? `0${text}` : text;
|
23264
|
+
}
|
23265
|
+
const hoursRef = ref(null);
|
23266
|
+
const minutesRef = ref(null);
|
23267
|
+
const secondsRef = ref(null);
|
23268
|
+
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
23269
|
+
hoursList,
|
23270
|
+
minutesList,
|
23271
|
+
secondsList,
|
23272
|
+
styles,
|
23273
|
+
hoursRef,
|
23274
|
+
minutesRef,
|
23275
|
+
secondsRef,
|
23276
|
+
getCellCls,
|
23277
|
+
handleClick,
|
23278
|
+
updateScroll,
|
23279
|
+
padTime
|
23280
|
+
});
|
23281
|
+
},
|
23282
|
+
render() {
|
23283
|
+
return createVNode("div", {
|
23284
|
+
"class": ["bk-time-picker-cells", this.showSeconds ? "bk-time-picker-cells-with-seconds" : ""]
|
23285
|
+
}, [createVNode("div", {
|
23286
|
+
"class": "bk-time-picker-cells-title-wrapper"
|
23287
|
+
}, [createVNode("div", {
|
23288
|
+
"class": ["bk-time-picker-cells-title", this.focusedColumn === 0 ? "active" : ""],
|
23289
|
+
"style": this.styles
|
23290
|
+
}, [createTextVNode("\u65F6")]), createVNode("div", {
|
23291
|
+
"class": ["bk-time-picker-cells-title", this.focusedColumn === 1 ? "active" : ""],
|
23292
|
+
"style": this.styles
|
23293
|
+
}, [createTextVNode("\u5206")]), withDirectives(createVNode("div", {
|
23294
|
+
"class": ["bk-time-picker-cells-title", this.focusedColumn === 2 ? "active" : ""],
|
23295
|
+
"style": this.styles
|
23296
|
+
}, [createTextVNode("\u79D2")]), [[vShow, this.showSeconds]])]), createVNode("div", {
|
23297
|
+
"class": "bk-time-picker-cells-list",
|
23298
|
+
"ref": "hoursRef",
|
23299
|
+
"style": this.styles
|
23300
|
+
}, [createVNode("ul", {
|
23301
|
+
"class": "bk-time-picker-cells-ul"
|
23302
|
+
}, [this.hoursList.map((item) => withDirectives(createVNode("li", {
|
23303
|
+
"class": this.getCellCls(item),
|
23304
|
+
"onClick": () => this.handleClick("hours", item)
|
23305
|
+
}, [this.padTime(item.text)]), [[vShow, !item.hide]]))])]), createVNode("div", {
|
23306
|
+
"class": "bk-time-picker-cells-list",
|
23307
|
+
"ref": "minutesRef",
|
23308
|
+
"style": this.styles
|
23309
|
+
}, [createVNode("ul", {
|
23310
|
+
"class": "bk-time-picker-cells-ul"
|
23311
|
+
}, [this.minutesList.map((item) => withDirectives(createVNode("li", {
|
23312
|
+
"class": this.getCellCls(item),
|
23313
|
+
"onClick": () => this.handleClick("minutes", item)
|
23314
|
+
}, [this.padTime(item.text)]), [[vShow, !item.hide]]))])]), withDirectives(createVNode("div", {
|
23315
|
+
"class": "bk-time-picker-cells-list",
|
23316
|
+
"ref": "secondsRef",
|
23317
|
+
"style": this.styles
|
23318
|
+
}, [createVNode("ul", {
|
23319
|
+
"class": "bk-time-picker-cells-ul"
|
23320
|
+
}, [this.secondsList.map((item) => withDirectives(createVNode("li", {
|
23321
|
+
"class": this.getCellCls(item),
|
23322
|
+
"onClick": () => this.handleClick("seconds", item)
|
23323
|
+
}, [this.padTime(item.text)]), [[vShow, !item.hide]]))])]), [[vShow, this.showSeconds]])]);
|
23324
|
+
}
|
23325
|
+
});
|
23326
|
+
const timeProps = {
|
23327
|
+
disabledDate: {
|
23328
|
+
type: Function,
|
23329
|
+
default: () => false
|
23330
|
+
},
|
23331
|
+
steps: {
|
23332
|
+
type: Array,
|
23333
|
+
default: () => []
|
23334
|
+
},
|
23335
|
+
format: {
|
23336
|
+
type: String,
|
23337
|
+
default: "HH:mm:ss"
|
23338
|
+
},
|
23339
|
+
value: {
|
23340
|
+
type: Array,
|
23341
|
+
required: true
|
23342
|
+
},
|
23343
|
+
confirm: {
|
23344
|
+
type: Boolean,
|
23345
|
+
default: false
|
23346
|
+
}
|
23347
|
+
};
|
23348
|
+
var TimePanel = defineComponent({
|
23349
|
+
name: "TimePickerPanel",
|
23350
|
+
props: __spreadValues(__spreadValues(__spreadValues({}, datePickerProps), timePanelProps), timeProps),
|
23351
|
+
emits: ["pick", "pick-click"],
|
23352
|
+
setup(props2, {
|
23353
|
+
emit
|
23354
|
+
}) {
|
23355
|
+
const state = reactive({
|
23356
|
+
date: props2.value[0] || initTime(),
|
23357
|
+
showDate: false
|
23358
|
+
});
|
23359
|
+
const parentProvide = inject(timePickerKey);
|
23360
|
+
const timeSpinnerRef = ref(null);
|
23361
|
+
const showSeconds = computed(() => !(props2.format || "").match(/mm$/));
|
23362
|
+
const visibleDate = computed(() => fecha.format(parentProvide.panelDate, props2.format));
|
23363
|
+
const timeSlots = computed(() => {
|
23364
|
+
if (!props2.value[0]) {
|
23365
|
+
return [];
|
23366
|
+
}
|
23367
|
+
return ["getHours", "getMinutes", "getSeconds"].map((slot) => state.date[slot]());
|
23368
|
+
});
|
23369
|
+
const disabledHMS = computed(() => {
|
23370
|
+
const disabledTypes = ["disabledHours", "disabledMinutes", "disabledSeconds"];
|
23371
|
+
if (props2.disabledDate === (() => !props2.value[0])) {
|
23372
|
+
const disabled2 = disabledTypes.reduce((obj, type) => {
|
23373
|
+
obj[type] = this[type];
|
23374
|
+
return obj;
|
23375
|
+
}, {});
|
23376
|
+
return disabled2;
|
23377
|
+
}
|
23378
|
+
const slots = [24, 60, 60];
|
23379
|
+
const disabled = ["Hours", "Minutes", "Seconds"].map((type) => props2[`disabled${type}`]);
|
23380
|
+
const disabledHMS2 = disabled.map((preDisabled, j2) => {
|
23381
|
+
const slot = slots[j2];
|
23382
|
+
const toDisable = preDisabled;
|
23383
|
+
for (let i2 = 0; i2 < slot; i2 += props2.steps[j2] || 1) {
|
23384
|
+
const hms = timeSlots.value.map((slot2, x2) => x2 === j2 ? i2 : slot2);
|
23385
|
+
const testDateTime = mergeDateHMS(state.date, ...hms);
|
23386
|
+
if (props2.disabledDate(testDateTime, true)) {
|
23387
|
+
toDisable.push(i2);
|
23388
|
+
}
|
23389
|
+
}
|
23390
|
+
return toDisable.filter((el, i2, arr) => arr.indexOf(el) === i2);
|
23391
|
+
});
|
23392
|
+
return disabledTypes.reduce((obj, type, i2) => {
|
23393
|
+
obj[type] = disabledHMS2[i2];
|
23394
|
+
return obj;
|
23395
|
+
}, {});
|
23396
|
+
});
|
23397
|
+
watch(() => props2.value, (dates) => {
|
23398
|
+
let newVal = dates[0] || initTime();
|
23399
|
+
newVal = new Date(newVal);
|
23400
|
+
state.date = newVal;
|
23401
|
+
});
|
23402
|
+
onMounted(() => {
|
23403
|
+
if (parentProvide && parentProvide.parentName === "DatePanel") {
|
23404
|
+
state.showDate = true;
|
23405
|
+
}
|
23406
|
+
});
|
23407
|
+
function handleChange(date, isEmit = true) {
|
23408
|
+
const newDate = new Date(state.date);
|
23409
|
+
Object.keys(date).forEach((type) => newDate[`set${capitalize(type)}`](date[type]));
|
23410
|
+
if (isEmit) {
|
23411
|
+
emit("pick", newDate, true, "time");
|
23412
|
+
}
|
23413
|
+
}
|
23414
|
+
function handlePickClick() {
|
23415
|
+
emit("pick-click");
|
23416
|
+
}
|
23417
|
+
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
23418
|
+
visibleDate,
|
23419
|
+
showSeconds,
|
23420
|
+
timeSlots,
|
23421
|
+
disabledHMS,
|
23422
|
+
timeSpinnerRef,
|
23423
|
+
handlePickClick,
|
23424
|
+
handleChange
|
23425
|
+
});
|
23426
|
+
},
|
23427
|
+
render() {
|
23428
|
+
return createVNode("div", {
|
23429
|
+
"class": "bk-picker-panel-body-wrapper",
|
23430
|
+
"onMousedown": (e) => {
|
23431
|
+
e.preventDefault();
|
23432
|
+
}
|
23433
|
+
}, [createVNode("div", {
|
23434
|
+
"class": "bk-picker-panel-body",
|
23435
|
+
"style": {
|
23436
|
+
width: `${this.width}px`
|
23437
|
+
}
|
23438
|
+
}, [this.showDate ? createVNode("div", {
|
23439
|
+
"class": "bk-time-picker-header"
|
23440
|
+
}, [this.visibleDate]) : "", createVNode("div", {
|
23441
|
+
"class": "bk-picker-panel-content"
|
23442
|
+
}, [createVNode(TimeSpinner, {
|
23443
|
+
"ref": "timeSpinnerRef",
|
23444
|
+
"showSeconds": this.showSeconds,
|
23445
|
+
"steps": this.steps,
|
23446
|
+
"hours": this.timeSlots[0],
|
23447
|
+
"minutes": this.timeSlots[1],
|
23448
|
+
"seconds": this.timeSlots[2],
|
23449
|
+
"disabledHours": this.disabledHMS.disabledHours,
|
23450
|
+
"disabledMinutes": this.disabledHMS.disabledMinutes,
|
23451
|
+
"disabledSeconds": this.disabledHMS.disabledSeconds,
|
23452
|
+
"hideDisabledOptions": this.hideDisabledOptions,
|
23453
|
+
"onPick-click": this.handlePickClick,
|
23454
|
+
"onChange": this.handleChange
|
23455
|
+
}, null)])])]);
|
23456
|
+
}
|
23457
|
+
});
|
22763
23458
|
const datePanelProps = {
|
22764
23459
|
modelValue: {
|
22765
23460
|
type: [Date, String, Number, Array]
|
@@ -22806,11 +23501,20 @@ const datePanelProps = {
|
|
22806
23501
|
showTime: {
|
22807
23502
|
type: Boolean,
|
22808
23503
|
default: false
|
23504
|
+
},
|
23505
|
+
format: {
|
23506
|
+
type: String,
|
23507
|
+
default: "yyyy-MM-dd"
|
23508
|
+
},
|
23509
|
+
disabledDate: {
|
23510
|
+
type: Function,
|
23511
|
+
default: () => false
|
22809
23512
|
}
|
22810
23513
|
};
|
22811
23514
|
var DatePanel = defineComponent({
|
23515
|
+
name: "DatePanel",
|
22812
23516
|
props: datePanelProps,
|
22813
|
-
emits: ["pick", "pick-success", "pick-clear"],
|
23517
|
+
emits: ["pick", "pick-success", "pick-clear", "pick-click", "selection-mode-change"],
|
22814
23518
|
setup(props2, {
|
22815
23519
|
slots,
|
22816
23520
|
emit
|
@@ -22823,6 +23527,30 @@ var DatePanel = defineComponent({
|
|
22823
23527
|
dates,
|
22824
23528
|
panelDate: props2.startDate || dates[0] || new Date()
|
22825
23529
|
});
|
23530
|
+
const {
|
23531
|
+
proxy
|
23532
|
+
} = getCurrentInstance();
|
23533
|
+
provide(timePickerKey, {
|
23534
|
+
panelDate: state.panelDate,
|
23535
|
+
parentName: proxy.$options.name
|
23536
|
+
});
|
23537
|
+
const timePickerRef = ref(null);
|
23538
|
+
const timeSpinnerRef = ref(null);
|
23539
|
+
const timeSpinnerEndRef = ref(null);
|
23540
|
+
watch(() => state.currentView, (val) => {
|
23541
|
+
console.error(11111, val);
|
23542
|
+
emit("selection-mode-change", val);
|
23543
|
+
if (state.currentView === "time") {
|
23544
|
+
nextTick(() => {
|
23545
|
+
const spinner2 = timePickerRef.value.timeSpinnerRef;
|
23546
|
+
spinner2.updateScroll();
|
23547
|
+
});
|
23548
|
+
}
|
23549
|
+
});
|
23550
|
+
watch(() => props2.selectionMode, (type) => {
|
23551
|
+
state.currentView = type;
|
23552
|
+
state.pickerTable = getTableType(type);
|
23553
|
+
});
|
22826
23554
|
const resetView = () => {
|
22827
23555
|
setTimeout(() => {
|
22828
23556
|
state.currentView = props2.selectionMode;
|
@@ -22881,13 +23609,11 @@ var DatePanel = defineComponent({
|
|
22881
23609
|
const changeMonth = (dir) => {
|
22882
23610
|
state.panelDate = siblingMonth(state.panelDate, dir);
|
22883
23611
|
};
|
22884
|
-
const timeSpinner = ref(null);
|
22885
|
-
const timeSpinnerEnd = ref(null);
|
22886
23612
|
const onToggleVisibility = (open) => {
|
22887
23613
|
var _a, _b;
|
22888
23614
|
if (open) {
|
22889
|
-
(_a =
|
22890
|
-
(_b =
|
23615
|
+
(_a = timeSpinnerRef == null ? void 0 : timeSpinnerRef.value) == null ? void 0 : _a.updateScroll();
|
23616
|
+
(_b = timeSpinnerEndRef == null ? void 0 : timeSpinnerEndRef.value) == null ? void 0 : _b.updateScroll();
|
22891
23617
|
}
|
22892
23618
|
};
|
22893
23619
|
const panelPickerHandlers = computed(() => state.pickerTable === `${state.currentView}-table` ? handlePick : handlePreSelection);
|
@@ -22918,6 +23644,10 @@ var DatePanel = defineComponent({
|
|
22918
23644
|
state.currentView = state.currentView === "time" ? "date" : "time";
|
22919
23645
|
};
|
22920
23646
|
const hasShortcuts = computed(() => !!slots.shortcuts);
|
23647
|
+
const timeDisabled = computed(() => !state.dates[0]);
|
23648
|
+
function handlePickClick() {
|
23649
|
+
emit("pick-click");
|
23650
|
+
}
|
22921
23651
|
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
22922
23652
|
panelPickerHandlers,
|
22923
23653
|
datePanelLabel,
|
@@ -22929,10 +23659,14 @@ var DatePanel = defineComponent({
|
|
22929
23659
|
reset: reset2,
|
22930
23660
|
isTime,
|
22931
23661
|
hasShortcuts,
|
23662
|
+
timeDisabled,
|
22932
23663
|
onToggleVisibility,
|
22933
23664
|
handleToggleTime,
|
22934
23665
|
handlePickSuccess,
|
22935
|
-
handlePickClear
|
23666
|
+
handlePickClear,
|
23667
|
+
handlePick,
|
23668
|
+
handlePickClick,
|
23669
|
+
timePickerRef
|
22936
23670
|
});
|
22937
23671
|
},
|
22938
23672
|
render() {
|
@@ -23006,7 +23740,15 @@ var DatePanel = defineComponent({
|
|
23006
23740
|
default:
|
23007
23741
|
return null;
|
23008
23742
|
}
|
23009
|
-
})() :
|
23743
|
+
})() : createVNode(TimePanel, {
|
23744
|
+
"ref": "timePickerRef",
|
23745
|
+
"value": this.dates,
|
23746
|
+
"format": this.format,
|
23747
|
+
"disabledDate": this.disabledDate,
|
23748
|
+
"onPick": this.handlePick,
|
23749
|
+
"onPick-clear": this.handlePickClear,
|
23750
|
+
"onPick-success": this.handlePickSuccess
|
23751
|
+
}, null)]), this.confirm ? createVNode(Confirm, {
|
23010
23752
|
"clearable": this.clearable,
|
23011
23753
|
"showTime": this.showTime,
|
23012
23754
|
"isTime": this.isTime,
|
@@ -23038,6 +23780,10 @@ const dateRangePanelProps = {
|
|
23038
23780
|
type: Array,
|
23039
23781
|
default: () => []
|
23040
23782
|
},
|
23783
|
+
shortcutClose: {
|
23784
|
+
type: Boolean,
|
23785
|
+
default: false
|
23786
|
+
},
|
23041
23787
|
clearable: {
|
23042
23788
|
type: Boolean,
|
23043
23789
|
default: true
|
@@ -23046,10 +23792,6 @@ const dateRangePanelProps = {
|
|
23046
23792
|
type: Boolean,
|
23047
23793
|
default: true
|
23048
23794
|
},
|
23049
|
-
shortcutClose: {
|
23050
|
-
type: Boolean,
|
23051
|
-
default: false
|
23052
|
-
},
|
23053
23795
|
showTime: {
|
23054
23796
|
type: Boolean,
|
23055
23797
|
default: false
|
@@ -23084,7 +23826,7 @@ const dateRangePanelProps = {
|
|
23084
23826
|
};
|
23085
23827
|
var DateRangePanel = defineComponent({
|
23086
23828
|
props: dateRangePanelProps,
|
23087
|
-
emits: ["pick"],
|
23829
|
+
emits: ["pick", "pick-success"],
|
23088
23830
|
setup(props2, {
|
23089
23831
|
slots,
|
23090
23832
|
emit
|
@@ -23236,6 +23978,18 @@ var DateRangePanel = defineComponent({
|
|
23236
23978
|
changePanelDate(otherPanel, "Month", increment, false);
|
23237
23979
|
}
|
23238
23980
|
};
|
23981
|
+
const handleShortcutClick = (shortcut, index) => {
|
23982
|
+
if (!(shortcut == null ? void 0 : shortcut.value)) {
|
23983
|
+
return false;
|
23984
|
+
}
|
23985
|
+
if (shortcut.onClick) {
|
23986
|
+
shortcut.onClick(shortcut, index);
|
23987
|
+
}
|
23988
|
+
emit("pick", typeof shortcut.value === "function" ? shortcut.value() : shortcut.value, false, props2.type, shortcut);
|
23989
|
+
if (props2.shortcutClose) {
|
23990
|
+
emit("pick-success");
|
23991
|
+
}
|
23992
|
+
};
|
23239
23993
|
const handleChangeRange = (val) => {
|
23240
23994
|
state.rangeState.to = val;
|
23241
23995
|
};
|
@@ -23262,7 +24016,10 @@ var DateRangePanel = defineComponent({
|
|
23262
24016
|
left: preSelecting.value.left ? handlePreSelection.bind("left") : handleRangePick,
|
23263
24017
|
right: preSelecting.value.right ? handlePreSelection.bind("right") : handleRangePick
|
23264
24018
|
}));
|
23265
|
-
const hasShortcuts = computed(() =>
|
24019
|
+
const hasShortcuts = computed(() => {
|
24020
|
+
var _a;
|
24021
|
+
return slots.shortcuts || ((_a = props2.shortcuts) == null ? void 0 : _a.length);
|
24022
|
+
});
|
23266
24023
|
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
23267
24024
|
isTime,
|
23268
24025
|
hasShortcuts,
|
@@ -23280,6 +24037,7 @@ var DateRangePanel = defineComponent({
|
|
23280
24037
|
rightShowLabelSecond,
|
23281
24038
|
preSelecting,
|
23282
24039
|
panelPickerHandlers,
|
24040
|
+
handleShortcutClick,
|
23283
24041
|
reset: reset2,
|
23284
24042
|
onToggleVisibility,
|
23285
24043
|
handleRangePick,
|
@@ -23425,156 +24183,15 @@ var DateRangePanel = defineComponent({
|
|
23425
24183
|
}
|
23426
24184
|
})() : ""]), [[vShow, !this.isTime]])]), this.hasShortcuts ? createVNode("div", {
|
23427
24185
|
"class": "bk-picker-panel-sidebar"
|
23428
|
-
}, [(_c = (_b = (_a = this.$slots).shortcuts) == null ? void 0 : _b.call(_a)) != null ? _c :
|
24186
|
+
}, [((_c = (_b = (_a = this.$slots).shortcuts) == null ? void 0 : _b.call(_a)) != null ? _c : this.shortcuts.length) ? createVNode("div", {
|
24187
|
+
"class": "bk-picker-panel-shortcuts"
|
24188
|
+
}, [this.shortcuts.map((item, index) => createVNode("div", {
|
24189
|
+
"key": index,
|
24190
|
+
"class": "shortcuts-item",
|
24191
|
+
"onClick": () => this.handleShortcutClick(item, index)
|
24192
|
+
}, [item.text]))]) : ""]) : null]);
|
23429
24193
|
}
|
23430
24194
|
});
|
23431
|
-
const datePickerProps = {
|
23432
|
-
type: {
|
23433
|
-
type: String,
|
23434
|
-
default: "date",
|
23435
|
-
validator(value) {
|
23436
|
-
const validList = ["year", "month", "date", "daterange", "datetime", "datetimerange", "time", "timerange"];
|
23437
|
-
if (validList.indexOf(value) < 0) {
|
23438
|
-
console.error(`type property is not valid: '${value}'`);
|
23439
|
-
return false;
|
23440
|
-
}
|
23441
|
-
return true;
|
23442
|
-
}
|
23443
|
-
},
|
23444
|
-
extPopoverCls: {
|
23445
|
-
type: String,
|
23446
|
-
default: ""
|
23447
|
-
},
|
23448
|
-
format: String,
|
23449
|
-
readonly: {
|
23450
|
-
type: Boolean,
|
23451
|
-
default: false
|
23452
|
-
},
|
23453
|
-
disabled: {
|
23454
|
-
type: Boolean,
|
23455
|
-
default: false
|
23456
|
-
},
|
23457
|
-
editable: {
|
23458
|
-
type: Boolean,
|
23459
|
-
default: true
|
23460
|
-
},
|
23461
|
-
clearable: {
|
23462
|
-
type: Boolean,
|
23463
|
-
default: true
|
23464
|
-
},
|
23465
|
-
open: {
|
23466
|
-
type: Boolean,
|
23467
|
-
default: null
|
23468
|
-
},
|
23469
|
-
multiple: {
|
23470
|
-
type: Boolean,
|
23471
|
-
default: false
|
23472
|
-
},
|
23473
|
-
timePickerOptions: {
|
23474
|
-
type: Object,
|
23475
|
-
default: () => ({})
|
23476
|
-
},
|
23477
|
-
splitPanels: {
|
23478
|
-
type: Boolean,
|
23479
|
-
default: true
|
23480
|
-
},
|
23481
|
-
startDate: Date,
|
23482
|
-
placeholder: {
|
23483
|
-
type: String,
|
23484
|
-
default: ""
|
23485
|
-
},
|
23486
|
-
placement: {
|
23487
|
-
type: String,
|
23488
|
-
default: "bottom-start",
|
23489
|
-
validator: (value) => {
|
23490
|
-
const validList = [
|
23491
|
-
"top",
|
23492
|
-
"top-start",
|
23493
|
-
"top-end",
|
23494
|
-
"bottom",
|
23495
|
-
"bottom-start",
|
23496
|
-
"bottom-end",
|
23497
|
-
"left",
|
23498
|
-
"left-start",
|
23499
|
-
"left-end",
|
23500
|
-
"right",
|
23501
|
-
"right-start",
|
23502
|
-
"right-end"
|
23503
|
-
];
|
23504
|
-
if (validList.indexOf(value) < 0) {
|
23505
|
-
console.error(`placement property is not valid: '${value}'`);
|
23506
|
-
return false;
|
23507
|
-
}
|
23508
|
-
return true;
|
23509
|
-
}
|
23510
|
-
},
|
23511
|
-
transfer: {
|
23512
|
-
type: Boolean,
|
23513
|
-
default: false
|
23514
|
-
},
|
23515
|
-
appendToBody: {
|
23516
|
-
type: Boolean,
|
23517
|
-
default: false
|
23518
|
-
},
|
23519
|
-
shortcuts: {
|
23520
|
-
type: Array,
|
23521
|
-
default: () => []
|
23522
|
-
},
|
23523
|
-
shortcutClose: {
|
23524
|
-
type: Boolean,
|
23525
|
-
default: false
|
23526
|
-
},
|
23527
|
-
modelValue: {
|
23528
|
-
type: [Date, String, Number, Array]
|
23529
|
-
},
|
23530
|
-
value: {
|
23531
|
-
type: [Date, String, Number, Array]
|
23532
|
-
},
|
23533
|
-
options: {
|
23534
|
-
type: Object,
|
23535
|
-
default: () => ({})
|
23536
|
-
},
|
23537
|
-
fontSize: {
|
23538
|
-
type: String,
|
23539
|
-
default: "normal"
|
23540
|
-
},
|
23541
|
-
upToNow: {
|
23542
|
-
type: Boolean,
|
23543
|
-
default: false
|
23544
|
-
},
|
23545
|
-
useShortcutText: {
|
23546
|
-
type: Boolean,
|
23547
|
-
default: false
|
23548
|
-
},
|
23549
|
-
shortcutSelectedIndex: {
|
23550
|
-
type: Number,
|
23551
|
-
default: -1
|
23552
|
-
},
|
23553
|
-
headerSlotCls: {
|
23554
|
-
type: String,
|
23555
|
-
default: ""
|
23556
|
-
},
|
23557
|
-
footerSlotCls: {
|
23558
|
-
type: String,
|
23559
|
-
default: ""
|
23560
|
-
},
|
23561
|
-
allowCrossDay: {
|
23562
|
-
type: Boolean,
|
23563
|
-
default: false
|
23564
|
-
},
|
23565
|
-
behavior: {
|
23566
|
-
type: String,
|
23567
|
-
default: "normal",
|
23568
|
-
validator(v2) {
|
23569
|
-
return ["simplicity", "normal"].indexOf(v2) > -1;
|
23570
|
-
}
|
23571
|
-
},
|
23572
|
-
disableDate: Function,
|
23573
|
-
withValidate: {
|
23574
|
-
type: Boolean,
|
23575
|
-
default: true
|
23576
|
-
}
|
23577
|
-
};
|
23578
24195
|
var Component$9 = defineComponent({
|
23579
24196
|
name: "DatePicker",
|
23580
24197
|
directives: {
|
@@ -23590,7 +24207,8 @@ var Component$9 = defineComponent({
|
|
23590
24207
|
const formItem = useFormItem();
|
23591
24208
|
const isRange = props2.type.includes("range");
|
23592
24209
|
const emptyArray = isRange ? [null, null] : [null];
|
23593
|
-
|
24210
|
+
const initialArr = isRange ? props2.value || props2.modelValue : [props2.value || props2.modelValue];
|
24211
|
+
let initialValue = isAllEmptyArr(initialArr) ? emptyArray : parseDate(props2.value || props2.modelValue, props2.type, props2.multiple, props2.format);
|
23594
24212
|
let shortcut = null;
|
23595
24213
|
if (props2.shortcutSelectedIndex !== -1) {
|
23596
24214
|
shortcut = props2.shortcuts[props2.shortcutSelectedIndex] || null;
|
@@ -23689,6 +24307,7 @@ var Component$9 = defineComponent({
|
|
23689
24307
|
}
|
23690
24308
|
return !props2.editable || props2.readonly;
|
23691
24309
|
});
|
24310
|
+
const ownPickerProps = computed(() => props2.options);
|
23692
24311
|
const allowCrossDayProp = computed(() => panel.value === "RangeTimePickerPanel" ? props2.allowCrossDay : false);
|
23693
24312
|
const inputRef = ref(null);
|
23694
24313
|
const inputFocus = () => {
|
@@ -23891,11 +24510,6 @@ var Component$9 = defineComponent({
|
|
23891
24510
|
state.shortcut = null;
|
23892
24511
|
setTimeout(() => onSelectionModeChange(props2.type), 500);
|
23893
24512
|
};
|
23894
|
-
const handleTransferClick = () => {
|
23895
|
-
if (props2.appendToBody) {
|
23896
|
-
state.disableCloseUnderTransfer = true;
|
23897
|
-
}
|
23898
|
-
};
|
23899
24513
|
const onPickSuccess = () => {
|
23900
24514
|
var _a;
|
23901
24515
|
state.visible = false;
|
@@ -23951,6 +24565,7 @@ var Component$9 = defineComponent({
|
|
23951
24565
|
longWidthCls,
|
23952
24566
|
localReadonly,
|
23953
24567
|
allowCrossDayProp,
|
24568
|
+
ownPickerProps,
|
23954
24569
|
pickerDropdownRef,
|
23955
24570
|
inputRef,
|
23956
24571
|
triggerRef,
|
@@ -23964,7 +24579,6 @@ var Component$9 = defineComponent({
|
|
23964
24579
|
handleKeydown,
|
23965
24580
|
handleInputChange,
|
23966
24581
|
handleClear,
|
23967
|
-
handleTransferClick,
|
23968
24582
|
onPick,
|
23969
24583
|
onPickSuccess
|
23970
24584
|
});
|
@@ -24039,7 +24653,9 @@ var Component$9 = defineComponent({
|
|
24039
24653
|
const shortcutsSlot = this.hasShortcuts ? {
|
24040
24654
|
shortcuts: () => {
|
24041
24655
|
var _a2, _b2;
|
24042
|
-
return ((_b2 = (_a2 = this.$slots).shortcuts) == null ? void 0 : _b2.call(_a2
|
24656
|
+
return ((_b2 = (_a2 = this.$slots).shortcuts) == null ? void 0 : _b2.call(_a2, {
|
24657
|
+
change: this.onPick
|
24658
|
+
})) || null;
|
24043
24659
|
}
|
24044
24660
|
} : {};
|
24045
24661
|
return withDirectives(createVNode("div", {
|
@@ -24062,8 +24678,7 @@ var Component$9 = defineComponent({
|
|
24062
24678
|
"triggerRef": this.triggerRef,
|
24063
24679
|
"placement": this.placement,
|
24064
24680
|
"extPopoverCls": this.extPopoverCls,
|
24065
|
-
"appendToBody": this.appendToBody
|
24066
|
-
"onClick": this.handleTransferClick
|
24681
|
+
"appendToBody": this.appendToBody
|
24067
24682
|
}, {
|
24068
24683
|
default: () => {
|
24069
24684
|
var _a2, _b2, _c2, _d, _e, _f;
|
@@ -24074,13 +24689,15 @@ var Component$9 = defineComponent({
|
|
24074
24689
|
"type": this.type,
|
24075
24690
|
"confirm": this.isConfirm,
|
24076
24691
|
"shortcuts": this.shortcuts,
|
24692
|
+
"shortcutClose": this.shortcutClose,
|
24077
24693
|
"modelValue": this.internalValue,
|
24078
24694
|
"selectionMode": this.selectionMode,
|
24079
24695
|
"startDate": this.startDate,
|
24080
24696
|
"disableDate": this.disableDate,
|
24081
24697
|
"focusedDate": this.focusedDate,
|
24082
24698
|
"onPick": this.onPick,
|
24083
|
-
"onPick-success": this.onPickSuccess
|
24699
|
+
"onPick-success": this.onPickSuccess,
|
24700
|
+
"onSelection-mode-change": this.onSelectionModeChange
|
24084
24701
|
}, shortcutsSlot) : createVNode(DatePanel, {
|
24085
24702
|
"ref": "pickerPanelRef",
|
24086
24703
|
"clearable": this.clearable,
|
@@ -24096,7 +24713,539 @@ var Component$9 = defineComponent({
|
|
24096
24713
|
"focusedDate": this.focusedDate,
|
24097
24714
|
"onPick": this.onPick,
|
24098
24715
|
"onPick-clear": this.handleClear,
|
24099
|
-
"onPick-success": this.onPickSuccess
|
24716
|
+
"onPick-success": this.onPickSuccess,
|
24717
|
+
"onSelection-mode-change": this.onSelectionModeChange
|
24718
|
+
}, shortcutsSlot), this.hasFooter ? createVNode("div", {
|
24719
|
+
"class": ["bk-date-picker-footer-wrapper", this.footerSlotCls]
|
24720
|
+
}, [(_f = (_e = (_d = this.$slots).footer) == null ? void 0 : _e.call(_d)) != null ? _f : null]) : null];
|
24721
|
+
}
|
24722
|
+
}), [[vShow, this.opened]])]
|
24723
|
+
})]
|
24724
|
+
})]), [[resolveDirective("clickoutside"), this.handleClose]]);
|
24725
|
+
}
|
24726
|
+
});
|
24727
|
+
var TimePicker = defineComponent({
|
24728
|
+
name: "TimePicker",
|
24729
|
+
directives: {
|
24730
|
+
clickoutside: ClickOutside
|
24731
|
+
},
|
24732
|
+
props: __spreadValues(__spreadValues(__spreadValues({}, datePickerProps), timePickerProps), timePanelProps),
|
24733
|
+
emits: ["open-change", "input", "change", "update:modelValue", "clear", "shortcut-change", "pick-success"],
|
24734
|
+
slots: ["header"],
|
24735
|
+
setup(props2, {
|
24736
|
+
slots,
|
24737
|
+
emit
|
24738
|
+
}) {
|
24739
|
+
const formItem = useFormItem();
|
24740
|
+
const isRange = props2.type.includes("range");
|
24741
|
+
const emptyArray = isRange ? [null, null] : [null];
|
24742
|
+
let initialValue = isAllEmptyArr((isRange ? props2.modelValue : [props2.modelValue]) || []) ? emptyArray : parseDate(props2.modelValue, props2.type, props2.multiple, props2.format);
|
24743
|
+
let shortcut = null;
|
24744
|
+
if (props2.shortcutSelectedIndex !== -1) {
|
24745
|
+
shortcut = props2.shortcuts[props2.shortcutSelectedIndex] || null;
|
24746
|
+
if (shortcut) {
|
24747
|
+
initialValue = shortcut.value();
|
24748
|
+
}
|
24749
|
+
}
|
24750
|
+
const state = reactive({
|
24751
|
+
showClose: false,
|
24752
|
+
visible: false,
|
24753
|
+
internalValue: initialValue,
|
24754
|
+
disableClickOutSide: false,
|
24755
|
+
disableCloseUnderTransfer: false,
|
24756
|
+
selectionMode: "date",
|
24757
|
+
forceInputRerender: 1,
|
24758
|
+
isFocused: false,
|
24759
|
+
focusedDate: initialValue[0] || props2.startDate || new Date(),
|
24760
|
+
focusedTime: {
|
24761
|
+
column: 0,
|
24762
|
+
picker: 0,
|
24763
|
+
time: initialValue.map(extractTime),
|
24764
|
+
active: false
|
24765
|
+
},
|
24766
|
+
internalFocus: false,
|
24767
|
+
timeEnterMode: true,
|
24768
|
+
shortcut,
|
24769
|
+
onSelectionModeChange
|
24770
|
+
});
|
24771
|
+
function onSelectionModeChange(_type) {
|
24772
|
+
let type = _type;
|
24773
|
+
if (_type.match(/^date/)) {
|
24774
|
+
type = "date";
|
24775
|
+
}
|
24776
|
+
state.selectionMode = ["year", "month", "date", "time"].indexOf(type) > -1 && type;
|
24777
|
+
return state.selectionMode;
|
24778
|
+
}
|
24779
|
+
const publicVModelValue = computed(() => {
|
24780
|
+
if (props2.multiple) {
|
24781
|
+
return state.internalValue.slice();
|
24782
|
+
}
|
24783
|
+
const isRange2 = props2.type.includes("range");
|
24784
|
+
let val = state.internalValue.map((date) => date instanceof Date ? new Date(date) : date || "");
|
24785
|
+
if (props2.type.match(/^time/)) {
|
24786
|
+
val = val.map((v2) => formatDate(v2, props2.type, props2.multiple, props2.format));
|
24787
|
+
}
|
24788
|
+
return isRange2 || props2.multiple ? val : val[0];
|
24789
|
+
});
|
24790
|
+
const publicStringValue = computed(() => {
|
24791
|
+
if (props2.type.match(/^time/)) {
|
24792
|
+
return publicVModelValue.value;
|
24793
|
+
}
|
24794
|
+
if (props2.multiple) {
|
24795
|
+
return formatDate(publicVModelValue.value, props2.type, props2.multiple, props2.format);
|
24796
|
+
}
|
24797
|
+
return Array.isArray(publicVModelValue.value) ? publicVModelValue.value.map((v2) => formatDate(v2, props2.type, props2.multiple, props2.format)) : formatDate(publicVModelValue.value, props2.type, props2.multiple, props2.format);
|
24798
|
+
});
|
24799
|
+
const panel = computed(() => {
|
24800
|
+
const isRange2 = props2.type === "timerange";
|
24801
|
+
return isRange2 ? "RangeTimePickerPanel" : "TimePickerPanel";
|
24802
|
+
});
|
24803
|
+
const opened = computed(() => props2.open === null ? state.visible : props2.open);
|
24804
|
+
const visualValue = computed(() => formatDate(state.internalValue, props2.type, props2.multiple, props2.format));
|
24805
|
+
const displayValue = computed(() => {
|
24806
|
+
var _a;
|
24807
|
+
if (((_a = state.shortcut) == null ? void 0 : _a.text) && props2.useShortcutText) {
|
24808
|
+
return state.shortcut.text;
|
24809
|
+
}
|
24810
|
+
return visualValue.value;
|
24811
|
+
});
|
24812
|
+
const isConfirm = computed(() => !!slots.trigger || props2.type === "datetime" || props2.type === "datetimerange" || props2.multiple);
|
24813
|
+
const hasHeader = computed(() => !!slots.header);
|
24814
|
+
const hasFooter = computed(() => !!slots.footer);
|
24815
|
+
const hasShortcuts = computed(() => !!slots.shortcuts);
|
24816
|
+
const fontSizeCls = computed(() => {
|
24817
|
+
let cls = "";
|
24818
|
+
if (props2.fontSize === "medium") {
|
24819
|
+
cls = "medium-font";
|
24820
|
+
} else if (props2.fontSize === "large") {
|
24821
|
+
cls = "large-font";
|
24822
|
+
}
|
24823
|
+
return cls;
|
24824
|
+
});
|
24825
|
+
const longWidthCls = computed(() => {
|
24826
|
+
let cls = "";
|
24827
|
+
if (props2.fontSize === "medium") {
|
24828
|
+
cls = "medium-width";
|
24829
|
+
} else if (props2.fontSize === "large") {
|
24830
|
+
cls = "large-width";
|
24831
|
+
}
|
24832
|
+
return cls;
|
24833
|
+
});
|
24834
|
+
const localReadonly = computed(() => {
|
24835
|
+
var _a;
|
24836
|
+
if (((_a = state.shortcut) == null ? void 0 : _a.text) && props2.useShortcutText) {
|
24837
|
+
return true;
|
24838
|
+
}
|
24839
|
+
return !props2.editable || props2.readonly;
|
24840
|
+
});
|
24841
|
+
const ownPickerProps = computed(() => ({
|
24842
|
+
disabledHours: props2.disabledHours,
|
24843
|
+
disabledMinutes: props2.disabledMinutes,
|
24844
|
+
disabledSeconds: props2.disabledSeconds,
|
24845
|
+
hideDisabledOptions: props2.hideDisabledOptions
|
24846
|
+
}));
|
24847
|
+
const allowCrossDayProp = computed(() => panel.value === "RangeTimePickerPanel" ? props2.allowCrossDay : false);
|
24848
|
+
const inputRef = ref(null);
|
24849
|
+
const inputFocus = () => {
|
24850
|
+
var _a;
|
24851
|
+
(_a = inputRef == null ? void 0 : inputRef.value) == null ? void 0 : _a.focus();
|
24852
|
+
};
|
24853
|
+
const {
|
24854
|
+
proxy
|
24855
|
+
} = getCurrentInstance();
|
24856
|
+
watch(() => state.visible, (visible) => {
|
24857
|
+
if (visible) {
|
24858
|
+
nextTick(() => {
|
24859
|
+
const spinners = findChildComponents(proxy, "TimeSpinner");
|
24860
|
+
spinners.forEach((instance) => instance.updateScroll());
|
24861
|
+
});
|
24862
|
+
}
|
24863
|
+
});
|
24864
|
+
const pickerDropdownRef = ref(null);
|
24865
|
+
watch(() => props2.modelValue, (modelValue) => {
|
24866
|
+
var _a;
|
24867
|
+
state.internalValue = parseDate(modelValue, props2.type, props2.multiple, props2.format);
|
24868
|
+
if (props2.withValidate) {
|
24869
|
+
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change");
|
24870
|
+
}
|
24871
|
+
});
|
24872
|
+
watch(() => props2.open, (open) => {
|
24873
|
+
state.visible = open === true;
|
24874
|
+
});
|
24875
|
+
watch(() => props2.type, (type) => {
|
24876
|
+
onSelectionModeChange(type);
|
24877
|
+
});
|
24878
|
+
watch(() => publicVModelValue, (now, before) => {
|
24879
|
+
const newValue = JSON.stringify(now);
|
24880
|
+
const oldValue = JSON.stringify(before);
|
24881
|
+
const shouldEmitInput = newValue !== oldValue || typeof now !== typeof before;
|
24882
|
+
if (shouldEmitInput) {
|
24883
|
+
emit("input", now);
|
24884
|
+
}
|
24885
|
+
});
|
24886
|
+
onMounted(() => {
|
24887
|
+
if (props2.type.indexOf("date") > -1) {
|
24888
|
+
state.timeEnterMode = true;
|
24889
|
+
} else {
|
24890
|
+
state.timeEnterMode = true;
|
24891
|
+
}
|
24892
|
+
const initialValue2 = props2.modelValue;
|
24893
|
+
const parsedValue = publicVModelValue.value;
|
24894
|
+
if (typeof initialValue2 !== typeof parsedValue || JSON.stringify(initialValue2) !== JSON.stringify(parsedValue)) {
|
24895
|
+
emit("input", publicVModelValue.value);
|
24896
|
+
}
|
24897
|
+
if (props2.open !== null) {
|
24898
|
+
state.visible = props2.open;
|
24899
|
+
}
|
24900
|
+
provide(datePickerKey, {
|
24901
|
+
props: props2,
|
24902
|
+
focus: () => inputFocus()
|
24903
|
+
});
|
24904
|
+
});
|
24905
|
+
const pickerPanelRef = ref(null);
|
24906
|
+
const handleClose = (e) => {
|
24907
|
+
var _a;
|
24908
|
+
if (state.disableCloseUnderTransfer) {
|
24909
|
+
state.disableCloseUnderTransfer = false;
|
24910
|
+
return false;
|
24911
|
+
}
|
24912
|
+
if (e && e.type === "mousedown" && state.visible) {
|
24913
|
+
e.preventDefault();
|
24914
|
+
e.stopPropagation();
|
24915
|
+
return;
|
24916
|
+
}
|
24917
|
+
if (state.visible) {
|
24918
|
+
const pickerPanel = (_a = pickerPanelRef == null ? void 0 : pickerPanelRef.value) == null ? void 0 : _a.$el;
|
24919
|
+
if (e && pickerPanel && pickerPanel.contains(e.target)) {
|
24920
|
+
return;
|
24921
|
+
}
|
24922
|
+
state.visible = false;
|
24923
|
+
e == null ? void 0 : e.preventDefault();
|
24924
|
+
e == null ? void 0 : e.stopPropagation();
|
24925
|
+
return;
|
24926
|
+
}
|
24927
|
+
state.isFocused = false;
|
24928
|
+
state.disableClickOutSide = false;
|
24929
|
+
};
|
24930
|
+
const handleIconClick = () => {
|
24931
|
+
var _a, _b;
|
24932
|
+
(_a = inputRef == null ? void 0 : inputRef.value) == null ? void 0 : _a.focus();
|
24933
|
+
(_b = inputRef == null ? void 0 : inputRef.value) == null ? void 0 : _b.click();
|
24934
|
+
};
|
24935
|
+
const handleInputMouseenter = () => {
|
24936
|
+
if (props2.readonly || props2.disabled) {
|
24937
|
+
return;
|
24938
|
+
}
|
24939
|
+
if (visualValue == null ? void 0 : visualValue.value) {
|
24940
|
+
state.showClose = true;
|
24941
|
+
}
|
24942
|
+
};
|
24943
|
+
const handleInputMouseleave = (_e) => {
|
24944
|
+
state.showClose = false;
|
24945
|
+
};
|
24946
|
+
const emitChange = (type) => {
|
24947
|
+
nextTick(() => {
|
24948
|
+
var _a;
|
24949
|
+
emit("change", publicStringValue.value, type);
|
24950
|
+
emit("update:modelValue", publicVModelValue.value);
|
24951
|
+
if (props2.type.indexOf("time") < 0) {
|
24952
|
+
(_a = inputRef == null ? void 0 : inputRef.value) == null ? void 0 : _a.blur();
|
24953
|
+
}
|
24954
|
+
});
|
24955
|
+
};
|
24956
|
+
const handleInputChange = (e) => {
|
24957
|
+
var _a;
|
24958
|
+
const isArrayValue = props2.type.includes("range") || props2.multiple;
|
24959
|
+
const oldValue = visualValue.value;
|
24960
|
+
const newValue = e.target.value;
|
24961
|
+
const newDate = parseDate(newValue, props2.type, props2.multiple, props2.format);
|
24962
|
+
const valueToTest = isArrayValue ? newDate : newDate[0];
|
24963
|
+
const isDisabled = (_a = props2.disableDate) == null ? void 0 : _a.call(props2, valueToTest);
|
24964
|
+
const isValidDate = newDate.reduce((valid, date) => valid && date instanceof Date, true);
|
24965
|
+
if (newValue !== oldValue && !isDisabled && isValidDate) {
|
24966
|
+
emitChange(props2.type);
|
24967
|
+
state.internalValue = newDate;
|
24968
|
+
} else {
|
24969
|
+
state.forceInputRerender = state.forceInputRerender + 1;
|
24970
|
+
}
|
24971
|
+
};
|
24972
|
+
const handleFocus = (e) => {
|
24973
|
+
if (props2.readonly) {
|
24974
|
+
return;
|
24975
|
+
}
|
24976
|
+
state.isFocused = true;
|
24977
|
+
if (e && e.type === "focus") {
|
24978
|
+
return;
|
24979
|
+
}
|
24980
|
+
if (!props2.disabled) {
|
24981
|
+
state.visible = true;
|
24982
|
+
}
|
24983
|
+
};
|
24984
|
+
const reset2 = () => {
|
24985
|
+
var _a;
|
24986
|
+
(_a = pickerPanelRef == null ? void 0 : pickerPanelRef.value) == null ? void 0 : _a.reset();
|
24987
|
+
};
|
24988
|
+
const handleBlur = (e) => {
|
24989
|
+
var _a, _b;
|
24990
|
+
if (state.internalFocus) {
|
24991
|
+
state.internalFocus = false;
|
24992
|
+
return;
|
24993
|
+
}
|
24994
|
+
if (state.visible) {
|
24995
|
+
e.preventDefault();
|
24996
|
+
return;
|
24997
|
+
}
|
24998
|
+
state.isFocused = false;
|
24999
|
+
onSelectionModeChange(props2.type);
|
25000
|
+
state.internalValue = state.internalValue.slice();
|
25001
|
+
reset2();
|
25002
|
+
(_a = pickerPanelRef == null ? void 0 : pickerPanelRef.value) == null ? void 0 : _a.onToggleVisibility(false);
|
25003
|
+
(_b = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _b.call(formItem, "blur");
|
25004
|
+
};
|
25005
|
+
const handleKeydown = (e) => {
|
25006
|
+
const {
|
25007
|
+
keyCode
|
25008
|
+
} = e;
|
25009
|
+
if (keyCode === 9) {
|
25010
|
+
if (state.visible) {
|
25011
|
+
e.stopPropagation();
|
25012
|
+
e.preventDefault();
|
25013
|
+
if (isConfirm.value) {
|
25014
|
+
const selector = ".bk-picker-confirm > *";
|
25015
|
+
const tabbable = pickerDropdownRef.value.$el.querySelectorAll(selector);
|
25016
|
+
state.internalFocus = true;
|
25017
|
+
const element = [...tabbable][e.shiftKey ? "pop" : "shift"]();
|
25018
|
+
element.focus();
|
25019
|
+
} else {
|
25020
|
+
handleClose();
|
25021
|
+
}
|
25022
|
+
}
|
25023
|
+
}
|
25024
|
+
const arrows = [37, 38, 39, 40];
|
25025
|
+
if (!state.visible && arrows.includes(keyCode)) {
|
25026
|
+
state.visible = true;
|
25027
|
+
return;
|
25028
|
+
}
|
25029
|
+
if (keyCode === 27) {
|
25030
|
+
if (state.visible) {
|
25031
|
+
e.stopPropagation();
|
25032
|
+
handleClose();
|
25033
|
+
}
|
25034
|
+
}
|
25035
|
+
if (!arrows.includes(keyCode)) {
|
25036
|
+
return;
|
25037
|
+
}
|
25038
|
+
if (state.focusedTime.active) {
|
25039
|
+
e.preventDefault();
|
25040
|
+
}
|
25041
|
+
};
|
25042
|
+
const handleClear = () => {
|
25043
|
+
state.visible = false;
|
25044
|
+
state.internalValue = state.internalValue.map(() => null);
|
25045
|
+
emit("clear");
|
25046
|
+
emitChange(props2.type);
|
25047
|
+
reset2();
|
25048
|
+
state.showClose = false;
|
25049
|
+
state.shortcut = null;
|
25050
|
+
setTimeout(() => onSelectionModeChange(props2.type), 500);
|
25051
|
+
};
|
25052
|
+
const handleTransferClick = () => {
|
25053
|
+
if (props2.appendToBody) {
|
25054
|
+
state.disableCloseUnderTransfer = true;
|
25055
|
+
}
|
25056
|
+
};
|
25057
|
+
const onPickSuccess = () => {
|
25058
|
+
var _a;
|
25059
|
+
state.visible = false;
|
25060
|
+
nextTick(() => {
|
25061
|
+
emit("pick-success");
|
25062
|
+
});
|
25063
|
+
(_a = inputRef == null ? void 0 : inputRef.value) == null ? void 0 : _a.blur();
|
25064
|
+
reset2();
|
25065
|
+
};
|
25066
|
+
const onPick = (_dates, visible = false, type, shortcut2) => {
|
25067
|
+
let dates = _dates;
|
25068
|
+
if (props2.multiple) {
|
25069
|
+
const pickedTimeStamp = dates.getTime();
|
25070
|
+
const indexOfPickedDate = state.internalValue.findIndex((date) => date && date.getTime() === pickedTimeStamp);
|
25071
|
+
const allDates = [...state.internalValue, dates].filter(Boolean);
|
25072
|
+
const timeStamps = allDates.map((date) => date.getTime()).filter((ts, i2, arr) => arr.indexOf(ts) === i2 && i2 !== indexOfPickedDate);
|
25073
|
+
state.internalValue = timeStamps.map((ts) => new Date(ts));
|
25074
|
+
} else {
|
25075
|
+
dates = parseDate(_dates, props2.type, props2.multiple, props2.format);
|
25076
|
+
state.internalValue = Array.isArray(dates) ? dates : [dates];
|
25077
|
+
}
|
25078
|
+
if (state.internalValue[0]) {
|
25079
|
+
const [v2] = state.internalValue;
|
25080
|
+
state.focusedDate = v2;
|
25081
|
+
}
|
25082
|
+
state.focusedTime = __spreadProps(__spreadValues({}, state.focusedTime), {
|
25083
|
+
time: state.internalValue.map(extractTime)
|
25084
|
+
});
|
25085
|
+
if (!isConfirm.value) {
|
25086
|
+
onSelectionModeChange(props2.type);
|
25087
|
+
state.visible = visible;
|
25088
|
+
}
|
25089
|
+
if (type === "upToNow" && props2.type === "daterange") {
|
25090
|
+
onPickSuccess();
|
25091
|
+
}
|
25092
|
+
state.shortcut = shortcut2;
|
25093
|
+
emitChange(type);
|
25094
|
+
const shortcutIndex = props2.shortcuts.findIndex((item) => item === state.shortcut);
|
25095
|
+
emit("shortcut-change", state.shortcut, shortcutIndex);
|
25096
|
+
};
|
25097
|
+
const triggerRef = ref(null);
|
25098
|
+
console.error(panel);
|
25099
|
+
console.error(panel.value);
|
25100
|
+
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
25101
|
+
panel,
|
25102
|
+
publicStringValue,
|
25103
|
+
opened,
|
25104
|
+
visualValue,
|
25105
|
+
displayValue,
|
25106
|
+
isConfirm,
|
25107
|
+
hasHeader,
|
25108
|
+
hasFooter,
|
25109
|
+
hasShortcuts,
|
25110
|
+
fontSizeCls,
|
25111
|
+
longWidthCls,
|
25112
|
+
localReadonly,
|
25113
|
+
allowCrossDayProp,
|
25114
|
+
ownPickerProps,
|
25115
|
+
pickerDropdownRef,
|
25116
|
+
inputRef,
|
25117
|
+
triggerRef,
|
25118
|
+
pickerPanelRef,
|
25119
|
+
handleClose,
|
25120
|
+
handleIconClick,
|
25121
|
+
handleInputMouseenter,
|
25122
|
+
handleInputMouseleave,
|
25123
|
+
handleFocus,
|
25124
|
+
handleBlur,
|
25125
|
+
handleKeydown,
|
25126
|
+
handleInputChange,
|
25127
|
+
handleClear,
|
25128
|
+
handleTransferClick,
|
25129
|
+
onPick,
|
25130
|
+
onPickSuccess
|
25131
|
+
});
|
25132
|
+
},
|
25133
|
+
render() {
|
25134
|
+
var _a, _b, _c;
|
25135
|
+
const defaultTrigger = createVNode("div", null, [createVNode("span", {
|
25136
|
+
"class": ["icon-wrapper", this.disabled ? "disabled" : ""],
|
25137
|
+
"onClick": this.handleIconClick
|
25138
|
+
}, [this.type === "time" || this.type === "timerange" ? createVNode("svg", {
|
25139
|
+
"class": "picker-icon",
|
25140
|
+
"x": "0px",
|
25141
|
+
"y": "0px",
|
25142
|
+
"viewBox": "0 0 1024 1024"
|
25143
|
+
}, [createVNode("g", {
|
25144
|
+
"id": "time"
|
25145
|
+
}, [createVNode("path", {
|
25146
|
+
"fill": "#c4c6cc",
|
25147
|
+
"d": "M512,128c51.9,0,102.2,10.1,149.5,30.2c45.7,19.3,86.8,47,122.1,82.3s63,76.4,82.3,122.1c20,47.3,30.2,97.6,30.2,149.5S886,614.3,865.9,661.6c-19.3,45.7-47,86.8-82.3,122.1s-76.4,63-122.1,82.3c-47.3,20-97.6,30.2-149.5,30.2S409.8,886.1,362.5,866c-45.7-19.3-86.8-47-122.1-82.3s-63-76.4-82.3-122.1c-20-47.3-30.2-97.6-30.2-149.5s10.1-102.2,30.2-149.5c19.3-45.7,47-86.8,82.3-122.1s76.4-63,122.1-82.3C409.8,138.1,460.1,128,512,128 M512,64C264.6,64,64,264.6,64,512s200.6,448,448,448s448-200.6,448-448S759.4,64,512,64L512,64z"
|
25148
|
+
}, null), createVNode("polygon", {
|
25149
|
+
"fill": "#c4c6cc",
|
25150
|
+
"points": "512,512 512,256 448,256 448,512 448,576 512,576 768,576 768,512"
|
25151
|
+
}, null)])]) : createVNode("svg", {
|
25152
|
+
"class": "picker-icon",
|
25153
|
+
"x": "0px",
|
25154
|
+
"y": "0px",
|
25155
|
+
"viewBox": "0 0 1024 1024"
|
25156
|
+
}, [createVNode("g", {
|
25157
|
+
"id": "date"
|
25158
|
+
}, [createVNode("path", {
|
25159
|
+
"fill": "#c4c6cc",
|
25160
|
+
"d": "M896,128h-96v64h64v112H160V192h64v-64h-96c-17.7,0-32,14.3-32,32v736c0,17.7,14.3,32,32,32h768c17.7,0,32-14.3,32-32V160C928,142.3,913.7,128,896,128z M160,864V368h704v496H160z"
|
25161
|
+
}, null), createVNode("rect", {
|
25162
|
+
"x": "416",
|
25163
|
+
"y": "128",
|
25164
|
+
"fill": "#c4c6cc",
|
25165
|
+
"width": "192",
|
25166
|
+
"height": "64"
|
25167
|
+
}, null), createVNode("rect", {
|
25168
|
+
"x": "288",
|
25169
|
+
"y": "96",
|
25170
|
+
"fill": "#c4c6cc",
|
25171
|
+
"width": "64",
|
25172
|
+
"height": "128"
|
25173
|
+
}, null), createVNode("rect", {
|
25174
|
+
"x": "672",
|
25175
|
+
"y": "96",
|
25176
|
+
"fill": "#c4c6cc",
|
25177
|
+
"width": "64",
|
25178
|
+
"height": "128"
|
25179
|
+
}, null), createVNode("polygon", {
|
25180
|
+
"fill": "#c4c6cc",
|
25181
|
+
"points": "403.7,514.4 557.1,514.4 557.1,515.3 420.1,765.5 483.5,765.5 620.3,504.3 620.3,466.5 403.7,466.5"
|
25182
|
+
}, null)])])]), createVNode("input", {
|
25183
|
+
"type": "text",
|
25184
|
+
"class": ["bk-date-picker-editor", this.readonly ? "readonly" : "", this.fontSizeCls, this.behavior === "simplicity" ? "only-bottom-border" : ""],
|
25185
|
+
"ref": "inputRef",
|
25186
|
+
"key": this.forceInputRerender,
|
25187
|
+
"readonly": this.localReadonly,
|
25188
|
+
"disabled": this.disabled,
|
25189
|
+
"placeholder": this.placeholder,
|
25190
|
+
"value": this.displayValue,
|
25191
|
+
"onFocus": this.handleFocus,
|
25192
|
+
"onClick": this.handleFocus,
|
25193
|
+
"onBlur": this.handleBlur,
|
25194
|
+
"onKeydown": this.handleKeydown,
|
25195
|
+
"onChange": this.handleInputChange
|
25196
|
+
}, null), this.clearable && this.showClose ? createVNode(close$1, {
|
25197
|
+
"onClick": this.handleClear,
|
25198
|
+
"class": "clear-action"
|
25199
|
+
}, null) : ""]);
|
25200
|
+
const shortcutsSlot = this.hasShortcuts ? {
|
25201
|
+
shortcuts: () => {
|
25202
|
+
var _a2, _b2;
|
25203
|
+
return ((_b2 = (_a2 = this.$slots).shortcuts) == null ? void 0 : _b2.call(_a2)) || null;
|
25204
|
+
}
|
25205
|
+
} : {};
|
25206
|
+
return withDirectives(createVNode("div", {
|
25207
|
+
"class": ["bk-date-picker", this.type === "datetimerange" ? "long" : "", this.longWidthCls]
|
25208
|
+
}, [createVNode("div", {
|
25209
|
+
"ref": "triggerRef",
|
25210
|
+
"class": "bk-date-picker-rel",
|
25211
|
+
"onMouseenter": this.handleInputMouseenter,
|
25212
|
+
"onMouseleave": this.handleInputMouseleave
|
25213
|
+
}, [(_c = (_b = (_a = this.$slots).trigger) == null ? void 0 : _b.call(_a)) != null ? _c : defaultTrigger]), createVNode(Teleport, {
|
25214
|
+
"to": "body",
|
25215
|
+
"disabled": !this.appendToBody
|
25216
|
+
}, {
|
25217
|
+
default: () => [createVNode(Transition, {
|
25218
|
+
"name": "bk-fade-down-transition"
|
25219
|
+
}, {
|
25220
|
+
default: () => [withDirectives(createVNode(PickerDropdown, {
|
25221
|
+
"class": [this.appendToBody ? "bk-date-picker-transfer" : ""],
|
25222
|
+
"ref": "pickerDropdownRef",
|
25223
|
+
"triggerRef": this.triggerRef,
|
25224
|
+
"placement": this.placement,
|
25225
|
+
"extPopoverCls": this.extPopoverCls,
|
25226
|
+
"appendToBody": this.appendToBody,
|
25227
|
+
"onClick": this.handleTransferClick
|
25228
|
+
}, {
|
25229
|
+
default: () => {
|
25230
|
+
var _a2, _b2, _c2, _d, _e, _f;
|
25231
|
+
return [this.hasHeader ? createVNode("div", {
|
25232
|
+
"class": ["bk-date-picker-top-wrapper", this.headerSlotCls]
|
25233
|
+
}, [(_c2 = (_b2 = (_a2 = this.$slots).header) == null ? void 0 : _b2.call(_a2)) != null ? _c2 : null]) : null, createVNode(TimePanel, {
|
25234
|
+
"ref": "pickerPanelRef",
|
25235
|
+
"clearable": this.clearable,
|
25236
|
+
"confirm": this.isConfirm,
|
25237
|
+
"shortcuts": this.shortcuts,
|
25238
|
+
"multiple": this.multiple,
|
25239
|
+
"shortcutClose": this.shortcutClose,
|
25240
|
+
"value": this.internalValue,
|
25241
|
+
"startDate": this.startDate,
|
25242
|
+
"disableDate": this.disableDate,
|
25243
|
+
"onPick": this.onPick,
|
25244
|
+
"onPick-clear": this.handleClear,
|
25245
|
+
"onPick-success": this.onPickSuccess,
|
25246
|
+
"disabledHours": this.ownPickerProps.disabledHours,
|
25247
|
+
"disabledMinutes": this.ownPickerProps.disabledMinutes,
|
25248
|
+
"disabledSeconds": this.ownPickerProps.disabledSeconds
|
24100
25249
|
}, shortcutsSlot), this.hasFooter ? createVNode("div", {
|
24101
25250
|
"class": ["bk-date-picker-footer-wrapper", this.footerSlotCls]
|
24102
25251
|
}, [(_f = (_e = (_d = this.$slots).footer) == null ? void 0 : _e.call(_d)) != null ? _f : null]) : null];
|
@@ -26232,7 +27381,7 @@ var CascaderPanel = defineComponent({
|
|
26232
27381
|
};
|
26233
27382
|
const nodeExpandHandler = (node) => {
|
26234
27383
|
var _a;
|
26235
|
-
if (node.isDisabled)
|
27384
|
+
if (!node || (node == null ? void 0 : node.isDisabled))
|
26236
27385
|
return;
|
26237
27386
|
menus.list = menus.list.slice(0, node.level);
|
26238
27387
|
activePath.value = activePath.value.slice(0, node.level - 1);
|
@@ -26299,6 +27448,9 @@ var CascaderPanel = defineComponent({
|
|
26299
27448
|
}, {
|
26300
27449
|
immediate: true
|
26301
27450
|
});
|
27451
|
+
watch(() => props2.store, (value) => {
|
27452
|
+
menus.list = [value.getNodes()];
|
27453
|
+
});
|
26302
27454
|
return {
|
26303
27455
|
menus,
|
26304
27456
|
activePath,
|
@@ -26429,7 +27581,7 @@ var Component$6 = defineComponent({
|
|
26429
27581
|
},
|
26430
27582
|
components: {
|
26431
27583
|
CascaderPanel,
|
26432
|
-
BkPopover
|
27584
|
+
BkPopover: BkPopover2
|
26433
27585
|
},
|
26434
27586
|
props: {
|
26435
27587
|
modelValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number).def([]), PropTypes.arrayOf(PropTypes.string).def([])]),
|
@@ -26464,7 +27616,7 @@ var Component$6 = defineComponent({
|
|
26464
27616
|
setHover,
|
26465
27617
|
cancelHover
|
26466
27618
|
} = useHover();
|
26467
|
-
const store =
|
27619
|
+
const store = ref(new Store(props2));
|
26468
27620
|
const panelShow = ref(false);
|
26469
27621
|
const selectedText = ref("");
|
26470
27622
|
const selectedTags = ref([]);
|
@@ -26480,57 +27632,61 @@ var Component$6 = defineComponent({
|
|
26480
27632
|
});
|
26481
27633
|
const popover3 = ref(null);
|
26482
27634
|
const updateValue = (val) => {
|
27635
|
+
var _a;
|
26483
27636
|
if (multiple) {
|
26484
|
-
selectedTags.value = store.getCheckedNodes().map((node) => ({
|
27637
|
+
selectedTags.value = store.value.getCheckedNodes().map((node) => ({
|
26485
27638
|
text: node.pathNames.join(separator2),
|
26486
27639
|
key: node.id
|
26487
27640
|
}));
|
26488
27641
|
return;
|
26489
27642
|
}
|
27643
|
+
(_a = popover3 == null ? void 0 : popover3.value) == null ? void 0 : _a.hide();
|
26490
27644
|
if (val.length === 0) {
|
26491
27645
|
selectedText.value = "";
|
26492
27646
|
} else {
|
26493
|
-
const node = store.getNodeByValue(val);
|
27647
|
+
const node = store.value.getNodeByValue(val);
|
27648
|
+
if (!node)
|
27649
|
+
return;
|
26494
27650
|
selectedText.value = node.pathNames.join(separator2);
|
26495
27651
|
}
|
26496
27652
|
};
|
26497
|
-
const hidePopover = () => {
|
26498
|
-
panelShow.value = false;
|
26499
|
-
};
|
26500
27653
|
const handleClear = (e) => {
|
26501
27654
|
e.stopPropagation();
|
26502
27655
|
updateValue([]);
|
26503
27656
|
emit("update:modelValue", []);
|
26504
27657
|
emit("clear", JSON.parse(JSON.stringify(props2.modelValue)));
|
26505
27658
|
};
|
26506
|
-
const inputClickHandler = (e) => {
|
26507
|
-
e.stopPropagation();
|
26508
|
-
panelShow.value = !panelShow.value;
|
26509
|
-
emit("toggle", panelShow.value);
|
26510
|
-
};
|
26511
27659
|
const removeTag = (value, index, e) => {
|
26512
27660
|
e.stopPropagation();
|
26513
27661
|
const current = JSON.parse(JSON.stringify(value));
|
26514
27662
|
current.splice(index, 1);
|
26515
27663
|
updateValue(current);
|
26516
27664
|
};
|
26517
|
-
|
26518
|
-
var _a;
|
27665
|
+
const modelValueChangeHandler = (value) => {
|
26519
27666
|
updateValue(value);
|
26520
|
-
(_a = popover3 == null ? void 0 : popover3.value) == null ? void 0 : _a.handlePopShow(false);
|
26521
27667
|
emit("update:modelValue", value);
|
26522
27668
|
emit("change", value);
|
26523
|
-
}
|
27669
|
+
};
|
27670
|
+
const listChangeHandler = () => {
|
27671
|
+
store.value = new Store(props2);
|
27672
|
+
updateValue(props2.modelValue);
|
27673
|
+
};
|
27674
|
+
const popoverChangeEmitter = (val) => {
|
27675
|
+
emit("toggle", val.isShow);
|
27676
|
+
};
|
27677
|
+
watch(() => props2.modelValue, modelValueChangeHandler, {
|
27678
|
+
immediate: true
|
27679
|
+
});
|
27680
|
+
watch(() => props2.list, listChangeHandler, {
|
27681
|
+
deep: true,
|
26524
27682
|
immediate: true
|
26525
27683
|
});
|
26526
27684
|
return {
|
26527
27685
|
store,
|
26528
27686
|
updateValue,
|
26529
|
-
|
26530
|
-
inputClickHandler,
|
27687
|
+
panelShow,
|
26531
27688
|
selectedText,
|
26532
27689
|
checkedValue,
|
26533
|
-
panelShow,
|
26534
27690
|
handleClear,
|
26535
27691
|
isHover,
|
26536
27692
|
setHover,
|
@@ -26538,7 +27694,8 @@ var Component$6 = defineComponent({
|
|
26538
27694
|
cancelHover,
|
26539
27695
|
selectedTags,
|
26540
27696
|
removeTag,
|
26541
|
-
cascaderPanel
|
27697
|
+
cascaderPanel,
|
27698
|
+
popoverChangeEmitter
|
26542
27699
|
};
|
26543
27700
|
},
|
26544
27701
|
render() {
|
@@ -26578,20 +27735,19 @@ var Component$6 = defineComponent({
|
|
26578
27735
|
"data-placeholder": this.placeholder,
|
26579
27736
|
"onMouseenter": this.setHover,
|
26580
27737
|
"onMouseleave": this.cancelHover
|
26581
|
-
}, [suffixIcon(), createVNode(
|
27738
|
+
}, [suffixIcon(), createVNode(BkPopover2, {
|
26582
27739
|
"placement": "bottom-start",
|
26583
27740
|
"theme": "light bk-cascader-popover",
|
26584
27741
|
"trigger": "click",
|
26585
27742
|
"arrow": false,
|
26586
27743
|
"class": "bk-cascader-popover-wrapper",
|
26587
|
-
"isShow": this.panelShow,
|
26588
|
-
"onUpdate:isShow": ($event) => this.panelShow = $event,
|
26589
27744
|
"ref": "popover",
|
27745
|
+
"onAfterHidden": this.popoverChangeEmitter,
|
27746
|
+
"onAfterShow": this.popoverChangeEmitter,
|
26590
27747
|
"boundary": "body"
|
26591
27748
|
}, {
|
26592
27749
|
default: () => createVNode("div", {
|
26593
|
-
"class": "bk-cascader-name"
|
26594
|
-
"onClick": this.inputClickHandler
|
27750
|
+
"class": "bk-cascader-name"
|
26595
27751
|
}, [this.multiple && renderTags(), this.filterable ? createVNode("input", {
|
26596
27752
|
"class": "bk-cascader-search-input",
|
26597
27753
|
"type": "text",
|
@@ -28967,7 +30123,7 @@ var useFileHandler = (props2, hooks) => {
|
|
28967
30123
|
var Component$1 = defineComponent({
|
28968
30124
|
name: "Upload",
|
28969
30125
|
props: uploadProps,
|
28970
|
-
emits: ["
|
30126
|
+
emits: ["exceed", "progress", "success", "error", "delete", "done"],
|
28971
30127
|
setup(props2, {
|
28972
30128
|
slots,
|
28973
30129
|
emit
|
@@ -28993,7 +30149,7 @@ var Component$1 = defineComponent({
|
|
28993
30149
|
};
|
28994
30150
|
function onRemove(file, fileList2) {
|
28995
30151
|
abort(file);
|
28996
|
-
emit("
|
30152
|
+
emit("delete", file, fileList2);
|
28997
30153
|
}
|
28998
30154
|
const {
|
28999
30155
|
fileList,
|
@@ -29010,7 +30166,7 @@ var Component$1 = defineComponent({
|
|
29010
30166
|
return;
|
29011
30167
|
}
|
29012
30168
|
if (props2.limit && fileList.value.length + files.length > props2.limit) {
|
29013
|
-
emit("
|
30169
|
+
emit("exceed", files, fileList.value);
|
29014
30170
|
return;
|
29015
30171
|
}
|
29016
30172
|
let sendFiles = files;
|
@@ -29021,7 +30177,7 @@ var Component$1 = defineComponent({
|
|
29021
30177
|
const rawFile = file;
|
29022
30178
|
const error2 = handlePreprocess(rawFile);
|
29023
30179
|
if (error2) {
|
29024
|
-
emit("
|
30180
|
+
emit("error", rawFile, fileList.value, error2);
|
29025
30181
|
return;
|
29026
30182
|
}
|
29027
30183
|
if (props2.autoUpload) {
|
@@ -29079,29 +30235,29 @@ var Component$1 = defineComponent({
|
|
29079
30235
|
chunkSize,
|
29080
30236
|
onProgress: (event) => {
|
29081
30237
|
handleProgress(event, file);
|
29082
|
-
emit("
|
30238
|
+
emit("progress", event, file, fileList.value);
|
29083
30239
|
},
|
29084
30240
|
onSuccess: (res) => {
|
29085
30241
|
var _a;
|
29086
30242
|
const result = res;
|
29087
30243
|
if ((_a = props2 == null ? void 0 : props2.handleResCode) == null ? void 0 : _a.call(props2, result)) {
|
29088
30244
|
handleSuccess(res, file);
|
29089
|
-
emit("
|
30245
|
+
emit("success", res, file, fileList.value);
|
29090
30246
|
} else {
|
29091
30247
|
const err = new Error((result == null ? void 0 : result.message) || "unknow error");
|
29092
30248
|
handleError(err, file);
|
29093
|
-
emit("
|
30249
|
+
emit("error", file, fileList.value, err);
|
29094
30250
|
}
|
29095
30251
|
delete requests.value[uid];
|
29096
30252
|
},
|
29097
30253
|
onError: (err) => {
|
29098
30254
|
handleError(err, file);
|
29099
|
-
emit("
|
30255
|
+
emit("error", file, fileList.value, err);
|
29100
30256
|
delete requests.value[uid];
|
29101
30257
|
},
|
29102
30258
|
onComplete: () => {
|
29103
30259
|
if (sendFiles.indexOf(file) === sendFiles.length - 1) {
|
29104
|
-
emit("
|
30260
|
+
emit("done", fileList.value);
|
29105
30261
|
}
|
29106
30262
|
}
|
29107
30263
|
};
|
@@ -33701,6 +34857,7 @@ var Component = defineComponent({
|
|
33701
34857
|
}
|
33702
34858
|
});
|
33703
34859
|
const BkColorPicker = withInstall(Component);
|
34860
|
+
const BkTimePicker = withInstall(TimePicker);
|
33704
34861
|
var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
33705
34862
|
__proto__: null,
|
33706
34863
|
Alert: BkAlert,
|
@@ -33756,7 +34913,8 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
33756
34913
|
Process: BkSteps,
|
33757
34914
|
Upload,
|
33758
34915
|
CodeDiff: BkCodeDiff,
|
33759
|
-
ColorPicker: BkColorPicker
|
34916
|
+
ColorPicker: BkColorPicker,
|
34917
|
+
TimePicker: BkTimePicker
|
33760
34918
|
}, Symbol.toStringTag, { value: "Module" }));
|
33761
34919
|
const createInstall = (prefix = "Bk") => (app) => {
|
33762
34920
|
const pre = app.config.globalProperties.bkUIPrefix || prefix;
|
@@ -33774,4 +34932,4 @@ var preset = {
|
|
33774
34932
|
install: createInstall(),
|
33775
34933
|
version: "0.0.1"
|
33776
34934
|
};
|
33777
|
-
export { BkAffix as Affix, BkAlert as Alert, BkAnimateNumber as AnimateNumber, BkBacktop as Backtop, BkBadge as Badge, BkBreadcrumb as Breadcrumb, BkButton as Button, BkCard as Card, BkCascader as Cascader, BkCheckbox as Checkbox, BkCodeDiff as CodeDiff, BkCollapse as Collapse, BkColorPicker as ColorPicker, BkContainer as Container, BkDatePicker as DatePicker, BkDialog as Dialog, BkDivider as Divider, BkDropdown as Dropdown, BkException as Exception, BkFixedNavbar as FixedNavbar, BkForm as Form, InfoBox, BkInput as Input, BkLink as Link, BkLoading as Loading, BkMenu as Menu, Message, BkModal as Modal, Navigation, Notify, BkPagination as Pagination, BkPopover as Popover, BkPopover2 as Popover2, BkSteps as Process, BkProgress as Progress, BkRadio as Radio, BkRate as Rate, BkResizeLayout as ResizeLayout, BkSelect as Select, BkSideslider as Sideslider, Slider, BkSteps$2 as Steps, BkSwiper as Swiper, BkSwitcher as Switcher, BkTab as Tab, BkTable as Table, BkTag as Tag, TagInput, BkSteps$1 as TimeLine, Transfer, BkTree as Tree, Upload, BkVirtualRender as VirtualRender, tooltips as bkTooltips, ClickOutside as clickoutside, BkContainer as containerProps, preset as default, mousewheel };
|
34935
|
+
export { BkAffix as Affix, BkAlert as Alert, BkAnimateNumber as AnimateNumber, BkBacktop as Backtop, BkBadge as Badge, BkBreadcrumb as Breadcrumb, BkButton as Button, BkCard as Card, BkCascader as Cascader, BkCheckbox as Checkbox, BkCodeDiff as CodeDiff, BkCollapse as Collapse, BkColorPicker as ColorPicker, BkContainer as Container, BkDatePicker as DatePicker, BkDialog as Dialog, BkDivider as Divider, BkDropdown as Dropdown, BkException as Exception, BkFixedNavbar as FixedNavbar, BkForm as Form, InfoBox, BkInput as Input, BkLink as Link, BkLoading as Loading, BkMenu as Menu, Message, BkModal as Modal, Navigation, Notify, BkPagination as Pagination, BkPopover as Popover, BkPopover2 as Popover2, BkSteps as Process, BkProgress as Progress, BkRadio as Radio, BkRate as Rate, BkResizeLayout as ResizeLayout, BkSelect as Select, BkSideslider as Sideslider, Slider, BkSteps$2 as Steps, BkSwiper as Swiper, BkSwitcher as Switcher, BkTab as Tab, BkTable as Table, BkTag as Tag, TagInput, BkSteps$1 as TimeLine, BkTimePicker as TimePicker, Transfer, BkTree as Tree, Upload, BkVirtualRender as VirtualRender, tooltips as bkTooltips, ClickOutside as clickoutside, BkContainer as containerProps, preset as default, mousewheel };
|