orion-design 0.1.31 → 0.1.32
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +5 -5
- package/dist/Throne/index.js +14 -30
- package/dist/Throne/index.js.map +1 -1
- package/dist/components/Button/index.js +33 -40
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Flex/index.js +89 -122
- package/dist/components/Flex/index.js.map +1 -1
- package/dist/components/Form/Form.js +2 -2
- package/dist/components/Form/Form.js.map +1 -1
- package/dist/components/Form/LovInput/LovInput.js +2 -2
- package/dist/components/Form/LovInput/LovInput.js.map +1 -1
- package/dist/components/Form/LovInput/hooks/useLov.js +5 -5
- package/dist/components/Form/LovInput/hooks/useLov.js.map +1 -1
- package/dist/components/Form/LovInput/index.js +4 -4
- package/dist/components/Form/hooks/FormItemValidateTrigger.js +2 -2
- package/dist/components/Form/hooks/FormItemValidateTrigger.js.map +1 -1
- package/dist/components/Form/hooks/index.js +68 -127
- package/dist/components/Form/hooks/index.js.map +1 -1
- package/dist/components/Form/index.js +656 -836
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/Form/utils/index.js +18 -30
- package/dist/components/Form/utils/index.js.map +1 -1
- package/dist/components/LovTable/LovPagetable.vue.d.ts +492 -0
- package/dist/components/LovTable/index.d.ts +246 -0
- package/dist/components/LovTable/index.js +106 -179
- package/dist/components/LovTable/index.js.map +1 -1
- package/dist/components/Modal/index.js +56 -111
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/types.d.ts +1 -1
- package/dist/components/Modal/types.js +3 -4
- package/dist/components/Modal/types.js.map +1 -1
- package/dist/components/Modal/useModal.js +5 -5
- package/dist/components/Modal/useModal.js.map +1 -1
- package/dist/components/Pagetable/Pagetable.d.ts +92 -1
- package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnLink.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +13 -0
- package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +13 -0
- package/dist/components/Pagetable/hooks/useColumns.js +85 -88
- package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
- package/dist/components/Pagetable/index.d.ts +155 -0
- package/dist/components/Pagetable/index.js +596 -683
- package/dist/components/Pagetable/index.js.map +1 -1
- package/dist/components/Pagetable/utils/index.js +54 -92
- package/dist/components/Pagetable/utils/index.js.map +1 -1
- package/dist/components/Querytable/hooks/useColumns.js +74 -82
- package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
- package/dist/components/Querytable/index.js +469 -579
- package/dist/components/Querytable/index.js.map +1 -1
- package/dist/components/Querytable/utils/index.js +54 -92
- package/dist/components/Querytable/utils/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.js +74 -100
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/Tabs/constants.js +2 -2
- package/dist/components/Tabs/constants.js.map +1 -1
- package/dist/components/Tabs/index.js +358 -603
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/tab-bar.js +6 -6
- package/dist/components/Tabs/tab-bar.js.map +1 -1
- package/dist/components/Tabs/tab-pane.js +3 -3
- package/dist/components/Tabs/tab-pane.js.map +1 -1
- package/dist/components/_constants/aria.js +2 -2
- package/dist/components/_constants/aria.js.map +1 -1
- package/dist/components/_constants/event.js +4 -6
- package/dist/components/_constants/event.js.map +1 -1
- package/dist/components/_constants/index.js +6 -6
- package/dist/components/_hooks/index.js +7 -7
- package/dist/components/_hooks/use-namespace/index.js +39 -74
- package/dist/components/_hooks/use-namespace/index.js.map +1 -1
- package/dist/components/_hooks/use-ordered-children/index.js +19 -29
- package/dist/components/_hooks/use-ordered-children/index.js.map +1 -1
- package/dist/components/_util/arrays.js +5 -9
- package/dist/components/_util/arrays.js.map +1 -1
- package/dist/components/_util/browser.js +6 -6
- package/dist/components/_util/browser.js.map +1 -1
- package/dist/components/_util/classNames.js +17 -22
- package/dist/components/_util/classNames.js.map +1 -1
- package/dist/components/_util/dom/aria.js +39 -74
- package/dist/components/_util/dom/aria.js.map +1 -1
- package/dist/components/_util/dom/element.js +8 -9
- package/dist/components/_util/dom/element.js.map +1 -1
- package/dist/components/_util/dom/event.js +7 -14
- package/dist/components/_util/dom/event.js.map +1 -1
- package/dist/components/_util/dom/index.js +36 -36
- package/dist/components/_util/dom/position.js +25 -49
- package/dist/components/_util/dom/position.js.map +1 -1
- package/dist/components/_util/dom/scroll.js +61 -103
- package/dist/components/_util/dom/scroll.js.map +1 -1
- package/dist/components/_util/dom/style.js +50 -65
- package/dist/components/_util/dom/style.js.map +1 -1
- package/dist/components/_util/easings.js +4 -8
- package/dist/components/_util/easings.js.map +1 -1
- package/dist/components/_util/error.js +11 -12
- package/dist/components/_util/error.js.map +1 -1
- package/dist/components/_util/functions.js +3 -3
- package/dist/components/_util/i18n.js +2 -2
- package/dist/components/_util/i18n.js.map +1 -1
- package/dist/components/_util/index.js +137 -137
- package/dist/components/_util/isValid.js +2 -4
- package/dist/components/_util/isValid.js.map +1 -1
- package/dist/components/_util/objects.js +14 -18
- package/dist/components/_util/objects.js.map +1 -1
- package/dist/components/_util/props-util/index.js +20 -46
- package/dist/components/_util/props-util/index.js.map +1 -1
- package/dist/components/_util/props-util/initDefaultProps.js +10 -18
- package/dist/components/_util/props-util/initDefaultProps.js.map +1 -1
- package/dist/components/_util/raf.js +4 -5
- package/dist/components/_util/raf.js.map +1 -1
- package/dist/components/_util/rand.js +3 -4
- package/dist/components/_util/rand.js.map +1 -1
- package/dist/components/_util/strings.js +8 -9
- package/dist/components/_util/strings.js.map +1 -1
- package/dist/components/_util/throttleByRaf.js +10 -16
- package/dist/components/_util/throttleByRaf.js.map +1 -1
- package/dist/components/_util/type.js +38 -41
- package/dist/components/_util/type.js.map +1 -1
- package/dist/components/_util/types.js +22 -41
- package/dist/components/_util/types.js.map +1 -1
- package/dist/components/_util/typescript.js +2 -2
- package/dist/components/_util/typescript.js.map +1 -1
- package/dist/components/_util/util.js +43 -85
- package/dist/components/_util/util.js.map +1 -1
- package/dist/components/_util/vue/global-node.js +15 -27
- package/dist/components/_util/vue/global-node.js.map +1 -1
- package/dist/components/_util/vue/icon.js +25 -29
- package/dist/components/_util/vue/icon.js.map +1 -1
- package/dist/components/_util/vue/index.js +41 -41
- package/dist/components/_util/vue/install.js +18 -35
- package/dist/components/_util/vue/install.js.map +1 -1
- package/dist/components/_util/vue/props/index.js +6 -6
- package/dist/components/_util/vue/props/runtime.js +30 -46
- package/dist/components/_util/vue/props/runtime.js.map +1 -1
- package/dist/components/_util/vue/refs.js +6 -12
- package/dist/components/_util/vue/refs.js.map +1 -1
- package/dist/components/_util/vue/size.js +3 -5
- package/dist/components/_util/vue/size.js.map +1 -1
- package/dist/components/_util/vue/validator.js +4 -5
- package/dist/components/_util/vue/validator.js.map +1 -1
- package/dist/components/_util/vue/vnode.js +54 -100
- package/dist/components/_util/vue/vnode.js.map +1 -1
- package/dist/components/_util/vue-types/index.js +220 -231
- package/dist/components/_util/vue-types/index.js.map +1 -1
- package/dist/components/components.js +20 -20
- package/dist/components/index.js +35 -38
- package/dist/components/index.js.map +1 -1
- package/dist/error/OrionError.js +4 -8
- package/dist/error/OrionError.js.map +1 -1
- package/dist/index.css +1 -797
- package/dist/index.js +36 -36
- package/dist/print/LodopFuncs.js +43 -101
- package/dist/print/LodopFuncs.js.map +1 -1
- package/dist/print/index.js +108 -200
- package/dist/print/index.js.map +1 -1
- package/dist/request/ErrorHandlerChain.js +14 -17
- package/dist/request/ErrorHandlerChain.js.map +1 -1
- package/dist/request/RequestFilterChain.js +13 -16
- package/dist/request/RequestFilterChain.js.map +1 -1
- package/dist/request/ResponseParserChain.js +14 -17
- package/dist/request/ResponseParserChain.js.map +1 -1
- package/dist/request/disivion/DateSerializer.js +22 -47
- package/dist/request/disivion/DateSerializer.js.map +1 -1
- package/dist/request/disivion/DivisionErrorHandler.js +25 -40
- package/dist/request/disivion/DivisionErrorHandler.js.map +1 -1
- package/dist/request/disivion/DivisionResponseParser.js +10 -16
- package/dist/request/disivion/DivisionResponseParser.js.map +1 -1
- package/dist/request/disivion/index.js +201 -305
- package/dist/request/disivion/index.js.map +1 -1
- package/dist/request/error/BizExceptionResponseError.js +5 -11
- package/dist/request/error/BizExceptionResponseError.js.map +1 -1
- package/dist/request/error/ExceptionResponseError.js +5 -11
- package/dist/request/error/ExceptionResponseError.js.map +1 -1
- package/dist/request/error/ResponseError.js +4 -9
- package/dist/request/error/ResponseError.js.map +1 -1
- package/dist/request/error/SessionExceptionResponseError.js +5 -11
- package/dist/request/error/SessionExceptionResponseError.js.map +1 -1
- package/dist/request/index.js +11 -11
- package/dist/utils/DateUtil.js +33 -48
- package/dist/utils/DateUtil.js.map +1 -1
- package/dist/utils/NumberUtil.js +6 -6
- package/dist/utils/NumberUtil.js.map +1 -1
- package/dist/utils/cloneDeep.js +2 -2
- package/dist/utils/delay.js +3 -3
- package/dist/utils/delay.js.map +1 -1
- package/dist/utils/functions.js +3 -3
- package/dist/utils/index.js +12 -12
- package/dist/utils/md5.js +93 -191
- package/dist/utils/md5.js.map +1 -1
- package/dist/utils/uuid.js +25 -35
- package/dist/utils/uuid.js.map +1 -1
- package/dist/version/index.js +2 -2
- package/dist/version/version.d.ts +1 -1
- package/dist/version/version.js +2 -2
- package/dist/version/version.js.map +1 -1
- package/package.json +1 -1
- package/dist/_commonjsHelpers-DWwsNxpa.js +0 -9
- package/dist/_commonjsHelpers-DWwsNxpa.js.map +0 -1
- package/dist/components-B3d9m_tn.js +0 -27
- package/dist/components-B3d9m_tn.js.map +0 -1
- package/dist/functions-BeMkokbY.js +0 -63
- package/dist/functions-BeMkokbY.js.map +0 -1
- package/dist/index-BOKLZnqH.js +0 -54
- package/dist/index-BOKLZnqH.js.map +0 -1
- package/dist/index-D1m0KTpK.js +0 -69
- package/dist/index-D1m0KTpK.js.map +0 -1
- package/dist/index-DR5ZP7mD.js +0 -160
- package/dist/index-DR5ZP7mD.js.map +0 -1
- package/dist/index-DkwIULcN.js +0 -200
- package/dist/index-DkwIULcN.js.map +0 -1
@@ -1,105 +1,97 @@
|
|
1
|
-
import { computed } from "vue";
|
2
|
-
import
|
3
|
-
import { camelize } from "../../_util/util.js";
|
4
|
-
import { filterEmpty } from "../../_util/props-util/index.js";
|
5
|
-
function
|
6
|
-
|
7
|
-
var
|
8
|
-
const
|
9
|
-
for (const [
|
10
|
-
delete
|
11
|
-
|
12
|
-
}
|
13
|
-
if (c.type.name === "OQuerytableColumnIndex") {
|
1
|
+
import { computed as y } from "vue";
|
2
|
+
import f from "../../../error/OrionError.js";
|
3
|
+
import { camelize as g } from "../../_util/util.js";
|
4
|
+
import { filterEmpty as d } from "../../_util/props-util/index.js";
|
5
|
+
function l(t) {
|
6
|
+
return t == null ? void 0 : t.map((n) => {
|
7
|
+
var a, i;
|
8
|
+
const e = { ...n.props || {} };
|
9
|
+
for (const [m, h] of Object.entries(e))
|
10
|
+
delete e[m], e[g(m)] = h;
|
11
|
+
if (n.type.name === "OQuerytableColumnIndex")
|
14
12
|
return {
|
15
|
-
type:
|
13
|
+
type: n.type.name
|
16
14
|
};
|
17
|
-
|
15
|
+
if (n.type.name === "OQuerytableColumnString" || n.type.name === "OQuerytableColumnLink")
|
18
16
|
return {
|
19
|
-
type:
|
20
|
-
head:
|
21
|
-
headAlign:
|
22
|
-
name:
|
23
|
-
width:
|
24
|
-
fixed:
|
17
|
+
type: n.type.name,
|
18
|
+
head: e == null ? void 0 : e.head,
|
19
|
+
headAlign: e == null ? void 0 : e.headAlign,
|
20
|
+
name: e == null ? void 0 : e.name,
|
21
|
+
width: e == null ? void 0 : e.width,
|
22
|
+
fixed: e == null ? void 0 : e.fixed
|
25
23
|
};
|
26
|
-
|
24
|
+
if (n.type.name === "OQuerytableColumnNumber")
|
27
25
|
return {
|
28
|
-
type:
|
29
|
-
head:
|
30
|
-
headAlign:
|
31
|
-
name:
|
32
|
-
width:
|
33
|
-
fixed:
|
34
|
-
thousandsSeparator:
|
35
|
-
precision: Number(
|
36
|
-
percentage:
|
26
|
+
type: n.type.name,
|
27
|
+
head: e == null ? void 0 : e.head,
|
28
|
+
headAlign: e == null ? void 0 : e.headAlign,
|
29
|
+
name: e == null ? void 0 : e.name,
|
30
|
+
width: e == null ? void 0 : e.width,
|
31
|
+
fixed: e == null ? void 0 : e.fixed,
|
32
|
+
thousandsSeparator: e == null ? void 0 : e.thousandsSeparator,
|
33
|
+
precision: Number(e == null ? void 0 : e.precision),
|
34
|
+
percentage: e == null ? void 0 : e.percentage
|
37
35
|
};
|
38
|
-
|
36
|
+
if (n.type.name === "OQuerytableColumnDate")
|
39
37
|
return {
|
40
|
-
type:
|
41
|
-
head:
|
42
|
-
headAlign:
|
43
|
-
name:
|
44
|
-
width:
|
45
|
-
fixed:
|
46
|
-
format:
|
47
|
-
sourceFormat:
|
38
|
+
type: n.type.name,
|
39
|
+
head: e == null ? void 0 : e.head,
|
40
|
+
headAlign: e == null ? void 0 : e.headAlign,
|
41
|
+
name: e == null ? void 0 : e.name,
|
42
|
+
width: e == null ? void 0 : e.width,
|
43
|
+
fixed: e == null ? void 0 : e.fixed,
|
44
|
+
format: e == null ? void 0 : e.format,
|
45
|
+
sourceFormat: e == null ? void 0 : e.sourceFormat
|
48
46
|
};
|
49
|
-
|
47
|
+
if (n.type.name === "OQuerytableColumnSingleselect" || n.type.name === "OQuerytableColumnMultiselect")
|
50
48
|
return {
|
51
|
-
type:
|
52
|
-
head:
|
53
|
-
headAlign:
|
54
|
-
name:
|
55
|
-
width:
|
56
|
-
fixed:
|
57
|
-
code:
|
49
|
+
type: n.type.name,
|
50
|
+
head: e == null ? void 0 : e.head,
|
51
|
+
headAlign: e == null ? void 0 : e.headAlign,
|
52
|
+
name: e == null ? void 0 : e.name,
|
53
|
+
width: e == null ? void 0 : e.width,
|
54
|
+
fixed: e == null ? void 0 : e.fixed,
|
55
|
+
code: e == null ? void 0 : e.code
|
58
56
|
};
|
59
|
-
|
57
|
+
if (n.type.name === "OQuerytableColumnButtongroup")
|
60
58
|
return {
|
61
|
-
type:
|
62
|
-
head:
|
63
|
-
headAlign:
|
64
|
-
name:
|
65
|
-
width:
|
66
|
-
fixed:
|
67
|
-
children:
|
59
|
+
type: n.type.name,
|
60
|
+
head: e == null ? void 0 : e.head,
|
61
|
+
headAlign: e == null ? void 0 : e.headAlign,
|
62
|
+
name: e == null ? void 0 : e.name,
|
63
|
+
width: e == null ? void 0 : e.width,
|
64
|
+
fixed: e == null ? void 0 : e.fixed,
|
65
|
+
children: n.children
|
68
66
|
};
|
69
|
-
|
67
|
+
if (n.type.name === "OQuerytableColumngroup")
|
70
68
|
return {
|
71
|
-
type:
|
72
|
-
head:
|
73
|
-
headAlign:
|
74
|
-
children:
|
69
|
+
type: n.type.name,
|
70
|
+
head: e == null ? void 0 : e.head,
|
71
|
+
headAlign: e == null ? void 0 : e.headAlign,
|
72
|
+
children: l(d((i = (a = n.children) == null ? void 0 : a.default) == null ? void 0 : i.call(a)))
|
75
73
|
};
|
76
|
-
|
74
|
+
if (n.type.name === "OQuerytableColumnDiy")
|
77
75
|
return {
|
78
|
-
type:
|
79
|
-
head:
|
80
|
-
headAlign:
|
81
|
-
name:
|
82
|
-
width:
|
83
|
-
fixed:
|
84
|
-
children:
|
76
|
+
type: n.type.name,
|
77
|
+
head: e == null ? void 0 : e.head,
|
78
|
+
headAlign: e == null ? void 0 : e.headAlign,
|
79
|
+
name: e == null ? void 0 : e.name,
|
80
|
+
width: e == null ? void 0 : e.width,
|
81
|
+
fixed: e == null ? void 0 : e.fixed,
|
82
|
+
children: n.children
|
85
83
|
};
|
86
|
-
|
87
|
-
throw new OrionError(`OQuerytable不能正确解析'${c.type.name}'子组件。`);
|
88
|
-
}
|
84
|
+
throw new f(`OQuerytable不能正确解析'${n.type.name}'子组件。`);
|
89
85
|
});
|
90
|
-
return tableColumns;
|
91
86
|
}
|
92
|
-
function
|
93
|
-
|
94
|
-
var
|
95
|
-
const
|
96
|
-
|
97
|
-
const tableColumns = genColumns(non_empty_children);
|
98
|
-
return tableColumns;
|
87
|
+
function A(t) {
|
88
|
+
return y(() => {
|
89
|
+
var i;
|
90
|
+
const n = (i = t.default) == null ? void 0 : i.call(t), e = d(n);
|
91
|
+
return l(e);
|
99
92
|
});
|
100
|
-
return columns;
|
101
93
|
}
|
102
94
|
export {
|
103
|
-
|
95
|
+
A as default
|
104
96
|
};
|
105
97
|
//# sourceMappingURL=useColumns.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useColumns.js","sources":["../../../../src/components/Querytable/hooks/useColumns.ts"],"sourcesContent":["import { computed } from 'vue'\r\nimport OrionError from '../../../error/OrionError'\r\n\r\nimport { camelize } from '../../../components/_util/util'\r\nimport { filterEmpty } from '../../_util/props-util'\r\n\r\nfunction genColumns(children) {\r\n const tableColumns = children?.map((c) => {\r\n const props = { ...(c.props || {}) }\r\n for (const [k, v] of Object.entries(props)) {\r\n delete props[k]\r\n props[camelize(k)] = v\r\n }\r\n\r\n if (c.type.name === 'OQuerytableColumnIndex') {\r\n return {\r\n type: c.type.name,\r\n }\r\n } else if (c.type.name === 'OQuerytableColumnString' || c.type.name === 'OQuerytableColumnLink') {\r\n return {\r\n type: c.type.name,\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n }\r\n } else if (c.type.name === 'OQuerytableColumnNumber') {\r\n return {\r\n type: c.type.name,\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n\r\n thousandsSeparator: props?.thousandsSeparator,\r\n precision: Number(props?.precision),\r\n percentage: props?.percentage,\r\n }\r\n } else if (c.type.name === 'OQuerytableColumnDate') {\r\n return {\r\n type: c.type.name,\r\n\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n\r\n format: props?.format,\r\n sourceFormat: props?.sourceFormat,\r\n }\r\n } else if (c.type.name === 'OQuerytableColumnSingleselect' || c.type.name === 'OQuerytableColumnMultiselect') {\r\n return {\r\n type: c.type.name,\r\n\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n\r\n code: props?.code,\r\n }\r\n } else if (c.type.name === 'OQuerytableColumnButtongroup') {\r\n return {\r\n type: c.type.name,\r\n\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n\r\n children: c.children,\r\n }\r\n } else if (c.type.name === 'OQuerytableColumngroup') {\r\n return {\r\n type: c.type.name,\r\n\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n\r\n children: genColumns(filterEmpty(c.children?.default?.())),\r\n }\r\n } else if (c.type.name === 'OQuerytableColumnDiy') {\r\n return {\r\n type: c.type.name,\r\n\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n\r\n children: c.children,\r\n }\r\n } else {\r\n throw new OrionError(`OQuerytable不能正确解析'${c.type.name}'子组件。`)\r\n }\r\n })\r\n\r\n return tableColumns\r\n}\r\n\r\nexport default function useColumns(slots) {\r\n const columns = computed(() => {\r\n const children = slots.default?.()\r\n\r\n const non_empty_children = filterEmpty(children)\r\n\r\n const tableColumns = genColumns(non_empty_children)\r\n\r\n return tableColumns\r\n })\r\n\r\n return columns\r\n}\r\n"],"names":[],"mappings":";;;;AAMA,
|
1
|
+
{"version":3,"file":"useColumns.js","sources":["../../../../src/components/Querytable/hooks/useColumns.ts"],"sourcesContent":["import { computed } from 'vue'\r\nimport OrionError from '../../../error/OrionError'\r\n\r\nimport { camelize } from '../../../components/_util/util'\r\nimport { filterEmpty } from '../../_util/props-util'\r\n\r\nfunction genColumns(children) {\r\n const tableColumns = children?.map((c) => {\r\n const props = { ...(c.props || {}) }\r\n for (const [k, v] of Object.entries(props)) {\r\n delete props[k]\r\n props[camelize(k)] = v\r\n }\r\n\r\n if (c.type.name === 'OQuerytableColumnIndex') {\r\n return {\r\n type: c.type.name,\r\n }\r\n } else if (c.type.name === 'OQuerytableColumnString' || c.type.name === 'OQuerytableColumnLink') {\r\n return {\r\n type: c.type.name,\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n }\r\n } else if (c.type.name === 'OQuerytableColumnNumber') {\r\n return {\r\n type: c.type.name,\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n\r\n thousandsSeparator: props?.thousandsSeparator,\r\n precision: Number(props?.precision),\r\n percentage: props?.percentage,\r\n }\r\n } else if (c.type.name === 'OQuerytableColumnDate') {\r\n return {\r\n type: c.type.name,\r\n\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n\r\n format: props?.format,\r\n sourceFormat: props?.sourceFormat,\r\n }\r\n } else if (c.type.name === 'OQuerytableColumnSingleselect' || c.type.name === 'OQuerytableColumnMultiselect') {\r\n return {\r\n type: c.type.name,\r\n\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n\r\n code: props?.code,\r\n }\r\n } else if (c.type.name === 'OQuerytableColumnButtongroup') {\r\n return {\r\n type: c.type.name,\r\n\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n\r\n children: c.children,\r\n }\r\n } else if (c.type.name === 'OQuerytableColumngroup') {\r\n return {\r\n type: c.type.name,\r\n\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n\r\n children: genColumns(filterEmpty(c.children?.default?.())),\r\n }\r\n } else if (c.type.name === 'OQuerytableColumnDiy') {\r\n return {\r\n type: c.type.name,\r\n\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n\r\n children: c.children,\r\n }\r\n } else {\r\n throw new OrionError(`OQuerytable不能正确解析'${c.type.name}'子组件。`)\r\n }\r\n })\r\n\r\n return tableColumns\r\n}\r\n\r\nexport default function useColumns(slots) {\r\n const columns = computed(() => {\r\n const children = slots.default?.()\r\n\r\n const non_empty_children = filterEmpty(children)\r\n\r\n const tableColumns = genColumns(non_empty_children)\r\n\r\n return tableColumns\r\n })\r\n\r\n return columns\r\n}\r\n"],"names":["genColumns","children","c","props","k","v","camelize","filterEmpty","_b","_a","OrionError","useColumns","slots","computed","non_empty_children"],"mappings":";;;;AAMA,SAASA,EAAWC,GAAU;AAiGrB,SAhGcA,KAAA,gBAAAA,EAAU,IAAI,CAACC,MAAM;;AACxC,UAAMC,IAAQ,EAAE,GAAID,EAAE,SAAS,CAAI,EAAA;AACnC,eAAW,CAACE,GAAGC,CAAC,KAAK,OAAO,QAAQF,CAAK;AACvC,aAAOA,EAAMC,CAAC,GACRD,EAAAG,EAASF,CAAC,CAAC,IAAIC;AAGnB,QAAAH,EAAE,KAAK,SAAS;AACX,aAAA;AAAA,QACL,MAAMA,EAAE,KAAK;AAAA,MAAA;AAEjB,QAAWA,EAAE,KAAK,SAAS,6BAA6BA,EAAE,KAAK,SAAS;AAC/D,aAAA;AAAA,QACL,MAAMA,EAAE,KAAK;AAAA,QACb,MAAMC,KAAA,gBAAAA,EAAO;AAAA,QACb,WAAWA,KAAA,gBAAAA,EAAO;AAAA,QAClB,MAAMA,KAAA,gBAAAA,EAAO;AAAA,QACb,OAAOA,KAAA,gBAAAA,EAAO;AAAA,QACd,OAAOA,KAAA,gBAAAA,EAAO;AAAA,MAAA;AAEP,QAAAD,EAAE,KAAK,SAAS;AAClB,a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