orion-design 0.1.17 → 0.1.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. package/README.md +5 -5
  2. package/dist/components/Form/FileInput/FileInput.vue.d.ts +2 -2
  3. package/dist/components/Form/index.js +40 -38
  4. package/dist/components/Form/index.js.map +1 -1
  5. package/dist/components/LovTable/LovPagetable.vue.d.ts +28 -0
  6. package/dist/components/LovTable/LovQuerytable.vue.d.ts +28 -0
  7. package/dist/components/LovTable/index.d.ts +28 -0
  8. package/dist/components/LovTable/index.js +22 -20
  9. package/dist/components/LovTable/index.js.map +1 -1
  10. package/dist/components/Pagetable/Pagetable.d.ts +13 -0
  11. package/dist/components/Pagetable/index.d.ts +9 -0
  12. package/dist/components/Pagetable/index.js +131 -126
  13. package/dist/components/Pagetable/index.js.map +1 -1
  14. package/dist/components/Querytable/Querytable.d.ts +13 -0
  15. package/dist/components/Querytable/index.d.ts +9 -0
  16. package/dist/components/Querytable/index.js +85 -81
  17. package/dist/components/Querytable/index.js.map +1 -1
  18. package/dist/components/RichTextEditor/RichTextEditor.d.ts +71 -0
  19. package/dist/components/RichTextEditor/index.d.ts +51 -0
  20. package/dist/components/RichTextEditor/index.js +20791 -0
  21. package/dist/components/RichTextEditor/index.js.map +1 -0
  22. package/dist/components/Tabs/index.js +1 -1
  23. package/dist/components/_util/arrays.js.map +1 -1
  24. package/dist/components/_util/browser.js.map +1 -1
  25. package/dist/components/_util/dom/aria.js.map +1 -1
  26. package/dist/components/_util/dom/element.js.map +1 -1
  27. package/dist/components/_util/dom/event.js.map +1 -1
  28. package/dist/components/_util/dom/position.js.map +1 -1
  29. package/dist/components/_util/dom/scroll.js.map +1 -1
  30. package/dist/components/_util/dom/style.js.map +1 -1
  31. package/dist/components/_util/easings.js.map +1 -1
  32. package/dist/components/_util/error.js.map +1 -1
  33. package/dist/components/_util/i18n.js.map +1 -1
  34. package/dist/components/_util/objects.js.map +1 -1
  35. package/dist/components/_util/raf.js.map +1 -1
  36. package/dist/components/_util/rand.js.map +1 -1
  37. package/dist/components/_util/strings.js.map +1 -1
  38. package/dist/components/_util/throttleByRaf.js.map +1 -1
  39. package/dist/components/_util/types.js.map +1 -1
  40. package/dist/components/_util/typescript.js.map +1 -1
  41. package/dist/components/_util/vue/global-node.js.map +1 -1
  42. package/dist/components/_util/vue/icon.js +1 -1
  43. package/dist/components/_util/vue/icon.js.map +1 -1
  44. package/dist/components/_util/vue/install.js.map +1 -1
  45. package/dist/components/_util/vue/props/runtime.js.map +1 -1
  46. package/dist/components/_util/vue/refs.js.map +1 -1
  47. package/dist/components/_util/vue/size.js.map +1 -1
  48. package/dist/components/_util/vue/validator.js.map +1 -1
  49. package/dist/components/_util/vue/vnode.js.map +1 -1
  50. package/dist/components/components.d.ts +2 -0
  51. package/dist/components/components.js +12 -10
  52. package/dist/components/components.js.map +1 -1
  53. package/dist/components/index.js +16 -14
  54. package/dist/components/index.js.map +1 -1
  55. package/dist/components-Cx2JsH63.js +74 -0
  56. package/dist/{components-0PErqPHo.js.map → components-Cx2JsH63.js.map} +1 -1
  57. package/dist/{index-BwWeqwHB.js → index-C6P_0wAy.js} +57 -42
  58. package/dist/{index-BwWeqwHB.js.map → index-C6P_0wAy.js.map} +1 -1
  59. package/dist/index.css +1 -1
  60. package/dist/index.js +22 -20
  61. package/dist/index.js.map +1 -1
  62. package/global.d.ts +2 -0
  63. package/package.json +3 -1
  64. package/dist/components-0PErqPHo.js +0 -72
@@ -22,6 +22,10 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
22
22
  type: BooleanConstructor;
23
23
  default: boolean;
24
24
  };
25
+ size: {
26
+ type: import('vue').PropType<"" | "small" | "default" | "large">;
27
+ default: "" | "small" | "default" | "large";
28
+ };
25
29
  }>> & Readonly<{
26
30
  onSelectionChange?: ((...args: any[]) => any) | undefined;
27
31
  onCurrentRowChange?: ((...args: any[]) => any) | undefined;
@@ -43,12 +47,17 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
43
47
  type: BooleanConstructor;
44
48
  default: boolean;
45
49
  };
50
+ size: {
51
+ type: import('vue').PropType<"" | "small" | "default" | "large">;
52
+ default: "" | "small" | "default" | "large";
53
+ };
46
54
  }>> & Readonly<{
47
55
  onSelectionChange?: ((...args: any[]) => any) | undefined;
48
56
  onCurrentRowChange?: ((...args: any[]) => any) | undefined;
49
57
  onRowClick?: ((...args: any[]) => any) | undefined;
50
58
  }>, {
51
59
  data: any[];
60
+ size: "" | "small" | "default" | "large";
52
61
  showRowNumber: boolean;
53
62
  selectionMode: boolean;
54
63
  currentRowMode: boolean;
@@ -76,12 +85,17 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
76
85
  type: BooleanConstructor;
77
86
  default: boolean;
78
87
  };
88
+ size: {
89
+ type: import('vue').PropType<"" | "small" | "default" | "large">;
90
+ default: "" | "small" | "default" | "large";
91
+ };
79
92
  }>> & Readonly<{
80
93
  onSelectionChange?: ((...args: any[]) => any) | undefined;
81
94
  onCurrentRowChange?: ((...args: any[]) => any) | undefined;
82
95
  onRowClick?: ((...args: any[]) => any) | undefined;
83
96
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
84
97
  data: any[];
98
+ size: "" | "small" | "default" | "large";
85
99
  showRowNumber: boolean;
86
100
  selectionMode: boolean;
87
101
  currentRowMode: boolean;
@@ -157,6 +171,10 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
157
171
  type: BooleanConstructor;
158
172
  default: boolean;
159
173
  };
174
+ size: {
175
+ type: import('vue').PropType<"" | "small" | "default" | "large">;
176
+ default: "" | "small" | "default" | "large";
177
+ };
160
178
  }>> & Readonly<{
161
179
  onSelectionChange?: ((...args: any[]) => any) | undefined;
162
180
  onCurrentRowChange?: ((...args: any[]) => any) | undefined;
@@ -191,6 +209,10 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
191
209
  type: BooleanConstructor;
192
210
  default: boolean;
193
211
  };
212
+ size: {
213
+ type: import('vue').PropType<"" | "small" | "default" | "large">;
214
+ default: "" | "small" | "default" | "large";
215
+ };
194
216
  }>> & Readonly<{
195
217
  onSelectionChange?: ((...args: any[]) => any) | undefined;
196
218
  onCurrentRowChange?: ((...args: any[]) => any) | undefined;
@@ -198,6 +220,7 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
198
220
  onRowClick?: ((...args: any[]) => any) | undefined;
199
221
  }>, {
200
222
  data: any[];
223
+ size: "" | "small" | "default" | "large";
201
224
  pagination: {
202
225
  currentPage?: number;
203
226
  pageSize?: number;
@@ -242,6 +265,10 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
242
265
  type: BooleanConstructor;
243
266
  default: boolean;
244
267
  };
268
+ size: {
269
+ type: import('vue').PropType<"" | "small" | "default" | "large">;
270
+ default: "" | "small" | "default" | "large";
271
+ };
245
272
  }>> & Readonly<{
246
273
  onSelectionChange?: ((...args: any[]) => any) | undefined;
247
274
  onCurrentRowChange?: ((...args: any[]) => any) | undefined;
@@ -249,6 +276,7 @@ declare const _default: import('../_util').SFCWithInstall<{}> & {
249
276
  onRowClick?: ((...args: any[]) => any) | undefined;
250
277
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
251
278
  data: any[];
279
+ size: "" | "small" | "default" | "large";
252
280
  pagination: {
253
281
  currentPage?: number;
254
282
  pageSize?: number;
@@ -1,5 +1,5 @@
1
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";
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
3
  import { withInstall as U } from "../_util/vue/install.js";
4
4
  import "element-plus";
5
5
  import T from "../Querytable/index.js";
@@ -14,7 +14,7 @@ const B = /* @__PURE__ */ A({
14
14
  data: {}
15
15
  },
16
16
  setup(e) {
17
- const d = x("table"), i = m(), f = m(), l = D();
17
+ const d = x("table"), i = v(), s = v(), l = D();
18
18
  l == null || l.registerKeydownHandler((a) => {
19
19
  if (a == "ArrowUp") {
20
20
  let o;
@@ -22,16 +22,16 @@ const B = /* @__PURE__ */ A({
22
22
  } else if (a == "ArrowDown") {
23
23
  let o;
24
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));
25
+ } else a == "Enter" && s.value && (l == null || l.backfill(s.value));
26
26
  });
27
27
  const r = (a) => {
28
28
  var t;
29
29
  ((t = d.value) == null ? void 0 : t.$el).querySelectorAll(".el-table__row")[a].scrollIntoViewIfNeeded();
30
- }, g = (a) => {
30
+ }, f = (a) => {
31
31
  l == null || l.backfill(a);
32
32
  }, u = (a) => {
33
33
  const o = P(e.data, a);
34
- o == -1 ? (i.value = 0, f.value = e.data[0]) : (i.value = o, f.value = a);
34
+ o == -1 ? (i.value = 0, s.value = e.data[0]) : (i.value = o, s.value = a);
35
35
  };
36
36
  return k(
37
37
  () => e.data,
@@ -41,9 +41,10 @@ const B = /* @__PURE__ */ A({
41
41
  ), (a, o) => (y(), I(L(T), {
42
42
  ref: "table",
43
43
  data: a.data,
44
- onRowClick: g,
44
+ onRowClick: f,
45
45
  "current-row-mode": "",
46
- onCurrentRowChange: u
46
+ onCurrentRowChange: u,
47
+ size: "small"
47
48
  }, {
48
49
  default: S(() => [
49
50
  z(a.$slots, "default")
@@ -61,11 +62,11 @@ const B = /* @__PURE__ */ A({
61
62
  },
62
63
  emits: ["update:pagination"],
63
64
  setup(e, { emit: d }) {
64
- const i = d, f = (t) => {
65
+ const i = d, s = (t) => {
65
66
  i("update:pagination", t);
66
- }, l = x("table"), r = m(), g = m(), u = D();
67
+ }, l = x("table"), r = v(), f = v(), u = D();
67
68
  u == null || u.registerKeydownHandler((t) => {
68
- var c, R, s, h, C, $;
69
+ var c, R, g, h, C, $;
69
70
  if (t == "ArrowUp") {
70
71
  let n;
71
72
  r.value == 0 ? n = e.data[e.data.length - 1] : n = e.data[r.value - 1], l.value.setCurrentRow(n), a(r.value);
@@ -73,20 +74,20 @@ const B = /* @__PURE__ */ A({
73
74
  let n;
74
75
  r.value == e.data.length - 1 ? n = e.data[0] : n = e.data[r.value + 1], l.value.setCurrentRow(n), a(r.value);
75
76
  } else if (t == "Enter")
76
- g.value && (u == null || u.backfill(g.value));
77
+ f.value && (u == null || u.backfill(f.value));
77
78
  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)
79
+ const n = (c = e.pagination) == null ? void 0 : c.currentPage, w = (R = e.pagination) == null ? void 0 : R.pageSize, m = (g = e.pagination) == null ? void 0 : g.total;
80
+ if (!n || !w || !m)
80
81
  return;
81
82
  n > 1 && i("update:pagination", {
82
83
  ...e.pagination,
83
84
  currentPage: n - 1
84
85
  });
85
86
  } 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)
87
+ const n = (h = e.pagination) == null ? void 0 : h.currentPage, w = (C = e.pagination) == null ? void 0 : C.pageSize, m = ($ = e.pagination) == null ? void 0 : $.total;
88
+ if (!n || !w || !m)
88
89
  return;
89
- const Q = Math.ceil(v / w);
90
+ const Q = Math.ceil(m / w);
90
91
  n < Q && i("update:pagination", {
91
92
  ...e.pagination,
92
93
  currentPage: n + 1
@@ -94,13 +95,13 @@ const B = /* @__PURE__ */ A({
94
95
  }
95
96
  });
96
97
  const a = (t) => {
97
- var s;
98
- ((s = l.value) == null ? void 0 : s.$el).querySelectorAll(".el-table__row")[t].scrollIntoViewIfNeeded();
98
+ var g;
99
+ ((g = l.value) == null ? void 0 : g.$el).querySelectorAll(".el-table__row")[t].scrollIntoViewIfNeeded();
99
100
  }, o = (t) => {
100
101
  u == null || u.backfill(t);
101
102
  }, b = (t) => {
102
103
  const c = P(e.data, t);
103
- c == -1 ? (r.value = 0, g.value = e.data[0]) : (r.value = c, g.value = t);
104
+ c == -1 ? (r.value = 0, f.value = e.data[0]) : (r.value = c, f.value = t);
104
105
  };
105
106
  return k(
106
107
  () => e.data,
@@ -114,7 +115,8 @@ const B = /* @__PURE__ */ A({
114
115
  "current-row-mode": "",
115
116
  onCurrentRowChange: b,
116
117
  pagination: t.pagination,
117
- "onUpdate:pagination": f
118
+ "onUpdate:pagination": s,
119
+ size: "small"
118
120
  }, {
119
121
  default: S(() => [
120
122
  z(t.$slots, "default")
@@ -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 @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,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,MAAM,cAAcQ,CAAO,GACpCE,EAAYR,EAAgB,KAAK;AAAA,MAAA,MACnC,CAAWK,KAAQ,WACjBH,EAAe,UAASC,KAAA,QAAAA,EAAK,SAASD,EAAe;AAAA,IACvD;AAGI,UAAAM,IAAc,CAACC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QK,EAAA,KAAK,CAAC,MAE7BP,EAAgB,QAAQS,GACxBP,EAAe,QAAQU;AAAA,IACzB;AAGF,WAAAG;AAAA,MACE,MAAMR,EAAI;AAAA,MACV,MAAM;AACA,QAAAA,EAAI,KAAC,SAAS,KAEhBT,EAAS,MAAM,cAAcS,EAAA,KAAK,CAAC,CAAC;AAAA,MAExC;AAAA,IAAA;;;;;;;;;;;;;;;ICpHFE,IAAeoB;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\" 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\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 size=\"small\"\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":";;;;;;;;;;;;;;;;AAcM,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,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,MAAM,cAAcQ,CAAO,GACpCE,EAAYR,EAAgB,KAAK;AAAA,MAAA,MACnC,CAAWK,KAAQ,WACjBH,EAAe,UAASC,KAAA,QAAAA,EAAK,SAASD,EAAe;AAAA,IACvD;AAGI,UAAAM,IAAc,CAACC,MAAkB;;AAGrC,QAFeC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MAE7BP,EAAgB,QAAQS,GACxBP,EAAe,QAAQU;AAAA,IACzB;AAGF,WAAAG;AAAA,MACE,MAAMR,EAAI;AAAA,MACV,MAAM;AACA,QAAAA,EAAI,KAAC,SAAS,KAEhBT,EAAS,MAAM,cAAcS,EAAA,KAAK,CAAC,CAAC;AAAA,MAExC;AAAA,IAAA;;;;;;;;;;;;;;;;ICrHFE,IAAeoB;AAAA,EACb,CAAC;AAAA,EACD;AAAA,IAAA,eACEC;AAAAA,IAAA,cACAC;AAAAA,EACF;AACF;"}
@@ -28,6 +28,10 @@ export declare const pagetableProps: () => {
28
28
  type: BooleanConstructor;
29
29
  default: boolean;
30
30
  };
31
+ size: {
32
+ type: PropType<"" | "small" | "default" | "large">;
33
+ default: "" | "small" | "default" | "large";
34
+ };
31
35
  };
32
36
  export type PagetableProps = Partial<ExtractPropTypes<ReturnType<typeof pagetableProps>>>;
33
37
  declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
@@ -59,6 +63,10 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
59
63
  type: BooleanConstructor;
60
64
  default: boolean;
61
65
  };
66
+ size: {
67
+ type: PropType<"" | "small" | "default" | "large">;
68
+ default: "" | "small" | "default" | "large";
69
+ };
62
70
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("selectionChange" | "currentRowChange" | "update:pagination" | "rowClick")[], "selectionChange" | "currentRowChange" | "update:pagination" | "rowClick", import('vue').PublicProps, Readonly<ExtractPropTypes<{
63
71
  data: {
64
72
  type: PropType<any[]>;
@@ -88,6 +96,10 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
88
96
  type: BooleanConstructor;
89
97
  default: boolean;
90
98
  };
99
+ size: {
100
+ type: PropType<"" | "small" | "default" | "large">;
101
+ default: "" | "small" | "default" | "large";
102
+ };
91
103
  }>> & Readonly<{
92
104
  onSelectionChange?: ((...args: any[]) => any) | undefined;
93
105
  onCurrentRowChange?: ((...args: any[]) => any) | undefined;
@@ -95,6 +107,7 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
95
107
  onRowClick?: ((...args: any[]) => any) | undefined;
96
108
  }>, {
97
109
  data: any[];
110
+ size: "" | "small" | "default" | "large";
98
111
  pagination: {
99
112
  currentPage?: number;
100
113
  pageSize?: number;
@@ -38,6 +38,10 @@ declare const _default: import('../_util').SFCWithInstall<import('vue').DefineCo
38
38
  type: BooleanConstructor;
39
39
  default: boolean;
40
40
  };
41
+ size: {
42
+ type: import('vue').PropType<"" | "small" | "default" | "large">;
43
+ default: "" | "small" | "default" | "large";
44
+ };
41
45
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("selectionChange" | "currentRowChange" | "update:pagination" | "rowClick")[], "selectionChange" | "currentRowChange" | "update:pagination" | "rowClick", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
42
46
  data: {
43
47
  type: import('vue').PropType<any[]>;
@@ -67,6 +71,10 @@ declare const _default: import('../_util').SFCWithInstall<import('vue').DefineCo
67
71
  type: BooleanConstructor;
68
72
  default: boolean;
69
73
  };
74
+ size: {
75
+ type: import('vue').PropType<"" | "small" | "default" | "large">;
76
+ default: "" | "small" | "default" | "large";
77
+ };
70
78
  }>> & Readonly<{
71
79
  onSelectionChange?: ((...args: any[]) => any) | undefined;
72
80
  onCurrentRowChange?: ((...args: any[]) => any) | undefined;
@@ -74,6 +82,7 @@ declare const _default: import('../_util').SFCWithInstall<import('vue').DefineCo
74
82
  onRowClick?: ((...args: any[]) => any) | undefined;
75
83
  }>, {
76
84
  data: any[];
85
+ size: "" | "small" | "default" | "large";
77
86
  pagination: {
78
87
  currentPage?: number;
79
88
  pageSize?: number;