@soft-stech/bootsman-ui-shadcn 1.1.1 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -2045,7 +2045,9 @@ const Tt = /* @__PURE__ */ Ce({
2045
2045
  columns: {},
2046
2046
  data: {},
2047
2047
  pageSize: { default: 10 },
2048
- showPagination: { type: Boolean, default: !0 }
2048
+ showPagination: { type: Boolean, default: !0 },
2049
+ totalItems: { default: 0 },
2050
+ getRowId: {}
2049
2051
  }, {
2050
2052
  sorting: {},
2051
2053
  sortingModifiers: {},
@@ -2088,7 +2090,8 @@ const Tt = /* @__PURE__ */ Ce({
2088
2090
  get rowSelection() {
2089
2091
  return r.value;
2090
2092
  }
2091
- }
2093
+ },
2094
+ getRowId: n.getRowId
2092
2095
  });
2093
2096
  return (l, u) => (h(), M(_(Oe), null, {
2094
2097
  default: V(() => [
@@ -2164,7 +2167,7 @@ const Tt = /* @__PURE__ */ Ce({
2164
2167
  default: V(() => [
2165
2168
  I(_(Te), {
2166
2169
  class: "float-right",
2167
- total: _(i).getFilteredRowModel().rows.length,
2170
+ total: l.totalItems,
2168
2171
  pageIndex: _(i).getState().pagination.pageIndex,
2169
2172
  pageSize: _(i).getState().pagination.pageSize,
2170
2173
  setPageIndex: (s) => _(i).setPageIndex(s),
@@ -1,4 +1,4 @@
1
- import { _ as f } from "../../../BuiDataTable.vue_vue_type_script_setup_true_lang-7Tst_H0P.js";
1
+ import { _ as f } from "../../../BuiDataTable.vue_vue_type_script_setup_true_lang-75kSylTF.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,9 +1,11 @@
1
- import type { ColumnDef, SortingState, PaginationState, RowSelectionState } from '@tanstack/vue-table';
1
+ import type { ColumnDef, SortingState, PaginationState, RowSelectionState, Row } from '@tanstack/vue-table';
2
2
  declare const _default: <TData, TValue>(__VLS_props: {
3
3
  data: TData[];
4
4
  columns: ColumnDef<TData, TValue>[];
5
5
  pageSize?: number | undefined;
6
6
  showPagination?: boolean | undefined;
7
+ totalItems?: number | undefined;
8
+ getRowId?: ((originalRow: TData, index: number, parent?: Row<TData> | undefined) => string) | undefined;
7
9
  sorting?: SortingState | undefined;
8
10
  pagination?: PaginationState | undefined;
9
11
  selection?: RowSelectionState | undefined;
@@ -21,6 +23,8 @@ declare const _default: <TData, TValue>(__VLS_props: {
21
23
  columns: ColumnDef<TData, TValue>[];
22
24
  pageSize?: number | undefined;
23
25
  showPagination?: boolean | undefined;
26
+ totalItems?: number | undefined;
27
+ getRowId?: ((originalRow: TData, index: number, parent?: Row<TData> | undefined) => string) | undefined;
24
28
  sorting?: SortingState | undefined;
25
29
  pagination?: PaginationState | undefined;
26
30
  selection?: RowSelectionState | undefined;
@@ -42,6 +46,8 @@ declare const _default: <TData, TValue>(__VLS_props: {
42
46
  columns: ColumnDef<TData, TValue>[];
43
47
  pageSize?: number | undefined;
44
48
  showPagination?: boolean | undefined;
49
+ totalItems?: number | undefined;
50
+ getRowId?: ((originalRow: TData, index: number, parent?: Row<TData> | undefined) => string) | undefined;
45
51
  sorting?: SortingState | undefined;
46
52
  pagination?: PaginationState | undefined;
47
53
  selection?: RowSelectionState | undefined;
@@ -7,7 +7,7 @@ import { _ as s } from "../../../BuiTableRow.vue_vue_type_script_setup_true_lang
7
7
  import { _ as x } from "../../../BuiTableCaption.vue_vue_type_script_setup_true_lang-OnsFZa8H.js";
8
8
  import { _ } from "../../../BuiTableEmpty.vue_vue_type_script_setup_true_lang-4QJziEvg.js";
9
9
  import { _ as y } from "../../../BuiTableFooter.vue_vue_type_script_setup_true_lang-DN__NJQ9.js";
10
- import { _ as H } from "../../../BuiDataTable.vue_vue_type_script_setup_true_lang-7Tst_H0P.js";
10
+ import { _ as H } from "../../../BuiDataTable.vue_vue_type_script_setup_true_lang-75kSylTF.js";
11
11
  export {
12
12
  H as BuiDataTable,
13
13
  o as BuiTable,
package/dist/index.js CHANGED
@@ -114,7 +114,7 @@ import { _ as wt } from "./BuiTableRow.vue_vue_type_script_setup_true_lang-rLz2b
114
114
  import { _ as It } from "./BuiTableCaption.vue_vue_type_script_setup_true_lang-OnsFZa8H.js";
115
115
  import { _ as Ft } from "./BuiTableEmpty.vue_vue_type_script_setup_true_lang-4QJziEvg.js";
116
116
  import { _ as Lt } from "./BuiTableFooter.vue_vue_type_script_setup_true_lang-DN__NJQ9.js";
117
- import { _ as Ht } from "./BuiDataTable.vue_vue_type_script_setup_true_lang-7Tst_H0P.js";
117
+ import { _ as Ht } from "./BuiDataTable.vue_vue_type_script_setup_true_lang-75kSylTF.js";
118
118
  import { BuiTabsList as ht, BuiTabsTrigger as kt, tabsListVariants as yt, tabsTriggerVariants as Et } from "./components/ui/tabs/index.js";
119
119
  import { BuiTextarea as Jt, textareaVariants as Nt } from "./components/ui/textarea/index.js";
120
120
  import { BuiToast as Wt, BuiToaster as jt, toastVariants as zt } from "./components/ui/toast/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soft-stech/bootsman-ui-shadcn",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -11,6 +11,23 @@
11
11
  "sideEffects": [
12
12
  "**/*.css"
13
13
  ],
14
+ "scripts": {
15
+ "build": "run-p type-check \"build-only {@}\" --",
16
+ "preview": "vite preview",
17
+ "test:unit": "vitest",
18
+ "test:e2e": "playwright test",
19
+ "build-only": "vite build",
20
+ "type-check": "vue-tsc --build --force",
21
+ "type-build": "vue-tsc --declaration --emitDeclarationOnly",
22
+ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
23
+ "format": "prettier --write src/",
24
+ "bumpp": "bumpp package.json",
25
+ "prepublishOnly": "npm run build",
26
+ "story:dev": "histoire dev",
27
+ "story:build": "DOCS=true histoire build",
28
+ "story:preview": "histoire preview",
29
+ "coverage": "vitest run --coverage"
30
+ },
14
31
  "dependencies": {
15
32
  "@tanstack/vue-table": "^8.11.6",
16
33
  "@vee-validate/zod": "^4.12.4",
@@ -56,21 +73,5 @@
56
73
  "vite-plugin-dts": "^3.7.2",
57
74
  "vitest": "^1.0.4",
58
75
  "vue-tsc": "^1.8.27"
59
- },
60
- "scripts": {
61
- "build": "run-p type-check \"build-only {@}\" --",
62
- "preview": "vite preview",
63
- "test:unit": "vitest",
64
- "test:e2e": "playwright test",
65
- "build-only": "vite build",
66
- "type-check": "vue-tsc --build --force",
67
- "type-build": "vue-tsc --declaration --emitDeclarationOnly",
68
- "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
69
- "format": "prettier --write src/",
70
- "bumpp": "bumpp package.json",
71
- "story:dev": "histoire dev",
72
- "story:build": "DOCS=true histoire build",
73
- "story:preview": "histoire preview",
74
- "coverage": "vitest run --coverage"
75
76
  }
76
- }
77
+ }
@@ -61,9 +61,10 @@ const data = ref<Task[]>(tasks)
61
61
 
62
62
  const sorting = ref<SortingState>([{ id: 'status', desc: false }])
63
63
  const pagination = ref<PaginationState>({
64
- pageIndex: 1,
64
+ pageIndex: 0,
65
65
  pageSize: 10
66
66
  })
67
+ const totalItems = tasks.length
67
68
 
68
69
  const selection = ref<RowSelectionState>({})
69
70
  function updateSelection(val: RowSelectionState) {
@@ -81,7 +82,9 @@ function updateSelection(val: RowSelectionState) {
81
82
  v-model:sorting="sorting"
82
83
  v-model:pagination="pagination"
83
84
  @update:selection="updateSelection"
85
+ :total-items="totalItems"
84
86
  class="caption-top"
87
+ :getRowId="(row) => row.id"
85
88
  >
86
89
  <template #caption="{ table }">
87
90
  <div class="flex justify-between">
@@ -3,7 +3,8 @@ import type {
3
3
  ColumnDef,
4
4
  SortingState,
5
5
  PaginationState,
6
- RowSelectionState
6
+ RowSelectionState,
7
+ Row
7
8
  } from '@tanstack/vue-table'
8
9
  import {
9
10
  FlexRender,
@@ -32,8 +33,10 @@ const props = withDefaults(
32
33
  data: TData[]
33
34
  pageSize?: number
34
35
  showPagination?: boolean
36
+ totalItems?: number
37
+ getRowId?: (originalRow: TData, index: number, parent?: Row<TData>) => string
35
38
  }>(),
36
- { pageSize: 10, showPagination: true }
39
+ { pageSize: 10, showPagination: true, totalItems: 0 }
37
40
  )
38
41
 
39
42
  const sorting = defineModel<SortingState>('sorting')
@@ -72,7 +75,8 @@ const table = useVueTable({
72
75
  get rowSelection() {
73
76
  return rowSelection.value
74
77
  }
75
- }
78
+ },
79
+ getRowId: props.getRowId
76
80
  })
77
81
  </script>
78
82
 
@@ -111,7 +115,7 @@ const table = useVueTable({
111
115
  <BuiTableCell :colspan="columns.length">
112
116
  <BuiPaginationCommon
113
117
  class="float-right"
114
- :total="table.getFilteredRowModel().rows.length"
118
+ :total="totalItems"
115
119
  :pageIndex="table.getState().pagination.pageIndex"
116
120
  :pageSize="table.getState().pagination.pageSize as PageSize"
117
121
  :setPageIndex="(v: number) => table.setPageIndex(v)"