@aplus-frontend/ui 6.38.0 → 6.39.0

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 (103) hide show
  1. package/es/index.mjs +108 -104
  2. package/es/src/ag-grid/hooks/use-columns-def.mjs +73 -71
  3. package/es/src/ag-grid/index.vue.mjs +201 -200
  4. package/es/src/ag-grid/interface.d.ts +14 -0
  5. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +72 -71
  6. package/es/src/ap-table/interface.d.ts +6 -0
  7. package/es/src/business/ag-grid-modal/constants.d.ts +4 -0
  8. package/es/src/business/ag-grid-modal/constants.mjs +6 -0
  9. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
  10. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +50 -0
  11. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
  12. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +58 -0
  13. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
  14. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +122 -0
  15. package/es/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
  16. package/es/src/business/ag-grid-modal/hooks/use-modal-title.mjs +49 -0
  17. package/es/src/business/ag-grid-modal/index.d.ts +2 -0
  18. package/es/src/business/ag-grid-modal/index.mjs +6 -0
  19. package/es/src/business/ag-grid-modal/interface.d.ts +130 -0
  20. package/es/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
  21. package/es/src/business/ag-grid-modal/modal-layout/index.vue.mjs +4 -0
  22. package/es/src/business/ag-grid-modal/modal-layout/index.vue2.mjs +102 -0
  23. package/es/src/business/ag-grid-modal/style/css.d.ts +0 -0
  24. package/es/src/business/ag-grid-modal/style/css.js +1 -0
  25. package/es/src/business/ag-grid-modal/style/index.d.ts +0 -0
  26. package/es/src/business/ag-grid-modal/style/index.js +1 -0
  27. package/es/src/business/ag-grid-modal/utils.d.ts +52 -0
  28. package/es/src/business/ag-grid-modal/utils.mjs +72 -0
  29. package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
  30. package/es/src/business/ag-grid-modal/wrapper/index.vue.mjs +4 -0
  31. package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -0
  32. package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
  33. package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
  34. package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
  35. package/es/src/business/ap-table-modal/index.d.ts +3 -0
  36. package/es/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
  37. package/es/src/business/hooks/usePageListApTable.d.ts +1 -0
  38. package/es/src/business/index.d.ts +1 -0
  39. package/es/src/business/index.mjs +55 -54
  40. package/es/src/index.mjs +78 -74
  41. package/es/src/path-map.mjs +3 -1
  42. package/es/src/version.d.ts +1 -1
  43. package/es/src/version.mjs +1 -1
  44. package/lib/index.js +1 -1
  45. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  46. package/lib/src/ag-grid/index.vue.js +1 -1
  47. package/lib/src/ag-grid/interface.d.ts +14 -0
  48. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
  49. package/lib/src/ap-table/interface.d.ts +6 -0
  50. package/lib/src/business/ag-grid-modal/constants.d.ts +4 -0
  51. package/lib/src/business/ag-grid-modal/constants.js +1 -0
  52. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
  53. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -0
  54. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
  55. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -0
  56. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
  57. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -0
  58. package/lib/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
  59. package/lib/src/business/ag-grid-modal/hooks/use-modal-title.js +1 -0
  60. package/lib/src/business/ag-grid-modal/index.d.ts +2 -0
  61. package/lib/src/business/ag-grid-modal/index.js +1 -0
  62. package/lib/src/business/ag-grid-modal/interface.d.ts +130 -0
  63. package/lib/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
  64. package/lib/src/business/ag-grid-modal/modal-layout/index.vue.js +1 -0
  65. package/lib/src/business/ag-grid-modal/modal-layout/index.vue2.js +1 -0
  66. package/lib/src/business/ag-grid-modal/style/css.cjs +1 -0
  67. package/lib/src/business/ag-grid-modal/style/css.d.ts +0 -0
  68. package/lib/src/business/ag-grid-modal/style/index.cjs +1 -0
  69. package/lib/src/business/ag-grid-modal/style/index.d.ts +0 -0
  70. package/lib/src/business/ag-grid-modal/utils.d.ts +52 -0
  71. package/lib/src/business/ag-grid-modal/utils.js +1 -0
  72. package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
  73. package/lib/src/business/ag-grid-modal/wrapper/index.vue.js +1 -0
  74. package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -0
  75. package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
  76. package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
  77. package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
  78. package/lib/src/business/ap-table-modal/index.d.ts +3 -0
  79. package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
  80. package/lib/src/business/hooks/usePageListApTable.d.ts +1 -0
  81. package/lib/src/business/index.d.ts +1 -0
  82. package/lib/src/business/index.js +1 -1
  83. package/lib/src/index.js +1 -1
  84. package/lib/src/path-map.js +1 -1
  85. package/lib/src/version.d.ts +1 -1
  86. package/lib/src/version.js +1 -1
  87. package/package.json +1 -1
  88. package/theme/ag-grid/index.css +3 -0
  89. package/theme/ag-grid-modal/index.css +773 -0
  90. package/theme/ag-grid-modal/index.less +58 -0
  91. package/theme/ap-form/ap-form-item.css +3 -0
  92. package/theme/ap-form/ap-form-item.less +3 -0
  93. package/theme/ap-form/index.css +3 -0
  94. package/theme/ap-form/search-form.css +3 -0
  95. package/theme/ap-grid/index.css +3 -0
  96. package/theme/ap-table/ap-table.css +3 -0
  97. package/theme/ap-table-modal/index.css +3 -0
  98. package/theme/ap-upload/index.css +5 -0
  99. package/theme/ap-upload/multiple-file.css +5 -0
  100. package/theme/ap-upload/multiple-file.less +6 -0
  101. package/theme/editable-table/index.css +3 -0
  102. package/theme/index.css +54 -0
  103. package/theme/index.less +1 -0
@@ -0,0 +1,130 @@
1
+ import { StyleValue, VNodeChild } from 'vue';
2
+ import { AgGridColumnType, AgGridExpose, AgGridProps, AgGridSlots } from '../../ag-grid';
3
+ import { CreateModalFuncProps } from '../../ap-modal';
4
+ import { Recordable } from '../../type';
5
+ import { GridApi } from './hooks/use-ag-grid-instance';
6
+ export type GetRowKey<TableRowType> = ((record: TableRowType) => string | number) | string;
7
+ /** AgGridModal 基础类型 */
8
+ export interface AgGridModalBasicProps<TableRowType = any> {
9
+ title: VNodeChild;
10
+ width?: string | number;
11
+ modalProps?: Omit<CreateModalFuncProps, 'content'>;
12
+ columns: AgGridColumnType[];
13
+ getRowKey: GetRowKey<TableRowType>;
14
+ api?: (params: any) => Promise<RequestReturn<TableRowType>>;
15
+ /** 渲染头部信息 */
16
+ renderHeader?: (gridApi: Omit<GridApi, 'setInstance'>) => VNodeChild;
17
+ rowHeight?: number;
18
+ }
19
+ /** 刷新方式 */
20
+ export type RefreshType = 'reset' | 'submit' | 'submitWith';
21
+ /** 只读模式 */
22
+ export interface AgGridPreviewModalProps<RowType = any> extends AgGridModalBasicProps<RowType> {
23
+ /** ag-grid 插槽 */
24
+ gridSlots?: AgGridSlots<RowType>;
25
+ }
26
+ /** 只读模式返回值 */
27
+ export interface PreviewModalReturnType {
28
+ /** 打开弹框 */
29
+ open(opt?: OpenOptions): void;
30
+ /** 刷新表格数据 */
31
+ refresh: (type: RefreshType) => void;
32
+ /** 获取ag-grid实例 */
33
+ getAgGridInstance: () => AgGridExpose | undefined;
34
+ }
35
+ export interface OpenOptions {
36
+ /** 发起网络请求携带的额外参数 */
37
+ extraParams?: Recordable;
38
+ }
39
+ /** 可选模式 */
40
+ export interface AgGridSelectModalProps<RowType = any> extends AgGridModalBasicProps<RowType> {
41
+ /** ag-grid 插槽 */
42
+ gridSlots?: AgGridSlots<RowType>;
43
+ /**
44
+ * 选择模式
45
+ * - radio: 单选模式
46
+ * - checkbox: 多选模式
47
+ * @default 'checkbox'
48
+ */
49
+ mode?: 'radio' | 'checkbox';
50
+ /**
51
+ * 合并规则
52
+ * - old 老数据优先
53
+ * - new 新数据优先
54
+ * @default 'old'
55
+ */
56
+ mergeRule?: 'old' | 'new';
57
+ /** 点击确认后执行的回调 */
58
+ finishCallback?: (data: OpenReturnType<RowType>) => void;
59
+ /** 最多选择多少条 */
60
+ maxCount?: number;
61
+ /** 禁用选项 */
62
+ disabledCheckbox?: boolean | ((record: RowType, actions: Omit<GridApi, 'setInstance'>) => boolean);
63
+ /** 额外的rowSelection配置 */
64
+ rowSelection?: Omit<AgGridProps['rowSelection'], 'disabled'>;
65
+ /** modal标题插槽 */
66
+ modalTitleSlots?: ModalTitleSlots;
67
+ /** 在finishCallback执行前执行,返回reject终止后续执行 */
68
+ beforeOk?: (data: OpenReturnType<RowType>) => Promise<any> | void;
69
+ /** 设置是否是复杂布局 */
70
+ modalLayout?: ModalLayoutConfig<RowType>;
71
+ }
72
+ export interface SelectModalReturnType<T = any> {
73
+ /** 打开弹框 */
74
+ open: (selectRows?: T[], options?: OpenOptions, isAsync?: boolean) => Promise<OpenReturnType<T>> | undefined;
75
+ /** 异步打开弹框 */
76
+ asyncOpen: (selectRows?: T[], options?: OpenOptions) => Promise<OpenReturnType<T>>;
77
+ /** 刷新表格数据 */
78
+ refresh: (type?: RefreshType) => void;
79
+ /** 获取表格实例 */
80
+ getAgGridInstance: () => AgGridExpose | undefined;
81
+ /** 获取原子化内容 */
82
+ genContent: (selectedRows?: T[]) => VNodeChild;
83
+ /** 获取数据并校验 */
84
+ validate: () => Promise<OpenReturnType<T>>;
85
+ }
86
+ export interface RequestReturn<T = any> {
87
+ records: T[];
88
+ total: number;
89
+ }
90
+ /** open打开方法返回的值的类型 */
91
+ export interface OpenReturnType<RowType> {
92
+ keys: (string | number)[];
93
+ rows: RowType[];
94
+ }
95
+ /** modal-title slots */
96
+ export interface ModalTitleSlots {
97
+ /** 标题 suffix 插槽 */
98
+ default: (props: {
99
+ maxCount: number;
100
+ count: number;
101
+ }) => VNodeChild;
102
+ }
103
+ /** 弹框布局props */
104
+ export interface ModalLayoutProps {
105
+ /** 左侧标题 */
106
+ leftTitle?: string | VNodeChild;
107
+ /** 右侧内容样式 */
108
+ rightContentStyle?: StyleValue;
109
+ /** 中间分割线向上偏移量 */
110
+ dividerOffset?: number;
111
+ }
112
+ /** modal-layout配置 */
113
+ export interface ModalLayoutConfig<T = any> extends ModalLayoutProps {
114
+ /** 右侧标题插槽 */
115
+ rightTitle?: (selectedCount: number) => any;
116
+ /** 右侧底部插槽 */
117
+ rightBottom?: (props: {
118
+ records: T[];
119
+ actions: {
120
+ deleteItem: (record: T) => void;
121
+ };
122
+ }) => any;
123
+ /** 已经选择item渲染, 选择项渲染插槽 */
124
+ renderSelectedItem: (props: {
125
+ record: T;
126
+ actions: {
127
+ deleteItem: (record: T) => void;
128
+ };
129
+ }) => any;
130
+ }
@@ -0,0 +1,43 @@
1
+ import { ModalLayoutProps } from '../interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, VNodeArrayChildren, VNode, RendererNode, RendererElement, ComponentProvideOptions } from 'vue';
3
+ type __VLS_Props = ModalLayoutProps & {
4
+ layoutType?: 'two-column';
5
+ };
6
+ declare function __VLS_template(): {
7
+ attrs: Partial<{}>;
8
+ slots: {
9
+ default?(_: {}): any;
10
+ default?(_: {}): any;
11
+ rightTitle?(_: {
12
+ count: number;
13
+ }): any;
14
+ renderSelectedItem?(_: {
15
+ record: any;
16
+ actions: {
17
+ deleteItem: (record: any) => void;
18
+ };
19
+ }): any;
20
+ rightBottom?(_: {
21
+ records: any[];
22
+ actions: {
23
+ deleteItem: (record: any) => void;
24
+ };
25
+ }): any;
26
+ };
27
+ refs: {};
28
+ rootEl: any;
29
+ };
30
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
31
+ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
32
+ leftTitle: string | number | boolean | void | VNodeArrayChildren | VNode<RendererNode, RendererElement, {
33
+ [key: string]: any;
34
+ }> | null;
35
+ layoutType: "two-column";
36
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
37
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
38
+ export default _default;
39
+ type __VLS_WithTemplateSlots<T, S> = T & {
40
+ new (): {
41
+ $slots: S;
42
+ };
43
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,102 @@
1
+ import { defineComponent as B, computed as N, createElementBlock as y, renderSlot as r, openBlock as a, normalizeStyle as g, normalizeClass as n, unref as e, createElementVNode as i, createBlock as c, createCommentVNode as v, withCtx as s, resolveDynamicComponent as O, h as x, Fragment as h, createVNode as b, createTextVNode as S, toDisplayString as T, renderList as I } from "vue";
2
+ import "../../../config-provider/index.mjs";
3
+ import { ApTitle as k } from "../../ap-title/index.mjs";
4
+ import { Button as M, Empty as C } from "@aplus-frontend/antdv";
5
+ import { useAgGridModalInject as V } from "../hooks/use-ag-grid-instance.mjs";
6
+ import { useLocale as w } from "../../../config-provider/hooks/use-locale.mjs";
7
+ import { useNamespace as L } from "../../../config-provider/hooks/use-namespace.mjs";
8
+ const q = /* @__PURE__ */ B({
9
+ __name: "index",
10
+ props: {
11
+ leftTitle: { type: [String, Object, Number, Boolean, null, Array], default: "" },
12
+ rightContentStyle: { type: [Boolean, null, String, Object, Array] },
13
+ dividerOffset: {},
14
+ layoutType: { default: void 0 }
15
+ },
16
+ setup(E) {
17
+ const { t: p } = w(), d = V(), l = N(() => d?.selectedRows?.value || []), u = E, $ = () => {
18
+ if (console.log("props.dividerOffset", u), u.dividerOffset != null)
19
+ return {
20
+ "--ag-grid-modal-layout-divider-offset": `${u.dividerOffset}px`
21
+ };
22
+ }, A = () => {
23
+ d?.clearAllSelected();
24
+ }, m = (t) => {
25
+ d?.removeSelected(t);
26
+ }, { m: o } = L("ag-grid-modal");
27
+ return (t, j) => t.layoutType === "two-column" ? (a(), y("div", {
28
+ key: 0,
29
+ class: n(e(o)("table-layout")),
30
+ style: g($())
31
+ }, [
32
+ i("div", {
33
+ class: n(e(o)("table-layout-left"))
34
+ }, [
35
+ t.leftTitle ? (a(), c(e(k), {
36
+ key: 0,
37
+ style: { "margin-bottom": "16px" }
38
+ }, {
39
+ prefix: s(() => [
40
+ (a(), c(O(x(h, [t.leftTitle]))))
41
+ ]),
42
+ _: 1
43
+ })) : v("", !0),
44
+ i("div", {
45
+ class: n(e(o)("table-layout-left-content"))
46
+ }, [
47
+ r(t.$slots, "default")
48
+ ], 2)
49
+ ], 2),
50
+ i("div", {
51
+ class: n(e(o)("table-layout-right")),
52
+ style: g(t.rightContentStyle)
53
+ }, [
54
+ b(e(k), null, {
55
+ prefix: s(() => [
56
+ r(t.$slots, "rightTitle", {
57
+ count: l.value.length
58
+ }, () => [
59
+ S(T(`${e(p)("ap.apTableModal.selected")} (${l.value.length})`), 1)
60
+ ])
61
+ ]),
62
+ suffix: s(() => [
63
+ b(e(M), {
64
+ type: "link",
65
+ style: { padding: "0px", height: "22px", "border-width": "0px" },
66
+ onClick: A
67
+ }, {
68
+ default: s(() => [
69
+ S(T(e(p)("ap.apTableModal.clear")), 1)
70
+ ]),
71
+ _: 1
72
+ })
73
+ ]),
74
+ _: 3
75
+ }),
76
+ i("div", {
77
+ class: n(e(o)("table-layout-right-content"))
78
+ }, [
79
+ (a(!0), y(h, null, I(l.value, (f) => r(t.$slots, "renderSelectedItem", {
80
+ key: f,
81
+ record: f,
82
+ actions: { deleteItem: m }
83
+ })), 128)),
84
+ l.value.length === 0 ? (a(), c(e(C), {
85
+ key: 0,
86
+ image: e(C).PRESENTED_IMAGE_SIMPLE,
87
+ style: { "margin-top": "100px" }
88
+ }, null, 8, ["image"])) : v("", !0)
89
+ ], 2),
90
+ i("div", null, [
91
+ r(t.$slots, "rightBottom", {
92
+ records: l.value,
93
+ actions: { deleteItem: m }
94
+ })
95
+ ])
96
+ ], 6)
97
+ ], 6)) : r(t.$slots, "default", { key: 1 });
98
+ }
99
+ });
100
+ export {
101
+ q as default
102
+ };
File without changes
@@ -0,0 +1 @@
1
+ import '@aplus-frontend/ui/theme/ag-grid-modal/index.css';
File without changes
@@ -0,0 +1 @@
1
+ import '@aplus-frontend/ui/theme/ag-grid-modal/index.less';
@@ -0,0 +1,52 @@
1
+ import { Recordable } from '../../type';
2
+ import { GetRowKey, ModalLayoutConfig, RequestReturn } from './interface';
3
+ import { VNodeChild, StyleValue } from 'vue';
4
+ export declare function genRequest(api: ((params: any) => Promise<RequestReturn<any>>) | undefined, gerRowKey: GetRowKey<any>, callback?: (length: number) => void): {
5
+ request: (params: any) => Promise<{
6
+ data: any[];
7
+ total: number;
8
+ }>;
9
+ setExtraParams: (params?: Recordable) => void;
10
+ };
11
+ export declare function addRowKeyField(row: any, gerRowKey: GetRowKey<any>): any;
12
+ export declare function delRowKeyField(row: any): any;
13
+ /** 解析props */
14
+ export declare function getModalLayoutConfig(props?: ModalLayoutConfig): {
15
+ props: {
16
+ readonly layoutType: "two-column" | undefined;
17
+ readonly leftTitle?: string | VNodeChild;
18
+ readonly rightContentStyle?: StyleValue;
19
+ readonly dividerOffset?: number;
20
+ };
21
+ slots: {
22
+ renderSelectedItem: ((props: {
23
+ record: any;
24
+ actions: {
25
+ deleteItem: (record: any) => void;
26
+ };
27
+ }) => any) | undefined;
28
+ rightTitle: ((selectedCount: number) => any) | undefined;
29
+ rightBottom: ((props: {
30
+ records: any[];
31
+ actions: {
32
+ deleteItem: (record: any) => void;
33
+ };
34
+ }) => any) | undefined;
35
+ };
36
+ };
37
+ /**
38
+ * 异步回调
39
+ * buildPromise 构建异步回调
40
+ * resolve reject 兑现或拒绝回调
41
+ */
42
+ export declare class AsyncCallback<T = any> {
43
+ private p;
44
+ private operateFn;
45
+ constructor();
46
+ buildPromise(): Promise<T>;
47
+ clear(): void;
48
+ /** 兑现回调 */
49
+ resolve(data: T): void;
50
+ /** 拒绝回调 */
51
+ reject(error?: string): void;
52
+ }
@@ -0,0 +1,72 @@
1
+ import { ROW_KEY as a } from "./constants.mjs";
2
+ import { isFunction as p } from "lodash-unified";
3
+ function m(t, e, r) {
4
+ let n = null;
5
+ return { request: async (s) => {
6
+ const i = t;
7
+ if (!i)
8
+ return r?.(0), {
9
+ data: [],
10
+ total: 0
11
+ };
12
+ n && (s = Object.assign(s, n));
13
+ const { records: l, total: u } = await i(Object.assign({}, s));
14
+ return r?.(l.length || 0), {
15
+ data: l.map((c) => h(c, e)),
16
+ total: u
17
+ };
18
+ }, setExtraParams: (s) => {
19
+ n = s || null;
20
+ } };
21
+ }
22
+ function h(t, e) {
23
+ return p(e) ? {
24
+ ...t,
25
+ [a]: e(t)
26
+ } : t;
27
+ }
28
+ function g(t) {
29
+ return Reflect.deleteProperty(t, a), t;
30
+ }
31
+ function y(t) {
32
+ const { renderSelectedItem: e, rightTitle: r, rightBottom: n, ...o } = t || {};
33
+ return console.log("props", o), {
34
+ props: { ...o, layoutType: t && "two-column" },
35
+ slots: {
36
+ renderSelectedItem: e,
37
+ rightTitle: r,
38
+ rightBottom: n
39
+ }
40
+ };
41
+ }
42
+ class P {
43
+ constructor() {
44
+ this.p = null, this.operateFn = null;
45
+ }
46
+ buildPromise() {
47
+ return this.operateFn && this.operateFn.reject("reuse"), this.p = new Promise((e, r) => {
48
+ this.operateFn = {
49
+ reject: r,
50
+ resolve: e
51
+ };
52
+ }), this.p;
53
+ }
54
+ clear() {
55
+ this.p = null, this.operateFn = null;
56
+ }
57
+ /** 兑现回调 */
58
+ resolve(e) {
59
+ this.operateFn && (this.operateFn.resolve(e), this.clear());
60
+ }
61
+ /** 拒绝回调 */
62
+ reject(e) {
63
+ this.operateFn && (this.operateFn.reject(e), this.clear());
64
+ }
65
+ }
66
+ export {
67
+ P as AsyncCallback,
68
+ h as addRowKeyField,
69
+ g as delRowKeyField,
70
+ m as genRequest,
71
+ y as getModalLayoutConfig
72
+ };
@@ -0,0 +1,23 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ type __VLS_Props = {
3
+ rowHeight?: number;
4
+ };
5
+ declare function __VLS_template(): {
6
+ attrs: Partial<{}>;
7
+ slots: {
8
+ default?(_: {}): any;
9
+ };
10
+ refs: {};
11
+ rootEl: HTMLDivElement;
12
+ };
13
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
+ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
15
+ rowHeight: number;
16
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
17
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
18
+ export default _default;
19
+ type __VLS_WithTemplateSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,25 @@
1
+ import { defineComponent as c, computed as t, createElementBlock as u, openBlock as s, normalizeStyle as d, unref as m, renderSlot as p } from "vue";
2
+ import { LARGER_HEIGHT as f, SMALL_HEIGHT as o } from "../constants.mjs";
3
+ import { useAgGridModalInject as h } from "../hooks/use-ag-grid-instance.mjs";
4
+ const v = /* @__PURE__ */ c({
5
+ __name: "index",
6
+ props: {
7
+ rowHeight: { default: 40 }
8
+ },
9
+ setup(r) {
10
+ const n = r, i = h(), l = t(() => i?.dataSourceLength?.value || 0), a = t(() => l.value * n.rowHeight > 400 ? f : o);
11
+ return (e, g) => (s(), u("div", {
12
+ style: d({
13
+ minHeight: m(o),
14
+ height: a.value,
15
+ display: "flex",
16
+ flexDirection: "column"
17
+ })
18
+ }, [
19
+ p(e.$slots, "default")
20
+ ], 4));
21
+ }
22
+ });
23
+ export {
24
+ v as default
25
+ };
@@ -11,6 +11,7 @@ export declare function useCreateTableModal(props: UseCreateTableModalProps): {
11
11
  readonly resetApTableData: () => void;
12
12
  readonly getApTableInstance: () => {
13
13
  submit: () => void;
14
+ submitWith: (resetCurrent?: boolean) => void;
14
15
  reset: () => void;
15
16
  refresh: () => void;
16
17
  setSearchFormValues: (fields: Partial< Recordable>) => void;
@@ -9,6 +9,7 @@ export declare function useTableModal<TableRowType = Record<string, any>>(props:
9
9
  resetApTableData: () => void;
10
10
  getApTableInstance: () => {
11
11
  submit: () => void;
12
+ submitWith: (resetCurrent?: boolean) => void;
12
13
  reset: () => void;
13
14
  refresh: () => void;
14
15
  setSearchFormValues: (fields: Partial< Recordable>) => void;
@@ -8,6 +8,7 @@ export declare function useTableSelectModal<TableRowType = Record<string, any>>(
8
8
  resetApTableData: () => void;
9
9
  getApTableInstance: () => {
10
10
  submit: () => void;
11
+ submitWith: (resetCurrent?: boolean) => void;
11
12
  reset: () => void;
12
13
  refresh: () => void;
13
14
  setSearchFormValues: (fields: Partial< Recordable>) => void;
@@ -17,6 +17,7 @@ declare const ApTableModal: {
17
17
  close: () => void;
18
18
  getApTableInstance: () => {
19
19
  submit: () => void;
20
+ submitWith: (resetCurrent?: boolean) => void;
20
21
  reset: () => void;
21
22
  refresh: () => void;
22
23
  setSearchFormValues: (fields: Partial< Recordable>) => void;
@@ -128,6 +129,7 @@ declare const ApTableModal: {
128
129
  close: () => void;
129
130
  getApTableInstance: () => {
130
131
  submit: () => void;
132
+ submitWith: (resetCurrent?: boolean) => void;
131
133
  reset: () => void;
132
134
  refresh: () => void;
133
135
  setSearchFormValues: (fields: Partial< Recordable>) => void;
@@ -193,6 +195,7 @@ declare const ApTableModal: {
193
195
  close: () => void;
194
196
  getApTableInstance: () => {
195
197
  submit: () => void;
198
+ submitWith: (resetCurrent?: boolean) => void;
196
199
  reset: () => void;
197
200
  refresh: () => void;
198
201
  setSearchFormValues: (fields: Partial< Recordable>) => void;
@@ -10,6 +10,7 @@ declare const _default: DefineComponent<__VLS_Props, {
10
10
  close: () => void;
11
11
  getApTableInstance: () => {
12
12
  submit: () => void;
13
+ submitWith: (resetCurrent?: boolean) => void;
13
14
  reset: () => void;
14
15
  refresh: () => void;
15
16
  setSearchFormValues: (fields: Partial< Recordable>) => void;
@@ -35,6 +35,7 @@ export declare function usePageListApTable(props?: UsePageListApTable): [ApTable
35
35
  getSearchFormValues: (transform?: boolean) => any;
36
36
  getApTableInstance: () => {
37
37
  submit: () => void;
38
+ submitWith: (resetCurrent?: boolean) => void;
38
39
  reset: () => void;
39
40
  refresh: () => void;
40
41
  setSearchFormValues: (fields: Partial< Recordable>) => void;
@@ -27,3 +27,4 @@ export * from './ap-keep-alive';
27
27
  export * from './ap-draggable-grid';
28
28
  export * from './ap-value-select-card';
29
29
  export { ApTransformDataHelper } from '../utils/ap-trans-data';
30
+ export * from './ag-grid-modal';
@@ -1,59 +1,60 @@
1
- import { default as m } from "./ap-table-modal/index.mjs";
2
- import { ApAttachment as f } from "./ap-attachment/index.mjs";
3
- import { ApBatchAction as a } from "./ap-batch-action/index.mjs";
4
- import { ApBatchActionGroup as i } from "./ap-batch-action-group/index.mjs";
5
- import { ApButtonGroup as d } from "./ap-button-group/index.mjs";
6
- import { ApCard as c } from "./ap-card/index.mjs";
7
- import { ApExpandAlert as S } from "./ap-expand-alert/index.mjs";
8
- import { ApExportGroup as s } from "./ap-export-group/index.mjs";
9
- import { ApImage as L } from "./ap-image/index.mjs";
10
- import { ApInputRadio as h } from "./ap-input-radio/index.mjs";
11
- import { ApLabel as B, ApLabelGroup as C } from "./ap-label/index.mjs";
12
- import { ApLadder as D } from "./ap-ladder/index.mjs";
13
- import { ApSelectLayout as R } from "./ap-select-layout/index.mjs";
14
- import { ApStatus as v, ApStatusGroup as w } from "./ap-status/index.mjs";
15
- import { ApTitle as H } from "./ap-title/index.mjs";
1
+ import { default as A } from "./ap-table-modal/index.mjs";
2
+ import { ApAttachment as x } from "./ap-attachment/index.mjs";
3
+ import { ApBatchAction as u } from "./ap-batch-action/index.mjs";
4
+ import { ApBatchActionGroup as l } from "./ap-batch-action-group/index.mjs";
5
+ import { ApButtonGroup as n } from "./ap-button-group/index.mjs";
6
+ import { ApCard as G } from "./ap-card/index.mjs";
7
+ import { ApExpandAlert as b } from "./ap-expand-alert/index.mjs";
8
+ import { ApExportGroup as I } from "./ap-export-group/index.mjs";
9
+ import { ApImage as g } from "./ap-image/index.mjs";
10
+ import { ApInputRadio as y } from "./ap-input-radio/index.mjs";
11
+ import { ApLabel as C, ApLabelGroup as T } from "./ap-label/index.mjs";
12
+ import { ApLadder as E } from "./ap-ladder/index.mjs";
13
+ import { ApSelectLayout as V } from "./ap-select-layout/index.mjs";
14
+ import { ApStatus as w, ApStatusGroup as z } from "./ap-status/index.mjs";
15
+ import { ApTitle as K } from "./ap-title/index.mjs";
16
16
  import "./hooks/index.mjs";
17
- import { ApSummary as M } from "./ap-summary/index.mjs";
18
- import { ApAppendix as j } from "./ap-appendix/index.mjs";
17
+ import { ApSummary as P } from "./ap-summary/index.mjs";
18
+ import { ApAppendix as k } from "./ap-appendix/index.mjs";
19
19
  import "./ap-upload-file/index.mjs";
20
20
  import "./batch-input-group/index.mjs";
21
- import { ApSizeInput as q } from "./ap-size-input/index.mjs";
22
- import { ApProductInfo as J } from "./ap-product-info/index.mjs";
23
- import { ApCopy as O } from "./ap-copy/index.mjs";
24
- import { ApView as U } from "./ap-view/index.mjs";
25
- import { ApRadioGroup as X } from "./ap-radio-group/index.mjs";
26
- import { ApKeepAlive as Z } from "./ap-keep-alive/index.mjs";
27
- import { ApDraggableGrid as $ } from "./ap-draggable-grid/index.mjs";
28
- import { ApValueSelectCard as ro } from "./ap-value-select-card/index.mjs";
29
- import { ApTransformDataHelper as to } from "../utils/ap-trans-data/index.mjs";
21
+ import { ApSizeInput as F } from "./ap-size-input/index.mjs";
22
+ import { ApProductInfo as N } from "./ap-product-info/index.mjs";
23
+ import { ApCopy as Q } from "./ap-copy/index.mjs";
24
+ import { ApView as W } from "./ap-view/index.mjs";
25
+ import { ApRadioGroup as Y } from "./ap-radio-group/index.mjs";
26
+ import { ApKeepAlive as _ } from "./ap-keep-alive/index.mjs";
27
+ import { ApDraggableGrid as oo } from "./ap-draggable-grid/index.mjs";
28
+ import { ApValueSelectCard as po } from "./ap-value-select-card/index.mjs";
29
+ import { ApTransformDataHelper as eo } from "../utils/ap-trans-data/index.mjs";
30
+ import "./ag-grid-modal/index.mjs";
30
31
  export {
31
- j as ApAppendix,
32
- f as ApAttachment,
33
- a as ApBatchAction,
34
- i as ApBatchActionGroup,
35
- d as ApButtonGroup,
36
- c as ApCard,
37
- O as ApCopy,
38
- $ as ApDraggableGrid,
39
- S as ApExpandAlert,
40
- s as ApExportGroup,
41
- L as ApImage,
42
- h as ApInputRadio,
43
- Z as ApKeepAlive,
44
- B as ApLabel,
45
- C as ApLabelGroup,
46
- D as ApLadder,
47
- J as ApProductInfo,
48
- X as ApRadioGroup,
49
- R as ApSelectLayout,
50
- q as ApSizeInput,
51
- v as ApStatus,
52
- w as ApStatusGroup,
53
- M as ApSummary,
54
- m as ApTableModal,
55
- H as ApTitle,
56
- to as ApTransformDataHelper,
57
- ro as ApValueSelectCard,
58
- U as ApView
32
+ k as ApAppendix,
33
+ x as ApAttachment,
34
+ u as ApBatchAction,
35
+ l as ApBatchActionGroup,
36
+ n as ApButtonGroup,
37
+ G as ApCard,
38
+ Q as ApCopy,
39
+ oo as ApDraggableGrid,
40
+ b as ApExpandAlert,
41
+ I as ApExportGroup,
42
+ g as ApImage,
43
+ y as ApInputRadio,
44
+ _ as ApKeepAlive,
45
+ C as ApLabel,
46
+ T as ApLabelGroup,
47
+ E as ApLadder,
48
+ N as ApProductInfo,
49
+ Y as ApRadioGroup,
50
+ V as ApSelectLayout,
51
+ F as ApSizeInput,
52
+ w as ApStatus,
53
+ z as ApStatusGroup,
54
+ P as ApSummary,
55
+ A as ApTableModal,
56
+ K as ApTitle,
57
+ eo as ApTransformDataHelper,
58
+ po as ApValueSelectCard,
59
+ W as ApView
59
60
  };