vueless 0.0.165 → 0.0.167

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.165",
3
+ "version": "0.0.167",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -1,34 +1,19 @@
1
1
  import useUI from "../../composable.ui";
2
2
  import defaultConfig from "../configs/default.config";
3
3
  import { cva, cx } from "../../service.ui";
4
- import { computed, useSlots } from "vue";
4
+ import { computed } from "vue";
5
5
 
6
6
  export function useAttrs(
7
7
  props,
8
- {
9
- tableRows,
10
- selectedRows,
11
- isNesting,
12
- isHeaderSticky,
13
- isFooterSticky,
14
- hasSlotContentTheadActions,
15
- },
8
+ { tableRows, isNesting, isShownActionsHeader, isHeaderSticky, isFooterSticky },
16
9
  ) {
17
10
  const { config, getAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
18
- const { wrapper, stickyHeaderColumn, headerCell } = config.value;
19
-
20
- const slot = useSlots();
21
-
22
- const cvaWrapper = cva({
23
- base: wrapper.base,
24
- variants: wrapper.variants,
25
- compoundVariants: wrapper.compoundVariants,
26
- });
11
+ const { stickyHeaderCell, headerCell } = config.value;
27
12
 
28
13
  const cvaCustomHeaderItem = cva({
29
- base: stickyHeaderColumn.base,
30
- variants: stickyHeaderColumn.variants,
31
- compoundVariants: stickyHeaderColumn.compoundVariants,
14
+ base: stickyHeaderCell.base,
15
+ variants: stickyHeaderCell.variants,
16
+ compoundVariants: stickyHeaderCell.compoundVariants,
32
17
  });
33
18
 
34
19
  const cvaHeaderCell = cva({
@@ -37,53 +22,60 @@ export function useAttrs(
37
22
  compoundVariants: headerCell.compoundVariants,
38
23
  });
39
24
 
40
- const wrapperClasses = computed(() => cvaWrapper({ compact: props.compact }));
41
-
42
- const stickyHeaderColumnClasses = computed(() => cvaCustomHeaderItem({ compact: props.compact }));
25
+ const stickyHeaderCellClasses = computed(() => cvaCustomHeaderItem({ compact: props.compact }));
43
26
 
44
27
  const headerCellClasses = computed(() => cvaHeaderCell({ compact: props.compact }));
45
28
 
46
- const wrapperAttrs = getAttrs("wrapper", { classes: wrapperClasses });
29
+ const wrapperAttrs = getAttrs("wrapper");
47
30
  const stickyHeaderAttrsRaw = getAttrs("stickyHeader");
48
- const stickyHeaderColumnAttrsRaw = getAttrs("stickyHeaderColumn", {
49
- classes: stickyHeaderColumnClasses,
31
+ const stickyHeaderCellAttrsRaw = getAttrs("stickyHeaderCell", {
32
+ classes: stickyHeaderCellClasses,
33
+ });
34
+ const headerCounterAttrsRaw = getAttrs("headerCounter");
35
+ const stickyHeaderCounterAttrsRaw = getAttrs("stickyHeaderCounter");
36
+ const stickyHeaderActionsCounterAttrsRaw = getAttrs("stickyHeaderActionsCounter");
37
+ const stickyHeaderCheckboxAttrs = getAttrs("stickyHeaderCheckbox", {
38
+ isComponent: true,
39
+ });
40
+ const stickyHeaderActionsCheckboxAttrs = getAttrs("stickyHeaderActionsCheckbox", {
41
+ isComponent: true,
50
42
  });
51
- const selectedRowsCountAttrs = getAttrs("selectedRowsCount");
52
- const selectAllCheckboxAttrs = getAttrs("selectAllCheckbox", { isComponent: true });
53
43
  const stickyHeaderLoaderAttrs = getAttrs("stickyHeaderLoader", { isComponent: true });
54
- const tableWrapperAttrsRaw = getAttrs("tableWrapper");
44
+ const tableWrapperAttrs = getAttrs("tableWrapper");
55
45
  const tableAttrs = getAttrs("table");
56
46
  const headerAttrs = getAttrs("header");
57
47
  const headerRowAttrsRaw = getAttrs("headerRow");
58
48
  const headerCellAttrsRaw = getAttrs("headerCell", { classes: headerCellClasses });
59
- const headerSelectAllCheckboxAttrs = getAttrs("headerSelectAllCheckbox", { isComponent: true });
60
- const tableLoaderAttrs = getAttrs("tableLoader", { isComponent: true });
61
- const expandIconAttrs = getAttrs("expandIcon", { isComponent: true });
62
- const collapseIconAttrs = getAttrs("collapseIcon", { isComponent: true });
49
+ const headerCheckboxAttrs = getAttrs("headerCheckbox", { isComponent: true });
50
+ const headerLoaderAttrs = getAttrs("headerLoader", { isComponent: true });
51
+ const bodyCellNestedExpandIconAttrs = getAttrs("bodyCellNestedExpandIcon", { isComponent: true });
52
+ const bodyCellNestedCollapseIconAttrs = getAttrs("bodyCellNestedCollapseIcon", {
53
+ isComponent: true,
54
+ });
63
55
  const bodyAttrs = getAttrs("body");
64
56
  const bodyCellAttrsRaw = getAttrs("bodyCell", { isComponent: true });
65
- const checkboxBodyWrapperCellAttrs = getAttrs("checkboxBodyWrapperCell");
66
- const tableCheckboxAttrs = getAttrs("tableCheckbox", { isComponent: true });
67
- const dateSeparatorAttrs = getAttrs("dateSeparator", { isComponent: true });
68
- const toggleItemButtonAttrs = getAttrs("toggleItemButton");
69
- const secondaryRowAttrs = getAttrs("secondaryRow");
70
- const secondaryRowEmptyAttrs = getAttrs("secondaryRowEmpty");
57
+ const bodyCheckboxAttrs = getAttrs("bodyCheckbox", { isComponent: true });
58
+ const bodyCellDateSeparatorAttrs = getAttrs("bodyCellDateSeparator");
59
+ const bodyDateSeparatorAttrs = getAttrs("bodyDateSeparator", { isComponent: true });
60
+ const bodyCellNestedAttrs = getAttrs("bodyCellNested");
61
+ const bodyCellSecondaryAttrs = getAttrs("bodyCellSecondary");
62
+ const bodyCellSecondaryEmptyAttrs = getAttrs("bodyCellSecondaryEmpty");
71
63
  const footerAttrsRaw = getAttrs("footer");
72
64
  const footerRowAttrs = getAttrs("footerRow");
73
65
  const footerCellAttrs = getAttrs("footerCell", { isComponent: true });
74
- const footerStickyRowAttrs = getAttrs("footerStickyRow");
75
- const emptyAttrs = getAttrs("empty", { isComponent: true });
76
- const beforeFirstRowAttrsRaw = getAttrs("beforeFirstRow");
77
- const beforeFirstRowCellAttrs = getAttrs("beforeFirstRowCell", { isComponent: true });
78
- const afterLastRowAttrsRaw = getAttrs("afterLastRow");
79
- const afterLastRowCellAttrs = getAttrs("afterLastRowCell", { isComponent: true });
80
- const toggleButtonWrapperAttrsRaw = getAttrs("toggleButtonWrapper");
66
+ const stickyFooterRowAttrs = getAttrs("stickyFooterRow");
67
+ const bodyEmptyStateAttrs = getAttrs("bodyEmptyState", { isComponent: true });
68
+ const bodyRowBeforeAttrsRaw = getAttrs("bodyRowBefore");
69
+ const bodyRowBeforeCellAttrs = getAttrs("bodyRowBeforeCell", { isComponent: true });
70
+ const bodyRowAfterAttrs = getAttrs("bodyRowAfter");
71
+ const bodyRowAfterCellAttrs = getAttrs("bodyRowAfterCell", { isComponent: true });
72
+ const bodyCellNestedWrapperAttrsRaw = getAttrs("bodyCellNestedWrapper");
81
73
 
82
74
  const bodyRowAttrsRaw = getAttrs("bodyRow");
83
75
 
84
- const bodyCellAttrs = computed(() => (tdClass) => ({
76
+ const bodyCellAttrs = computed(() => (classes) => ({
85
77
  ...bodyCellAttrsRaw.value,
86
- class: cx([bodyCellAttrsRaw.value.class, tdClass || ""]),
78
+ class: cx([bodyCellAttrsRaw.value.class, classes || ""]),
87
79
  }));
88
80
 
89
81
  const bodyRowAttrs = computed(() => (row) => ({
@@ -93,115 +85,131 @@ export function useAttrs(
93
85
 
94
86
  const headerCellAttrs = computed(() => (classes) => ({
95
87
  ...headerCellAttrsRaw.value,
96
- class: cx([headerCellAttrsRaw.value.class, classes]),
88
+ class: cx([config.value.headerCellGeneral, headerCellAttrsRaw.value.class, classes]),
97
89
  }));
98
90
 
99
- const beforeFirstRowAttrs = computed(() => ({
100
- ...beforeFirstRowAttrsRaw.value,
101
- class: cx([
102
- beforeFirstRowAttrsRaw.value.class,
103
- tableRows.value[0]?.isChecked ? config.value.checkedRow : "",
104
- ]),
91
+ const stickyHeaderActionsCounterAttrs = computed(() => ({
92
+ ...stickyHeaderActionsCounterAttrsRaw.value,
93
+ class: cx([config.value.headerCounterGeneral, stickyHeaderActionsCounterAttrsRaw.value.class]),
105
94
  }));
106
95
 
107
- const tableWrapperAttrs = computed(() => ({
108
- ...tableWrapperAttrsRaw.value,
109
- class: cx([
110
- tableWrapperAttrsRaw.value.class,
111
- selectedRows.value.length && config.value.tableWrapperSelected,
112
- ]),
96
+ const stickyHeaderCounterAttrs = computed(() => ({
97
+ ...stickyHeaderCounterAttrsRaw.value,
98
+ class: cx([config.value.headerCounterGeneral, stickyHeaderCounterAttrsRaw.value.class]),
113
99
  }));
114
100
 
115
- const headerRowAttrs = computed(() => ({
116
- ...headerRowAttrsRaw.value,
117
- class: cx([
118
- headerRowAttrsRaw.value.class,
119
- selectedRows.value.length && !isHeaderSticky.value && config.value.stickyHeaderHidden,
120
- ]),
101
+ const headerCounterAttrs = computed(() => ({
102
+ ...headerCounterAttrsRaw.value,
103
+ class: cx([config.value.headerCounterGeneral, headerCounterAttrsRaw.value.class]),
121
104
  }));
122
105
 
123
- const stickyHeaderAttrs = computed(() => ({
124
- ...stickyHeaderAttrsRaw.value,
106
+ const bodyRowBeforeAttrs = computed(() => ({
107
+ ...bodyRowBeforeAttrsRaw.value,
125
108
  class: cx([
126
- stickyHeaderAttrsRaw.value.class,
127
- selectedRows.value.length &&
128
- hasSlotContentTheadActions.value &&
129
- config.value.stickyHeaderActions,
130
- isHeaderSticky.value && props.stickyHeader && config.value.stickyHeaderActive,
109
+ bodyRowBeforeAttrsRaw.value.class,
110
+ tableRows.value[0]?.isChecked ? config.value.bodyRowChecked : "",
131
111
  ]),
132
112
  }));
133
113
 
114
+ const headerRowAttrs = computed(() => {
115
+ return {
116
+ ...headerRowAttrsRaw.value,
117
+ class: cx([headerRowAttrsRaw.value.class]),
118
+ };
119
+ });
120
+
121
+ const stickyHeaderAttrs = computed(() => {
122
+ const actionHeaderClasses = cx([
123
+ stickyHeaderAttrsRaw.value.class,
124
+ config.value.stickyHeaderActions,
125
+ ]);
126
+
127
+ const actionHeaderStickyClasses = cx([
128
+ config.value.stickyHeaderActions,
129
+ stickyHeaderAttrsRaw.value.class,
130
+ ]);
131
+
132
+ const stickyHeaderRowClasses = cx([
133
+ stickyHeaderAttrsRaw.value.class,
134
+ config.value.stickyHeaderRow,
135
+ ]);
136
+
137
+ return {
138
+ ...stickyHeaderAttrsRaw.value,
139
+ class: cx([
140
+ isShownActionsHeader.value && actionHeaderClasses,
141
+ isShownActionsHeader.value && isHeaderSticky.value && actionHeaderStickyClasses,
142
+ !isShownActionsHeader.value && isHeaderSticky.value && stickyHeaderRowClasses,
143
+ ]),
144
+ };
145
+ });
146
+
134
147
  const footerClassesAttrs = computed(() => ({
135
148
  ...footerAttrsRaw.value,
136
- class: cx([footerAttrsRaw.value.class, isFooterSticky.value && config.value.footerSticky]),
137
- }));
138
-
139
- const afterLastRowAttrs = computed(() => ({
140
- ...afterLastRowAttrsRaw.value,
141
- class: cx([
142
- afterLastRowAttrsRaw.value.class,
143
- hasSlotContent(slot["after-last-row"]) ? config.value.moreRowHidden : config.value.moreRow,
144
- ]),
149
+ class: cx([footerAttrsRaw.value.class, isFooterSticky.value && config.value.stickyFooter]),
145
150
  }));
146
151
 
147
- const stickyHeaderColumnAttrs = computed(() => (thClass) => ({
148
- ...stickyHeaderColumnAttrsRaw.value,
149
- class: cx([stickyHeaderColumnAttrsRaw.value.class, thClass]),
152
+ const stickyHeaderCellAttrs = computed(() => (classes) => ({
153
+ ...stickyHeaderCellAttrsRaw.value,
154
+ class: cx([config.value.headerCellGeneral, stickyHeaderCellAttrsRaw.value.class, classes]),
150
155
  }));
151
156
 
152
- const dateSeparatorRowAttrs = (rowIndex) => {
157
+ const bodyRowDateSeparatorAttrs = (rowIndex) => {
153
158
  const isCheckedRowBefore = tableRows.value[rowIndex - 1]?.isChecked;
154
159
  const isCheckedRowAfter = tableRows.value[rowIndex]?.isChecked;
155
160
 
156
161
  const activeClass =
157
162
  (isCheckedRowBefore && isCheckedRowAfter) || (rowIndex === 0 && isCheckedRowAfter)
158
- ? config.value.checkedRow
163
+ ? config.value.bodyRowChecked
159
164
  : "";
160
165
 
161
- return getAttrs("option", { classes: activeClass }).value;
166
+ return getAttrs("bodyRowDateSeparator", { classes: activeClass }).value;
162
167
  };
163
168
 
164
- const toggleButtonWrapperAttrs = computed(() => (index) => ({
165
- ...toggleButtonWrapperAttrsRaw.value,
166
- class: index === 0 && isNesting.value ? config.value.toggleButtonWrapper : "",
169
+ const bodyCellNestedWrapperAttrs = computed(() => (index) => ({
170
+ ...bodyCellNestedWrapperAttrsRaw.value,
171
+ class: index === 0 && isNesting.value ? config.value.bodyCellNestedWrapper : "",
167
172
  }));
168
173
 
169
174
  return {
170
175
  config,
171
176
  wrapperAttrs,
172
- stickyHeaderColumnAttrs,
177
+ stickyHeaderCellAttrs,
173
178
  stickyHeaderAttrs,
174
179
  tableWrapperAttrs,
175
180
  headerCellAttrs,
176
181
  headerRowAttrs,
177
182
  bodyRowAttrs,
178
183
  footerClassesAttrs,
179
- afterLastRowAttrs,
180
- afterLastRowCellAttrs,
181
- beforeFirstRowAttrs,
182
- beforeFirstRowCellAttrs,
183
- dateSeparatorRowAttrs,
184
- toggleButtonWrapperAttrs,
184
+ bodyRowAfterAttrs,
185
+ bodyRowAfterCellAttrs,
186
+ bodyRowBeforeAttrs,
187
+ bodyRowBeforeCellAttrs,
188
+ bodyRowDateSeparatorAttrs,
189
+ bodyCellNestedWrapperAttrs,
185
190
  bodyCellAttrs,
186
- checkboxBodyWrapperCellAttrs,
187
191
  footerCellAttrs,
188
- selectAllCheckboxAttrs,
189
- headerSelectAllCheckboxAttrs,
190
- tableCheckboxAttrs,
191
- collapseIconAttrs,
192
- expandIconAttrs,
193
- emptyAttrs,
194
- dateSeparatorAttrs,
195
- selectedRowsCountAttrs,
192
+ stickyHeaderCounterAttrs,
193
+ stickyHeaderActionsCounterAttrs,
194
+ headerCounterAttrs,
195
+ headerCheckboxAttrs,
196
+ bodyCheckboxAttrs,
197
+ bodyCellNestedCollapseIconAttrs,
198
+ bodyCellNestedExpandIconAttrs,
199
+ bodyEmptyStateAttrs,
200
+ bodyDateSeparatorAttrs,
201
+ bodyCellDateSeparatorAttrs,
202
+ stickyHeaderCheckboxAttrs,
203
+ stickyHeaderActionsCheckboxAttrs,
196
204
  stickyHeaderLoaderAttrs,
197
205
  tableAttrs,
198
- tableLoaderAttrs,
206
+ headerLoaderAttrs,
199
207
  bodyAttrs,
200
- toggleItemButtonAttrs,
201
- secondaryRowAttrs,
202
- secondaryRowEmptyAttrs,
208
+ bodyCellNestedAttrs,
209
+ bodyCellSecondaryAttrs,
210
+ bodyCellSecondaryEmptyAttrs,
203
211
  footerRowAttrs,
204
- footerStickyRowAttrs,
212
+ stickyFooterRowAttrs,
205
213
  hasSlotContent,
206
214
  headerAttrs,
207
215
  };
@@ -1,67 +1,60 @@
1
1
  export default /*tw*/ {
2
- wrapper: {
3
- base: "relative bg-white rounded-lg",
4
- variants: {
5
- compact: {
6
- true: "group/table-compact",
7
- },
8
- },
9
- },
10
- headerCheckboxWrapper: "",
2
+ wrapper: "relative",
3
+ headerCellGeneral: "p-4 text-sm font-normal text-gray-500 text-left",
4
+ headerCounterGeneral: "mr-3 font-medium text-sm text-gray-900",
5
+ stickyHeader: "fixed top-0 flex items-center z-30 overflow-hidden rounded-none border",
6
+ stickyHeaderRow: "border-gray-200 bg-white",
7
+ stickyHeaderCell: "flex-none whitespace-nowrap",
8
+ stickyHeaderCheckbox: "",
9
+ stickyHeaderCounter: "absolute top-4 left-11 bg-gradient-to-r from-white from-80%",
10
+ stickyHeaderLoader: "",
11
+ stickyHeaderActions: "absolute rounded-t-lg border-blue-200 bg-blue-50",
12
+ stickyHeaderActionsCheckbox: "",
13
+ stickyHeaderActionsCounter: "-ml-2",
14
+ tableWrapper: "border border-gray-200 rounded-lg bg-white",
15
+ table: "min-w-full border-none text-sm w-full",
11
16
  header: "border-b border-gray-200",
12
17
  headerRow: "",
13
- headerCell: "p-4 text-sm font-normal text-gray-500 text-left",
14
- headerSelectAllCheckbox: "",
15
- stickyHeader: "flex items-center z-30 overflow-hidden rounded-t-lg border border-gray-200 border-b-0",
16
- stickyHeaderHidden: "relative -top-[3.75rem] collapse",
17
- stickyHeaderLoader: "absolute top-[3.75rem] group-[]/table-compact:!top-[3.25rem]",
18
- stickyHeaderActive: "fixed top-0 border border-gray-200 bg-white rounded-none",
19
- stickyHeaderActions: "rounded-t-lg border border-blue-200 !bg-blue-50",
20
- stickyHeaderColumn: "flex-none text-sm font-normal text-gray-500 p-4 whitespace-nowrap",
21
- selectedRowsCount: "absolute left-11 pr-2 font-medium text-sm text-gray-900 bg-gradient-to-r from-white from-80%",
22
- selectAllCheckbox: "flex-none text-sm font-normal text-gray-500 pr-[1.125rem] pl-4 py-4 group-[]/table-compact:!px-4",
23
- tableWrapper: "!overflow-x-auto rounded-lg border border-gray-200",
24
- tableWrapperSelected: "!rounded-t-none border-t-0",
25
- table: "min-w-full border-none text-sm w-full",
26
- tableLoader: "absolute !top-auto",
27
- moreRow: "!px-0 !py-4 first:mx-auto",
28
- moreRowHidden: "!p-0",
29
- checkedRow: "transition duration-100 bg-gray-100",
30
- beforeFirstRow: "",
31
- beforeFirstRowCell: "py-1",
32
- afterLastRow: "",
33
- afterLastRowCell: "py-1",
34
- toggleButtonWrapper: "flex items-center",
35
- expandIcon: "mr-2 rounded-sm bg-gray-200",
36
- expandIconName: "add",
37
- collapseIcon: "mr-2 rounded-sm bg-gray-200",
38
- collapseIconName: "remove",
18
+ headerCell: "",
19
+ headerCellCheckbox: "w-10",
20
+ headerCheckbox: "",
21
+ headerCounter: "absolute top-4 left-11 bg-gradient-to-r from-white from-80% mt-px ml-px",
22
+ headerLoader: "absolute !top-auto",
39
23
  body: "group/body divide-none",
40
24
  bodyRow: "hover:bg-gray-50",
41
- checkboxBodyWrapperCell: "py-3 px-4 align-top",
25
+ bodyRowChecked: "bg-gray-100 transition duration-100",
26
+ bodyRowBefore: "!p-0",
27
+ bodyRowBeforeCell: "py-1",
28
+ bodyRowAfter: "!p-0",
29
+ bodyRowAfterCell: "py-1",
30
+ bodyRowDateSeparator: "",
42
31
  bodyCell: "",
43
- tableCheckbox: "",
44
- dateSeparator: "",
45
- toggleItemButton: "flex relative -top-px",
46
- secondaryRow: "mt-1 text-xs text-gray-500",
47
- secondaryRowEmpty: "inline-block",
32
+ bodyCellSecondary: "mt-1 text-xs text-gray-500",
33
+ bodyCellSecondaryEmpty: "inline-block",
34
+ bodyCellCheckbox: "first:px-4", // try to remove first
35
+ bodyCellDateSeparator: "",
36
+ bodyCellNestedWrapper: "flex items-center",
37
+ bodyCellNested: "flex relative -top-px",
38
+ bodyCellNestedExpandIcon: "mr-2 rounded-sm bg-gray-200",
39
+ bodyCellNestedExpandIconName: "add",
40
+ bodyCellNestedCollapseIcon: "mr-2 rounded-sm bg-gray-200",
41
+ bodyCellNestedCollapseIconName: "remove",
42
+ bodyCheckbox: "",
43
+ bodyDateSeparator: "",
44
+ bodyEmptyState: "my-8",
48
45
  footer: "group/footer border-t border-solid border-gray-200",
49
- footerSticky: "relative group/footer-fixed",
50
46
  footerRow: "",
51
47
  footerCell: "",
52
- footerStickyRow: `
48
+ stickyFooter: "relative group/footer-fixed",
49
+ stickyFooterRow: `
53
50
  fixed bottom-0 -ml-px border border-b border-gray-200 bg-white
54
51
  collapse group-[]/footer-fixed:[visibility:inherit]
55
52
  `,
56
- empty: "my-8",
57
53
  i18n: {
58
- noItems: "There is no data in the table yet.",
59
- noResultsForFilters: "No results were found for the specified filters.",
60
- today: "today",
61
- tomorrow: "tomorrow",
54
+ noData: "There is no data in the table.",
62
55
  },
63
56
  defaultVariants: {
64
- nesting: null,
57
+ nesting: false,
65
58
  compact: false,
66
59
  selectable: false,
67
60
  stickyHeader: false,
@@ -7,6 +7,7 @@ import UButton from "../ui.button";
7
7
  import ULink from "../ui.button-link";
8
8
  import UMoney from "../ui.text-money";
9
9
  import UBadge from "../ui.text-badge";
10
+ import URow from "../ui.container-row";
10
11
 
11
12
  const STICKY_PARAMETERS = {
12
13
  docs: {
@@ -46,20 +47,20 @@ export default {
46
47
  id: 1,
47
48
  isChecked: false,
48
49
  key_1: {
49
- primaryRow: "primaryRow",
50
- secondaryRow: "secondaryRow",
50
+ primary: "primary",
51
+ secondary: "secondary",
51
52
  },
52
53
  key_2: {
53
- primaryRow: "primaryRow",
54
- secondaryRow: "secondaryRow",
54
+ primary: "primary",
55
+ secondary: "secondary",
55
56
  },
56
57
  key_3: {
57
- primaryRow: "primaryRow",
58
- secondaryRow: "secondaryRow",
58
+ primary: "primary",
59
+ secondary: "secondary",
59
60
  },
60
61
  key_4: {
61
- primaryRow: "primaryRow",
62
- secondaryRow: "secondaryRow",
62
+ primary: "primary",
63
+ secondary: "secondary",
63
64
  },
64
65
  },
65
66
  numberOfRows: 5,
@@ -109,7 +110,7 @@ const EmptyTemplate = (args) => ({
109
110
  });
110
111
 
111
112
  const SlotTemplate = (args) => ({
112
- components: { UTable, UButton, UTableCell, ULink, UMoney, UBadge },
113
+ components: { UTable, UButton, UTableCell, ULink, UMoney, UBadge, URow },
113
114
  setup() {
114
115
  return { args };
115
116
  },
@@ -123,9 +124,14 @@ const SlotTemplate = (args) => ({
123
124
  `,
124
125
  computed: {
125
126
  itemsData() {
126
- const rows = [];
127
+ let rows = [];
127
128
 
128
- for (let i = 0; i < args.numberOfRows; i++) rows.push(args.row);
129
+ for (let i = 0; i < args.numberOfRows; i++) {
130
+ const newRow = { ...args.row };
131
+
132
+ newRow.id = getRandomId();
133
+ rows.push(newRow);
134
+ }
129
135
 
130
136
  return rows;
131
137
  },
@@ -159,7 +165,7 @@ stickyFooter.args = {
159
165
  selectable: true,
160
166
  stickyFooter: true,
161
167
  slotTemplate: `
162
- <template #tfoot>
168
+ <template #footer>
163
169
  <UTableCell>
164
170
  <p>
165
171
  🤘🤘🤘
@@ -197,33 +203,32 @@ slotDefault.args = {
197
203
 
198
204
  export const slotTheadActions = SlotTemplate.bind({});
199
205
  slotTheadActions.args = {
206
+ numberOfRows: 50,
207
+ stickyHeader: true,
200
208
  selectable: true,
201
209
  slotTemplate: `
202
- <template #thead-actions>
203
- <p>
204
- 🤘🤘🤘
205
- Lorem ipsum dolor sit amet.
206
- </p>
207
-
208
- <UButton
209
- size="sm"
210
- variant="thirdary"
211
- filled
212
- label="some button"
213
- />
214
-
215
- <UButton
216
- size="sm"
217
- variant="thirdary"
218
- filled
219
- label="some button"
220
- />
210
+ <template #header-actions>
211
+ <URow gap="2xs">
212
+ <UButton
213
+ label="Edit"
214
+ variant="thirdary"
215
+ color="blue"
216
+ size="sm"
217
+ />
218
+
219
+ <UButton
220
+ label="Delete"
221
+ variant="thirdary"
222
+ color="blue"
223
+ size="sm"
224
+ />
225
+ </URow>
221
226
  </template>
222
227
  `,
223
228
  };
224
229
 
225
- export const slotBeforeFirstRow = SlotTemplate.bind({});
226
- slotBeforeFirstRow.args = {
230
+ export const slotbodyRowBefore = SlotTemplate.bind({});
231
+ slotbodyRowBefore.args = {
227
232
  slotTemplate: `
228
233
  <template #before-first-row>
229
234
  <p>
@@ -236,8 +241,8 @@ slotBeforeFirstRow.args = {
236
241
  `,
237
242
  };
238
243
 
239
- export const slotAfterLastRow = SlotTemplate.bind({});
240
- slotAfterLastRow.args = {
244
+ export const slotbodyRowAfter = SlotTemplate.bind({});
245
+ slotbodyRowAfter.args = {
241
246
  slotTemplate: `
242
247
  <template #after-last-row>
243
248
  <p>