vue-devui 1.0.0-beta.17 → 1.0.0-beta.18

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/vue-devui.es.js CHANGED
@@ -33,7 +33,7 @@ var __publicField = (obj, key, value) => {
33
33
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
34
34
  return value;
35
35
  };
36
- import { createVNode, getCurrentInstance, defineComponent, toRefs, inject, computed, Fragment, mergeProps, resolveComponent, createTextVNode, provide, onMounted, watch, ref, Transition, withDirectives, vShow, nextTick, h, render, resolveDirective, Teleport, renderSlot, isVNode, onUnmounted, reactive, toRef, isRef, onBeforeUnmount, Comment as Comment$1, onUpdated, onBeforeMount, readonly, unref, createApp, useSlots, shallowRef } from "vue";
36
+ import { createVNode, getCurrentInstance, defineComponent, toRefs, inject, computed, Fragment, mergeProps, resolveComponent, createTextVNode, provide, onMounted, watch, ref, Transition, withDirectives, vShow, nextTick, h, render, resolveDirective, Teleport, renderSlot, isVNode, onUnmounted, reactive, toRef, isRef, onBeforeUnmount, Comment as Comment$1, onUpdated, onBeforeMount, readonly, unref, createApp, withModifiers, useSlots, shallowRef } from "vue";
37
37
  const accordionProps = {
38
38
  data: {
39
39
  type: Array,
@@ -2752,49 +2752,59 @@ var IconInstall = {
2752
2752
  }
2753
2753
  };
2754
2754
  const buttonProps = {
2755
- type: {
2756
- type: String,
2757
- default: "button"
2758
- },
2759
2755
  variant: {
2760
2756
  type: String,
2761
- default: "primary"
2757
+ default: "outline"
2762
2758
  },
2763
2759
  size: {
2764
2760
  type: String,
2765
2761
  default: "md"
2766
2762
  },
2767
- position: {
2768
- type: String,
2769
- default: "default"
2770
- },
2771
- bordered: {
2772
- type: Boolean,
2773
- default: false
2763
+ color: {
2764
+ type: String
2774
2765
  },
2775
2766
  icon: {
2776
2767
  type: String,
2777
2768
  default: ""
2778
2769
  },
2779
- showLoading: {
2770
+ loading: {
2780
2771
  type: Boolean,
2781
2772
  default: false
2782
2773
  },
2783
- width: {
2784
- type: String
2785
- },
2786
2774
  disabled: {
2787
2775
  type: Boolean,
2788
2776
  default: false
2789
- },
2790
- autofocus: {
2791
- type: Boolean,
2792
- default: false
2793
- },
2794
- onClick: {
2795
- type: Function
2796
2777
  }
2797
2778
  };
2779
+ function useButton(props, ctx2) {
2780
+ const hasContent = computed(() => ctx2.slots.default);
2781
+ const colorMap = {
2782
+ solid: "primary",
2783
+ outline: "secondary",
2784
+ text: "secondary"
2785
+ };
2786
+ const defaultColor = colorMap[props.variant];
2787
+ const classes = computed(() => ({
2788
+ "devui-btn": true,
2789
+ [`devui-btn-${props.variant}`]: true,
2790
+ [`devui-btn-${props.variant}-${props.color || defaultColor}`]: true,
2791
+ [`devui-btn-${props.size}`]: true,
2792
+ "devui-btn-icon-wrap": props.icon,
2793
+ "devui-btn-icon": props.icon && !hasContent.value && props.variant !== "solid"
2794
+ }));
2795
+ const iconClass = computed(() => {
2796
+ if (!props.icon) {
2797
+ return;
2798
+ }
2799
+ const origin = "devui-icon-fix icon";
2800
+ if (hasContent.value) {
2801
+ return `${origin} clear-right-5`;
2802
+ } else {
2803
+ return origin;
2804
+ }
2805
+ });
2806
+ return { classes, iconClass };
2807
+ }
2798
2808
  var button = "";
2799
2809
  var DButton = defineComponent({
2800
2810
  name: "DButton",
@@ -2802,115 +2812,45 @@ var DButton = defineComponent({
2802
2812
  devLoading: loadingDirective
2803
2813
  },
2804
2814
  props: buttonProps,
2815
+ emits: ["click"],
2805
2816
  setup(props, ctx2) {
2806
- const buttonContent = ref(null);
2817
+ const {
2818
+ icon,
2819
+ disabled,
2820
+ loading: loading2
2821
+ } = toRefs(props);
2822
+ const {
2823
+ classes,
2824
+ iconClass
2825
+ } = useButton(props, ctx2);
2807
2826
  const onClick = (e) => {
2808
- var _a;
2809
- if (props.showLoading) {
2827
+ if (loading2.value) {
2810
2828
  return;
2811
2829
  }
2812
- (_a = props.onClick) == null ? void 0 : _a.call(props, e);
2830
+ ctx2.emit("click", e);
2813
2831
  };
2814
- const hasContent = computed(() => ctx2.slots.default);
2815
- const btnClass = computed(() => {
2816
- const {
2817
- variant,
2818
- size,
2819
- position,
2820
- bordered,
2821
- icon
2822
- } = props;
2823
- const origin = `devui-btn devui-btn-${variant} devui-btn-${size} devui-btn-${position}`;
2824
- const borderedClass = bordered ? "bordered" : "";
2825
- const btnIcon = !!icon && !hasContent.value && variant !== "primary" ? "d-btn-icon" : "";
2826
- const btnIconWrap = !!icon ? "d-btn-icon-wrap" : "";
2827
- return `${origin} ${borderedClass} ${btnIcon} ${btnIconWrap}`;
2828
- });
2829
- const iconClass = computed(() => {
2830
- if (!props.icon) {
2831
- return;
2832
- }
2833
- const origin = "devui-icon-fix icon";
2834
- if (hasContent.value) {
2835
- return `${origin} clear-right-5`;
2836
- } else {
2837
- return origin;
2838
- }
2839
- });
2840
2832
  return () => {
2841
2833
  var _a, _b;
2842
- const {
2843
- icon,
2844
- type: type4,
2845
- disabled,
2846
- showLoading,
2847
- width
2848
- } = props;
2849
- return createVNode("div", mergeProps({
2850
- "class": "devui-btn-host"
2851
- }, ctx2.attrs), [withDirectives(createVNode("button", {
2852
- "class": btnClass.value,
2853
- "type": type4,
2854
- "disabled": disabled,
2855
- "style": {
2856
- width
2857
- },
2834
+ return withDirectives(createVNode("button", {
2835
+ "class": classes.value,
2836
+ "disabled": disabled.value,
2858
2837
  "onClick": onClick
2859
- }, [!!icon ? createVNode(Icon, {
2860
- "name": icon,
2838
+ }, [icon.value && createVNode(Icon, {
2839
+ "name": icon.value,
2840
+ "size": "12px",
2861
2841
  "class": iconClass.value
2862
- }, null) : null, createVNode("span", {
2863
- "class": "button-content",
2864
- "ref": buttonContent
2865
- }, [(_b = (_a = ctx2.slots).default) == null ? void 0 : _b.call(_a)])]), [[resolveDirective("devLoading"), showLoading]])]);
2842
+ }, null), createVNode("span", {
2843
+ "class": "button-content"
2844
+ }, [(_b = (_a = ctx2.slots).default) == null ? void 0 : _b.call(_a)])]), [[resolveDirective("dLoading"), loading2.value]]);
2866
2845
  };
2867
2846
  }
2868
2847
  });
2869
- const loadingConstructor = defineComponent(Loading);
2870
- const cacheTarget = /* @__PURE__ */ new WeakMap();
2871
- const loading = {
2872
- open(options = {}) {
2873
- const parent = options.target || document.body;
2874
- if (cacheTarget.has(parent)) {
2875
- return cacheTarget.get(parent);
2876
- }
2877
- parent.style.position = options.positionType;
2878
- const isFull = document.body === parent;
2879
- options = __spreadValues(__spreadValues({}, new LoadingProps()), options);
2880
- const instance = createComponent$1(loadingConstructor, __spreadProps(__spreadValues({}, options), {
2881
- isFull
2882
- }), options.loadingTemplateRef ? () => options.loadingTemplateRef : null);
2883
- cacheTarget.set(parent, instance);
2884
- instance.proxy.open();
2885
- parent.appendChild(instance.proxy.$el);
2886
- const close = instance.proxy.close;
2887
- instance.loadingInstance = instance.proxy;
2888
- instance.loadingInstance.close = (...args) => {
2889
- cacheTarget.delete(parent);
2890
- close(...args);
2891
- };
2892
- return instance;
2893
- }
2894
- };
2895
- var LoadingInstall = {
2896
- title: "Loading \u52A0\u8F7D\u63D0\u793A",
2897
- category: "\u53CD\u9988",
2898
- status: "100%",
2899
- install(app) {
2900
- app.directive("dLoading", loadingDirective);
2901
- app.config.globalProperties.$loadingService = loading;
2902
- }
2903
- };
2904
- DButton.install = function(app) {
2905
- app.directive("dLoading", loadingDirective);
2906
- app.component(DButton.name, DButton);
2907
- };
2908
2848
  var ButtonInstall = {
2909
2849
  title: "Button \u6309\u94AE",
2910
2850
  category: "\u901A\u7528",
2911
2851
  status: "100%",
2912
2852
  install(app) {
2913
- app.use(DButton);
2853
+ app.component(DButton.name, DButton);
2914
2854
  }
2915
2855
  };
2916
2856
  var card = "";
@@ -13888,14 +13828,18 @@ const drawerProps = {
13888
13828
  type: Boolean,
13889
13829
  default: false
13890
13830
  },
13831
+ showAnimation: {
13832
+ type: Boolean,
13833
+ default: true
13834
+ },
13891
13835
  beforeHidden: {
13892
13836
  type: [Promise, Function]
13893
13837
  },
13894
13838
  content: {
13895
- type: [Object, Function]
13839
+ type: Object
13896
13840
  },
13897
13841
  header: {
13898
- type: [Object, Function]
13842
+ type: Object
13899
13843
  }
13900
13844
  };
13901
13845
  var drawerHeader = "";
@@ -13934,12 +13878,8 @@ var DrawerHeader = defineComponent({
13934
13878
  if (destroyOnHide.value && !visible) {
13935
13879
  return null;
13936
13880
  }
13937
- const visibleVal = visible ? "visible" : "hidden";
13938
13881
  return createVNode("div", {
13939
- "class": "devui-drawer-header",
13940
- "style": {
13941
- visibility: visibleVal
13942
- }
13882
+ "class": "devui-drawer-header"
13943
13883
  }, [createVNode("div", {
13944
13884
  "class": "devui-drawer-header-item"
13945
13885
  }, [createVNode("span", {
@@ -13975,12 +13915,7 @@ var DrawerContainer = defineComponent({
13975
13915
  if (destroyOnHide.value && !visible) {
13976
13916
  return null;
13977
13917
  }
13978
- const visibleVal = this.visible ? "visible" : "hidden";
13979
- return createVNode("div", {
13980
- "style": {
13981
- visibility: visibleVal
13982
- }
13983
- }, [createTextVNode("\u5185\u5BB9\u533A\u57DF")]);
13918
+ return createVNode("div", null, [createTextVNode("\u5185\u5BB9\u533A\u57DF")]);
13984
13919
  }
13985
13920
  });
13986
13921
  var drawerBody = "";
@@ -13998,6 +13933,7 @@ var DrawerBody = defineComponent({
13998
13933
  const visible = inject("visible");
13999
13934
  const backdropCloseable = inject("backdropCloseable");
14000
13935
  const destroyOnHide = inject("destroyOnHide");
13936
+ const showAnimation = inject("showAnimation");
14001
13937
  const navRight = computed(() => position.value === "right" ? {
14002
13938
  "right": 0
14003
13939
  } : {
@@ -14019,6 +13955,8 @@ var DrawerBody = defineComponent({
14019
13955
  navRight,
14020
13956
  navWidth,
14021
13957
  visible,
13958
+ position,
13959
+ showAnimation,
14022
13960
  clickContent,
14023
13961
  handleDrawerClose,
14024
13962
  destroyOnHide
@@ -14031,36 +13969,42 @@ var DrawerBody = defineComponent({
14031
13969
  isCover,
14032
13970
  navRight,
14033
13971
  navWidth,
13972
+ showAnimation,
14034
13973
  visible,
14035
13974
  handleDrawerClose,
14036
- destroyOnHide
13975
+ destroyOnHide,
13976
+ position
14037
13977
  } = this;
14038
13978
  if (destroyOnHide.value && !visible) {
14039
13979
  return null;
14040
13980
  }
14041
- const visibleVal = visible ? "visible" : "hidden";
13981
+ const transitionName = showAnimation ? position : "none";
14042
13982
  return createVNode("div", {
14043
13983
  "class": "devui-drawer",
14044
13984
  "style": {
14045
- zIndex: zindex,
14046
- visibility: visibleVal
13985
+ zIndex: zindex
14047
13986
  },
14048
13987
  "onClick": handleDrawerClose
14049
13988
  }, [isCover ? createVNode("div", {
14050
13989
  "class": "devui-overlay-backdrop"
14051
- }, null) : null, createVNode("div", {
14052
- "class": "devui-overlay-wrapper"
14053
- }, [createVNode("div", {
14054
- "class": "devui-drawer-nav",
14055
- "style": __spreadValues({
14056
- "width": navWidth
14057
- }, navRight)
14058
- }, [createVNode("div", {
14059
- "class": "devui-drawer-content",
14060
- "onClick": this.clickContent
14061
- }, [slots.default ? slots.default() : null])])])]);
13990
+ }, null) : null, createVNode(Transition, {
13991
+ "name": "devui-drawer-" + transitionName
13992
+ }, {
13993
+ default: () => [withDirectives(createVNode("div", {
13994
+ "class": "devui-overlay-wrapper"
13995
+ }, [createVNode("div", {
13996
+ "class": "devui-drawer-nav",
13997
+ "style": __spreadValues({
13998
+ "width": navWidth
13999
+ }, navRight)
14000
+ }, [createVNode("div", {
14001
+ "class": "devui-drawer-content",
14002
+ "onClick": this.clickContent
14003
+ }, [slots.default ? slots.default() : null])])]), [[vShow, visible]])]
14004
+ })]);
14062
14005
  }
14063
14006
  });
14007
+ var drawer = "";
14064
14008
  var Drawer$1 = defineComponent({
14065
14009
  name: "DDrawer",
14066
14010
  props: drawerProps,
@@ -14077,7 +14021,8 @@ var Drawer$1 = defineComponent({
14077
14021
  escKeyCloseable,
14078
14022
  position,
14079
14023
  backdropCloseable,
14080
- destroyOnHide
14024
+ destroyOnHide,
14025
+ showAnimation
14081
14026
  } = toRefs(props);
14082
14027
  const isFullScreen = ref(false);
14083
14028
  const fullscreen2 = () => {
@@ -14122,6 +14067,7 @@ var Drawer$1 = defineComponent({
14122
14067
  provide("isFullScreen", isFullScreen);
14123
14068
  provide("backdropCloseable", backdropCloseable);
14124
14069
  provide("destroyOnHide", destroyOnHide);
14070
+ provide("showAnimation", showAnimation);
14125
14071
  onUnmounted(() => {
14126
14072
  document.removeEventListener("keyup", escCloseDrawer);
14127
14073
  });
@@ -14143,15 +14089,10 @@ var Drawer$1 = defineComponent({
14143
14089
  if (destroyOnHide.value && !visible) {
14144
14090
  return null;
14145
14091
  }
14146
- const visibleVal = visible ? "visible" : "hidden";
14147
14092
  return createVNode(Teleport, {
14148
14093
  "to": "body"
14149
14094
  }, {
14150
- default: () => [createVNode(DrawerBody, {
14151
- "style": {
14152
- visibility: visibleVal
14153
- }
14154
- }, {
14095
+ default: () => [withDirectives(createVNode(DrawerBody, null, {
14155
14096
  default: () => [this.slots.header ? this.slots.header({
14156
14097
  fullscreen: fullscreen2,
14157
14098
  closeDrawer
@@ -14159,18 +14100,19 @@ var Drawer$1 = defineComponent({
14159
14100
  "onToggleFullScreen": fullscreen2,
14160
14101
  "onClose": closeDrawer
14161
14102
  }, null), this.slots.content ? this.slots.content() : createVNode(DrawerContainer, null, null)]
14162
- })]
14103
+ }), [[vShow, visible]])]
14163
14104
  });
14164
14105
  }
14165
14106
  });
14166
- function createDrawerApp(props, drawer, el) {
14167
- if (drawer) {
14168
- return drawer;
14107
+ function createDrawerApp(props, drawer2, el) {
14108
+ if (drawer2) {
14109
+ return drawer2;
14169
14110
  }
14170
- const res = createApp(createVNode(Drawer$1, {
14111
+ const restProps = lodash.exports.omit(props, ["header", "content", "visible"]);
14112
+ const res = createApp(createVNode(Drawer$1, mergeProps({
14171
14113
  "visible": props.visible,
14172
14114
  "onUpdate:visible": ($event) => props.visible = $event
14173
- }, {
14115
+ }, restProps), {
14174
14116
  header: props.header,
14175
14117
  content: props.content
14176
14118
  }));
@@ -14178,11 +14120,11 @@ function createDrawerApp(props, drawer, el) {
14178
14120
  return res;
14179
14121
  }
14180
14122
  class DrawerService {
14181
- static create(props, drawer) {
14182
- if (!drawer) {
14183
- drawer = new Drawer(props);
14123
+ static create(props, drawer2) {
14124
+ if (!drawer2) {
14125
+ drawer2 = new Drawer(props);
14184
14126
  }
14185
- return drawer;
14127
+ return drawer2;
14186
14128
  }
14187
14129
  }
14188
14130
  class Drawer {
@@ -14468,60 +14410,42 @@ var DropdownInstall = {
14468
14410
  };
14469
14411
  const editableSelectProps = {
14470
14412
  appendToBody: {
14471
- type: Boolean,
14472
- default: false
14473
- },
14474
- modelValue: {
14475
- type: [String, Number]
14413
+ type: Boolean
14476
14414
  },
14477
14415
  options: {
14478
14416
  type: Array,
14479
14417
  default: () => []
14480
14418
  },
14481
- width: {
14482
- type: Number,
14483
- default: 450
14484
- },
14485
- maxHeight: {
14486
- type: Number
14487
- },
14488
14419
  disabled: {
14489
- type: Boolean,
14490
- default: false
14491
- },
14492
- disabledKey: {
14493
- type: String
14494
- },
14495
- remote: {
14496
- type: Boolean,
14497
- default: false
14420
+ type: Boolean
14498
14421
  },
14499
14422
  loading: {
14500
14423
  type: Boolean
14501
14424
  },
14502
- enableLazyLoad: {
14503
- type: Boolean,
14504
- default: false
14425
+ optionDisabledKey: {
14426
+ type: String,
14427
+ default: ""
14505
14428
  },
14506
- remoteMethod: {
14507
- type: Function
14429
+ placeholder: {
14430
+ type: String,
14431
+ default: "Search"
14508
14432
  },
14509
- filterMethod: {
14510
- type: Function
14433
+ modelValue: {
14434
+ type: String
14511
14435
  },
14512
- searchFn: {
14513
- type: Function
14436
+ width: {
14437
+ type: Number
14438
+ },
14439
+ maxHeight: {
14440
+ type: Number
14441
+ },
14442
+ filterOption: {
14443
+ type: [Function, Boolean]
14514
14444
  },
14515
14445
  loadMore: {
14516
14446
  type: Function
14517
14447
  }
14518
14448
  };
14519
- const selectDropdownProps = {
14520
- options: {
14521
- type: Array,
14522
- default: () => []
14523
- }
14524
- };
14525
14449
  function className$2(classStr, classOpt) {
14526
14450
  let classname = classStr;
14527
14451
  if (typeof classOpt === "object") {
@@ -14531,71 +14455,56 @@ function className$2(classStr, classOpt) {
14531
14455
  }
14532
14456
  return classname;
14533
14457
  }
14534
- var SelectDropdown = defineComponent({
14535
- name: "DSelectDropdown",
14536
- props: selectDropdownProps,
14537
- setup(props) {
14538
- const select2 = inject("InjectionKey");
14539
- const {
14540
- props: selectProps2,
14541
- dropdownRef,
14542
- visible,
14543
- selectOptionClick,
14544
- renderDefaultSlots,
14545
- renderEmptySlots,
14546
- selectedIndex,
14547
- hoverIndex,
14548
- loadMore
14549
- } = select2;
14550
- const {
14551
- maxHeight
14552
- } = selectProps2;
14553
- return () => {
14554
- const getLiCls = (item2, index2) => {
14555
- const {
14556
- disabledKey
14557
- } = selectProps2;
14558
- return className$2("devui-dropdown-item", {
14559
- disabled: disabledKey ? !!item2[disabledKey] : false,
14560
- selected: selectedIndex.value === index2,
14561
- "devui-dropdown-bg": hoverIndex.value === index2
14562
- });
14563
- };
14564
- return withDirectives(createVNode("div", {
14565
- "class": "devui-dropdown-menu"
14566
- }, [createVNode("ul", {
14567
- "ref": dropdownRef,
14568
- "class": "devui-list-unstyled scroll-height",
14569
- "style": {
14570
- maxHeight: maxHeight + "px"
14571
- },
14572
- "onScroll": loadMore
14573
- }, [props.options.map((o, index2) => {
14574
- return createVNode("li", {
14575
- "class": getLiCls(o, index2),
14576
- "onClick": ($evnet) => selectOptionClick($evnet, o)
14577
- }, [renderDefaultSlots(o)]);
14578
- }), withDirectives(createVNode("li", {
14579
- "class": "devui-no-result-template"
14580
- }, [createVNode("div", {
14581
- "class": "devui-no-data-tip"
14582
- }, [renderEmptySlots()])]), [[vShow, props.options.length === 0]])])]), [[vShow, visible]]);
14583
- };
14458
+ var editableSelect = "";
14459
+ const getFilterFunc = () => (val, option2) => option2.label.toLocaleLowerCase().indexOf(val.toLocaleLowerCase()) > -1;
14460
+ const userFilterOptions = (normalizeOptions, inputValue, filterOption) => computed(() => {
14461
+ const filteredOptions = [];
14462
+ if (!inputValue.value || filterOption === false) {
14463
+ return normalizeOptions.value;
14584
14464
  }
14465
+ const filterFunc = typeof filterOption === "function" ? filterOption : getFilterFunc();
14466
+ normalizeOptions.value.forEach((option2) => {
14467
+ if (filterFunc(inputValue.value, option2)) {
14468
+ filteredOptions.push(option2);
14469
+ }
14470
+ });
14471
+ return filteredOptions;
14585
14472
  });
14586
- var editableSelect = "";
14587
- function keyboardSelect(dropdownRef, visible, hoverIndex, selectedIndex, filteredOptions, toggleMenu, selectOptionClick) {
14588
- const updateHoverIndex = (index2) => {
14473
+ const useInput = (inputValue, ctx2) => {
14474
+ const onInputChange = (value) => {
14475
+ ctx2.emit("search", value);
14476
+ };
14477
+ const handleInput = (event) => {
14478
+ const value = event.target.value;
14479
+ inputValue.value = value;
14480
+ onInputChange(value);
14481
+ };
14482
+ return {
14483
+ handleInput
14484
+ };
14485
+ };
14486
+ const useLazyLoad = (dropdownRef, inputValue, filterOtion, load) => {
14487
+ const loadMore = () => {
14488
+ if (filterOtion !== false)
14489
+ return;
14490
+ if (dropdownRef.value.clientHeight + dropdownRef.value.scrollTop >= dropdownRef.value.scrollHeight) {
14491
+ load(inputValue.value);
14492
+ }
14493
+ };
14494
+ return { loadMore };
14495
+ };
14496
+ const useKeyboardSelect = (dropdownRef, disabled, visible, hoverIndex, selectedIndex, options, toggleMenu, closeMenu, handleClick) => {
14497
+ const updateHoveringIndex = (index2) => {
14589
14498
  hoverIndex.value = index2;
14590
14499
  };
14591
- const scrollToActive = (index2) => {
14592
- const dropdownVal = dropdownRef.value;
14593
- const li = dropdownVal.children[index2];
14500
+ const scrollToItem = (index2) => {
14501
+ const ul = dropdownRef.value;
14502
+ const li = ul.children[index2];
14594
14503
  nextTick(() => {
14595
14504
  if (li.scrollIntoViewIfNeeded) {
14596
14505
  li.scrollIntoViewIfNeeded(false);
14597
14506
  } else {
14598
- const containerInfo = dropdownVal.getBoundingClientRect();
14507
+ const containerInfo = ul.getBoundingClientRect();
14599
14508
  const elementInfo = li.getBoundingClientRect();
14600
14509
  if (elementInfo.bottom > containerInfo.bottom || elementInfo.top < containerInfo.top) {
14601
14510
  li.scrollIntoView(false);
@@ -14603,227 +14512,238 @@ function keyboardSelect(dropdownRef, visible, hoverIndex, selectedIndex, filtere
14603
14512
  }
14604
14513
  });
14605
14514
  };
14606
- const onKeyboardSelect = (e) => {
14607
- const option2 = filteredOptions.value[hoverIndex.value];
14608
- selectOptionClick(e, option2);
14609
- hoverIndex.value = selectedIndex.value;
14610
- };
14611
- const handleKeydown = (e) => {
14612
- const keyCode = e.key || e.code;
14613
- let index2 = 0;
14614
- if (!visible.value) {
14615
- toggleMenu();
14515
+ const onKeyboardNavigation = (direction, newIndex) => {
14516
+ if (!newIndex) {
14517
+ newIndex = hoverIndex.value;
14616
14518
  }
14617
- if (keyCode === "Backspace") {
14519
+ if (!["ArrowDown", "ArrowUp"].includes(direction))
14618
14520
  return;
14619
- }
14620
- if (keyCode === "ArrowUp") {
14621
- index2 = hoverIndex.value - 1;
14622
- if (index2 < 0) {
14623
- index2 = filteredOptions.value.length - 1;
14521
+ if (direction === "ArrowUp") {
14522
+ if (newIndex === 0) {
14523
+ newIndex = options.value.length - 1;
14524
+ scrollToItem(newIndex);
14525
+ updateHoveringIndex(newIndex);
14526
+ return;
14624
14527
  }
14625
- } else if (keyCode === "ArrowDown") {
14626
- index2 = hoverIndex.value + 1;
14627
- if (index2 > filteredOptions.value.length - 1) {
14628
- index2 = 0;
14528
+ newIndex = newIndex - 1;
14529
+ } else if (direction === "ArrowDown") {
14530
+ if (newIndex === options.value.length - 1) {
14531
+ newIndex = 0;
14532
+ scrollToItem(newIndex);
14533
+ updateHoveringIndex(newIndex);
14534
+ return;
14629
14535
  }
14536
+ newIndex = newIndex + 1;
14630
14537
  }
14631
- if (keyCode === "Enter") {
14632
- return onKeyboardSelect(e);
14538
+ const option2 = options.value[newIndex];
14539
+ if (option2[disabled]) {
14540
+ return onKeyboardNavigation(direction, newIndex);
14541
+ }
14542
+ scrollToItem(newIndex);
14543
+ updateHoveringIndex(newIndex);
14544
+ };
14545
+ const handleKeydown = (event) => {
14546
+ const keyCode = event.key || event.code;
14547
+ if (options.value.length === 0)
14548
+ return;
14549
+ if (!visible.value) {
14550
+ return toggleMenu();
14551
+ }
14552
+ const onKeydownEnter = () => {
14553
+ handleClick(options.value[hoverIndex.value]);
14554
+ closeMenu();
14555
+ };
14556
+ const onKeydownEsc = () => {
14557
+ closeMenu();
14558
+ };
14559
+ switch (keyCode) {
14560
+ case "Enter":
14561
+ onKeydownEnter();
14562
+ break;
14563
+ case "Escape":
14564
+ onKeydownEsc();
14565
+ break;
14566
+ default:
14567
+ onKeyboardNavigation(keyCode);
14633
14568
  }
14634
- updateHoverIndex(index2);
14635
- scrollToActive(index2);
14636
14569
  };
14637
14570
  return {
14638
14571
  handleKeydown
14639
14572
  };
14640
- }
14573
+ };
14641
14574
  var EditableSelect = defineComponent({
14642
14575
  name: "DEditableSelect",
14643
14576
  directives: {
14644
- ClickOutside: clickoutsideDirective
14577
+ clickOutside: clickoutsideDirective
14645
14578
  },
14646
14579
  props: editableSelectProps,
14647
- emits: ["update:modelValue"],
14580
+ emits: ["update:modelValue", "search", "loadMore"],
14648
14581
  setup(props, ctx2) {
14649
- const renderDropdown = (condition, type4) => {
14650
- if (!condition && type4 === 0) {
14651
- return createVNode(Transition, {
14652
- "name": "fade"
14653
- }, {
14654
- default: () => [createVNode(SelectDropdown, {
14655
- "options": filteredOptions.value
14656
- }, null)]
14657
- });
14658
- } else if (condition && type4 === 1) {
14582
+ const getItemCls = (option2, index2) => {
14583
+ const {
14584
+ optionDisabledKey: disabledKey
14585
+ } = props;
14586
+ return className$2("devui-dropdown-item", {
14587
+ disabled: disabledKey ? !!option2[disabledKey] : false,
14588
+ selected: index2 === selectIndex.value,
14589
+ "devui-dropdown-bg": index2 === hoverIndex.value
14590
+ });
14591
+ };
14592
+ const renderDropdown = () => {
14593
+ if (props.appendToBody) {
14659
14594
  return createVNode(resolveComponent("d-flexible-overlay"), {
14660
- "hasBackdrop": false,
14661
14595
  "origin": origin,
14662
- "position": position,
14663
14596
  "visible": visible.value,
14664
- "onUpdate:visible": ($event) => visible.value = $event
14597
+ "onUpdate:visible": ($event) => visible.value = $event,
14598
+ "position": position,
14599
+ "hasBackdrop": false
14665
14600
  }, {
14666
14601
  default: () => [createVNode("div", {
14667
- "class": "devui-dropdown",
14602
+ "class": "devui-editable-select-dropdown",
14668
14603
  "style": {
14669
14604
  width: props.width + "px"
14670
14605
  }
14671
- }, [createVNode(SelectDropdown, {
14672
- "options": filteredOptions.value
14673
- }, null)])]
14606
+ }, [withDirectives(createVNode("div", {
14607
+ "class": "devui-dropdown-menu"
14608
+ }, [createVNode("ul", {
14609
+ "ref": dopdownRef,
14610
+ "class": "devui-list-unstyled scroll-height",
14611
+ "style": {
14612
+ maxHeight: props.maxHeight + "px"
14613
+ },
14614
+ "onScroll": loadMore
14615
+ }, [filteredOptions.value.map((option2, index2) => {
14616
+ return createVNode("li", {
14617
+ "class": getItemCls(option2, index2),
14618
+ "onClick": (e) => {
14619
+ e.stopPropagation();
14620
+ handleClick(option2);
14621
+ }
14622
+ }, [ctx2.slots.itemTemplate ? ctx2.slots.itemTemplate(option2) : option2.label]);
14623
+ }), withDirectives(createVNode("li", {
14624
+ "class": "devui-no-result-template"
14625
+ }, [createVNode("div", {
14626
+ "class": "devui-no-data-tip"
14627
+ }, [emptyText.value])]), [[vShow, !filteredOptions.value.length]])])]), [[resolveDirective("dLoading"), props.loading], [vShow, visible.value]])])]
14628
+ });
14629
+ } else {
14630
+ return createVNode(Transition, {
14631
+ "name": "fade"
14632
+ }, {
14633
+ default: () => [withDirectives(createVNode("div", {
14634
+ "class": "devui-dropdown-menu"
14635
+ }, [createVNode("ul", {
14636
+ "ref": dopdownRef,
14637
+ "class": "devui-list-unstyled scroll-height",
14638
+ "style": {
14639
+ maxHeight: props.maxHeight + "px"
14640
+ },
14641
+ "onScroll": loadMore
14642
+ }, [filteredOptions.value.map((option2, index2) => {
14643
+ return createVNode("li", {
14644
+ "class": getItemCls(option2, index2),
14645
+ "onClick": (e) => {
14646
+ e.stopPropagation();
14647
+ handleClick(option2);
14648
+ }
14649
+ }, [ctx2.slots.itemTemplate ? ctx2.slots.itemTemplate(option2) : option2.label]);
14650
+ }), withDirectives(createVNode("li", {
14651
+ "class": "devui-no-result-template"
14652
+ }, [createVNode("div", {
14653
+ "class": "devui-no-data-tip"
14654
+ }, [emptyText.value])]), [[vShow, !filteredOptions.value.length]])])]), [[vShow, visible.value]])]
14674
14655
  });
14675
14656
  }
14676
14657
  };
14677
- const renderDefaultSlots = (item2) => {
14678
- return ctx2.slots.default ? renderSlot(ctx2.slots, "default", {
14679
- item: item2
14680
- }) : item2.name;
14681
- };
14682
- const renderEmptySlots = () => {
14683
- return ctx2.slots.empty ? renderSlot(ctx2.slots, "empty") : emptyText.value;
14684
- };
14658
+ const dopdownRef = ref();
14685
14659
  const origin = ref();
14686
- const dropdownRef = ref();
14687
- const visible = ref(false);
14688
- const inputValue = ref("");
14689
- const selectedIndex = ref(0);
14690
- const hoverIndex = ref(0);
14691
- const query = ref(props.modelValue);
14692
14660
  const position = reactive({
14693
14661
  originX: "left",
14694
14662
  originY: "bottom",
14695
14663
  overlayX: "left",
14696
14664
  overlayY: "top"
14697
14665
  });
14698
- const wait = computed(() => props.remote ? 300 : 0);
14699
- const emptyText = computed(() => {
14700
- const options = filteredOptions.value;
14701
- if (!props.remote && options.length === 0) {
14702
- return "\u6CA1\u6709\u76F8\u5173\u8BB0\u5F55";
14703
- }
14704
- if (options.length === 0) {
14705
- return "\u6CA1\u6709\u6570\u636E";
14706
- }
14707
- return null;
14708
- });
14666
+ const visible = ref(false);
14667
+ const inputValue = ref(props.modelValue);
14668
+ const hoverIndex = ref(0);
14669
+ const selectIndex = ref(0);
14709
14670
  const normalizeOptions = computed(() => {
14710
- let options;
14711
- return props.options.map((item2) => {
14712
- if (typeof item2 !== "object") {
14713
- options = {
14714
- name: item2
14715
- };
14716
- return options;
14671
+ return props.options.map((option2) => {
14672
+ if (typeof option2 === "object") {
14673
+ return __spreadValues({
14674
+ label: option2.label ? option2.label : option2.value,
14675
+ value: option2.value
14676
+ }, option2);
14717
14677
  }
14718
- return item2;
14678
+ return {
14679
+ label: option2 + "",
14680
+ value: option2
14681
+ };
14719
14682
  });
14720
14683
  });
14721
- const filteredOptions = computed(() => {
14722
- const isValidOption = (o) => {
14723
- const query2 = inputValue.value;
14724
- const containsQueryString = query2 ? o.name.toLocaleLowerCase().indexOf(query2.toLocaleLowerCase()) >= 0 : true;
14725
- return containsQueryString;
14726
- };
14727
- return normalizeOptions.value.map((item2) => {
14728
- if (props.remote || isValidOption(item2)) {
14729
- return item2;
14730
- }
14731
- return null;
14732
- }).filter((item2) => item2 !== null);
14684
+ const filteredOptions = userFilterOptions(normalizeOptions, inputValue, props.filterOption);
14685
+ const emptyText = computed(() => {
14686
+ let text;
14687
+ if (props.filterOption !== false && !filteredOptions.value.length) {
14688
+ text = "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55";
14689
+ } else if (props.filterOption === false && !filteredOptions.value.length) {
14690
+ text = "\u6CA1\u6709\u6570\u636E";
14691
+ }
14692
+ return ctx2.slots.noResultItemTemplate ? ctx2.slots.noResultItemTemplate() : text;
14733
14693
  });
14734
- const findIndex = (o) => {
14735
- return normalizeOptions.value.findIndex((item2) => {
14736
- return item2.name === o.name;
14737
- });
14738
- };
14739
- const handleClose = () => {
14740
- visible.value = false;
14741
- };
14742
14694
  const toggleMenu = () => {
14743
- if (!props.disabled) {
14744
- visible.value = !visible.value;
14745
- }
14695
+ visible.value = !visible.value;
14746
14696
  };
14747
- const onInputChange = (val) => {
14748
- if (props.filterMethod) {
14749
- props.filterMethod(val);
14750
- } else if (props.remote) {
14751
- props.remoteMethod(val);
14752
- }
14753
- };
14754
- const debouncedOnInputChange = lodash.exports.debounce(onInputChange, wait.value);
14755
- const handleInput = (event) => {
14756
- const value = event.target.value;
14757
- inputValue.value = value;
14758
- query.value = value;
14759
- if (props.remote) {
14760
- debouncedOnInputChange(value);
14761
- } else {
14762
- onInputChange(value);
14763
- }
14697
+ const closeMenu = () => {
14698
+ visible.value = false;
14764
14699
  };
14765
- const selectOptionClick = (e, item2) => {
14700
+ const {
14701
+ loadMore
14702
+ } = useLazyLoad(dopdownRef, inputValue, props.filterOption, props.loadMore);
14703
+ const {
14704
+ handleInput
14705
+ } = useInput(inputValue, ctx2);
14706
+ const handleClick = (option2) => {
14766
14707
  const {
14767
- disabledKey
14708
+ optionDisabledKey: disabledKey
14768
14709
  } = props;
14769
- if (disabledKey && item2[disabledKey]) {
14770
- e.stopPropagation();
14771
- } else {
14772
- query.value = item2.name;
14773
- selectedIndex.value = findIndex(item2);
14774
- inputValue.value = "";
14775
- ctx2.emit("update:modelValue", item2.name);
14776
- visible.value = false;
14777
- }
14778
- };
14779
- const loadMore = () => {
14780
- if (!props.enableLazyLoad)
14710
+ if (disabledKey && !!option2[disabledKey])
14781
14711
  return;
14782
- const dropdownVal = dropdownRef.value;
14783
- if (dropdownVal.clientHeight + dropdownVal.scrollTop >= dropdownVal.scrollHeight) {
14784
- props.loadMore();
14785
- }
14712
+ ctx2.emit("update:modelValue", option2.label);
14713
+ closeMenu();
14786
14714
  };
14787
14715
  const {
14788
14716
  handleKeydown
14789
- } = keyboardSelect(dropdownRef, visible, hoverIndex, selectedIndex, filteredOptions, toggleMenu, selectOptionClick);
14790
- provide("InjectionKey", {
14791
- dropdownRef,
14792
- props: reactive(__spreadValues({}, toRefs(props))),
14793
- visible,
14794
- emptyText,
14795
- selectedIndex,
14796
- hoverIndex,
14797
- loadMore,
14798
- selectOptionClick,
14799
- renderDefaultSlots,
14800
- renderEmptySlots
14717
+ } = useKeyboardSelect(dopdownRef, props.optionDisabledKey, visible, hoverIndex, selectIndex, filteredOptions, toggleMenu, closeMenu, handleClick);
14718
+ watch(() => props.modelValue, (newVal) => {
14719
+ inputValue.value = newVal;
14801
14720
  });
14802
14721
  return () => {
14803
14722
  const selectCls = className$2("devui-editable-select devui-form-group devui-has-feedback", {
14804
- "devui-select-open": visible.value
14723
+ "devui-select-open": visible.value === true
14805
14724
  });
14806
- const inputCls = className$2("devui-form-control devui-dropdown-origin devui-dropdown-origin-open", {
14807
- disabled: props.disabled
14808
- });
14809
- return createVNode(Fragment, null, [withDirectives(createVNode("div", {
14725
+ return withDirectives(createVNode("div", {
14810
14726
  "class": selectCls,
14811
- "onClick": toggleMenu,
14812
- "ref": origin
14727
+ "ref": origin,
14728
+ "style": {
14729
+ width: props.width + "px"
14730
+ }
14813
14731
  }, [createVNode("input", {
14814
- "class": inputCls,
14815
- "disabled": props.disabled,
14816
- "type": "text",
14732
+ "class": "devui-form-control devui-dropdown-origin devui-dropdown-origin-open",
14733
+ "onClick": withModifiers(toggleMenu, ["self"]),
14817
14734
  "onInput": handleInput,
14818
- "value": query.value,
14819
- "onKeydown": handleKeydown
14735
+ "onKeydown": handleKeydown,
14736
+ "value": inputValue.value,
14737
+ "disabled": props.disabled,
14738
+ "placeholder": props.placeholder,
14739
+ "type": "text"
14820
14740
  }, null), createVNode("span", {
14821
14741
  "class": "devui-form-control-feedback"
14822
14742
  }, [createVNode("span", {
14823
14743
  "class": "devui-select-chevron-icon"
14824
14744
  }, [createVNode(resolveComponent("d-icon"), {
14825
14745
  "name": "select-arrow"
14826
- }, null)])]), renderDropdown(props.appendToBody, 0)]), [[resolveDirective("click-outside"), handleClose]]), renderDropdown(props.appendToBody, 1)]);
14746
+ }, null)])]), renderDropdown()]), [[resolveDirective("click-outside"), closeMenu]]);
14827
14747
  };
14828
14748
  }
14829
14749
  });
@@ -14833,7 +14753,7 @@ EditableSelect.install = function(app) {
14833
14753
  var EditableSelectInstall = {
14834
14754
  title: "EditableSelect \u53EF\u8F93\u5165\u4E0B\u62C9\u9009\u62E9\u6846",
14835
14755
  category: "\u6570\u636E\u5F55\u5165",
14836
- status: "10%",
14756
+ status: "100%",
14837
14757
  install(app) {
14838
14758
  app.use(EditableSelect);
14839
14759
  }
@@ -17472,6 +17392,41 @@ var LayoutInstall = {
17472
17392
  app.use(Aside);
17473
17393
  }
17474
17394
  };
17395
+ const loadingConstructor = defineComponent(Loading);
17396
+ const cacheTarget = /* @__PURE__ */ new WeakMap();
17397
+ const loading = {
17398
+ open(options = {}) {
17399
+ const parent = options.target || document.body;
17400
+ if (cacheTarget.has(parent)) {
17401
+ return cacheTarget.get(parent);
17402
+ }
17403
+ parent.style.position = options.positionType;
17404
+ const isFull = document.body === parent;
17405
+ options = __spreadValues(__spreadValues({}, new LoadingProps()), options);
17406
+ const instance = createComponent$1(loadingConstructor, __spreadProps(__spreadValues({}, options), {
17407
+ isFull
17408
+ }), options.loadingTemplateRef ? () => options.loadingTemplateRef : null);
17409
+ cacheTarget.set(parent, instance);
17410
+ instance.proxy.open();
17411
+ parent.appendChild(instance.proxy.$el);
17412
+ const close = instance.proxy.close;
17413
+ instance.loadingInstance = instance.proxy;
17414
+ instance.loadingInstance.close = (...args) => {
17415
+ cacheTarget.delete(parent);
17416
+ close(...args);
17417
+ };
17418
+ return instance;
17419
+ }
17420
+ };
17421
+ var LoadingInstall = {
17422
+ title: "Loading \u52A0\u8F7D\u63D0\u793A",
17423
+ category: "\u53CD\u9988",
17424
+ status: "100%",
17425
+ install(app) {
17426
+ app.directive("dLoading", loadingDirective);
17427
+ app.config.globalProperties.$loadingService = loading;
17428
+ }
17429
+ };
17475
17430
  const modalProps = {
17476
17431
  width: {
17477
17432
  type: String,
@@ -22859,7 +22814,7 @@ const createColumnGenerator = () => {
22859
22814
  const _columns = ref([]);
22860
22815
  const insertColumn = (column) => {
22861
22816
  _columns.value.push(column);
22862
- _columns.value.sort((a, b) => a.order > b.order ? 1 : -1);
22817
+ _columns.value.sort((a, b) => a.order - b.order);
22863
22818
  };
22864
22819
  const sortColumn = () => {
22865
22820
  _columns.value.sort((a, b) => a.order > b.order ? 1 : -1);
@@ -22913,7 +22868,7 @@ const createSelection = (dataSource, _data) => {
22913
22868
  };
22914
22869
  };
22915
22870
  const createSorter = (dataSource, _data) => {
22916
- const sortData = (field, direction, compareFn = (field2, a, b) => a[field2] > b[field2]) => {
22871
+ const sortData = (field, direction, compareFn = (fieldKey, a, b) => a[fieldKey] > b[fieldKey]) => {
22917
22872
  if (direction === "ASC") {
22918
22873
  _data.value = _data.value.sort((a, b) => compareFn(field, a, b) ? 1 : -1);
22919
22874
  } else if (direction === "DESC") {
@@ -22930,8 +22885,8 @@ const createFilter = (dataSource, _data) => {
22930
22885
  fieldSet.add(field);
22931
22886
  const fields = [...fieldSet];
22932
22887
  _data.value = dataSource.value.filter((item2) => {
22933
- return fields.reduce((prev, field2) => {
22934
- return prev && results2.indexOf(item2[field2]) !== -1;
22888
+ return fields.reduce((prev, fieldKey) => {
22889
+ return prev && results2.indexOf(item2[fieldKey]) !== -1;
22935
22890
  }, true);
22936
22891
  });
22937
22892
  };
@@ -23275,48 +23230,74 @@ const TD = defineComponent({
23275
23230
  }, [column.value.renderCell(props.row, props.index)]);
23276
23231
  }
23277
23232
  });
23278
- var table = "";
23279
- var Table = defineComponent({
23280
- name: "DTable",
23281
- props: TableProps,
23282
- setup(props, ctx2) {
23283
- const table2 = getCurrentInstance();
23284
- const store = createStore(toRef(props, "data"));
23285
- table2.store = store;
23286
- provide(TABLE_TOKEN, table2);
23287
- const {
23288
- classes,
23289
- style: style2
23290
- } = useTable(props);
23291
- const isEmpty2 = computed(() => props.data.length === 0);
23292
- const fixHeaderCompo = computed(() => {
23233
+ var FixHeader = defineComponent({
23234
+ props: {
23235
+ classes: {
23236
+ type: Object,
23237
+ default: () => ({})
23238
+ },
23239
+ isEmpty: {
23240
+ type: Boolean
23241
+ }
23242
+ },
23243
+ setup(props) {
23244
+ return () => {
23293
23245
  return createVNode("div", {
23294
23246
  "class": "devui-table-view"
23295
23247
  }, [createVNode("div", {
23296
- "style": "overflow: hidden scroll;"
23248
+ "style": "overflow:hidden scroll;"
23297
23249
  }, [createVNode("table", {
23298
- "class": classes.value,
23250
+ "class": props.classes,
23299
23251
  "cellpadding": "0",
23300
23252
  "cellspacing": "0"
23301
23253
  }, [createVNode(ColGroup, null, null), createVNode(TableHeader, null, null)])]), createVNode("div", {
23302
23254
  "class": "scroll-view"
23303
23255
  }, [createVNode("table", {
23304
- "class": classes.value,
23256
+ "class": props.classes,
23305
23257
  "cellpadding": "0",
23306
23258
  "cellspacing": "0"
23307
- }, [createVNode(ColGroup, null, null), !isEmpty2.value && createVNode(TableBody, {
23259
+ }, [createVNode(ColGroup, null, null), !props.isEmpty && createVNode(TableBody, {
23308
23260
  "style": "flex: 1"
23309
23261
  }, null)])])]);
23310
- });
23311
- const normalHeaderCompo = computed(() => {
23262
+ };
23263
+ }
23264
+ });
23265
+ var NormalHeader = defineComponent({
23266
+ props: {
23267
+ classes: {
23268
+ type: Object,
23269
+ default: () => ({})
23270
+ },
23271
+ isEmpty: {
23272
+ type: Boolean
23273
+ }
23274
+ },
23275
+ setup(props) {
23276
+ return () => {
23312
23277
  return createVNode("table", {
23313
- "class": classes.value,
23278
+ "class": props.classes,
23314
23279
  "cellpadding": "0",
23315
23280
  "cellspacing": "0"
23316
23281
  }, [createVNode(ColGroup, null, null), createVNode(TableHeader, {
23317
- "style": "position: relative"
23318
- }, null), !isEmpty2.value && createVNode(TableBody, null, null)]);
23319
- });
23282
+ "style": "position:relative"
23283
+ }, null), !props.isEmpty && createVNode(TableBody, null, null)]);
23284
+ };
23285
+ }
23286
+ });
23287
+ var table = "";
23288
+ var Table = defineComponent({
23289
+ name: "DTable",
23290
+ props: TableProps,
23291
+ setup(props, ctx2) {
23292
+ const table2 = getCurrentInstance();
23293
+ const store = createStore(toRef(props, "data"));
23294
+ table2.store = store;
23295
+ provide(TABLE_TOKEN, table2);
23296
+ const {
23297
+ classes,
23298
+ style: style2
23299
+ } = useTable(props);
23300
+ const isEmpty2 = computed(() => props.data.length === 0);
23320
23301
  ctx2.expose({
23321
23302
  getCheckedRows() {
23322
23303
  return store.getCheckedRows();
@@ -23325,7 +23306,13 @@ var Table = defineComponent({
23325
23306
  return () => withDirectives(createVNode("div", {
23326
23307
  "class": "devui-table-wrapper",
23327
23308
  "style": style2.value
23328
- }, [ctx2.slots.default(), props.fixHeader ? fixHeaderCompo.value : normalHeaderCompo.value, isEmpty2.value && createVNode("div", {
23309
+ }, [ctx2.slots.default(), props.fixHeader ? createVNode(FixHeader, {
23310
+ "classes": classes.value,
23311
+ "is-empty": isEmpty2.value
23312
+ }, null) : createVNode(NormalHeader, {
23313
+ "classes": classes.value,
23314
+ "is-empty": isEmpty2.value
23315
+ }, null), isEmpty2.value && createVNode("div", {
23329
23316
  "class": "devui-table-empty"
23330
23317
  }, [createTextVNode("No Data")])]), [[resolveDirective("dLoading"), props.showLoading]]);
23331
23318
  }
@@ -23390,6 +23377,9 @@ function formatWidth(width) {
23390
23377
  function formatMinWidth(minWidth) {
23391
23378
  return formatWidth(minWidth) || 80;
23392
23379
  }
23380
+ function defaultRenderHeader() {
23381
+ return h("span", { class: "title" }, this.header);
23382
+ }
23393
23383
  function createColumn(props, templates) {
23394
23384
  const {
23395
23385
  field,
@@ -23407,31 +23397,38 @@ function createColumn(props, templates) {
23407
23397
  fixedRight
23408
23398
  } = props;
23409
23399
  const column = reactive({});
23410
- watch([field, header2, order], ([field2, header22, order2]) => {
23411
- column.field = field2;
23412
- column.header = header22;
23413
- column.order = order2;
23400
+ function defaultRenderCell(rowData, index2) {
23401
+ var _a, _b;
23402
+ const value = rowData[this.field];
23403
+ if (templates.default) {
23404
+ return templates.default(rowData);
23405
+ }
23406
+ if (this.formatter) {
23407
+ return this.formatter(rowData, value, index2);
23408
+ }
23409
+ return (_b = (_a = value == null ? void 0 : value.toString) == null ? void 0 : _a.call(value)) != null ? _b : "";
23410
+ }
23411
+ watch([field, header2, order], ([fieldVal, headerVal, orderVal]) => {
23412
+ column.field = fieldVal;
23413
+ column.header = headerVal;
23414
+ column.order = orderVal;
23414
23415
  }, { immediate: true });
23415
- watch([sortable, compareFn], ([sortable2, compareFn2]) => {
23416
- column.sortable = sortable2;
23417
- column.compareFn = compareFn2;
23416
+ watch([sortable, compareFn], ([sortableVal, compareFnVal]) => {
23417
+ column.sortable = sortableVal;
23418
+ column.compareFn = compareFnVal;
23418
23419
  });
23419
- watch([
23420
- filterable,
23421
- filterList,
23422
- filterMultiple
23423
- ], ([filterable2, filterList2, filterMultiple2]) => {
23424
- column.filterable = filterable2;
23425
- column.filterMultiple = filterMultiple2;
23426
- column.filterList = filterList2;
23420
+ watch([filterable, filterList, filterMultiple], ([filterableVal, filterListVal, filterMultipleVal]) => {
23421
+ column.filterable = filterableVal;
23422
+ column.filterMultiple = filterMultipleVal;
23423
+ column.filterList = filterListVal;
23427
23424
  }, { immediate: true });
23428
23425
  watch([fixedLeft, fixedRight], ([left, right]) => {
23429
23426
  column.fixedLeft = left;
23430
23427
  column.fixedRight = right;
23431
23428
  }, { immediate: true });
23432
- watch([width, minWidth], ([width2, minWidth2]) => {
23433
- column.width = formatWidth(width2);
23434
- column.minWidth = formatMinWidth(minWidth2);
23429
+ watch([width, minWidth], ([widthVal, minWidthVal]) => {
23430
+ column.width = formatWidth(widthVal);
23431
+ column.minWidth = formatMinWidth(minWidthVal);
23435
23432
  column.realWidth = column.width || column.minWidth;
23436
23433
  });
23437
23434
  onBeforeMount(() => {
@@ -23443,17 +23440,6 @@ function createColumn(props, templates) {
23443
23440
  });
23444
23441
  return column;
23445
23442
  }
23446
- function defaultRenderHeader() {
23447
- return h("span", { class: "title" }, this.header);
23448
- }
23449
- function defaultRenderCell(rowData, index2) {
23450
- var _a, _b;
23451
- const value = rowData[this.field];
23452
- if (this.formatter) {
23453
- return this.formatter(rowData, value, index2);
23454
- }
23455
- return (_b = (_a = value == null ? void 0 : value.toString) == null ? void 0 : _a.call(value)) != null ? _b : "";
23456
- }
23457
23443
  var Column = defineComponent({
23458
23444
  name: "DColumn",
23459
23445
  props: TableColumnProps,
@@ -26838,8 +26824,8 @@ function useDraggable(draggable, dropType, node, renderData, data) {
26838
26824
  dragState
26839
26825
  };
26840
26826
  }
26841
- var IconOpen$1 = "data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIxNnB4IgogIGhlaWdodD0iMTZweCIKICB2aWV3Qm94PSIwIDAgMTYgMTYiCiAgdmVyc2lvbj0iMS4xIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIKICBjbGFzcz0ic3ZnLWljb24gc3ZnLWljb24tY2xvc2UiCj4KICA8ZyBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICA8cmVjdCB4PSIwLjUiIHk9IjAuNSIgd2lkdGg9IjE1IiBoZWlnaHQ9IjE1IiByeD0iMiIgc3Ryb2tlPSIjNWU3Y2UwIj48L3JlY3Q+CiAgICA8cmVjdCB4PSI0IiB5PSI3IiB3aWR0aD0iOCIgaGVpZ2h0PSIyIiBmaWxsPSIjNWU3Y2UwIj48L3JlY3Q+CiAgPC9nPgo8L3N2Zz4=";
26842
- var IconClose$1 = "data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIxNnB4IgogIGhlaWdodD0iMTZweCIKICB2aWV3Qm94PSIwIDAgMTYgMTYiCiAgdmVyc2lvbj0iMS4xIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIKICBjbGFzcz0ic3ZnLWljb24iCj4KICA8ZyBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxyZWN0IHg9IjAuNSIgeT0iMC41IiB3aWR0aD0iMTUiIGhlaWd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3cudzMub3JnLzIwMDAvc3ZnIg0KICB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayINCiAgY2xhc3M9InN2Zy1pY29uIg0KPg0KICA8ZyBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4NCiAgICA8cmVjdCB4PSIwLjUiIHk9IjAuNSIgd2lkdGg9IjE1IiBoZWlnaHQ9IjE1IiByeD0iMiIgc3Ryb2tlPSIjMjUyYjNhIj48L3JlY3Q+DQogICAgPHBhdGgNCiAgICAgIGZpbGw9IiMyNTJiM2EiDQogICAgICBkPSJNOC43NSw0IEw4Ljc1LDcuMjUgTDEyLDcuMjUgTDEyLDguNzUgTDguNzQ5LDguNzUgTDguNzUsMTIgTDcuMjUsMTIgTDcuMjQ5LDguNzUgTDQsOC43NSBMNCw3LjI1IEw3LjI1LDcuMjUgTDcuMjUsNCBMOC43NSw0IFoiDQogICAgPjwvcGF0aD4NCiAgPC9nPg0KPC9zdmc+DQo=";
26843
26829
  var NodeContent = defineComponent({
26844
26830
  name: "DTreeNodeContent",
26845
26831
  props: {
@@ -27267,8 +27253,8 @@ function useClear(props, ctx2, data) {
27267
27253
  handleClearItem
27268
27254
  };
27269
27255
  }
27270
- var IconOpen = "data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIxNnB4IgogIGhlaWdodD0iMTZweCIKICB2aWV3Qm94PSIwIDAgMTYgMTYiCiAgdmVyc2lvbj0iMS4xIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIKICBjbGFzcz0ic3ZnLWljb24gc3ZnLWljb24tY2xvc2UiCj4KICA8ZyBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICA8cmVj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UsMTIgTDcuMjQ5LDguNzUgTDQsOC43NSBMNCw3LjI1IEw3LjI1LDcuMjUgTDcuMjUsNCBMOC43NSw0IFoiDQogICAgPjwvcGF0aD4NCiAgPC9nPg0KPC9zdmc+DQo=";
27272
27258
  var TreeSelect = defineComponent({
27273
27259
  name: "DTreeSelect",
27274
27260
  directives: {