@pequity/squirrel 1.0.21 → 1.0.23
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/dist/cjs/chunks/p-table-loader.js +13 -4
- package/dist/cjs/index.js +49 -16
- package/dist/cjs/inputClassesMixin.js +5 -1
- package/dist/cjs/p-chips.js +3 -3
- package/dist/cjs/p-drawer.js +24 -3
- package/dist/cjs/p-input-search.js +2 -1
- package/dist/cjs/p-input.js +4 -0
- package/dist/cjs/p-table-header-cell.js +21 -8
- package/dist/cjs/p-table-td.js +6 -6
- package/dist/cjs/p-toggle.js +2 -2
- package/dist/cjs/useInputClasses.js +4 -3
- package/dist/es/chunks/p-table-loader.js +14 -5
- package/dist/es/index.js +49 -16
- package/dist/es/inputClassesMixin.js +5 -1
- package/dist/es/p-chips.js +3 -3
- package/dist/es/p-drawer.js +25 -4
- package/dist/es/p-input-search.js +2 -1
- package/dist/es/p-input.js +4 -0
- package/dist/es/p-table-header-cell.js +22 -9
- package/dist/es/p-table-td.js +6 -6
- package/dist/es/p-toggle.js +2 -2
- package/dist/es/useInputClasses.js +4 -3
- package/dist/squirrel/components/p-date-picker/p-date-picker.vue.d.ts +9 -0
- package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +12 -0
- package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +9 -0
- package/dist/squirrel/components/p-input/p-input.vue.d.ts +18 -0
- package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +9 -0
- package/dist/squirrel/components/p-table/p-table.vue.d.ts +5 -1
- package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +17 -1
- package/dist/squirrel/components/p-table-loader/p-table-loader.vue.d.ts +9 -0
- package/dist/squirrel/components/p-textarea/p-textarea.vue.d.ts +9 -0
- package/dist/squirrel/components/p-toggle/p-toggle.vue.d.ts +9 -0
- package/dist/squirrel/composables/useInputClasses.d.ts +1 -0
- package/dist/squirrel/utils/inputClassesMixin.d.ts +9 -0
- package/dist/style.css +56 -54
- package/package.json +18 -18
- package/squirrel/components/p-chips/p-chips.vue +1 -1
- package/squirrel/components/p-drawer/p-drawer.vue +22 -9
- package/squirrel/components/p-input/p-input.stories.js +1 -0
- package/squirrel/components/p-input/p-input.vue +4 -0
- package/squirrel/components/p-input-search/p-input-search.vue +1 -0
- package/squirrel/components/p-table/p-table.spec.js +0 -23
- package/squirrel/components/p-table/p-table.vue +48 -13
- package/squirrel/components/p-table-header-cell/p-table-header-cell.spec.js +2 -3
- package/squirrel/components/p-table-header-cell/p-table-header-cell.vue +20 -7
- package/squirrel/components/p-table-loader/p-table-loader.vue +6 -1
- package/squirrel/components/p-table-td/p-table-td.spec.js +13 -13
- package/squirrel/components/p-table-td/p-table-td.vue +4 -4
- package/squirrel/components/p-toggle/p-toggle.vue +1 -1
- package/squirrel/composables/useInputClasses.ts +4 -2
- package/squirrel/utils/inputClassesMixin.ts +5 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
ref="scrollWrapper"
|
|
4
|
-
:class="['block border border-p-gray-30', lockScroll ? 'overflow-hidden' : 'overflow-x-auto']"
|
|
4
|
+
:class="['block rounded-xl border border-p-gray-30', lockScroll ? 'overflow-hidden' : 'overflow-x-auto']"
|
|
5
5
|
>
|
|
6
6
|
<div
|
|
7
7
|
v-if="isColResizing"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
:style="col.style"
|
|
33
33
|
class="bg-surface"
|
|
34
34
|
>
|
|
35
|
-
<div :class="thDivClasses(i
|
|
35
|
+
<div :class="thDivClasses(i)" :style="bgColorStyle(col)">
|
|
36
36
|
<div class="flex">
|
|
37
37
|
<slot :name="`prepend-header-cell-${kebabCase(col.name)}`" :col="col" />
|
|
38
38
|
<PTableHeaderCell
|
|
@@ -41,22 +41,22 @@
|
|
|
41
41
|
:show-filter-icon="col.filterable || col.sortable"
|
|
42
42
|
:tooltip-text="col.tooltip"
|
|
43
43
|
:class="[{ 'pl-2': i === 1 && isFirstColFixed, 'pr-2': i === cols.length && isLastColFixed }, 'grow']"
|
|
44
|
+
:text-color="headerCellTextColor(col)"
|
|
44
45
|
v-bind="col.headerCellAttrs"
|
|
45
46
|
@click-filter-icon="$emit('click-filter-icon', $event, col)"
|
|
46
47
|
/>
|
|
47
48
|
</div>
|
|
48
49
|
<div
|
|
49
50
|
v-if="colsResizable && i !== 0 && !(i === cols.length - 1 && isLastColFixed)"
|
|
50
|
-
class="absolute bottom-
|
|
51
|
-
:class="i === cols.length - 1 ? ' after:right-0' : ' after:right-
|
|
51
|
+
class="absolute bottom-2 right-0 z-110 h-5 w-2 cursor-col-resize after:absolute after:bottom-0 after:z-110 after:block after:h-full after:w-2 after:cursor-col-resize after:border-r-2 after:border-dashed after:border-p-gray-30"
|
|
52
|
+
:class="i === cols.length - 1 ? ' after:right-0.5' : ' after:right-0'"
|
|
52
53
|
data-resize-handle
|
|
53
54
|
@mousedown="colResizeStart($event, i)"
|
|
54
55
|
@dblclick="colResizeFitToData(i)"
|
|
55
56
|
></div>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
></div>
|
|
57
|
+
</div>
|
|
58
|
+
<div v-if="subheader" :class="thSubheaderClasses(i)">
|
|
59
|
+
<slot :name="`subheader-cell-${kebabCase(col.name)}`"></slot>
|
|
60
60
|
</div>
|
|
61
61
|
</th>
|
|
62
62
|
<th
|
|
@@ -97,6 +97,7 @@ type Props = {
|
|
|
97
97
|
isFirstColFixed?: boolean;
|
|
98
98
|
isLastColFixed?: boolean;
|
|
99
99
|
lockScroll?: boolean;
|
|
100
|
+
subheader?: boolean;
|
|
100
101
|
virtualizer?: {
|
|
101
102
|
paddingTop: number;
|
|
102
103
|
paddingBottom: number;
|
|
@@ -118,6 +119,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
118
119
|
isFirstColFixed: false,
|
|
119
120
|
isLastColFixed: false,
|
|
120
121
|
lockScroll: false,
|
|
122
|
+
subheader: false,
|
|
121
123
|
virtualizer: () => ({
|
|
122
124
|
paddingTop: 0,
|
|
123
125
|
paddingBottom: 0,
|
|
@@ -169,12 +171,10 @@ const emitScroll = (e: Event) => {
|
|
|
169
171
|
emit('scroll', e);
|
|
170
172
|
};
|
|
171
173
|
|
|
172
|
-
const thDivClasses = (i: number
|
|
174
|
+
const thDivClasses = (i: number) => {
|
|
173
175
|
const res = ['relative', 'py-2'];
|
|
174
176
|
|
|
175
|
-
|
|
176
|
-
res.push('border-b border-p-gray-30');
|
|
177
|
-
}
|
|
177
|
+
res.push('border-b border-p-gray-30');
|
|
178
178
|
|
|
179
179
|
if ((i === 0 && props.isFirstColFixed) || (i === props.cols.length - 1 && props.isLastColFixed)) {
|
|
180
180
|
res.push('th-shadow px-4');
|
|
@@ -185,6 +185,41 @@ const thDivClasses = (i: number, col: TableCol) => {
|
|
|
185
185
|
return res;
|
|
186
186
|
};
|
|
187
187
|
|
|
188
|
+
const thSubheaderClasses = (i: number) => {
|
|
189
|
+
const res = [
|
|
190
|
+
'flex',
|
|
191
|
+
'h-6',
|
|
192
|
+
'items-center',
|
|
193
|
+
'border-b',
|
|
194
|
+
'border-b-p-gray-20',
|
|
195
|
+
'bg-p-gray-10',
|
|
196
|
+
'px-2',
|
|
197
|
+
'text-xs',
|
|
198
|
+
'font-medium',
|
|
199
|
+
'text-p-gray-40',
|
|
200
|
+
];
|
|
201
|
+
|
|
202
|
+
if ((i === 0 && props.isFirstColFixed) || (i === props.cols.length - 1 && props.isLastColFixed)) {
|
|
203
|
+
res.push('th-shadow');
|
|
204
|
+
}
|
|
205
|
+
return res;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const bgColorStyle = (col: TableCol) => {
|
|
209
|
+
if (col.borderColor) {
|
|
210
|
+
// append 33 to the color to make it 20% opacity
|
|
211
|
+
return { backgroundColor: col.borderColor + '33' };
|
|
212
|
+
}
|
|
213
|
+
return {};
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
const headerCellTextColor = (col: TableCol) => {
|
|
217
|
+
if (col.borderColor) {
|
|
218
|
+
return `color-mix(in srgb, ${col.borderColor} 100%, #000000 20%)`;
|
|
219
|
+
}
|
|
220
|
+
return '';
|
|
221
|
+
};
|
|
222
|
+
|
|
188
223
|
// Lifecycle hooks
|
|
189
224
|
onMounted(() => {
|
|
190
225
|
scrollWrapper.value?.addEventListener('scroll', emitScroll, true);
|
|
@@ -214,7 +249,7 @@ watch(isColResizing, (nV) => {
|
|
|
214
249
|
@apply left-0 z-30;
|
|
215
250
|
}
|
|
216
251
|
.p-table.first-col-fixed th:first-child .th-shadow {
|
|
217
|
-
box-shadow:
|
|
252
|
+
box-shadow: -1px 1px 5px 4px rgba(0, 0, 0, 0.15);
|
|
218
253
|
clip-path: inset(0px -12px 0px 0px);
|
|
219
254
|
}
|
|
220
255
|
.p-table.last-col-fixed th:last-child {
|
|
@@ -23,12 +23,11 @@ describe('PTableHeaderCell.vue', () => {
|
|
|
23
23
|
expect(div.classes()).toEqual([
|
|
24
24
|
'text-xs',
|
|
25
25
|
'leading-5',
|
|
26
|
-
'font-
|
|
27
|
-
'uppercase',
|
|
26
|
+
'font-semibold',
|
|
28
27
|
'truncate',
|
|
29
28
|
'shrink',
|
|
30
29
|
'test-class',
|
|
31
|
-
'text-p-
|
|
30
|
+
'text-p-gray-60',
|
|
32
31
|
'mr-auto',
|
|
33
32
|
]);
|
|
34
33
|
expect(tooltipIcon.exists()).toBe(false);
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="flex items-center overflow-hidden">
|
|
3
3
|
<div
|
|
4
|
-
:class="[
|
|
5
|
-
|
|
6
|
-
textClass,
|
|
7
|
-
filterActive ? 'text-active-blue' : 'text-p-purple-60',
|
|
8
|
-
{ 'mr-auto': !tooltipText },
|
|
9
|
-
]"
|
|
4
|
+
:class="[DEFAULT_CLASSES, textClass, textColorClass, { 'mr-auto': !tooltipText }]"
|
|
5
|
+
:style="style"
|
|
10
6
|
:title="text"
|
|
11
7
|
>
|
|
12
8
|
{{ text }}
|
|
@@ -27,7 +23,7 @@ import PInfoIcon from '@squirrel/components/p-info-icon/p-info-icon.vue';
|
|
|
27
23
|
import PTableFilterIcon from '@squirrel/components/p-table-header-cell/p-table-filter-icon.vue';
|
|
28
24
|
import { defineComponent } from 'vue';
|
|
29
25
|
|
|
30
|
-
const DEFAULT_CLASSES = `text-xs leading-5 font-
|
|
26
|
+
const DEFAULT_CLASSES = `text-xs leading-5 font-semibold truncate shrink`;
|
|
31
27
|
|
|
32
28
|
export default defineComponent({
|
|
33
29
|
name: 'PTableHeaderCell',
|
|
@@ -56,6 +52,10 @@ export default defineComponent({
|
|
|
56
52
|
type: String,
|
|
57
53
|
default: '',
|
|
58
54
|
},
|
|
55
|
+
textColor: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: '',
|
|
58
|
+
},
|
|
59
59
|
},
|
|
60
60
|
emits: ['click-filter-icon'],
|
|
61
61
|
data() {
|
|
@@ -63,5 +63,18 @@ export default defineComponent({
|
|
|
63
63
|
DEFAULT_CLASSES,
|
|
64
64
|
};
|
|
65
65
|
},
|
|
66
|
+
computed: {
|
|
67
|
+
textColorClass() {
|
|
68
|
+
return this.filterActive ? 'text-active-blue' : this.textColor ? '' : 'text-p-gray-60';
|
|
69
|
+
},
|
|
70
|
+
style() {
|
|
71
|
+
if (this.filterActive) {
|
|
72
|
+
return {};
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
color: this.textColor,
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
},
|
|
66
79
|
});
|
|
67
80
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="block overflow-hidden border border-p-gray-30">
|
|
2
|
+
<div class="block overflow-hidden border border-p-gray-30 bg-surface">
|
|
3
3
|
<table class="mb-0 w-full bg-surface">
|
|
4
4
|
<thead>
|
|
5
5
|
<tr>
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
<div class="relative border-b border-p-gray-30 px-4 py-2">
|
|
8
8
|
<PSkeletonLoader class="h-5" />
|
|
9
9
|
</div>
|
|
10
|
+
<div v-if="withSubheader" class="h-4 w-full border-b border-b-p-gray-20 bg-p-gray-10"></div>
|
|
10
11
|
</th>
|
|
11
12
|
</tr>
|
|
12
13
|
</thead>
|
|
@@ -45,5 +46,9 @@ defineProps({
|
|
|
45
46
|
type: String,
|
|
46
47
|
default: 'h-5',
|
|
47
48
|
},
|
|
49
|
+
withSubheader: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false,
|
|
52
|
+
},
|
|
48
53
|
});
|
|
49
54
|
</script>
|
|
@@ -10,14 +10,18 @@ import { ref } from 'vue';
|
|
|
10
10
|
const DEFAULT_TD_CLASSES = [
|
|
11
11
|
'p-0',
|
|
12
12
|
'h-full',
|
|
13
|
+
'font-normal',
|
|
14
|
+
'text-p-gray-60',
|
|
13
15
|
'text-sm',
|
|
14
16
|
'border-b',
|
|
15
17
|
'border-p-gray-30',
|
|
18
|
+
'border-r',
|
|
19
|
+
'border-r-p-blue-10',
|
|
16
20
|
'bg-white',
|
|
17
|
-
'group-hover/row:bg-p-
|
|
21
|
+
'group-hover/row:bg-p-gray-10',
|
|
18
22
|
];
|
|
19
23
|
|
|
20
|
-
const DEFAULT_INNER_DIV_CLASSES = ['
|
|
24
|
+
const DEFAULT_INNER_DIV_CLASSES = ['w-max', 'px-2'];
|
|
21
25
|
|
|
22
26
|
describe('PTableTd.vue', () => {
|
|
23
27
|
it('renders a td', async () => {
|
|
@@ -28,7 +32,7 @@ describe('PTableTd.vue', () => {
|
|
|
28
32
|
});
|
|
29
33
|
|
|
30
34
|
const td = wrapper.find('td');
|
|
31
|
-
const innerDiv = wrapper.find('div
|
|
35
|
+
const innerDiv = wrapper.find('div:nth-child(2)');
|
|
32
36
|
|
|
33
37
|
expect(td.text()).toContain(`Cell content`);
|
|
34
38
|
expect(td.classes()).toEqual(DEFAULT_TD_CLASSES);
|
|
@@ -73,7 +77,7 @@ describe('PTableTd.vue', () => {
|
|
|
73
77
|
});
|
|
74
78
|
|
|
75
79
|
const td = wrapper.find('td');
|
|
76
|
-
const innerDiv = wrapper.find('div
|
|
80
|
+
const innerDiv = wrapper.find('div:nth-child(2)');
|
|
77
81
|
|
|
78
82
|
['td-col-fixed-border-b', 'first:sticky', 'first:left-0', 'first:z-10'].forEach((c) => {
|
|
79
83
|
expect(td.classes()).toContain(c);
|
|
@@ -97,7 +101,7 @@ describe('PTableTd.vue', () => {
|
|
|
97
101
|
});
|
|
98
102
|
|
|
99
103
|
const td = wrapper.find('td');
|
|
100
|
-
const innerDiv = wrapper.find('div
|
|
104
|
+
const innerDiv = wrapper.find('div:nth-child(2)');
|
|
101
105
|
|
|
102
106
|
['td-col-fixed-border-b', 'last:sticky', 'last:right-0', 'last:z-10'].forEach((c) => {
|
|
103
107
|
expect(td.classes()).toContain(c);
|
|
@@ -120,11 +124,9 @@ describe('PTableTd.vue', () => {
|
|
|
120
124
|
},
|
|
121
125
|
});
|
|
122
126
|
|
|
123
|
-
const innerDiv = wrapper.find('div
|
|
127
|
+
const innerDiv = wrapper.find('div:nth-child(2)');
|
|
124
128
|
|
|
125
|
-
['
|
|
126
|
-
expect(innerDiv.classes()).toContain(c);
|
|
127
|
-
});
|
|
129
|
+
expect([...innerDiv.classes()].sort()).toEqual(['w-max', 'pl-4', 'pr-2'].sort());
|
|
128
130
|
});
|
|
129
131
|
|
|
130
132
|
it('it applies spacing on the last non-sticky column', async () => {
|
|
@@ -139,10 +141,8 @@ describe('PTableTd.vue', () => {
|
|
|
139
141
|
},
|
|
140
142
|
});
|
|
141
143
|
|
|
142
|
-
const innerDiv = wrapper.find('div
|
|
144
|
+
const innerDiv = wrapper.find('div:nth-child(2)');
|
|
143
145
|
|
|
144
|
-
['
|
|
145
|
-
expect(innerDiv.classes()).toContain(c);
|
|
146
|
-
});
|
|
146
|
+
expect([...innerDiv.classes()].sort()).toEqual(['w-max', 'pl-2', 'pr-4'].sort());
|
|
147
147
|
});
|
|
148
148
|
});
|
|
@@ -50,7 +50,7 @@ const isLastCol = computed(() => props.colIndex === cols.value.length - 1);
|
|
|
50
50
|
const tdClass = computed(() => {
|
|
51
51
|
const res = [
|
|
52
52
|
// Common classes for all cells
|
|
53
|
-
'p-0 h-full text-sm',
|
|
53
|
+
'p-0 h-full font-normal text-p-gray-60 text-sm ',
|
|
54
54
|
];
|
|
55
55
|
|
|
56
56
|
if (props.isEditable) {
|
|
@@ -64,19 +64,19 @@ const tdClass = computed(() => {
|
|
|
64
64
|
// Stick the last column's cells to the right
|
|
65
65
|
res.push('td-col-fixed-border-b', 'last:sticky last:right-0 last:z-10');
|
|
66
66
|
} else {
|
|
67
|
-
res.push('border-b border-p-gray-30');
|
|
67
|
+
res.push('border-b border-p-gray-30 border-r border-r-p-blue-10');
|
|
68
68
|
}
|
|
69
69
|
if (props.isSelected) {
|
|
70
70
|
res.push('bg-p-blue-15 group-hover/row:bg-p-blue-15');
|
|
71
71
|
} else {
|
|
72
|
-
res.push('bg-white group-hover/row:bg-p-
|
|
72
|
+
res.push('bg-white group-hover/row:bg-p-gray-10');
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
return res;
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
const innerDivClass = computed(() => {
|
|
79
|
-
const res = [
|
|
79
|
+
const res = [];
|
|
80
80
|
|
|
81
81
|
const currentColIsFirstColFixed = isFirstColFixed.value && isFirstCol.value;
|
|
82
82
|
const currentColIsLastColFixed = isLastColFixed.value && isLastCol.value;
|
|
@@ -29,7 +29,7 @@ import inputClassesMixin from '@squirrel/utils/inputClassesMixin';
|
|
|
29
29
|
import { type StyleValue, defineComponent } from 'vue';
|
|
30
30
|
|
|
31
31
|
const TOGGLE_SIZES = {
|
|
32
|
-
sm: `w-
|
|
32
|
+
sm: `w-7 h-4 after:top-[2px] after:left-[2px] after:h-3 after:w-3`,
|
|
33
33
|
md: `w-11 h-6 after:top-[2px] after:left-[2px] after:h-5 after:w-5`,
|
|
34
34
|
lg: `w-[52px] h-7 after:top-0.5 after:left-[2px] after:h-6 after:w-6`,
|
|
35
35
|
};
|
|
@@ -25,6 +25,7 @@ const defaults = {
|
|
|
25
25
|
required: ref(false),
|
|
26
26
|
prefix: ref(false),
|
|
27
27
|
suffix: ref(false),
|
|
28
|
+
rounded: ref(false),
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
type Props = {
|
|
@@ -33,19 +34,20 @@ type Props = {
|
|
|
33
34
|
required: boolean;
|
|
34
35
|
prefix: boolean;
|
|
35
36
|
suffix: boolean;
|
|
37
|
+
rounded: boolean;
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
type Defaults = typeof defaults;
|
|
39
41
|
|
|
40
42
|
export function useInputClasses(props: Partial<Props>) {
|
|
41
43
|
const opts = { ...defaults, ...toRefs(props) } as Defaults;
|
|
42
|
-
const { size, errorMsg, required, prefix, suffix } = opts;
|
|
44
|
+
const { size, errorMsg, required, rounded, prefix, suffix } = opts;
|
|
43
45
|
|
|
44
46
|
const inputClasses = computed(() => {
|
|
45
47
|
const base = `${INPUT_BASE} ${INPUT_SIZES[size.value]}`;
|
|
46
48
|
const spacingLeft = prefix.value ? SPACING_PREFIX[size.value] : SPACING_LEFT[size.value];
|
|
47
49
|
const spacingRight = suffix.value ? SPACING_SUFFIX[size.value] : SPACING_RIGHT[size.value];
|
|
48
|
-
const res = `${base} ${spacingLeft} ${spacingRight} ${errorMsg.value ? INPUT_ERROR : INPUT_NORMAL}`;
|
|
50
|
+
const res = `${base} ${spacingLeft} ${spacingRight} ${errorMsg.value ? INPUT_ERROR : INPUT_NORMAL}${rounded.value ? ' rounded-full' : ''}`;
|
|
49
51
|
|
|
50
52
|
return res;
|
|
51
53
|
});
|
|
@@ -36,6 +36,10 @@ export default defineComponent({
|
|
|
36
36
|
type: Boolean,
|
|
37
37
|
default: false,
|
|
38
38
|
},
|
|
39
|
+
rounded: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false,
|
|
42
|
+
},
|
|
39
43
|
},
|
|
40
44
|
data() {
|
|
41
45
|
return {
|
|
@@ -47,7 +51,7 @@ export default defineComponent({
|
|
|
47
51
|
const base = `${INPUT_BASE} ${INPUT_SIZES[this.size]}`;
|
|
48
52
|
const spacingLeft = this.$slots.prefix ? SPACING_PREFIX[this.size] : SPACING_LEFT[this.size];
|
|
49
53
|
const spacingRight = this.$slots.suffix ? SPACING_SUFFIX[this.size] : SPACING_RIGHT[this.size];
|
|
50
|
-
const res = `${base} ${spacingLeft} ${spacingRight} ${this.errorMsg ? INPUT_ERROR : INPUT_NORMAL}`;
|
|
54
|
+
const res = `${base} ${spacingLeft} ${spacingRight} ${this.errorMsg ? INPUT_ERROR : INPUT_NORMAL}${this.rounded ? ' rounded-full' : ''}`;
|
|
51
55
|
|
|
52
56
|
return res;
|
|
53
57
|
},
|