vueless 0.0.237 → 0.0.238
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 +1 -1
- package/ui.form-input/index.vue +12 -12
- package/ui.form-select/configs/default.config.js +1 -1
- package/ui.form-switch/configs/default.config.js +3 -4
- package/ui.form-textarea/configs/default.config.js +1 -2
- package/ui.form-textarea/index.vue +13 -13
- package/web-types.json +2 -2
package/package.json
CHANGED
package/ui.form-input/index.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ULabel
|
|
3
|
-
ref="
|
|
3
|
+
ref="labelComponentRef"
|
|
4
4
|
:for="id"
|
|
5
5
|
:label="label"
|
|
6
6
|
:description="description"
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
v-bind="labelAttrs"
|
|
13
13
|
>
|
|
14
14
|
<label :for="id" v-bind="blockAttrs">
|
|
15
|
-
<span v-if="hasSlotContent($slots['left'])" ref="
|
|
15
|
+
<span v-if="hasSlotContent($slots['left'])" ref="leftSlotWrapperRef">
|
|
16
16
|
<!-- @slot Use it to add something before the text. -->
|
|
17
17
|
<slot name="left" />
|
|
18
18
|
</span>
|
|
19
19
|
|
|
20
20
|
<span
|
|
21
21
|
v-if="hasSlotContent($slots['icon-left']) || iconLeft"
|
|
22
|
-
ref="
|
|
22
|
+
ref="leftSlotWrapperRef"
|
|
23
23
|
v-bind="leftIconSlotAttrs"
|
|
24
24
|
>
|
|
25
25
|
<!--
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<span v-bind="inputWrapperAttrs">
|
|
36
36
|
<input
|
|
37
37
|
:id="id"
|
|
38
|
-
ref="
|
|
38
|
+
ref="inputRef"
|
|
39
39
|
v-model="inputValue"
|
|
40
40
|
:placeholder="placeholder"
|
|
41
41
|
:type="inputType"
|
|
@@ -315,11 +315,11 @@ const props = defineProps({
|
|
|
315
315
|
const slots = useSlots();
|
|
316
316
|
|
|
317
317
|
const isShownPassword = ref(false);
|
|
318
|
-
const
|
|
319
|
-
const
|
|
320
|
-
const
|
|
318
|
+
const inputRef = ref(null);
|
|
319
|
+
const labelComponentRef = ref(null);
|
|
320
|
+
const leftSlotWrapperRef = ref(null);
|
|
321
321
|
|
|
322
|
-
defineExpose({
|
|
322
|
+
defineExpose({ inputRef });
|
|
323
323
|
|
|
324
324
|
const isTypePassword = computed(() => props.type === "password");
|
|
325
325
|
|
|
@@ -440,12 +440,12 @@ function setLabelPosition() {
|
|
|
440
440
|
return;
|
|
441
441
|
}
|
|
442
442
|
|
|
443
|
-
let leftSlotOrIconWidth =
|
|
443
|
+
let leftSlotOrIconWidth = leftSlotWrapperRef.value.getBoundingClientRect().width;
|
|
444
444
|
|
|
445
|
-
const leftPaddingValue = parseFloat(getComputedStyle(
|
|
445
|
+
const leftPaddingValue = parseFloat(getComputedStyle(inputRef.value).paddingLeft);
|
|
446
446
|
|
|
447
|
-
if (
|
|
448
|
-
|
|
447
|
+
if (labelComponentRef.value.labelElement) {
|
|
448
|
+
labelComponentRef.value.labelElement.style.left = `${leftSlotOrIconWidth + leftPaddingValue}px`;
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
451
|
</script>
|
|
@@ -2,8 +2,7 @@ export default /*tw*/ {
|
|
|
2
2
|
label: "{ULabel}",
|
|
3
3
|
wrapper: {
|
|
4
4
|
base: `
|
|
5
|
-
|
|
6
|
-
flex items-center p-0.5 relative rounded-3xl cursor-pointer
|
|
5
|
+
flex items-center p-0.5 relative rounded-3xl cursor-pointer transition
|
|
7
6
|
ring-opacity-10 focus-within:ring-dynamic focus-within:ring-offset-dynamic
|
|
8
7
|
`,
|
|
9
8
|
variants: {
|
|
@@ -28,7 +27,7 @@ export default /*tw*/ {
|
|
|
28
27
|
},
|
|
29
28
|
input: "absolute size-0 opacity-0",
|
|
30
29
|
circle: {
|
|
31
|
-
base: "transition duration-300 rounded-full bg-white flex items-center justify-center",
|
|
30
|
+
base: "transition-all duration-300 rounded-full bg-white flex items-center justify-center",
|
|
32
31
|
variants: {
|
|
33
32
|
size: {
|
|
34
33
|
sm: "size-3",
|
|
@@ -46,7 +45,7 @@ export default /*tw*/ {
|
|
|
46
45
|
selectedIconName: "check",
|
|
47
46
|
unselectedIconName: "close",
|
|
48
47
|
toggleLabel: {
|
|
49
|
-
base: "absolute text-center text-2xs font-medium uppercase text-white
|
|
48
|
+
base: "absolute text-center text-2xs font-medium uppercase text-white",
|
|
50
49
|
compoundVariants: [
|
|
51
50
|
{ toggleLabel: true, checked: true, class: "w-1/2 left-1" },
|
|
52
51
|
{ toggleLabel: true, checked: false, class: "w-1/2 right-1" },
|
|
@@ -12,7 +12,7 @@ export default /*tw*/ {
|
|
|
12
12
|
variants: {
|
|
13
13
|
error: {
|
|
14
14
|
true: `
|
|
15
|
-
border-red-300
|
|
15
|
+
bg-red-50 border-red-300
|
|
16
16
|
hover:border-red-400 hover:focus-within:border-red-500
|
|
17
17
|
focus-within:border-red-500 focus-within:ring-red-100
|
|
18
18
|
`,
|
|
@@ -51,7 +51,6 @@ export default /*tw*/ {
|
|
|
51
51
|
type: "text",
|
|
52
52
|
inputmode: "text",
|
|
53
53
|
labelAlign: "topInside",
|
|
54
|
-
error: false,
|
|
55
54
|
disabled: false,
|
|
56
55
|
readonly: false,
|
|
57
56
|
noAutocomplete: false,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ULabel
|
|
3
|
-
ref="
|
|
3
|
+
ref="labelComponentRef"
|
|
4
4
|
:for="id"
|
|
5
5
|
:label="label"
|
|
6
6
|
:error="error"
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
>
|
|
14
14
|
<label
|
|
15
15
|
v-if="hasSlotContent($slots['left'])"
|
|
16
|
-
ref="
|
|
16
|
+
ref="leftSlotWrapperRef"
|
|
17
17
|
:for="id"
|
|
18
18
|
v-bind="leftSlotAttrs"
|
|
19
19
|
>
|
|
20
20
|
<!-- @slot Use it to add something before the text. -->
|
|
21
21
|
<slot name="left" />
|
|
22
22
|
</label>
|
|
23
|
-
<label ref="
|
|
23
|
+
<label ref="textareaWrapperRef" :for="id" v-bind="textareaWrapperAttrs">
|
|
24
24
|
<textarea
|
|
25
25
|
:id="id"
|
|
26
|
-
ref="
|
|
26
|
+
ref="textareaRef"
|
|
27
27
|
v-model="localValue"
|
|
28
28
|
:value="modelValue"
|
|
29
29
|
:placeholder="placeholder"
|
|
@@ -231,10 +231,10 @@ const {
|
|
|
231
231
|
hasSlotContent,
|
|
232
232
|
} = useAttrs(props);
|
|
233
233
|
|
|
234
|
-
const
|
|
235
|
-
const
|
|
236
|
-
const
|
|
237
|
-
const
|
|
234
|
+
const textareaRef = ref(null);
|
|
235
|
+
const labelComponentRef = ref(null);
|
|
236
|
+
const leftSlotWrapperRef = ref(null);
|
|
237
|
+
const textareaWrapperRef = ref(null);
|
|
238
238
|
|
|
239
239
|
const localValue = computed({
|
|
240
240
|
get() {
|
|
@@ -245,7 +245,7 @@ const localValue = computed({
|
|
|
245
245
|
},
|
|
246
246
|
});
|
|
247
247
|
|
|
248
|
-
defineExpose({
|
|
248
|
+
defineExpose({ textareaRef });
|
|
249
249
|
|
|
250
250
|
onMounted(() => toggleReadonly(true));
|
|
251
251
|
|
|
@@ -292,13 +292,13 @@ function toggleReadonly(hasReadonly) {
|
|
|
292
292
|
function setLabelPosition() {
|
|
293
293
|
if (props.labelAlign === "top" || !hasSlotContent(slots["left"])) return;
|
|
294
294
|
|
|
295
|
-
const leftSlotWidth =
|
|
295
|
+
const leftSlotWidth = leftSlotWrapperRef.value.getBoundingClientRect().width;
|
|
296
296
|
|
|
297
|
-
if (
|
|
298
|
-
|
|
297
|
+
if (labelComponentRef.value.labelElement) {
|
|
298
|
+
labelComponentRef.value.labelElement.style.left = `${leftSlotWidth}px`;
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
-
|
|
301
|
+
textareaWrapperRef.value.style.paddingLeft = `${leftSlotWidth}px`;
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
onMounted(() => setLabelPosition());
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.238",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -7916,7 +7916,7 @@
|
|
|
7916
7916
|
"kind": "expression",
|
|
7917
7917
|
"type": "string"
|
|
7918
7918
|
},
|
|
7919
|
-
"default": "
|
|
7919
|
+
"default": "\"\""
|
|
7920
7920
|
},
|
|
7921
7921
|
{
|
|
7922
7922
|
"name": "rows",
|