@mouseless/baked 1.3.4 → 1.3.6
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/module.json
CHANGED
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
<FloatLabel variant="on">
|
|
9
9
|
<InputText
|
|
10
|
-
v-model="
|
|
10
|
+
v-model="input"
|
|
11
11
|
v-bind="$attrs"
|
|
12
12
|
class="min-w-60"
|
|
13
|
+
@update:model-value="onUpdate"
|
|
13
14
|
/>
|
|
14
15
|
<label :for="path">{{ l(label) }}</label>
|
|
15
16
|
</FloatLabel>
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
</template>
|
|
18
19
|
|
|
19
20
|
<script setup>
|
|
21
|
+
import { ref } from "vue";
|
|
20
22
|
import { FloatLabel, InputText, Skeleton } from "primevue";
|
|
21
23
|
import { useContext, useLocalization } from "#imports";
|
|
22
24
|
import { AwaitLoading } from "#components";
|
|
@@ -26,6 +28,11 @@ const { schema } = defineProps({
|
|
|
26
28
|
schema: { type: null, required: true }
|
|
27
29
|
});
|
|
28
30
|
const model = defineModel({ type: null, required: true });
|
|
29
|
-
const { label } = schema;
|
|
31
|
+
const { label, targetProp } = schema;
|
|
30
32
|
const path = context.injectPath();
|
|
33
|
+
const input = ref("");
|
|
34
|
+
function onUpdate(value) {
|
|
35
|
+
input.value = value;
|
|
36
|
+
model.value = value && targetProp ? { [targetProp]: value } : value || void 0;
|
|
37
|
+
}
|
|
31
38
|
</script>
|
|
@@ -13,15 +13,24 @@ import { computed } from "vue";
|
|
|
13
13
|
import { useFormat } from "#imports";
|
|
14
14
|
import { AwaitLoading } from "#components";
|
|
15
15
|
const { truncate } = useFormat();
|
|
16
|
-
const { schema, data } = defineProps({
|
|
16
|
+
const { schema, data: rawData } = defineProps({
|
|
17
17
|
schema: { type: null, required: true },
|
|
18
18
|
data: { type: null, required: true }
|
|
19
19
|
});
|
|
20
|
-
const { maxLength } = schema;
|
|
21
|
-
const
|
|
22
|
-
|
|
20
|
+
const { maxLength, prop } = schema;
|
|
21
|
+
const data = computed(() => {
|
|
22
|
+
if (!rawData) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
if (prop) {
|
|
26
|
+
return rawData[prop];
|
|
27
|
+
}
|
|
28
|
+
return rawData;
|
|
29
|
+
});
|
|
30
|
+
const lengthIsExceeded = computed(() => maxLength && data.value.length > maxLength);
|
|
31
|
+
const text = computed(() => lengthIsExceeded.value ? truncate(data.value, maxLength) : data.value);
|
|
23
32
|
const tooltip = computed(() => ({
|
|
24
|
-
value: `${data}`,
|
|
33
|
+
value: `${data.value}`,
|
|
25
34
|
disabled: !lengthIsExceeded.value,
|
|
26
35
|
pt: {
|
|
27
36
|
root: {
|