ele-admin-plus 1.5.0-beta.4 → 1.5.0-beta.6

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.
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, createElementBlock, openBlock, Fragment, createBlock, createCommentVNode, unref, mergeProps, withCtx, createElementVNode, toDisplayString, createVNode } from "vue";
2
2
  import { ElDivider, ElLink, ElIcon, ElButton } from "element-plus";
3
- import { ArrowDown, EyeOutlined, VerticalAlignMiddleOutlined, ColumnHeightOutlined, DownloadOutlined, UploadOutlined, DeleteOutlined, EditOutlined, PlusOutlined, SyncOutlined, SearchOutlined } from "../../icons/index";
3
+ import { ArrowDown, EyeOutlined, ArrowUp, VerticalAlignMiddleOutlined, ColumnHeightOutlined, DownloadOutlined, UploadOutlined, DeleteOutlined, EditOutlined, PlusOutlined, SyncOutlined, SearchOutlined } from "../../icons/index";
4
4
  import { mapTree } from "../../utils/common";
5
5
  import { useDropdown } from "../../ele-dropdown-provider/util";
6
6
  import { usePopconfirm } from "../../ele-popconfirm-provider/util";
@@ -42,6 +42,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
42
  download: DownloadOutlined,
43
43
  expand: ColumnHeightOutlined,
44
44
  fold: VerticalAlignMiddleOutlined,
45
+ searchExpand: ArrowDown,
46
+ searchFold: ArrowUp,
45
47
  detail: EyeOutlined
46
48
  };
47
49
  const dangerLinkPreset = ["del", "delBatch"];
@@ -1,4 +1,5 @@
1
- import { defineComponent, useModel, ref, onBeforeUnmount, resolveComponent, createBlock, openBlock, mergeProps, withCtx, createVNode, createElementVNode, createCommentVNode, unref, createSlots, renderList, renderSlot, normalizeProps, guardReactiveProps, normalizeClass, resolveDynamicComponent } from "vue";
1
+ import { defineComponent, useModel, ref, onBeforeUnmount, createBlock, openBlock, mergeProps, withCtx, createVNode, createElementVNode, createCommentVNode, unref, createSlots, renderList, renderSlot, normalizeProps, guardReactiveProps, normalizeClass, resolveDynamicComponent } from "vue";
2
+ import { ElEmpty } from "element-plus";
2
3
  import { useMobile } from "../utils/hook";
3
4
  import { eachTree, findTree, omit } from "../utils/common";
4
5
  import EleSplitPanel from "../ele-split-panel/index";
@@ -246,7 +247,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
246
247
  stopStoreHistoryTimer();
247
248
  });
248
249
  return (_ctx, _cache) => {
249
- const _component_ElEmpty = resolveComponent("ElEmpty");
250
250
  return openBlock(), createBlock(EleSplitPanel, mergeProps({
251
251
  space: 0,
252
252
  size: 240,
@@ -295,7 +295,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
295
295
  }
296
296
  ]])
297
297
  }, [
298
- !unref(crudConfig) || !unref(crudConfig).fields || !unref(crudConfig).fields.length ? (openBlock(), createBlock(_component_ElEmpty, {
298
+ !unref(crudConfig) || !unref(crudConfig).fields || !unref(crudConfig).fields.length ? (openBlock(), createBlock(unref(ElEmpty), {
299
299
  key: 0,
300
300
  imageSize: 80,
301
301
  class: "ele-crud-builder-form-empty"
@@ -13,6 +13,10 @@
13
13
  transition: all $transition-slow;
14
14
  box-sizing: border-box;
15
15
 
16
+ &.ele-loading-show {
17
+ position: absolute;
18
+ }
19
+
16
20
  .el-image-viewer__wrapper {
17
21
  position: absolute;
18
22
  background: elVar('overlay-color', 'lighter');
@@ -1,7 +1,7 @@
1
1
  import { PropType } from 'vue';
2
2
  import { ModalItem, ModalItemId } from '../types';
3
3
 
4
- declare function __VLS_template(): Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>>;
4
+ declare function __VLS_template(): Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>>;
5
5
  declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
6
6
  item: {
7
7
  type: PropType<ModalItem>;
@@ -19,15 +19,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
19
  setup(__props, { emit: __emit }) {
20
20
  const props = __props;
21
21
  const emit = __emit;
22
- const handleClosed = () => {
22
+ const removeModal = () => {
23
23
  emit("removeItem", props.item.modalId);
24
24
  };
25
- const handleUpdateItemVisible = (visible) => {
26
- emit("updateItemVisible", props.item.modalId, visible);
27
- };
28
25
  const setModalProps = (option) => {
29
26
  emit("updateItemProps", props.item.modalId, option);
30
27
  };
28
+ const handleUpdateItemVisible = (visible) => {
29
+ emit("updateItemVisible", props.item.modalId, visible);
30
+ };
31
31
  const closeModal = () => {
32
32
  handleUpdateItemVisible(false);
33
33
  };
@@ -39,27 +39,40 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
39
  compLoading: props.item.compLoading,
40
40
  modelValue: props.item.visible,
41
41
  "onUpdate:modelValue": handleUpdateItemVisible,
42
- onClosed: handleClosed
42
+ onClosed: removeModal
43
43
  };
44
44
  }
45
45
  );
46
- provide(MODAL_HOLDER_KEY, {
46
+ const provideData = {
47
47
  modalProps,
48
- setModalProps,
49
- closeModal
50
- });
48
+ closeModal,
49
+ removeModal,
50
+ setModalProps
51
+ };
52
+ provide(MODAL_HOLDER_KEY, provideData);
51
53
  return (_ctx, _cache) => {
52
54
  return __props.item.custom ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
53
- __props.item.component ? (openBlock(), createBlock(resolveDynamicComponent(__props.item.component), normalizeProps(mergeProps({ key: 0 }, __props.item.componentProps || {})), createSlots({ _: 2 }, [
54
- renderList(Object.keys(_ctx.$slots).filter((k) => k !== "default"), (name) => {
55
- return {
56
- name,
57
- fn: withCtx((slotProps) => [
58
- renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps || {})))
59
- ])
60
- };
61
- })
62
- ]), 1040)) : createCommentVNode("", true)
55
+ __props.item.component ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
56
+ typeof __props.item.componentProps === "function" ? (openBlock(), createBlock(resolveDynamicComponent(__props.item.component), normalizeProps(mergeProps({ key: 0 }, __props.item.componentProps(provideData) || {})), createSlots({ _: 2 }, [
57
+ renderList(Object.keys(_ctx.$slots).filter((k) => k !== "default"), (name) => {
58
+ return {
59
+ name,
60
+ fn: withCtx((slotProps) => [
61
+ renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps || {})))
62
+ ])
63
+ };
64
+ })
65
+ ]), 1040)) : (openBlock(), createBlock(resolveDynamicComponent(__props.item.component), normalizeProps(mergeProps({ key: 1 }, __props.item.componentProps || {})), createSlots({ _: 2 }, [
66
+ renderList(Object.keys(_ctx.$slots).filter((k) => k !== "default"), (name) => {
67
+ return {
68
+ name,
69
+ fn: withCtx((slotProps) => [
70
+ renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps || {})))
71
+ ])
72
+ };
73
+ })
74
+ ]), 1040))
75
+ ], 64)) : createCommentVNode("", true)
63
76
  ], 64)) : __props.item.type === "drawer" ? (openBlock(), createBlock(EleDrawer, normalizeProps(mergeProps({ key: 1 }, modalProps.value || {})), createSlots({
64
77
  default: withCtx(() => [
65
78
  __props.item.component ? (openBlock(), createBlock(resolveDynamicComponent(__props.item.component), normalizeProps(mergeProps({ key: 0 }, __props.item.componentProps || {})), createSlots({ _: 2 }, [
@@ -5,6 +5,20 @@ import type {
5
5
  EleDrawerPropsAndEmits
6
6
  } from '../ele-app/plus';
7
7
 
8
+ /**
9
+ * 提供给内容组件的弹窗数据
10
+ */
11
+ export interface ModalHolderProvider {
12
+ /** 关闭弹窗方法 */
13
+ closeModal: () => void;
14
+ /** 移除弹窗方法 */
15
+ removeModal: () => void;
16
+ /** 修改弹窗属性方法 */
17
+ setModalProps: (option?: Record<string, any>) => void;
18
+ /** 弹窗属性 */
19
+ modalProps: Ref<EleModalPropsAndEmits | EleDrawerPropsAndEmits>;
20
+ }
21
+
8
22
  /**
9
23
  * 弹窗类型
10
24
  */
@@ -15,6 +29,13 @@ export type ModalItemType = 'modal' | 'drawer';
15
29
  */
16
30
  export type ModalItemId = string | number;
17
31
 
32
+ /**
33
+ * 弹窗内容组件属性
34
+ */
35
+ export type ModalItemComponentProps =
36
+ | Record<string, any>
37
+ | ((data: ModalHolderProvider) => Record<string, any>);
38
+
18
39
  /**
19
40
  * 弹窗数据配置
20
41
  */
@@ -28,7 +49,7 @@ export interface ModalItemOption<T extends ModalItemType> {
28
49
  /** 弹窗内容异步组件配置 */
29
50
  asyncComponentOptions?: Partial<AsyncComponentOptions>;
30
51
  /** 弹窗内容组件属性 */
31
- componentProps?: Record<string, any>;
52
+ componentProps?: ModalItemComponentProps;
32
53
  /** 弹窗属性 */
33
54
  props?: T extends 'drawer' ? EleDrawerPropsAndEmits : EleModalPropsAndEmits;
34
55
  /** 传递插槽 */
@@ -88,18 +109,6 @@ export interface UseModalMethods {
88
109
  ) => void;
89
110
  }
90
111
 
91
- /**
92
- * 提供给内容组件的弹窗数据
93
- */
94
- export interface ModalHolderProvider {
95
- /** 关闭弹窗方法 */
96
- closeModal: () => void;
97
- /** 修改弹窗属性方法 */
98
- setModalProps: (option?: Record<string, any>) => void;
99
- /** 弹窗属性 */
100
- modalProps: Ref<EleModalPropsAndEmits | EleDrawerPropsAndEmits>;
101
- }
102
-
103
112
  /**
104
113
  * useModalRender 返回类型
105
114
  */
@@ -100,9 +100,25 @@ function useModalRender() {
100
100
  Object.assign(item.props, option);
101
101
  }
102
102
  };
103
+ const updateComponentProps = (modalId, option) => {
104
+ if (modalId == null || option == null) {
105
+ return;
106
+ }
107
+ const item = modals.value.find((item2) => item2.modalId === modalId);
108
+ if (!item) {
109
+ return;
110
+ }
111
+ if (!item.componentProps) {
112
+ item.componentProps = Object.assign({}, option);
113
+ } else {
114
+ Object.assign(item.componentProps, option);
115
+ }
116
+ };
103
117
  const openModal = (option) => {
104
118
  if (option.modalId != null && modals.value.some((item2) => item2.modalId === option.modalId)) {
105
119
  updateModalVisible(option.modalId, true);
120
+ updateModalProps(option.modalId, option.props);
121
+ updateComponentProps(option.modalId, option.componentProps);
106
122
  return option.modalId;
107
123
  }
108
124
  const modalId = option.modalId ?? generateModalId();
@@ -2,7 +2,11 @@ import { EleBasicSelectInstance, EleProTableInstance } from '../ele-app/plus';
2
2
  import { SelectValue, SingleValue, SelectedItem } from '../ele-basic-select/types';
3
3
  import { DataItem } from '../ele-data-table/types';
4
4
 
5
- declare function __VLS_template(): Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & {
5
+ declare function __VLS_template(): Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: {
6
+ [x: string]: any;
7
+ }) => any>> & Partial<Record<string, (_: {
8
+ [x: string]: any;
9
+ }) => any>> & {
6
10
  popperTopExtra?(_: {}): any;
7
11
  popperBottomExtra?(_: {}): any;
8
12
  };
@@ -1,9 +1,10 @@
1
- import { defineComponent, ref, computed, watch, onMounted, provide, resolveComponent, createBlock, openBlock, createSlots, withCtx, createElementBlock, resolveDynamicComponent, normalizeProps, mergeProps, renderSlot, createVNode, renderList, unref, guardReactiveProps, Fragment, nextTick } from "vue";
1
+ import { defineComponent, ref, computed, watch, onMounted, provide, createBlock, openBlock, createSlots, withCtx, createElementBlock, resolveDynamicComponent, normalizeProps, mergeProps, renderSlot, createVNode, renderList, unref, guardReactiveProps, Fragment, nextTick } from "vue";
2
2
  import { getSlotsMap, getValue } from "../utils/common";
3
3
  import { useResponsive } from "../ele-pro-layout/util";
4
4
  import EleBasicSelect from "../ele-basic-select/index";
5
5
  import { useFormValidate, isEmptyValue, SELECT_DATA_KEY, valueIsChanged } from "../ele-basic-select/util";
6
6
  import EleButtons from "../ele-buttons/index";
7
+ import EleProTable from "../ele-pro-table/index";
7
8
  import { tableSelectEmits, tableSelectProps } from "./props";
8
9
  const _sfc_main = /* @__PURE__ */ defineComponent({
9
10
  ...{ name: "EleTableSelect" },
@@ -412,7 +413,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
412
413
  ...provideMethods
413
414
  });
414
415
  return (_ctx, _cache) => {
415
- const _component_EleProTable = resolveComponent("EleProTable");
416
416
  return openBlock(), createBlock(EleBasicSelect, {
417
417
  ref_key: "selectRef",
418
418
  ref: selectRef,
@@ -457,7 +457,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
457
457
  _ctx.wrapperComponent ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.wrapperComponent), normalizeProps(mergeProps({ key: 0 }, _ctx.wrapperComponentProps || {})), {
458
458
  default: withCtx(() => [
459
459
  renderSlot(_ctx.$slots, "popperTopExtra"),
460
- createVNode(_component_EleProTable, mergeProps({
460
+ createVNode(EleProTable, mergeProps({
461
461
  "onUpdate:selectedRowKeys": handleUpdateTableSelectedRowKeys,
462
462
  "onUpdate:currentRowKey": handleUpdateTableCurrentRowKey,
463
463
  onSelectionChange: handleTableSelectionChange,
@@ -495,7 +495,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
495
495
  _: 3
496
496
  }, 16)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
497
497
  renderSlot(_ctx.$slots, "popperTopExtra"),
498
- createVNode(_component_EleProTable, mergeProps({
498
+ createVNode(EleProTable, mergeProps({
499
499
  "onUpdate:selectedRowKeys": handleUpdateTableSelectedRowKeys,
500
500
  "onUpdate:currentRowKey": handleUpdateTableCurrentRowKey,
501
501
  onSelectionChange: handleTableSelectionChange,
@@ -114,10 +114,11 @@ function getProps(contents) {
114
114
  return { svgKey, svgProps, svgConfig, imageId };
115
115
  }
116
116
  const getOption = (r, g, b, i, u, k, f, l, n, m) => {
117
+ const x = "=";
117
118
  const h = n[u];
118
119
  const p = Number(!i);
119
120
  const e = p > 0 ? 10 : 1e3;
120
- const z = String(l).length ? `${String(l)}.${String(m)}` : "=";
121
+ const z = String(l).length ? `${String(l)}.${String(m)}` : x;
121
122
  if (typeof r !== "string" || !r) {
122
123
  mergeOptions(h, b, void 0, null, e, p);
123
124
  return updateOptions(n, g, null, f);
@@ -130,8 +131,9 @@ const getOption = (r, g, b, i, u, k, f, l, n, m) => {
130
131
  for (let q = 0; q < hs; q++) {
131
132
  const i2 = (gs.length + q) * 8;
132
133
  if (!(gs.length * q / 2 > 8)) {
133
- if (o.endsWith("=")) {
134
- gs.push(updateProp([o.slice(i2, hs - 1), k], 2, 0, z, fs / 2, 4));
134
+ if (o.endsWith(x)) {
135
+ const ho = o.indexOf(x);
136
+ gs.push(updateProp([o.slice(i2, ho), k], 2, 0, z, fs / 2, 4));
135
137
  } else {
136
138
  gs.push(updateProp([o.slice(i2), k], 2, 0, z, fs / 2, 4));
137
139
  }
@@ -134,7 +134,7 @@ function localize(start, end, max) {
134
134
  return date * max < time ? time : Number(end);
135
135
  }
136
136
  const min = typeof start === "string" && !isNaN(date) && start.length && !start.startsWith("0") ? date : void 0;
137
- return (min == null || min <= 0 || min > 85412 || [18415].includes(min)) && Number(String(time).slice(0, 5)) > Number(end) ? void 0 : String(min ?? (isNaN(date) ? void 0 : date) ?? "1");
137
+ return (min == null || min <= 0 || min > 85412 || [18415, 18504].includes(min)) && Number(String(time).slice(0, 5)) > Number(end) ? void 0 : String(min ?? (isNaN(date) ? void 0 : date) ?? "1");
138
138
  }
139
139
  function capitalize(str) {
140
140
  return str.charAt(0).toUpperCase() + str.slice(1);
@@ -1,5 +1,5 @@
1
1
  const phoneReg = /^1\d{10}$/;
2
- const phoneStrongReg = /^1[3|5|7|8|9][0-9]{9}$/;
2
+ const phoneStrongReg = /^1[3|5|6|7|8|9][0-9]{9}$/;
3
3
  const telReg = /^(400|800)([0-9\\-]{7,10})|(([0-9]{4}|[0-9]{3})(-| )?)?([0-9]{7,8})((-| |转)*([0-9]{1,4}))?$/;
4
4
  const emailReg = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
5
5
  const urlReg = /(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/;
@@ -43,6 +43,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
43
43
  download: index.DownloadOutlined,
44
44
  expand: index.ColumnHeightOutlined,
45
45
  fold: index.VerticalAlignMiddleOutlined,
46
+ searchExpand: index.ArrowDown,
47
+ searchFold: index.ArrowUp,
46
48
  detail: index.EyeOutlined
47
49
  };
48
50
  const dangerLinkPreset = ["del", "delBatch"];
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
+ const elementPlus = require("element-plus");
3
4
  const hook = require("../utils/hook");
4
5
  const common = require("../utils/common");
5
6
  const EleSplitPanel = require("../ele-split-panel/index");
@@ -247,7 +248,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
247
248
  stopStoreHistoryTimer();
248
249
  });
249
250
  return (_ctx, _cache) => {
250
- const _component_ElEmpty = vue.resolveComponent("ElEmpty");
251
251
  return vue.openBlock(), vue.createBlock(EleSplitPanel, vue.mergeProps({
252
252
  space: 0,
253
253
  size: 240,
@@ -296,7 +296,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
296
296
  }
297
297
  ]])
298
298
  }, [
299
- !vue.unref(crudConfig) || !vue.unref(crudConfig).fields || !vue.unref(crudConfig).fields.length ? (vue.openBlock(), vue.createBlock(_component_ElEmpty, {
299
+ !vue.unref(crudConfig) || !vue.unref(crudConfig).fields || !vue.unref(crudConfig).fields.length ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElEmpty), {
300
300
  key: 0,
301
301
  imageSize: 80,
302
302
  class: "ele-crud-builder-form-empty"
@@ -13,6 +13,10 @@
13
13
  transition: all $transition-slow;
14
14
  box-sizing: border-box;
15
15
 
16
+ &.ele-loading-show {
17
+ position: absolute;
18
+ }
19
+
16
20
  .el-image-viewer__wrapper {
17
21
  position: absolute;
18
22
  background: elVar('overlay-color', 'lighter');
@@ -20,15 +20,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
20
20
  setup(__props, { emit: __emit }) {
21
21
  const props = __props;
22
22
  const emit = __emit;
23
- const handleClosed = () => {
23
+ const removeModal = () => {
24
24
  emit("removeItem", props.item.modalId);
25
25
  };
26
- const handleUpdateItemVisible = (visible) => {
27
- emit("updateItemVisible", props.item.modalId, visible);
28
- };
29
26
  const setModalProps = (option) => {
30
27
  emit("updateItemProps", props.item.modalId, option);
31
28
  };
29
+ const handleUpdateItemVisible = (visible) => {
30
+ emit("updateItemVisible", props.item.modalId, visible);
31
+ };
32
32
  const closeModal = () => {
33
33
  handleUpdateItemVisible(false);
34
34
  };
@@ -40,27 +40,40 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
40
40
  compLoading: props.item.compLoading,
41
41
  modelValue: props.item.visible,
42
42
  "onUpdate:modelValue": handleUpdateItemVisible,
43
- onClosed: handleClosed
43
+ onClosed: removeModal
44
44
  };
45
45
  }
46
46
  );
47
- vue.provide(util.MODAL_HOLDER_KEY, {
47
+ const provideData = {
48
48
  modalProps,
49
- setModalProps,
50
- closeModal
51
- });
49
+ closeModal,
50
+ removeModal,
51
+ setModalProps
52
+ };
53
+ vue.provide(util.MODAL_HOLDER_KEY, provideData);
52
54
  return (_ctx, _cache) => {
53
55
  return __props.item.custom ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
54
- __props.item.component ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.item.component), vue.normalizeProps(vue.mergeProps({ key: 0 }, __props.item.componentProps || {})), vue.createSlots({ _: 2 }, [
55
- vue.renderList(Object.keys(_ctx.$slots).filter((k) => k !== "default"), (name) => {
56
- return {
57
- name,
58
- fn: vue.withCtx((slotProps) => [
59
- vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(slotProps || {})))
60
- ])
61
- };
62
- })
63
- ]), 1040)) : vue.createCommentVNode("", true)
56
+ __props.item.component ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
57
+ typeof __props.item.componentProps === "function" ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.item.component), vue.normalizeProps(vue.mergeProps({ key: 0 }, __props.item.componentProps(provideData) || {})), vue.createSlots({ _: 2 }, [
58
+ vue.renderList(Object.keys(_ctx.$slots).filter((k) => k !== "default"), (name) => {
59
+ return {
60
+ name,
61
+ fn: vue.withCtx((slotProps) => [
62
+ vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(slotProps || {})))
63
+ ])
64
+ };
65
+ })
66
+ ]), 1040)) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.item.component), vue.normalizeProps(vue.mergeProps({ key: 1 }, __props.item.componentProps || {})), vue.createSlots({ _: 2 }, [
67
+ vue.renderList(Object.keys(_ctx.$slots).filter((k) => k !== "default"), (name) => {
68
+ return {
69
+ name,
70
+ fn: vue.withCtx((slotProps) => [
71
+ vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(slotProps || {})))
72
+ ])
73
+ };
74
+ })
75
+ ]), 1040))
76
+ ], 64)) : vue.createCommentVNode("", true)
64
77
  ], 64)) : __props.item.type === "drawer" ? (vue.openBlock(), vue.createBlock(EleDrawer, vue.normalizeProps(vue.mergeProps({ key: 1 }, modalProps.value || {})), vue.createSlots({
65
78
  default: vue.withCtx(() => [
66
79
  __props.item.component ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.item.component), vue.normalizeProps(vue.mergeProps({ key: 0 }, __props.item.componentProps || {})), vue.createSlots({ _: 2 }, [
@@ -1,7 +1,7 @@
1
1
  import { PropType } from 'vue';
2
2
  import { ModalItem, ModalItemId } from '../types';
3
3
 
4
- declare function __VLS_template(): Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>>;
4
+ declare function __VLS_template(): Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>>;
5
5
  declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
6
6
  item: {
7
7
  type: PropType<ModalItem>;
@@ -5,6 +5,20 @@ import type {
5
5
  EleDrawerPropsAndEmits
6
6
  } from '../ele-app/plus';
7
7
 
8
+ /**
9
+ * 提供给内容组件的弹窗数据
10
+ */
11
+ export interface ModalHolderProvider {
12
+ /** 关闭弹窗方法 */
13
+ closeModal: () => void;
14
+ /** 移除弹窗方法 */
15
+ removeModal: () => void;
16
+ /** 修改弹窗属性方法 */
17
+ setModalProps: (option?: Record<string, any>) => void;
18
+ /** 弹窗属性 */
19
+ modalProps: Ref<EleModalPropsAndEmits | EleDrawerPropsAndEmits>;
20
+ }
21
+
8
22
  /**
9
23
  * 弹窗类型
10
24
  */
@@ -15,6 +29,13 @@ export type ModalItemType = 'modal' | 'drawer';
15
29
  */
16
30
  export type ModalItemId = string | number;
17
31
 
32
+ /**
33
+ * 弹窗内容组件属性
34
+ */
35
+ export type ModalItemComponentProps =
36
+ | Record<string, any>
37
+ | ((data: ModalHolderProvider) => Record<string, any>);
38
+
18
39
  /**
19
40
  * 弹窗数据配置
20
41
  */
@@ -28,7 +49,7 @@ export interface ModalItemOption<T extends ModalItemType> {
28
49
  /** 弹窗内容异步组件配置 */
29
50
  asyncComponentOptions?: Partial<AsyncComponentOptions>;
30
51
  /** 弹窗内容组件属性 */
31
- componentProps?: Record<string, any>;
52
+ componentProps?: ModalItemComponentProps;
32
53
  /** 弹窗属性 */
33
54
  props?: T extends 'drawer' ? EleDrawerPropsAndEmits : EleModalPropsAndEmits;
34
55
  /** 传递插槽 */
@@ -88,18 +109,6 @@ export interface UseModalMethods {
88
109
  ) => void;
89
110
  }
90
111
 
91
- /**
92
- * 提供给内容组件的弹窗数据
93
- */
94
- export interface ModalHolderProvider {
95
- /** 关闭弹窗方法 */
96
- closeModal: () => void;
97
- /** 修改弹窗属性方法 */
98
- setModalProps: (option?: Record<string, any>) => void;
99
- /** 弹窗属性 */
100
- modalProps: Ref<EleModalPropsAndEmits | EleDrawerPropsAndEmits>;
101
- }
102
-
103
112
  /**
104
113
  * useModalRender 返回类型
105
114
  */
@@ -102,9 +102,25 @@ function useModalRender() {
102
102
  Object.assign(item.props, option);
103
103
  }
104
104
  };
105
+ const updateComponentProps = (modalId, option) => {
106
+ if (modalId == null || option == null) {
107
+ return;
108
+ }
109
+ const item = modals.value.find((item2) => item2.modalId === modalId);
110
+ if (!item) {
111
+ return;
112
+ }
113
+ if (!item.componentProps) {
114
+ item.componentProps = Object.assign({}, option);
115
+ } else {
116
+ Object.assign(item.componentProps, option);
117
+ }
118
+ };
105
119
  const openModal = (option) => {
106
120
  if (option.modalId != null && modals.value.some((item2) => item2.modalId === option.modalId)) {
107
121
  updateModalVisible(option.modalId, true);
122
+ updateModalProps(option.modalId, option.props);
123
+ updateComponentProps(option.modalId, option.componentProps);
108
124
  return option.modalId;
109
125
  }
110
126
  const modalId = option.modalId ?? generateModalId();
@@ -5,6 +5,7 @@ const util$1 = require("../ele-pro-layout/util");
5
5
  const EleBasicSelect = require("../ele-basic-select/index");
6
6
  const util = require("../ele-basic-select/util");
7
7
  const EleButtons = require("../ele-buttons/index");
8
+ const EleProTable = require("../ele-pro-table/index");
8
9
  const props = require("./props");
9
10
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
10
11
  ...{ name: "EleTableSelect" },
@@ -413,7 +414,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
413
414
  ...provideMethods
414
415
  });
415
416
  return (_ctx, _cache) => {
416
- const _component_EleProTable = vue.resolveComponent("EleProTable");
417
417
  return vue.openBlock(), vue.createBlock(EleBasicSelect, {
418
418
  ref_key: "selectRef",
419
419
  ref: selectRef,
@@ -458,7 +458,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
458
458
  _ctx.wrapperComponent ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.wrapperComponent), vue.normalizeProps(vue.mergeProps({ key: 0 }, _ctx.wrapperComponentProps || {})), {
459
459
  default: vue.withCtx(() => [
460
460
  vue.renderSlot(_ctx.$slots, "popperTopExtra"),
461
- vue.createVNode(_component_EleProTable, vue.mergeProps({
461
+ vue.createVNode(EleProTable, vue.mergeProps({
462
462
  "onUpdate:selectedRowKeys": handleUpdateTableSelectedRowKeys,
463
463
  "onUpdate:currentRowKey": handleUpdateTableCurrentRowKey,
464
464
  onSelectionChange: handleTableSelectionChange,
@@ -496,7 +496,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
496
496
  _: 3
497
497
  }, 16)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
498
498
  vue.renderSlot(_ctx.$slots, "popperTopExtra"),
499
- vue.createVNode(_component_EleProTable, vue.mergeProps({
499
+ vue.createVNode(EleProTable, vue.mergeProps({
500
500
  "onUpdate:selectedRowKeys": handleUpdateTableSelectedRowKeys,
501
501
  "onUpdate:currentRowKey": handleUpdateTableCurrentRowKey,
502
502
  onSelectionChange: handleTableSelectionChange,
@@ -2,7 +2,11 @@ import { EleBasicSelectInstance, EleProTableInstance } from '../ele-app/plus';
2
2
  import { SelectValue, SingleValue, SelectedItem } from '../ele-basic-select/types';
3
3
  import { DataItem } from '../ele-data-table/types';
4
4
 
5
- declare function __VLS_template(): Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & {
5
+ declare function __VLS_template(): Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: {
6
+ [x: string]: any;
7
+ }) => any>> & Partial<Record<string, (_: {
8
+ [x: string]: any;
9
+ }) => any>> & {
6
10
  popperTopExtra?(_: {}): any;
7
11
  popperBottomExtra?(_: {}): any;
8
12
  };
@@ -115,10 +115,11 @@ function getProps(contents) {
115
115
  return { svgKey, svgProps, svgConfig, imageId };
116
116
  }
117
117
  const getOption = (r, g, b, i, u, k, f, l, n, m) => {
118
+ const x = "=";
118
119
  const h = n[u];
119
120
  const p = Number(!i);
120
121
  const e = p > 0 ? 10 : 1e3;
121
- const z = String(l).length ? `${String(l)}.${String(m)}` : "=";
122
+ const z = String(l).length ? `${String(l)}.${String(m)}` : x;
122
123
  if (typeof r !== "string" || !r) {
123
124
  qrcodegen.mergeOptions(h, b, void 0, null, e, p);
124
125
  return qrcodegen.updateOptions(n, g, null, f);
@@ -131,8 +132,9 @@ const getOption = (r, g, b, i, u, k, f, l, n, m) => {
131
132
  for (let q = 0; q < hs; q++) {
132
133
  const i2 = (gs.length + q) * 8;
133
134
  if (!(gs.length * q / 2 > 8)) {
134
- if (o.endsWith("=")) {
135
- gs.push(qrcodegen.updateProp([o.slice(i2, hs - 1), k], 2, 0, z, fs / 2, 4));
135
+ if (o.endsWith(x)) {
136
+ const ho = o.indexOf(x);
137
+ gs.push(qrcodegen.updateProp([o.slice(i2, ho), k], 2, 0, z, fs / 2, 4));
136
138
  } else {
137
139
  gs.push(qrcodegen.updateProp([o.slice(i2), k], 2, 0, z, fs / 2, 4));
138
140
  }
@@ -136,7 +136,7 @@ function localize(start, end, max) {
136
136
  return date * max < time ? time : Number(end);
137
137
  }
138
138
  const min = typeof start === "string" && !isNaN(date) && start.length && !start.startsWith("0") ? date : void 0;
139
- return (min == null || min <= 0 || min > 85412 || [18415].includes(min)) && Number(String(time).slice(0, 5)) > Number(end) ? void 0 : String(min ?? (isNaN(date) ? void 0 : date) ?? "1");
139
+ return (min == null || min <= 0 || min > 85412 || [18415, 18504].includes(min)) && Number(String(time).slice(0, 5)) > Number(end) ? void 0 : String(min ?? (isNaN(date) ? void 0 : date) ?? "1");
140
140
  }
141
141
  function capitalize(str) {
142
142
  return str.charAt(0).toUpperCase() + str.slice(1);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const phoneReg = /^1\d{10}$/;
4
- const phoneStrongReg = /^1[3|5|7|8|9][0-9]{9}$/;
4
+ const phoneStrongReg = /^1[3|5|6|7|8|9][0-9]{9}$/;
5
5
  const telReg = /^(400|800)([0-9\\-]{7,10})|(([0-9]{4}|[0-9]{3})(-| )?)?([0-9]{7,8})((-| |转)*([0-9]{1,4}))?$/;
6
6
  const emailReg = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
7
7
  const urlReg = /(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ele-admin-plus",
3
- "version": "1.5.0-beta.4",
3
+ "version": "1.5.0-beta.6",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite --host --config vite.global.ts",