orion-design 0.1.15 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. package/dist/components/Form/FileInput/FileInput.vue.d.ts +2 -2
  2. package/dist/components/Form/LovInput/LovInput.d.ts +2 -0
  3. package/dist/components/Form/LovInput/LovInput.js.map +1 -1
  4. package/dist/components/Form/index.js +337 -320
  5. package/dist/components/Form/index.js.map +1 -1
  6. package/dist/components/LovTable/LovPagetable.vue.d.ts +296 -0
  7. package/dist/components/LovTable/LovQuerytable.vue.d.ts +184 -0
  8. package/dist/components/LovTable/index.d.ts +295 -2
  9. package/dist/components/LovTable/index.js +118 -45
  10. package/dist/components/LovTable/index.js.map +1 -1
  11. package/dist/components/Pagetable/index.js +64 -63
  12. package/dist/components/Pagetable/index.js.map +1 -1
  13. package/dist/components/Querytable/index.js +62 -61
  14. package/dist/components/Querytable/index.js.map +1 -1
  15. package/dist/components/Tabs/constants.d.ts +19 -0
  16. package/dist/components/Tabs/constants.js +5 -0
  17. package/dist/components/Tabs/constants.js.map +1 -0
  18. package/dist/components/Tabs/index.d.ts +74 -0
  19. package/dist/components/Tabs/index.js +475 -0
  20. package/dist/components/Tabs/index.js.map +1 -0
  21. package/dist/components/Tabs/tab-bar.d.ts +59 -0
  22. package/dist/components/Tabs/tab-bar.js +15 -0
  23. package/dist/components/Tabs/tab-bar.js.map +1 -0
  24. package/dist/components/Tabs/tab-bar.vue.d.ts +131 -0
  25. package/dist/components/Tabs/tab-nav.d.ts +237 -0
  26. package/dist/components/Tabs/tab-pane.d.ts +16 -0
  27. package/dist/components/Tabs/tab-pane.js +35 -0
  28. package/dist/components/Tabs/tab-pane.js.map +1 -0
  29. package/dist/components/Tabs/tab-pane.vue.d.ts +43 -0
  30. package/dist/components/Tabs/tabs.d.ts +101 -0
  31. package/dist/components/_constants/aria.d.ts +17 -0
  32. package/dist/components/_constants/aria.js +25 -0
  33. package/dist/components/_constants/aria.js.map +1 -0
  34. package/dist/components/_constants/event.d.ts +3 -0
  35. package/dist/components/_constants/event.js +7 -0
  36. package/dist/components/_constants/event.js.map +1 -0
  37. package/dist/components/_constants/index.d.ts +2 -0
  38. package/dist/components/_constants/index.js +9 -0
  39. package/dist/components/_constants/index.js.map +1 -0
  40. package/dist/components/_hooks/index.d.ts +2 -0
  41. package/dist/components/_hooks/index.js +10 -0
  42. package/dist/components/_hooks/index.js.map +1 -0
  43. package/dist/components/_hooks/use-namespace/index.d.ts +23 -0
  44. package/dist/components/_hooks/use-namespace/index.js +46 -0
  45. package/dist/components/_hooks/use-namespace/index.js.map +1 -0
  46. package/dist/components/_hooks/use-ordered-children/index.d.ts +8 -0
  47. package/dist/components/_hooks/use-ordered-children/index.js +27 -0
  48. package/dist/components/_hooks/use-ordered-children/index.js.map +1 -0
  49. package/dist/components/_util/browser.js +2 -2
  50. package/dist/components/_util/dom/element.js +1 -1
  51. package/dist/components/_util/dom/position.js +1 -1
  52. package/dist/components/_util/dom/scroll.js +1 -1
  53. package/dist/components/_util/dom/style.js +1 -1
  54. package/dist/components/_util/index.js +1 -1
  55. package/dist/components/_util/raf.js +1 -1
  56. package/dist/components/_util/vue/global-node.js +1 -1
  57. package/dist/components/_util/vue/icon.js +24 -146
  58. package/dist/components/_util/vue/icon.js.map +1 -1
  59. package/dist/components/components.d.ts +2 -0
  60. package/dist/components/components.js +13 -11
  61. package/dist/components/components.js.map +1 -1
  62. package/dist/components/index.js +21 -19
  63. package/dist/components/index.js.map +1 -1
  64. package/dist/components-0PErqPHo.js +72 -0
  65. package/dist/{components-DXZmD0GT.js.map → components-0PErqPHo.js.map} +1 -1
  66. package/dist/index-BwWeqwHB.js +164 -0
  67. package/dist/index-BwWeqwHB.js.map +1 -0
  68. package/dist/index-C9tCD90X.js +45 -0
  69. package/dist/{index-C8JNJPWW.js.map → index-C9tCD90X.js.map} +1 -1
  70. package/dist/index.css +1 -1
  71. package/dist/index.js +21 -19
  72. package/dist/index.js.map +1 -1
  73. package/dist/version/version.d.ts +1 -1
  74. package/dist/version/version.js +1 -1
  75. package/dist/version/version.js.map +1 -1
  76. package/global.d.ts +6 -1
  77. package/package.json +3 -1
  78. package/dist/components/LovTable/LovPagetable.d.ts +0 -2
  79. package/dist/components/LovTable/LovQuerytable.d.ts +0 -2
  80. package/dist/components-DXZmD0GT.js +0 -70
  81. package/dist/index-C8JNJPWW.js +0 -8
@@ -1,5 +1,298 @@
1
1
  declare const _default: import('../_util').SFCWithInstall<{}> & {
2
- LovQuerytable: import('vue').DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
3
- LovPagetable: import('vue').DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ LovQuerytable: {
3
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
4
+ data: any[];
5
+ }> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<{
6
+ data: any[];
7
+ }> & Readonly<{}>, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
8
+ table: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
9
+ data: {
10
+ type: import('vue').PropType<any[]>;
11
+ default: any[];
12
+ };
13
+ showRowNumber: {
14
+ type: BooleanConstructor;
15
+ default: boolean;
16
+ };
17
+ selectionMode: {
18
+ type: BooleanConstructor;
19
+ default: boolean;
20
+ };
21
+ currentRowMode: {
22
+ type: BooleanConstructor;
23
+ default: boolean;
24
+ };
25
+ }>> & Readonly<{
26
+ onSelectionChange?: ((...args: any[]) => any) | undefined;
27
+ onCurrentRowChange?: ((...args: any[]) => any) | undefined;
28
+ onRowClick?: ((...args: any[]) => any) | undefined;
29
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("selectionChange" | "currentRowChange" | "rowClick")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
30
+ data: {
31
+ type: import('vue').PropType<any[]>;
32
+ default: any[];
33
+ };
34
+ showRowNumber: {
35
+ type: BooleanConstructor;
36
+ default: boolean;
37
+ };
38
+ selectionMode: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
42
+ currentRowMode: {
43
+ type: BooleanConstructor;
44
+ default: boolean;
45
+ };
46
+ }>> & Readonly<{
47
+ onSelectionChange?: ((...args: any[]) => any) | undefined;
48
+ onCurrentRowChange?: ((...args: any[]) => any) | undefined;
49
+ onRowClick?: ((...args: any[]) => any) | undefined;
50
+ }>, {
51
+ data: any[];
52
+ showRowNumber: boolean;
53
+ selectionMode: boolean;
54
+ currentRowMode: boolean;
55
+ }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
56
+ P: {};
57
+ B: {};
58
+ D: {};
59
+ C: {};
60
+ M: {};
61
+ Defaults: {};
62
+ }, Readonly<import('vue').ExtractPropTypes<{
63
+ data: {
64
+ type: import('vue').PropType<any[]>;
65
+ default: any[];
66
+ };
67
+ showRowNumber: {
68
+ type: BooleanConstructor;
69
+ default: boolean;
70
+ };
71
+ selectionMode: {
72
+ type: BooleanConstructor;
73
+ default: boolean;
74
+ };
75
+ currentRowMode: {
76
+ type: BooleanConstructor;
77
+ default: boolean;
78
+ };
79
+ }>> & Readonly<{
80
+ onSelectionChange?: ((...args: any[]) => any) | undefined;
81
+ onCurrentRowChange?: ((...args: any[]) => any) | undefined;
82
+ onRowClick?: ((...args: any[]) => any) | undefined;
83
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
84
+ data: any[];
85
+ showRowNumber: boolean;
86
+ selectionMode: boolean;
87
+ currentRowMode: boolean;
88
+ }> | null;
89
+ }, any, import('vue').ComponentProvideOptions, {
90
+ P: {};
91
+ B: {};
92
+ D: {};
93
+ C: {};
94
+ M: {};
95
+ Defaults: {};
96
+ }, Readonly<{
97
+ data: any[];
98
+ }> & Readonly<{}>, {}, {}, {}, {}, {}>;
99
+ __isFragment?: never;
100
+ __isTeleport?: never;
101
+ __isSuspense?: never;
102
+ } & import('vue').ComponentOptionsBase<Readonly<{
103
+ data: any[];
104
+ }> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
105
+ $slots: {
106
+ default?(_: {}): any;
107
+ };
108
+ });
109
+ LovPagetable: {
110
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
111
+ data: any[];
112
+ pagination: {
113
+ currentPage?: number;
114
+ pageSize?: number;
115
+ total?: number;
116
+ };
117
+ }> & Readonly<{
118
+ "onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
119
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
120
+ "update:pagination": (...args: any[]) => void;
121
+ }, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<{
122
+ data: any[];
123
+ pagination: {
124
+ currentPage?: number;
125
+ pageSize?: number;
126
+ total?: number;
127
+ };
128
+ }> & Readonly<{
129
+ "onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
130
+ }>, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
131
+ table: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
132
+ data: {
133
+ type: import('vue').PropType<any[]>;
134
+ default: any[];
135
+ };
136
+ pagination: {
137
+ type: import('vue').PropType<{
138
+ currentPage?: number;
139
+ pageSize?: number;
140
+ total?: number;
141
+ }>;
142
+ default: {
143
+ currentPage?: number;
144
+ pageSize?: number;
145
+ total?: number;
146
+ };
147
+ };
148
+ showRowNumber: {
149
+ type: BooleanConstructor;
150
+ default: boolean;
151
+ };
152
+ selectionMode: {
153
+ type: BooleanConstructor;
154
+ default: boolean;
155
+ };
156
+ currentRowMode: {
157
+ type: BooleanConstructor;
158
+ default: boolean;
159
+ };
160
+ }>> & Readonly<{
161
+ onSelectionChange?: ((...args: any[]) => any) | undefined;
162
+ onCurrentRowChange?: ((...args: any[]) => any) | undefined;
163
+ "onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
164
+ onRowClick?: ((...args: any[]) => any) | undefined;
165
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("selectionChange" | "currentRowChange" | "update:pagination" | "rowClick")[], import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
166
+ data: {
167
+ type: import('vue').PropType<any[]>;
168
+ default: any[];
169
+ };
170
+ pagination: {
171
+ type: import('vue').PropType<{
172
+ currentPage?: number;
173
+ pageSize?: number;
174
+ total?: number;
175
+ }>;
176
+ default: {
177
+ currentPage?: number;
178
+ pageSize?: number;
179
+ total?: number;
180
+ };
181
+ };
182
+ showRowNumber: {
183
+ type: BooleanConstructor;
184
+ default: boolean;
185
+ };
186
+ selectionMode: {
187
+ type: BooleanConstructor;
188
+ default: boolean;
189
+ };
190
+ currentRowMode: {
191
+ type: BooleanConstructor;
192
+ default: boolean;
193
+ };
194
+ }>> & Readonly<{
195
+ onSelectionChange?: ((...args: any[]) => any) | undefined;
196
+ onCurrentRowChange?: ((...args: any[]) => any) | undefined;
197
+ "onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
198
+ onRowClick?: ((...args: any[]) => any) | undefined;
199
+ }>, {
200
+ data: any[];
201
+ pagination: {
202
+ currentPage?: number;
203
+ pageSize?: number;
204
+ total?: number;
205
+ };
206
+ showRowNumber: boolean;
207
+ selectionMode: boolean;
208
+ currentRowMode: boolean;
209
+ }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
210
+ P: {};
211
+ B: {};
212
+ D: {};
213
+ C: {};
214
+ M: {};
215
+ Defaults: {};
216
+ }, Readonly<import('vue').ExtractPropTypes<{
217
+ data: {
218
+ type: import('vue').PropType<any[]>;
219
+ default: any[];
220
+ };
221
+ pagination: {
222
+ type: import('vue').PropType<{
223
+ currentPage?: number;
224
+ pageSize?: number;
225
+ total?: number;
226
+ }>;
227
+ default: {
228
+ currentPage?: number;
229
+ pageSize?: number;
230
+ total?: number;
231
+ };
232
+ };
233
+ showRowNumber: {
234
+ type: BooleanConstructor;
235
+ default: boolean;
236
+ };
237
+ selectionMode: {
238
+ type: BooleanConstructor;
239
+ default: boolean;
240
+ };
241
+ currentRowMode: {
242
+ type: BooleanConstructor;
243
+ default: boolean;
244
+ };
245
+ }>> & Readonly<{
246
+ onSelectionChange?: ((...args: any[]) => any) | undefined;
247
+ onCurrentRowChange?: ((...args: any[]) => any) | undefined;
248
+ "onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
249
+ onRowClick?: ((...args: any[]) => any) | undefined;
250
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
251
+ data: any[];
252
+ pagination: {
253
+ currentPage?: number;
254
+ pageSize?: number;
255
+ total?: number;
256
+ };
257
+ showRowNumber: boolean;
258
+ selectionMode: boolean;
259
+ currentRowMode: boolean;
260
+ }> | null;
261
+ }, any, import('vue').ComponentProvideOptions, {
262
+ P: {};
263
+ B: {};
264
+ D: {};
265
+ C: {};
266
+ M: {};
267
+ Defaults: {};
268
+ }, Readonly<{
269
+ data: any[];
270
+ pagination: {
271
+ currentPage?: number;
272
+ pageSize?: number;
273
+ total?: number;
274
+ };
275
+ }> & Readonly<{
276
+ "onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
277
+ }>, {}, {}, {}, {}, {}>;
278
+ __isFragment?: never;
279
+ __isTeleport?: never;
280
+ __isSuspense?: never;
281
+ } & import('vue').ComponentOptionsBase<Readonly<{
282
+ data: any[];
283
+ pagination: {
284
+ currentPage?: number;
285
+ pageSize?: number;
286
+ total?: number;
287
+ };
288
+ }> & Readonly<{
289
+ "onUpdate:pagination"?: ((...args: any[]) => any) | undefined;
290
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
291
+ "update:pagination": (...args: any[]) => void;
292
+ }, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
293
+ $slots: {
294
+ default?(_: {}): any;
295
+ };
296
+ });
4
297
  };
5
298
  export default _default;
@@ -1,62 +1,135 @@
1
- import "lodash-es";
2
- import { defineComponent as i, createVNode as c, isVNode as p } from "vue";
3
- import { withInstall as f } from "../_util/vue/install.js";
1
+ import { findIndex as P } from "lodash-es";
2
+ import { defineComponent as A, useTemplateRef as x, ref as m, 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 T from "../Querytable/index.js";
5
6
  import "../Form/index.js";
6
- import b from "../Querytable/index.js";
7
- import a from "../Form/LovInput/hooks/useLov.js";
8
- import s from "../Pagetable/index.js";
9
- function d(t) {
10
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !p(t);
11
- }
12
- const y = /* @__PURE__ */ i({
7
+ import D from "../Form/LovInput/hooks/useLov.js";
8
+ import q from "../Pagetable/index.js";
9
+ const B = /* @__PURE__ */ A({
13
10
  name: "OLovQuerytable",
14
11
  inheritAttrs: !0,
15
- setup(t, {
16
- emit: u,
17
- slots: e,
18
- expose: l,
19
- attrs: m
20
- }) {
21
- const o = a(), r = (n) => {
22
- o == null || o.backfill(n);
23
- };
24
- return () => c(b, {
25
- onRowClick: r
26
- }, d(e) ? e : {
27
- default: () => [e]
12
+ __name: "LovQuerytable",
13
+ props: {
14
+ data: {}
15
+ },
16
+ setup(e) {
17
+ const d = x("table"), i = m(), f = m(), 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" && f.value && (l == null || l.backfill(f.value));
28
26
  });
27
+ const r = (a) => {
28
+ var t;
29
+ ((t = d.value) == null ? void 0 : t.$el).querySelectorAll(".el-table__row")[a].scrollIntoViewIfNeeded();
30
+ }, g = (a) => {
31
+ l == null || l.backfill(a);
32
+ }, u = (a) => {
33
+ const o = P(e.data, a);
34
+ o == -1 ? (i.value = 0, f.value = e.data[0]) : (i.value = o, f.value = a);
35
+ };
36
+ return k(
37
+ () => e.data,
38
+ () => {
39
+ e.data.length > 0 && d.value.setCurrentRow(e.data[0]);
40
+ }
41
+ ), (a, o) => (y(), I(L(T), {
42
+ ref: "table",
43
+ data: a.data,
44
+ onRowClick: g,
45
+ "current-row-mode": "",
46
+ onCurrentRowChange: u
47
+ }, {
48
+ default: S(() => [
49
+ z(a.$slots, "default")
50
+ ]),
51
+ _: 3
52
+ }, 8, ["data"]));
29
53
  }
30
- });
31
- function j(t) {
32
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !p(t);
33
- }
34
- const k = /* @__PURE__ */ i({
54
+ }), E = /* @__PURE__ */ A({
35
55
  name: "OLovPagetable",
36
56
  inheritAttrs: !0,
37
- setup(t, {
38
- emit: u,
39
- slots: e,
40
- expose: l,
41
- attrs: m
42
- }) {
43
- const o = a(), r = (n) => {
44
- o == null || o.backfill(n);
45
- };
46
- return () => c(s, {
47
- onRowClick: r
48
- }, j(e) ? e : {
49
- default: () => [e]
57
+ __name: "LovPagetable",
58
+ props: {
59
+ data: {},
60
+ pagination: {}
61
+ },
62
+ emits: ["update:pagination"],
63
+ setup(e, { emit: d }) {
64
+ const i = d, f = (t) => {
65
+ i("update:pagination", t);
66
+ }, l = x("table"), r = m(), g = m(), u = D();
67
+ u == null || u.registerKeydownHandler((t) => {
68
+ var c, R, s, 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
+ g.value && (u == null || u.backfill(g.value));
77
+ else if (t == "ArrowLeft") {
78
+ const n = (c = e.pagination) == null ? void 0 : c.currentPage, w = (R = e.pagination) == null ? void 0 : R.pageSize, v = (s = e.pagination) == null ? void 0 : s.total;
79
+ if (!n || !w || !v)
80
+ return;
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, w = (C = e.pagination) == null ? void 0 : C.pageSize, v = ($ = e.pagination) == null ? void 0 : $.total;
87
+ if (!n || !w || !v)
88
+ return;
89
+ const Q = Math.ceil(v / w);
90
+ n < Q && i("update:pagination", {
91
+ ...e.pagination,
92
+ currentPage: n + 1
93
+ });
94
+ }
50
95
  });
96
+ const a = (t) => {
97
+ var s;
98
+ ((s = l.value) == null ? void 0 : s.$el).querySelectorAll(".el-table__row")[t].scrollIntoViewIfNeeded();
99
+ }, o = (t) => {
100
+ u == null || u.backfill(t);
101
+ }, b = (t) => {
102
+ const c = P(e.data, t);
103
+ c == -1 ? (r.value = 0, g.value = e.data[0]) : (r.value = c, g.value = t);
104
+ };
105
+ return k(
106
+ () => e.data,
107
+ () => {
108
+ e.data.length > 0 && l.value.setCurrentRow(e.data[0]);
109
+ }
110
+ ), (t, c) => (y(), I(L(q), {
111
+ ref: "table",
112
+ data: t.data,
113
+ onRowClick: o,
114
+ "current-row-mode": "",
115
+ onCurrentRowChange: b,
116
+ pagination: t.pagination,
117
+ "onUpdate:pagination": f
118
+ }, {
119
+ default: S(() => [
120
+ z(t.$slots, "default")
121
+ ]),
122
+ _: 3
123
+ }, 8, ["data", "pagination"]));
51
124
  }
52
- }), h = f(
125
+ }), G = U(
53
126
  {},
54
127
  {
55
- LovQuerytable: y,
56
- LovPagetable: k
128
+ LovQuerytable: B,
129
+ LovPagetable: E
57
130
  }
58
131
  );
59
132
  export {
60
- h as default
133
+ G as default
61
134
  };
62
135
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/LovTable/LovQuerytable.tsx","../../../src/components/LovTable/LovPagetable.tsx","../../../src/components/LovTable/index.ts"],"sourcesContent":["import { defineComponent } from 'vue'\r\nimport { useLov } from '../Form'\r\nimport Querytable from '../Querytable'\r\n\r\nconst LovQuerytable = defineComponent({\r\n name: 'OLovQuerytable',\r\n inheritAttrs: true,\r\n setup(props, { emit, slots, expose, attrs }) {\r\n const lov = useLov()\r\n\r\n const onRowClick = (row: any) => {\r\n lov?.backfill(row)\r\n }\r\n\r\n return () => {\r\n return <Querytable onRowClick={onRowClick}>{slots}</Querytable>\r\n }\r\n },\r\n})\r\n\r\nexport default LovQuerytable\r\n","import { defineComponent } from 'vue'\r\nimport { useLov } from '../Form'\r\nimport Pagetable from '../Pagetable'\r\n\r\nconst LovPagetable = defineComponent({\r\n name: 'OLovPagetable',\r\n inheritAttrs: true,\r\n setup(props, { emit, slots, expose, attrs }) {\r\n const lov = useLov()\r\n\r\n const onRowClick = (row: any) => {\r\n lov?.backfill(row)\r\n }\r\n\r\n return () => {\r\n return <Pagetable onRowClick={onRowClick}>{slots}</Pagetable>\r\n }\r\n },\r\n})\r\n\r\nexport default LovPagetable\r\n","import { withInstall } from '../_util'\r\n\r\nimport LovQuerytable from './LovQuerytable'\r\nimport LovPagetable from './LovPagetable'\r\n\r\nexport default withInstall(\r\n {},\r\n {\r\n LovQuerytable,\r\n LovPagetable,\r\n }\r\n)\r\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","LovQuerytable","defineComponent","name","inheritAttrs","setup","props","emit","slots","expose","attrs","lov","useLov","onRowClick","row","backfill","_createVNode","Querytable","default","LovPagetable","Pagetable","index","withInstall"],"mappings":";;;;;;;;AAEsC,SAAAA,EAAAC,GAAA;AAAA,SAAA,OAAAA,KAAA,cAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,CAAA,MAAAK,qBAAAA,CAAAA,EAAAL,CAAA;AAAA;AAEtC,MAAMM,IAAgBC,gBAAAA,EAAgB;AAAA,EACpCC,MAAM;AAAA,EACNC,cAAc;AAAA,EACdC,MAAMC,GAAO;AAAA,IAAEC,MAAAA;AAAAA,IAAMC,OAAAA;AAAAA,IAAOC,QAAAA;AAAAA,IAAQC,OAAAA;AAAAA,EAAM,GAAG;AAC3C,UAAMC,IAAMC,KAENC,IAAcC,CAAAA,MAAa;AAC/BH,MAAAA,KAAAA,QAAAA,EAAKI,SAASD;AAAAA;AAGhB,WAAO,MACLE,EAAAC,GAAA;AAAA,MAAA,YAA+BJ;AAAAA,IAAU,GAAAnB,EAAGc,CAAK,IAALA,IAAK;AAAA,MAAAU,SAAAA,MAAA,CAALV,CAAK;AAAA,IAAA,CAAA;AAAA,EAErD;AACF,CAAC;AChBmC,SAAAd,EAAAC,GAAA;AAAA,SAAA,OAAAA,KAAA,cAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,CAAA,MAAAK,qBAAAA,CAAAA,EAAAL,CAAA;AAAA;AAEpC,MAAMwB,IAAejB,gBAAAA,EAAgB;AAAA,EACnCC,MAAM;AAAA,EACNC,cAAc;AAAA,EACdC,MAAMC,GAAO;AAAA,IAAEC,MAAAA;AAAAA,IAAMC,OAAAA;AAAAA,IAAOC,QAAAA;AAAAA,IAAQC,OAAAA;AAAAA,EAAM,GAAG;AAC3C,UAAMC,IAAMC,KAENC,IAAcC,CAAAA,MAAa;AAC/BH,MAAAA,KAAAA,QAAAA,EAAKI,SAASD;AAAAA;AAGhB,WAAO,MACLE,EAAAI,GAAA;AAAA,MAAA,YAA8BP;AAAAA,IAAU,GAAAnB,EAAGc,CAAK,IAALA,IAAK;AAAA,MAAAU,SAAAA,MAAA,CAALV,CAAK;AAAA,IAAA,CAAA;AAAA,EAEpD;AACF,CAAC,GCbDa,IAAeC;AAAA,EACb,CAAC;AAAA,EACD;AAAA,IACE,eAAArB;AAAA,IACA,cAAAkB;AAAA,EACF;AACF;"}
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 @current-row-change=\"handleCurrentRowChange\"><slot></slot></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\r\n ref=\"table\"\r\n :data=\"data\"\r\n @row-click=\"onRowClick\"\r\n current-row-mode\r\n @current-row-change=\"handleCurrentRowChange\"\r\n :pagination=\"pagination\"\r\n @update:pagination=\"onUpdatePagination\"\r\n >\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","_a","onRowClick","row","handleCurrentRowChange","findIndex","watch","emits","__emit","onUpdatePagination","data","currentPage","pageSize","_b","total","_c","_d","_e","_f","totalPage","withInstall","LovQuerytable","LovPagetable"],"mappings":";;;;;;;;;;;;;;;;AAYM,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,MAAM,cAAcQ,CAAO,GACpCE,EAAYR,EAAgB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