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
@@ -1,211 +1,136 @@
|
|
1
|
-
import { findIndex } from "lodash-es";
|
2
|
-
import { defineComponent, useTemplateRef, ref, watch, openBlock, createBlock, unref, withCtx, renderSlot } from "vue";
|
3
|
-
import { withInstall } from "../_util/vue/install.js";
|
1
|
+
import { findIndex as P } from "lodash-es";
|
2
|
+
import { defineComponent as A, useTemplateRef as x, ref as v, watch as k, openBlock as y, createBlock as I, unref as L, withCtx as S, renderSlot as z } from "vue";
|
3
|
+
import { withInstall as U } from "../_util/vue/install.js";
|
4
4
|
import "element-plus";
|
5
|
-
import
|
5
|
+
import T from "../Querytable/index.js";
|
6
6
|
import "../Form/index.js";
|
7
|
-
import
|
8
|
-
import
|
9
|
-
const
|
10
|
-
|
7
|
+
import D from "../Form/LovInput/hooks/useLov.js";
|
8
|
+
import q from "../Pagetable/index.js";
|
9
|
+
const B = /* @__PURE__ */ A({
|
10
|
+
name: "OLovQuerytable",
|
11
|
+
inheritAttrs: !0,
|
11
12
|
__name: "LovQuerytable",
|
12
13
|
props: {
|
13
14
|
data: {}
|
14
15
|
},
|
15
|
-
setup(
|
16
|
-
const
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
if (
|
22
|
-
let
|
23
|
-
|
24
|
-
|
25
|
-
} else {
|
26
|
-
nextRow = __props.data[currentRowIndex.value - 1];
|
27
|
-
}
|
28
|
-
tableRef.value.setCurrentRow(nextRow);
|
29
|
-
scrollToRow(currentRowIndex.value);
|
30
|
-
} else if (code == "ArrowDown") {
|
31
|
-
let nextRow;
|
32
|
-
if (currentRowIndex.value == __props.data.length - 1) {
|
33
|
-
nextRow = __props.data[0];
|
34
|
-
} else {
|
35
|
-
nextRow = __props.data[currentRowIndex.value + 1];
|
36
|
-
}
|
37
|
-
tableRef.value.setCurrentRow(nextRow);
|
38
|
-
scrollToRow(currentRowIndex.value);
|
39
|
-
} else if (code == "Enter") {
|
40
|
-
currentRowData.value && (lov == null ? void 0 : lov.backfill(currentRowData.value));
|
41
|
-
}
|
16
|
+
setup(e) {
|
17
|
+
const d = x("table"), i = v(), s = v(), l = D();
|
18
|
+
l == null || l.registerKeydownHandler((a) => {
|
19
|
+
if (a == "ArrowUp") {
|
20
|
+
let o;
|
21
|
+
i.value == 0 ? o = e.data[e.data.length - 1] : o = e.data[i.value - 1], d.value.setCurrentRow(o), r(i.value);
|
22
|
+
} else if (a == "ArrowDown") {
|
23
|
+
let o;
|
24
|
+
i.value == e.data.length - 1 ? o = e.data[0] : o = e.data[i.value + 1], d.value.setCurrentRow(o), r(i.value);
|
25
|
+
} else a == "Enter" && s.value && (l == null || l.backfill(s.value));
|
42
26
|
});
|
43
|
-
const
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
lov == null ? void 0 : lov.backfill(row);
|
27
|
+
const r = (a) => {
|
28
|
+
d.value.$el.querySelectorAll(".el-table__row")[a].scrollIntoViewIfNeeded();
|
29
|
+
}, f = (a) => {
|
30
|
+
l == null || l.backfill(a);
|
31
|
+
}, u = (a) => {
|
32
|
+
const o = P(e.data, a);
|
33
|
+
o == -1 ? (i.value = 0, s.value = e.data[0]) : (i.value = o, s.value = a);
|
51
34
|
};
|
52
|
-
|
53
|
-
|
54
|
-
if (index2 == -1) {
|
55
|
-
currentRowIndex.value = 0;
|
56
|
-
currentRowData.value = __props.data[0];
|
57
|
-
} else {
|
58
|
-
currentRowIndex.value = index2;
|
59
|
-
currentRowData.value = row;
|
60
|
-
}
|
61
|
-
};
|
62
|
-
watch(
|
63
|
-
() => __props.data,
|
35
|
+
return k(
|
36
|
+
() => e.data,
|
64
37
|
() => {
|
65
|
-
|
66
|
-
tableRef.value.setCurrentRow(__props.data[0]);
|
67
|
-
}
|
38
|
+
e.data.length > 0 && d.value.setCurrentRow(e.data[0]);
|
68
39
|
}
|
69
|
-
)
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
_: 3
|
83
|
-
}, 8, ["data"]);
|
84
|
-
};
|
40
|
+
), (a, o) => (y(), I(L(T), {
|
41
|
+
ref: "table",
|
42
|
+
data: a.data,
|
43
|
+
onRowClick: f,
|
44
|
+
"current-row-mode": "",
|
45
|
+
onCurrentRowChange: u,
|
46
|
+
size: "small"
|
47
|
+
}, {
|
48
|
+
default: S(() => [
|
49
|
+
z(a.$slots, "default")
|
50
|
+
]),
|
51
|
+
_: 3
|
52
|
+
}, 8, ["data"]));
|
85
53
|
}
|
86
|
-
})
|
87
|
-
|
88
|
-
|
54
|
+
}), E = /* @__PURE__ */ A({
|
55
|
+
name: "OLovPagetable",
|
56
|
+
inheritAttrs: !0,
|
89
57
|
__name: "LovPagetable",
|
90
58
|
props: {
|
91
59
|
data: {},
|
92
60
|
pagination: {}
|
93
61
|
},
|
94
62
|
emits: ["update:pagination"],
|
95
|
-
setup(
|
96
|
-
const
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
}
|
113
|
-
tableRef.value.setCurrentRow(nextRow);
|
114
|
-
scrollToRow(currentRowIndex.value);
|
115
|
-
} else if (code == "ArrowDown") {
|
116
|
-
let nextRow;
|
117
|
-
if (currentRowIndex.value == __props.data.length - 1) {
|
118
|
-
nextRow = __props.data[0];
|
119
|
-
} else {
|
120
|
-
nextRow = __props.data[currentRowIndex.value + 1];
|
121
|
-
}
|
122
|
-
tableRef.value.setCurrentRow(nextRow);
|
123
|
-
scrollToRow(currentRowIndex.value);
|
124
|
-
} else if (code == "Enter") {
|
125
|
-
currentRowData.value && (lov == null ? void 0 : lov.backfill(currentRowData.value));
|
126
|
-
} else if (code == "ArrowLeft") {
|
127
|
-
const currentPage = (_a = __props.pagination) == null ? void 0 : _a.currentPage;
|
128
|
-
const pageSize = (_b = __props.pagination) == null ? void 0 : _b.pageSize;
|
129
|
-
const total = (_c = __props.pagination) == null ? void 0 : _c.total;
|
130
|
-
if (!currentPage || !pageSize || !total) {
|
63
|
+
setup(e, { emit: d }) {
|
64
|
+
const i = d, s = (t) => {
|
65
|
+
i("update:pagination", t);
|
66
|
+
}, l = x("table"), r = v(), f = v(), u = D();
|
67
|
+
u.registerKeydownHandler((t) => {
|
68
|
+
var c, m, b, h, C, $;
|
69
|
+
if (t == "ArrowUp") {
|
70
|
+
let n;
|
71
|
+
r.value == 0 ? n = e.data[e.data.length - 1] : n = e.data[r.value - 1], l.value.setCurrentRow(n), a(r.value);
|
72
|
+
} else if (t == "ArrowDown") {
|
73
|
+
let n;
|
74
|
+
r.value == e.data.length - 1 ? n = e.data[0] : n = e.data[r.value + 1], l.value.setCurrentRow(n), a(r.value);
|
75
|
+
} else if (t == "Enter")
|
76
|
+
f.value && (u == null || u.backfill(f.value));
|
77
|
+
else if (t == "ArrowLeft") {
|
78
|
+
const n = (c = e.pagination) == null ? void 0 : c.currentPage, g = (m = e.pagination) == null ? void 0 : m.pageSize, w = (b = e.pagination) == null ? void 0 : b.total;
|
79
|
+
if (!n || !g || !w)
|
131
80
|
return;
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
} else if (code == "ArrowRight") {
|
140
|
-
const currentPage = (_d = __props.pagination) == null ? void 0 : _d.currentPage;
|
141
|
-
const pageSize = (_e = __props.pagination) == null ? void 0 : _e.pageSize;
|
142
|
-
const total = (_f = __props.pagination) == null ? void 0 : _f.total;
|
143
|
-
if (!currentPage || !pageSize || !total) {
|
81
|
+
n > 1 && i("update:pagination", {
|
82
|
+
...e.pagination,
|
83
|
+
currentPage: n - 1
|
84
|
+
});
|
85
|
+
} else if (t == "ArrowRight") {
|
86
|
+
const n = (h = e.pagination) == null ? void 0 : h.currentPage, g = (C = e.pagination) == null ? void 0 : C.pageSize, w = ($ = e.pagination) == null ? void 0 : $.total;
|
87
|
+
if (!n || !g || !w)
|
144
88
|
return;
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
currentPage: currentPage + 1
|
151
|
-
});
|
152
|
-
}
|
89
|
+
const Q = Math.ceil(w / g);
|
90
|
+
n < Q && i("update:pagination", {
|
91
|
+
...e.pagination,
|
92
|
+
currentPage: n + 1
|
93
|
+
});
|
153
94
|
}
|
154
95
|
});
|
155
|
-
const
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
lov == null ? void 0 : lov.backfill(row);
|
96
|
+
const a = (t) => {
|
97
|
+
l.value.$el.querySelectorAll(".el-table__row")[t].scrollIntoViewIfNeeded();
|
98
|
+
}, o = (t) => {
|
99
|
+
u == null || u.backfill(t);
|
100
|
+
}, R = (t) => {
|
101
|
+
const c = P(e.data, t);
|
102
|
+
c == -1 ? (r.value = 0, f.value = e.data[0]) : (r.value = c, f.value = t);
|
163
103
|
};
|
164
|
-
|
165
|
-
|
166
|
-
if (index2 == -1) {
|
167
|
-
currentRowIndex.value = 0;
|
168
|
-
currentRowData.value = __props.data[0];
|
169
|
-
} else {
|
170
|
-
currentRowIndex.value = index2;
|
171
|
-
currentRowData.value = row;
|
172
|
-
}
|
173
|
-
};
|
174
|
-
watch(
|
175
|
-
() => __props.data,
|
104
|
+
return k(
|
105
|
+
() => e.data,
|
176
106
|
() => {
|
177
|
-
|
178
|
-
tableRef.value.setCurrentRow(__props.data[0]);
|
179
|
-
}
|
107
|
+
e.data.length > 0 && l.value.setCurrentRow(e.data[0]);
|
180
108
|
}
|
181
|
-
)
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
default
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
}, 8, ["data", "pagination"]);
|
198
|
-
};
|
109
|
+
), (t, c) => (y(), I(L(q), {
|
110
|
+
ref: "table",
|
111
|
+
data: t.data,
|
112
|
+
onRowClick: o,
|
113
|
+
"current-row-mode": "",
|
114
|
+
onCurrentRowChange: R,
|
115
|
+
pagination: t.pagination,
|
116
|
+
"onUpdate:pagination": s,
|
117
|
+
size: "small",
|
118
|
+
"pagination-teleported": !1
|
119
|
+
}, {
|
120
|
+
default: S(() => [
|
121
|
+
z(t.$slots, "default")
|
122
|
+
]),
|
123
|
+
_: 3
|
124
|
+
}, 8, ["data", "pagination"]));
|
199
125
|
}
|
200
|
-
})
|
201
|
-
const index = withInstall(
|
126
|
+
}), G = U(
|
202
127
|
{},
|
203
128
|
{
|
204
|
-
LovQuerytable:
|
205
|
-
LovPagetable:
|
129
|
+
LovQuerytable: B,
|
130
|
+
LovPagetable: E
|
206
131
|
}
|
207
132
|
);
|
208
133
|
export {
|
209
|
-
|
134
|
+
G as default
|
210
135
|
};
|
211
136
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/LovTable/LovQuerytable.vue","../../../src/components/LovTable/LovPagetable.vue","../../../src/components/LovTable/index.ts"],"sourcesContent":["<template>\r\n <querytable ref=\"table\" :data=\"data\" @row-click=\"onRowClick\" current-row-mode
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/LovTable/LovQuerytable.vue","../../../src/components/LovTable/LovPagetable.vue","../../../src/components/LovTable/index.ts"],"sourcesContent":["<template>\r\n <querytable ref=\"table\" :data=\"data\" @row-click=\"onRowClick\" current-row-mode\r\n @current-row-change=\"handleCurrentRowChange\" size=\"small\">\r\n <slot></slot>\r\n </querytable>\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport { ref, useTemplateRef, watch } from 'vue'\r\nimport Querytable from '../Querytable'\r\nimport { useLov } from '../Form'\r\nimport { findIndex } from 'lodash-es'\r\n\r\ndefineOptions({ name: 'OLovQuerytable', inheritAttrs: true })\r\n\r\nconst { data } = defineProps<{ data: any[] }>()\r\nconst tableRef = useTemplateRef('table')\r\nconst currentRowIndex = ref()\r\nconst currentRowData = ref()\r\n\r\nconst lov = useLov()\r\nlov?.registerKeydownHandler((code) => {\r\n if (code == 'ArrowUp') {\r\n let nextRow: any\r\n if (currentRowIndex.value == 0) {\r\n nextRow = data[data.length - 1]\r\n } else {\r\n nextRow = data[currentRowIndex.value - 1]\r\n }\r\n //@ts-ignore\r\n tableRef.value!.setCurrentRow(nextRow)\r\n scrollToRow(currentRowIndex.value)\r\n } else if (code == 'ArrowDown') {\r\n let nextRow: any\r\n if (currentRowIndex.value == data.length - 1) {\r\n nextRow = data[0]\r\n } else {\r\n nextRow = data[currentRowIndex.value + 1]\r\n }\r\n //@ts-ignore\r\n tableRef.value!.setCurrentRow(nextRow)\r\n scrollToRow(currentRowIndex.value)\r\n } else if (code == 'Enter') {\r\n currentRowData.value && lov?.backfill(currentRowData.value)\r\n }\r\n})\r\n\r\nconst scrollToRow = (index: number) => {\r\n const $table = tableRef.value!.$el\r\n const $row = $table.querySelectorAll('.el-table__row')[index]\r\n $row.scrollIntoViewIfNeeded()\r\n}\r\n\r\nconst onRowClick = (row: any) => {\r\n lov?.backfill(row)\r\n}\r\n\r\nconst handleCurrentRowChange = (row: any) => {\r\n const index = findIndex(data, row)\r\n if (index == -1) {\r\n currentRowIndex.value = 0\r\n currentRowData.value = data[0]\r\n } else {\r\n currentRowIndex.value = index\r\n currentRowData.value = row\r\n }\r\n}\r\n\r\nwatch(\r\n () => data,\r\n () => {\r\n if (data.length > 0) {\r\n //@ts-ignore\r\n tableRef.value!.setCurrentRow(data[0])\r\n }\r\n }\r\n)\r\n</script>\r\n","<template>\r\n <pagetable ref=\"table\" :data=\"data\" @row-click=\"onRowClick\" current-row-mode\r\n @current-row-change=\"handleCurrentRowChange\" :pagination=\"pagination\" @update:pagination=\"onUpdatePagination\"\r\n size=\"small\" :pagination-teleported=\"false\">\r\n <slot></slot>\r\n </pagetable>\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport Pagetable from '../Pagetable'\r\nimport { useLov } from '../Form'\r\nimport { ref, useTemplateRef, watch } from 'vue'\r\nimport { findIndex } from 'lodash-es'\r\n\r\ndefineOptions({ name: 'OLovPagetable', inheritAttrs: true })\r\n\r\nconst { data, pagination } = defineProps<{\r\n data: any[]\r\n pagination: {\r\n currentPage?: number\r\n pageSize?: number\r\n total?: number\r\n }\r\n}>()\r\n\r\nconst emits = defineEmits(['update:pagination'])\r\nconst onUpdatePagination = (data: any) => {\r\n emits('update:pagination', data)\r\n}\r\n\r\nconst tableRef = useTemplateRef('table')\r\nconst currentRowIndex = ref()\r\nconst currentRowData = ref()\r\n\r\nconst lov = useLov()!\r\nlov.registerKeydownHandler((code) => {\r\n if (code == 'ArrowUp') {\r\n let nextRow: any\r\n if (currentRowIndex.value == 0) {\r\n nextRow = data[data.length - 1]\r\n } else {\r\n nextRow = data[currentRowIndex.value - 1]\r\n }\r\n //@ts-ignore\r\n tableRef.value!.setCurrentRow(nextRow)\r\n scrollToRow(currentRowIndex.value)\r\n } else if (code == 'ArrowDown') {\r\n let nextRow: any\r\n if (currentRowIndex.value == data.length - 1) {\r\n nextRow = data[0]\r\n } else {\r\n nextRow = data[currentRowIndex.value + 1]\r\n }\r\n //@ts-ignore\r\n tableRef.value!.setCurrentRow(nextRow)\r\n scrollToRow(currentRowIndex.value)\r\n } else if (code == 'Enter') {\r\n currentRowData.value && lov?.backfill(currentRowData.value)\r\n } else if (code == 'ArrowLeft') {\r\n const currentPage = pagination?.currentPage\r\n const pageSize = pagination?.pageSize\r\n const total = pagination?.total\r\n if (!currentPage || !pageSize || !total) {\r\n return\r\n }\r\n if (currentPage > 1) {\r\n emits('update:pagination', {\r\n ...pagination,\r\n currentPage: currentPage - 1,\r\n })\r\n }\r\n } else if (code == 'ArrowRight') {\r\n const currentPage = pagination?.currentPage\r\n const pageSize = pagination?.pageSize\r\n const total = pagination?.total\r\n if (!currentPage || !pageSize || !total) {\r\n return\r\n }\r\n const totalPage = Math.ceil(total / pageSize)\r\n if (currentPage < totalPage) {\r\n emits('update:pagination', {\r\n ...pagination,\r\n currentPage: currentPage + 1,\r\n })\r\n }\r\n }\r\n})\r\n\r\nconst scrollToRow = (index: number) => {\r\n const $table = tableRef.value!.$el\r\n const $row = $table.querySelectorAll('.el-table__row')[index]\r\n $row.scrollIntoViewIfNeeded()\r\n}\r\n\r\nconst onRowClick = (row: any) => {\r\n lov?.backfill(row)\r\n}\r\n\r\nconst handleCurrentRowChange = (row: any) => {\r\n const index = findIndex(data, row)\r\n if (index == -1) {\r\n currentRowIndex.value = 0\r\n currentRowData.value = data[0]\r\n } else {\r\n currentRowIndex.value = index\r\n currentRowData.value = row\r\n }\r\n}\r\n\r\nwatch(\r\n () => data,\r\n () => {\r\n if (data.length > 0) {\r\n //@ts-ignore\r\n tableRef.value!.setCurrentRow(data[0])\r\n }\r\n }\r\n)\r\n</script>\r\n","import { withInstall } from '../_util'\r\n\r\nimport LovQuerytable from './LovQuerytable.vue'\r\nimport LovPagetable from './LovPagetable.vue'\r\n\r\nexport default withInstall(\r\n {},\r\n {\r\n LovQuerytable,\r\n LovPagetable,\r\n }\r\n)\r\n"],"names":["tableRef","useTemplateRef","currentRowIndex","ref","currentRowData","lov","useLov","code","nextRow","__props","scrollToRow","index","onRowClick","row","handleCurrentRowChange","findIndex","watch","emits","__emit","onUpdatePagination","data","currentPage","_a","pageSize","_b","total","_c","_d","_e","_f","totalPage","withInstall","LovQuerytable","LovPagetable"],"mappings":";;;;;;;;;;;;;;;;AAeM,UAAAA,IAAWC,EAAe,OAAO,GACjCC,IAAkBC,KAClBC,IAAiBD,KAEjBE,IAAMC;AACP,IAAAD,KAAA,QAAAA,EAAA,uBAAuB,CAACE,MAAS;AACpC,UAAIA,KAAQ,WAAW;AACjB,YAAAC;AACA,QAAAN,EAAgB,SAAS,IAC3BM,IAAUC,EAAI,KAACA,EAAI,KAAC,SAAS,CAAC,IAE9BD,IAAUC,OAAKP,EAAgB,QAAQ,CAAC,GAGjCF,EAAA,MAAO,cAAcQ,CAAO,GACrCE,EAAYR,EAAgB,KAAK;AAAA,MAAA,WACxBK,KAAQ,aAAa;AAC1B,YAAAC;AACJ,QAAIN,EAAgB,SAASO,EAAI,KAAC,SAAS,IAC/BD,IAAAC,OAAK,CAAC,IAEhBD,IAAUC,OAAKP,EAAgB,QAAQ,CAAC,GAGjCF,EAAA,MAAO,cAAcQ,CAAO,GACrCE,EAAYR,EAAgB,KAAK;AAAA,MAAA,MACnC,CAAWK,KAAQ,WACjBH,EAAe,UAASC,KAAA,QAAAA,EAAK,SAASD,EAAe;AAAA,IACvD;AAGI,UAAAM,IAAc,CAACC,MAAk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AQS;AAAA,IACzB;AAGF,WAAAG;AAAA,MACE,MAAMP,EAAI;AAAA,MACV,MAAM;AACA,QAAAA,EAAI,KAAC,SAAS,KAEhBT,EAAS,MAAO,cAAcS,EAAA,KAAK,CAAC,CAAC;AAAA,MAEzC;AAAA,IAAA;;;;;;;;;;;;;;;;;IC9GFE,IAAeoB;AAAA,EACb,CAAC;AAAA,EACD;AAAA,IAAA,eACEC;AAAAA,IAAA,cACAC;AAAAA,EACF;AACF;"}
|
@@ -1,127 +1,72 @@
|
|
1
1
|
import "lodash-es";
|
2
|
-
import { defineComponent, inject, ref, shallowRef, provide, createVNode, Fragment, useTemplateRef, openBlock, createElementBlock, renderSlot } from "vue";
|
3
|
-
import { withInstall } from "../_util/vue/install.js";
|
4
|
-
import { ElDialog } from "element-plus";
|
5
|
-
import { addUnit } from "../_util/dom/style.js";
|
6
|
-
import { modalLocatorContextKey, modalContextKey } from "./types.js";
|
7
|
-
const
|
2
|
+
import { defineComponent as g, inject as L, ref as o, shallowRef as O, provide as M, createVNode as w, Fragment as P, useTemplateRef as k, openBlock as E, createElementBlock as T, renderSlot as b } from "vue";
|
3
|
+
import { withInstall as j } from "../_util/vue/install.js";
|
4
|
+
import { ElDialog as B } from "element-plus";
|
5
|
+
import { addUnit as I } from "../_util/dom/style.js";
|
6
|
+
import { modalLocatorContextKey as x, modalContextKey as K } from "./types.js";
|
7
|
+
const R = /* @__PURE__ */ g({
|
8
8
|
name: "OModal",
|
9
|
-
setup(
|
10
|
-
slots,
|
11
|
-
attrs,
|
12
|
-
emit,
|
13
|
-
expose
|
9
|
+
setup(l, {
|
10
|
+
slots: a,
|
11
|
+
attrs: t,
|
12
|
+
emit: u,
|
13
|
+
expose: c
|
14
14
|
}) {
|
15
|
-
const
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
const width = ref();
|
21
|
-
const height = ref();
|
22
|
-
const __resolve = ref();
|
23
|
-
const showClose = ref(true);
|
24
|
-
const appendTo = ref();
|
25
|
-
const _open = async (options) => {
|
26
|
-
show.value = true;
|
27
|
-
title.value = options.title;
|
28
|
-
content.value = options.content;
|
29
|
-
if (options.contentProps) {
|
30
|
-
contentProps.value = options.contentProps;
|
31
|
-
} else {
|
32
|
-
contentProps.value = {};
|
33
|
-
}
|
34
|
-
if (options.width) {
|
35
|
-
width.value = options.width;
|
36
|
-
}
|
37
|
-
if (options.height) {
|
38
|
-
height.value = addUnit(options.height);
|
39
|
-
}
|
40
|
-
if (options.showClose != void 0 && options.showClose == false) {
|
41
|
-
showClose.value = false;
|
42
|
-
}
|
43
|
-
if (options.locator) {
|
44
|
-
appendTo.value = options.locator;
|
45
|
-
} else {
|
46
|
-
if (modalLocator && modalLocator.locator.value) {
|
47
|
-
appendTo.value = modalLocator.locator.value;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
const promise = new Promise((resolve, reject) => {
|
51
|
-
__resolve.value = resolve;
|
52
|
-
});
|
53
|
-
return promise;
|
54
|
-
};
|
55
|
-
expose({
|
56
|
-
open: _open
|
15
|
+
const d = L(x), n = o(!1), i = o(), v = O(), r = o(), f = o(), m = o(), h = o(), p = o(!0), s = o();
|
16
|
+
c({
|
17
|
+
open: async (e) => (n.value = !0, i.value = e.title, v.value = e.content, e.contentProps ? r.value = e.contentProps : r.value = {}, e.width && (f.value = e.width), e.height && (m.value = I(e.height)), e.showClose != null && e.showClose == !1 && (p.value = !1), e.locator ? s.value = e.locator : d && d.locator.value && (s.value = d.locator.value), new Promise((y, S) => {
|
18
|
+
h.value = y;
|
19
|
+
}))
|
57
20
|
});
|
58
|
-
const
|
59
|
-
const
|
60
|
-
|
61
|
-
title.value = void 0;
|
62
|
-
content.value = void 0;
|
63
|
-
contentProps.value = void 0;
|
64
|
-
width.value = void 0;
|
65
|
-
height.value = void 0;
|
66
|
-
__resolve.value = void 0;
|
67
|
-
showClose.value = true;
|
68
|
-
appendTo.value = void 0;
|
69
|
-
resolve && resolve(options);
|
21
|
+
const C = (e) => {
|
22
|
+
const _ = h.value;
|
23
|
+
n.value = !1, i.value = void 0, v.value = void 0, r.value = void 0, f.value = void 0, m.value = void 0, h.value = void 0, p.value = !0, s.value = void 0, _ && _(e);
|
70
24
|
};
|
71
|
-
|
72
|
-
close:
|
73
|
-
})
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
height: height.value
|
25
|
+
return M(K, {
|
26
|
+
close: C
|
27
|
+
}), () => {
|
28
|
+
const e = v.value;
|
29
|
+
return n.value ? w(B, {
|
30
|
+
title: i.value,
|
31
|
+
width: f.value,
|
32
|
+
modelValue: n.value,
|
33
|
+
beforeClose: C,
|
34
|
+
draggable: !0,
|
35
|
+
closeOnClickModal: !1,
|
36
|
+
closeOnPressEscape: !1,
|
37
|
+
showClose: p.value,
|
38
|
+
alignCenter: !0,
|
39
|
+
style: {
|
40
|
+
height: m.value
|
88
41
|
},
|
89
|
-
|
42
|
+
appendTo: s.value
|
90
43
|
}, {
|
91
|
-
default: () => [
|
92
|
-
}) :
|
44
|
+
default: () => [w(e, r.value, null)]
|
45
|
+
}) : w(P, null, null);
|
93
46
|
};
|
94
47
|
}
|
95
|
-
})
|
96
|
-
const _hoisted_1 = {
|
48
|
+
}), V = {
|
97
49
|
ref: "modal-locator",
|
98
50
|
class: "orion-modal-locator"
|
99
|
-
}
|
100
|
-
|
101
|
-
|
51
|
+
}, A = /* @__PURE__ */ g({
|
52
|
+
name: "OModalLocator",
|
53
|
+
inheritAttrs: !0,
|
102
54
|
__name: "ModalLocator",
|
103
|
-
setup(
|
104
|
-
const
|
105
|
-
|
106
|
-
locator
|
107
|
-
})
|
108
|
-
|
109
|
-
|
110
|
-
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
111
|
-
], 512);
|
112
|
-
};
|
113
|
-
}
|
114
|
-
});
|
115
|
-
const _export_sfc = (sfc, props) => {
|
116
|
-
const target = sfc.__vccOpts || sfc;
|
117
|
-
for (const [key, val] of props) {
|
118
|
-
target[key] = val;
|
55
|
+
setup(l) {
|
56
|
+
const a = k("modal-locator");
|
57
|
+
return M(x, {
|
58
|
+
locator: a
|
59
|
+
}), (t, u) => (E(), T("div", V, [
|
60
|
+
b(t.$slots, "default", {}, void 0, !0)
|
61
|
+
], 512));
|
119
62
|
}
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
63
|
+
}), D = (l, a) => {
|
64
|
+
const t = l.__vccOpts || l;
|
65
|
+
for (const [u, c] of a)
|
66
|
+
t[u] = c;
|
67
|
+
return t;
|
68
|
+
}, F = /* @__PURE__ */ D(A, [["__scopeId", "data-v-0fd5a1a9"]]), J = j(R, { ModalLocator: F });
|
124
69
|
export {
|
125
|
-
|
70
|
+
J as default
|
126
71
|
};
|
127
72
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Modal/Modal.tsx","../../../src/components/Modal/ModalLocator.vue","../../../src/components/Modal/index.ts"],"sourcesContent":["import { defineComponent, inject, provide, ref, shallowRef } from 'vue'\r\nimport { ElDialog } from 'element-plus'\r\nimport { addUnit } from '../_util'\r\nimport { modalContextKey, modalLocatorContextKey, ModalOptions } from './types'\r\n\r\nconst Modal = defineComponent({\r\n name: 'OModal',\r\n setup(props, { slots, attrs, emit, expose }) {\r\n const modalLocator = inject(modalLocatorContextKey)\r\n\r\n const show = ref(false)\r\n const title = ref<string>()\r\n const content = shallowRef()\r\n const contentProps = ref<Record<string, any>>()\r\n const width = ref<number | string>()\r\n const height = ref<number | string>()\r\n const __resolve = ref<(value: Record<string, any> | PromiseLike<Record<string, any>>) => void>()\r\n const showClose = ref(true)\r\n const appendTo = ref<
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Modal/Modal.tsx","../../../src/components/Modal/ModalLocator.vue","../../../src/components/Modal/index.ts"],"sourcesContent":["import { defineComponent, inject, provide, ref, shallowRef } from 'vue'\r\nimport { ElDialog } from 'element-plus'\r\nimport { addUnit } from '../_util'\r\nimport { modalContextKey, modalLocatorContextKey, ModalOptions } from './types'\r\n\r\nconst Modal = defineComponent({\r\n name: 'OModal',\r\n setup(props, { slots, attrs, emit, expose }) {\r\n const modalLocator = inject(modalLocatorContextKey)\r\n\r\n const show = ref(false)\r\n const title = ref<string>()\r\n const content = shallowRef()\r\n const contentProps = ref<Record<string, any>>()\r\n const width = ref<number | string>()\r\n const height = ref<number | string>()\r\n const __resolve = ref<(value: Record<string, any> | PromiseLike<Record<string, any>>) => void>()\r\n const showClose = ref(true)\r\n const appendTo = ref<HTMLElement>()\r\n\r\n const _open: (options: ModalOptions) => Promise<Record<string, any>> = async (options) => {\r\n show.value = true\r\n title.value = options.title\r\n content.value = options.content\r\n if (options.contentProps) {\r\n contentProps.value = options.contentProps\r\n } else {\r\n contentProps.value = {}\r\n }\r\n if (options.width) {\r\n width.value = options.width\r\n }\r\n if (options.height) {\r\n height.value = addUnit(options.height)\r\n }\r\n if (options.showClose != undefined && options.showClose == false) {\r\n showClose.value = false\r\n }\r\n if (options.locator) {\r\n appendTo.value = options.locator\r\n } else {\r\n if (modalLocator && modalLocator.locator.value) {\r\n appendTo.value = modalLocator.locator.value\r\n }\r\n }\r\n\r\n const promise = new Promise<Record<string, any>>((resolve, reject) => {\r\n __resolve.value = resolve\r\n })\r\n\r\n return promise\r\n }\r\n expose({\r\n open: _open,\r\n })\r\n\r\n const _close: (options: Record<string, any>) => void = (options) => {\r\n const resolve = __resolve.value\r\n\r\n show.value = false\r\n title.value = undefined\r\n content.value = undefined\r\n contentProps.value = undefined\r\n width.value = undefined\r\n height.value = undefined\r\n __resolve.value = undefined\r\n showClose.value = true\r\n appendTo.value = undefined\r\n\r\n resolve && resolve(options)\r\n }\r\n provide(modalContextKey, { close: _close })\r\n\r\n return () => {\r\n const Children = content.value\r\n return show.value ? (\r\n <ElDialog\r\n title={title.value}\r\n width={width.value}\r\n modelValue={show.value}\r\n beforeClose={_close}\r\n draggable={true}\r\n closeOnClickModal={false}\r\n closeOnPressEscape={false}\r\n showClose={showClose.value}\r\n alignCenter={true}\r\n style={{ height: height.value }}\r\n appendTo={appendTo.value}\r\n >\r\n <Children {...contentProps.value}></Children>\r\n </ElDialog>\r\n ) : (\r\n <></>\r\n )\r\n }\r\n },\r\n})\r\n\r\nexport default Modal\r\n","<template>\r\n <div ref=\"modal-locator\" class=\"orion-modal-locator\"><slot></slot></div>\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport { provide, useTemplateRef } from 'vue'\r\nimport { modalLocatorContextKey } from './types'\r\n\r\ndefineOptions({ name: 'OModalLocator', inheritAttrs: true })\r\nconst locator = useTemplateRef('modal-locator')\r\n\r\nprovide(modalLocatorContextKey, {\r\n locator,\r\n})\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.orion-modal-locator {\r\n width: 100%;\r\n height: 100%;\r\n overflow: auto;\r\n box-sizing: border-box;\r\n position: relative;\r\n\r\n :deep(> .el-overlay) {\r\n position: absolute;\r\n\r\n > .el-overlay-dialog {\r\n position: absolute;\r\n }\r\n }\r\n}\r\n</style>\r\n","import { withInstall } from '../_util'\r\n\r\nimport Modal from './Modal'\r\nimport ModalLocator from './ModalLocator.vue'\r\n\r\nexport default withInstall<typeof Modal, { ModalLocator: typeof ModalLocator }>(Modal, { ModalLocator })\r\n"],"names":["Modal","defineComponent","name","setup","props","slots","attrs","emit","expose","modalLocator","inject","modalLocatorContextKey","show","ref","title","content","shallowRef","contentProps","width","height","__resolve","showClose","appendTo","open","options","value","addUnit","undefined","locator","Promise","resolve","reject","_close","provide","modalContextKey","close","Children","_createVNode","ElDialog","default","_Fragment","useTemplateRef","index","withInstall","ModalLocator"],"mappings":";;;;;;AAKA,MAAMA,IAAQC,gBAAAA,EAAgB;AAAA,EAC5BC,MAAM;AAAA,EACNC,MAAMC,GAAO;AAAA,IAAEC,OAAAA;AAAAA,IAAOC,OAAAA;AAAAA,IAA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b,EAAKa,QAAKY,EAAAC,GAAA;AAAA,QAAA,OAENxB,EAAMW;AAAAA,QAAK,OACXP,EAAMO;AAAAA,QAAK,YACNb,EAAKa;AAAAA,QAAK,aACTO;AAAAA,QAAM,WACR;AAAA,QAAI,mBACI;AAAA,QAAK,oBACJ;AAAA,QAAK,WACdX,EAAUI;AAAAA,QAAK,aACb;AAAA,QAAI,OACV;AAAA,UAAEN,QAAQA,EAAOM;AAAAA,QAAO;AAAA,QAAA,UACrBH,EAASG;AAAAA,MAAK,GAAA;AAAA,QAAAc,SAAAA,MAAAF,CAAAA,EAAAD,GAEVnB,EAAaQ,OAAK,IAAA,CAAA;AAAA,MAAAY,CAAAA,IAAAA,EAAAG,GAInC,MAAA,IAAA;AAAA;EAEL;AACF,CAAC;;;;;;;;ACxFK,UAAAZ,IAAUa,EAAe,eAAe;AAE9C,WAAAR,EAAQtB,GAAwB;AAAA,MAC9B,SAAAiB;AAAA,IAAA,CACD;;;;;;;;;iECPDc,IAAeC,EAAiE3C,GAAO,EAAE,cAAA4C,GAAc;"}
|
@@ -1,7 +1,6 @@
|
|
1
|
-
const
|
2
|
-
const modalLocatorContextKey = Symbol("modalLocatorContextKey");
|
1
|
+
const o = Symbol("modalContextKey"), t = Symbol("modalLocatorContextKey");
|
3
2
|
export {
|
4
|
-
modalContextKey,
|
5
|
-
modalLocatorContextKey
|
3
|
+
o as modalContextKey,
|
4
|
+
t as modalLocatorContextKey
|
6
5
|
};
|
7
6
|
//# sourceMappingURL=types.js.map
|