vueless 0.0.332 → 0.0.333
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.
|
@@ -10,7 +10,7 @@ export function useMutationObserver(
|
|
|
10
10
|
onMounted(() => {
|
|
11
11
|
if (!toValue(target)) return;
|
|
12
12
|
|
|
13
|
-
if (Array.isArray) {
|
|
13
|
+
if (Array.isArray(toValue(target))) {
|
|
14
14
|
toValue(target).forEach((element) => {
|
|
15
15
|
observer.observe(element, config);
|
|
16
16
|
});
|
|
@@ -22,7 +22,7 @@ export function useMutationObserver(
|
|
|
22
22
|
watch(
|
|
23
23
|
() => toValue(target),
|
|
24
24
|
() => {
|
|
25
|
-
if (Array.isArray) {
|
|
25
|
+
if (Array.isArray(toValue(target))) {
|
|
26
26
|
toValue(target).forEach((element) => {
|
|
27
27
|
observer.observe(element, config);
|
|
28
28
|
});
|
package/package.json
CHANGED
package/ui.form-input/UInput.vue
CHANGED
|
@@ -115,6 +115,8 @@ const VALIDATION_RULES_REG_EX = {
|
|
|
115
115
|
<script setup>
|
|
116
116
|
import { ref, computed, onMounted, useSlots } from "vue";
|
|
117
117
|
|
|
118
|
+
import { useMutationObserver } from "../composables/useMutationObserver.js";
|
|
119
|
+
|
|
118
120
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
119
121
|
import ULabel from "../ui.form-label/ULabel.vue";
|
|
120
122
|
|
|
@@ -448,6 +450,10 @@ function transformValue(value, exp) {
|
|
|
448
450
|
return matches ? matches.join("") : "";
|
|
449
451
|
}
|
|
450
452
|
|
|
453
|
+
useMutationObserver(leftSlotWrapperRef, (mutations) => {
|
|
454
|
+
mutations.forEach(setLabelPosition);
|
|
455
|
+
});
|
|
456
|
+
|
|
451
457
|
function setLabelPosition() {
|
|
452
458
|
const shouldAlignLabelOnTop =
|
|
453
459
|
!hasSlotContent(slots["left-icon"]) && !hasSlotContent(slots["left"]) && !props.leftIcon;
|
|
@@ -127,7 +127,7 @@ export const leftSlot = DefaultTemplate.bind({});
|
|
|
127
127
|
leftSlot.args = {
|
|
128
128
|
slotTemplate: `
|
|
129
129
|
<template #left>
|
|
130
|
-
<UButton variant="thirdary" filled square label="Filter" class="rounded-r-none h-full" />
|
|
130
|
+
<UButton variant="thirdary" filled square noRing label="Filter" class="rounded-r-none h-full" />
|
|
131
131
|
</template>
|
|
132
132
|
`,
|
|
133
133
|
};
|
|
@@ -136,7 +136,7 @@ export const rightSlot = DefaultTemplate.bind({});
|
|
|
136
136
|
rightSlot.args = {
|
|
137
137
|
slotTemplate: `
|
|
138
138
|
<template #right>
|
|
139
|
-
<UButton variant="thirdary" filled square label="Filter" class="rounded-l-none" />
|
|
139
|
+
<UButton variant="thirdary" filled square noRing label="Filter" class="rounded-l-none" />
|
|
140
140
|
</template>
|
|
141
141
|
`,
|
|
142
142
|
};
|