@minilo/ui 0.0.6 → 0.0.7

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.
Files changed (47) hide show
  1. package/minilo/dist/index.full.js +186 -214
  2. package/minilo/dist/index.full.min.js +1 -1
  3. package/minilo/dist/index.full.min.js.map +1 -1
  4. package/minilo/dist/index.full.min.mjs +1 -1
  5. package/minilo/dist/index.full.min.mjs.map +1 -1
  6. package/minilo/dist/index.full.mjs +186 -214
  7. package/minilo/es/components/image-upload-pro/index.vue2.mjs +2 -2
  8. package/minilo/es/components/search/index.vue2.mjs +0 -1
  9. package/minilo/es/components/search-table/index.vue.d.ts +16 -0
  10. package/minilo/es/components/search-table/index.vue2.mjs +6 -3
  11. package/minilo/es/components/tree-select/index.d.ts +4 -2
  12. package/minilo/es/components/tree-select/index.vue.d.ts +5 -2
  13. package/minilo/es/components/tree-select/index.vue2.mjs +8 -5
  14. package/minilo/es/components/tree-select-dialog/index.d.ts +2 -0
  15. package/minilo/es/components/tree-select-dialog/index.vue.d.ts +3 -0
  16. package/minilo/es/components/tree-select-dialog/index.vue2.mjs +14 -6
  17. package/minilo/es/components/tree-select-drawer/index.d.ts +2 -0
  18. package/minilo/es/components/tree-select-drawer/index.vue.d.ts +3 -0
  19. package/minilo/es/components/tree-select-drawer/index.vue2.mjs +14 -6
  20. package/minilo/es/components/virtual-list/index.vue2.mjs +3 -1
  21. package/minilo/es/packages/utils/dist/request/index.mjs +105 -0
  22. package/minilo/es/resolver/index.mjs +1 -4
  23. package/minilo/lib/components/image-upload-pro/index.vue2.js +2 -2
  24. package/minilo/lib/components/search/index.vue2.js +0 -1
  25. package/minilo/lib/components/search-table/index.vue.d.ts +16 -0
  26. package/minilo/lib/components/search-table/index.vue2.js +6 -3
  27. package/minilo/lib/components/tree-select/index.d.ts +4 -2
  28. package/minilo/lib/components/tree-select/index.vue.d.ts +5 -2
  29. package/minilo/lib/components/tree-select/index.vue2.js +7 -4
  30. package/minilo/lib/components/tree-select-dialog/index.d.ts +2 -0
  31. package/minilo/lib/components/tree-select-dialog/index.vue.d.ts +3 -0
  32. package/minilo/lib/components/tree-select-dialog/index.vue2.js +14 -6
  33. package/minilo/lib/components/tree-select-drawer/index.d.ts +2 -0
  34. package/minilo/lib/components/tree-select-drawer/index.vue.d.ts +3 -0
  35. package/minilo/lib/components/tree-select-drawer/index.vue2.js +14 -6
  36. package/minilo/lib/components/virtual-list/index.vue2.js +3 -1
  37. package/minilo/lib/packages/utils/dist/request/index.js +115 -0
  38. package/minilo/lib/resolver/index.js +1 -4
  39. package/package.json +2 -2
  40. package/minilo/es/components/search-table/index.d.ts +0 -274
  41. package/minilo/es/index.d.ts +0 -1724
  42. package/minilo/es/node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo/utils/dist/request/index.mjs +0 -110
  43. package/minilo/lib/components/search-table/index.d.ts +0 -274
  44. package/minilo/lib/index.d.ts +0 -1724
  45. package/minilo/lib/node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo/utils/dist/request/index.js +0 -120
  46. /package/minilo/es/{node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo → packages}/utils/dist/func/common.mjs +0 -0
  47. /package/minilo/lib/{node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo → packages}/utils/dist/func/common.js +0 -0
@@ -2,8 +2,8 @@ import { defineComponent, ref, reactive, computed, watch, resolveComponent, crea
2
2
  import { ElUpload, ElButton, ElImage, ElDialog, ElForm, ElRow, ElCol, ElFormItem, ElSelect, ElInputNumber, ElMessage, ElMessageBox } from 'element-plus';
3
3
  import { imageUploadProProps } from './type.mjs';
4
4
  import { bem } from '../../utils/index.mjs';
5
- import { initRequestInstance } from '../../node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo/utils/dist/request/index.mjs';
6
- import { getNestedValue } from '../../node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo/utils/dist/func/common.mjs';
5
+ import { initRequestInstance } from '../../packages/utils/dist/request/index.mjs';
6
+ import { getNestedValue } from '../../packages/utils/dist/func/common.mjs';
7
7
 
8
8
  const _hoisted_1 = { key: 0 };
9
9
  const _hoisted_2 = ["onDragstart", "onDrop"];
@@ -27,7 +27,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
27
27
  emit("reset");
28
28
  };
29
29
  onMounted(() => {
30
- console.log(props);
31
30
  const itemProps = props.item.map((item) => ({
32
31
  type: SearchTypeEnum.ITEM,
33
32
  ...item
@@ -1,5 +1,10 @@
1
1
  import { RequestMethodType } from './props';
2
2
  import { SearchModel } from '../search/props';
3
+ interface Pagination {
4
+ currentPage: number;
5
+ pageSize: number;
6
+ total: number;
7
+ }
3
8
  declare function __VLS_template(): {
4
9
  attrs: Partial<{}>;
5
10
  slots: Partial<Record<any, (_: {}) => any>> & Partial<Record<any, (_: {
@@ -80,6 +85,17 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
80
85
  };
81
86
  }>, {
82
87
  handleSearch: (reset?: boolean) => Promise<void>;
88
+ data: import('vue').Ref<any[], any[]>;
89
+ loading: import('vue').Ref<boolean, boolean>;
90
+ pagination: import('vue').Ref<{
91
+ currentPage: number;
92
+ pageSize: number;
93
+ total: number;
94
+ }, Pagination | {
95
+ currentPage: number;
96
+ pageSize: number;
97
+ total: number;
98
+ }>;
83
99
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
84
100
  reset: (...args: any[]) => void;
85
101
  "update:search": (value: SearchModel) => void;
@@ -4,8 +4,8 @@ import { searchTableProps, RequestMethodType } from './props.mjs';
4
4
  import { ElTable, ElTableColumn, ElPagination } from 'element-plus';
5
5
  import Render from './render.mjs';
6
6
  import { bem } from '../../utils/index.mjs';
7
- import { initRequestInstance } from '../../node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo/utils/dist/request/index.mjs';
8
- import { getNestedValue } from '../../node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo/utils/dist/func/common.mjs';
7
+ import { initRequestInstance } from '../../packages/utils/dist/request/index.mjs';
8
+ import { getNestedValue } from '../../packages/utils/dist/func/common.mjs';
9
9
 
10
10
  var _sfc_main = /* @__PURE__ */ defineComponent({
11
11
  ...{
@@ -78,7 +78,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
78
78
  handleSearch();
79
79
  });
80
80
  __expose({
81
- handleSearch
81
+ handleSearch,
82
+ data,
83
+ loading,
84
+ pagination
82
85
  });
83
86
  const tableListeners = Object.keys(attrs).reduce((listeners, key) => {
84
87
  if (key.startsWith("on")) {
@@ -3,12 +3,14 @@ export declare const MlTreeSelect: <T = any>(__VLS_props: NonNullable<Awaited<ty
3
3
  footer?(_: {}): any;
4
4
  };
5
5
  attrs: any;
6
- emit: ((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "cancel") => void);
6
+ emit: (((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "cancel") => void)) & ((evt: "update:searchText", value: string) => void);
7
7
  }, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
8
8
  props: {
9
9
  readonly onInput?: (value: string) => any;
10
+ readonly "onUpdate:searchText"?: (value: string) => any;
10
11
  readonly onConfirm?: (selectedData: T | T[]) => any;
11
12
  readonly onCancel?: () => any;
13
+ searchText?: string;
12
14
  treeData: T[];
13
15
  treeProps?: Record<string, any>;
14
16
  multiple?: boolean;
@@ -24,7 +26,7 @@ export declare const MlTreeSelect: <T = any>(__VLS_props: NonNullable<Awaited<ty
24
26
  slots: {
25
27
  footer?(_: {}): any;
26
28
  };
27
- emit: ((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "cancel") => void);
29
+ emit: (((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "cancel") => void)) & ((evt: "update:searchText", value: string) => void);
28
30
  }>) => import('vue').VNode & {
29
31
  __ctx?: Awaited<typeof __VLS_setup>;
30
32
  };
@@ -2,15 +2,18 @@ import { TreeSelectProps, TreeSelectExpose } from './type';
2
2
  declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
4
  readonly onInput?: (value: string) => any;
5
+ readonly "onUpdate:searchText"?: (value: string) => any;
5
6
  readonly onConfirm?: (selectedData: T | T[]) => any;
6
7
  readonly onCancel?: () => any;
7
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onInput" | "onConfirm" | "onCancel"> & TreeSelectProps<T> & Partial<{}>> & import('vue').PublicProps;
8
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onInput" | "onUpdate:searchText" | "onConfirm" | "onCancel"> & ({
9
+ searchText?: string;
10
+ } & TreeSelectProps<T>) & Partial<{}>> & import('vue').PublicProps;
8
11
  expose(exposed: import('vue').ShallowUnwrapRef<TreeSelectExpose>): void;
9
12
  attrs: any;
10
13
  slots: {
11
14
  footer?(_: {}): any;
12
15
  };
13
- emit: ((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "cancel") => void);
16
+ emit: (((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "cancel") => void)) & ((evt: "update:searchText", value: string) => void);
14
17
  }>) => import('vue').VNode & {
15
18
  __ctx?: Awaited<typeof __VLS_setup>;
16
19
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, watch, computed, resolveComponent, createElementBlock, openBlock, normalizeClass, unref, createCommentVNode, createBlock, createElementVNode, createVNode, mergeProps, toHandlers, renderSlot, withCtx, createTextVNode, nextTick } from 'vue';
1
+ import { defineComponent, mergeModels, useModel, ref, watch, computed, resolveComponent, createElementBlock, openBlock, normalizeClass, unref, createCommentVNode, createBlock, createElementVNode, createVNode, mergeProps, toHandlers, renderSlot, withCtx, createTextVNode, nextTick } from 'vue';
2
2
  import { ElTree, ElMessage } from 'element-plus';
3
3
  import { Search as search_default } from '../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.26_typescript@5.9.3_/node_modules/@element-plus/icons-vue/dist/index.mjs';
4
4
  import { bem } from '../../utils/index.mjs';
@@ -8,7 +8,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
8
8
  name: "MlTreeSelect"
9
9
  },
10
10
  __name: "index",
11
- props: {
11
+ props: /* @__PURE__ */ mergeModels({
12
12
  treeData: { type: Array, required: true },
13
13
  treeProps: { type: Object, required: false, default: () => ({ label: "label", children: "children" }) },
14
14
  multiple: { type: Boolean, required: false, default: false },
@@ -18,12 +18,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
18
18
  showSearch: { type: Boolean, required: false, default: true },
19
19
  expandOnClickNode: { type: Boolean, required: false },
20
20
  placeholder: { type: String, required: false, default: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22" }
21
- },
22
- emits: ["confirm", "cancel", "input"],
21
+ }, {
22
+ "searchText": { type: String, ...{ default: "" } },
23
+ "searchTextModifiers": {}
24
+ }),
25
+ emits: /* @__PURE__ */ mergeModels(["confirm", "cancel", "input"], ["update:searchText"]),
23
26
  setup(__props, { expose: __expose, emit: __emit }) {
24
27
  const props = __props;
25
28
  const emit = __emit;
26
- const searchKeyword = ref("");
29
+ const searchKeyword = useModel(__props, "searchText");
27
30
  const treeRef = ref();
28
31
  const selectedKeys = ref([]);
29
32
  const selectedData = ref(props.multiple ? [] : {});
@@ -51,6 +51,8 @@ export declare const MlTreeSelectDialog: <T = any>(__VLS_props: NonNullable<Awai
51
51
  } & import('vue').PublicProps;
52
52
  expose(exposed: import('vue').ShallowUnwrapRef<{
53
53
  input: (value: string) => void;
54
+ searchText: import('vue').Ref<string, string>;
55
+ treeRef: import('vue').Ref<import('..').TreeSelectExpose, import('..').TreeSelectExpose>;
54
56
  }>): void;
55
57
  attrs: any;
56
58
  slots: {};
@@ -1,4 +1,5 @@
1
1
  import { TreeSelectDialogProps } from './type';
2
+ import { TreeSelectExpose } from '../tree-select/type';
2
3
  declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
5
  readonly onInput?: (value: string) => any;
@@ -10,6 +11,8 @@ declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_
10
11
  } & TreeSelectDialogProps<T>) & Partial<{}>> & import('vue').PublicProps;
11
12
  expose(exposed: import('vue').ShallowUnwrapRef<{
12
13
  input: (value: string) => void;
14
+ searchText: import('vue').Ref<string, string>;
15
+ treeRef: import('vue').Ref<TreeSelectExpose, TreeSelectExpose>;
13
16
  }>): void;
14
17
  attrs: any;
15
18
  slots: {};
@@ -89,9 +89,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
89
89
  return result;
90
90
  });
91
91
  const treeSelectRef = ref();
92
+ const searchText = ref("");
92
93
  watch(visible, (val) => {
93
- if (!val && treeSelectRef.value) {
94
- treeSelectRef.value.reset();
94
+ if (!val) {
95
+ searchText.value = "";
96
+ if (treeSelectRef.value) {
97
+ treeSelectRef.value.reset();
98
+ }
95
99
  }
96
100
  });
97
101
  const handleBeforeClose = () => {
@@ -105,27 +109,31 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
105
109
  visible.value = false;
106
110
  };
107
111
  __expose({
108
- input: (value) => emit("input", value)
112
+ input: (value) => emit("input", value),
113
+ searchText,
114
+ treeRef: treeSelectRef
109
115
  });
110
116
  return (_ctx, _cache) => {
111
117
  const _component_el_dialog = resolveComponent("el-dialog");
112
118
  return openBlock(), createBlock(_component_el_dialog, mergeProps({
113
119
  modelValue: visible.value,
114
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event)
120
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => visible.value = $event)
115
121
  }, dialogAttrs.value, {
116
122
  class: unref(bem)("tree-select-dialog"),
117
123
  "before-close": handleBeforeClose,
118
- onClose: _cache[1] || (_cache[1] = ($event) => emit("close"))
124
+ onClose: _cache[2] || (_cache[2] = ($event) => emit("close"))
119
125
  }), {
120
126
  default: withCtx(() => [
121
127
  createVNode(unref(MlTreeSelect), mergeProps({
122
128
  ref_key: "treeSelectRef",
123
129
  ref: treeSelectRef,
130
+ "search-text": searchText.value,
131
+ "onUpdate:searchText": _cache[0] || (_cache[0] = ($event) => searchText.value = $event),
124
132
  "tree-data": props.treeData
125
133
  }, treeSelectAttrs.value, toHandlers(_ctx.$attrs), {
126
134
  onConfirm: handleConfirm,
127
135
  onCancel: handleCancel
128
- }), null, 16, ["tree-data"])
136
+ }), null, 16, ["search-text", "tree-data"])
129
137
  ]),
130
138
  _: 1
131
139
  /* STABLE */
@@ -56,6 +56,8 @@ export declare const MlTreeSelectDrawer: <T = any>(__VLS_props: NonNullable<Awai
56
56
  } & import('vue').PublicProps;
57
57
  expose(exposed: import('vue').ShallowUnwrapRef<{
58
58
  input: (value: string) => void;
59
+ searchText: import('vue').Ref<string, string>;
60
+ treeRef: import('vue').Ref<import('..').TreeSelectExpose, import('..').TreeSelectExpose>;
59
61
  }>): void;
60
62
  attrs: any;
61
63
  slots: {};
@@ -1,4 +1,5 @@
1
1
  import { TreeSelectDrawerProps } from './type';
2
+ import { TreeSelectExpose } from '../tree-select/type';
2
3
  declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
5
  readonly onInput?: (value: string) => any;
@@ -10,6 +11,8 @@ declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_
10
11
  } & TreeSelectDrawerProps<T>) & Partial<{}>> & import('vue').PublicProps;
11
12
  expose(exposed: import('vue').ShallowUnwrapRef<{
12
13
  input: (value: string) => void;
14
+ searchText: import('vue').Ref<string, string>;
15
+ treeRef: import('vue').Ref<TreeSelectExpose, TreeSelectExpose>;
13
16
  }>): void;
14
17
  attrs: any;
15
18
  slots: {};
@@ -94,9 +94,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
94
94
  return result;
95
95
  });
96
96
  const treeSelectRef = ref();
97
+ const searchText = ref("");
97
98
  watch(visible, (val) => {
98
- if (!val && treeSelectRef.value) {
99
- treeSelectRef.value.reset();
99
+ if (!val) {
100
+ searchText.value = "";
101
+ if (treeSelectRef.value) {
102
+ treeSelectRef.value.reset();
103
+ }
100
104
  }
101
105
  });
102
106
  const handleBeforeClose = (done) => {
@@ -111,27 +115,31 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
111
115
  visible.value = false;
112
116
  };
113
117
  __expose({
114
- input: (value) => emit("input", value)
118
+ input: (value) => emit("input", value),
119
+ searchText,
120
+ treeRef: treeSelectRef
115
121
  });
116
122
  return (_ctx, _cache) => {
117
123
  const _component_el_drawer = resolveComponent("el-drawer");
118
124
  return openBlock(), createBlock(_component_el_drawer, mergeProps({
119
125
  modelValue: visible.value,
120
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event)
126
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => visible.value = $event)
121
127
  }, drawerAttrs.value, {
122
128
  class: unref(bem)("tree-select-drawer"),
123
129
  "before-close": handleBeforeClose,
124
- onClose: _cache[1] || (_cache[1] = ($event) => emit("close"))
130
+ onClose: _cache[2] || (_cache[2] = ($event) => emit("close"))
125
131
  }), {
126
132
  default: withCtx(() => [
127
133
  createVNode(_sfc_main$1, mergeProps({
128
134
  ref_key: "treeSelectRef",
129
135
  ref: treeSelectRef,
136
+ "search-text": searchText.value,
137
+ "onUpdate:searchText": _cache[0] || (_cache[0] = ($event) => searchText.value = $event),
130
138
  "tree-data": __props.treeData
131
139
  }, treeSelectAttrs.value, toHandlers(_ctx.$attrs), {
132
140
  onConfirm: handleConfirm,
133
141
  onCancel: handleCancel
134
- }), null, 16, ["tree-data"])
142
+ }), null, 16, ["search-text", "tree-data"])
135
143
  ]),
136
144
  _: 1
137
145
  /* STABLE */
@@ -121,9 +121,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
121
121
  resizeObserver.disconnect();
122
122
  }
123
123
  resizeObserver = new ResizeObserver((entries) => {
124
+ console.log("\u5916\u90E8entries:", entries);
124
125
  let needUpdate = false;
125
126
  const changedIndices = [];
126
127
  for (const entry of entries) {
128
+ console.log("entry:", entry);
127
129
  const target = entry.target;
128
130
  const index = parseInt(target.dataset.index || "0");
129
131
  const pos = positions.value[index];
@@ -161,7 +163,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
161
163
  const observeVisibleItems = () => {
162
164
  if (!resizeObserver || props.itemEqual) return;
163
165
  resizeObserver.disconnect();
164
- const nodes = containerRef.value?.querySelectorAll(".virtual-list-item");
166
+ const nodes = containerRef.value?.querySelectorAll(`.${bem("virtual-list", "item")}`);
165
167
  if (!nodes) return;
166
168
  nodes.forEach((node) => {
167
169
  resizeObserver.observe(node);
@@ -0,0 +1,105 @@
1
+ import axios$1 from 'axios';
2
+ export * from 'axios';
3
+ import { ElMessage } from 'element-plus';
4
+ import { defu } from 'defu';
5
+
6
+ const initRequestInstance = (extendConfig = {}, options = {}) => {
7
+ const { interceptorsRequestFn = () => {
8
+ }, interceptorsResponseFn = () => {
9
+ }, isSuccess = (data) => data?.code === 200, getData = (data) => data?.data, getMessage = (data) => data?.msg || "\u8BF7\u6C42\u5931\u8D25" } = options;
10
+ const axiosConfig = defu({}, extendConfig, {
11
+ baseURL: "/",
12
+ // 从环境变量获取基础URL
13
+ timeout: 1e4,
14
+ // 超时时间
15
+ headers: {
16
+ "Content-Type": "application/json;charset=utf-8"
17
+ }
18
+ });
19
+ const instance = axios$1.create(axiosConfig);
20
+ instance.interceptors.request.use((config) => {
21
+ interceptorsRequestFn(config);
22
+ addPendingRequest(config);
23
+ return config;
24
+ }, (error) => {
25
+ return Promise.reject(error);
26
+ });
27
+ instance.interceptors.response.use((response) => {
28
+ interceptorsResponseFn(response);
29
+ removePendingRequest(response.config);
30
+ const data = response.data;
31
+ if (isSuccess(data)) {
32
+ return Promise.resolve({
33
+ ...response,
34
+ ...data,
35
+ data: getData(data)
36
+ });
37
+ } else {
38
+ const msg = getMessage(data);
39
+ ElMessage.error(msg);
40
+ return Promise.reject(new Error(msg));
41
+ }
42
+ }, (error) => {
43
+ console.log("\u8BF7\u6C42\u53D1\u751F\u9519\u8BEF>>>>>>>>>>>>>>>>>>\uFF1A", error);
44
+ if (error.config) {
45
+ removePendingRequest(error.config);
46
+ }
47
+ if (axios$1.isCancel(error)) {
48
+ console.warn("\u8BF7\u6C42\u5DF2\u88AB\u53D6\u6D88:", error.message);
49
+ return Promise.reject(new Error("\u8BF7\u6C42\u5DF2\u88AB\u53D6\u6D88"));
50
+ }
51
+ if (!window.navigator.onLine) {
52
+ ElMessage.error("\u7F51\u7EDC\u8FDE\u63A5\u5DF2\u65AD\u5F00\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC");
53
+ return Promise.reject(new Error("\u7F51\u7EDC\u8FDE\u63A5\u5DF2\u65AD\u5F00"));
54
+ }
55
+ const { response } = error;
56
+ if (response) {
57
+ switch (response.status) {
58
+ case 401:
59
+ ElMessage.error("\u8EAB\u4EFD\u9A8C\u8BC1\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55");
60
+ break;
61
+ case 403:
62
+ ElMessage.error("\u6CA1\u6709\u6743\u9650\u6267\u884C\u6B64\u64CD\u4F5C");
63
+ break;
64
+ case 404:
65
+ ElMessage.error("\u8BF7\u6C42\u7684\u8D44\u6E90\u4E0D\u5B58\u5728");
66
+ break;
67
+ case 500:
68
+ ElMessage.error("\u670D\u52A1\u5668\u5185\u90E8\u9519\u8BEF");
69
+ break;
70
+ default:
71
+ ElMessage.error(`\u8BF7\u6C42\u9519\u8BEF: ${response.status}`);
72
+ }
73
+ } else {
74
+ ElMessage.error("\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
75
+ }
76
+ return Promise.reject(error);
77
+ });
78
+ return instance;
79
+ };
80
+ const pendingRequests = /* @__PURE__ */ new Map();
81
+ const generateRequestKey = (config) => {
82
+ const { method, url, params, data } = config;
83
+ const paramsStr = params ? JSON.stringify(params) : "";
84
+ const dataStr = data ? JSON.stringify(data) : "";
85
+ return `${method}-${url}-${paramsStr}-${dataStr}`;
86
+ };
87
+ const addPendingRequest = (config) => {
88
+ const requestKey = generateRequestKey(config);
89
+ if (pendingRequests.has(requestKey)) {
90
+ const cancelToken = pendingRequests.get(requestKey);
91
+ cancelToken.cancel(`\u91CD\u590D\u8BF7\u6C42\u88AB\u53D6\u6D88: ${config.url}`);
92
+ pendingRequests.delete(requestKey);
93
+ }
94
+ const source = axios$1.CancelToken.source();
95
+ config.cancelToken = source.token;
96
+ pendingRequests.set(requestKey, source);
97
+ };
98
+ const removePendingRequest = (config) => {
99
+ const requestKey = generateRequestKey(config);
100
+ if (pendingRequests.has(requestKey)) {
101
+ pendingRequests.delete(requestKey);
102
+ }
103
+ };
104
+
105
+ export { addPendingRequest, generateRequestKey, initRequestInstance, removePendingRequest };
@@ -15,10 +15,7 @@ const MiniloUiResolver = () => {
15
15
  return {
16
16
  name,
17
17
  from: `@${libraryName}/ui/es/${componentName}`,
18
- sideEffects: [
19
- "element-plus/theme-chalk/index.css",
20
- `@${libraryName}/ui/theme-chalk/ml-${componentName}`
21
- ]
18
+ sideEffects: [`@${libraryName}/ui/theme-chalk/ml-${componentName}`]
22
19
  };
23
20
  }
24
21
  return null;
@@ -6,8 +6,8 @@ var vue = require('vue');
6
6
  var elementPlus = require('element-plus');
7
7
  var type = require('./type.js');
8
8
  var index$1 = require('../../utils/index.js');
9
- var index = require('../../node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo/utils/dist/request/index.js');
10
- var common = require('../../node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo/utils/dist/func/common.js');
9
+ var index = require('../../packages/utils/dist/request/index.js');
10
+ var common = require('../../packages/utils/dist/func/common.js');
11
11
 
12
12
  const _hoisted_1 = { key: 0 };
13
13
  const _hoisted_2 = ["onDragstart", "onDrop"];
@@ -31,7 +31,6 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
31
31
  emit("reset");
32
32
  };
33
33
  vue.onMounted(() => {
34
- console.log(props$1);
35
34
  const itemProps = props$1.item.map((item) => ({
36
35
  type: props.SearchTypeEnum.ITEM,
37
36
  ...item
@@ -1,5 +1,10 @@
1
1
  import { RequestMethodType } from './props';
2
2
  import { SearchModel } from '../search/props';
3
+ interface Pagination {
4
+ currentPage: number;
5
+ pageSize: number;
6
+ total: number;
7
+ }
3
8
  declare function __VLS_template(): {
4
9
  attrs: Partial<{}>;
5
10
  slots: Partial<Record<any, (_: {}) => any>> & Partial<Record<any, (_: {
@@ -80,6 +85,17 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
80
85
  };
81
86
  }>, {
82
87
  handleSearch: (reset?: boolean) => Promise<void>;
88
+ data: import('vue').Ref<any[], any[]>;
89
+ loading: import('vue').Ref<boolean, boolean>;
90
+ pagination: import('vue').Ref<{
91
+ currentPage: number;
92
+ pageSize: number;
93
+ total: number;
94
+ }, Pagination | {
95
+ currentPage: number;
96
+ pageSize: number;
97
+ total: number;
98
+ }>;
83
99
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
84
100
  reset: (...args: any[]) => void;
85
101
  "update:search": (value: SearchModel) => void;
@@ -8,8 +8,8 @@ var props = require('./props.js');
8
8
  var elementPlus = require('element-plus');
9
9
  var render = require('./render.js');
10
10
  var index$1 = require('../../utils/index.js');
11
- var index = require('../../node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo/utils/dist/request/index.js');
12
- var common = require('../../node_modules/.pnpm/@minilo_utils@0.0.2_vue@3.5.26_typescript@5.9.3_/node_modules/@minilo/utils/dist/func/common.js');
11
+ var index = require('../../packages/utils/dist/request/index.js');
12
+ var common = require('../../packages/utils/dist/func/common.js');
13
13
 
14
14
  var _sfc_main = /* @__PURE__ */ vue.defineComponent({
15
15
  ...{
@@ -82,7 +82,10 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
82
82
  handleSearch();
83
83
  });
84
84
  __expose({
85
- handleSearch
85
+ handleSearch,
86
+ data,
87
+ loading,
88
+ pagination
86
89
  });
87
90
  const tableListeners = Object.keys(attrs).reduce((listeners, key) => {
88
91
  if (key.startsWith("on")) {
@@ -3,12 +3,14 @@ export declare const MlTreeSelect: <T = any>(__VLS_props: NonNullable<Awaited<ty
3
3
  footer?(_: {}): any;
4
4
  };
5
5
  attrs: any;
6
- emit: ((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "cancel") => void);
6
+ emit: (((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "cancel") => void)) & ((evt: "update:searchText", value: string) => void);
7
7
  }, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
8
8
  props: {
9
9
  readonly onInput?: (value: string) => any;
10
+ readonly "onUpdate:searchText"?: (value: string) => any;
10
11
  readonly onConfirm?: (selectedData: T | T[]) => any;
11
12
  readonly onCancel?: () => any;
13
+ searchText?: string;
12
14
  treeData: T[];
13
15
  treeProps?: Record<string, any>;
14
16
  multiple?: boolean;
@@ -24,7 +26,7 @@ export declare const MlTreeSelect: <T = any>(__VLS_props: NonNullable<Awaited<ty
24
26
  slots: {
25
27
  footer?(_: {}): any;
26
28
  };
27
- emit: ((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "cancel") => void);
29
+ emit: (((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "cancel") => void)) & ((evt: "update:searchText", value: string) => void);
28
30
  }>) => import('vue').VNode & {
29
31
  __ctx?: Awaited<typeof __VLS_setup>;
30
32
  };
@@ -2,15 +2,18 @@ import { TreeSelectProps, TreeSelectExpose } from './type';
2
2
  declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
4
  readonly onInput?: (value: string) => any;
5
+ readonly "onUpdate:searchText"?: (value: string) => any;
5
6
  readonly onConfirm?: (selectedData: T | T[]) => any;
6
7
  readonly onCancel?: () => any;
7
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onInput" | "onConfirm" | "onCancel"> & TreeSelectProps<T> & Partial<{}>> & import('vue').PublicProps;
8
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onInput" | "onUpdate:searchText" | "onConfirm" | "onCancel"> & ({
9
+ searchText?: string;
10
+ } & TreeSelectProps<T>) & Partial<{}>> & import('vue').PublicProps;
8
11
  expose(exposed: import('vue').ShallowUnwrapRef<TreeSelectExpose>): void;
9
12
  attrs: any;
10
13
  slots: {
11
14
  footer?(_: {}): any;
12
15
  };
13
- emit: ((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "cancel") => void);
16
+ emit: (((evt: "input", value: string) => void) & ((evt: "confirm", selectedData: T | T[]) => void) & ((evt: "cancel") => void)) & ((evt: "update:searchText", value: string) => void);
14
17
  }>) => import('vue').VNode & {
15
18
  __ctx?: Awaited<typeof __VLS_setup>;
16
19
  };
@@ -12,7 +12,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
12
12
  name: "MlTreeSelect"
13
13
  },
14
14
  __name: "index",
15
- props: {
15
+ props: /* @__PURE__ */ vue.mergeModels({
16
16
  treeData: { type: Array, required: true },
17
17
  treeProps: { type: Object, required: false, default: () => ({ label: "label", children: "children" }) },
18
18
  multiple: { type: Boolean, required: false, default: false },
@@ -22,12 +22,15 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
22
22
  showSearch: { type: Boolean, required: false, default: true },
23
23
  expandOnClickNode: { type: Boolean, required: false },
24
24
  placeholder: { type: String, required: false, default: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22" }
25
- },
26
- emits: ["confirm", "cancel", "input"],
25
+ }, {
26
+ "searchText": { type: String, ...{ default: "" } },
27
+ "searchTextModifiers": {}
28
+ }),
29
+ emits: /* @__PURE__ */ vue.mergeModels(["confirm", "cancel", "input"], ["update:searchText"]),
27
30
  setup(__props, { expose: __expose, emit: __emit }) {
28
31
  const props = __props;
29
32
  const emit = __emit;
30
- const searchKeyword = vue.ref("");
33
+ const searchKeyword = vue.useModel(__props, "searchText");
31
34
  const treeRef = vue.ref();
32
35
  const selectedKeys = vue.ref([]);
33
36
  const selectedData = vue.ref(props.multiple ? [] : {});
@@ -51,6 +51,8 @@ export declare const MlTreeSelectDialog: <T = any>(__VLS_props: NonNullable<Awai
51
51
  } & import('vue').PublicProps;
52
52
  expose(exposed: import('vue').ShallowUnwrapRef<{
53
53
  input: (value: string) => void;
54
+ searchText: import('vue').Ref<string, string>;
55
+ treeRef: import('vue').Ref<import('..').TreeSelectExpose, import('..').TreeSelectExpose>;
54
56
  }>): void;
55
57
  attrs: any;
56
58
  slots: {};
@@ -1,4 +1,5 @@
1
1
  import { TreeSelectDialogProps } from './type';
2
+ import { TreeSelectExpose } from '../tree-select/type';
2
3
  declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
5
  readonly onInput?: (value: string) => any;
@@ -10,6 +11,8 @@ declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_
10
11
  } & TreeSelectDialogProps<T>) & Partial<{}>> & import('vue').PublicProps;
11
12
  expose(exposed: import('vue').ShallowUnwrapRef<{
12
13
  input: (value: string) => void;
14
+ searchText: import('vue').Ref<string, string>;
15
+ treeRef: import('vue').Ref<TreeSelectExpose, TreeSelectExpose>;
13
16
  }>): void;
14
17
  attrs: any;
15
18
  slots: {};