@pequity/squirrel 7.2.6 → 8.0.1
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-btn.js +3 -3
- package/dist/cjs/chunks/p-input-number.js +5 -5
- package/dist/es/chunks/p-btn.js +3 -3
- package/dist/es/chunks/p-input-number.js +5 -5
- package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +9 -9
- package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +6 -6
- package/package.json +5 -5
- package/squirrel/components/p-btn/p-btn.spec.js +3 -3
- package/squirrel/components/p-btn/p-btn.vue +3 -3
- package/squirrel/components/p-input-number/p-input-number.spec.js +29 -2
- package/squirrel/components/p-input-number/p-input-number.vue +7 -5
package/dist/cjs/chunks/p-btn.js
CHANGED
|
@@ -44,17 +44,17 @@ const btnClasses = {
|
|
|
44
44
|
},
|
|
45
45
|
size: {
|
|
46
46
|
sm: {
|
|
47
|
-
button: "px-3 has-[.slot-wrapper:empty]:px-1.5 py-1.5 text-sm leading-5",
|
|
47
|
+
button: "px-3 has-[.slot-wrapper:empty]:px-1.5 py-1.5 text-sm leading-5 h-8",
|
|
48
48
|
content: "gap-1",
|
|
49
49
|
icon: "text-base p-0.5"
|
|
50
50
|
},
|
|
51
51
|
md: {
|
|
52
|
-
button: "px-6 has-[.slot-wrapper:empty]:px-2.5 has-[.slot-wrapper:empty]:py-2.5 py-2 text-base",
|
|
52
|
+
button: "px-6 has-[.slot-wrapper:empty]:px-2.5 has-[.slot-wrapper:empty]:py-2.5 py-2 text-base h-10",
|
|
53
53
|
content: "gap-2",
|
|
54
54
|
icon: "text-xl"
|
|
55
55
|
},
|
|
56
56
|
lg: {
|
|
57
|
-
button: "px-6 has-[.slot-wrapper:empty]:px-3 py-3 text-lg leading-6",
|
|
57
|
+
button: "px-6 has-[.slot-wrapper:empty]:px-3 py-3 text-lg leading-6 h-12",
|
|
58
58
|
content: "gap-2.5",
|
|
59
59
|
icon: "text-2xl"
|
|
60
60
|
}
|
|
@@ -48,7 +48,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
48
48
|
type: String,
|
|
49
49
|
default: ""
|
|
50
50
|
},
|
|
51
|
-
|
|
51
|
+
prefixString: {
|
|
52
52
|
type: String,
|
|
53
53
|
default: ""
|
|
54
54
|
}
|
|
@@ -79,7 +79,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
79
79
|
const { labelClasses, inputClasses, errorMsgClasses } = useInputClasses.useInputClasses(
|
|
80
80
|
vue.computed(() => ({
|
|
81
81
|
...props,
|
|
82
|
-
prefix: !!slots.prefix || !!props.
|
|
82
|
+
prefix: !!slots.prefix || !!props.prefixString,
|
|
83
83
|
suffix: !!slots.suffix
|
|
84
84
|
}))
|
|
85
85
|
);
|
|
@@ -146,11 +146,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
146
146
|
}, null, 8, ["text"])) : vue.createCommentVNode("", true)
|
|
147
147
|
]),
|
|
148
148
|
vue.createElementVNode("div", _hoisted_3, [
|
|
149
|
-
!!_ctx.$slots.prefix || __props.
|
|
149
|
+
!!_ctx.$slots.prefix || __props.prefixString ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
|
|
150
150
|
vue.renderSlot(_ctx.$slots, "prefix", {}, () => [
|
|
151
151
|
vue.createElementVNode("div", {
|
|
152
|
-
class: vue.normalizeClass([{ "absolute left-3 flex items-center": __props.
|
|
153
|
-
}, vue.toDisplayString(__props.
|
|
152
|
+
class: vue.normalizeClass([{ "absolute left-3 flex items-center": __props.prefixString }, __props.prefixString ? prefixClasses[__props.size] : ""])
|
|
153
|
+
}, vue.toDisplayString(__props.prefixString), 3)
|
|
154
154
|
])
|
|
155
155
|
])) : vue.createCommentVNode("", true),
|
|
156
156
|
vue.createElementVNode("input", vue.mergeProps({
|
package/dist/es/chunks/p-btn.js
CHANGED
|
@@ -43,17 +43,17 @@ const btnClasses = {
|
|
|
43
43
|
},
|
|
44
44
|
size: {
|
|
45
45
|
sm: {
|
|
46
|
-
button: "px-3 has-[.slot-wrapper:empty]:px-1.5 py-1.5 text-sm leading-5",
|
|
46
|
+
button: "px-3 has-[.slot-wrapper:empty]:px-1.5 py-1.5 text-sm leading-5 h-8",
|
|
47
47
|
content: "gap-1",
|
|
48
48
|
icon: "text-base p-0.5"
|
|
49
49
|
},
|
|
50
50
|
md: {
|
|
51
|
-
button: "px-6 has-[.slot-wrapper:empty]:px-2.5 has-[.slot-wrapper:empty]:py-2.5 py-2 text-base",
|
|
51
|
+
button: "px-6 has-[.slot-wrapper:empty]:px-2.5 has-[.slot-wrapper:empty]:py-2.5 py-2 text-base h-10",
|
|
52
52
|
content: "gap-2",
|
|
53
53
|
icon: "text-xl"
|
|
54
54
|
},
|
|
55
55
|
lg: {
|
|
56
|
-
button: "px-6 has-[.slot-wrapper:empty]:px-3 py-3 text-lg leading-6",
|
|
56
|
+
button: "px-6 has-[.slot-wrapper:empty]:px-3 py-3 text-lg leading-6 h-12",
|
|
57
57
|
content: "gap-2.5",
|
|
58
58
|
icon: "text-2xl"
|
|
59
59
|
}
|
|
@@ -47,7 +47,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
47
47
|
type: String,
|
|
48
48
|
default: ""
|
|
49
49
|
},
|
|
50
|
-
|
|
50
|
+
prefixString: {
|
|
51
51
|
type: String,
|
|
52
52
|
default: ""
|
|
53
53
|
}
|
|
@@ -78,7 +78,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
78
78
|
const { labelClasses, inputClasses, errorMsgClasses } = useInputClasses(
|
|
79
79
|
computed(() => ({
|
|
80
80
|
...props,
|
|
81
|
-
prefix: !!slots.prefix || !!props.
|
|
81
|
+
prefix: !!slots.prefix || !!props.prefixString,
|
|
82
82
|
suffix: !!slots.suffix
|
|
83
83
|
}))
|
|
84
84
|
);
|
|
@@ -145,11 +145,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
145
145
|
}, null, 8, ["text"])) : createCommentVNode("", true)
|
|
146
146
|
]),
|
|
147
147
|
createElementVNode("div", _hoisted_3, [
|
|
148
|
-
!!_ctx.$slots.prefix || __props.
|
|
148
|
+
!!_ctx.$slots.prefix || __props.prefixString ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
149
149
|
renderSlot(_ctx.$slots, "prefix", {}, () => [
|
|
150
150
|
createElementVNode("div", {
|
|
151
|
-
class: normalizeClass([{ "absolute left-3 flex items-center": __props.
|
|
152
|
-
}, toDisplayString(__props.
|
|
151
|
+
class: normalizeClass([{ "absolute left-3 flex items-center": __props.prefixString }, __props.prefixString ? prefixClasses[__props.size] : ""])
|
|
152
|
+
}, toDisplayString(__props.prefixString), 3)
|
|
153
153
|
])
|
|
154
154
|
])) : createCommentVNode("", true),
|
|
155
155
|
createElementVNode("input", mergeProps({
|
|
@@ -49,17 +49,17 @@ declare const btn: import("tailwind-variants").TVReturnType<{
|
|
|
49
49
|
};
|
|
50
50
|
readonly size: {
|
|
51
51
|
readonly sm: {
|
|
52
|
-
readonly button: "px-3 has-[.slot-wrapper:empty]:px-1.5 py-1.5 text-sm leading-5";
|
|
52
|
+
readonly button: "px-3 has-[.slot-wrapper:empty]:px-1.5 py-1.5 text-sm leading-5 h-8";
|
|
53
53
|
readonly content: "gap-1";
|
|
54
54
|
readonly icon: "text-base p-0.5";
|
|
55
55
|
};
|
|
56
56
|
readonly md: {
|
|
57
|
-
readonly button: "px-6 has-[.slot-wrapper:empty]:px-2.5 has-[.slot-wrapper:empty]:py-2.5 py-2 text-base";
|
|
57
|
+
readonly button: "px-6 has-[.slot-wrapper:empty]:px-2.5 has-[.slot-wrapper:empty]:py-2.5 py-2 text-base h-10";
|
|
58
58
|
readonly content: "gap-2";
|
|
59
59
|
readonly icon: "text-xl";
|
|
60
60
|
};
|
|
61
61
|
readonly lg: {
|
|
62
|
-
readonly button: "px-6 has-[.slot-wrapper:empty]:px-3 py-3 text-lg leading-6";
|
|
62
|
+
readonly button: "px-6 has-[.slot-wrapper:empty]:px-3 py-3 text-lg leading-6 h-12";
|
|
63
63
|
readonly content: "gap-2.5";
|
|
64
64
|
readonly icon: "text-2xl";
|
|
65
65
|
};
|
|
@@ -114,17 +114,17 @@ declare const btn: import("tailwind-variants").TVReturnType<{
|
|
|
114
114
|
};
|
|
115
115
|
readonly size: {
|
|
116
116
|
readonly sm: {
|
|
117
|
-
readonly button: "px-3 has-[.slot-wrapper:empty]:px-1.5 py-1.5 text-sm leading-5";
|
|
117
|
+
readonly button: "px-3 has-[.slot-wrapper:empty]:px-1.5 py-1.5 text-sm leading-5 h-8";
|
|
118
118
|
readonly content: "gap-1";
|
|
119
119
|
readonly icon: "text-base p-0.5";
|
|
120
120
|
};
|
|
121
121
|
readonly md: {
|
|
122
|
-
readonly button: "px-6 has-[.slot-wrapper:empty]:px-2.5 has-[.slot-wrapper:empty]:py-2.5 py-2 text-base";
|
|
122
|
+
readonly button: "px-6 has-[.slot-wrapper:empty]:px-2.5 has-[.slot-wrapper:empty]:py-2.5 py-2 text-base h-10";
|
|
123
123
|
readonly content: "gap-2";
|
|
124
124
|
readonly icon: "text-xl";
|
|
125
125
|
};
|
|
126
126
|
readonly lg: {
|
|
127
|
-
readonly button: "px-6 has-[.slot-wrapper:empty]:px-3 py-3 text-lg leading-6";
|
|
127
|
+
readonly button: "px-6 has-[.slot-wrapper:empty]:px-3 py-3 text-lg leading-6 h-12";
|
|
128
128
|
readonly content: "gap-2.5";
|
|
129
129
|
readonly icon: "text-2xl";
|
|
130
130
|
};
|
|
@@ -179,17 +179,17 @@ declare const btn: import("tailwind-variants").TVReturnType<{
|
|
|
179
179
|
};
|
|
180
180
|
readonly size: {
|
|
181
181
|
readonly sm: {
|
|
182
|
-
readonly button: "px-3 has-[.slot-wrapper:empty]:px-1.5 py-1.5 text-sm leading-5";
|
|
182
|
+
readonly button: "px-3 has-[.slot-wrapper:empty]:px-1.5 py-1.5 text-sm leading-5 h-8";
|
|
183
183
|
readonly content: "gap-1";
|
|
184
184
|
readonly icon: "text-base p-0.5";
|
|
185
185
|
};
|
|
186
186
|
readonly md: {
|
|
187
|
-
readonly button: "px-6 has-[.slot-wrapper:empty]:px-2.5 has-[.slot-wrapper:empty]:py-2.5 py-2 text-base";
|
|
187
|
+
readonly button: "px-6 has-[.slot-wrapper:empty]:px-2.5 has-[.slot-wrapper:empty]:py-2.5 py-2 text-base h-10";
|
|
188
188
|
readonly content: "gap-2";
|
|
189
189
|
readonly icon: "text-xl";
|
|
190
190
|
};
|
|
191
191
|
readonly lg: {
|
|
192
|
-
readonly button: "px-6 has-[.slot-wrapper:empty]:px-3 py-3 text-lg leading-6";
|
|
192
|
+
readonly button: "px-6 has-[.slot-wrapper:empty]:px-3 py-3 text-lg leading-6 h-12";
|
|
193
193
|
readonly content: "gap-2.5";
|
|
194
194
|
readonly icon: "text-2xl";
|
|
195
195
|
};
|
|
@@ -49,7 +49,7 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
49
49
|
type: StringConstructor;
|
|
50
50
|
default: string;
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
prefixString: {
|
|
53
53
|
type: StringConstructor;
|
|
54
54
|
default: string;
|
|
55
55
|
};
|
|
@@ -96,7 +96,7 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
96
96
|
type: StringConstructor;
|
|
97
97
|
default: string;
|
|
98
98
|
};
|
|
99
|
-
|
|
99
|
+
prefixString: {
|
|
100
100
|
type: StringConstructor;
|
|
101
101
|
default: string;
|
|
102
102
|
};
|
|
@@ -108,10 +108,10 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
108
108
|
label: string;
|
|
109
109
|
required: boolean;
|
|
110
110
|
modelValue: string | number | null | undefined;
|
|
111
|
-
prefix: string;
|
|
112
111
|
errorMsg: string;
|
|
113
112
|
selectOnClick: boolean;
|
|
114
113
|
tooltipText: string;
|
|
114
|
+
prefixString: string;
|
|
115
115
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
116
116
|
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
117
117
|
modelValue: {
|
|
@@ -143,7 +143,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
143
143
|
type: StringConstructor;
|
|
144
144
|
default: string;
|
|
145
145
|
};
|
|
146
|
-
|
|
146
|
+
prefixString: {
|
|
147
147
|
type: StringConstructor;
|
|
148
148
|
default: string;
|
|
149
149
|
};
|
|
@@ -182,7 +182,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
182
182
|
type: StringConstructor;
|
|
183
183
|
default: string;
|
|
184
184
|
};
|
|
185
|
-
|
|
185
|
+
prefixString: {
|
|
186
186
|
type: StringConstructor;
|
|
187
187
|
default: string;
|
|
188
188
|
};
|
|
@@ -194,10 +194,10 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
194
194
|
label: string;
|
|
195
195
|
required: boolean;
|
|
196
196
|
modelValue: string | number | null | undefined;
|
|
197
|
-
prefix: string;
|
|
198
197
|
errorMsg: string;
|
|
199
198
|
selectOnClick: boolean;
|
|
200
199
|
tooltipText: string;
|
|
200
|
+
prefixString: string;
|
|
201
201
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
202
202
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
203
203
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pequity/squirrel",
|
|
3
3
|
"description": "Squirrel component library",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "8.0.1",
|
|
5
5
|
"packageManager": "pnpm@10.6.4",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@vue/test-utils": "^2.4.6",
|
|
76
76
|
"@vuepic/vue-datepicker": "11.0.2",
|
|
77
77
|
"autoprefixer": "^10.4.21",
|
|
78
|
-
"eslint": "^9.
|
|
78
|
+
"eslint": "^9.24.0",
|
|
79
79
|
"eslint-plugin-storybook": "^0.12.0",
|
|
80
80
|
"floating-vue": "5.2.2",
|
|
81
81
|
"glob": "^11.0.1",
|
|
@@ -90,12 +90,12 @@
|
|
|
90
90
|
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
91
91
|
"resolve-tspaths": "^0.8.23",
|
|
92
92
|
"rimraf": "^6.0.1",
|
|
93
|
-
"sass": "^1.86.
|
|
93
|
+
"sass": "^1.86.3",
|
|
94
94
|
"semantic-release": "^24.2.3",
|
|
95
95
|
"storybook": "^8.6.12",
|
|
96
96
|
"svgo": "^3.3.2",
|
|
97
97
|
"tailwindcss": "^3.4.17",
|
|
98
|
-
"typescript": "5.8.
|
|
98
|
+
"typescript": "5.8.3",
|
|
99
99
|
"vite": "^6.2.5",
|
|
100
100
|
"vitest": "^3.1.1",
|
|
101
101
|
"vue": "3.5.13",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
},
|
|
110
110
|
"pnpm": {
|
|
111
111
|
"overrides": {
|
|
112
|
-
"typescript": "5.8.
|
|
112
|
+
"typescript": "5.8.3"
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -174,9 +174,9 @@ describe('PBtn.vue', () => {
|
|
|
174
174
|
});
|
|
175
175
|
|
|
176
176
|
it.each([
|
|
177
|
-
['sm', ['py-1.5', 'px-3', 'rounded', 'font-medium', 'text-sm', 'leading-5']],
|
|
178
|
-
['md', ['py-2', 'px-6', 'rounded', 'font-medium', 'text-base']],
|
|
179
|
-
['lg', ['py-3', 'px-6', 'rounded', 'font-medium', 'text-lg', 'leading-6']],
|
|
177
|
+
['sm', ['py-1.5', 'px-3', 'rounded', 'font-medium', 'text-sm', 'leading-5', 'h-8']],
|
|
178
|
+
['md', ['py-2', 'px-6', 'rounded', 'font-medium', 'text-base', 'h-10']],
|
|
179
|
+
['lg', ['py-3', 'px-6', 'rounded', 'font-medium', 'text-lg', 'leading-6', 'h-12']],
|
|
180
180
|
])('renders a button of size %s', async (size, classes) => {
|
|
181
181
|
const wrapper = createWrapperFor(PBtn, { props: { size }, slots: { default: `button` } });
|
|
182
182
|
|
|
@@ -63,17 +63,17 @@ const btnClasses = {
|
|
|
63
63
|
},
|
|
64
64
|
size: {
|
|
65
65
|
sm: {
|
|
66
|
-
button: 'px-3 has-[.slot-wrapper:empty]:px-1.5 py-1.5 text-sm leading-5',
|
|
66
|
+
button: 'px-3 has-[.slot-wrapper:empty]:px-1.5 py-1.5 text-sm leading-5 h-8',
|
|
67
67
|
content: 'gap-1',
|
|
68
68
|
icon: 'text-base p-0.5',
|
|
69
69
|
},
|
|
70
70
|
md: {
|
|
71
|
-
button: 'px-6 has-[.slot-wrapper:empty]:px-2.5 has-[.slot-wrapper:empty]:py-2.5 py-2 text-base',
|
|
71
|
+
button: 'px-6 has-[.slot-wrapper:empty]:px-2.5 has-[.slot-wrapper:empty]:py-2.5 py-2 text-base h-10',
|
|
72
72
|
content: 'gap-2',
|
|
73
73
|
icon: 'text-xl',
|
|
74
74
|
},
|
|
75
75
|
lg: {
|
|
76
|
-
button: 'px-6 has-[.slot-wrapper:empty]:px-3 py-3 text-lg leading-6',
|
|
76
|
+
button: 'px-6 has-[.slot-wrapper:empty]:px-3 py-3 text-lg leading-6 h-12',
|
|
77
77
|
content: 'gap-2.5',
|
|
78
78
|
icon: 'text-2xl',
|
|
79
79
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import PInputNumber from '@squirrel/components/p-input-number/p-input-number.vue';
|
|
2
|
+
import { expect } from '@storybook/test';
|
|
2
3
|
import { createWrapperFor } from '@tests/vitest.helpers';
|
|
3
4
|
|
|
4
5
|
const baseClasses = () => [
|
|
@@ -139,10 +140,10 @@ describe('PInputNumber.vue', () => {
|
|
|
139
140
|
expect(wrapper.find('input').classes()).toEqual(expect.arrayContaining(res));
|
|
140
141
|
});
|
|
141
142
|
|
|
142
|
-
it('renders the
|
|
143
|
+
it('renders the prefixString prop content when no slot is provided', () => {
|
|
143
144
|
const wrapper = createWrapperFor(PInputNumber, {
|
|
144
145
|
props: {
|
|
145
|
-
|
|
146
|
+
prefixString: '$',
|
|
146
147
|
label: 'test input',
|
|
147
148
|
},
|
|
148
149
|
});
|
|
@@ -152,6 +153,32 @@ describe('PInputNumber.vue', () => {
|
|
|
152
153
|
expect(prefixDiv.text()).toBe('$');
|
|
153
154
|
});
|
|
154
155
|
|
|
156
|
+
it('works correctly when the component is stubbed', () => {
|
|
157
|
+
const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {});
|
|
158
|
+
|
|
159
|
+
const wrapper = createWrapperFor(
|
|
160
|
+
{
|
|
161
|
+
template: `<PInputNumber v-model="numberVal" />`,
|
|
162
|
+
components: { PInputNumber },
|
|
163
|
+
data() {
|
|
164
|
+
return {
|
|
165
|
+
numberVal: null,
|
|
166
|
+
};
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
global: {
|
|
171
|
+
stubs: {
|
|
172
|
+
PInputNumber: true,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
expect(wrapper.findComponent({ name: 'PInputNumber' }).exists()).toBe(true);
|
|
179
|
+
expect(warnSpy).not.toHaveBeenCalled();
|
|
180
|
+
});
|
|
181
|
+
|
|
155
182
|
it('emits a number on input', async () => {
|
|
156
183
|
const wrapper = createWrapperFor({
|
|
157
184
|
template: `<PInputNumber v-model="numberVal" />`,
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
<PInfoIcon v-if="tooltipText" :text="tooltipText" class="ml-1" />
|
|
10
10
|
</div>
|
|
11
11
|
<div class="relative w-full">
|
|
12
|
-
<div v-if="!!$slots.prefix ||
|
|
12
|
+
<div v-if="!!$slots.prefix || prefixString">
|
|
13
13
|
<slot name="prefix">
|
|
14
|
-
<div
|
|
15
|
-
{
|
|
14
|
+
<div
|
|
15
|
+
:class="[{ 'absolute left-3 flex items-center': prefixString }, prefixString ? prefixClasses[size] : '']"
|
|
16
|
+
>
|
|
17
|
+
{{ prefixString }}
|
|
16
18
|
</div>
|
|
17
19
|
</slot>
|
|
18
20
|
</div>
|
|
@@ -90,7 +92,7 @@ const props = defineProps({
|
|
|
90
92
|
type: String,
|
|
91
93
|
default: '',
|
|
92
94
|
},
|
|
93
|
-
|
|
95
|
+
prefixString: {
|
|
94
96
|
type: String,
|
|
95
97
|
default: '',
|
|
96
98
|
},
|
|
@@ -101,7 +103,7 @@ const slots = useSlots();
|
|
|
101
103
|
const { labelClasses, inputClasses, errorMsgClasses } = useInputClasses(
|
|
102
104
|
computed(() => ({
|
|
103
105
|
...props,
|
|
104
|
-
prefix: !!slots.prefix || !!props.
|
|
106
|
+
prefix: !!slots.prefix || !!props.prefixString,
|
|
105
107
|
suffix: !!slots.suffix,
|
|
106
108
|
}))
|
|
107
109
|
);
|