orion-design 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. package/README.md +5 -5
  2. package/dist/components/Form/index.js +247 -238
  3. package/dist/components/Form/index.js.map +1 -1
  4. package/dist/components/LovTable/LovPagetable.vue.d.ts +282 -2
  5. package/dist/components/LovTable/LovQuerytable.vue.d.ts +170 -2
  6. package/dist/components/LovTable/index.d.ts +267 -6
  7. package/dist/components/LovTable/index.js +112 -29
  8. package/dist/components/LovTable/index.js.map +1 -1
  9. package/dist/components/Pagetable/index.js +64 -63
  10. package/dist/components/Pagetable/index.js.map +1 -1
  11. package/dist/components/Querytable/index.js +62 -61
  12. package/dist/components/Querytable/index.js.map +1 -1
  13. package/dist/components/Tabs/index.js +371 -263
  14. package/dist/components/Tabs/index.js.map +1 -1
  15. package/dist/components/_util/arrays.js.map +1 -1
  16. package/dist/components/_util/browser.js +2 -2
  17. package/dist/components/_util/browser.js.map +1 -1
  18. package/dist/components/_util/dom/aria.js.map +1 -1
  19. package/dist/components/_util/dom/element.js +1 -1
  20. package/dist/components/_util/dom/element.js.map +1 -1
  21. package/dist/components/_util/dom/event.js.map +1 -1
  22. package/dist/components/_util/dom/position.js +1 -1
  23. package/dist/components/_util/dom/position.js.map +1 -1
  24. package/dist/components/_util/dom/scroll.js +1 -1
  25. package/dist/components/_util/dom/scroll.js.map +1 -1
  26. package/dist/components/_util/dom/style.js +1 -1
  27. package/dist/components/_util/dom/style.js.map +1 -1
  28. package/dist/components/_util/easings.js.map +1 -1
  29. package/dist/components/_util/error.js.map +1 -1
  30. package/dist/components/_util/i18n.js.map +1 -1
  31. package/dist/components/_util/index.js +1 -1
  32. package/dist/components/_util/objects.js.map +1 -1
  33. package/dist/components/_util/raf.js +1 -1
  34. package/dist/components/_util/raf.js.map +1 -1
  35. package/dist/components/_util/rand.js.map +1 -1
  36. package/dist/components/_util/strings.js.map +1 -1
  37. package/dist/components/_util/throttleByRaf.js.map +1 -1
  38. package/dist/components/_util/types.js.map +1 -1
  39. package/dist/components/_util/typescript.js.map +1 -1
  40. package/dist/components/_util/vue/global-node.js +1 -1
  41. package/dist/components/_util/vue/global-node.js.map +1 -1
  42. package/dist/components/_util/vue/icon.js.map +1 -1
  43. package/dist/components/_util/vue/install.js.map +1 -1
  44. package/dist/components/_util/vue/props/runtime.js.map +1 -1
  45. package/dist/components/_util/vue/refs.js.map +1 -1
  46. package/dist/components/_util/vue/size.js.map +1 -1
  47. package/dist/components/_util/vue/validator.js.map +1 -1
  48. package/dist/components/_util/vue/vnode.js.map +1 -1
  49. package/dist/{index-DG_8kbAs.js → index-C9tCD90X.js} +6 -6
  50. package/dist/{index-DG_8kbAs.js.map → index-C9tCD90X.js.map} +1 -1
  51. package/dist/version/version.d.ts +1 -1
  52. package/dist/version/version.js +1 -1
  53. package/dist/version/version.js.map +1 -1
  54. package/package.json +1 -1
  55. package/dist/index-DLvlyWAh.js +0 -127
  56. package/dist/index-DLvlyWAh.js.map +0 -1
@@ -1,34 +1,295 @@
1
1
  declare const _default: import('../_util').SFCWithInstall<{}> & {
2
2
  LovQuerytable: {
3
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<{}> & Readonly<{}>, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
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, {
4
90
  P: {};
5
91
  B: {};
6
92
  D: {};
7
93
  C: {};
8
94
  M: {};
9
95
  Defaults: {};
10
- }, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
96
+ }, Readonly<{
97
+ data: any[];
98
+ }> & Readonly<{}>, {}, {}, {}, {}, {}>;
11
99
  __isFragment?: never;
12
100
  __isTeleport?: never;
13
101
  __isSuspense?: never;
14
- } & import('vue').ComponentOptionsBase<Readonly<{}> & 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 () => {
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 () => {
15
105
  $slots: {
16
106
  default?(_: {}): any;
17
107
  };
18
108
  });
19
109
  LovPagetable: {
20
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<{}> & Readonly<{}>, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
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, {
21
262
  P: {};
22
263
  B: {};
23
264
  D: {};
24
265
  C: {};
25
266
  M: {};
26
267
  Defaults: {};
27
- }, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
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
+ }>, {}, {}, {}, {}, {}>;
28
278
  __isFragment?: never;
29
279
  __isTeleport?: never;
30
280
  __isSuspense?: never;
31
- } & import('vue').ComponentOptionsBase<Readonly<{}> & 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 () => {
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 () => {
32
293
  $slots: {
33
294
  default?(_: {}): any;
34
295
  };
@@ -1,52 +1,135 @@
1
- import "lodash-es";
2
- import { defineComponent as r, openBlock as n, createBlock as a, unref as l, withCtx as s, renderSlot as i } from "vue";
3
- import { withInstall as u } 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 f from "../Querytable/index.js";
5
+ import T from "../Querytable/index.js";
6
6
  import "../Form/index.js";
7
- import { o as _ } from "../../index-DLvlyWAh.js";
8
- import m from "../Form/LovInput/hooks/useLov.js";
9
- import b from "../Pagetable/index.js";
10
- const d = /* @__PURE__ */ r({
7
+ import D from "../Form/LovInput/hooks/useLov.js";
8
+ import q from "../Pagetable/index.js";
9
+ const B = /* @__PURE__ */ A({
11
10
  name: "OLovQuerytable",
12
11
  inheritAttrs: !0,
13
12
  __name: "LovQuerytable",
14
- setup(c) {
15
- const o = m(), e = (t) => {
16
- o == null || o.backfill(t);
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));
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);
17
35
  };
18
- return _("ArrowDown", (t) => {
19
- console.log("ArrowDown", t), t.stopPropagation(), t.preventDefault();
20
- }), (t, p) => (n(), a(l(f), { onRowClick: e }, {
21
- default: s(() => [
22
- i(t.$slots, "default")
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")
23
50
  ]),
24
51
  _: 3
25
- }));
52
+ }, 8, ["data"]));
26
53
  }
27
- }), w = /* @__PURE__ */ r({
54
+ }), E = /* @__PURE__ */ A({
28
55
  name: "OLovPagetable",
29
56
  inheritAttrs: !0,
30
57
  __name: "LovPagetable",
31
- setup(c) {
32
- const o = m(), e = (t) => {
33
- o == null || o.backfill(t);
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
+ }
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);
34
104
  };
35
- return (t, p) => (n(), a(l(b), { onRowClick: e }, {
36
- default: s(() => [
37
- i(t.$slots, "default")
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")
38
121
  ]),
39
122
  _: 3
40
- }));
123
+ }, 8, ["data", "pagination"]));
41
124
  }
42
- }), Q = u(
125
+ }), G = U(
43
126
  {},
44
127
  {
45
- LovQuerytable: d,
46
- LovPagetable: w
128
+ LovQuerytable: B,
129
+ LovPagetable: E
47
130
  }
48
131
  );
49
132
  export {
50
- Q as default
133
+ G as default
51
134
  };
52
135
  //# 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 @row-click=\"onRowClick\"><slot></slot></querytable>\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport Querytable from '../Querytable'\r\nimport { useLov } from '../Form'\r\nimport { onKeyStroke } from '@vueuse/core'\r\n\r\ndefineOptions({ name: 'OLovQuerytable', inheritAttrs: true })\r\n\r\nconst lov = useLov()\r\nconst onRowClick = (row: any) => {\r\n lov?.backfill(row)\r\n}\r\n\r\nonKeyStroke('ArrowDown', (e) => {\r\n console.log('ArrowDown', e)\r\n e.stopPropagation()\r\n e.preventDefault()\r\n})\r\n</script>\r\n","<template>\r\n <pagetable @row-click=\"onRowClick\"><slot></slot></pagetable>\r\n</template>\r\n<script setup lang=\"ts\">\r\nimport Pagetable from '../Pagetable'\r\nimport { useLov } from '../Form'\r\n\r\ndefineOptions({ name: 'OLovPagetable', inheritAttrs: true })\r\n\r\nconst lov = useLov()\r\nconst onRowClick = (row: any) => {\r\n lov?.backfill(row)\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":["lov","useLov","onRowClick","row","onKeyStroke","e","index","withInstall","LovQuerytable","LovPagetable"],"mappings":";;;;;;;;;;;;;;AAUA,UAAMA,IAAMC,KACNC,IAAa,CAACC,MAAa;AAC/B,MAAAH,KAAA,QAAAA,EAAK,SAASG;AAAA,IAAG;AAGP,WAAAC,EAAA,aAAa,CAACC,MAAM;AACtB,cAAA,IAAI,aAAaA,CAAC,GAC1BA,EAAE,gBAAgB,GAClBA,EAAE,eAAe;AAAA,IAAA,CAClB;;;;;;;;;;;;ACVD,UAAML,IAAMC,KACNC,IAAa,CAACC,MAAa;AAC/B,MAAAH,KAAA,QAAAA,EAAK,SAASG;AAAA,IAAG;;;;;;;;ICNnBG,IAAeC;AAAA,EACb,CAAC;AAAA,EACD;AAAA,IAAA,eACEC;AAAAA,IAAA,cACAC;AAAAA,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,GACpC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