orion-design 0.1.50 → 0.1.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
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";
2
+ import { defineComponent as A, useTemplateRef as k, ref as v, watch as x, openBlock as y, createBlock as I, unref as L, withCtx as S, renderSlot as z } from "vue";
3
+ import { withInstall as D } from "../_util/vue/install.js";
4
4
  import "element-plus";
5
5
  import T from "../Querytable/index.js";
6
6
  import "../Form/index.js";
7
- import D from "../Form/LovInput/hooks/useLov.js";
7
+ import Q from "../Form/LovInput/hooks/useLov.js";
8
8
  import q from "../Pagetable/index.js";
9
9
  const B = /* @__PURE__ */ A({
10
10
  name: "OLovQuerytable",
@@ -14,7 +14,7 @@ const B = /* @__PURE__ */ A({
14
14
  data: {}
15
15
  },
16
16
  setup(e) {
17
- const d = x("table"), i = v(), s = v(), l = D();
17
+ const d = k("table"), i = v(), s = v(), l = Q();
18
18
  l == null || l.registerKeydownHandler((a) => {
19
19
  if (a == "ArrowUp") {
20
20
  let o;
@@ -32,7 +32,7 @@ const B = /* @__PURE__ */ A({
32
32
  const o = P(e.data, a);
33
33
  o == -1 ? (i.value = 0, s.value = e.data[0]) : (i.value = o, s.value = a);
34
34
  };
35
- return k(
35
+ return x(
36
36
  () => e.data,
37
37
  () => {
38
38
  e.data.length > 0 && d.value.setCurrentRow(e.data[0]);
@@ -63,7 +63,7 @@ const B = /* @__PURE__ */ A({
63
63
  setup(e, { emit: d }) {
64
64
  const i = d, s = (t) => {
65
65
  i("update:pagination", t);
66
- }, l = x("table"), r = v(), f = v(), u = D();
66
+ }, l = k("table"), r = v(), f = v(), u = Q();
67
67
  u.registerKeydownHandler((t) => {
68
68
  var c, m, b, h, C, $;
69
69
  if (t == "ArrowUp") {
@@ -86,8 +86,8 @@ const B = /* @__PURE__ */ A({
86
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
87
  if (!n || !g || !w)
88
88
  return;
89
- const Q = Math.ceil(w / g);
90
- n < Q && i("update:pagination", {
89
+ const U = Math.ceil(w / g);
90
+ n < U && i("update:pagination", {
91
91
  ...e.pagination,
92
92
  currentPage: n + 1
93
93
  });
@@ -101,7 +101,7 @@ const B = /* @__PURE__ */ A({
101
101
  const c = P(e.data, t);
102
102
  c == -1 ? (r.value = 0, f.value = e.data[0]) : (r.value = c, f.value = t);
103
103
  };
104
- return k(
104
+ return x(
105
105
  () => e.data,
106
106
  () => {
107
107
  e.data.length > 0 && l.value.setCurrentRow(e.data[0]);
@@ -123,14 +123,9 @@ const B = /* @__PURE__ */ A({
123
123
  _: 3
124
124
  }, 8, ["data", "pagination"]));
125
125
  }
126
- }), G = U(
127
- {},
128
- {
129
- LovQuerytable: B,
130
- LovPagetable: E
131
- }
132
- );
126
+ }), G = D(B), J = D(E);
133
127
  export {
134
- G as default
128
+ J as LovPagetable,
129
+ G as LovQuerytable
135
130
  };
136
131
  //# 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\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,E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QAAA,CAC5B;AAAA,MAEL;AAAA,IAAA,CACD;AAEK,UAAAX,IAAc,CAACC,MAAkB;AAGrC,MAFeX,EAAS,MAAO,IACX,iBAAiB,gBAAgB,EAAEW,CAAK,EACvD,uBAAuB;AAAA,IAAA,GAGxBC,IAAa,CAACC,MAAa;AAC/B,MAAAR,KAAA,QAAAA,EAAK,SAASQ;AAAA,IAAG,GAGbC,IAAyB,CAACD,MAAa;AAC3C,YAAMF,IAAQI,EAAUN,EAAI,MAAEI,CAAG;AACjC,MAAIF,KAAS,MACXT,EAAgB,QAAQ,GACTE,EAAA,QAAQK,EAAA,KAAK,CAAC,MAE7BP,EAAgB,QAAQS,GACxBP,EAAe,QAAQS;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
+ {"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 LovQuerytableInner from './LovQuerytable.vue'\r\nimport LovPagetableInner from './LovPagetable.vue'\r\n\r\nexport const LovQuerytable = withInstall(LovQuerytableInner)\r\nexport const LovPagetable = withInstall(LovPagetableInner)\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","LovQuerytable","withInstall","LovQuerytableInner","LovPagetable","LovPagetableInner"],"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,C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AAAX,IAAc,CAACC,MAAkB;AAGrC,MAFeX,EAAS,MAAO,IACX,iBAAiB,gBAAgB,EAAEW,CAAK,EACvD,uBAAuB;AAAA,IAAA,GAGxBC,IAAa,CAACC,MAAa;AAC/B,MAAAR,KAAA,QAAAA,EAAK,SAASQ;AAAA,IAAG,GAGbC,IAAyB,CAACD,MAAa;AAC3C,YAAMF,IAAQI,EAAUN,EAAI,MAAEI,CAAG;AACjC,MAAIF,KAAS,MACXT,EAAgB,QAAQ,GACTE,EAAA,QAAQK,EAAA,KAAK,CAAC,MAE7BP,EAAgB,QAAQS,GACxBP,EAAe,QAAQS;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;;;;;;;;;;;;;;;;;IC9GWsB,IAAgBC,EAAYC,CAAkB,GAC9CC,IAAeF,EAAYG,CAAiB;"}
@@ -1,4 +1,4 @@
1
- import { PropType, ExtractPropTypes, CSSProperties } from 'vue';
1
+ import { ExtractPropTypes, CSSProperties, ComponentPublicInstance } from 'vue';
2
2
  type rowClassNameFn = (data: {
3
3
  rowData: any;
4
4
  rowIndex: number;
@@ -27,15 +27,15 @@ type cellStyleFn = (data: {
27
27
  }) => CSSProperties;
28
28
  export declare const pagetableProps: () => {
29
29
  data: {
30
- type: PropType<any[]>;
30
+ type: import('vue').PropType<any[]>;
31
31
  default: any[];
32
32
  };
33
33
  tailData: {
34
- type: PropType<Record<string, any>>;
34
+ type: import('vue').PropType<Record<string, any>>;
35
35
  default: Record<string, any>;
36
36
  };
37
37
  pagination: {
38
- type: PropType<{
38
+ type: import('vue').PropType<{
39
39
  currentPage?: number;
40
40
  pageSize?: number;
41
41
  pageSizes?: number[];
@@ -53,7 +53,7 @@ export declare const pagetableProps: () => {
53
53
  default: boolean;
54
54
  };
55
55
  paginationPagerCount: {
56
- type: PropType<number>;
56
+ type: import('vue').PropType<number>;
57
57
  default: number;
58
58
  };
59
59
  paginationShowTotal: {
@@ -81,38 +81,46 @@ export declare const pagetableProps: () => {
81
81
  default: boolean;
82
82
  };
83
83
  size: {
84
- type: PropType<"" | "small" | "default" | "large">;
84
+ type: import('vue').PropType<"" | "small" | "default" | "large">;
85
85
  default: "" | "small" | "default" | "large";
86
86
  };
87
87
  rowClassName: {
88
- type: PropType<string | rowClassNameFn>;
88
+ type: import('vue').PropType<string | rowClassNameFn>;
89
89
  default: string | rowClassNameFn;
90
90
  };
91
91
  rowStyle: {
92
- type: PropType<CSSProperties | rowStyleFn>;
92
+ type: import('vue').PropType<CSSProperties | rowStyleFn>;
93
93
  default: CSSProperties | rowStyleFn;
94
94
  };
95
95
  cellClassName: {
96
- type: PropType<string | cellClassNameFn>;
96
+ type: import('vue').PropType<string | cellClassNameFn>;
97
97
  default: string | cellClassNameFn;
98
98
  };
99
99
  cellStyle: {
100
- type: PropType<CSSProperties | cellStyleFn>;
100
+ type: import('vue').PropType<CSSProperties | cellStyleFn>;
101
101
  default: CSSProperties | cellStyleFn;
102
102
  };
103
103
  };
104
104
  export type PagetableProps = Partial<ExtractPropTypes<ReturnType<typeof pagetableProps>>>;
105
+ export interface PagetableExpose {
106
+ clearSelection: () => void;
107
+ toggleRowSelection: (row: any, selected?: boolean) => void;
108
+ toggleAllSelection: () => void;
109
+ getSelectionRows: () => any[];
110
+ setCurrentRow: (row: any) => void;
111
+ }
112
+ export type PagetableInstance = ComponentPublicInstance<PagetableProps, PagetableExpose>;
105
113
  declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
106
114
  data: {
107
- type: PropType<any[]>;
115
+ type: import('vue').PropType<any[]>;
108
116
  default: any[];
109
117
  };
110
118
  tailData: {
111
- type: PropType<Record<string, any>>;
119
+ type: import('vue').PropType<Record<string, any>>;
112
120
  default: Record<string, any>;
113
121
  };
114
122
  pagination: {
115
- type: PropType<{
123
+ type: import('vue').PropType<{
116
124
  currentPage?: number;
117
125
  pageSize?: number;
118
126
  pageSizes?: number[];
@@ -130,7 +138,7 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
130
138
  default: boolean;
131
139
  };
132
140
  paginationPagerCount: {
133
- type: PropType<number>;
141
+ type: import('vue').PropType<number>;
134
142
  default: number;
135
143
  };
136
144
  paginationShowTotal: {
@@ -158,36 +166,36 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
158
166
  default: boolean;
159
167
  };
160
168
  size: {
161
- type: PropType<"" | "small" | "default" | "large">;
169
+ type: import('vue').PropType<"" | "small" | "default" | "large">;
162
170
  default: "" | "small" | "default" | "large";
163
171
  };
164
172
  rowClassName: {
165
- type: PropType<string | rowClassNameFn>;
173
+ type: import('vue').PropType<string | rowClassNameFn>;
166
174
  default: string | rowClassNameFn;
167
175
  };
168
176
  rowStyle: {
169
- type: PropType<CSSProperties | rowStyleFn>;
177
+ type: import('vue').PropType<CSSProperties | rowStyleFn>;
170
178
  default: CSSProperties | rowStyleFn;
171
179
  };
172
180
  cellClassName: {
173
- type: PropType<string | cellClassNameFn>;
181
+ type: import('vue').PropType<string | cellClassNameFn>;
174
182
  default: string | cellClassNameFn;
175
183
  };
176
184
  cellStyle: {
177
- type: PropType<CSSProperties | cellStyleFn>;
185
+ type: import('vue').PropType<CSSProperties | cellStyleFn>;
178
186
  default: CSSProperties | cellStyleFn;
179
187
  };
180
188
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("select" | "select-all" | "selectionChange" | "currentRowChange" | "update:pagination" | "paginationChange" | "rowClick" | "rowDblclick" | "cellClick" | "cellDblclick")[], "select" | "select-all" | "selectionChange" | "currentRowChange" | "update:pagination" | "paginationChange" | "rowClick" | "rowDblclick" | "cellClick" | "cellDblclick", import('vue').PublicProps, Readonly<ExtractPropTypes<{
181
189
  data: {
182
- type: PropType<any[]>;
190
+ type: import('vue').PropType<any[]>;
183
191
  default: any[];
184
192
  };
185
193
  tailData: {
186
- type: PropType<Record<string, any>>;
194
+ type: import('vue').PropType<Record<string, any>>;
187
195
  default: Record<string, any>;
188
196
  };
189
197
  pagination: {
190
- type: PropType<{
198
+ type: import('vue').PropType<{
191
199
  currentPage?: number;
192
200
  pageSize?: number;
193
201
  pageSizes?: number[];
@@ -205,7 +213,7 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
205
213
  default: boolean;
206
214
  };
207
215
  paginationPagerCount: {
208
- type: PropType<number>;
216
+ type: import('vue').PropType<number>;
209
217
  default: number;
210
218
  };
211
219
  paginationShowTotal: {
@@ -233,23 +241,23 @@ declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
233
241
  default: boolean;
234
242
  };
235
243
  size: {
236
- type: PropType<"" | "small" | "default" | "large">;
244
+ type: import('vue').PropType<"" | "small" | "default" | "large">;
237
245
  default: "" | "small" | "default" | "large";
238
246
  };
239
247
  rowClassName: {
240
- type: PropType<string | rowClassNameFn>;
248
+ type: import('vue').PropType<string | rowClassNameFn>;
241
249
  default: string | rowClassNameFn;
242
250
  };
243
251
  rowStyle: {
244
- type: PropType<CSSProperties | rowStyleFn>;
252
+ type: import('vue').PropType<CSSProperties | rowStyleFn>;
245
253
  default: CSSProperties | rowStyleFn;
246
254
  };
247
255
  cellClassName: {
248
- type: PropType<string | cellClassNameFn>;
256
+ type: import('vue').PropType<string | cellClassNameFn>;
249
257
  default: string | cellClassNameFn;
250
258
  };
251
259
  cellStyle: {
252
- type: PropType<CSSProperties | cellStyleFn>;
260
+ type: import('vue').PropType<CSSProperties | cellStyleFn>;
253
261
  default: CSSProperties | cellStyleFn;
254
262
  };
255
263
  }>> & Readonly<{
@@ -0,0 +1,38 @@
1
+ interface PaginationProps {
2
+ currentPage: number;
3
+ pageSize: number;
4
+ pageSizes?: number[];
5
+ total?: number;
6
+ }
7
+ type LoadDataFn<T> = (pagination: PaginationProps) => Promise<{
8
+ data: T[];
9
+ total: number;
10
+ }>;
11
+ interface UsePagetableOptions<T> {
12
+ tableRef: any;
13
+ onLoadData: LoadDataFn<T>;
14
+ afterSelectionChange?: (newSelection: T[]) => void;
15
+ afterCurrentRowChange?: (currentRow: T, oldCurrentRow: T) => void;
16
+ initialData?: T[];
17
+ initialPagination?: PaginationProps;
18
+ }
19
+ declare const usePagetable: <T>(options: UsePagetableOptions<T>) => {
20
+ data: import('@vue/reactivity').UnwrapRefSimple<T>[];
21
+ pagination: {
22
+ currentPage: number;
23
+ pageSize: number;
24
+ pageSizes?: number[] | undefined;
25
+ total?: number | undefined;
26
+ };
27
+ selection: import('@vue/reactivity').UnwrapRefSimple<T>[];
28
+ currentRow: T | undefined;
29
+ onSelectionChange: (newSelection: T[]) => void;
30
+ onCurrentRowChange: (newCurrentRow: T, oldCurrentRow: T) => void;
31
+ clearSelection: () => void;
32
+ toggleRowSelection: (row: T, selected?: boolean) => void;
33
+ toggleAllSelection: () => void;
34
+ getSelectionRows: () => void;
35
+ setCurrentRow: (row: T) => void;
36
+ loadData: () => Promise<void>;
37
+ };
38
+ export default usePagetable;
@@ -0,0 +1,49 @@
1
+ import { ref as a, reactive as w } from "vue";
2
+ const m = (R) => {
3
+ const { tableRef: o, onLoadData: v, afterSelectionChange: l, afterCurrentRowChange: c, initialData: i, initialPagination: g } = R, r = a(i || []), n = a(
4
+ g || {
5
+ currentPage: 1,
6
+ pageSize: 10
7
+ }
8
+ ), s = a([]), u = a();
9
+ return w({
10
+ data: r,
11
+ pagination: n,
12
+ selection: s,
13
+ currentRow: u,
14
+ onSelectionChange: (e) => {
15
+ s.value = e, l && l(e);
16
+ },
17
+ onCurrentRowChange: (e, t) => {
18
+ u.value = e, c && c(e, t);
19
+ },
20
+ clearSelection: () => {
21
+ var e;
22
+ (e = o.value) == null || e.clearSelection();
23
+ },
24
+ toggleRowSelection: (e, t) => {
25
+ var S;
26
+ (S = o.value) == null || S.toggleRowSelection(e, t);
27
+ },
28
+ toggleAllSelection: () => {
29
+ var e;
30
+ (e = o.value) == null || e.toggleAllSelection();
31
+ },
32
+ getSelectionRows: () => {
33
+ var e;
34
+ (e = o.value) == null || e.getSelectionRows();
35
+ },
36
+ setCurrentRow: (e) => {
37
+ var t;
38
+ (t = o.value) == null || t.setCurrentRow(e);
39
+ },
40
+ loadData: async () => {
41
+ const e = await v(n.value);
42
+ r.value = e.data, n.value.total = e.total;
43
+ }
44
+ });
45
+ };
46
+ export {
47
+ m as default
48
+ };
49
+ //# sourceMappingURL=usePagetable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePagetable.js","sources":["../../../../src/components/Pagetable/hooks/usePagetable.ts"],"sourcesContent":["import { reactive, ref } from 'vue'\r\n\r\ninterface PaginationProps {\r\n currentPage: number\r\n pageSize: number\r\n pageSizes?: number[]\r\n total?: number\r\n}\r\n\r\ntype LoadDataFn<T> = (pagination: PaginationProps) => Promise<{\r\n data: T[]\r\n total: number\r\n}>\r\n\r\ninterface UsePagetableOptions<T> {\r\n tableRef: any\r\n onLoadData: LoadDataFn<T>\r\n afterSelectionChange?: (newSelection: T[]) => void\r\n afterCurrentRowChange?: (currentRow: T, oldCurrentRow: T) => void\r\n initialData?: T[]\r\n initialPagination?: PaginationProps\r\n}\r\n\r\nconst usePagetable = <T>(options: UsePagetableOptions<T>) => {\r\n const { tableRef, onLoadData, afterSelectionChange, afterCurrentRowChange, initialData, initialPagination } = options\r\n\r\n const data = ref<T[]>(initialData ? initialData : [])\r\n const pagination = ref<PaginationProps>(\r\n initialPagination\r\n ? initialPagination\r\n : {\r\n currentPage: 1,\r\n pageSize: 10,\r\n }\r\n )\r\n const selection = ref<T[]>([])\r\n const currentRow = ref<T>()\r\n\r\n const onSelectionChange = (newSelection: T[]) => {\r\n selection.value = newSelection\r\n afterSelectionChange && afterSelectionChange(newSelection)\r\n }\r\n const onCurrentRowChange = (newCurrentRow: T, oldCurrentRow: T) => {\r\n currentRow.value = newCurrentRow\r\n afterCurrentRowChange && afterCurrentRowChange(newCurrentRow, oldCurrentRow)\r\n }\r\n\r\n const clearSelection = () => {\r\n tableRef.value?.clearSelection()\r\n }\r\n const toggleRowSelection = (row: T, selected?: boolean) => {\r\n tableRef.value?.toggleRowSelection(row, selected)\r\n }\r\n const toggleAllSelection = () => {\r\n tableRef.value?.toggleAllSelection()\r\n }\r\n const getSelectionRows = () => {\r\n tableRef.value?.getSelectionRows()\r\n }\r\n const setCurrentRow = (row: T) => {\r\n tableRef.value?.setCurrentRow(row)\r\n }\r\n\r\n const loadData = async () => {\r\n const loaded = await onLoadData(pagination.value)\r\n data.value = loaded.data\r\n pagination.value.total = loaded.total\r\n }\r\n\r\n return reactive({\r\n data,\r\n pagination,\r\n selection,\r\n currentRow,\r\n onSelectionChange,\r\n onCurrentRowChange,\r\n clearSelection,\r\n toggleRowSelection,\r\n toggleAllSelection,\r\n getSelectionRows,\r\n setCurrentRow,\r\n loadData,\r\n })\r\n}\r\n\r\nexport default usePagetable\r\n"],"names":["usePagetable","options","tableRef","onLoadData","afterSelectionChange","afterCurrentRowChange","initialData","initialPagination","data","ref","pagination","selection","currentRow","reactive","newSelection","newCurrentRow","oldCurrentRow","_a","row","selected","loaded"],"mappings":";AAuBM,MAAAA,IAAe,CAAIC,MAAoC;AAC3D,QAAM,EAAE,UAAAC,GAAU,YAAAC,GAAY,sBAAAC,GAAsB,uBAAAC,GAAuB,aAAAC,GAAa,mBAAAC,EAAsB,IAAAN,GAExGO,IAAOC,EAASH,KAA4B,CAAE,CAAA,GAC9CI,IAAaD;AAAA,IACjBF,KAEI;AAAA,MACE,aAAa;AAAA,MACb,UAAU;AAAA,IACZ;AAAA,EAAA,GAEAI,IAAYF,EAAS,CAAA,CAAE,GACvBG,IAAaH;AAiCnB,SAAOI,EAAS;AAAA,IACd,MAAAL;AAAA,IACA,YAAAE;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,mBApCwB,CAACE,MAAsB;AAC/C,MAAAH,EAAU,QAAQG,GAClBV,KAAwBA,EAAqBU,CAAY;AAAA,IAAA;AAAA,IAmCzD,oBAjCyB,CAACC,GAAkBC,MAAqB;AACjE,MAAAJ,EAAW,QAAQG,GACMV,KAAAA,EAAsBU,GAAeC,CAAa;AAAA,IAAA;AAAA,IAgC3E,gBA7BqB,MAAM;;AAC3B,OAAAC,IAAAf,EAAS,UAAT,QAAAe,EAAgB;AAAA,IAAe;AAAA,IA6B/B,oBA3ByB,CAACC,GAAQC,MAAuB;;AAChD,OAAAF,IAAAf,EAAA,UAAA,QAAAe,EAAO,mBAAmBC,GAAKC;AAAA,IAAQ;AAAA,IA2BhD,oBAzByB,MAAM;;AAC/B,OAAAF,IAAAf,EAAS,UAAT,QAAAe,EAAgB;AAAA,IAAmB;AAAA,IAyBnC,kBAvBuB,MAAM;;AAC7B,OAAAA,IAAAf,EAAS,UAAT,QAAAe,EAAgB;AAAA,IAAiB;AAAA,IAuBjC,eArBoB,CAACC,MAAW;;AACvB,OAAAD,IAAAf,EAAA,UAAA,QAAAe,EAAO,cAAcC;AAAA,IAAG;AAAA,IAqBjC,UAlBe,YAAY;AAC3B,YAAME,IAAS,MAAMjB,EAAWO,EAAW,KAAK;AAChD,MAAAF,EAAK,QAAQY,EAAO,MACTV,EAAA,MAAM,QAAQU,EAAO;AAAA,IAAA;AAAA,EAehC,CACD;AACH;"}
@@ -9,7 +9,6 @@ import { default as PagetableColumnButtongroup } from './columns/PagetableColumn
9
9
  import { default as PagetableCellButton } from './columns/PagetableCellButton';
10
10
  import { default as PagetableColumngroup } from './columns/PagetableColumngroup';
11
11
  import { default as PagetableColumnDiy } from './columns/PagetableColumnDiy';
12
- export type { PagetableProps } from './Pagetable';
13
12
  declare const _default: import('../_util').SFCWithInstall<import('vue').DefineComponent<import('vue').ExtractPropTypes<{
14
13
  data: {
15
14
  type: import('vue').PropType<any[]>;
@@ -317,3 +316,5 @@ declare const _default: import('../_util').SFCWithInstall<import('vue').DefineCo
317
316
  PagetableColumnDiy: typeof PagetableColumnDiy;
318
317
  };
319
318
  export default _default;
319
+ export * from './Pagetable';
320
+ export { default as usePagetable } from './hooks/usePagetable';
@@ -10,6 +10,7 @@ import { S as Pe } from "../../index-BbsXWo7C.js";
10
10
  import F from "../../error/OrionError.js";
11
11
  import ve from "./hooks/useColumns.js";
12
12
  import H from "./hooks/useCode.js";
13
+ import { default as Ct } from "./hooks/usePagetable.js";
13
14
  function Oe(o) {
14
15
  return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !J(o);
15
16
  }
@@ -498,7 +499,7 @@ const Be = () => ({
498
499
  pageSize: e
499
500
  }), s("paginationChange", d.currentPage, e);
500
501
  },
501
- total: d.total,
502
+ total: d.total || 0,
502
503
  pagerCount: k,
503
504
  layout: `${G ? "total," : ""} ->, ${K ? "sizes," : ""} prev, pager, next ${Q ? ", jumper" : ""}`,
504
505
  background: !0,
@@ -752,6 +753,8 @@ const Ue = () => ({
752
753
  PagetableColumnDiy: We
753
754
  });
754
755
  export {
755
- ht as default
756
+ ht as default,
757
+ Be as pagetableProps,
758
+ Ct as usePagetable
756
759
  };
757
760
  //# sourceMappingURL=index.js.map