@nexxtmove/ui 1.5.0 → 1.7.0
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/index.js +692 -678
- package/package.json +1 -1
- package/src/components/Card/Card.vue +1 -3
- package/src/components/ColorPicker/ColorPicker.vue +1 -1
- package/src/components/CountrySelect/CountrySelect.vue +1 -1
- package/src/components/InputField/InputField.vue +22 -4
- package/src/components/InputSelect/InputSelect.vue +22 -5
- package/src/components/PropertyListing/PropertyListing.vue +4 -7
- package/src/components/Select/Select.vue +1 -1
- package/src/components/ToggleGroup/ToggleGroup.vue +1 -1
package/package.json
CHANGED
|
@@ -8,9 +8,7 @@ defineProps<Props>()
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<template>
|
|
11
|
-
<div
|
|
12
|
-
class="card bg-color-white inline-flex w-80 flex-col items-start justify-start gap-0 rounded-t-lg"
|
|
13
|
-
>
|
|
11
|
+
<div class="card inline-flex w-80 flex-col items-start justify-start gap-0 rounded-t-lg">
|
|
14
12
|
<slot name="image" v-if="image || $slots.image">
|
|
15
13
|
<img
|
|
16
14
|
v-if="image"
|
|
@@ -113,7 +113,7 @@ watch(
|
|
|
113
113
|
|
|
114
114
|
<template>
|
|
115
115
|
<div class="inline-flex flex-col gap-1" :class="{ 'w-full': fullWidth }">
|
|
116
|
-
<label v-if="label" :for="PICKER_ID" class="
|
|
116
|
+
<label v-if="label" :for="PICKER_ID" class="justify-start small-normal text-gray-700">
|
|
117
117
|
{{ label }}
|
|
118
118
|
<span v-if="required" class="text-brick-500">*</span>
|
|
119
119
|
</label>
|
|
@@ -72,7 +72,7 @@ const onOpen = async () => {
|
|
|
72
72
|
|
|
73
73
|
<template>
|
|
74
74
|
<div class="inline-flex flex-col gap-1">
|
|
75
|
-
<label v-if="label" class="
|
|
75
|
+
<label v-if="label" class="justify-start small-normal text-gray-700" :for="selectId">
|
|
76
76
|
{{ label }}
|
|
77
77
|
<span v-if="required" class="text-brick-500">*</span>
|
|
78
78
|
</label>
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, getCurrentInstance, useTemplateRef } from 'vue'
|
|
2
|
+
import { computed, getCurrentInstance, useAttrs, useTemplateRef } from 'vue'
|
|
3
3
|
import Icon from '../Icon/Icon.vue'
|
|
4
4
|
|
|
5
5
|
const INPUT_ID = 'input-field-' + Math.random().toString(36).slice(2, 10)
|
|
6
6
|
|
|
7
|
+
const attrs = useAttrs()
|
|
8
|
+
|
|
9
|
+
// `class` and `style` describe where the field sits in the consumer's layout,
|
|
10
|
+
// so they belong on the outer wrapper. Everything else -- id, name, type,
|
|
11
|
+
// placeholder, data-* , aria-* -- describes the control, so it goes to the
|
|
12
|
+
// input. Nothing lands on both any more.
|
|
13
|
+
const inputAttrs = computed(() => {
|
|
14
|
+
const rest: Record<string, unknown> = { ...attrs }
|
|
15
|
+
delete rest.class
|
|
16
|
+
delete rest.style
|
|
17
|
+
return rest
|
|
18
|
+
})
|
|
19
|
+
|
|
7
20
|
defineOptions({
|
|
8
21
|
name: 'NexxtInputField',
|
|
22
|
+
// Attributes used to land twice: Vue applied them to the root *and* the
|
|
23
|
+
// explicit v-bind put them on the input. `id` was therefore duplicated across
|
|
24
|
+
// two elements, and a consumer's layout class ended up on an input that
|
|
25
|
+
// already carries `w-full` itself. Routing is now explicit: see the template.
|
|
26
|
+
inheritAttrs: false,
|
|
9
27
|
})
|
|
10
28
|
|
|
11
29
|
export interface NexxtInputFieldProps {
|
|
@@ -50,8 +68,8 @@ const decrement = () => {
|
|
|
50
68
|
</script>
|
|
51
69
|
|
|
52
70
|
<template>
|
|
53
|
-
<div class="inline-flex flex-col gap-1">
|
|
54
|
-
<label v-if="label" class="
|
|
71
|
+
<div class="inline-flex flex-col gap-1" :class="attrs.class" :style="attrs.style">
|
|
72
|
+
<label v-if="label" class="justify-start small-normal text-gray-700" :for="INPUT_ID">
|
|
55
73
|
{{ label }}
|
|
56
74
|
<span v-if="required" class="text-brick-500">*</span>
|
|
57
75
|
</label>
|
|
@@ -69,7 +87,7 @@ const decrement = () => {
|
|
|
69
87
|
:id="INPUT_ID"
|
|
70
88
|
v-model="modelValue"
|
|
71
89
|
:placeholder="placeholder"
|
|
72
|
-
v-bind="
|
|
90
|
+
v-bind="inputAttrs"
|
|
73
91
|
class="bg-transparant h-10 w-full min-w-60 text-sm text-gray-900 placeholder-gray-400 focus:outline-none [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"
|
|
74
92
|
:class="{ 'pl-3': !leftIcon, 'pr-3': !rightIcon }"
|
|
75
93
|
/>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue'
|
|
2
|
+
import { computed, useAttrs } from 'vue'
|
|
3
3
|
import NexxtIcon from '../Icon/Icon.vue'
|
|
4
4
|
import NexxtFloatingPanel from '../FloatingPanel/FloatingPanel.vue'
|
|
5
5
|
import type Icon from '../Icon/Icon.vue'
|
|
@@ -11,7 +11,24 @@ const generateId = () => 'input-select-' + Math.random().toString(36).slice(2, 1
|
|
|
11
11
|
const fieldId = generateId()
|
|
12
12
|
const selectId = generateId()
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const attrs = useAttrs()
|
|
15
|
+
|
|
16
|
+
// `class` and `style` position the field in the consumer's layout and belong on
|
|
17
|
+
// the wrapper; everything else describes the control and goes to the input.
|
|
18
|
+
const inputAttrs = computed(() => {
|
|
19
|
+
const rest: Record<string, unknown> = { ...attrs }
|
|
20
|
+
delete rest.class
|
|
21
|
+
delete rest.style
|
|
22
|
+
return rest
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
defineOptions({
|
|
26
|
+
name: 'NexxtInputSelect',
|
|
27
|
+
// Same routing as NexxtInputField: attributes used to land on the root and
|
|
28
|
+
// the input at once, duplicating `id` and putting layout classes on a control
|
|
29
|
+
// that is already full-width. See the template.
|
|
30
|
+
inheritAttrs: false,
|
|
31
|
+
})
|
|
15
32
|
|
|
16
33
|
export interface NexxtInputSelectProps {
|
|
17
34
|
options: SelectOption[]
|
|
@@ -49,8 +66,8 @@ const select = (opt: SelectOption, close: () => void) => {
|
|
|
49
66
|
</script>
|
|
50
67
|
|
|
51
68
|
<template>
|
|
52
|
-
<div class="inline-flex flex-col gap-1">
|
|
53
|
-
<label v-if="label" class="
|
|
69
|
+
<div class="inline-flex flex-col gap-1" :class="attrs.class" :style="attrs.style">
|
|
70
|
+
<label v-if="label" class="justify-start small-normal text-gray-700" :for="fieldId">
|
|
54
71
|
{{ label }}
|
|
55
72
|
<span v-if="required" class="text-brick-500">*</span>
|
|
56
73
|
</label>
|
|
@@ -114,7 +131,7 @@ const select = (opt: SelectOption, close: () => void) => {
|
|
|
114
131
|
:id="fieldId"
|
|
115
132
|
v-model="inputModel"
|
|
116
133
|
:placeholder="placeholder"
|
|
117
|
-
v-bind="
|
|
134
|
+
v-bind="inputAttrs"
|
|
118
135
|
class="bg-transparant h-10 w-full min-w-40 px-3 text-sm text-gray-900 placeholder-gray-400 focus:outline-none"
|
|
119
136
|
/>
|
|
120
137
|
</div>
|
|
@@ -11,19 +11,16 @@ defineProps<Props>()
|
|
|
11
11
|
<template>
|
|
12
12
|
<div class="flex flex-col items-start justify-start gap-2 self-stretch overflow-hidden">
|
|
13
13
|
<div class="inline-flex w-full items-center gap-2 overflow-hidden">
|
|
14
|
-
<div v-if="price" class="
|
|
14
|
+
<div v-if="price" class="shrink-0 body-semibold text-gray-950">
|
|
15
15
|
€ {{ price.toLocaleString('nl-NL') }}
|
|
16
16
|
</div>
|
|
17
|
-
<div v-if="price" class="
|
|
18
|
-
<div
|
|
19
|
-
class="text-color-gray-950 min-w-0 truncate"
|
|
20
|
-
:class="price ? 'body-normal' : 'body-semibold'"
|
|
21
|
-
>
|
|
17
|
+
<div v-if="price" class="shrink-0 body-normal text-gray-950">|</div>
|
|
18
|
+
<div class="min-w-0 truncate text-gray-950" :class="price ? 'body-normal' : 'body-semibold'">
|
|
22
19
|
{{ city }}
|
|
23
20
|
</div>
|
|
24
21
|
</div>
|
|
25
22
|
|
|
26
|
-
<div v-if="text" class="
|
|
23
|
+
<div v-if="text" class="wrap-break-words w-full body-normal text-gray-950">
|
|
27
24
|
{{ text }}
|
|
28
25
|
</div>
|
|
29
26
|
</div>
|
|
@@ -123,7 +123,7 @@ watch(model, () => {
|
|
|
123
123
|
|
|
124
124
|
<template>
|
|
125
125
|
<div class="inline-flex flex-col gap-1">
|
|
126
|
-
<label v-if="label" class="
|
|
126
|
+
<label v-if="label" class="justify-start small-normal text-gray-700" :for="selectId">
|
|
127
127
|
{{ label }}
|
|
128
128
|
<span v-if="required" class="text-brick-500">*</span>
|
|
129
129
|
</label>
|
|
@@ -70,7 +70,7 @@ onMounted(async () => {
|
|
|
70
70
|
|
|
71
71
|
<template>
|
|
72
72
|
<div class="flex flex-col gap-1">
|
|
73
|
-
<label v-if="label" class="
|
|
73
|
+
<label v-if="label" class="justify-start small-normal text-gray-700">
|
|
74
74
|
{{ label }}
|
|
75
75
|
</label>
|
|
76
76
|
<div
|