bkui-vue 0.0.1-beta.209 → 0.0.1-beta.210

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.esm.js CHANGED
@@ -11412,13 +11412,19 @@ function createPopoverComponent(options) {
11412
11412
  };
11413
11413
  updateStyle(refProps.value.target);
11414
11414
  const show3 = () => {
11415
- var _a, _b;
11416
- (_b = (_a = refReference.value) == null ? void 0 : _a.show) == null ? void 0 : _b.call(_a);
11415
+ setTimeout(() => {
11416
+ var _a, _b;
11417
+ (_b = (_a = refReference.value) == null ? void 0 : _a.show) == null ? void 0 : _b.call(_a);
11418
+ });
11417
11419
  };
11418
11420
  const hide3 = () => {
11419
11421
  var _a, _b;
11420
11422
  (_b = (_a = refReference.value) == null ? void 0 : _a.hide) == null ? void 0 : _b.call(_a);
11421
11423
  };
11424
+ const stopHide = () => {
11425
+ var _a, _b;
11426
+ (_b = (_a = refReference.value) == null ? void 0 : _a.stopHide) == null ? void 0 : _b.call(_a);
11427
+ };
11422
11428
  const attrs = computed(() => {
11423
11429
  const excludeKeys = ["target"];
11424
11430
  return Object.keys(refProps.value).filter((key2) => !excludeKeys.includes(key2)).reduce((out, curKey) => __spreadProps(__spreadValues({}, out), {
@@ -11435,13 +11441,24 @@ function createPopoverComponent(options) {
11435
11441
  (_b2 = (_a2 = refReference.value) == null ? void 0 : _a2.updatePopover) == null ? void 0 : _b2.call(_a2);
11436
11442
  });
11437
11443
  };
11444
+ const handleContentMouseenter = () => {
11445
+ var _a;
11446
+ (_a = resolvedOptions.onContentMouseenter) == null ? void 0 : _a.call(resolvedOptions);
11447
+ };
11448
+ const handleContentMouseleave = () => {
11449
+ var _a;
11450
+ (_a = resolvedOptions.onContentMouseleave) == null ? void 0 : _a.call(resolvedOptions);
11451
+ };
11438
11452
  expose({
11439
11453
  show: show3,
11440
11454
  hide: hide3,
11441
- updateTarget
11455
+ updateTarget,
11456
+ stopHide
11442
11457
  });
11443
11458
  return () => createVNode(Component$q, mergeProps(attrs.value, {
11444
- "ref": refReference
11459
+ "ref": refReference,
11460
+ "onContentMouseenter": handleContentMouseenter,
11461
+ "onContentMouseleave": handleContentMouseleave
11445
11462
  }), {
11446
11463
  default: () => [createVNode("span", {
11447
11464
  "style": referStyle.value
@@ -11494,7 +11511,9 @@ function createPopoverComponent(options) {
11494
11511
  show: show2,
11495
11512
  hide: hide2,
11496
11513
  update,
11497
- vm: $PopoverInstanceVm,
11514
+ get vm() {
11515
+ return $PopoverInstanceVm;
11516
+ },
11498
11517
  get $el() {
11499
11518
  return $PopoverInstanceVm.$el;
11500
11519
  }
@@ -11515,16 +11534,33 @@ const resolveOptions = (el, binding) => {
11515
11534
  const createInstance = (el, binding) => {
11516
11535
  let instance = null;
11517
11536
  let createTimer = null;
11537
+ let hidePopTimer = null;
11518
11538
  const options = resolveOptions(el, binding);
11519
11539
  const { disabled } = options;
11520
11540
  if (disabled || instance) {
11521
11541
  return;
11522
11542
  }
11543
+ const handleContentEnter = () => {
11544
+ hidePopTimer && clearTimeout(hidePopTimer);
11545
+ hidePopTimer = null;
11546
+ };
11547
+ const handleContentLeave = () => {
11548
+ if (createTimer) {
11549
+ clearTimeout(createTimer);
11550
+ }
11551
+ instance == null ? void 0 : instance.hide();
11552
+ instance == null ? void 0 : instance.close();
11553
+ instance = null;
11554
+ };
11523
11555
  const handleMouseEnter = () => {
11524
11556
  createTimer && clearTimeout(createTimer);
11525
11557
  createTimer = setTimeout(() => {
11526
11558
  const targetOptions = resolveOptions(el, binding);
11527
11559
  targetOptions.content = targetOptions.content || el.innerHTML;
11560
+ Object.assign(targetOptions, {
11561
+ onContentMouseenter: handleContentEnter,
11562
+ onContentMouseleave: handleContentLeave
11563
+ });
11528
11564
  instance = createPopoverComponent(targetOptions);
11529
11565
  setTimeout(() => {
11530
11566
  instance.show();
@@ -11532,12 +11568,14 @@ const createInstance = (el, binding) => {
11532
11568
  }, 100);
11533
11569
  };
11534
11570
  const handleMouseLeave = () => {
11535
- if (createTimer) {
11536
- clearTimeout(createTimer);
11537
- }
11538
- instance == null ? void 0 : instance.hide();
11539
- instance == null ? void 0 : instance.close();
11540
- instance = null;
11571
+ hidePopTimer = setTimeout(() => {
11572
+ if (createTimer) {
11573
+ clearTimeout(createTimer);
11574
+ }
11575
+ instance == null ? void 0 : instance.hide();
11576
+ instance == null ? void 0 : instance.close();
11577
+ instance = null;
11578
+ }, 120);
11541
11579
  };
11542
11580
  el.addEventListener("mouseenter", handleMouseEnter);
11543
11581
  el.addEventListener("mouseleave", handleMouseLeave);
@@ -11581,16 +11619,22 @@ var Arrow = defineComponent({
11581
11619
  }
11582
11620
  });
11583
11621
  const EMPTY$2 = (..._args) => true;
11584
- let EMITEVENTS;
11585
- (function(EMITEVENTS2) {
11586
- EMITEVENTS2["SHOW"] = "show";
11587
- EMITEVENTS2["HIDE"] = "hide";
11588
- EMITEVENTS2["CLICK_OUTSIDE"] = "clickoutside";
11589
- })(EMITEVENTS || (EMITEVENTS = {}));
11622
+ let EMIT_EVENTS$1;
11623
+ (function(EMIT_EVENTS2) {
11624
+ EMIT_EVENTS2["SHOW"] = "show";
11625
+ EMIT_EVENTS2["HIDE"] = "hide";
11626
+ EMIT_EVENTS2["CLICK_OUTSIDE"] = "clickoutside";
11627
+ EMIT_EVENTS2["CONTENT_MOUSEENTER"] = "contentMouseenter";
11628
+ EMIT_EVENTS2["CONTENT_MOUSELEAVE"] = "contentMouseleave";
11629
+ EMIT_EVENTS2["STOP_HIDE"] = "stopHide";
11630
+ })(EMIT_EVENTS$1 || (EMIT_EVENTS$1 = {}));
11590
11631
  const EMIT_EVENT_TYPES$1 = {
11591
- [EMITEVENTS.SHOW]: EMPTY$2,
11592
- [EMITEVENTS.HIDE]: EMPTY$2,
11593
- [EMITEVENTS.CLICK_OUTSIDE]: EMPTY$2
11632
+ [EMIT_EVENTS$1.SHOW]: EMPTY$2,
11633
+ [EMIT_EVENTS$1.HIDE]: EMPTY$2,
11634
+ [EMIT_EVENTS$1.CLICK_OUTSIDE]: EMPTY$2,
11635
+ [EMIT_EVENTS$1.CONTENT_MOUSEENTER]: EMPTY$2,
11636
+ [EMIT_EVENTS$1.CONTENT_MOUSELEAVE]: EMPTY$2,
11637
+ [EMIT_EVENTS$1.STOP_HIDE]: EMPTY$2
11594
11638
  };
11595
11639
  var Content = defineComponent({
11596
11640
  name: "PopContent",
@@ -13144,13 +13188,15 @@ var useFloating = (props2, ctx, {
13144
13188
  updateArrowStyle(elArrow, resolvedPlacement, middlewareData);
13145
13189
  });
13146
13190
  };
13191
+ let popHideTimerId = void 0;
13192
+ let isMouseenter = false;
13147
13193
  const showPopover = () => {
13148
- !props2.disabled && (localIsShow.value = true);
13194
+ setTimeout(() => {
13195
+ !props2.disabled && (localIsShow.value = true);
13196
+ }, 100);
13149
13197
  };
13150
- let popShowTimerId = void 0;
13151
- let isMouseenter = false;
13152
13198
  const hidePopover = () => {
13153
- popShowTimerId = setTimeout(() => {
13199
+ popHideTimerId = setTimeout(() => {
13154
13200
  localIsShow.value = false;
13155
13201
  }, 100);
13156
13202
  };
@@ -13179,25 +13225,33 @@ var useFloating = (props2, ctx, {
13179
13225
  hidePopover();
13180
13226
  }
13181
13227
  };
13182
- const hanldeClickRef = () => {
13228
+ const handleClickRef = () => {
13183
13229
  triggerPopover();
13184
13230
  };
13185
13231
  const handlePopContentMouseEnter = () => {
13186
13232
  if (props2.trigger !== "hover") {
13187
13233
  return;
13188
13234
  }
13189
- if (popShowTimerId) {
13235
+ if (popHideTimerId) {
13190
13236
  isMouseenter = true;
13191
- clearTimeout(popShowTimerId);
13192
- popShowTimerId = void 0;
13237
+ clearTimeout(popHideTimerId);
13238
+ popHideTimerId = void 0;
13193
13239
  }
13240
+ emitPopContentMouseEnter();
13194
13241
  };
13195
13242
  const handlePopContentMouseLeave = () => {
13196
13243
  if (isMouseenter) {
13197
13244
  hidePopover();
13198
13245
  isMouseenter = false;
13246
+ emitPopContentMouseLeave();
13199
13247
  }
13200
13248
  };
13249
+ const emitPopContentMouseEnter = () => {
13250
+ ctx.emit(EMIT_EVENTS$1.CONTENT_MOUSEENTER);
13251
+ };
13252
+ const emitPopContentMouseLeave = () => {
13253
+ ctx.emit(EMIT_EVENTS$1.CONTENT_MOUSELEAVE);
13254
+ };
13201
13255
  const resolveTriggerEvents = () => {
13202
13256
  var _a;
13203
13257
  const triggerEvents = {
@@ -13205,8 +13259,11 @@ var useFloating = (props2, ctx, {
13205
13259
  content: [["mouseenter", handlePopContentMouseEnter], ["mouseleave", handlePopContentMouseLeave]],
13206
13260
  reference: [["mouseenter", showPopover], ["mouseleave", hidePopover], ["focus", showPopover], ["blur", hidePopover]]
13207
13261
  },
13208
- click: [["click", hanldeClickRef]],
13209
- manual: [[]]
13262
+ click: [["click", handleClickRef]],
13263
+ manual: {
13264
+ content: [["mouseenter", emitPopContentMouseEnter], ["mouseleave", emitPopContentMouseLeave]],
13265
+ reference: [[]]
13266
+ }
13210
13267
  };
13211
13268
  return (_a = triggerEvents[props2.trigger]) != null ? _a : [];
13212
13269
  };
@@ -13220,6 +13277,13 @@ var useFloating = (props2, ctx, {
13220
13277
  handlePopoverHide();
13221
13278
  }
13222
13279
  });
13280
+ const stopHide = () => {
13281
+ if (popHideTimerId) {
13282
+ isMouseenter = true;
13283
+ clearTimeout(popHideTimerId);
13284
+ popHideTimerId = void 0;
13285
+ }
13286
+ };
13223
13287
  return {
13224
13288
  showPopover,
13225
13289
  hidePopover,
@@ -13232,6 +13296,7 @@ var useFloating = (props2, ctx, {
13232
13296
  createPopInstance,
13233
13297
  updateFullscreenTarget,
13234
13298
  getFullscreenRoot,
13299
+ stopHide,
13235
13300
  localIsShow,
13236
13301
  cleanup
13237
13302
  };
@@ -13304,7 +13369,8 @@ var usePopoverInit = (props2, ctx, { refReference, refContent, refArrow, refRoot
13304
13369
  isElementFullScreen,
13305
13370
  updateFullscreenTarget,
13306
13371
  createPopInstance,
13307
- getFullscreenRoot
13372
+ getFullscreenRoot,
13373
+ stopHide
13308
13374
  } = useFloating(props2, ctx, { refReference, refContent, refArrow, refRoot });
13309
13375
  const showFn = () => {
13310
13376
  showPopover();
@@ -13407,7 +13473,7 @@ var usePopoverInit = (props2, ctx, { refReference, refContent, refArrow, refRoot
13407
13473
  document.body.removeEventListener("fullscreenchange", handleFullscreenChange);
13408
13474
  };
13409
13475
  const handleClickOutside = (_e) => {
13410
- ctx.emit(EMITEVENTS.CLICK_OUTSIDE, { isShow: localIsShow.value, event: _e });
13476
+ ctx.emit(EMIT_EVENTS$1.CLICK_OUTSIDE, { isShow: localIsShow.value, event: _e });
13411
13477
  if (props2.disableOutsideClick || props2.always || props2.disabled || props2.trigger === "manual") {
13412
13478
  return;
13413
13479
  }
@@ -13427,6 +13493,7 @@ var usePopoverInit = (props2, ctx, { refReference, refContent, refArrow, refRoot
13427
13493
  hidePopover,
13428
13494
  showFn,
13429
13495
  hideFn,
13496
+ stopHide,
13430
13497
  isFullscreen,
13431
13498
  boundary
13432
13499
  };
@@ -13469,6 +13536,7 @@ var Component$q = defineComponent({
13469
13536
  showPopover,
13470
13537
  hidePopover,
13471
13538
  updatePopover,
13539
+ stopHide,
13472
13540
  boundary
13473
13541
  } = usePopoverInit(props2, ctx, {
13474
13542
  refReference,
@@ -13512,7 +13580,8 @@ var Component$q = defineComponent({
13512
13580
  handleClickOutside,
13513
13581
  updatePopover,
13514
13582
  hide: hide2,
13515
- show: show2
13583
+ show: show2,
13584
+ stopHide
13516
13585
  };
13517
13586
  },
13518
13587
  render() {
@@ -17474,7 +17543,7 @@ var Settings = defineComponent({
17474
17543
  emit
17475
17544
  }) {
17476
17545
  const defaultSizeList = DEFAULT_SIZE_LIST;
17477
- const resolvedColVal = (item, index) => resolvePropVal(item, ["field", "index"], [item, index]);
17546
+ const resolvedColVal = (item, index) => resolvePropVal(item, ["field", "type"], [item, index]);
17478
17547
  const checkAll = ref(false);
17479
17548
  const isShow = ref(false);
17480
17549
  const localSettings = typeof props2.settings === "boolean" ? ref({
@@ -17489,7 +17558,7 @@ var Settings = defineComponent({
17489
17558
  }) : ref(props2.settings);
17490
17559
  const activeSize = ref(localSettings.value.size || "small");
17491
17560
  const activeHeight = ref(props2.rowHeight);
17492
- const checkedFields = ref(localSettings.value.checked);
17561
+ const checkedFields = ref(localSettings.value.checked || []);
17493
17562
  const className = resolveClassName("table-settings");
17494
17563
  const theme = `light ${className}`;
17495
17564
  const cachedValue = {
@@ -17528,10 +17597,12 @@ var Settings = defineComponent({
17528
17597
  e.preventDefault();
17529
17598
  checkAll.value = !checkAll.value;
17530
17599
  const fields = localSettings.value.fields || props2.columns || [];
17600
+ const readonlyFields = fields.filter((f2, index) => f2.disabled && checkedFields.value.includes(resolvedColVal(f2, index))).map((item, index) => resolvedColVal(item, index));
17531
17601
  if (checkAll.value) {
17532
- checkedFields.value = fields.filter((f2) => !f2.disabled).map((item, index) => resolvedColVal(item, index));
17602
+ const allFields = fields.filter((f2) => !f2.disabled).map((item, index) => resolvedColVal(item, index));
17603
+ checkedFields.value.splice(0, checkedFields.value.length, ...allFields, ...readonlyFields);
17533
17604
  } else {
17534
- checkedFields.value.splice(0, checkedFields.value.length);
17605
+ checkedFields.value.splice(0, checkedFields.value.length, ...readonlyFields);
17535
17606
  }
17536
17607
  };
17537
17608
  const isLimit = computed(() => {