lew-ui 1.7.18 → 1.7.20

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.es.js CHANGED
@@ -2673,7 +2673,7 @@ const _sfc_main$D = defineComponent({
2673
2673
  return null;
2674
2674
  };
2675
2675
  const init = () => {
2676
- let _options = props.options && props.options.map((e) => {
2676
+ const _options = props.options && props.options.map((e) => {
2677
2677
  return {
2678
2678
  ...e,
2679
2679
  isHasChild: e.children && e.children.length > 0 || false
@@ -2681,7 +2681,7 @@ const _sfc_main$D = defineComponent({
2681
2681
  }) || [];
2682
2682
  addPathsToTreeList(_options);
2683
2683
  state.format_options = _options;
2684
- let new_options = [];
2684
+ const new_options = [];
2685
2685
  new_options[0] = _options;
2686
2686
  state.options = new_options;
2687
2687
  };
@@ -2708,11 +2708,9 @@ const _sfc_main$D = defineComponent({
2708
2708
  state.tobeItem = { ...item, children: void 0 };
2709
2709
  if (props.free) {
2710
2710
  checkItem(item);
2711
- } else {
2712
- if (!item.isHasChild) {
2713
- checkItem(item);
2714
- ok();
2715
- }
2711
+ } else if (!item.isHasChild) {
2712
+ checkItem(item);
2713
+ ok();
2716
2714
  }
2717
2715
  };
2718
2716
  const checkItem = (item, level) => {
@@ -2722,12 +2720,10 @@ const _sfc_main$D = defineComponent({
2722
2720
  } else {
2723
2721
  state.tobelabels = item.labelPaths;
2724
2722
  }
2723
+ } else if (state.tobelabels === [item.label]) {
2724
+ state.tobelabels = [];
2725
2725
  } else {
2726
- if (state.tobelabels === [item.label]) {
2727
- state.tobelabels = [];
2728
- } else {
2729
- state.tobelabels = [item.label];
2730
- }
2726
+ state.tobelabels = [item.label];
2731
2727
  }
2732
2728
  };
2733
2729
  const show = () => {
@@ -2778,7 +2774,9 @@ const _sfc_main$D = defineComponent({
2778
2774
  emit("blur");
2779
2775
  };
2780
2776
  const getCascaderWidth = computed(() => {
2781
- let _hasChildOptions = state.options.filter((e) => e && e.length > 0).length;
2777
+ const _hasChildOptions = state.options.filter(
2778
+ (e) => e && e.length > 0
2779
+ ).length;
2782
2780
  if (_hasChildOptions > 1) {
2783
2781
  return _hasChildOptions * 180;
2784
2782
  }
@@ -2806,7 +2804,6 @@ const _sfc_main$D = defineComponent({
2806
2804
  ref_key: "lewPopverRef",
2807
2805
  ref: lewPopverRef,
2808
2806
  class: normalizeClass(["lew-cascader-view", unref(getCascaderViewClassName)]),
2809
- popoverBodyClassName: "lew-cascader-popover-body",
2810
2807
  trigger: _ctx.trigger,
2811
2808
  disabled: _ctx.disabled,
2812
2809
  placement: "bottom-start",
@@ -2906,17 +2903,13 @@ const _sfc_main$D = defineComponent({
2906
2903
  createCommentVNode(" "),
2907
2904
  (openBlock(true), createElementBlock(Fragment, null, renderList(oItem, (item, index2) => {
2908
2905
  return openBlock(), createElementBlock("div", {
2906
+ key: index2,
2909
2907
  class: normalizeClass(["lew-cascader-item", {
2910
2908
  "lew-cascader-item-disabled": item.disabled,
2911
- "lew-cascader-item-active": unref(state).activelabels.includes(
2912
- item.label
2913
- ),
2914
- "lew-cascader-item-tobe": unref(state).tobelabels.includes(
2915
- item.label
2916
- ),
2909
+ "lew-cascader-item-active": unref(state).activelabels.includes(item.label),
2910
+ "lew-cascader-item-tobe": unref(state).tobelabels.includes(item.label),
2917
2911
  "lew-cascader-item-select": unref(getLabel) && unref(getLabel).includes(item.label)
2918
2912
  }]),
2919
- key: index2,
2920
2913
  onClick: ($event) => selectItem(item, oIndex)
2921
2914
  }, [
2922
2915
  _ctx.free ? (openBlock(), createBlock(_component_lew_checkbox, {
@@ -2947,11 +2940,11 @@ const _sfc_main$D = defineComponent({
2947
2940
  }, {
2948
2941
  default: withCtx(() => [
2949
2942
  createVNode(unref(LewButton), {
2950
- onClick: cancel,
2951
2943
  round: "",
2952
2944
  color: "normal",
2953
2945
  type: "text",
2954
- size: "small"
2946
+ size: "small",
2947
+ onClick: cancel
2955
2948
  }, {
2956
2949
  default: withCtx(() => [
2957
2950
  createTextVNode("\u53D6\u6D88")
@@ -2959,10 +2952,10 @@ const _sfc_main$D = defineComponent({
2959
2952
  _: 1
2960
2953
  }),
2961
2954
  createVNode(unref(LewButton), {
2962
- onClick: ok,
2963
2955
  round: "",
2964
2956
  type: "light",
2965
- size: "small"
2957
+ size: "small",
2958
+ onClick: ok
2966
2959
  }, {
2967
2960
  default: withCtx(() => [
2968
2961
  createTextVNode(" \u786E\u8BA4 ")
@@ -3311,6 +3304,7 @@ const dropdownProps = {
3311
3304
  }
3312
3305
  };
3313
3306
  var LewDropdown_vue_vue_type_style_index_0_scoped_true_lang = "";
3307
+ var LewDropdown_vue_vue_type_style_index_1_lang = "";
3314
3308
  const _hoisted_1$t = ["onClick"];
3315
3309
  const _sfc_main$y = defineComponent({
3316
3310
  __name: "LewDropdown",
@@ -3333,6 +3327,7 @@ const _sfc_main$y = defineComponent({
3333
3327
  return openBlock(), createBlock(unref(LewPopover), {
3334
3328
  ref_key: "lewPopoverRef",
3335
3329
  ref: lewPopoverRef,
3330
+ "popover-body-class-name": "lew-dropdown-popover-body",
3336
3331
  trigger: _ctx.trigger,
3337
3332
  placement: _ctx.placement
3338
3333
  }, {
@@ -7062,6 +7057,7 @@ const _sfc_main$p = defineComponent({
7062
7057
  return openBlock(), createBlock(unref(LewPopover), {
7063
7058
  ref_key: "lewPopverRef",
7064
7059
  ref: lewPopverRef,
7060
+ "popover-body-class-name": "lew-select-popover-body",
7065
7061
  class: normalizeClass(["lew-select-view", unref(getSelectViewClassName)]),
7066
7062
  trigger: _ctx.trigger,
7067
7063
  disabled: _ctx.disabled,
@@ -7377,7 +7373,7 @@ const _sfc_main$o = defineComponent({
7377
7373
  });
7378
7374
  };
7379
7375
  const deleteTag = (index2) => {
7380
- let item = selectValue.value[index2];
7376
+ const item = selectValue.value[index2];
7381
7377
  selectValue.value && selectValue.value.splice(index2, 1);
7382
7378
  emit("delete", item);
7383
7379
  nextTick(() => {
@@ -7389,7 +7385,7 @@ const _sfc_main$o = defineComponent({
7389
7385
  if (item.disabled) {
7390
7386
  return;
7391
7387
  }
7392
- let _value = selectValue.value || [];
7388
+ const _value = selectValue.value || [];
7393
7389
  const index2 = _value.findIndex((e) => e == item.value);
7394
7390
  if (index2 >= 0) {
7395
7391
  _value.splice(index2, 1);
@@ -7478,6 +7474,7 @@ const _sfc_main$o = defineComponent({
7478
7474
  return openBlock(), createBlock(unref(LewPopover), {
7479
7475
  ref_key: "lewPopverRef",
7480
7476
  ref: lewPopverRef,
7477
+ "popover-body-class-name": "lew-select-multiple-popover-body",
7481
7478
  class: normalizeClass(["lew-select-view", unref(getSelectViewClassName)]),
7482
7479
  trigger: _ctx.trigger,
7483
7480
  disabled: _ctx.disabled,
@@ -7531,8 +7528,8 @@ const _sfc_main$o = defineComponent({
7531
7528
  default: withCtx(() => [
7532
7529
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(getLabels), (item, index2) => {
7533
7530
  return openBlock(), createBlock(_component_lew_tag, {
7534
- type: "light",
7535
7531
  key: index2,
7532
+ type: "light",
7536
7533
  size: _ctx.size,
7537
7534
  closable: "",
7538
7535
  onClose: ($event) => deleteTag(index2)
@@ -13424,6 +13421,10 @@ const popoverProps = {
13424
13421
  type: Array,
13425
13422
  default: [0, 8],
13426
13423
  description: "\u504F\u79FB\u91CF"
13424
+ },
13425
+ hideOnClick: {
13426
+ type: [Boolean, String],
13427
+ default: true
13427
13428
  }
13428
13429
  };
13429
13430
  var LewPopover_vue_vue_type_style_index_0_lang = "";
@@ -13512,7 +13513,7 @@ const _sfc_main$5 = defineComponent({
13512
13513
  content: bodyRef.value,
13513
13514
  animation: "shift-away-subtle",
13514
13515
  interactive: true,
13515
- hideOnClick: trigger !== "mouseenter",
13516
+ hideOnClick: trigger !== "mouseenter" ? props.hideOnClick : false,
13516
13517
  placement,
13517
13518
  duration: [120, 120],
13518
13519
  arrow: false,