@dazhicheng/ui 1.6.19 → 1.6.21

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 (49) hide show
  1. package/dist/components/tt-form/index.d.ts +2 -2
  2. package/dist/components/tt-form/src/formApi.d.ts +11 -2
  3. package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +162 -114
  4. package/dist/components/tt-form/src/group-form/groupFormApi.js +0 -6
  5. package/dist/components/tt-form/src/group-form/lazyContext.d.ts +18 -0
  6. package/dist/components/tt-form/src/group-form/lazyContext.js +64 -36
  7. package/dist/components/tt-form/src/group-form/types.d.ts +39 -6
  8. package/dist/components/tt-form/src/group-form/useGroupForm.d.ts +7 -5
  9. package/dist/components/tt-form/src/types.d.ts +58 -26
  10. package/dist/components/tt-form/src/useForm.d.ts +1 -1
  11. package/dist/components/tt-form/src/useForm.js +5 -5
  12. package/dist/components/tt-modal/index.d.ts +1 -0
  13. package/dist/components/tt-modal/index.js +8 -3
  14. package/dist/components/tt-modal/src/RenderModal.vue.js +224 -210
  15. package/dist/components/tt-modal/src/hooks/useModalRender.js +66 -67
  16. package/dist/components/tt-modal/src/index.js +9 -7
  17. package/dist/components/tt-modal/src/utils/modal-api.d.ts +9 -3
  18. package/dist/components/tt-modal/src/utils/modal-api.js +42 -36
  19. package/dist/components/tt-modal/src/utils/modal-close-transition.d.ts +13 -0
  20. package/dist/components/tt-modal/src/utils/modal-close-transition.js +13 -0
  21. package/dist/components/tt-modal/src/utils/modal-host-app.d.ts +5 -0
  22. package/dist/components/tt-modal/src/utils/modal-host-app.js +12 -0
  23. package/dist/components/tt-modal/src/utils/modal-scope.d.ts +21 -0
  24. package/dist/components/tt-modal/src/utils/modal-scope.js +20 -0
  25. package/dist/components/tt-modal/src/utils/modal-service.d.ts +23 -0
  26. package/dist/components/tt-modal/src/utils/modal-service.js +51 -0
  27. package/dist/components/tt-modal/src/utils/modal-stack.d.ts +14 -13
  28. package/dist/components/tt-modal/src/utils/modal-stack.js +20 -9
  29. package/dist/components/tt-modal/src/utils/modal-z-index.d.ts +15 -0
  30. package/dist/components/tt-modal/src/utils/modal-z-index.js +24 -0
  31. package/dist/components/tt-modal/src/utils/resolve-modal-target.d.ts +14 -0
  32. package/dist/components/tt-modal/src/utils/resolve-modal-target.js +83 -47
  33. package/dist/components/tt-modal-form/props.d.ts +9 -4
  34. package/dist/components/tt-modal-form/useModalForm.d.ts +1 -1
  35. package/dist/components/tt-table/index.d.ts +15 -0
  36. package/dist/components/tt-table/src/Table.vue.d.ts +9 -0
  37. package/dist/components/tt-table/src/Table.vue.js +240 -242
  38. package/dist/components/tt-table/src/TableForm.vue.d.ts +7 -5
  39. package/dist/components/tt-table/src/TableForm.vue.js +199 -180
  40. package/dist/components/tt-table/src/hooks/usePagination.d.ts +1 -1
  41. package/dist/components/tt-table/src/hooks/usePagination.js +38 -24
  42. package/dist/components/tt-table/src/hooks/useTableRender.d.ts +4 -4
  43. package/dist/components/tt-table/src/props.d.ts +6 -0
  44. package/dist/components/tt-table/src/props.js +5 -0
  45. package/dist/components/tt-table/src/types/table.d.ts +8 -0
  46. package/dist/components/tt-table/src/types/tableForm.d.ts +29 -14
  47. package/dist/components/tt-table/src/utils/table-form-api.d.ts +11 -11
  48. package/dist/index.js +132 -127
  49. package/package.json +1 -1
@@ -1,52 +1,66 @@
1
- import { GlobalConfig as f } from "../../../../hooks/useSetup.js";
1
+ import { GlobalConfig as s } from "../../../../hooks/useSetup.js";
2
2
  import "axios";
3
3
  import "element-plus";
4
+ import { isFunction as P } from "../../../../packages/utils/src/is.js";
5
+ import { ref as h, unref as t, computed as C, watch as y } from "vue";
4
6
  import "dayjs";
5
- import { ref as c, unref as o, computed as P, watch as l } from "vue";
6
7
  import "numeral";
7
8
  import "xe-utils";
8
9
  import "dayjs/plugin/utc";
9
10
  import "dayjs/plugin/timezone";
10
- import { mergeWithArrayOverride as s } from "../../../../packages/utils/src/merge.js";
11
+ import { mergeWithArrayOverride as b } from "../../../../packages/utils/src/merge.js";
11
12
  import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
12
13
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
13
14
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
14
15
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
15
16
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
16
17
  import "lodash-es";
17
- const C = {
18
+ const z = {
18
19
  currentPage: 1,
19
20
  pageSize: 300,
20
21
  total: 0,
21
22
  pageSizes: [300, 500, 1e3, 2e3],
22
23
  layouts: ["Total", "PrevPage", "JumpNumber", "NextPage", "Sizes", "FullJump"]
23
24
  };
24
- function T(e, g) {
25
- var a;
26
- const r = c(
27
- s(o(e).pagerConfig || {}, ((a = f.table) == null ? void 0 : a.pagerConfig) || {})
28
- ), i = P(() => {
29
- const { showPager: t, pagerConfig: u } = o(e);
30
- if (!(!t && !u))
31
- return { ...C, ...o(r) };
25
+ function D(i, f) {
26
+ var u;
27
+ const r = h(
28
+ b(t(i).pagerConfig || {}, ((u = s.table) == null ? void 0 : u.pagerConfig) || {})
29
+ ), g = C(() => {
30
+ const { showPager: e, pagerConfig: n } = t(i);
31
+ if (!(!e && !n))
32
+ return { ...z, ...t(r) };
32
33
  });
33
- function p() {
34
- return o(i);
34
+ function c() {
35
+ return t(g);
35
36
  }
36
- function n(t) {
37
- r.value = { ...o(r), ...t };
37
+ function o(e) {
38
+ r.value = { ...t(r), ...e };
38
39
  }
39
- function m(t) {
40
- g("page-change", t);
40
+ let a = !1;
41
+ async function l(e) {
42
+ const { currentPage: n, pageSize: m } = e, { beforePageChange: p } = t(i);
43
+ if (P(p)) {
44
+ if (a) return;
45
+ a = !0;
46
+ try {
47
+ if (await p({ ...t(r), currentPage: n, pageSize: m }) === !1) return;
48
+ } catch {
49
+ return;
50
+ } finally {
51
+ a = !1;
52
+ }
53
+ }
54
+ o({ currentPage: n, pageSize: m }), f("page-change", e);
41
55
  }
42
- return l(
43
- () => o(e).pagerConfig,
44
- (t) => {
45
- t && n(t);
56
+ return y(
57
+ () => t(i).pagerConfig,
58
+ (e) => {
59
+ e && o(e);
46
60
  },
47
61
  { deep: !0 }
48
- ), { pagination: r, paginationInfo: i, getPagination: p, setPagination: n, onPageChange: m };
62
+ ), { pagination: r, paginationInfo: g, getPagination: c, setPagination: o, onPageChange: l };
49
63
  }
50
64
  export {
51
- T as usePagination
65
+ D as usePagination
52
66
  };
@@ -16,9 +16,9 @@ type TtTableRenderEmits = Record<string, (...args: any[]) => any>;
16
16
  *
17
17
  * `Row` 是业务行数据类型,传入后表格插槽作用域与 `tableFormApi.tableApi` 的方法签名跟着推断。
18
18
  */
19
- export type TtUseTableFormRenderReturnType<Row = any> = [
20
- DefineSetupFnComponent<TtTableFormProps<Row>, TtTableRenderEmits, SlotsType<TtTableSlots<Row>>>,
21
- TtTableExtendedTableFormApi<Row>
19
+ export type TtUseTableFormRenderReturnType<Row = any, TValues extends Record<string, any> = Record<string, any>> = [
20
+ DefineSetupFnComponent<TtTableFormProps<Row, TValues>, TtTableRenderEmits, SlotsType<TtTableSlots<Row>>>,
21
+ TtTableExtendedTableFormApi<Row, TValues>
22
22
  ];
23
23
  /**
24
24
  * useTableRender 的返回值
@@ -61,7 +61,7 @@ export type TtUseTableRenderReturnType<Row = any> = [
61
61
  * // 在模板中使用
62
62
  * <FormTable />
63
63
  */
64
- export declare function useTableFormRender<Row = any>(options: NoInfer<TtTableFormProps<Row>>): TtUseTableFormRenderReturnType<Row>;
64
+ export declare function useTableFormRender<Row = any, TValues extends Record<string, any> = Record<string, any>>(options: NoInfer<TtTableFormProps<Row, TValues>>): TtUseTableFormRenderReturnType<Row, TValues>;
65
65
  /**
66
66
  * 用于渲染表格的 hooks,返回 [TableRender 组件, 表格API]。
67
67
  *
@@ -71,6 +71,11 @@ export declare const tableProps: {
71
71
  type: PropType<TtTableProps["beforeFetch"]>;
72
72
  default: null;
73
73
  };
74
+ /** 用户操作分页器请求前的回调,返回 false 拦下这次翻页 */
75
+ beforePageChange: {
76
+ type: PropType<TtTableProps["beforePageChange"]>;
77
+ default: null;
78
+ };
74
79
  /**
75
80
  * data
76
81
  *
@@ -479,6 +484,7 @@ export declare const tableFormProps: {
479
484
  immediate?: boolean;
480
485
  afterFetch?: ((data: any[], res: Recordable | Recordable[]) => Promise<any[]>) | undefined;
481
486
  beforeFetch?: (params: Recordable) => Promise<Recordable>;
487
+ beforePageChange?: (page: import("vxe-table").VxeGridPropTypes.PagerConfig) => boolean | Promise<boolean>;
482
488
  isScrollFetch?: boolean;
483
489
  showToolbar?: boolean;
484
490
  columnsFieldSort?: string[];
@@ -102,6 +102,11 @@ const a = {
102
102
  type: Function,
103
103
  default: null
104
104
  },
105
+ /** 用户操作分页器请求前的回调,返回 false 拦下这次翻页 */
106
+ beforePageChange: {
107
+ type: Function,
108
+ default: null
109
+ },
105
110
  /**
106
111
  * data
107
112
  *
@@ -77,6 +77,14 @@ export type TtTableFetchProps<Row = any> = {
77
77
  * @param params 请求参数
78
78
  */
79
79
  beforeFetch?: (params: Recordable) => Promise<Recordable>;
80
+ /**
81
+ * 用户操作分页器发起请求前的回调,返回 `false` 拦下这次翻页,页码保持原样。
82
+ *
83
+ * 只拦分页器上的交互,代码里调 `setPagination()` 改分页不经过它。
84
+ * `TtTableForm` 会用它把分页接到 `tableSearchBefore` 上,用表单的组合方式时不必自己传。
85
+ * @param page 这次要切到的分页信息
86
+ */
87
+ beforePageChange?: (page: VxeGridPropTypes.PagerConfig) => boolean | Promise<boolean>;
80
88
  /** 是否滚动加载 */
81
89
  isScrollFetch?: boolean;
82
90
  };
@@ -1,11 +1,22 @@
1
1
  import { MaybeRef, Ref } from 'vue';
2
- import { Recordable } from '../../../../../../utils/src';
3
2
  import { TtSelectRowKeysType, TtTableMethods, TtTableProps } from '../types/table';
4
3
  import { TableFormApi } from '../utils/table-form-api';
5
4
  import { TtTableToolsProps } from './tableTools';
6
5
  import { TtExtendedFormApi, TtFormProps } from '../../../tt-form';
7
- export type TtTableFormRenderFormProps = Partial<TtFormProps>;
8
- export type TtTableRenderFormInstance = TtExtendedFormApi;
6
+ /**
7
+ * 搜索表单配置。
8
+ *
9
+ * `TValues` 是搜索表单的值类型,由 `useTableFormRender<Row, SearchValues>()` 传入后,
10
+ * schema 里 `dependencies` 等回调的 values 参数会跟着推断;不传时退化为 `Record<string, any>`。
11
+ */
12
+ export type TtTableFormRenderFormProps<TValues extends Record<string, any> = Record<string, any>> = Partial<TtFormProps<TValues>>;
13
+ export type TtTableRenderFormInstance<TValues extends Record<string, any> = Record<string, any>> = TtExtendedFormApi<TValues>;
14
+ /**
15
+ * 触发查询的入口。
16
+ *
17
+ * `submit` 查询按钮或回车提交,`reset` 重置按钮,`refresh` 工具栏刷新按钮,`page` 分页器翻页或改每页条数。
18
+ */
19
+ export type TtTableSearchTrigger = "submit" | "reset" | "refresh" | "page";
9
20
  /**
10
21
  * 查询前拦截的返回结果。
11
22
  *
@@ -22,12 +33,13 @@ export type TtTableSearchBeforeResult = boolean | {
22
33
  *
23
34
  * `Row` 是业务行数据类型,由 `useTableFormRender<Row>()` 传入后 `table` 里的列配置、
24
35
  * 数据与 `tableApi` 的方法签名都会跟着推断;不传时退化为 `any`。
36
+ * `TValues` 是搜索表单的值类型,由第二个类型参数传入,决定 `form` 里各回调的 values 类型。
25
37
  */
26
- export type TtTableFormProps<Row = any> = {
38
+ export type TtTableFormProps<Row = any, TValues extends Record<string, any> = Record<string, any>> = {
27
39
  /** 表格配置 */
28
40
  table?: Partial<TtTableProps<Row>>;
29
41
  /** form 配置 */
30
- form?: TtTableFormRenderFormProps;
42
+ form?: TtTableFormRenderFormProps<TValues>;
31
43
  /** 是否开启form表单 */
32
44
  useSearchForm?: boolean;
33
45
  handleSearchInfoFn?: Fn;
@@ -36,12 +48,15 @@ export type TtTableFormProps<Row = any> = {
36
48
  /** 刷新前的调用方法 */
37
49
  tableRefreshBefore?: (...arg: any[]) => Promise<any>;
38
50
  /**
39
- * 点击查询(含回车提交)发起请求前的调用方法。
51
+ * 用户操作发起查询请求前的调用方法。
40
52
  *
41
53
  * 返回 `false` 拦截本次查询;返回 `{ canSearch, clearData }` 可以在拦截的同时清空表格数据。
42
- * @param values 通过校验后的当前表单值
54
+ * 覆盖查询、重置、工具栏刷新与分页器四个用户入口;`table.immediate` 的首次自动请求、
55
+ * `reload()` / `setPagination()` 等 API 调用都不经过这里。分页被拦下时页码保持原样。
56
+ * @param values 通过校验后的当前表单值,重置时是重置后的值
57
+ * @param trigger 触发入口
43
58
  */
44
- tableSearchBefore?: (values: Recordable) => TtTableSearchBeforeResult | Promise<TtTableSearchBeforeResult>;
59
+ tableSearchBefore?: (values: TValues, trigger: TtTableSearchTrigger) => TtTableSearchBeforeResult | Promise<TtTableSearchBeforeResult>;
45
60
  /**
46
61
  * 表格 testId,用于生成测试标识
47
62
  * 如果不指定,将从 table.api 路径自动提取
@@ -50,13 +65,13 @@ export type TtTableFormProps<Row = any> = {
50
65
  */
51
66
  testId?: string;
52
67
  };
53
- export type TtTableFormActionType<Row = any> = {
68
+ export type TtTableFormActionType<Row = any, TValues extends Record<string, any> = Record<string, any>> = {
54
69
  setTableProps: (props: Partial<TtTableProps<Row>>) => void;
55
- setFormProps: (props: TtTableFormRenderFormProps) => void;
70
+ setFormProps: (props: TtTableFormRenderFormProps<TValues>) => void;
56
71
  tableMethods: TtTableMethods<Row>;
57
- formMethods: TtTableRenderFormInstance;
72
+ formMethods: TtTableRenderFormInstance<TValues>;
58
73
  /** 设置props */
59
- setProps: (props: Partial<TtTableFormProps<Row>>) => void;
74
+ setProps: (props: Partial<TtTableFormProps<Row, TValues>>) => void;
60
75
  /** reload */
61
76
  reload: TtTableMethods<Row>["reload"];
62
77
  /**
@@ -65,6 +80,6 @@ export type TtTableFormActionType<Row = any> = {
65
80
  */
66
81
  selectedKeys: MaybeRef<TtSelectRowKeysType>;
67
82
  };
68
- export type TtTableExtendedTableFormApi<Row = any> = TableFormApi<Row> & {
69
- useStore: <T = NoInfer<TtTableFormProps<Row>>>(selector?: (state: NoInfer<TtTableFormProps<Row>>) => T) => Readonly<Ref<T>>;
83
+ export type TtTableExtendedTableFormApi<Row = any, TValues extends Record<string, any> = Record<string, any>> = TableFormApi<Row, TValues> & {
84
+ useStore: <T = NoInfer<TtTableFormProps<Row, TValues>>>(selector?: (state: NoInfer<TtTableFormProps<Row, TValues>>) => T) => Readonly<Ref<T>>;
70
85
  };
@@ -13,37 +13,37 @@ import { Store } from '@tanstack/vue-store';
13
13
  * api.reload()
14
14
  * api.setFormProps({ ... })
15
15
  */
16
- declare class TableFormApi<Row = any> {
16
+ declare class TableFormApi<Row = any, TValues extends Record<string, any> = Record<string, any>> {
17
17
  /** form 表单实例(FormApi) */
18
- formApi: TtExtendedFormApi;
18
+ formApi: TtExtendedFormApi<TValues>;
19
19
  /** 表格 API 实例(TableApi) */
20
20
  tableApi: TtTableExtendedTableApi<Row>;
21
21
  /** vxe-grid 表格实例 */
22
22
  grid: VxeGridInstance;
23
23
  /** 当前表单+表格的 props 状态 */
24
- state: null | TtTableFormProps<Row>;
24
+ state: null | TtTableFormProps<Row, TValues>;
25
25
  /** 表单操作方法集合(TableFormActionType) */
26
- tableForm: TtTableFormActionType<Row>;
26
+ tableForm: TtTableFormActionType<Row, TValues>;
27
27
  /** 响应式 store,存储表单+表格的状态 */
28
- store: Store<TtTableFormProps<Row>>;
28
+ store: Store<TtTableFormProps<Row, TValues>>;
29
29
  private isMounted;
30
30
  private stateHandler;
31
31
  /**
32
32
  * 构造函数,初始化 store、tableApi、状态等
33
33
  * @param options 表单+表格配置项
34
34
  */
35
- constructor(options?: TtTableFormProps<Row>);
35
+ constructor(options?: TtTableFormProps<Row, TValues>);
36
36
  /**
37
37
  * 组件挂载时调用,注入表单和表格实例
38
38
  * @param instance 表单操作方法实例
39
39
  * @param formApi 表单实例
40
40
  */
41
- mount(instance: null | TtTableFormActionType<Row>, formApi: TtExtendedFormApi): void;
41
+ mount(instance: null | TtTableFormActionType<Row, TValues>, formApi: TtExtendedFormApi<TValues>): void;
42
42
  /**
43
43
  * 更新表单+表格的数据
44
44
  * @param stateOrFn 新状态或返回新状态的函数
45
45
  */
46
- setState(stateOrFn: ((prev: TtTableFormProps<Row>) => Partial<TtTableFormProps<Row>>) | Partial<TtTableFormProps<Row>>): void;
46
+ setState(stateOrFn: ((prev: TtTableFormProps<Row, TValues>) => Partial<TtTableFormProps<Row, TValues>>) | Partial<TtTableFormProps<Row, TValues>>): void;
47
47
  /**
48
48
  * 重新加载表格数据
49
49
  * @param data 可选的查询参数
@@ -56,7 +56,7 @@ declare class TableFormApi<Row = any> {
56
56
  /**
57
57
  * 获取表单实例
58
58
  */
59
- formInstance(): import('../../../tt-form/src/types').ExtendedFormApi;
59
+ formInstance(): TtExtendedFormApi<TValues>;
60
60
  /**
61
61
  * 获取 vxe-grid 表格实例
62
62
  */
@@ -74,12 +74,12 @@ declare class TableFormApi<Row = any> {
74
74
  * 设置表单属性
75
75
  * @param props 表单属性
76
76
  */
77
- setFormProps(props: Partial<TtTableFormRenderFormProps>): void;
77
+ setFormProps(props: Partial<TtTableFormRenderFormProps<TValues>>): void;
78
78
  /**
79
79
  * 设置表单+表格属性
80
80
  * @param props 属性
81
81
  */
82
- setProps(props: Partial<TtTableFormProps<Row>>): void;
82
+ setProps(props: Partial<TtTableFormProps<Row, TValues>>): void;
83
83
  /**
84
84
  * 组件卸载时调用,重置挂载状态
85
85
  */
package/dist/index.js CHANGED
@@ -1,92 +1,93 @@
1
1
  import { TtButton as p } from "./components/tt-button/index.js";
2
- import { TtAddButton as ar } from "./components/tt-button/index.js";
2
+ import { TtAddButton as ao } from "./components/tt-button/index.js";
3
3
  import { TtCheckbox as a } from "./components/tt-checkbox/index.js";
4
4
  import { TtEmpty as f } from "./components/tt-empty/index.js";
5
- import { addComponent as s, setConfig as i } from "./components/tt-form/index.js";
6
- import { TtFormItemErrorTooltip as d } from "./components/tt-form-item-error-tooltip/index.js";
7
- import { TtIcon as u, TtAddIcon as x, TtSubIcon as T } from "./components/tt-icon/index.js";
8
- import { TtImage as n } from "./components/tt-image/index.js";
9
- import { RenderDrawer as l } from "./components/tt-drawer/index.js";
5
+ import { addComponent as s, setConfig as d } from "./components/tt-form/index.js";
6
+ import { TtFormItemErrorTooltip as i } from "./components/tt-form-item-error-tooltip/index.js";
7
+ import { TtIcon as l, TtAddIcon as u, TtSubIcon as x } from "./components/tt-icon/index.js";
8
+ import { TtImage as T } from "./components/tt-image/index.js";
9
+ import { RenderDrawer as n } from "./components/tt-drawer/index.js";
10
10
  import { RenderModal as c } from "./components/tt-modal/index.js";
11
- import { TtModal as sr } from "./components/tt-modal/index.js";
12
- import { TtSelect as b } from "./components/tt-select/index.js";
13
- import { TtText as w } from "./components/tt-text/index.js";
14
- import { TtUpload as R } from "./components/tt-upload/index.js";
15
- import { TtNavAnchor as h } from "./components/tt-nav-anchor/index.js";
16
- import { TtApiComponent as g } from "./components/tt-api-component/index.js";
11
+ import { TtModal as so } from "./components/tt-modal/index.js";
12
+ import { TtSelect as M } from "./components/tt-select/index.js";
13
+ import { TtText as b } from "./components/tt-text/index.js";
14
+ import { TtUpload as w } from "./components/tt-upload/index.js";
15
+ import { TtNavAnchor as R } from "./components/tt-nav-anchor/index.js";
16
+ import { TtApiComponent as h } from "./components/tt-api-component/index.js";
17
17
  import * as e from "./directives/index.js";
18
- import { setup as M } from "./hooks/useSetup.js";
19
- import { TtLog as P } from "./components/tt-log/index.js";
20
- import { TtPanelSelect as S } from "./components/tt-panel-select/index.js";
21
- import { TtRadioGroup as A } from "./components/tt-radio-group/index.js";
22
- import { setXHR as dr } from "./utils/xhr.js";
18
+ import { setup as g } from "./hooks/useSetup.js";
19
+ import { TtLog as A } from "./components/tt-log/index.js";
20
+ import { TtPanelSelect as P } from "./components/tt-panel-select/index.js";
21
+ import { TtRadioGroup as S } from "./components/tt-radio-group/index.js";
22
+ import { setXHR as lo } from "./utils/xhr.js";
23
23
  /* empty css */
24
24
  /* empty css */
25
25
  /* empty css */
26
26
  /* empty css */
27
27
  /* empty css */
28
- import { default as xr } from "./components/tt-area/TtArea.vue.js";
29
- import { useModalForm as nr } from "./components/tt-modal-form/useModalForm.js";
30
- import { TtLoading as cr } from "./components/tt-loading/index.js";
31
- import { TtTable as wr, TtTableAction as Rr, TtTableButton as hr } from "./components/tt-table/index.js";
32
- import { useFormSchemasLink as Mr } from "./hooks/useFormSchemasLink.js";
33
- import { useDataPermissionOptions as Sr } from "./hooks/useDataPermissionOptions.js";
34
- import { useBasicDataOptions as Cr } from "./hooks/useBasicDataOptions.js";
35
- import { usePanelSelectSchemas as Ir } from "./hooks/usePanelSelectSchemas.js";
36
- import { CODES as Or, GROUP_BY as Lr } from "./hooks/basicDataCodes.js";
37
- import { useFormat as Br } from "./hooks/useFormat.js";
38
- import { useLoading as vr } from "./hooks/useLoading.js";
39
- import { useScreenshotOss as Nr } from "./hooks/useScreenshotOss.js";
40
- import { createUppercaseInputProps as kr, toUppercaseInputValue as Vr, uppercaseInputProps as _r } from "./utils/uppercaseInput.js";
28
+ import { default as xo } from "./components/tt-area/TtArea.vue.js";
29
+ import { useModalForm as no } from "./components/tt-modal-form/useModalForm.js";
30
+ import { TtLoading as Mo } from "./components/tt-loading/index.js";
31
+ import { TtTable as wo, TtTableAction as Ro, TtTableButton as ho } from "./components/tt-table/index.js";
32
+ import { useFormSchemasLink as Ao } from "./hooks/useFormSchemasLink.js";
33
+ import { useDataPermissionOptions as So } from "./hooks/useDataPermissionOptions.js";
34
+ import { useBasicDataOptions as Do } from "./hooks/useBasicDataOptions.js";
35
+ import { usePanelSelectSchemas as Fo } from "./hooks/usePanelSelectSchemas.js";
36
+ import { CODES as Lo, GROUP_BY as Eo } from "./hooks/basicDataCodes.js";
37
+ import { useFormat as Uo } from "./hooks/useFormat.js";
38
+ import { useLoading as zo } from "./hooks/useLoading.js";
39
+ import { useScreenshotOss as Go } from "./hooks/useScreenshotOss.js";
40
+ import { createUppercaseInputProps as Vo, toUppercaseInputValue as _o, uppercaseInputProps as $o } from "./utils/uppercaseInput.js";
41
41
  import { setupDrawer as C } from "./components/tt-drawer/src/index.js";
42
- import { useShowDrawer as jr } from "./components/tt-drawer/src/index.js";
42
+ import { useShowDrawer as yo } from "./components/tt-drawer/src/index.js";
43
43
  import { setupModal as D } from "./components/tt-modal/src/index.js";
44
- import { useShowModal as Hr } from "./components/tt-modal/src/index.js";
45
- import { default as Yr } from "./directives/disabled-tip/index.js";
46
- import { default as qr } from "./directives/auto-tip/index.js";
47
- import { showTtDrawer as Kr, useDrawerRender as Qr } from "./components/tt-drawer/src/hooks/useDrawerRender.js";
48
- import { useDrawerResizable as ro } from "./components/tt-drawer/src/hooks/useResizable.js";
49
- import { showTtModal as eo, useModalRender as to } from "./components/tt-modal/src/hooks/useModalRender.js";
50
- import { default as po } from "./directives/dialog-resize/index.js";
51
- import * as or from "zod";
52
- import { useGroupForm as fo } from "./components/tt-form/src/group-form/useGroupForm.js";
53
- import { COMPONENT_MAP as io } from "./components/tt-form/src/config.js";
54
- import { useForm as xo } from "./components/tt-form/src/useForm.js";
55
- import { TtImageViewer as no } from "./components/tt-image/src/components/ImageViewer.js";
56
- import { vTtLoading as co } from "./components/tt-loading/src/directive.js";
57
- import { Loading as wo } from "./components/tt-loading/src/service.js";
58
- import { useTableContext as ho, useTableFormContext as go } from "./components/tt-table/src/hooks/useTableContext.js";
59
- import { useTableFormRender as Po, useTableRender as So } from "./components/tt-table/src/hooks/useTableRender.js";
60
- import { ttUploadProps as Co } from "./components/tt-upload/src/typing.js";
44
+ import { useShowModal as Xo } from "./components/tt-modal/src/index.js";
45
+ import { default as Zo } from "./directives/disabled-tip/index.js";
46
+ import { default as Jo } from "./directives/auto-tip/index.js";
47
+ import { showTtDrawer as Qo, useDrawerRender as Wo } from "./components/tt-drawer/src/hooks/useDrawerRender.js";
48
+ import { useDrawerResizable as rr } from "./components/tt-drawer/src/hooks/useResizable.js";
49
+ import { showTtModal as tr, useModalRender as mr } from "./components/tt-modal/src/hooks/useModalRender.js";
50
+ import { closeAllTtModal as ar, closeTtModal as fr, openTtModal as sr, ttModal as dr } from "./components/tt-modal/src/utils/modal-service.js";
51
+ import { default as lr } from "./directives/dialog-resize/index.js";
52
+ import * as ro from "zod";
53
+ import { useGroupForm as xr } from "./components/tt-form/src/group-form/useGroupForm.js";
54
+ import { COMPONENT_MAP as nr } from "./components/tt-form/src/config.js";
55
+ import { useForm as Mr } from "./components/tt-form/src/useForm.js";
56
+ import { TtImageViewer as wr } from "./components/tt-image/src/components/ImageViewer.js";
57
+ import { vTtLoading as hr } from "./components/tt-loading/src/directive.js";
58
+ import { Loading as Ar } from "./components/tt-loading/src/service.js";
59
+ import { useTableContext as Sr, useTableFormContext as Cr } from "./components/tt-table/src/hooks/useTableContext.js";
60
+ import { useTableFormRender as Ir, useTableRender as Fr } from "./components/tt-table/src/hooks/useTableRender.js";
61
+ import { ttUploadProps as Lr } from "./components/tt-upload/src/typing.js";
61
62
  const I = [
62
63
  p,
63
- l,
64
+ n,
64
65
  c,
65
- u,
66
- b,
66
+ l,
67
+ M,
67
68
  f,
68
- w,
69
+ b,
69
70
  a,
70
- d,
71
- n,
71
+ i,
72
+ T,
73
+ w,
72
74
  R,
73
- h,
75
+ u,
74
76
  x,
75
- T,
76
- g,
77
+ h,
78
+ A,
77
79
  P,
78
- S,
79
- A
80
- ], F = (r) => {
81
- I.forEach((o) => r.use(o)), Object.keys(e).forEach((o) => {
82
- const t = e[o], m = o.replace(/([A-Z])/g, "-$1").toLowerCase();
83
- r.directive(m, t);
84
- }), C(r), D(r);
80
+ S
81
+ ], F = (o) => {
82
+ I.forEach((r) => o.use(r)), Object.keys(e).forEach((r) => {
83
+ const t = e[r], m = r.replace(/([A-Z])/g, "-$1").toLowerCase();
84
+ o.directive(m, t);
85
+ }), C(o), D(o);
85
86
  };
86
- function er(r) {
87
- s(r == null ? void 0 : r.components), i(r == null ? void 0 : r.defineRules, r == null ? void 0 : r.modelPropNameMap);
87
+ function eo(o) {
88
+ s(o == null ? void 0 : o.components), d(o == null ? void 0 : o.defineRules, o == null ? void 0 : o.modelPropNameMap);
88
89
  }
89
- const tr = {
90
+ const to = {
90
91
  /**
91
92
  * 安装组件
92
93
  * @param app Vue 应用实例
@@ -97,73 +98,77 @@ const tr = {
97
98
  * @param options 全局参数
98
99
  * @returns 合并后的全局参数
99
100
  */
100
- setup: M
101
+ setup: g
101
102
  };
102
103
  export {
103
- Or as CODES,
104
- io as COMPONENT_MAP,
105
- Lr as GROUP_BY,
106
- wo as Loading,
107
- l as RenderDrawer,
104
+ Lo as CODES,
105
+ nr as COMPONENT_MAP,
106
+ Eo as GROUP_BY,
107
+ Ar as Loading,
108
+ n as RenderDrawer,
108
109
  c as RenderModal,
109
- ar as TtAddButton,
110
- x as TtAddIcon,
111
- g as TtApiComponent,
112
- xr as TtArea,
110
+ ao as TtAddButton,
111
+ u as TtAddIcon,
112
+ h as TtApiComponent,
113
+ xo as TtArea,
113
114
  p as TtButton,
114
115
  a as TtCheckbox,
115
116
  f as TtEmpty,
116
- u as TtIcon,
117
- n as TtImage,
118
- no as TtImageViewer,
119
- cr as TtLoading,
120
- P as TtLog,
121
- sr as TtModal,
122
- h as TtNavAnchor,
123
- S as TtPanelSelect,
124
- A as TtRadioGroup,
125
- b as TtSelect,
126
- T as TtSubIcon,
127
- wr as TtTable,
128
- Rr as TtTableAction,
129
- hr as TtTableButton,
130
- w as TtText,
131
- R as TtUpload,
117
+ l as TtIcon,
118
+ T as TtImage,
119
+ wr as TtImageViewer,
120
+ Mo as TtLoading,
121
+ A as TtLog,
122
+ so as TtModal,
123
+ R as TtNavAnchor,
124
+ P as TtPanelSelect,
125
+ S as TtRadioGroup,
126
+ M as TtSelect,
127
+ x as TtSubIcon,
128
+ wo as TtTable,
129
+ Ro as TtTableAction,
130
+ ho as TtTableButton,
131
+ b as TtText,
132
+ w as TtUpload,
132
133
  s as addComponent,
133
- qr as autoTip,
134
- kr as createUppercaseInputProps,
135
- tr as default,
136
- po as dialogResize,
137
- Yr as disabledTip,
138
- er as formAdapter,
139
- i as setConfig,
140
- dr as setXHR,
134
+ Jo as autoTip,
135
+ ar as closeAllTtModal,
136
+ fr as closeTtModal,
137
+ Vo as createUppercaseInputProps,
138
+ to as default,
139
+ lr as dialogResize,
140
+ Zo as disabledTip,
141
+ eo as formAdapter,
142
+ sr as openTtModal,
143
+ d as setConfig,
144
+ lo as setXHR,
141
145
  C as setupDrawer,
142
146
  D as setupModal,
143
- Kr as showTtDrawer,
144
- eo as showTtModal,
145
- Vr as toUppercaseInputValue,
146
- Co as ttUploadProps,
147
- _r as uppercaseInputProps,
148
- Cr as useBasicDataOptions,
149
- Sr as useDataPermissionOptions,
150
- Qr as useDrawerRender,
151
- ro as useDrawerResizable,
152
- xo as useForm,
153
- Mr as useFormSchemasLink,
154
- Br as useFormat,
155
- fo as useGroupForm,
156
- vr as useLoading,
157
- nr as useModalForm,
158
- to as useModalRender,
159
- Ir as usePanelSelectSchemas,
160
- Nr as useScreenshotOss,
161
- jr as useShowDrawer,
162
- Hr as useShowModal,
163
- ho as useTableContext,
164
- go as useTableFormContext,
165
- Po as useTableFormRender,
166
- So as useTableRender,
167
- co as vTtLoading,
168
- or as z
147
+ Qo as showTtDrawer,
148
+ tr as showTtModal,
149
+ _o as toUppercaseInputValue,
150
+ dr as ttModal,
151
+ Lr as ttUploadProps,
152
+ $o as uppercaseInputProps,
153
+ Do as useBasicDataOptions,
154
+ So as useDataPermissionOptions,
155
+ Wo as useDrawerRender,
156
+ rr as useDrawerResizable,
157
+ Mr as useForm,
158
+ Ao as useFormSchemasLink,
159
+ Uo as useFormat,
160
+ xr as useGroupForm,
161
+ zo as useLoading,
162
+ no as useModalForm,
163
+ mr as useModalRender,
164
+ Fo as usePanelSelectSchemas,
165
+ Go as useScreenshotOss,
166
+ yo as useShowDrawer,
167
+ Xo as useShowModal,
168
+ Sr as useTableContext,
169
+ Cr as useTableFormContext,
170
+ Ir as useTableFormRender,
171
+ Fr as useTableRender,
172
+ hr as vTtLoading,
173
+ ro as z
169
174
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazhicheng/ui",
3
- "version": "1.6.19",
3
+ "version": "1.6.21",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",