@stubber/form-fields 1.0.10 → 1.0.11
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/fields/components/Contactselector.svelte +1 -1
- package/dist/fields/components/Currency.svelte +7 -6
- package/dist/fields/components/Dataindication.svelte +3 -10
- package/dist/fields/components/Date.svelte +4 -3
- package/dist/fields/components/Datetime.svelte +4 -3
- package/dist/fields/components/Email.svelte +1 -3
- package/dist/fields/components/Note.svelte +1 -3
- package/dist/fields/components/Number.svelte +1 -1
- package/dist/fields/components/Qrcodescanner.svelte +6 -6
- package/dist/fields/components/Select.svelte +1 -1
- package/dist/fields/components/Selectresource.svelte +1 -1
- package/dist/fields/components/SmartText.svelte +2 -10
- package/dist/fields/components/Telephone.svelte +4 -6
- package/dist/fields/components/Text.svelte +1 -3
- package/package.json +1 -1
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
flex h-7 w-full items-center justify-between rounded px-3 py-2
|
|
280
280
|
text-sm focus:outline-none
|
|
281
281
|
[&>span]:line-clamp-1 aria-[invalid]:border-destructive
|
|
282
|
-
placeholder:text-
|
|
282
|
+
placeholder:text-muted-foreground
|
|
283
283
|
{!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-transparent'}"
|
|
284
284
|
bind:value={filter_text}
|
|
285
285
|
autocomplete="off"
|
|
@@ -183,12 +183,13 @@
|
|
|
183
183
|
{label}
|
|
184
184
|
</Label>
|
|
185
185
|
<div
|
|
186
|
-
class="
|
|
187
|
-
? 'ring-danger-500'
|
|
188
|
-
: 'ring-surface-300
|
|
186
|
+
class="w-full flex items-center gap-2 border-input bg-white bg-opacity-[15] ring-offset-background placeholder:text-muted-foreground focus-within:ring-ring h-10 rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 {!isValid
|
|
187
|
+
? 'focus-within:ring-danger-500'
|
|
188
|
+
: 'ring-surface-300'}"
|
|
189
|
+
style="box-shadow: inset 0px 16px 16px -16px rgba(0, 0, 0, 0.1333);"
|
|
189
190
|
>
|
|
190
|
-
<div class="pointer-events-none flex items-center pl-
|
|
191
|
-
<span class="text-
|
|
191
|
+
<div class="pointer-events-none flex items-center pl-2">
|
|
192
|
+
<span class="text-sm text-surface-600">
|
|
192
193
|
{getSymbolFromCurrency($internal?.currencycode)}
|
|
193
194
|
</span>
|
|
194
195
|
</div>
|
|
@@ -198,10 +199,10 @@
|
|
|
198
199
|
e.preventDefault();
|
|
199
200
|
}
|
|
200
201
|
}}
|
|
202
|
+
class="w-full focus-within:outline-none"
|
|
201
203
|
use:inputRegexMask={currencyRegex}
|
|
202
204
|
id="input_{state_key}"
|
|
203
205
|
placeholder={label}
|
|
204
|
-
class="bg-transparent w-full focus:outline-none text-surface-900 placeholder:text-surface-400 ml-2"
|
|
205
206
|
name={state_key}
|
|
206
207
|
inputmode="decimal"
|
|
207
208
|
bind:value={$internal.raw}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import _ from "lodash-es";
|
|
3
3
|
|
|
4
4
|
import { Label } from "@stubber/ui/label";
|
|
5
|
+
import { Input } from "@stubber/ui/input";
|
|
5
6
|
|
|
6
7
|
export let field;
|
|
7
8
|
|
|
@@ -18,16 +19,8 @@
|
|
|
18
19
|
<Label for="input_{state_key}" class="block {hide_label ? 'hidden' : ''}">
|
|
19
20
|
{label}
|
|
20
21
|
</Label>
|
|
21
|
-
<div class="relative mt-2 rounded-md">
|
|
22
|
-
<
|
|
23
|
-
class="bg-gradient-to-b from-[#2727271F] to-[#27272719] shadow-select flex items-center h-7 w-full rounded px-3 py-2 text-sm focus:outline-none placeholder:text-black"
|
|
24
|
-
>
|
|
25
|
-
{#if value_is_string}
|
|
26
|
-
{value}
|
|
27
|
-
{:else}
|
|
28
|
-
<pre>{value}</pre>
|
|
29
|
-
{/if}
|
|
30
|
-
</div>
|
|
22
|
+
<div class="relative mt-2 rounded-md bg-surface-100 p-2">
|
|
23
|
+
<pre class="rounded-md">{value}</pre>
|
|
31
24
|
</div>
|
|
32
25
|
|
|
33
26
|
{#if validationMessage}
|
|
@@ -80,9 +80,10 @@
|
|
|
80
80
|
type="date"
|
|
81
81
|
id="input_{state_key}"
|
|
82
82
|
placeholder={label}
|
|
83
|
-
class="
|
|
84
|
-
|
|
85
|
-
{
|
|
83
|
+
class="block w-full border-input bg-white bg-opacity-[15] ring-0 ring-offset-background focus-visible:ring-ring h-10 rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50
|
|
84
|
+
{!isValid ? 'ring-danger-500' : 'ring-surface-300'}
|
|
85
|
+
{$internal?.raw ? 'text-surface-900' : 'text-muted-foreground'}"
|
|
86
|
+
style="box-shadow: inset 0px 16px 16px -16px rgba(0, 0, 0, 0.1333);"
|
|
86
87
|
name={state_key}
|
|
87
88
|
bind:value={$internal.raw}
|
|
88
89
|
/>
|
|
@@ -80,9 +80,10 @@
|
|
|
80
80
|
type="datetime-local"
|
|
81
81
|
id="input_{state_key}"
|
|
82
82
|
placeholder={label}
|
|
83
|
-
class="
|
|
84
|
-
|
|
85
|
-
{
|
|
83
|
+
class="block w-full border-input bg-white bg-opacity-[15] ring-0 ring-offset-background focus-visible:ring-ring h-10 rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50
|
|
84
|
+
{!isValid ? 'ring-danger-500' : 'ring-surface-300'}
|
|
85
|
+
{$internal?.raw ? 'text-surface-900' : 'text-muted-foreground'}"
|
|
86
|
+
style="box-shadow: inset 0px 16px 16px -16px rgba(0, 0, 0, 0.1333);"
|
|
86
87
|
name={state_key}
|
|
87
88
|
bind:value={$internal.raw}
|
|
88
89
|
/>
|
|
@@ -111,9 +111,7 @@
|
|
|
111
111
|
type="text"
|
|
112
112
|
id="input_{state_key}"
|
|
113
113
|
placeholder={label}
|
|
114
|
-
class="block w-full
|
|
115
|
-
? 'ring-danger-500'
|
|
116
|
-
: 'ring-surface-300 focus:ring-primary-400'} focus:outline-none placeholder:text-surface-400 focus:ring-2 focus:ring-inset"
|
|
114
|
+
class="block w-full {!isValid ? 'ring-danger-500' : 'ring-surface-300'}"
|
|
117
115
|
name={state_key}
|
|
118
116
|
bind:value={$internal.raw}
|
|
119
117
|
/>
|
|
@@ -80,9 +80,7 @@
|
|
|
80
80
|
rows="3"
|
|
81
81
|
id="input_{state_key}"
|
|
82
82
|
placeholder={label}
|
|
83
|
-
class="block w-full
|
|
84
|
-
? 'ring-danger-500'
|
|
85
|
-
: 'ring-surface-300 '} "
|
|
83
|
+
class="block w-full {!isValid ? 'ring-danger-500' : 'ring-surface-300 '} "
|
|
86
84
|
name={state_key}
|
|
87
85
|
bind:value={$internal.raw}
|
|
88
86
|
/>
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
type="number"
|
|
103
103
|
id="input_{state_key}"
|
|
104
104
|
placeholder={label}
|
|
105
|
-
class="block w-full
|
|
105
|
+
class="block w-full {!isValid
|
|
106
106
|
? 'ring-danger-500'
|
|
107
107
|
: 'ring-surface-300 focus:ring-primary-400'} "
|
|
108
108
|
name={state_key}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { fade } from "svelte/transition";
|
|
8
8
|
import { Html5Qrcode } from "html5-qrcode";
|
|
9
9
|
import { Button } from "@stubber/ui/button";
|
|
10
|
-
|
|
10
|
+
import { Input } from "@stubber/ui/input";
|
|
11
11
|
import { Label } from "@stubber/ui/label";
|
|
12
12
|
|
|
13
13
|
export let field;
|
|
@@ -170,20 +170,20 @@
|
|
|
170
170
|
<div class="relative mt-2 rounded-md">
|
|
171
171
|
<div class="flex items-center space-x-3">
|
|
172
172
|
{#if $internal.raw}
|
|
173
|
-
<
|
|
173
|
+
<Input
|
|
174
174
|
readonly
|
|
175
175
|
type="text"
|
|
176
176
|
id="input_{state_key}"
|
|
177
177
|
placeholder={label}
|
|
178
|
-
class="block w-full text-field rounded-md border-0 py-2 pl-3 text-surface-900 ring-1 ring-inset {!isValid
|
|
179
|
-
? 'ring-danger-500'
|
|
180
|
-
: 'ring-surface-300 focus:ring-primary-400'} focus:outline-none placeholder:text-surface-400 focus:ring-2 focus:ring-inset"
|
|
181
178
|
name={state_key}
|
|
182
179
|
value={$internal.raw}
|
|
183
180
|
/>
|
|
184
181
|
{/if}
|
|
185
182
|
<div class="shrink-0">
|
|
186
|
-
<Button
|
|
183
|
+
<Button on:click={openScannerModal}>
|
|
184
|
+
<i class="fa-solid fa-qrcode" />
|
|
185
|
+
Scan Code
|
|
186
|
+
</Button>
|
|
187
187
|
</div>
|
|
188
188
|
</div>
|
|
189
189
|
</div>
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
flex h-7 w-full items-center justify-between rounded px-3 py-2
|
|
191
191
|
text-sm focus:outline-none
|
|
192
192
|
[&>span]:line-clamp-1 aria-[invalid]:border-destructive
|
|
193
|
-
placeholder:text-
|
|
193
|
+
placeholder:text-muted-foreground
|
|
194
194
|
{!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-transparent'}"
|
|
195
195
|
name={state_key}
|
|
196
196
|
bind:value={filter_text}
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
flex h-7 w-full items-center justify-between rounded px-3 py-2
|
|
237
237
|
text-sm focus:outline-none
|
|
238
238
|
[&>span]:line-clamp-1 aria-[invalid]:border-destructive
|
|
239
|
-
placeholder:text-
|
|
239
|
+
placeholder:text-muted-foreground
|
|
240
240
|
{!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-transparent'}"
|
|
241
241
|
bind:value={filter_text}
|
|
242
242
|
autocomplete="off"
|
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
.stubber-cm :global(.cm-editor.cm-focused) {
|
|
291
291
|
outline: none;
|
|
292
292
|
border-width: 1px;
|
|
293
|
-
border-color: var(--
|
|
293
|
+
border-color: hsl(var(--input) / var(--tw-border-opacity, 1));
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
.stubber-cm.stubber-valid :global(.cm-editor.cm-focused) {
|
|
@@ -318,18 +318,10 @@
|
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
.stubber-cm :global(.cm-editor .cm-placeholder) {
|
|
321
|
-
color: var(--muted-foreground
|
|
321
|
+
color: hsl(var(--muted-foreground) / var(--tw-text-opacity, 1));
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
.stubber-cm :global(.curly-braces-highlight) {
|
|
325
325
|
color: rgb(9 103 210);
|
|
326
326
|
}
|
|
327
|
-
|
|
328
|
-
/* CSS Custom Properties */
|
|
329
|
-
:root {
|
|
330
|
-
--ring: rgb(98, 98, 98);
|
|
331
|
-
--muted-foreground: rgb(165 169 173);
|
|
332
|
-
--input: 214.3 31.8% 91.4%;
|
|
333
|
-
--border: 214.3 31.8% 91.4%;
|
|
334
|
-
}
|
|
335
327
|
</style>
|
|
@@ -141,12 +141,10 @@
|
|
|
141
141
|
bind:value={$internal.raw}
|
|
142
142
|
type="tel"
|
|
143
143
|
id="input_{state_key}"
|
|
144
|
-
class="
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
placeholder:text-black
|
|
149
|
-
{!isValid ? 'ring-danger-500' : 'ring-surface-300 focus:ring-primary-400'}"
|
|
144
|
+
class="w-full pl-12 border-input bg-white bg-opacity-[15] ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring h-10 rounded-md border py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 {!isValid
|
|
145
|
+
? 'ring-danger-500'
|
|
146
|
+
: 'ring-surface-300'}"
|
|
147
|
+
style="box-shadow: inset 0px 16px 16px -16px rgba(0, 0, 0, 0.1333);"
|
|
150
148
|
/>
|
|
151
149
|
</div>
|
|
152
150
|
{#if validationMessage}
|
|
@@ -93,9 +93,7 @@
|
|
|
93
93
|
type="text"
|
|
94
94
|
id="input_{state_key}"
|
|
95
95
|
placeholder={label}
|
|
96
|
-
class="block w-full
|
|
97
|
-
? 'ring-danger-500'
|
|
98
|
-
: 'ring-surface-300 '} "
|
|
96
|
+
class="block w-full {!isValid ? 'ring-danger-500' : 'ring-surface-300 '}"
|
|
99
97
|
name={state_key}
|
|
100
98
|
bind:value={$internal.raw}
|
|
101
99
|
/>
|