vueless 0.0.160 → 0.0.162
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/composable.ui/index.js
CHANGED
|
@@ -58,8 +58,8 @@ export default function useUI(defaultConfig = {}, propsConfigGetter = null, topL
|
|
|
58
58
|
|
|
59
59
|
const commonAttrs = {
|
|
60
60
|
...attrs,
|
|
61
|
-
component: isDev
|
|
62
|
-
"config-key": isDev
|
|
61
|
+
component: isDev ? attrs.component || componentName || null : null,
|
|
62
|
+
"config-key": isDev ? attrs["config-key"] || configKey || null : null,
|
|
63
63
|
"child-component": isDev && attrs.component ? componentName : null,
|
|
64
64
|
"child-config-key": isDev && attrs.component ? configKey : null,
|
|
65
65
|
};
|
package/package.json
CHANGED
package/preset.tailwind/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import forms from "@tailwindcss/forms";
|
|
2
2
|
import { BRAND_COLORS, GRAY_COLORS, GRAYSCALE_COLOR } from "./constants/index.js";
|
|
3
3
|
|
|
4
|
+
const safelist = getSafelist();
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* Generates preset for TailwindCSS base on Vueless config.
|
|
6
8
|
* @returns {Object}
|
|
7
9
|
*/
|
|
8
10
|
export function vuelessPreset() {
|
|
9
|
-
const isProd = process.env.NODE_ENV === "production";
|
|
10
11
|
const brandColor = twColorWithOpacity("--color-brand");
|
|
11
12
|
const { brand, gray } = getVuelessConfigColors();
|
|
12
13
|
const colors = getTailwindConfigColors();
|
|
@@ -22,14 +23,6 @@ export function vuelessPreset() {
|
|
|
22
23
|
brandPalette = grayPalette;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
const prodSafelist = getSafelist();
|
|
26
|
-
const devSafelist = [
|
|
27
|
-
{
|
|
28
|
-
pattern: /^!?(border|bg|text|ring)-(.*)-((50|[1-9]00|950)?)$/,
|
|
29
|
-
variants: ["hover", "focus", "focus-within", "active", "disabled"],
|
|
30
|
-
},
|
|
31
|
-
];
|
|
32
|
-
|
|
33
26
|
return {
|
|
34
27
|
content: [
|
|
35
28
|
"./index.html",
|
|
@@ -37,7 +30,7 @@ export function vuelessPreset() {
|
|
|
37
30
|
"./vueless.config.{js,ts}",
|
|
38
31
|
"./node_modules/vueless/**/*.{js,ts,vue}",
|
|
39
32
|
],
|
|
40
|
-
safelist
|
|
33
|
+
safelist,
|
|
41
34
|
theme: {
|
|
42
35
|
extend: {
|
|
43
36
|
colors: {
|
|
@@ -39,20 +39,22 @@ export function useAttrs(
|
|
|
39
39
|
|
|
40
40
|
const wrapperClasses = computed(() => cvaWrapper({ compact: props.compact }));
|
|
41
41
|
|
|
42
|
-
const
|
|
42
|
+
const stickyHeaderColumnClasses = computed(() => cvaCustomHeaderItem({ compact: props.compact }));
|
|
43
43
|
|
|
44
44
|
const headerCellClasses = computed(() => cvaHeaderCell({ compact: props.compact }));
|
|
45
45
|
|
|
46
46
|
const wrapperAttrs = getAttrs("wrapper", { classes: wrapperClasses });
|
|
47
|
-
const
|
|
48
|
-
|
|
47
|
+
const stickyHeaderAttrsRaw = getAttrs("stickyHeader");
|
|
48
|
+
const stickyHeaderColumnAttrsRaw = getAttrs("stickyHeaderColumn", {
|
|
49
|
+
classes: stickyHeaderColumnClasses,
|
|
49
50
|
});
|
|
50
51
|
const selectedRowsCountAttrs = getAttrs("selectedRowsCount");
|
|
51
52
|
const selectAllCheckboxAttrs = getAttrs("selectAllCheckbox", { isComponent: true });
|
|
52
53
|
const stickyHeaderLoaderAttrs = getAttrs("stickyHeaderLoader", { isComponent: true });
|
|
54
|
+
const tableWrapperAttrsRaw = getAttrs("tableWrapper");
|
|
53
55
|
const tableAttrs = getAttrs("table");
|
|
54
56
|
const headerAttrs = getAttrs("header");
|
|
55
|
-
const
|
|
57
|
+
const headerRowAttrsRaw = getAttrs("headerRow");
|
|
56
58
|
const headerCellAttrsRaw = getAttrs("headerCell", { classes: headerCellClasses });
|
|
57
59
|
const headerSelectAllCheckboxAttrs = getAttrs("headerSelectAllCheckbox", { isComponent: true });
|
|
58
60
|
const tableLoaderAttrs = getAttrs("tableLoader", { isComponent: true });
|
|
@@ -66,6 +68,7 @@ export function useAttrs(
|
|
|
66
68
|
const toggleItemButtonAttrs = getAttrs("toggleItemButton");
|
|
67
69
|
const secondaryRowAttrs = getAttrs("secondaryRow");
|
|
68
70
|
const secondaryRowEmptyAttrs = getAttrs("secondaryRowEmpty");
|
|
71
|
+
const footerAttrsRaw = getAttrs("footer");
|
|
69
72
|
const footerRowAttrs = getAttrs("footerRow");
|
|
70
73
|
const footerCellAttrs = getAttrs("footerCell", { isComponent: true });
|
|
71
74
|
const footerStickyRowAttrs = getAttrs("footerStickyRow");
|
|
@@ -74,6 +77,7 @@ export function useAttrs(
|
|
|
74
77
|
const beforeFirstRowCellAttrs = getAttrs("beforeFirstRowCell", { isComponent: true });
|
|
75
78
|
const afterLastRowAttrsRaw = getAttrs("afterLastRow");
|
|
76
79
|
const afterLastRowCellAttrs = getAttrs("afterLastRowCell", { isComponent: true });
|
|
80
|
+
const toggleButtonWrapperAttrsRaw = getAttrs("toggleButtonWrapper");
|
|
77
81
|
|
|
78
82
|
const bodyRowAttrsRaw = getAttrs("bodyRow");
|
|
79
83
|
|
|
@@ -101,35 +105,35 @@ export function useAttrs(
|
|
|
101
105
|
}));
|
|
102
106
|
|
|
103
107
|
const tableWrapperAttrs = computed(() => ({
|
|
108
|
+
...tableWrapperAttrsRaw.value,
|
|
104
109
|
class: cx([
|
|
105
|
-
|
|
106
|
-
selectedRows.value.length && config.value.
|
|
110
|
+
tableWrapperAttrsRaw.value.class,
|
|
111
|
+
selectedRows.value.length && config.value.tableWrapperSelected,
|
|
107
112
|
]),
|
|
108
113
|
}));
|
|
109
114
|
|
|
110
|
-
const
|
|
115
|
+
const headerRowAttrs = computed(() => ({
|
|
116
|
+
...headerRowAttrsRaw.value,
|
|
111
117
|
class: cx([
|
|
112
|
-
|
|
118
|
+
headerRowAttrsRaw.value.class,
|
|
113
119
|
selectedRows.value.length && !isHeaderSticky.value && config.value.stickyHeaderHidden,
|
|
114
120
|
]),
|
|
115
121
|
}));
|
|
116
122
|
|
|
117
|
-
const stickyHeaderAttrs = computed(() => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
]),
|
|
128
|
-
};
|
|
129
|
-
});
|
|
123
|
+
const stickyHeaderAttrs = computed(() => ({
|
|
124
|
+
...stickyHeaderAttrsRaw.value,
|
|
125
|
+
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,
|
|
131
|
+
]),
|
|
132
|
+
}));
|
|
130
133
|
|
|
131
134
|
const footerClassesAttrs = computed(() => ({
|
|
132
|
-
|
|
135
|
+
...footerAttrsRaw.value,
|
|
136
|
+
class: cx([footerAttrsRaw.value.class, isFooterSticky.value && config.value.footerSticky]),
|
|
133
137
|
}));
|
|
134
138
|
|
|
135
139
|
const afterLastRowAttrs = computed(() => ({
|
|
@@ -141,8 +145,8 @@ export function useAttrs(
|
|
|
141
145
|
}));
|
|
142
146
|
|
|
143
147
|
const stickyHeaderColumnAttrs = computed(() => (thClass) => ({
|
|
144
|
-
...
|
|
145
|
-
class: cx([
|
|
148
|
+
...stickyHeaderColumnAttrsRaw.value,
|
|
149
|
+
class: cx([stickyHeaderColumnAttrsRaw.value.class, thClass]),
|
|
146
150
|
}));
|
|
147
151
|
|
|
148
152
|
const dateSeparatorRowAttrs = (rowIndex) => {
|
|
@@ -158,6 +162,7 @@ export function useAttrs(
|
|
|
158
162
|
};
|
|
159
163
|
|
|
160
164
|
const toggleButtonWrapperAttrs = computed(() => (index) => ({
|
|
165
|
+
...toggleButtonWrapperAttrsRaw.value,
|
|
161
166
|
class: index === 0 && isNesting.value ? config.value.toggleButtonWrapper : "",
|
|
162
167
|
}));
|
|
163
168
|
|
|
@@ -167,7 +172,8 @@ export function useAttrs(
|
|
|
167
172
|
stickyHeaderColumnAttrs,
|
|
168
173
|
stickyHeaderAttrs,
|
|
169
174
|
tableWrapperAttrs,
|
|
170
|
-
|
|
175
|
+
headerCellAttrs,
|
|
176
|
+
headerRowAttrs,
|
|
171
177
|
bodyRowAttrs,
|
|
172
178
|
footerClassesAttrs,
|
|
173
179
|
afterLastRowAttrs,
|
|
@@ -176,7 +182,6 @@ export function useAttrs(
|
|
|
176
182
|
beforeFirstRowCellAttrs,
|
|
177
183
|
dateSeparatorRowAttrs,
|
|
178
184
|
toggleButtonWrapperAttrs,
|
|
179
|
-
headerCellAttrs,
|
|
180
185
|
bodyCellAttrs,
|
|
181
186
|
checkboxBodyWrapperCellAttrs,
|
|
182
187
|
footerCellAttrs,
|
|
@@ -190,7 +195,6 @@ export function useAttrs(
|
|
|
190
195
|
selectedRowsCountAttrs,
|
|
191
196
|
stickyHeaderLoaderAttrs,
|
|
192
197
|
tableAttrs,
|
|
193
|
-
headerRowAttrs,
|
|
194
198
|
tableLoaderAttrs,
|
|
195
199
|
bodyAttrs,
|
|
196
200
|
toggleItemButtonAttrs,
|
|
@@ -20,8 +20,8 @@ export default /*tw*/ {
|
|
|
20
20
|
stickyHeaderColumn: "flex-none text-sm font-normal text-gray-500 p-4 whitespace-nowrap",
|
|
21
21
|
selectedRowsCount: "absolute left-11 pr-2 font-medium text-sm text-gray-900 bg-gradient-to-r from-white from-80%",
|
|
22
22
|
selectAllCheckbox: "flex-none text-sm font-normal text-gray-500 pr-[1.125rem] pl-4 py-4 group-[]/table-compact:!px-4",
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
tableWrapper: "!overflow-x-auto rounded-lg border border-gray-200",
|
|
24
|
+
tableWrapperSelected: "!rounded-t-none border-t-0",
|
|
25
25
|
table: "min-w-full border-none text-sm w-full",
|
|
26
26
|
tableLoader: "absolute !top-auto",
|
|
27
27
|
moreRow: "!px-0 !py-4 first:mx-auto",
|
package/ui.data-table/index.vue
CHANGED
|
@@ -492,7 +492,7 @@ const {
|
|
|
492
492
|
stickyHeaderColumnAttrs,
|
|
493
493
|
stickyHeaderAttrs,
|
|
494
494
|
tableWrapperAttrs,
|
|
495
|
-
|
|
495
|
+
headerRowAttrs,
|
|
496
496
|
afterLastRowAttrs,
|
|
497
497
|
afterLastRowCellAttrs,
|
|
498
498
|
beforeFirstRowAttrs,
|
|
@@ -515,7 +515,6 @@ const {
|
|
|
515
515
|
selectedRowsCountAttrs,
|
|
516
516
|
stickyHeaderLoaderAttrs,
|
|
517
517
|
tableAttrs,
|
|
518
|
-
headerRowAttrs,
|
|
519
518
|
tableLoaderAttrs,
|
|
520
519
|
bodyAttrs,
|
|
521
520
|
toggleItemButtonAttrs,
|