@aplus-frontend/ui 7.0.0-beta.3 → 7.0.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.
- package/es/src/ag-grid/hooks/use-columns-def.mjs +71 -70
- package/es/src/ag-grid/index.vue.mjs +1 -0
- package/es/src/ag-grid/interface.d.ts +1 -0
- package/es/src/ag-grid/style/custom-header.d.ts +2 -2
- package/es/src/ag-grid/style/editable.d.ts +2 -2
- package/es/src/ag-grid/style/index.d.ts +2 -2
- package/es/src/ap-action/item-dropdown/index.vue.mjs +18 -17
- package/es/src/ap-action/style/dropdown-item.d.ts +2 -2
- package/es/src/ap-action/style/index.d.ts +2 -2
- package/es/src/ap-button/style/index.d.ts +2 -2
- package/es/src/ap-button/utils/index.mjs +16 -16
- package/es/src/ap-descriptions/style/index.d.ts +2 -2
- package/es/src/ap-download/ap-download.vue.d.ts +4 -4
- package/es/src/ap-download/ap-download.vue.mjs +27 -27
- package/es/src/ap-download/interface.d.ts +4 -0
- package/es/src/ap-download/style/index.d.ts +2 -2
- package/es/src/ap-drawer/style/index.d.ts +2 -2
- package/es/src/ap-field/style/index.d.ts +2 -2
- package/es/src/ap-form/style/drawer-form.d.ts +2 -2
- package/es/src/ap-form/style/item-group.d.ts +2 -2
- package/es/src/ap-form/style/item-text-group.d.ts +2 -2
- package/es/src/ap-form/style/item.d.ts +2 -2
- package/es/src/ap-form/style/modal-form.d.ts +2 -2
- package/es/src/ap-form/style/search-form-sorter.d.ts +2 -2
- package/es/src/ap-form/style/search-form.d.ts +2 -2
- package/es/src/ap-grid/style/editable.d.ts +2 -2
- package/es/src/ap-grid/style/index.d.ts +2 -2
- package/es/src/ap-grid/utils/col.mjs +33 -33
- package/es/src/ap-list/style/index.d.ts +2 -2
- package/es/src/ap-modal/interface.d.ts +31 -11
- package/es/src/ap-modal/utils/createModal.mjs +52 -45
- package/es/src/ap-pro-card/style/divider.d.ts +2 -2
- package/es/src/ap-pro-card/style/index.d.ts +2 -2
- package/es/src/ap-pro-card/style/operation.d.ts +2 -2
- package/es/src/ap-pro-card/style/statistic.d.ts +2 -2
- package/es/src/ap-pro-card/style/statistics-card.d.ts +2 -2
- package/es/src/ap-pro-card/style/title.d.ts +2 -2
- package/es/src/ap-table/style/ellipsis.d.ts +2 -2
- package/es/src/ap-table/style/index-comp.d.ts +2 -2
- package/es/src/ap-table/style/index.d.ts +2 -2
- package/es/src/ap-table/style/setting.d.ts +2 -2
- package/es/src/ap-tag/style/group.d.ts +2 -2
- package/es/src/ap-tag/style/index.d.ts +2 -2
- package/es/src/ap-upload/style/index.d.ts +2 -2
- package/es/src/business/ag-grid-modal/style/index.d.ts +2 -2
- package/es/src/business/ag-grid-modal/style/selected-items.d.ts +2 -2
- package/es/src/business/ag-grid-modal/utils.mjs +23 -23
- package/es/src/business/ap-appendix/style/index.d.ts +3 -3
- package/es/src/business/ap-appendix/style/index.mjs +1 -1
- package/es/src/business/ap-attachment/ApAttachment.mjs +70 -66
- package/es/src/business/ap-attachment/style/index.d.ts +2 -2
- package/es/src/business/ap-batch-action/style/index.d.ts +3 -3
- package/es/src/business/ap-batch-action/style/index.mjs +1 -1
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +50 -56
- package/es/src/business/ap-batch-action-group/style/index.d.ts +3 -0
- package/es/src/business/ap-batch-action-group/style/index.mjs +14 -0
- package/es/src/business/ap-card/style/index.d.ts +3 -3
- package/es/src/business/ap-card/style/index.mjs +8 -8
- package/es/src/business/ap-copy/style/index.d.ts +2 -2
- package/es/src/business/ap-draggable-grid/style/index.d.ts +2 -2
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +3 -2
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +57 -49
- package/es/src/business/ap-expand-alert/index.d.ts +5 -2
- package/es/src/business/ap-expand-alert/interface.d.ts +1 -1
- package/es/src/business/ap-expand-alert/style/index.d.ts +2 -2
- package/es/src/business/ap-image/style/index.d.ts +3 -3
- package/es/src/business/ap-image/style/index.mjs +6 -6
- package/es/src/business/ap-input-radio/style/index.d.ts +2 -2
- package/es/src/business/ap-label/style/index.d.ts +2 -2
- package/es/src/business/ap-ladder/style/index.d.ts +2 -2
- package/es/src/business/ap-product-info/style/index.d.ts +2 -2
- package/es/src/business/ap-radio-group/style/index.d.ts +2 -2
- package/es/src/business/ap-select-layout/style/index.d.ts +2 -2
- package/es/src/business/ap-size-input/style/index.d.ts +2 -2
- package/es/src/business/ap-status/style/index.d.ts +2 -2
- package/es/src/business/ap-summary/style/index.d.ts +2 -2
- package/es/src/business/ap-table-modal/style/index.d.ts +2 -2
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +23 -23
- package/es/src/business/ap-title/style/index.d.ts +2 -2
- package/es/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +2 -2
- package/es/src/business/ap-value-select-card/style/index.d.ts +2 -2
- package/es/src/business/ap-view/style/index.d.ts +3 -3
- package/es/src/business/ap-view/style/index.mjs +1 -1
- package/es/src/business/batch-input-group/style/index.d.ts +2 -2
- package/es/src/business/hooks/usePageListAgGrid.mjs +7 -6
- package/es/src/check-card/style/index.d.ts +2 -2
- package/es/src/editable-table/style/index.d.ts +2 -2
- package/es/src/full-screen/style/index.d.ts +2 -2
- package/es/src/mask/style/index.d.ts +2 -2
- package/es/src/scroll-bar/style/index.d.ts +2 -2
- package/es/src/scroll-view/style/index.d.ts +2 -2
- package/es/src/splitter/style/index.d.ts +2 -2
- package/es/src/text/style/group.d.ts +2 -2
- package/es/src/text/style/index.d.ts +2 -2
- package/es/src/utils/cssinjs/index.d.ts +2 -2
- package/es/src/utils/cssinjs/index.mjs +41 -35
- package/es/src/utils/cssinjs/plugin-specificity.mjs +13 -0
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +1 -0
- package/lib/src/ag-grid/style/custom-header.d.ts +2 -2
- package/lib/src/ag-grid/style/editable.d.ts +2 -2
- package/lib/src/ag-grid/style/index.d.ts +2 -2
- package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
- package/lib/src/ap-action/style/dropdown-item.d.ts +2 -2
- package/lib/src/ap-action/style/index.d.ts +2 -2
- package/lib/src/ap-button/style/index.d.ts +2 -2
- package/lib/src/ap-button/utils/index.js +1 -1
- package/lib/src/ap-descriptions/style/index.d.ts +2 -2
- package/lib/src/ap-download/ap-download.vue.d.ts +4 -4
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-download/interface.d.ts +4 -0
- package/lib/src/ap-download/style/index.d.ts +2 -2
- package/lib/src/ap-drawer/style/index.d.ts +2 -2
- package/lib/src/ap-field/style/index.d.ts +2 -2
- package/lib/src/ap-form/style/drawer-form.d.ts +2 -2
- package/lib/src/ap-form/style/item-group.d.ts +2 -2
- package/lib/src/ap-form/style/item-text-group.d.ts +2 -2
- package/lib/src/ap-form/style/item.d.ts +2 -2
- package/lib/src/ap-form/style/modal-form.d.ts +2 -2
- package/lib/src/ap-form/style/search-form-sorter.d.ts +2 -2
- package/lib/src/ap-form/style/search-form.d.ts +2 -2
- package/lib/src/ap-grid/style/editable.d.ts +2 -2
- package/lib/src/ap-grid/style/index.d.ts +2 -2
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/ap-list/style/index.d.ts +2 -2
- package/lib/src/ap-modal/interface.d.ts +31 -11
- package/lib/src/ap-modal/utils/createModal.js +1 -1
- package/lib/src/ap-pro-card/style/divider.d.ts +2 -2
- package/lib/src/ap-pro-card/style/index.d.ts +2 -2
- package/lib/src/ap-pro-card/style/operation.d.ts +2 -2
- package/lib/src/ap-pro-card/style/statistic.d.ts +2 -2
- package/lib/src/ap-pro-card/style/statistics-card.d.ts +2 -2
- package/lib/src/ap-pro-card/style/title.d.ts +2 -2
- package/lib/src/ap-table/style/ellipsis.d.ts +2 -2
- package/lib/src/ap-table/style/index-comp.d.ts +2 -2
- package/lib/src/ap-table/style/index.d.ts +2 -2
- package/lib/src/ap-table/style/setting.d.ts +2 -2
- package/lib/src/ap-tag/style/group.d.ts +2 -2
- package/lib/src/ap-tag/style/index.d.ts +2 -2
- package/lib/src/ap-upload/style/index.d.ts +2 -2
- package/lib/src/business/ag-grid-modal/style/index.d.ts +2 -2
- package/lib/src/business/ag-grid-modal/style/selected-items.d.ts +2 -2
- package/lib/src/business/ag-grid-modal/utils.js +1 -1
- package/lib/src/business/ap-appendix/style/index.d.ts +3 -3
- package/lib/src/business/ap-appendix/style/index.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/style/index.d.ts +2 -2
- package/lib/src/business/ap-batch-action/style/index.d.ts +3 -3
- package/lib/src/business/ap-batch-action/style/index.js +1 -1
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
- package/lib/src/business/ap-batch-action-group/style/index.d.ts +3 -0
- package/lib/src/business/ap-batch-action-group/style/index.js +1 -0
- package/lib/src/business/ap-card/style/index.d.ts +3 -3
- package/lib/src/business/ap-card/style/index.js +1 -1
- package/lib/src/business/ap-copy/style/index.d.ts +2 -2
- package/lib/src/business/ap-draggable-grid/style/index.d.ts +2 -2
- package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +3 -2
- package/lib/src/business/ap-expand-alert/ApExpandAlert.vue2.js +1 -1
- package/lib/src/business/ap-expand-alert/index.d.ts +5 -2
- package/lib/src/business/ap-expand-alert/interface.d.ts +1 -1
- package/lib/src/business/ap-expand-alert/style/index.d.ts +2 -2
- package/lib/src/business/ap-image/style/index.d.ts +3 -3
- package/lib/src/business/ap-image/style/index.js +1 -1
- package/lib/src/business/ap-input-radio/style/index.d.ts +2 -2
- package/lib/src/business/ap-label/style/index.d.ts +2 -2
- package/lib/src/business/ap-ladder/style/index.d.ts +2 -2
- package/lib/src/business/ap-product-info/style/index.d.ts +2 -2
- package/lib/src/business/ap-radio-group/style/index.d.ts +2 -2
- package/lib/src/business/ap-select-layout/style/index.d.ts +2 -2
- package/lib/src/business/ap-size-input/style/index.d.ts +2 -2
- package/lib/src/business/ap-status/style/index.d.ts +2 -2
- package/lib/src/business/ap-summary/style/index.d.ts +2 -2
- package/lib/src/business/ap-table-modal/style/index.d.ts +2 -2
- package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
- package/lib/src/business/ap-title/style/index.d.ts +2 -2
- package/lib/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +2 -2
- package/lib/src/business/ap-value-select-card/style/index.d.ts +2 -2
- package/lib/src/business/ap-view/style/index.d.ts +3 -3
- package/lib/src/business/ap-view/style/index.js +1 -1
- package/lib/src/business/batch-input-group/style/index.d.ts +2 -2
- package/lib/src/business/hooks/usePageListAgGrid.js +1 -1
- package/lib/src/check-card/style/index.d.ts +2 -2
- package/lib/src/editable-table/style/index.d.ts +2 -2
- package/lib/src/full-screen/style/index.d.ts +2 -2
- package/lib/src/mask/style/index.d.ts +2 -2
- package/lib/src/scroll-bar/style/index.d.ts +2 -2
- package/lib/src/scroll-view/style/index.d.ts +2 -2
- package/lib/src/splitter/style/index.d.ts +2 -2
- package/lib/src/text/style/group.d.ts +2 -2
- package/lib/src/text/style/index.d.ts +2 -2
- package/lib/src/utils/cssinjs/index.d.ts +2 -2
- package/lib/src/utils/cssinjs/index.js +1 -1
- package/lib/src/utils/cssinjs/plugin-specificity.js +1 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export type ScrollbarToken = {
|
|
4
4
|
/**
|
|
5
5
|
* 滚动条滑块颜色
|
|
@@ -23,5 +23,5 @@ export type ScrollbarToken = {
|
|
|
23
23
|
scrollBarTrackWidth: number;
|
|
24
24
|
};
|
|
25
25
|
export declare const genScrollbarStyle: GenStyleFunc<ScrollbarToken>;
|
|
26
|
-
declare const _default: (prefixCls: string) =>
|
|
26
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
27
27
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export declare const genScrollViewStyle: GenStyleFunc;
|
|
4
|
-
declare const _default: (prefixCls: string) =>
|
|
4
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export type SplitterToken = {
|
|
4
4
|
/**
|
|
5
5
|
* 拖拽元素大小
|
|
@@ -15,5 +15,5 @@ export type SplitterToken = {
|
|
|
15
15
|
splitterSplitBarDraggableSize: number;
|
|
16
16
|
};
|
|
17
17
|
export declare const genSplitterStyle: GenStyleFunc<SplitterToken>;
|
|
18
|
-
declare const _default: (prefixCls: string) =>
|
|
18
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
19
19
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export declare const genApTextGroupStyle: GenStyleFunc;
|
|
4
|
-
declare const _default: (prefixCls: string) =>
|
|
4
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
5
5
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export type ApTextToken = {
|
|
4
4
|
apTextColonMarginInline: number | string;
|
|
5
5
|
};
|
|
6
6
|
export declare const genApTextStyle: GenStyleFunc<ApTextToken>;
|
|
7
|
-
declare const _default: (prefixCls: string) =>
|
|
7
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
8
8
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { BaseToken, GenStyleCallback } from '../../design-token/interface';
|
|
2
2
|
import { GeneraterOption } from './utils';
|
|
3
|
-
import {
|
|
4
|
-
export declare function genComponentStyleHook<ComponentToken>(componentName: string, cb: GenStyleCallback<BaseToken & ComponentToken>, componentToken?: Partial<ComponentToken>, option?: GeneraterOption): (prefixCls: string) =>
|
|
3
|
+
import { ComputedRef } from 'vue';
|
|
4
|
+
export declare function genComponentStyleHook<ComponentToken>(componentName: string, cb: GenStyleCallback<BaseToken & ComponentToken>, componentToken?: Partial<ComponentToken>, option?: GeneraterOption): (prefixCls: string) => ComputedRef<string>;
|
|
@@ -1,61 +1,67 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { injectGlobal as
|
|
3
|
-
import
|
|
1
|
+
import { ref as k, computed as l, watch as v } from "vue";
|
|
2
|
+
import { injectGlobal as $, cx as g } from "@emotion/css";
|
|
3
|
+
import y from "@emotion/css/create-instance";
|
|
4
|
+
import { useToken as T } from "../../config-provider/hooks/use-token.mjs";
|
|
4
5
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { camelToKebab as
|
|
6
|
-
import { omit as
|
|
7
|
-
import { css as
|
|
8
|
-
import {
|
|
9
|
-
|
|
6
|
+
import { camelToKebab as S, generateCssVar as b } from "./utils.mjs";
|
|
7
|
+
import { omit as V, merge as h, cloneDeep as j } from "lodash-unified";
|
|
8
|
+
import { css as w } from "./instance.mjs";
|
|
9
|
+
import { downSpecificityPlugin as A } from "./plugin-specificity.mjs";
|
|
10
|
+
import { useGlobalConfig as G } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
|
+
const { css: I } = y({
|
|
12
|
+
key: "css-dev-only",
|
|
13
|
+
stylisPlugins: [A]
|
|
14
|
+
});
|
|
15
|
+
function P(c) {
|
|
10
16
|
const n = {};
|
|
11
17
|
for (const o in c)
|
|
12
|
-
n[o] = `var(${
|
|
18
|
+
n[o] = `var(${S(o)})`;
|
|
13
19
|
return n;
|
|
14
20
|
}
|
|
15
|
-
function
|
|
21
|
+
function J(c, n, o, f) {
|
|
16
22
|
return (m) => {
|
|
17
|
-
const
|
|
18
|
-
...a.value.components?.[
|
|
23
|
+
const p = c.split("."), { token: a, rootCls: u } = T(), d = k(), s = G("namespace"), C = l(() => ({
|
|
24
|
+
...a.value.components?.[p[0]] || {},
|
|
19
25
|
...o
|
|
20
|
-
})),
|
|
21
|
-
let e =
|
|
26
|
+
})), i = l(() => {
|
|
27
|
+
let e = V(a.value || {}, "components");
|
|
22
28
|
return e = {
|
|
23
29
|
...e,
|
|
24
|
-
...
|
|
25
|
-
|
|
26
|
-
a.value.components?.[
|
|
30
|
+
...h(
|
|
31
|
+
j(o || {}),
|
|
32
|
+
a.value.components?.[p[0]] || {}
|
|
27
33
|
),
|
|
28
|
-
componentCls: `.${
|
|
29
|
-
namespace:
|
|
34
|
+
componentCls: `.${s.value}-${m}`,
|
|
35
|
+
namespace: s.value
|
|
30
36
|
}, e;
|
|
31
37
|
});
|
|
32
38
|
return v(
|
|
33
|
-
() =>
|
|
39
|
+
() => s.value,
|
|
34
40
|
(e) => {
|
|
35
|
-
const t =
|
|
36
|
-
|
|
37
|
-
);
|
|
38
|
-
t.componentCls = `.${e}-${m}`, t.namespace = e, f(
|
|
39
|
-
n(t, {
|
|
40
|
-
...u.value,
|
|
41
|
-
componentCls: `.${e}-${m}`,
|
|
42
|
-
namespace: e
|
|
43
|
-
})
|
|
41
|
+
const t = P(
|
|
42
|
+
i.value
|
|
44
43
|
);
|
|
44
|
+
t.componentCls = `.${e}-${m}`, t.namespace = e;
|
|
45
|
+
const r = n(t, {
|
|
46
|
+
...i.value,
|
|
47
|
+
componentCls: `.${e}-${m}`,
|
|
48
|
+
namespace: e
|
|
49
|
+
});
|
|
50
|
+
$(r);
|
|
45
51
|
},
|
|
46
52
|
{ immediate: !0 }
|
|
47
53
|
), v(
|
|
48
|
-
[() =>
|
|
54
|
+
[() => C.value, () => u.value],
|
|
49
55
|
([e, t]) => {
|
|
50
|
-
const
|
|
51
|
-
Object.keys(
|
|
52
|
-
[`.${t}.${
|
|
56
|
+
const r = b(e, f);
|
|
57
|
+
Object.keys(r).length && w({
|
|
58
|
+
[`.${t}.${s.value}-${m}`]: r
|
|
53
59
|
});
|
|
54
60
|
},
|
|
55
61
|
{ deep: !0, immediate: !0 }
|
|
56
|
-
),
|
|
62
|
+
), l(() => g(u.value, d.value));
|
|
57
63
|
};
|
|
58
64
|
}
|
|
59
65
|
export {
|
|
60
|
-
|
|
66
|
+
J as genComponentStyleHook
|
|
61
67
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const t = (r) => {
|
|
2
|
+
r.type === "rule" && Array.isArray(r.props) && (r.props = r.props.map((p) => {
|
|
3
|
+
const s = p.trim().split(/\s+/);
|
|
4
|
+
if (s.length >= 2) {
|
|
5
|
+
const i = s[0], o = s[1];
|
|
6
|
+
/^\.css-dev-only-[a-z0-9]+$/.test(i) && (s[0] = `:where(${i})${o}`, s.splice(1, 1));
|
|
7
|
+
}
|
|
8
|
+
return s.join(" ");
|
|
9
|
+
}));
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
t as downSpecificityPlugin
|
|
13
|
+
};
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.0.0
|
|
1
|
+
declare const _default: "7.0.0";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("../../ap-table/utils.js"),T=require("../renderer/index.js"),d=require("lodash-unified"),u=require("vue");require("../components/body-cell/index.vue.js");require("../components/header-cell/index.vue.js");require("../components/tooltip/index.vue.js");require("../../config-provider/index.js");const q=require("../../ap-grid/utils/col.js"),w=require("../../utils/index.js"),R=require("../../config-provider/hooks/use-global-config.js"),P=require("../../config-provider/hooks/use-namespace.js"),S=require("../components/body-cell/index.vue2.js"),D=require("../components/tooltip/index.vue2.js"),y=require("../components/header-cell/index.vue2.js");function I(t){return d.isNumber(t)&&t>1}function M(t,i){if(i.bodyCellTooltip)return d.isFunction(i.bodyCellTooltip)?i.bodyCellTooltip(t.value,t.data):i.bodyCellTooltip;if(i.renderText)return i.renderText({value:t.value,record:t.data,column:i,text:t.value});const p=i.valueType||"text",f=T.rendererMap[p];if(f){const c=C.getTableRenderProps({...i,valueType:p},{value:t.value,text:t.value,record:t.data,column:t.column,rowIndex:t.node?.rowIndex,pinned:t.node?.rowPinned});return f(c)}return C.objectToString(t.value)}const G=(t,i,p)=>{const f=R.useGlobalConfig("valueTypeMap"),v=u.ref(),{em:c}=P.useNamespace("ag-grid"),b=r=>{const a={cellRenderer:S.default,cellRendererParams:{column:r,extraValueType:u.unref(f),rowKey:i.rowKey}};if(r.customRender)return a;if(r.renderText)return{valueFormatter:s=>r.renderText({value:s.value,record:s.data,column:r,text:s.value})};const l=r.valueType||"text",e=T.rendererMap[l];return e?{valueFormatter:s=>{const n=C.getTableRenderProps({...r,valueType:l},{value:s.value,text:s.value,record:s.data,column:s.column,rowIndex:s.node?.rowIndex,pinned:s.node?.rowPinned});return e(n)}}:a},h=r=>{const a=r.valueType||"text",l=T.rendererMap[a],e={},s=r.bodyCellTooltip||!r.customRender&&l&&(r.ellipsis===!0||r.ellipsis==="tooltip"||d.isNumber(r.ellipsis)),n=d.isNumber(r.ellipsis)&&r.ellipsis>1,o=d.isNumber(r.ellipsis)?r.ellipsis:1;return e.tooltipValueGetter=s?x=>M(x,r):void 0,e.wrapText=!r.ellipsis||n,e.cellStyle={"--ag-grid-line-clamp":o},e.tooltipComponent=D.default,e.tooltipComponentParams={lineClamp:o,gridWrapperRef:v},e},_=u.computed(()=>{const r=u.unref(t);function a(l){return l.map(e=>{const s={field:q.dataIndexToField(e.dataIndex),colId:w.isDef(e.key)?String(e.key):void 0,sortable:!!e.sorter,comparator:e.sorter===!0?()=>0:e.sorter,headerComponentParams:{column:e},resizable:e.resizable,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth,flex:e.width?void 0:1,pinned:e.fixed||null,colSpan:e.colSpan,spanRows:e.spanRows,cellClass:p(n=>{const o=e.cellClass||"",x=d.isFunction(o)?o(n.data,n.node):o;return[`${c("cell",e.align||"left")}`,I(e.ellipsis)?c("cell","multiline"):null,x].flat().filter(Boolean)}),headerStyle:e.headerStyle,headerClass:e.headerClass,autoHeight:!0,...h(e),...b(e)};return e.children?.length?{...s,headerGroupComponent:y.default,headerGroupComponentParams:{column:e},children:a(e.children)}:s})}return a(r)}),g=u.computed(()=>({headerComponent:y.default,resizable:i.columnResizable,suppressMovable:!0,cellDataType:!1}));return{columnDefs:_,defaultColDef:g,gridWrapperRef:v}};exports.useColumnsDef=G;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),je=require("ag-grid-vue3"),$=require("ag-grid-community"),Je=require("./utils.js"),j=require("@aplus-frontend/antdv"),i=require("lodash-unified");require("../config-provider/index.js");const Qe=require("../ap-form/index.js"),Xe=require("../ap-table/utils.js"),Ye=require("../ap-table/hooks/use-table-paging-ng.js"),Ze=require("./hooks/use-row-selection.js"),eo=require("./context.js"),oo=require("../ap-table/context.js"),B=require("../ap-grid/constants.js"),to=require("@aplus-frontend/antdv/es/theme/internal"),ro=require("./theme.js"),no=require("./hooks/use-columns.js"),ao=require("./hooks/use-columns-def.js"),lo=require("../utils/index.js"),so=require("../utils/slot.js"),uo=require("./hooks/use-search-form.js");require("./components/empty/index.vue.js");const io=require("./hooks/use-virtual-config.js"),co=require("./hooks/use-pinned-row.js"),fo=require("./hooks/use-selection-col-def.js");require("./components/row/index.vue.js");const mo=require("./style/index.js"),po=require("../config-provider/hooks/use-namespace.js"),go=require("../config-provider/hooks/use-global-config.js"),wo=require("./components/row/index.vue2.js"),So=require("./components/empty/index.vue2.js"),Co=e.defineComponent({name:"AgGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},columns:{},rowSelection:{type:Boolean},card:{type:Boolean},params:{},request:{},defaultData:{},dataSource:{},onLoadingChange:{},onShownColumnsChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},manual:{type:Boolean,default:void 0},size:{default:"mini"},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{}},setup(J,{expose:Q}){$.ModuleRegistry.registerModules([$.AllCommunityModule]);const t=J,T=e.useSlots(),{e:R,b:c,be:X}=po.useNamespace("ag-grid"),Y=mo.default("ag-grid"),C=e.ref(t.size),Z=ro.useTheme(C,e.toRef(t,"rowHeight"),e.toRef(t,"theme")),ee=io.default(e.toRef(t,"virtual")),{rowPinnedGridConfig:E,getRowPinnedCellClass:oe}=co.usePinnedRow(e.toRef(t,"summary")),te=go.useGlobalConfig("apGrid"),l=e.ref(),[,re]=to.useToken();let h=!!t.dataSource;const D=uo.useSearchForm(t),{shownColumns:p,columns:V,columnKeys:ne,getTargetColumnByKey:ae}=no.useColumns(t),{defaultColDef:le,columnDefs:se,gridWrapperRef:ue}=ao.useColumnsDef(V,t,oe),b=e.ref({});eo.useProvideSorter({sorter:b,setSorter(o){b.value=o}});const ie={asc:"ascend",desc:"descend"};function ce(){const o=l.value.getColumns()?.filter(d=>d.getSort()!==void 0),r=e.unref(b)||{};let n=o?.[0];const s=Object.keys(r);if(s.length&&s.every(d=>r[d]===null)){const d=Object.keys(r)[0];d&&(n=l.value?.getColumn(d))}if(!n)return;const u=n.getColDef(),f=n.getSort(),m=ae(u.colId);P(void 0,void 0,{column:u,field:m?.field??u.field??u.colId,order:f?ie[f]:null})}const de=e.computed(()=>Xe.recursionApColumns(e.unref(p),o=>{if(o.sorter===!0)return o.field??o.dataIndex??o.key}).filter(Boolean)),fe=()=>{b.value={};const o=l.value;if(!o)return;const r=o.getColumnState()?.map(n=>({...n,sort:null}));o.applyColumnState({state:r})},me=e.computed(()=>lo.isDef(t.manual)?t.manual:so.getValidVNodeList(T.searchFormExtra?.()||[]).some(r=>r.type?.name==="ApView")),{formRef:g,submit:F,reset:x,data:w,tableProps:z,handleTableChangeOptional:P,submitWith:A,refresh:K,getPaging:pe,setPaging:ge,setDataSource:we}=Ye.useTablePaging({async request(o){if(h=!1,S.value&&!S.value.preserveSelectedRowKeys&&i.isUndefined(t.dataSource)&&I(),!i.isUndefined(t.dataSource)){const n=o.pageSize*(o.current-1);return{data:(t.pagination===!1?t.dataSource:t.dataSource.slice(n,n+o.pageSize))||[],total:t.dataSource.length||0}}const r=await t.request?.(o);return{data:r?.data||[],total:r?.total||0}},namespace:"ap-grid",filterFields:e.ref([]),params:e.toRef(t,"params"),defaultData:t.defaultData,manual:e.unref(me),formatParams:t.beforeSearchSubmit,pagination:t.pagination,sortFields:de,onClickReset:fe}),S=e.computed(()=>{const o=t.rowSelection||te.value?.rowSelection;if(o)return o===!0?B.DEFAULT_ROW_SELECTION_CONFIG:{...B.DEFAULT_ROW_SELECTION_CONFIG,...o}}),Se=fo.default(t,p),Ce=e.computed(()=>i.isUndefined(t.dataSource)?w.records:t.dataSource),{select:he,unSelect:ye,selectedRows:N,selectedRowKeys:ve,clearAll:Re,selectMultiByKeys:be,selectMulti:ke,unSelectMulti:Be}=Ze.default({...S.value,dataSource:Ce,rowKey:t.rowKey}),Fe={checkbox:"multiRow",radio:"singleRow"},xe=e.computed(()=>{const o=S.value;if(!o)return;const{type:r="checkbox",disabled:n}=o;return{mode:Fe[r],isRowSelectable:s=>n?!n(s.data):!0,hideDisabledCheckboxes:o.hideDisabled??!1}});function q(o){return i.isFunction(t.rowKey)?t.rowKey(o):o[t.rowKey]}const k=({api:o=l.value})=>{if(t.onUpdate?.(),!S.value)return;const r=N.value||[];h=!1;const n=[];o.forEachNode(s=>{const y=s.data,u=q(y),f=s.isSelected();r.find(m=>q(m)===u)?!f&&n.push(s):f&&s.setSelected(!1)}),o.setNodesSelected({nodes:n,newValue:!0}),setTimeout(()=>{h=!0},0)},Ne=o=>{h&&(o.node.isSelected()?he(o.data):ye(o.data),i.isFunction(S.value?.tooltip)&&o.api.refreshCells({rowNodes:[o.node],columns:["ag-Grid-SelectionColumn"],force:!0}))},qe=()=>{h=!0},I=()=>{Re(),l.value?.deselectAll()};function Ie(o){be(o),e.nextTick(()=>{k({})})}const Te=e.computed(()=>{const o=t.customRow;return o?{isFullWidthRow:o.isCustomRow,fullWidthCellRenderer:wo.default,fullWidthCellRendererParams:{render:o.render}}:{}});function Ee(o){ke(o),e.nextTick(()=>{k({})})}function De(o){Be(o),e.nextTick(()=>{k({})})}function M(o=!1){const r=o?"getFieldsValueTransformed":"getFieldsValue";return g.value?.apForm?.[r]?.(!0)}function _(o){g.value?.apForm?.setFieldsValue?.(o)}function O(){return g.value?.getSorterItems()||[]}function W(o){g.value?.setSorterItems(o)}function U(){g.value?.resetSorterItems()}function G(o){return o&&String(o)}function Ve(o){const r=l.value;if(!r)return;const n=r.getColumnState()||[],s=o.map(a=>a.key?String(a.key):a.key).filter(Boolean),y=n.map(a=>{if(!ne.value.includes(a.colId))return a;const v=!s.includes(a.colId),H={...a,hide:v},L=o.find($e=>G($e.key)===a.colId);return L&&(H.pinned=L.fixed||null),H}),u=new Map(o.map((a,v)=>[G(a.key),v])),f=y.filter(a=>u.has(a.colId)).sort((a,v)=>u.get(a.colId)-u.get(v.colId)),m=[];let d=0;for(const a of y)u.has(a.colId)?m.push(f[d++]):m.push(a);r.applyColumnState({state:m,applyOrder:!0})}oo.useProvideApTable({columns:e.computed(()=>p.value),columnsBackup:e.computed(()=>V.value),size:e.computed(()=>B.sizeMap[C.value]),updateColumns(o){p.value=o,t.onShownColumnsChange?.(o),Ve(o)},updateSize(o){C.value=B.sizeReverseMap[o]},renderConfig:e.computed(()=>({className:X("table-header","title"),color:re.value.colorTextTertiary})),dataSource:e.computed(()=>e.unref(w).records),getSearchFormValues:M,setSearchFormValues:_,submit:F,submitWith:A,reset:x,refresh:K,getSearchFormSorterItems:O,setSearchFormSorterItems:W,resetSearchFormSorterItems:U});const ze=e.computed(()=>i.isUndefined(t.loading)?w.loading:t.loading),Pe=e.computed(()=>[c(),t.card?null:c("wrapper"),c("adaptive"),c(`size-${C.value}`),Y.value].filter(Boolean)),Ae=e.computed(()=>({height:"100%",...t.tableStyle||{}})),Ke=(o,r)=>{P({current:o,pageSize:r})};function Me(o){const r=o.data;return q(r)}function _e(o,r){(i.isFunction(o)?l.value?.ensureNodeVisible:l.value?.ensureIndexVisible)?.(o,r)}function Oe(o,r){l.value?.ensureColumnVisible(o,r)}function We(o){t.onRowClicked?.(o.data,o.event)}function Ue(o){t.onScrollEnd?.(o.direction)}function Ge(o){return l.value?.refreshCells(o)}function He(o){return l.value?.redrawRows(o)}const Le=o=>{const r=[E.value.getRowClass?.(o)];if(!o.node.rowPinned){const n=i.isFunction(t.rowClassName)?t.rowClassName(o.data,o.rowIndex):t.rowClassName;r.push(n)}return r.flat().filter(Boolean)};return e.watch(()=>t.dataSource,o=>{we(o)},{immediate:!0,deep:!0}),e.watch(()=>t.size,o=>{C.value=o}),e.watch(()=>e.unref(w).loading,o=>{t.onLoadingChange?.(o)}),Q({submit:F,reset:x,refresh:K,submitWith:A,setSearchFormValues:_,getSearchFormValues:M,getShowColumns:()=>e.unref(p),rowSelection:{selectedRows:e.computed(()=>N.value),setSelectedRowKeys:Ie,setSelectedRows:Ee,clearAll:I,unSelectRows:De},scrollToRow:_e,scrollToColumn:Oe,getDataSource:()=>e.unref(w.records),getPaging:pe,setPaging:ge,getSearchFormSorterItems:O,setSearchFormSorterItems:W,resetSearchFormSorterItems:U,refreshCells:Ge,redrawRows:He,_internalGridApi:e.computed(()=>l.value)}),(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(Pe.value),style:e.normalizeStyle(o.wrapperStyle)},[e.unref(i.isUndefined)(o.dataSource)&&o.searchForm!==!1&&e.unref(D).length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.card?e.unref(R)("search-wrapper"):null),style:e.normalizeStyle(o.searchFormWrapperStyle)},[e.createVNode(e.unref(Qe.ApForm).SearchForm,e.mergeProps(o.searchForm||{},{ref_key:"formRef",ref:g,"custom-reset":"","submit-loading":e.unref(z).loading,onSubmit:e.unref(F),onReset:e.unref(x)}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(D),n=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.renderNode),{key:n.dataIndex}))),128))]),_:2},[T.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["submit-loading","onSubmit","onReset"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(R)("table-wrapper"),o.card?e.unref(R)("table-wrapper-card"):null]),style:e.normalizeStyle(o.tableWrapperStyle)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(c)("header-wrapper"))},[e.renderSlot(o.$slots,"title",{selectedRows:e.unref(N),selectedRowKeys:e.unref(ve),shownColumns:e.unref(p),clearAll:I})],2),e.createElementVNode("div",{ref_key:"gridWrapperRef",ref:ue,class:e.normalizeClass(e.unref(c)("grid-wrapper"))},[e.createVNode(e.unref(je.AgGridVue),e.mergeProps(e.unref(Je.mergeProps)(e.unref(ee),e.unref(E),Te.value),{"get-row-class":Le,style:Ae.value,"row-data":e.unref(w).records,"column-defs":e.unref(se),"default-col-def":e.unref(le),"suppress-loading-overlay":"","row-selection":xe.value,"selection-column-def":e.unref(Se),"get-row-id":Me,"get-row-height":t.getRowHeight,theme:e.unref(Z),"tooltip-show-delay":500,"enable-browser-tooltips":o.browserTooltips,"tooltip-interaction":"","row-class-rules":o.rowClassRules,"no-rows-overlay-component":So.default,"suppress-cell-focus":"","dom-layout":o.autoHeight?"autoHeight":"normal",onSortChanged:ce,onGridReady:r[0]||(r[0]=n=>l.value=n.api),onRowDataUpdated:k,onRowSelected:Ne,onFirstDataRendered:qe,onRowClicked:We,onBodyScrollEnd:Ue}),null,16,["style","row-data","column-defs","default-col-def","row-selection","selection-column-def","get-row-height","theme","enable-browser-tooltips","row-class-rules","dom-layout"]),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(R)("table-loading-wrapper"))},[e.createVNode(e.unref(j.Spin),{delay:300})],2),[[e.vShow,ze.value]])],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(c)("pagination-wrapper"))},[o.pagination!==!1?(e.openBlock(),e.createBlock(e.unref(j.Pagination),e.mergeProps({key:0,class:e.unref(c)("pagination")},e.unref(z).pagination,{onChange:Ke}),null,16,["class"])):e.createCommentVNode("",!0)],2)],6)],6))}});exports.default=Co;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),je=require("ag-grid-vue3"),$=require("ag-grid-community"),Je=require("./utils.js"),j=require("@aplus-frontend/antdv"),i=require("lodash-unified");require("../config-provider/index.js");const Qe=require("../ap-form/index.js"),Xe=require("../ap-table/utils.js"),Ye=require("../ap-table/hooks/use-table-paging-ng.js"),Ze=require("./hooks/use-row-selection.js"),eo=require("./context.js"),oo=require("../ap-table/context.js"),B=require("../ap-grid/constants.js"),to=require("@aplus-frontend/antdv/es/theme/internal"),ro=require("./theme.js"),no=require("./hooks/use-columns.js"),ao=require("./hooks/use-columns-def.js"),lo=require("../utils/index.js"),so=require("../utils/slot.js"),uo=require("./hooks/use-search-form.js");require("./components/empty/index.vue.js");const io=require("./hooks/use-virtual-config.js"),co=require("./hooks/use-pinned-row.js"),fo=require("./hooks/use-selection-col-def.js");require("./components/row/index.vue.js");const po=require("./style/index.js"),mo=require("../config-provider/hooks/use-namespace.js"),go=require("../config-provider/hooks/use-global-config.js"),wo=require("./components/row/index.vue2.js"),So=require("./components/empty/index.vue2.js"),Co=e.defineComponent({name:"AgGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},columns:{},rowSelection:{type:Boolean},card:{type:Boolean},params:{},request:{},defaultData:{},dataSource:{},onLoadingChange:{},onShownColumnsChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},manual:{type:Boolean,default:void 0},size:{default:"mini"},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{}},setup(J,{expose:Q}){$.ModuleRegistry.registerModules([$.AllCommunityModule]);const t=J,T=e.useSlots(),{e:R,b:c,be:X}=mo.useNamespace("ag-grid"),Y=po.default("ag-grid"),C=e.ref(t.size),Z=ro.useTheme(C,e.toRef(t,"rowHeight"),e.toRef(t,"theme")),ee=io.default(e.toRef(t,"virtual")),{rowPinnedGridConfig:E,getRowPinnedCellClass:oe}=co.usePinnedRow(e.toRef(t,"summary")),te=go.useGlobalConfig("apGrid"),l=e.ref(),[,re]=to.useToken();let h=!!t.dataSource;const D=uo.useSearchForm(t),{shownColumns:m,columns:V,columnKeys:ne,getTargetColumnByKey:ae}=no.useColumns(t),{defaultColDef:le,columnDefs:se,gridWrapperRef:ue}=ao.useColumnsDef(V,t,oe),b=e.ref({});eo.useProvideSorter({sorter:b,setSorter(o){b.value=o}});const ie={asc:"ascend",desc:"descend"};function ce(){const o=l.value.getColumns()?.filter(d=>d.getSort()!==void 0),r=e.unref(b)||{};let n=o?.[0];const s=Object.keys(r);if(s.length&&s.every(d=>r[d]===null)){const d=Object.keys(r)[0];d&&(n=l.value?.getColumn(d))}if(!n)return;const u=n.getColDef(),f=n.getSort(),p=ae(u.colId);P(void 0,void 0,{column:u,field:p?.field??u.field??u.colId,order:f?ie[f]:null})}const de=e.computed(()=>Xe.recursionApColumns(e.unref(m),o=>{if(o.sorter===!0)return o.field??o.dataIndex??o.key}).filter(Boolean)),fe=()=>{b.value={};const o=l.value;if(!o)return;const r=o.getColumnState()?.map(n=>({...n,sort:null}));o.applyColumnState({state:r})},pe=e.computed(()=>lo.isDef(t.manual)?t.manual:so.getValidVNodeList(T.searchFormExtra?.()||[]).some(r=>r.type?.name==="ApView")),{formRef:g,submit:F,reset:x,data:w,tableProps:z,handleTableChangeOptional:P,submitWith:A,refresh:K,getPaging:me,setPaging:ge,setDataSource:we}=Ye.useTablePaging({async request(o){if(h=!1,S.value&&!S.value.preserveSelectedRowKeys&&i.isUndefined(t.dataSource)&&I(),!i.isUndefined(t.dataSource)){const n=o.pageSize*(o.current-1);return{data:(t.pagination===!1?t.dataSource:t.dataSource.slice(n,n+o.pageSize))||[],total:t.dataSource.length||0}}const r=await t.request?.(o);return{data:r?.data||[],total:r?.total||0}},namespace:"ap-grid",filterFields:e.ref([]),params:e.toRef(t,"params"),defaultData:t.defaultData,manual:e.unref(pe),formatParams:t.beforeSearchSubmit,pagination:t.pagination,sortFields:de,onClickReset:fe}),S=e.computed(()=>{const o=t.rowSelection||te.value?.rowSelection;if(o)return o===!0?B.DEFAULT_ROW_SELECTION_CONFIG:{...B.DEFAULT_ROW_SELECTION_CONFIG,...o}}),Se=fo.default(t,m),Ce=e.computed(()=>i.isUndefined(t.dataSource)?w.records:t.dataSource),{select:he,unSelect:ye,selectedRows:N,selectedRowKeys:ve,clearAll:Re,selectMultiByKeys:be,selectMulti:ke,unSelectMulti:Be}=Ze.default({...S.value,dataSource:Ce,rowKey:t.rowKey}),Fe={checkbox:"multiRow",radio:"singleRow"},xe=e.computed(()=>{const o=S.value;if(!o)return;const{type:r="checkbox",disabled:n}=o;return{mode:Fe[r],isRowSelectable:s=>n?!n(s.data):!0,hideDisabledCheckboxes:o.hideDisabled??!1}});function q(o){return i.isFunction(t.rowKey)?t.rowKey(o):o[t.rowKey]}const k=({api:o=l.value})=>{if(t.onUpdate?.(),!S.value)return;const r=N.value||[];h=!1;const n=[];o.forEachNode(s=>{const y=s.data,u=q(y),f=s.isSelected();r.find(p=>q(p)===u)?!f&&n.push(s):f&&s.setSelected(!1)}),o.setNodesSelected({nodes:n,newValue:!0}),setTimeout(()=>{h=!0},0)},Ne=o=>{h&&(o.node.isSelected()?he(o.data):ye(o.data),i.isFunction(S.value?.tooltip)&&o.api.refreshCells({rowNodes:[o.node],columns:["ag-Grid-SelectionColumn"],force:!0}))},qe=()=>{h=!0},I=()=>{Re(),l.value?.deselectAll()};function Ie(o){be(o),e.nextTick(()=>{k({})})}const Te=e.computed(()=>{const o=t.customRow;return o?{isFullWidthRow:o.isCustomRow,fullWidthCellRenderer:wo.default,fullWidthCellRendererParams:{render:o.render}}:{}});function Ee(o){ke(o),e.nextTick(()=>{k({})})}function De(o){Be(o),e.nextTick(()=>{k({})})}function M(o=!1){const r=o?"getFieldsValueTransformed":"getFieldsValue";return g.value?.apForm?.[r]?.(!0)}function _(o){g.value?.apForm?.setFieldsValue?.(o)}function O(){return g.value?.getSorterItems()||[]}function W(o){g.value?.setSorterItems(o)}function U(){g.value?.resetSorterItems()}function G(o){return o&&String(o)}function Ve(o){const r=l.value;if(!r)return;const n=r.getColumnState()||[],s=o.map(a=>a.key?String(a.key):a.key).filter(Boolean),y=n.map(a=>{if(!ne.value.includes(a.colId))return a;const v=!s.includes(a.colId),H={...a,hide:v},L=o.find($e=>G($e.key)===a.colId);return L&&(H.pinned=L.fixed||null),H}),u=new Map(o.map((a,v)=>[G(a.key),v])),f=y.filter(a=>u.has(a.colId)).sort((a,v)=>u.get(a.colId)-u.get(v.colId)),p=[];let d=0;for(const a of y)u.has(a.colId)?p.push(f[d++]):p.push(a);r.applyColumnState({state:p,applyOrder:!0})}oo.useProvideApTable({columns:e.computed(()=>m.value),columnsBackup:e.computed(()=>V.value),size:e.computed(()=>B.sizeMap[C.value]),updateColumns(o){m.value=o,t.onShownColumnsChange?.(o),Ve(o)},updateSize(o){C.value=B.sizeReverseMap[o]},renderConfig:e.computed(()=>({className:X("table-header","title"),color:re.value.colorTextTertiary})),dataSource:e.computed(()=>e.unref(w).records),getSearchFormValues:M,setSearchFormValues:_,submit:F,submitWith:A,reset:x,refresh:K,getSearchFormSorterItems:O,setSearchFormSorterItems:W,resetSearchFormSorterItems:U});const ze=e.computed(()=>i.isUndefined(t.loading)?w.loading:t.loading),Pe=e.computed(()=>[c(),t.card?null:c("wrapper"),c("adaptive"),c(`size-${C.value}`),Y.value].filter(Boolean)),Ae=e.computed(()=>({height:"100%",...t.tableStyle||{}})),Ke=(o,r)=>{P({current:o,pageSize:r})};function Me(o){const r=o.data;return q(r)}function _e(o,r){(i.isFunction(o)?l.value?.ensureNodeVisible:l.value?.ensureIndexVisible)?.(o,r)}function Oe(o,r){l.value?.ensureColumnVisible(o,r)}function We(o){t.onRowClicked?.(o.data,o.event)}function Ue(o){t.onScrollEnd?.(o.direction)}function Ge(o){return l.value?.refreshCells(o)}function He(o){return l.value?.redrawRows(o)}const Le=o=>{const r=[E.value.getRowClass?.(o)];if(!o.node.rowPinned){const n=i.isFunction(t.rowClassName)?t.rowClassName(o.data,o.rowIndex):t.rowClassName;r.push(n)}return r.flat().filter(Boolean)};return e.watch(()=>t.dataSource,o=>{we(o)},{immediate:!0,deep:!0}),e.watch(()=>t.size,o=>{C.value=o}),e.watch(()=>e.unref(w).loading,o=>{t.onLoadingChange?.(o)}),Q({submit:F,reset:x,refresh:K,submitWith:A,setSearchFormValues:_,getSearchFormValues:M,getShowColumns:()=>e.unref(m),rowSelection:{selectedRows:e.computed(()=>N.value),setSelectedRowKeys:Ie,setSelectedRows:Ee,clearAll:I,unSelectRows:De},scrollToRow:_e,scrollToColumn:Oe,getDataSource:()=>e.unref(w.records),getPaging:me,setPaging:ge,getSearchFormSorterItems:O,setSearchFormSorterItems:W,resetSearchFormSorterItems:U,refreshCells:Ge,redrawRows:He,_internalGridApi:e.computed(()=>l.value)}),(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(Pe.value),style:e.normalizeStyle(o.wrapperStyle)},[e.unref(i.isUndefined)(o.dataSource)&&o.searchForm!==!1&&e.unref(D).length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.card?e.unref(R)("search-wrapper"):null),style:e.normalizeStyle(o.searchFormWrapperStyle)},[e.createVNode(e.unref(Qe.ApForm).SearchForm,e.mergeProps(o.searchForm||{},{ref_key:"formRef",ref:g,"custom-reset":"","submit-loading":e.unref(z).loading,onSubmit:e.unref(F),onReset:e.unref(x)}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(D),n=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.renderNode),{key:n.dataIndex}))),128))]),_:2},[T.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["submit-loading","onSubmit","onReset"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(R)("table-wrapper"),o.card?e.unref(R)("table-wrapper-card"):null]),style:e.normalizeStyle(o.tableWrapperStyle)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(c)("header-wrapper"))},[e.renderSlot(o.$slots,"title",{selectedRows:e.unref(N),selectedRowKeys:e.unref(ve),shownColumns:e.unref(m),clearAll:I})],2),e.createElementVNode("div",{ref_key:"gridWrapperRef",ref:ue,class:e.normalizeClass(e.unref(c)("grid-wrapper"))},[e.createVNode(e.unref(je.AgGridVue),e.mergeProps(e.unref(Je.mergeProps)(e.unref(ee),e.unref(E),Te.value),{"get-row-class":Le,style:Ae.value,"row-data":e.unref(w).records,"column-defs":e.unref(se),"default-col-def":e.unref(le),"suppress-loading-overlay":"","row-selection":xe.value,"selection-column-def":e.unref(Se),"get-row-id":Me,"get-row-height":t.getRowHeight,theme:e.unref(Z),"tooltip-show-delay":500,"enable-browser-tooltips":o.browserTooltips,"tooltip-interaction":"","row-class-rules":o.rowClassRules,"no-rows-overlay-component":So.default,"suppress-cell-focus":"","enable-cell-span":"","dom-layout":o.autoHeight?"autoHeight":"normal",onSortChanged:ce,onGridReady:r[0]||(r[0]=n=>l.value=n.api),onRowDataUpdated:k,onRowSelected:Ne,onFirstDataRendered:qe,onRowClicked:We,onBodyScrollEnd:Ue}),null,16,["style","row-data","column-defs","default-col-def","row-selection","selection-column-def","get-row-height","theme","enable-browser-tooltips","row-class-rules","dom-layout"]),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(R)("table-loading-wrapper"))},[e.createVNode(e.unref(j.Spin),{delay:300})],2),[[e.vShow,ze.value]])],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(c)("pagination-wrapper"))},[o.pagination!==!1?(e.openBlock(),e.createBlock(e.unref(j.Pagination),e.mergeProps({key:0,class:e.unref(c)("pagination")},e.unref(z).pagination,{onChange:Ke}),null,16,["class"])):e.createCommentVNode("",!0)],2)],6)],6))}});exports.default=Co;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export declare const genAgGridCustomHeaderCellStyle: GenStyleFunc;
|
|
4
|
-
declare const _default: (prefixCls: string) =>
|
|
4
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export declare const genEditableAgGridStyle: GenStyleFunc;
|
|
4
|
-
declare const _default: (prefixCls: string) =>
|
|
4
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export type AgGridToken = {
|
|
4
4
|
/**
|
|
5
5
|
* 卡片模式下表单容器的下边距尺寸
|
|
@@ -28,5 +28,5 @@ export type AgGridToken = {
|
|
|
28
28
|
};
|
|
29
29
|
export declare const defaultToken: AgGridToken;
|
|
30
30
|
export declare const genAgGridStyle: GenStyleFunc<AgGridToken>;
|
|
31
|
-
declare const _default: (prefixCls: string) =>
|
|
31
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
32
32
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("@aplus-frontend/antdv");require("../item/index.vue.js");require("../item-modal/index.vue2.js");require("../item-popconfirm/index.vue2.js");const _=require("@aplus-frontend/icon");require("../../config-provider/index.js");const s=require("lodash-unified"),g=require("../style/dropdown-item.js"),k=require("../../config-provider/hooks/use-namespace.js"),i=require("../item/index.vue2.js"),v=require("../item-modal/index.vue.js"),y=require("../item-popconfirm/index.vue.js"),B=e.defineComponent({name:"ApActionItemDropDown",__name:"index",props:{trigger:{default:()=>["hover"]},placement:{default:"bottomLeft"},actions:{default:()=>[]},showIcon:{type:Boolean,default:!0},text:{},color:{default:"primary"},disabled:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},onClick:{},loading:{type:Boolean,default:!1},icon:{},iconFirst:{type:Boolean},tooltip:{}},setup(c){const a=c,n=e.ref(!1),{e:u,b:p}=k.useNamespace("action-item-dropdown"),d=g.default("action-item-dropdown"),f=e.computed(()=>a.actions.filter(t=>t.visible||s.isUndefined(t.visible)).map(t=>({...t,onAction:async o=>{try{await t.onAction?.(o)}finally{n.value=!1}}})));return(t,o)=>(e.openBlock(),e.createBlock(e.unref(l.Dropdown),{open:n.value,"onUpdate:open":o[0]||(o[0]=r=>n.value=r),trigger:t.trigger,placement:t.placement,class:e.normalizeClass(e.unref(d))},{overlay:e.withCtx(()=>[e.createVNode(e.unref(l.Menu),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(r,m)=>(e.openBlock(),e.createBlock(e.unref(l.MenuItem),{key:m,class:e.normalizeClass(e.unref(u)("item"))},{default:e.withCtx(()=>[r.modalProps?(e.openBlock(),e.createBlock(v.default,e.mergeProps({key:0,ref_for:!0},r),null,16)):r.popconfirmProps?(e.openBlock(),e.createBlock(y.default,e.mergeProps({key:1,ref_for:!0},r),null,16)):(e.openBlock(),e.createBlock(i.default,e.mergeProps({key:2,ref_for:!0},r),null,16))]),_:2},1032,["class"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(p)())},[e.createVNode(i.default,e.normalizeProps(e.guardReactiveProps(e.unref(s.omit)(a,["actions","trigger","placement"]))),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16),t.showIcon?(e.openBlock(),e.createBlock(e.unref(_.IconApAdLineDown),{key:0
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("@aplus-frontend/antdv");require("../item/index.vue.js");require("../item-modal/index.vue2.js");require("../item-popconfirm/index.vue2.js");const _=require("@aplus-frontend/icon");require("../../config-provider/index.js");const s=require("lodash-unified"),g=require("../style/dropdown-item.js"),k=require("../../config-provider/hooks/use-namespace.js"),i=require("../item/index.vue2.js"),v=require("../item-modal/index.vue.js"),y=require("../item-popconfirm/index.vue.js"),B=e.defineComponent({name:"ApActionItemDropDown",__name:"index",props:{trigger:{default:()=>["hover"]},placement:{default:"bottomLeft"},actions:{default:()=>[]},showIcon:{type:Boolean,default:!0},text:{},color:{default:"primary"},disabled:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},onClick:{},loading:{type:Boolean,default:!1},icon:{},iconFirst:{type:Boolean},tooltip:{}},setup(c){const a=c,n=e.ref(!1),{e:u,b:p}=k.useNamespace("action-item-dropdown"),d=g.default("action-item-dropdown"),f=e.computed(()=>a.actions.filter(t=>t.visible||s.isUndefined(t.visible)).map(t=>({...t,onAction:async o=>{try{await t.onAction?.(o)}finally{n.value=!1}}})));return(t,o)=>(e.openBlock(),e.createBlock(e.unref(l.Dropdown),{open:n.value,"onUpdate:open":o[0]||(o[0]=r=>n.value=r),trigger:t.trigger,placement:t.placement,class:e.normalizeClass(e.unref(d))},{overlay:e.withCtx(()=>[e.createVNode(e.unref(l.Menu),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(r,m)=>(e.openBlock(),e.createBlock(e.unref(l.MenuItem),{key:m,class:e.normalizeClass(e.unref(u)("item"))},{default:e.withCtx(()=>[r.modalProps?(e.openBlock(),e.createBlock(v.default,e.mergeProps({key:0,ref_for:!0},r),null,16)):r.popconfirmProps?(e.openBlock(),e.createBlock(y.default,e.mergeProps({key:1,ref_for:!0},r),null,16)):(e.openBlock(),e.createBlock(i.default,e.mergeProps({key:2,ref_for:!0},r),null,16))]),_:2},1032,["class"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(p)())},[e.createVNode(i.default,e.normalizeProps(e.guardReactiveProps(e.unref(s.omit)(a,["actions","trigger","placement"]))),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16),e.createElementVNode("span",{class:e.normalizeClass(e.unref(u)("icon"))},[t.showIcon?(e.openBlock(),e.createBlock(e.unref(_.IconApAdLineDown),{key:0})):e.createCommentVNode("",!0)],2)],2)]),_:3},8,["open","trigger","placement","class"]))}});exports.default=B;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export declare const genActionDropdownItemStyle: GenStyleFunc;
|
|
4
|
-
declare const _default: (prefixCls: string) =>
|
|
4
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export type ActionToken = {
|
|
4
4
|
/**
|
|
5
5
|
* 加载中时的组件透明度
|
|
@@ -7,5 +7,5 @@ export type ActionToken = {
|
|
|
7
7
|
loadingOpacity: number;
|
|
8
8
|
};
|
|
9
9
|
export declare const genActionItemStyle: GenStyleFunc<ActionToken>;
|
|
10
|
-
declare const _default: (prefixCls: string) =>
|
|
10
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
11
11
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const _default: (prefixCls: string) =>
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
3
3
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@aplus-frontend/antdv"),l=require("lodash-unified");function c(e){return typeof e=="object"&&typeof e.then=="function"?e:!1}const f=e=>typeof e=="function"&&c(e?.()),u=(e,s="0.7")=>{try{let t=e?.toLowerCase();if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)){if(t.length===4){let o="#";for(let n=1;n<4;n+=1)o+=t.slice(n,n+1).concat(t.slice(n,n+1));t=o}const r=[];for(let o=1;o<7;o+=2)r.push(parseInt("0x"+t.slice(o,o+2)));return"rgba("+r.join(",")+","+s+")"}if(t&&t.startsWith("rgb")){let r=t.match(/(\d(\.\d+)?)+/g);return r=r?.slice(0,3)?.concat(s),"rgba("+r.join(",")+")"}return t}catch{return}},h=e=>{const{onOk:s=()=>({})}=e;return new Promise((t,i)=>{a.Modal.confirm({onOk:async()=>{try{await s(),t(!0)}catch{i()}},onCancel:()=>{
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@aplus-frontend/antdv"),l=require("lodash-unified");function c(e){return typeof e=="object"&&typeof e.then=="function"?e:!1}const f=e=>typeof e=="function"&&c(e?.()),u=(e,s="0.7")=>{try{let t=e?.toLowerCase();if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)){if(t.length===4){let o="#";for(let n=1;n<4;n+=1)o+=t.slice(n,n+1).concat(t.slice(n,n+1));t=o}const r=[];for(let o=1;o<7;o+=2)r.push(parseInt("0x"+t.slice(o,o+2)));return"rgba("+r.join(",")+","+s+")"}if(t&&t.startsWith("rgb")){let r=t.match(/(\d(\.\d+)?)+/g);return r=r?.slice(0,3)?.concat(s),"rgba("+r.join(",")+")"}return t}catch{return}},h=e=>{const{onOk:s=()=>({})}=e;return new Promise((t,i)=>{a.Modal.confirm({onOk:async()=>{try{await s(),t(!0)}catch(r){i(r)}},onCancel:()=>{t(!1)},...l.omit(e,["onOk"])})})};exports.confirmHandle=h;exports.isAsynchronous=f;exports.isPromise=c;exports.transferOpacityColor=u;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const _default: (prefixCls: string) =>
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
3
3
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApDownLoadProps } from './interface';
|
|
1
|
+
import { ApDownLoadProps, downloadCallbackResponse } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
3
|
import { ButtonType } from '@aplus-frontend/antdv/es/button';
|
|
4
4
|
type __VLS_Props = ApDownLoadProps;
|
|
@@ -11,10 +11,10 @@ declare function __VLS_template(): {
|
|
|
11
11
|
rootEl: any;
|
|
12
12
|
};
|
|
13
13
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
-
declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
15
|
-
downloadCallback: (
|
|
14
|
+
declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
15
|
+
downloadCallback: (res?: downloadCallbackResponse | undefined) => any;
|
|
16
16
|
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
-
onDownloadCallback?: ((
|
|
17
|
+
onDownloadCallback?: ((res?: downloadCallbackResponse | undefined) => any) | undefined;
|
|
18
18
|
}>, {
|
|
19
19
|
size: "small" | "large" | "middle";
|
|
20
20
|
type: ButtonType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("@aplus-frontend/antdv"),w=require("@ant-design/icons-vue");require("../config-provider/index.js");const B=require("./hooks/index.js"),u=require("./utils/getFileInfo.js"),O=require("./hooks/useStyle.js"),q=require("lodash-unified"),z=require("../config-provider/hooks/use-locale.js"),a=require("../config-provider/hooks/use-global-config.js"),F={key:0,class:"spin"},S={key:1,class:"icon"},I={class:"text"},L=e.defineComponent({name:"ApDownload",__name:"ap-download",props:{prefixCls:{},type:{default:"link"},htmlType:{},shape:{},size:{default:"middle"},loading:{type:[Boolean,Object]},disabled:{type:Boolean,default:!1},ghost:{type:Boolean},block:{type:Boolean},danger:{type:Boolean},icon:{},href:{},target:{},title:{},onClick:{},onMousedown:{},autoInsertSpace:{type:Boolean},iconPosition:{},color:{},variant:{},text:{},fileName:{},needName:{type:[Boolean,Object]},getOssAccess:{}},emits:["downloadCallback"],setup(p,{emit:f}){const i=f,l=e.ref(!1),{lang:m}=z.useLocale(),g=e.useSlots(),C=e.computed(()=>m.value==="zh-cn"?"zh_CN":"en_US"),y=a.useGlobalConfig("uiMode"),o=p,s=a.useGlobalConfig("apUpload"),c=a.useGlobalConfig("downloadCenterTriggerConfig"),r=e.computed(()=>o.disabled),b=e.computed(()=>o.color?o.color:y.value==="aplus"?"#0070FF":"#1890FF"),N=e.computed(()=>o.size),{getInnerWrapperClass:v}=O.useStyle(b,N,r),k=e.computed(()=>o.getOssAccess||s.value?.getOssAccess),_=async()=>{if(!o.disabled){l.value=!0;try{if(c.value?.trigger){let n=u.getFileInfo(o.needName??s?.value?.needName,o.fileName).map(d=>({objectName:d.path,fileName:d.fileName}));await c.value?.trigger(n),i("downloadCallback",n)}else{const n=await(await B.useOssInit(k.value,e.unref(C))).downloadFile(u.getFileInfo(o.needName??s?.value?.needName,o.fileName));i("downloadCallback",n)}}catch(t){console.error(t)}finally{l.value=!1}}};return(t,n)=>(e.openBlock(),e.createBlock(e.unref(h.Button),e.mergeProps(e.unref(q.omit)(o,["getOssAccess","fileName","needName"]),{type:o.type,size:o.size,disabled:r.value,onClick:_}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(v))},[l.value?(e.openBlock(),e.createElementBlock("span",F,[e.createVNode(e.unref(w.LoadingOutlined),{spin:!0})])):e.createCommentVNode("",!0),e.unref(g).icon?(e.openBlock(),e.createElementBlock("span",S,[e.renderSlot(t.$slots,"icon")])):e.createCommentVNode("",!0),e.createElementVNode("span",I,e.toDisplayString(t.text),1)],2)]),_:3},16,["type","size","disabled"]))}});exports.default=L;
|
|
@@ -38,4 +38,8 @@ export declare enum ApDownLoadNeedNameKeyDefault {
|
|
|
38
38
|
pathKey = "path"
|
|
39
39
|
}
|
|
40
40
|
export type actionResponse = Awaited<ReturnType<typeof client.downloadFile>>;
|
|
41
|
+
export type downloadCallbackResponse = {
|
|
42
|
+
objectName: string;
|
|
43
|
+
fileName: string;
|
|
44
|
+
}[] | actionResponse;
|
|
41
45
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const _default: (prefixCls: string) =>
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const _default: (prefixCls: string) =>
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const _default: (prefixCls: string) =>
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
3
3
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export declare const genDrawerFormStyle: GenStyleFunc;
|
|
4
|
-
declare const _default: (prefixCls: string) =>
|
|
4
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export declare const genItemGroupStyle: GenStyleFunc;
|
|
4
|
-
declare const _default: (prefixCls: string) =>
|
|
4
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export declare const genFormItemTextGroupStyle: GenStyleFunc;
|
|
4
|
-
declare const _default: (prefixCls: string) =>
|
|
4
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export declare const genApFormItemStyle: GenStyleFunc;
|
|
4
|
-
declare const _default: (prefixCls: string) =>
|
|
4
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
5
5
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
2
|
import { ApFormToken } from './token';
|
|
3
|
-
import {
|
|
3
|
+
import { ComputedRef } from 'vue';
|
|
4
4
|
export declare const genModalFormStyle: GenStyleFunc<ApFormToken>;
|
|
5
|
-
declare const _default: (prefixCls: string) =>
|
|
5
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
6
6
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
2
|
import { ApFormToken } from './token';
|
|
3
|
-
import {
|
|
3
|
+
import { ComputedRef } from 'vue';
|
|
4
4
|
export declare const genSearchFormSorter: GenStyleFunc<ApFormToken>;
|
|
5
|
-
declare const _default: (prefixCls: string) =>
|
|
5
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
6
6
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GenStyleFunc, StyleMixin } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export declare const genPopoverStyle: StyleMixin;
|
|
4
4
|
export declare const genSearchFormStyle: GenStyleFunc;
|
|
5
|
-
declare const _default: (prefixCls: string) =>
|
|
5
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
6
6
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export declare const genEditableGridStyle: GenStyleFunc;
|
|
4
|
-
declare const _default: (prefixCls: string) =>
|
|
4
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
5
5
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export type ApGridToken = {
|
|
4
4
|
apGridFixedScrollingBoxShadowColor: string;
|
|
5
5
|
};
|
|
6
6
|
export declare const genApGridStyle: GenStyleFunc<ApGridToken>;
|
|
7
|
-
declare const _default: (prefixCls: string) =>
|
|
7
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
8
8
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("vue"),l=require("lodash-unified"),u=require("../../ap-table/utils.js"),q=require("../../ap-table/constants.js");require("../../ap-table/components/paragraph-ellipsis/index.vue.js");const A=require("../../ap-table/components/paragraph-ellipsis/index.vue2.js");function p(e,t){if(t)return l.isArray(t)?t.reduce((r,i)=>r?.[i],e):e?.[t]}function y(e){if(!l.isUndefined(e))return l.isArray(e)?e.reduce((t,r)=>l.isString(r)?`${t}${t?".":""}${r}`:`${t}[${r}]`,""):String(e)}function b(e){if(e)return e===!0?"left":e}function N(e){return l.isBoolean(e)?{sortable:e}:e?{sortable:!0,sortType:e?.type,sortBy:e?.by}:{sortable:!1}}function R(e){let t;return l.isBoolean(e.filters)&&e.valueEnum?t=u.valueEnumToArray(e.valueEnum):t=e.filters,t?.map(r=>({label:l.isString(r.text)?r.text:"",value:r.value}))}function _(e){if(e)return t=>e(t.value,t.row)}function V(e,t){return e?l.isNumber(e)?{tooltip:t,rows:e}:e===!0||e==="tooltip"?{tooltip:t,rows:1}:{tooltip:null,rows:1,htmlTitle:e==="title"?t:""}:!1}function O(e,t,r){if(q.noRenderAsFormItemValueList.includes(e.valueType))return r;if(e.copyable||e.ellipsis){const i=V(e.ellipsis,t),n=u.objectToString(t);return f.createVNode(A.default,{rawValue:n,copyable:e.copyable,ellipsis:i,content:r},null)}return r}function c(e,t,r){const i=l.pick(e,["width","minWidth","align"]);return i.field=y(e.dataIndex),i.fixed=b(e.fixed),i.slots={header:()=>u.getTableTitle(e,r,void 0,t)},i.headerAlign=e.align,i.showOverflow=!1,i.showFooterOverflow=!1,i}function g(e,t,r){if(r)return l.isString(r)?e[r]:r(e,t)}const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("vue"),l=require("lodash-unified"),u=require("../../ap-table/utils.js"),q=require("../../ap-table/constants.js");require("../../ap-table/components/paragraph-ellipsis/index.vue.js");const A=require("../../ap-table/components/paragraph-ellipsis/index.vue2.js");function p(e,t){if(t)return l.isArray(t)?t.reduce((r,i)=>r?.[i],e):e?.[t]}function y(e){if(!l.isUndefined(e))return l.isArray(e)?e.reduce((t,r)=>l.isString(r)?`${t}${t?".":""}${r}`:`${t}[${r}]`,""):String(e)}function b(e){if(e)return e===!0?"left":e}function N(e){return l.isBoolean(e)?{sortable:e}:e?{sortable:!0,sortType:e?.type,sortBy:e?.by}:{sortable:!1}}function R(e){let t;return l.isBoolean(e.filters)&&e.valueEnum?t=u.valueEnumToArray(e.valueEnum):t=e.filters,t?.map(r=>({label:l.isString(r.text)?r.text:"",value:r.value}))}function _(e){if(e)return t=>e(t.value,t.row)}function V(e,t){return e?l.isNumber(e)?{tooltip:t,rows:e}:e===!0||e==="tooltip"?{tooltip:t,rows:1}:{tooltip:null,rows:1,htmlTitle:e==="title"?t:""}:!1}function O(e,t,r){if(q.noRenderAsFormItemValueList.includes(e.valueType))return r;if(e.copyable||e.ellipsis){const i=V(e.ellipsis,t),n=u.objectToString(t);return f.createVNode(A.default,{rawValue:n,copyable:e.copyable,ellipsis:i,content:r},null)}return r}function c(e,t,r){const i=l.pick(e,["width","minWidth","align"]);return i.field=y(e.dataIndex),i.fixed=b(e.fixed),i.slots={header:()=>u.getTableTitle(e,r,void 0,t)},i.headerAlign=e.align,i.showOverflow=!1,i.showFooterOverflow=!1,i}function g(e,t,r){if(r)return l.isString(r)?e[r]:r(e,t)}const v=({value:e,...t},r,i,n=!0)=>{const a=u.getTableRenderType(r),d=u.getTableRenderProps({...r,valueType:a},{value:e,...t}),s=u.getTableCellRenderNode(a,d,t.record,i),o=r.renderText?.({value:e,...t})||e,x=r.renderText?f.createVNode(f.Fragment,null,[r.renderText?.({value:e,...t})]):s;let h=n?O(r,o,x):x;if(r.customRender){const S=r._path||[],F=g(t.record,t.rowIndex,t.params?.rowKey);h=r.customRender({value:e,...t,column:r,originalNode:h,originalText:o,path:F&&[...S,String(F)]})}return f.createVNode(f.Fragment,null,[h])};function T(e,t,r,i){const n=l.pick(e,["width","minWidth","align","resizable","className","headerClassName","footerClassName","treeNode"]);n.field=y(e.dataIndex),n.fixed=b(e.fixed),n.headerAlign=e.align,n.footerAlign=e.align,n.showOverflow=!1,n.showFooterOverflow=!1,Object.assign(n,N(e.sorter)),n.filters=R(e),n.filterMultiple=e.filterMultiple,n.filterMethod=_(e.onFilter);const a=({row:d,rowIndex:s})=>v({value:p(d,e.dataIndex),text:p(d,e.dataIndex),record:d,index:s,renderIndex:s,column:e},e,i);return n.slots={header:()=>u.getTableTitle(e,r,void 0,t),default:a,footer:a},e.html&&(delete n.slots.default,delete n.slots.footer,n.type="html"),e.seq&&(n.type="seq",n.slots={}),n}function w(e,t,r,i){if(!e.children?.length)return T(e,t,r,i);function n(d){return d.map(s=>{if(s.children?.length){const o=c(s,t,r);return o.children=n(s.children),o}return T(s,t,r,i)})}const a=c(e,t,r);return a.children=n(e.children),a}exports.contentCustom=v;exports.dataIndexToField=y;exports.getValueByDataIndex=p;exports.transformCol=w;exports.transformFixed=b;exports.transformToColGroup=c;exports.transformToColumn=T;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GenStyleFunc } from '../../design-token/interface';
|
|
2
|
-
import {
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
3
|
export type ApListToken = {
|
|
4
4
|
apListSpinnigOpacity: number;
|
|
5
5
|
};
|
|
6
6
|
export declare const genApListStyle: GenStyleFunc<ApListToken>;
|
|
7
|
-
declare const _default: (prefixCls: string) =>
|
|
7
|
+
declare const _default: (prefixCls: string) => ComputedRef<string>;
|
|
8
8
|
export default _default;
|