@aplus-frontend/ui 0.6.3 → 0.6.5

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 (79) hide show
  1. package/es/src/ap-form/interface.d.ts +23 -3
  2. package/es/src/ap-form/item-group/index.vue.mjs +33 -27
  3. package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
  4. package/es/src/ap-form/items/text/password.vue.d.ts +2 -2
  5. package/es/src/ap-form/search-form/components/popover-filter.vue2.mjs +36 -32
  6. package/es/src/ap-form/search-form/components/popover-sorter/index.vue.d.ts +4 -2
  7. package/es/src/ap-form/search-form/components/popover-sorter/index.vue2.mjs +70 -72
  8. package/es/src/ap-form/search-form/components/popover-sorter/sortable-item.vue.d.ts +3 -2
  9. package/es/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.mjs +16 -24
  10. package/es/src/ap-form/search-form/hooks/use-sorter.d.ts +7 -0
  11. package/es/src/ap-form/search-form/hooks/use-sorter.mjs +42 -0
  12. package/es/src/ap-form/search-form/index.vue.d.ts +6 -3
  13. package/es/src/ap-form/search-form/index.vue.mjs +101 -91
  14. package/es/src/ap-grid/index.vue.mjs +219 -201
  15. package/es/src/ap-grid/interface.d.ts +17 -1
  16. package/es/src/ap-table/ap-table.vue.d.ts +4 -0
  17. package/es/src/ap-table/ap-table.vue2.mjs +223 -205
  18. package/es/src/ap-table/constants.d.ts +2 -2
  19. package/es/src/ap-table/context.d.ts +4 -0
  20. package/es/src/ap-table/context.mjs +21 -21
  21. package/es/src/ap-table/interface.d.ts +17 -1
  22. package/es/src/ap-table/utils.d.ts +2 -2
  23. package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +4 -0
  24. package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +4 -0
  25. package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +4 -0
  26. package/es/src/business/ap-table-modal/index.d.ts +13 -0
  27. package/es/src/business/ap-table-modal/table-modal.vue.d.ts +7 -0
  28. package/es/src/business/ap-view/ap-view.vue2.mjs +107 -109
  29. package/es/src/business/ap-view/components/main-button-content.vue2.mjs +72 -71
  30. package/es/src/business/ap-view/interface.d.ts +4 -0
  31. package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
  32. package/es/src/business/hooks/usePageListApTable.d.ts +4 -0
  33. package/es/src/version.d.ts +1 -1
  34. package/es/src/version.mjs +1 -1
  35. package/lib/src/ap-form/interface.d.ts +23 -3
  36. package/lib/src/ap-form/item-group/index.vue.js +1 -1
  37. package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
  38. package/lib/src/ap-form/items/text/password.vue.d.ts +2 -2
  39. package/lib/src/ap-form/search-form/components/popover-filter.vue2.js +1 -1
  40. package/lib/src/ap-form/search-form/components/popover-sorter/index.vue.d.ts +4 -2
  41. package/lib/src/ap-form/search-form/components/popover-sorter/index.vue2.js +1 -1
  42. package/lib/src/ap-form/search-form/components/popover-sorter/sortable-item.vue.d.ts +3 -2
  43. package/lib/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.js +1 -1
  44. package/lib/src/ap-form/search-form/hooks/use-sorter.d.ts +7 -0
  45. package/lib/src/ap-form/search-form/hooks/use-sorter.js +1 -0
  46. package/lib/src/ap-form/search-form/index.vue.d.ts +6 -3
  47. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  48. package/lib/src/ap-grid/index.vue.js +1 -1
  49. package/lib/src/ap-grid/interface.d.ts +17 -1
  50. package/lib/src/ap-table/ap-table.vue.d.ts +4 -0
  51. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  52. package/lib/src/ap-table/constants.d.ts +2 -2
  53. package/lib/src/ap-table/context.d.ts +4 -0
  54. package/lib/src/ap-table/context.js +1 -1
  55. package/lib/src/ap-table/interface.d.ts +17 -1
  56. package/lib/src/ap-table/utils.d.ts +2 -2
  57. package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +4 -0
  58. package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +4 -0
  59. package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +4 -0
  60. package/lib/src/business/ap-table-modal/index.d.ts +13 -0
  61. package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +7 -0
  62. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  63. package/lib/src/business/ap-view/components/main-button-content.vue2.js +1 -1
  64. package/lib/src/business/ap-view/interface.d.ts +4 -0
  65. package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
  66. package/lib/src/business/hooks/usePageListApTable.d.ts +4 -0
  67. package/lib/src/version.d.ts +1 -1
  68. package/lib/src/version.js +1 -1
  69. package/package.json +1 -1
  70. package/theme/ap-form/ap-form-item.css +4 -0
  71. package/theme/ap-form/ap-form-item.less +4 -0
  72. package/theme/ap-form/index.css +4 -0
  73. package/theme/ap-form/search-form.css +4 -0
  74. package/theme/ap-grid/index.css +19 -0
  75. package/theme/ap-grid/index.less +14 -0
  76. package/theme/ap-table/ap-table.css +4 -0
  77. package/theme/ap-table-modal/index.css +4 -0
  78. package/theme/editable-table/index.css +4 -0
  79. package/theme/index.css +19 -0
@@ -2,6 +2,7 @@ import { ColumnsType } from '@aplus-frontend/antdv/es/table';
2
2
  import { ComputedRef, InjectionKey } from 'vue';
3
3
  import { ApTableContextRenderConfig, ApTableProps } from './interface';
4
4
  import { Recordable } from '../type';
5
+ import { ApFormSearchFormPopoverSorterItem } from '../ap-form';
5
6
  type TableSize = ApTableProps['size'];
6
7
  type ApTableContextProps<RecordType> = {
7
8
  /**
@@ -31,6 +32,9 @@ type ApTableContextProps<RecordType> = {
31
32
  setSearchFormValues?: (values: Partial<Recordable>) => void;
32
33
  submit?: () => void;
33
34
  reset?: () => void;
35
+ getSearchFormSorterItems?: () => ApFormSearchFormPopoverSorterItem[];
36
+ setSearchFormSorterItems?: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
37
+ resetSearchFormSorterItems: () => void;
34
38
  };
35
39
  export declare const ApTableContextKey: InjectionKey<ApTableContextProps<any>>;
36
40
  export declare function useProvideApTable<ModelType>(state: ApTableContextProps<ModelType>): void;
@@ -1,30 +1,30 @@
1
- import { provide as r, inject as i, computed as e } from "vue";
2
- const o = Symbol("apTableContextKey");
3
- function u(t) {
4
- r(o, t);
1
+ import { provide as s, inject as a, computed as o } from "vue";
2
+ const t = Symbol("apTableContextKey");
3
+ function n(r) {
4
+ s(t, r);
5
5
  }
6
- function a() {
7
- return i(o, {
8
- columns: e(() => []),
9
- updateColumns: () => {
10
- },
11
- size: e(() => "middle"),
12
- updateSize: () => {
13
- },
6
+ const e = () => {
7
+ };
8
+ function c() {
9
+ return a(t, {
10
+ columns: o(() => []),
11
+ updateColumns: e,
12
+ size: o(() => "middle"),
13
+ updateSize: e,
14
14
  dataSource: void 0,
15
15
  renderConfig: void 0,
16
16
  getSearchFormValues: () => {
17
17
  },
18
- setSearchFormValues: () => {
19
- },
20
- submit: () => {
21
- },
22
- reset: () => {
23
- }
18
+ setSearchFormValues: e,
19
+ submit: e,
20
+ reset: e,
21
+ getSearchFormSorterItems: () => [],
22
+ setSearchFormSorterItems: e,
23
+ resetSearchFormSorterItems: e
24
24
  });
25
25
  }
26
26
  export {
27
- o as ApTableContextKey,
28
- a as useInjectApTable,
29
- u as useProvideApTable
27
+ t as ApTableContextKey,
28
+ c as useInjectApTable,
29
+ n as useProvideApTable
30
30
  };
@@ -1,6 +1,6 @@
1
1
  import { ColumnType, TableProps, ColumnsType } from '@aplus-frontend/antdv/es/table';
2
2
  import { CompareFn, SortOrder, TableRowSelection } from '@aplus-frontend/antdv/es/table/interface';
3
- import { ApFormItemProps, ApFormSearchFormProps } from '../ap-form';
3
+ import { ApFormItemProps, ApFormSearchFormPopoverSorterItem, ApFormSearchFormProps } from '../ap-form';
4
4
  import { ApFormItemCheckboxProps, ApFormItemDateProps, ApFormItemDateRangeProps, ApFormItemNumberProps, ApFormItemRadioProps, ApFormItemSelectProps, ApFormItemSwitchProps, ApFormItemTextAreaProps, ApFormItemTextPasswordProps, ApFormItemTextProps, ApFormItemTreeSelectProps } from '../ap-form/items/interface';
5
5
  import { Recordable } from '../type';
6
6
  import { ComputedRef, CSSProperties, VNode } from 'vue';
@@ -406,6 +406,22 @@ export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
406
406
  * @returns
407
407
  */
408
408
  setPaging: (nextPaging: InternalPagingType, refreshImmediately?: boolean) => void;
409
+ /**
410
+ * 获取查询排序
411
+ * @returns
412
+ */
413
+ getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
414
+ /**
415
+ * 设置查询表单排序
416
+ * @param sortedItems
417
+ * @returns
418
+ */
419
+ setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
420
+ /**
421
+ * 重设查询表单排序
422
+ * @returns
423
+ */
424
+ resetSearchFormSorterItems: () => void;
409
425
  };
410
426
  export type ApTableContextRenderConfig = {
411
427
  color: string;
@@ -141,8 +141,8 @@ export declare function getSearchFormItemRenderNode(item: any, extraRenderMap?:
141
141
  readonly bordered?: boolean | undefined;
142
142
  readonly suffix?: any;
143
143
  readonly focused?: boolean | undefined;
144
- readonly placeholder?: string | number | undefined;
145
144
  readonly handleReset?: MouseEventHandler | undefined;
145
+ readonly placeholder?: string | number | undefined;
146
146
  readonly defaultValue?: string | number | undefined;
147
147
  readonly id?: string | undefined;
148
148
  readonly autocomplete?: string | undefined;
@@ -352,8 +352,8 @@ export declare function getSearchFormItemRenderNode(item: any, extraRenderMap?:
352
352
  readonly bordered?: boolean | undefined;
353
353
  readonly suffix?: any;
354
354
  readonly focused?: boolean | undefined;
355
- readonly placeholder?: string | number | undefined;
356
355
  readonly handleReset?: MouseEventHandler | undefined;
356
+ readonly placeholder?: string | number | undefined;
357
357
  readonly defaultValue?: string | number | undefined;
358
358
  readonly id?: string | undefined;
359
359
  readonly autocomplete?: string | undefined;
@@ -2,6 +2,7 @@ import { OpenOptions, UseCreateTableModalProps, OpenReturnType } from '../interf
2
2
  import { Recordable } from '../../../type';
3
3
  import { TableColumnsType } from '@aplus-frontend/antdv';
4
4
  import { InternalPagingType } from '../../../ap-table/hooks/use-table-paging-ng';
5
+ import { ApFormSearchFormPopoverSorterItem } from '../../..';
5
6
  export declare function useCreateTableModal(props: UseCreateTableModalProps): {
6
7
  readonly openModal: <T>(selected?: any[], options?: OpenOptions) => Promise< OpenReturnType<T> | undefined>;
7
8
  readonly closeModal: () => void;
@@ -37,6 +38,9 @@ export declare function useCreateTableModal(props: UseCreateTableModalProps): {
37
38
  };
38
39
  getPaging: () => InternalPagingType;
39
40
  setPaging: (nextPaging: InternalPagingType, refreshImmediately?: boolean) => void;
41
+ getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
42
+ setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
43
+ resetSearchFormSorterItems: () => void;
40
44
  } | null | undefined;
41
45
  readonly isDestroyed: true;
42
46
  };
@@ -2,6 +2,7 @@ import { ApTableModalProps, OpenOptions } from '../interface';
2
2
  import { Recordable } from '../../../type';
3
3
  import { TableColumnsType } from '@aplus-frontend/antdv';
4
4
  import { InternalPagingType } from '../../../ap-table/hooks/use-table-paging-ng';
5
+ import { ApFormSearchFormPopoverSorterItem } from '../../..';
5
6
  /** 函数式调用弹框表格 */
6
7
  export declare function useTableModal<TableRowType = Record<string, any>>(props: ApTableModalProps<TableRowType>): {
7
8
  reloadApTableData: () => void;
@@ -35,6 +36,9 @@ export declare function useTableModal<TableRowType = Record<string, any>>(props:
35
36
  };
36
37
  getPaging: () => InternalPagingType;
37
38
  setPaging: (nextPaging: InternalPagingType, refreshImmediately?: boolean) => void;
39
+ getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
40
+ setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
41
+ resetSearchFormSorterItems: () => void;
38
42
  } | null | undefined;
39
43
  isDestroyed: true;
40
44
  open: (options?: OpenOptions) => Promise<void>;
@@ -2,6 +2,7 @@ import { OpenOptions, UseTableSelectModalProps } from '../interface';
2
2
  import { Recordable } from '../../../type';
3
3
  import { TableColumnsType } from '@aplus-frontend/antdv';
4
4
  import { InternalPagingType } from '../../../ap-table/hooks/use-table-paging-ng';
5
+ import { ApFormSearchFormPopoverSorterItem } from '../../..';
5
6
  export declare function useTableSelectModal<TableRowType = Record<string, any>>(props: UseTableSelectModalProps<TableRowType>): {
6
7
  reloadApTableData: () => void;
7
8
  resetApTableData: () => void;
@@ -34,6 +35,9 @@ export declare function useTableSelectModal<TableRowType = Record<string, any>>(
34
35
  };
35
36
  getPaging: () => InternalPagingType;
36
37
  setPaging: (nextPaging: InternalPagingType, refreshImmediately?: boolean) => void;
38
+ getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
39
+ setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
40
+ resetSearchFormSorterItems: () => void;
37
41
  } | null | undefined;
38
42
  isDestroyed: true;
39
43
  open: (selected?: any[], options?: OpenOptions) => Promise<{
@@ -4,6 +4,7 @@ import { CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicP
4
4
  import { ApTableModalProps, OpenOptions, OpenReturnType } from './interface';
5
5
  import { Recordable } from '../../type';
6
6
  import { TableColumnsType } from '@aplus-frontend/antdv';
7
+ import { ApFormSearchFormPopoverSorterItem } from '../..';
7
8
  import { InternalPagingType } from '../../ap-table/hooks/use-table-paging-ng';
8
9
  /**
9
10
  *
@@ -49,6 +50,9 @@ declare const ApTableModal: {
49
50
  current: number;
50
51
  pageSize: number;
51
52
  }>, refreshImmediately?: boolean) => void;
53
+ getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
54
+ setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
55
+ resetSearchFormSorterItems: () => void;
52
56
  } | null;
53
57
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
54
58
  finish: (selectedRowKeys: (string | number)[], selectedRows: any[]) => any;
@@ -105,6 +109,9 @@ declare const ApTableModal: {
105
109
  };
106
110
  y: undefined;
107
111
  };
112
+ getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
113
+ setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
114
+ resetSearchFormSorterItems: () => void;
108
115
  }> | null;
109
116
  }, any, ComponentProvideOptions, {
110
117
  P: {};
@@ -153,6 +160,9 @@ declare const ApTableModal: {
153
160
  current: number;
154
161
  pageSize: number;
155
162
  }>, refreshImmediately?: boolean) => void;
163
+ getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
164
+ setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
165
+ resetSearchFormSorterItems: () => void;
156
166
  } | null;
157
167
  }, {}, {}, {}, {
158
168
  mask: boolean;
@@ -209,6 +219,9 @@ declare const ApTableModal: {
209
219
  };
210
220
  getPaging: () => InternalPagingType;
211
221
  setPaging: (nextPaging: InternalPagingType, refreshImmediately?: boolean) => void;
222
+ getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
223
+ setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
224
+ resetSearchFormSorterItems: () => void;
212
225
  } | null;
213
226
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
214
227
  finish: (selectedRowKeys: (string | number)[], selectedRows: any[]) => any;
@@ -3,6 +3,7 @@ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOp
3
3
  import { Recordable } from '../../type';
4
4
  import { TableColumnsType } from '@aplus-frontend/antdv';
5
5
  import { InternalPagingType } from '../../ap-table/hooks/use-table-paging-ng';
6
+ import { ApFormSearchFormPopoverSorterItem } from '../..';
6
7
  type __VLS_Props = ApTableModalProps;
7
8
  declare const _default: DefineComponent<__VLS_Props, {
8
9
  open: <T>(selected?: any[], options?: OpenOptions) => Promise<OpenReturnType<T>>;
@@ -36,6 +37,9 @@ declare const _default: DefineComponent<__VLS_Props, {
36
37
  };
37
38
  getPaging: () => InternalPagingType;
38
39
  setPaging: (nextPaging: InternalPagingType, refreshImmediately?: boolean) => void;
40
+ getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
41
+ setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
42
+ resetSearchFormSorterItems: () => void;
39
43
  } | null;
40
44
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
41
45
  finish: (selectedRowKeys: (string | number)[], selectedRows: any[]) => any;
@@ -94,6 +98,9 @@ declare const _default: DefineComponent<__VLS_Props, {
94
98
  };
95
99
  y: undefined;
96
100
  };
101
+ getSearchFormSorterItems: () => ApFormSearchFormPopoverSorterItem[];
102
+ setSearchFormSorterItems: (sortedItems: ApFormSearchFormPopoverSorterItem[]) => void;
103
+ resetSearchFormSorterItems: () => void;
97
104
  }> | null;
98
105
  }, any>;
99
106
  export default _default;
@@ -1,21 +1,19 @@
1
- import { defineComponent as q, computed as B, ref as v, createVNode as _, onMounted as H, watch as J, createBlock as Q, openBlock as X, unref as K, mergeProps as Z, withCtx as U, createElementVNode as C, normalizeClass as R } from "vue";
1
+ import { defineComponent as Q, computed as B, ref as K, createVNode as N, watch as X, createBlock as Z, openBlock as S, unref as b, mergeProps as U, withCtx as R, createElementVNode as C, normalizeClass as O } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import S from "./icons/line-down.vue.mjs";
4
- import { ApBatchActionGroup as D } from "../ap-batch-action-group/index.mjs";
3
+ import D from "./icons/line-down.vue.mjs";
4
+ import { ApBatchActionGroup as ee } from "../ap-batch-action-group/index.mjs";
5
5
  import "./components/main-button-content.vue.mjs";
6
6
  import "./components/menu-list-content.vue.mjs";
7
- import { useViewProvide as O } from "./hooks/use-view-provide.mjs";
8
- import { useInjectApTable as ee } from "../../ap-table/context.mjs";
9
- import { SYSTEM_VIEW_KEY as w } from "./utils/enum.mjs";
10
- import { isValid as te } from "@aplus-frontend/utils";
11
- import "../ap-keep-alive/index.mjs";
12
- import { useGlobalConfig as se } from "../../config-provider/hooks/use-global-config.mjs";
13
- import { useNamespace as ie } from "../../config-provider/hooks/use-namespace.mjs";
14
- import { useLocale as le } from "../../config-provider/hooks/use-locale.mjs";
15
- import oe from "./components/main-button-content.vue2.mjs";
7
+ import { useViewProvide as te } from "./hooks/use-view-provide.mjs";
8
+ import { useInjectApTable as ie } from "../../ap-table/context.mjs";
9
+ import { SYSTEM_VIEW_KEY as c } from "./utils/enum.mjs";
10
+ import { isValid as se } from "@aplus-frontend/utils";
11
+ import { useGlobalConfig as le } from "../../config-provider/hooks/use-global-config.mjs";
12
+ import { useNamespace as re } from "../../config-provider/hooks/use-namespace.mjs";
13
+ import { useLocale as oe } from "../../config-provider/hooks/use-locale.mjs";
14
+ import me from "./components/main-button-content.vue2.mjs";
16
15
  import ne from "./components/menu-list-content.vue2.mjs";
17
- import { useApKeepAliveInject as ae } from "../ap-keep-alive/hook.mjs";
18
- const xe = /* @__PURE__ */ q({
16
+ const _e = /* @__PURE__ */ Q({
19
17
  name: "ApView",
20
18
  __name: "ap-view",
21
19
  props: {
@@ -35,57 +33,63 @@ const xe = /* @__PURE__ */ q({
35
33
  }
36
34
  },
37
35
  setup(E, {
38
- expose: T
36
+ expose: k
39
37
  }) {
40
- const r = E, j = se("viewCacheOption"), {
41
- b
42
- } = ie("ap-view"), {
43
- t: k
44
- } = le(), g = B(() => ({
45
- viewKey: w,
46
- viewName: k("ap.apView.systemView")
38
+ const a = E, A = le("viewCacheOption"), {
39
+ b: g
40
+ } = re("ap-view"), {
41
+ t: L
42
+ } = oe(), v = B(() => ({
43
+ viewKey: c,
44
+ viewName: L("ap.apView.systemView")
47
45
  })), {
48
- getSearchFormValues: L,
49
- setSearchFormValues: P,
50
- submit: G,
51
- reset: I
52
- } = ee(), $ = v(!1), N = v(!1), V = v("");
53
- let d = !1, F = !1;
54
- const M = {
46
+ getSearchFormValues: P,
47
+ setSearchFormValues: T,
48
+ submit: j,
49
+ reset: G,
50
+ getSearchFormSorterItems: $,
51
+ setSearchFormSorterItems: Y,
52
+ resetSearchFormSorterItems: z
53
+ } = ie(), M = K(!1), F = K(!1), V = K("");
54
+ let d = !1, _ = !1;
55
+ const W = {
55
56
  dropdownType: "dropdown",
56
- content: _(oe, {
57
- maxViewNum: r.maxViewNum
57
+ content: N(me, {
58
+ maxViewNum: a.maxViewNum
58
59
  }, null)
59
- }, o = v([g.value]), Y = B(() => o.value.map((t) => ({
60
+ }, r = K([v.value]), q = B(() => r.value.map((t) => ({
60
61
  id: t.viewKey,
61
- content: _(ne, {
62
+ content: N(ne, {
62
63
  view: t
63
64
  }, null)
64
65
  }))), e = {
65
- getSearchFormValues: L,
66
- setSearchFormValues: P,
67
- submit: G,
68
- reset: I,
69
- ...r.saveDataSource
66
+ getSearchFormValues: P,
67
+ setSearchFormValues: T,
68
+ submit: j,
69
+ reset: G,
70
+ getSearchFormSorterItems: $,
71
+ setSearchFormSorterItems: Y,
72
+ resetSearchFormSorterItems: z,
73
+ ...a.saveDataSource
70
74
  }, s = {
71
- ...j.value,
72
- ...r.viewCacheOption
73
- }, x = () => {
74
- if (r.isDefaultSystemView)
75
- return w;
76
- if ((r.isFirstDefaultSystemView || F) && d)
77
- return w;
78
- const t = o.value.find((i) => i.isDefault);
79
- return (t == null ? void 0 : t.viewKey) ?? w;
80
- }, c = (t) => {
75
+ ...A.value,
76
+ ...a.viewCacheOption
77
+ }, I = () => {
78
+ if (a.isDefaultSystemView)
79
+ return c;
80
+ if ((a.isFirstDefaultSystemView || _) && d)
81
+ return c;
82
+ const t = r.value.find((i) => i.isDefault);
83
+ return (t == null ? void 0 : t.viewKey) ?? c;
84
+ }, w = (t) => {
81
85
  V.value = t;
82
- const i = o.value.find((l) => l.viewKey === V.value);
86
+ const i = r.value.find((l) => l.viewKey === V.value);
83
87
  i && setTimeout(() => {
84
- var l, n, a, f, m, u;
85
- i.viewKey === w ? d ? (l = e == null ? void 0 : e.submit) == null || l.call(e) : (n = e == null ? void 0 : e.reset) == null || n.call(e) : ((m = e == null ? void 0 : e.setSearchFormValues) == null || m.call(e, {
86
- ...Object.fromEntries(Object.keys(((a = e == null ? void 0 : e.getSearchFormValues) == null ? void 0 : a.call(e)) ?? {}).map((y) => [y, void 0])) ?? {},
87
- ...((f = i.viewConfig) == null ? void 0 : f.searchForm) ?? {}
88
- }), (u = e == null ? void 0 : e.submit) == null || u.call(e)), d = !1;
88
+ var l, o, m, f, n, u, y, x, h;
89
+ i.viewKey === c ? ((l = e == null ? void 0 : e.resetSearchFormSorterItems) == null || l.call(e), d ? (o = e == null ? void 0 : e.submit) == null || o.call(e) : (m = e == null ? void 0 : e.reset) == null || m.call(e)) : ((u = e == null ? void 0 : e.setSearchFormValues) == null || u.call(e, {
90
+ ...Object.fromEntries(Object.keys(((f = e == null ? void 0 : e.getSearchFormValues) == null ? void 0 : f.call(e)) ?? {}).map((J) => [J, void 0])) ?? {},
91
+ ...((n = i.viewConfig) == null ? void 0 : n.searchForm) ?? {}
92
+ }), (x = e == null ? void 0 : e.setSearchFormSorterItems) == null || x.call(e, ((y = i.viewConfig) == null ? void 0 : y.sorterItems) ?? []), (h = e == null ? void 0 : e.submit) == null || h.call(e)), d = !1;
89
93
  });
90
94
  }, p = {
91
95
  getViewList: async (t) => {
@@ -93,118 +97,112 @@ const xe = /* @__PURE__ */ q({
93
97
  try {
94
98
  const {
95
99
  tableKey: l
96
- } = t, n = await ((i = s == null ? void 0 : s.getViewList) == null ? void 0 : i.call(s, {
100
+ } = t, o = await ((i = s == null ? void 0 : s.getViewList) == null ? void 0 : i.call(s, {
97
101
  tableKey: l
98
102
  }));
99
- return o.value = [g.value, ...n ?? []], c(x()), o.value;
103
+ return r.value = [v.value, ...o ?? []], w(I()), r.value;
100
104
  } catch {
101
- return o.value = [g.value], c(w), o.value;
105
+ return r.value = [v.value], w(c), r.value;
102
106
  }
103
107
  },
104
108
  addView: async (t) => {
105
- var m;
109
+ var n;
106
110
  const {
107
111
  tableKey: i,
108
112
  viewKey: l,
109
- viewName: n,
110
- isDefault: a,
113
+ viewName: o,
114
+ isDefault: m,
111
115
  viewConfig: f
112
116
  } = t;
113
- await ((m = s == null ? void 0 : s.addView) == null ? void 0 : m.call(s, {
117
+ await ((n = s == null ? void 0 : s.addView) == null ? void 0 : n.call(s, {
114
118
  tableKey: i,
115
119
  viewKey: l,
116
- viewName: n,
117
- isDefault: a,
120
+ viewName: o,
121
+ isDefault: m,
118
122
  viewConfig: f
119
- })), a && (o.value = o.value.map((u) => ({
123
+ })), m && (r.value = r.value.map((u) => ({
120
124
  ...u,
121
125
  isDefault: !1
122
- }))), o.value = [...o.value, {
126
+ }))), r.value = [...r.value, {
123
127
  viewKey: l,
124
- viewName: n,
125
- isDefault: a,
128
+ viewName: o,
129
+ isDefault: m,
126
130
  viewConfig: f
127
- }], c(l);
131
+ }], w(l);
128
132
  },
129
133
  changeView: async (t) => {
130
134
  var u;
131
135
  const {
132
136
  tableKey: i,
133
137
  viewKey: l,
134
- viewName: n,
135
- isDefault: a,
138
+ viewName: o,
139
+ isDefault: m,
136
140
  viewConfig: f
137
141
  } = t;
138
142
  await ((u = s == null ? void 0 : s.changeView) == null ? void 0 : u.call(s, {
139
143
  tableKey: i,
140
144
  viewKey: l,
141
- viewName: n,
142
- isDefault: a,
145
+ viewName: o,
146
+ isDefault: m,
143
147
  viewConfig: f
144
- })), a && (o.value = o.value.map((y) => ({
148
+ })), m && (r.value = r.value.map((y) => ({
145
149
  ...y,
146
150
  isDefault: !1
147
151
  })));
148
- const m = o.value.find((y) => y.viewKey === l);
149
- m && (m.viewName = n, m.isDefault = a, m.viewConfig = f), c(l);
152
+ const n = r.value.find((y) => y.viewKey === l);
153
+ n && (n.viewName = o, n.isDefault = m, n.viewConfig = f), w(l);
150
154
  },
151
155
  removeView: async (t) => {
152
- var n;
156
+ var o;
153
157
  const {
154
158
  tableKey: i,
155
159
  viewKey: l
156
160
  } = t;
157
- await ((n = s == null ? void 0 : s.removeView) == null ? void 0 : n.call(s, {
161
+ await ((o = s == null ? void 0 : s.removeView) == null ? void 0 : o.call(s, {
158
162
  tableKey: i,
159
163
  viewKey: l
160
- })), o.value = o.value.filter((a) => a.viewKey !== l), l === V.value && c(x());
164
+ })), r.value = r.value.filter((m) => m.viewKey !== l), l === V.value && w(I());
161
165
  }
162
- }, z = {
163
- tableKey: r.tableKey,
166
+ }, H = {
167
+ tableKey: a.tableKey,
164
168
  currentViewKey: V,
165
- changeCurrentViewKey: c,
166
- popoverOpen: $,
167
- menuOpen: N,
168
- viewList: o,
169
+ changeCurrentViewKey: w,
170
+ popoverOpen: M,
171
+ menuOpen: F,
172
+ viewList: r,
169
173
  viewListCRUD: p,
170
174
  saveDataSource: e
171
175
  };
172
- O(z);
173
- const {
174
- has: W
175
- } = ae(), A = (t) => {
176
- F = t;
177
- }, h = (t) => {
176
+ return te(H), X(() => a.tableKey, (t) => {
178
177
  var i;
179
- te(t) && (d = !0, (i = p == null ? void 0 : p.getViewList) == null || i.call(p, {
178
+ se(t) && (d = !0, (i = p == null ? void 0 : p.getViewList) == null || i.call(p, {
180
179
  tableKey: t
181
180
  }));
182
- };
183
- return H(async () => {
184
- await W() && A(!0), h(r.tableKey);
185
- }), J(() => r.tableKey, (t) => {
186
- h(t);
187
- }), T({
188
- setFirstDefaultSystemView: A
189
- }), (t, i) => (X(), Q(K(D), Z({
181
+ }, {
182
+ immediate: !0
183
+ }), k({
184
+ setFirstDefaultSystemView: (t) => {
185
+ _ = t;
186
+ }
187
+ }), (t, i) => (S(), Z(b(ee), U({
190
188
  ...t.$attrs
191
189
  }, {
192
- open: N.value,
193
- "onUpdate:open": i[0] || (i[0] = (l) => N.value = l),
194
- class: [K(b)()],
195
- "button-props": M,
196
- "menu-list": Y.value,
197
- "overlay-class-name": [K(b)("overlay")],
190
+ open: F.value,
191
+ "onUpdate:open": i[0] || (i[0] = (l) => F.value = l),
192
+ class: [b(g)()],
193
+ "button-props": W,
194
+ "menu-list": q.value,
195
+ "overlay-class-name": [b(g)("overlay")],
198
196
  trigger: "click",
199
197
  placement: "bottom"
200
198
  }), {
201
- icon: U(() => [C("div", {
202
- class: R([K(b)("icon")])
203
- }, [_(S)], 2)]),
199
+ icon: R(() => [C("div", {
200
+ class: O([b(g)("icon")])
201
+ }, [N(D)], 2)]),
204
202
  _: 1
205
203
  }, 16, ["open", "class", "menu-list", "overlay-class-name"]));
206
204
  }
207
205
  });
208
206
  export {
209
- xe as default
207
+ _e as default
210
208
  };