srcdev-nuxt-forms 2.1.1 → 2.1.2
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/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## NOTE: This is personal forms setup and not necessarily intended for widespread use
|
|
4
4
|
|
|
5
|
+
## Layer extended into barebones project
|
|
6
|
+
|
|
7
|
+
Checkout the repo [SRCDEV Nuxt Forms being extended as layer into another Nuxt project](https://github.com/srcdev/nuxt-extend-nuxt-forms)
|
|
8
|
+
|
|
5
9
|
## Setup
|
|
6
10
|
|
|
7
11
|
Make sure to install the dependencies:
|
|
@@ -23,14 +27,14 @@ npm run release
|
|
|
23
27
|
## Install Nuxt Forms
|
|
24
28
|
|
|
25
29
|
```bash
|
|
26
|
-
npm install --save
|
|
30
|
+
npm install --save srcdev-nuxt-forms
|
|
27
31
|
```
|
|
28
32
|
|
|
29
33
|
Then add the dependency to their `extends` in `nuxt.config`:
|
|
30
34
|
|
|
31
35
|
```ts
|
|
32
36
|
defineNuxtConfig({
|
|
33
|
-
extends: '
|
|
37
|
+
extends: 'srcdev-nuxt-forms',
|
|
34
38
|
});
|
|
35
39
|
```
|
|
36
40
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<InputButtonCore
|
|
11
11
|
type="button"
|
|
12
12
|
@click.stop.prevent="updateValue(-step, Number(modelValue) > min)"
|
|
13
|
-
:readonly="Number(modelValue)
|
|
13
|
+
:readonly="Number(modelValue) <= min"
|
|
14
14
|
:is-pending="false"
|
|
15
15
|
buttonText="Step down"
|
|
16
16
|
theme="primary"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<InputButtonCore
|
|
26
26
|
type="button"
|
|
27
27
|
@click.stop.prevent="updateValue(step, Number(modelValue) < max)"
|
|
28
|
-
:readonly="Number(modelValue)
|
|
28
|
+
:readonly="Number(modelValue) >= max"
|
|
29
29
|
:is-pending="false"
|
|
30
30
|
buttonText="Step up"
|
|
31
31
|
theme="primary"
|
|
@@ -153,12 +153,20 @@ onMounted(() => {
|
|
|
153
153
|
box-shadow: var(--theme-form-focus-box-shadow);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
.
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
&:not(:has(.btn)) {
|
|
157
|
+
.slot {
|
|
158
|
+
display: inline-block;
|
|
159
|
+
padding-inline: 8px;
|
|
160
|
+
|
|
161
|
+
.icon {
|
|
162
|
+
color: var(--theme-form-input-text);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
159
166
|
|
|
160
|
-
|
|
161
|
-
|
|
167
|
+
&:has(.btn) {
|
|
168
|
+
.btn {
|
|
169
|
+
margin-inline: 6px;
|
|
162
170
|
}
|
|
163
171
|
}
|
|
164
172
|
|
|
@@ -23,14 +23,30 @@
|
|
|
23
23
|
inputmode="numeric"
|
|
24
24
|
>
|
|
25
25
|
<template v-if="hasLeftSlot" #left>
|
|
26
|
-
<InputButtonCore
|
|
26
|
+
<InputButtonCore
|
|
27
|
+
type="button"
|
|
28
|
+
@click.stop.prevent="updateValue(-step, Number(modelValue) > min)"
|
|
29
|
+
:readonly="Number(modelValue) <= min"
|
|
30
|
+
:is-pending="false"
|
|
31
|
+
buttonText="Step down"
|
|
32
|
+
theme="ghost"
|
|
33
|
+
size="x-small"
|
|
34
|
+
>
|
|
27
35
|
<template #iconOnly>
|
|
28
36
|
<slot name="left"></slot>
|
|
29
37
|
</template>
|
|
30
38
|
</InputButtonCore>
|
|
31
39
|
</template>
|
|
32
40
|
<template v-if="hasRightSlot" #right>
|
|
33
|
-
<InputButtonCore
|
|
41
|
+
<InputButtonCore
|
|
42
|
+
type="button"
|
|
43
|
+
@click.stop.prevent="updateValue(step, Number(modelValue) < max)"
|
|
44
|
+
:readonly="Number(modelValue) >= max"
|
|
45
|
+
:is-pending="false"
|
|
46
|
+
buttonText="Step up"
|
|
47
|
+
theme="ghost"
|
|
48
|
+
size="x-small"
|
|
49
|
+
>
|
|
34
50
|
<template #iconOnly>
|
|
35
51
|
<slot name="right"></slot>
|
|
36
52
|
</template>
|
package/package.json
CHANGED