orion-design 0.1.31 → 0.1.33
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/hooks/use-throne-context.d.ts +5 -0
- package/dist/Throne/hooks/use-throne-context.js +15 -0
- package/dist/Throne/hooks/use-throne-context.js.map +1 -0
- package/dist/Throne/index.d.ts +1 -1
- package/dist/Throne/index.js +14 -30
- package/dist/Throne/index.js.map +1 -1
- package/dist/components/Button/ButtonGroup/ButtonGroup.d.ts +2 -0
- package/dist/components/Button/index.js +36 -41
- 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/FileInput/FileInput.vue.d.ts +4 -4
- 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/LovInput.vue.d.ts +894 -0
- 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/MultiTableSelect/MultiTableSelect.d.ts +26 -0
- package/dist/components/Form/MultiTableSelect/MultiTableSelect.js +5 -0
- package/dist/components/Form/MultiTableSelect/MultiTableSelect.js.map +1 -0
- package/dist/components/Form/MultiTableSelect/MultiTableSelect.vue.d.ts +6249 -0
- package/dist/components/Form/MultiTableSelect/hooks/useMultiTableSelect.d.ts +1 -0
- package/dist/components/Form/MultiTableSelect/hooks/useMultiTableSelect.js +9 -0
- package/dist/components/Form/MultiTableSelect/hooks/useMultiTableSelect.js.map +1 -0
- package/dist/components/Form/MultiTableSelect/index.d.ts +2 -0
- package/dist/components/Form/MultiTableSelect/index.js +7 -0
- package/dist/components/Form/MultiTableSelect/index.js.map +1 -0
- 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 +69 -127
- package/dist/components/Form/hooks/index.js.map +1 -1
- package/dist/components/Form/index.d.ts +3 -0
- package/dist/components/Form/index.js +790 -829
- 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 +510 -6
- package/dist/components/LovTable/LovQuerytable.vue.d.ts +468 -4
- package/dist/components/LovTable/index.d.ts +489 -5
- package/dist/components/LovTable/index.js +104 -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/MultiTableSelectPagetable/MultiTableSelectPagetable.vue.d.ts +880 -0
- package/dist/components/MultiTableSelectPagetable/index.d.ts +462 -0
- package/dist/components/MultiTableSelectPagetable/index.js +164 -0
- package/dist/components/MultiTableSelectPagetable/index.js.map +1 -0
- package/dist/components/Pagetable/Pagetable.d.ts +96 -3
- package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnDiy.d.ts +1 -1
- package/dist/components/Pagetable/columns/PagetableColumnLink.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +14 -1
- package/dist/components/Pagetable/hooks/useCode.d.ts +2 -0
- package/dist/components/Pagetable/hooks/useCode.js +24 -0
- package/dist/components/Pagetable/hooks/useCode.js.map +1 -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 +159 -2
- package/dist/components/Pagetable/index.js +601 -684
- 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/Querytable.d.ts +80 -2
- package/dist/components/Querytable/columns/QuerytableColumnButtongroup.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnDate.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnDiy.d.ts +1 -1
- package/dist/components/Querytable/columns/QuerytableColumnLink.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnMultiselect.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnNumber.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnSingleselect.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnString.d.ts +14 -1
- package/dist/components/Querytable/hooks/useColumns.js +79 -82
- package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
- package/dist/components/Querytable/index.d.ts +147 -1
- package/dist/components/Querytable/index.js +526 -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/Throne/ThroneContextProvider.d.ts +25 -0
- 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.d.ts +2 -0
- package/dist/components/components.js +24 -20
- package/dist/components/components.js.map +1 -1
- package/dist/components/index.js +43 -38
- package/dist/components/index.js.map +1 -1
- package/dist/components-DP9bnDLm.js +48 -0
- package/dist/components-DP9bnDLm.js.map +1 -0
- package/dist/error/OrionError.js +4 -8
- package/dist/error/OrionError.js.map +1 -1
- package/dist/{index-C6P_0wAy.js → index-ChkLOmNK.js} +76 -46
- package/dist/{index-C6P_0wAy.js.map → index-ChkLOmNK.js.map} +1 -1
- package/dist/index.css +1 -797
- package/dist/index.d.ts +1 -0
- package/dist/index.js +46 -36
- package/dist/index.js.map +1 -1
- 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-8oZ2kpUC.js +0 -27
- package/dist/components-8oZ2kpUC.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
@@ -0,0 +1 @@
|
|
1
|
+
export default function useMultiTableSelect(): import('..').MultiTableSelectContext | undefined;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useMultiTableSelect.js","sources":["../../../../../src/components/Form/MultiTableSelect/hooks/useMultiTableSelect.ts"],"sourcesContent":["import { inject } from 'vue'\r\nimport { multiTableSelectContext } from '../MultiTableSelect'\r\n\r\nexport default function useMultiTableSelect() {\r\n return inject(multiTableSelectContext)\r\n}\r\n"],"names":["useMultiTableSelect","inject","multiTableSelectContext"],"mappings":";;AAGA,SAAwBA,IAAsB;AAC5C,SAAOC,EAAOC,CAAuB;AACvC;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
const
|
1
|
+
const r = {
|
2
2
|
OFormString: "blur",
|
3
3
|
OFormSingleselect: "change",
|
4
4
|
OFormMultiselect: "change",
|
@@ -13,6 +13,6 @@ const formItemValidateTrigger = {
|
|
13
13
|
OFormDiy: "blur"
|
14
14
|
};
|
15
15
|
export {
|
16
|
-
|
16
|
+
r as default
|
17
17
|
};
|
18
18
|
//# sourceMappingURL=FormItemValidateTrigger.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FormItemValidateTrigger.js","sources":["../../../../src/components/Form/hooks/FormItemValidateTrigger.ts"],"sourcesContent":["export default {\r\n OFormString: 'blur',\r\n OFormSingleselect: 'change',\r\n OFormMultiselect: 'change',\r\n OFormRadiogroup: 'change',\r\n OFormCheckboxgroup: 'change',\r\n OFormCheckbox: 'change',\r\n OFormSwitch: 'change',\r\n OFormTextarea: 'blur',\r\n OFormPassword: 'blur',\r\n OFormDate: 'blur',\r\n OFormFile: 'blur',\r\n OFormDiy: 'blur',\r\n}\r\n"],"names":[],"mappings":"AAAA,
|
1
|
+
{"version":3,"file":"FormItemValidateTrigger.js","sources":["../../../../src/components/Form/hooks/FormItemValidateTrigger.ts"],"sourcesContent":["export default {\r\n OFormString: 'blur',\r\n OFormSingleselect: 'change',\r\n OFormMultiselect: 'change',\r\n OFormRadiogroup: 'change',\r\n OFormCheckboxgroup: 'change',\r\n OFormCheckbox: 'change',\r\n OFormSwitch: 'change',\r\n OFormTextarea: 'blur',\r\n OFormPassword: 'blur',\r\n OFormDate: 'blur',\r\n OFormFile: 'blur',\r\n OFormDiy: 'blur',\r\n}\r\n"],"names":["formItemValidateTrigger"],"mappings":"AAAA,MAAeA,IAAA;AAAA,EACb,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,eAAe;AAAA,EACf,aAAa;AAAA,EACb,eAAe;AAAA,EACf,eAAe;AAAA,EACf,WAAW;AAAA,EACX,WAAW;AAAA,EACX,UAAU;AACZ;"}
|
@@ -1,145 +1,87 @@
|
|
1
|
-
import { inject, getCurrentInstance, computed } from "vue";
|
2
|
-
import { formContextKey } from "../Form.js";
|
3
|
-
import
|
4
|
-
import { castArray, isString, isArray } from "lodash-es";
|
5
|
-
import
|
6
|
-
import
|
7
|
-
|
8
|
-
|
9
|
-
};
|
10
|
-
|
11
|
-
|
12
|
-
const { props } =
|
13
|
-
|
14
|
-
|
15
|
-
const
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
}
|
23
|
-
return computed(() => {
|
24
|
-
const rules = [];
|
25
|
-
let flag = true;
|
26
|
-
if (required) {
|
27
|
-
if (props.rules) {
|
28
|
-
rules.push(...castArray(props.rules));
|
29
|
-
flag = !rules.some((rule) => Object.keys(rule).includes("required"));
|
30
|
-
}
|
31
|
-
if (formContext.rules && formContext.rules[name]) {
|
32
|
-
const formRules = castArray(formContext.rules[name]);
|
33
|
-
flag = !formRules.some((rule) => Object.keys(rule).includes("required"));
|
34
|
-
}
|
35
|
-
}
|
36
|
-
if (flag) {
|
37
|
-
rules.push({
|
38
|
-
required: true,
|
39
|
-
message: `必填项[${label ? label : name}]不能为空`,
|
40
|
-
trigger
|
41
|
-
});
|
42
|
-
}
|
43
|
-
return rules;
|
1
|
+
import { inject as C, getCurrentInstance as s, computed as n } from "vue";
|
2
|
+
import { formContextKey as M } from "../Form.js";
|
3
|
+
import V from "../../../Throne/index.js";
|
4
|
+
import { castArray as p, isString as x, isArray as I } from "lodash-es";
|
5
|
+
import f from "../../../error/OrionError.js";
|
6
|
+
import F from "./FormItemValidateTrigger.js";
|
7
|
+
import { useThroneContext as b } from "../../../Throne/hooks/use-throne-context.js";
|
8
|
+
const u = () => C(M), R = () => {
|
9
|
+
const t = u(), { props: o } = s();
|
10
|
+
return n(() => o.span ? o.span : t.itemSpan);
|
11
|
+
}, T = () => {
|
12
|
+
const t = u(), { props: o, type: r } = s(), { name: e, label: l, required: m } = o;
|
13
|
+
let a = F[r.name];
|
14
|
+
return a || (a = "change"), n(() => {
|
15
|
+
const c = [];
|
16
|
+
let i = !0;
|
17
|
+
return m && (o.rules && (c.push(...p(o.rules)), i = !c.some((d) => Object.keys(d).includes("required"))), t.rules && t.rules[e] && (i = !p(t.rules[e]).some((g) => Object.keys(g).includes("required")))), i && c.push({
|
18
|
+
required: !0,
|
19
|
+
message: `必填项[${l || e}]不能为空`,
|
20
|
+
trigger: a
|
21
|
+
}), c;
|
44
22
|
});
|
45
|
-
}
|
46
|
-
const
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
} else {
|
63
|
-
throw new OrionError("code类型错误");
|
64
|
-
}
|
65
|
-
return codeData;
|
23
|
+
}, k = () => {
|
24
|
+
const t = u(), { props: o } = s();
|
25
|
+
return n(() => t.disabled || o.disabled);
|
26
|
+
}, w = () => {
|
27
|
+
const { props: t } = s(), o = b();
|
28
|
+
return n(() => {
|
29
|
+
let r;
|
30
|
+
const { code: e } = t;
|
31
|
+
if (e)
|
32
|
+
if (x(e))
|
33
|
+
r = V.getCode(e, o == null ? void 0 : o.value).value;
|
34
|
+
else if (I(e))
|
35
|
+
r = e;
|
36
|
+
else
|
37
|
+
throw new f("code类型错误");
|
38
|
+
else throw new f("code为空");
|
39
|
+
return r;
|
66
40
|
});
|
67
|
-
}
|
68
|
-
const
|
69
|
-
|
70
|
-
const { props } = getCurrentInstance();
|
71
|
-
const { name } = props;
|
72
|
-
return computed({
|
41
|
+
}, A = () => {
|
42
|
+
const t = u(), { props: o } = s(), { name: r } = o;
|
43
|
+
return n({
|
73
44
|
get: () => {
|
74
|
-
const
|
75
|
-
|
76
|
-
return "";
|
77
|
-
}
|
78
|
-
return value;
|
45
|
+
const e = t.modelValue[r];
|
46
|
+
return e || "";
|
79
47
|
},
|
80
|
-
set: (
|
81
|
-
|
82
|
-
formContext.updateModelValue(name, "");
|
83
|
-
} else {
|
84
|
-
formContext.updateModelValue(name, newValue);
|
85
|
-
}
|
48
|
+
set: (e) => {
|
49
|
+
e ? t.updateModelValue(r, e) : t.updateModelValue(r, "");
|
86
50
|
}
|
87
51
|
});
|
88
|
-
}
|
89
|
-
const
|
90
|
-
|
91
|
-
const { props } = getCurrentInstance();
|
92
|
-
const { name } = props;
|
93
|
-
return computed({
|
52
|
+
}, D = () => {
|
53
|
+
const t = u(), { props: o } = s(), { name: r } = o;
|
54
|
+
return n({
|
94
55
|
get: () => {
|
95
|
-
const
|
96
|
-
if (
|
97
|
-
return
|
98
|
-
}
|
99
|
-
return value.split(",");
|
56
|
+
const e = t.modelValue[r];
|
57
|
+
if (e)
|
58
|
+
return e.split(",");
|
100
59
|
},
|
101
|
-
set: (
|
102
|
-
|
103
|
-
formContext.updateModelValue(name, "");
|
104
|
-
} else {
|
105
|
-
formContext.updateModelValue(name, newValue.join(","));
|
106
|
-
}
|
60
|
+
set: (e) => {
|
61
|
+
e ? t.updateModelValue(r, e.join(",")) : t.updateModelValue(r, "");
|
107
62
|
}
|
108
63
|
});
|
109
|
-
}
|
110
|
-
const
|
111
|
-
|
112
|
-
const { props } = getCurrentInstance();
|
113
|
-
const { name } = props;
|
114
|
-
return computed({
|
64
|
+
}, B = () => {
|
65
|
+
const t = u(), { props: o } = s(), { name: r } = o;
|
66
|
+
return n({
|
115
67
|
get: () => {
|
116
|
-
const
|
117
|
-
|
118
|
-
return false;
|
119
|
-
}
|
120
|
-
return value == "1";
|
68
|
+
const e = t.modelValue[r];
|
69
|
+
return e ? e == "1" : !1;
|
121
70
|
},
|
122
|
-
set: (
|
123
|
-
const
|
124
|
-
|
125
|
-
if (oldValue) {
|
126
|
-
formContext.updateModelValue(name, newValue);
|
127
|
-
} else {
|
128
|
-
if (_newValue) {
|
129
|
-
formContext.updateModelValue(name, newValue);
|
130
|
-
}
|
131
|
-
}
|
71
|
+
set: (e) => {
|
72
|
+
const l = t.modelValue[r], m = e ? "1" : "0";
|
73
|
+
(l || e) && t.updateModelValue(r, m);
|
132
74
|
}
|
133
75
|
});
|
134
76
|
};
|
135
77
|
export {
|
136
|
-
useFormContext,
|
137
|
-
useFormItemBooleanModel,
|
138
|
-
useFormItemCode,
|
139
|
-
useFormItemDisabled,
|
140
|
-
useFormItemMultiModel,
|
141
|
-
useFormItemRules,
|
142
|
-
useFormItemSpan,
|
143
|
-
useFormItemStringModel
|
78
|
+
u as useFormContext,
|
79
|
+
B as useFormItemBooleanModel,
|
80
|
+
w as useFormItemCode,
|
81
|
+
k as useFormItemDisabled,
|
82
|
+
D as useFormItemMultiModel,
|
83
|
+
T as useFormItemRules,
|
84
|
+
R as useFormItemSpan,
|
85
|
+
A as useFormItemStringModel
|
144
86
|
};
|
145
87
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Form/hooks/index.ts"],"sourcesContent":["import { inject, getCurrentInstance, computed } from 'vue'\r\nimport { formContextKey, FormItemRule } from '../Form'\r\nimport Throne from '../../../Throne'\r\nimport { CodeItem } from '../../types'\r\nimport { castArray, isArray, isString } from 'lodash-es'\r\nimport OrionError from '../../../error/OrionError'\r\nimport formItemValidateTrigger from './FormItemValidateTrigger'\r\n\r\nconst useFormContext = () => {\r\n return inject(formContextKey)\r\n}\r\n\r\nconst useFormItemSpan = () => {\r\n const formContext = useFormContext()!\r\n const { props } = getCurrentInstance()!\r\n\r\n return computed(() => (props.span ? (props.span as number) : formContext.itemSpan))\r\n}\r\n\r\nconst useFormItemRules = () => {\r\n const formContext = useFormContext()!\r\n const { props, type } = getCurrentInstance()!\r\n const { name, label, required } = props\r\n let trigger = formItemValidateTrigger[type.name!]\r\n if (!trigger) {\r\n trigger = 'change'\r\n }\r\n\r\n return computed(() => {\r\n const rules: FormItemRule[] = []\r\n let flag = true\r\n\r\n if (required) {\r\n if (props.rules) {\r\n rules.push(...castArray(props.rules))\r\n flag = !rules.some((rule) => Object.keys(rule).includes('required'))\r\n }\r\n if (formContext.rules && formContext.rules[name as string]) {\r\n const formRules = castArray(formContext.rules[name as string])\r\n flag = !formRules.some((rule) => Object.keys(rule).includes('required'))\r\n }\r\n }\r\n\r\n if (flag) {\r\n rules.push({\r\n required: true,\r\n message: `必填项[${label ? label : name}]不能为空`,\r\n trigger: trigger,\r\n })\r\n }\r\n\r\n return rules\r\n })\r\n}\r\n\r\nconst useFormItemDisabled = () => {\r\n const formContext = useFormContext()!\r\n const { props } = getCurrentInstance()!\r\n return computed(() => formContext.disabled || (props.disabled as boolean))\r\n}\r\n\r\nconst useFormItemCode = () => {\r\n const { props } = getCurrentInstance()!\r\n\r\n return computed(() => {\r\n let codeData: Array<CodeItem>\r\n const { code } = props\r\n if (!code) {\r\n throw new OrionError('code为空')\r\n } else if (isString(code)) {\r\n codeData = Throne.getCode(code).value\r\n } else if (isArray<CodeItem>(code)) {\r\n codeData = code\r\n } else {\r\n throw new OrionError('code类型错误')\r\n }\r\n\r\n return codeData\r\n })\r\n}\r\n\r\nconst useFormItemStringModel = () => {\r\n const formContext = useFormContext()!\r\n const { props } = getCurrentInstance()!\r\n const { name } = props\r\n\r\n return computed<string>({\r\n get: () => {\r\n const value = formContext.modelValue[name as string]\r\n if (!value) {\r\n return ''\r\n }\r\n return value as string\r\n },\r\n set: (newValue) => {\r\n if (!newValue) {\r\n formContext.updateModelValue(name as string, '')\r\n } else {\r\n formContext.updateModelValue(name as string, newValue)\r\n }\r\n },\r\n })\r\n}\r\n\r\nconst useFormItemMultiModel = () => {\r\n const formContext = useFormContext()!\r\n const { props } = getCurrentInstance()!\r\n const { name } = props\r\n\r\n return computed<string[] | undefined>({\r\n get: () => {\r\n const value = formContext.modelValue[name as string]\r\n if (!value) {\r\n return undefined\r\n }\r\n return (value as string).split(',')\r\n },\r\n set: (newValue) => {\r\n if (!newValue) {\r\n formContext.updateModelValue(name as string, '')\r\n } else {\r\n formContext.updateModelValue(name as string, newValue.join(','))\r\n }\r\n },\r\n })\r\n}\r\n\r\nconst useFormItemBooleanModel = () => {\r\n const formContext = useFormContext()!\r\n const { props } = getCurrentInstance()!\r\n const { name } = props\r\n\r\n return computed<boolean>({\r\n get: () => {\r\n const value = formContext.modelValue[name as string]\r\n if (!value) {\r\n return false\r\n }\r\n return (value as string) == '1'\r\n },\r\n set: (_newValue) => {\r\n const oldValue = formContext.modelValue[name as string]\r\n const newValue = _newValue ? '1' : '0'\r\n if (oldValue) {\r\n formContext.updateModelValue(name as string, newValue)\r\n } else {\r\n if (_newValue) {\r\n formContext.updateModelValue(name as string, newValue)\r\n }\r\n }\r\n },\r\n })\r\n}\r\n\r\nexport {\r\n useFormContext,\r\n useFormItemSpan,\r\n useFormItemRules,\r\n useFormItemDisabled,\r\n useFormItemCode,\r\n useFormItemStringModel,\r\n useFormItemMultiModel,\r\n useFormItemBooleanModel,\r\n}\r\n"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Form/hooks/index.ts"],"sourcesContent":["import { inject, getCurrentInstance, computed } from 'vue'\r\nimport { formContextKey, FormItemRule } from '../Form'\r\nimport Throne from '../../../Throne'\r\nimport { CodeItem } from '../../types'\r\nimport { castArray, isArray, isString } from 'lodash-es'\r\nimport OrionError from '../../../error/OrionError'\r\nimport formItemValidateTrigger from './FormItemValidateTrigger'\r\nimport { useThroneContext } from '../../../Throne/hooks/use-throne-context'\r\n\r\nconst useFormContext = () => {\r\n return inject(formContextKey)\r\n}\r\n\r\nconst useFormItemSpan = () => {\r\n const formContext = useFormContext()!\r\n const { props } = getCurrentInstance()!\r\n\r\n return computed(() => (props.span ? (props.span as number) : formContext.itemSpan))\r\n}\r\n\r\nconst useFormItemRules = () => {\r\n const formContext = useFormContext()!\r\n const { props, type } = getCurrentInstance()!\r\n const { name, label, required } = props\r\n let trigger = formItemValidateTrigger[type.name!]\r\n if (!trigger) {\r\n trigger = 'change'\r\n }\r\n\r\n return computed(() => {\r\n const rules: FormItemRule[] = []\r\n let flag = true\r\n\r\n if (required) {\r\n if (props.rules) {\r\n rules.push(...castArray(props.rules))\r\n flag = !rules.some((rule) => Object.keys(rule).includes('required'))\r\n }\r\n if (formContext.rules && formContext.rules[name as string]) {\r\n const formRules = castArray(formContext.rules[name as string])\r\n flag = !formRules.some((rule) => Object.keys(rule).includes('required'))\r\n }\r\n }\r\n\r\n if (flag) {\r\n rules.push({\r\n required: true,\r\n message: `必填项[${label ? label : name}]不能为空`,\r\n trigger: trigger,\r\n })\r\n }\r\n\r\n return rules\r\n })\r\n}\r\n\r\nconst useFormItemDisabled = () => {\r\n const formContext = useFormContext()!\r\n const { props } = getCurrentInstance()!\r\n return computed(() => formContext.disabled || (props.disabled as boolean))\r\n}\r\n\r\nconst useFormItemCode = () => {\r\n const { props } = getCurrentInstance()!\r\n\r\n const throneContext = useThroneContext();\r\n\r\n return computed(() => {\r\n let codeData: Array<CodeItem>\r\n const { code } = props\r\n if (!code) {\r\n throw new OrionError('code为空')\r\n } else if (isString(code)) {\r\n codeData = Throne.getCode(code, throneContext?.value).value\r\n } else if (isArray<CodeItem>(code)) {\r\n codeData = code\r\n } else {\r\n throw new OrionError('code类型错误')\r\n }\r\n\r\n return codeData\r\n })\r\n}\r\n\r\nconst useFormItemStringModel = () => {\r\n const formContext = useFormContext()!\r\n const { props } = getCurrentInstance()!\r\n const { name } = props\r\n\r\n return computed<string>({\r\n get: () => {\r\n const value = formContext.modelValue[name as string]\r\n if (!value) {\r\n return ''\r\n }\r\n return value as string\r\n },\r\n set: (newValue) => {\r\n if (!newValue) {\r\n formContext.updateModelValue(name as string, '')\r\n } else {\r\n formContext.updateModelValue(name as string, newValue)\r\n }\r\n },\r\n })\r\n}\r\n\r\nconst useFormItemMultiModel = () => {\r\n const formContext = useFormContext()!\r\n const { props } = getCurrentInstance()!\r\n const { name } = props\r\n\r\n return computed<string[] | undefined>({\r\n get: () => {\r\n const value = formContext.modelValue[name as string]\r\n if (!value) {\r\n return undefined\r\n }\r\n return (value as string).split(',')\r\n },\r\n set: (newValue) => {\r\n if (!newValue) {\r\n formContext.updateModelValue(name as string, '')\r\n } else {\r\n formContext.updateModelValue(name as string, newValue.join(','))\r\n }\r\n },\r\n })\r\n}\r\n\r\nconst useFormItemBooleanModel = () => {\r\n const formContext = useFormContext()!\r\n const { props } = getCurrentInstance()!\r\n const { name } = props\r\n\r\n return computed<boolean>({\r\n get: () => {\r\n const value = formContext.modelValue[name as string]\r\n if (!value) {\r\n return false\r\n }\r\n return (value as string) == '1'\r\n },\r\n set: (_newValue) => {\r\n const oldValue = formContext.modelValue[name as string]\r\n const newValue = _newValue ? '1' : '0'\r\n if (oldValue) {\r\n formContext.updateModelValue(name as string, newValue)\r\n } else {\r\n if (_newValue) {\r\n formContext.updateModelValue(name as string, newValue)\r\n }\r\n }\r\n },\r\n })\r\n}\r\n\r\nexport {\r\n useFormContext,\r\n useFormItemSpan,\r\n useFormItemRules,\r\n useFormItemDisabled,\r\n useFormItemCode,\r\n useFormItemStringModel,\r\n useFormItemMultiModel,\r\n useFormItemBooleanModel,\r\n}\r\n"],"names":["useFormContext","inject","formContextKey","useFormItemSpan","formContext","props","getCurrentInstance","computed","useFormItemRules","type","name","label","required","trigger","formItemValidateTrigger","rules","flag","castArray","rule","useFormItemDisabled","useFormItemCode","throneContext","useThroneContext","codeData","code","isString","Throne","isArray","OrionError","useFormItemStringModel","value","newValue","useFormItemMultiModel","useFormItemBooleanModel","_newValue","oldValue"],"mappings":";;;;;;;AASA,MAAMA,IAAiB,MACdC,EAAOC,CAAc,GAGxBC,IAAkB,MAAM;AAC5B,QAAMC,IAAcJ,KACd,EAAE,OAAAK,MAAUC;AAElB,SAAOC,EAAS,MAAOF,EAAM,OAAQA,EAAM,OAAkBD,EAAY,Q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OAAIC,KAGED,MACU9B,EAAA,iBAAiBM,GAAgBqB,CAAQ;AAAA,IAG3D;AAAA,EAAA,CACD;AACH;"}
|
@@ -13,6 +13,7 @@ import { default as ButtonGroup } from './ButtonGroup/ButtonGroup.vue';
|
|
13
13
|
import { default as DiyItem } from './DiyItem/DiyItem.vue';
|
14
14
|
import { default as LovInput } from './LovInput/LovInput.vue';
|
15
15
|
import { default as NumberInput } from './NumberInput/NumberInput.vue';
|
16
|
+
import { default as MultiTableSelect } from './MultiTableSelect/MultiTableSelect.vue';
|
16
17
|
declare const _default: import('../_util').SFCWithInstall<{
|
17
18
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./Form').FormProps> & Readonly<{
|
18
19
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
@@ -282,6 +283,7 @@ declare const _default: import('../_util').SFCWithInstall<{
|
|
282
283
|
DiyItem: typeof DiyItem;
|
283
284
|
LovInput: typeof LovInput;
|
284
285
|
NumberInput: typeof NumberInput;
|
286
|
+
MultiTableSelect: typeof MultiTableSelect;
|
285
287
|
};
|
286
288
|
export default _default;
|
287
289
|
export * from './Form';
|
@@ -300,3 +302,4 @@ export * from './ButtonGroup';
|
|
300
302
|
export * from './DiyItem';
|
301
303
|
export * from './LovInput';
|
302
304
|
export * from './NumberInput';
|
305
|
+
export * from './MultiTableSelect';
|