@marianmeres/stuic 1.59.0 → 1.61.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.
|
@@ -61,12 +61,18 @@ const _PRESET_BY_SIZE = {
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
export class FieldConfig {
|
|
64
|
+
//
|
|
64
65
|
static class = _emptyClasses();
|
|
65
66
|
static classBySize = {
|
|
66
67
|
sm: _emptyClasses(),
|
|
67
68
|
md: _emptyClasses(),
|
|
68
69
|
lg: _emptyClasses()
|
|
69
70
|
};
|
|
71
|
+
static labelLeft = false;
|
|
72
|
+
static labelLeftWidth = "normal";
|
|
73
|
+
//
|
|
74
|
+
static _preset = _PRESET;
|
|
75
|
+
static _presetBySize = _PRESET_BY_SIZE;
|
|
70
76
|
}
|
|
71
77
|
</script>
|
|
72
78
|
|
|
@@ -98,8 +104,8 @@ export let pattern = void 0;
|
|
|
98
104
|
export let step = void 0;
|
|
99
105
|
export let useTrim = true;
|
|
100
106
|
export let textareaAutoEnlarge = true;
|
|
101
|
-
export let labelLeft =
|
|
102
|
-
export let labelLeftWidth =
|
|
107
|
+
export let labelLeft = FieldConfig.labelLeft;
|
|
108
|
+
export let labelLeftWidth = FieldConfig.labelLeftWidth;
|
|
103
109
|
export let validate = void 0;
|
|
104
110
|
export let showAsterixOnRequired = true;
|
|
105
111
|
let validation;
|
|
@@ -177,7 +183,7 @@ $:
|
|
|
177
183
|
class:cursor-not-allowed={disabled}
|
|
178
184
|
class:opacity-50={disabled}
|
|
179
185
|
>
|
|
180
|
-
<div class="flex
|
|
186
|
+
<div class="flex">
|
|
181
187
|
<slot name="input_before" {id} />
|
|
182
188
|
{#if type === 'textarea'}
|
|
183
189
|
<textarea
|
|
@@ -19,6 +19,10 @@ export interface FieldConfigClassesBySize {
|
|
|
19
19
|
export declare class FieldConfig {
|
|
20
20
|
static class: FieldConfigClasses;
|
|
21
21
|
static classBySize: FieldConfigClassesBySize;
|
|
22
|
+
static labelLeft: boolean;
|
|
23
|
+
static labelLeftWidth: 'normal' | 'wide';
|
|
24
|
+
static readonly _preset: FieldConfigClasses;
|
|
25
|
+
static readonly _presetBySize: FieldConfigClassesBySize;
|
|
22
26
|
}
|
|
23
27
|
declare const __propDef: {
|
|
24
28
|
props: {
|
|
@@ -21,7 +21,6 @@ const _PRESET = {
|
|
|
21
21
|
box: "mb-4 grid",
|
|
22
22
|
// gap-4
|
|
23
23
|
wrap: `
|
|
24
|
-
flex items-center
|
|
25
24
|
rounded-md border border-gray-300
|
|
26
25
|
bg-gray-100
|
|
27
26
|
focus-within:border-stuic-primary
|
|
@@ -58,12 +57,18 @@ const _PRESET_BY_SIZE = {
|
|
|
58
57
|
}
|
|
59
58
|
};
|
|
60
59
|
export class FieldSelectConfig {
|
|
60
|
+
//
|
|
61
61
|
static class = _emptyClasses();
|
|
62
62
|
static classBySize = {
|
|
63
63
|
sm: _emptyClasses(),
|
|
64
64
|
md: _emptyClasses(),
|
|
65
65
|
lg: _emptyClasses()
|
|
66
66
|
};
|
|
67
|
+
static labelLeft = false;
|
|
68
|
+
static labelLeftWidth = "normal";
|
|
69
|
+
//
|
|
70
|
+
static _preset = _PRESET;
|
|
71
|
+
static _presetBySize = _PRESET_BY_SIZE;
|
|
67
72
|
}
|
|
68
73
|
</script>
|
|
69
74
|
|
|
@@ -84,8 +89,8 @@ export let required = false;
|
|
|
84
89
|
export let autofocus = void 0;
|
|
85
90
|
export let validate = void 0;
|
|
86
91
|
export let showAsterixOnRequired = true;
|
|
87
|
-
export let labelLeft =
|
|
88
|
-
export let labelLeftWidth =
|
|
92
|
+
export let labelLeft = FieldSelectConfig.labelLeft;
|
|
93
|
+
export let labelLeftWidth = FieldSelectConfig.labelLeftWidth;
|
|
89
94
|
let validation;
|
|
90
95
|
const setValidationResult = (res) => validation = res;
|
|
91
96
|
let _options = [];
|
|
@@ -169,27 +174,29 @@ $:
|
|
|
169
174
|
class:cursor-not-allowed={disabled}
|
|
170
175
|
class:opacity-50={disabled}
|
|
171
176
|
>
|
|
172
|
-
<
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
177
|
+
<div class="flex">
|
|
178
|
+
<slot name="input_before" {id} />
|
|
179
|
+
<select
|
|
180
|
+
class={_inputClass}
|
|
181
|
+
bind:value
|
|
182
|
+
bind:this={_inputEl}
|
|
183
|
+
{id}
|
|
184
|
+
{disabled}
|
|
185
|
+
{required}
|
|
186
|
+
{tabindex}
|
|
187
|
+
{autofocus}
|
|
188
|
+
{name}
|
|
189
|
+
use:validateAction={validate
|
|
190
|
+
? { ...(validate === true ? {} : validate), setValidationResult }
|
|
191
|
+
: undefined}
|
|
192
|
+
>
|
|
193
|
+
{#each _options as o, i}
|
|
194
|
+
<option value={o.value}>{o.label}</option>
|
|
195
|
+
{/each}
|
|
196
|
+
</select>
|
|
191
197
|
|
|
192
|
-
|
|
198
|
+
<slot name="input_after" {id} />
|
|
199
|
+
</div>
|
|
193
200
|
</div>
|
|
194
201
|
{#if validation && !validation?.valid}
|
|
195
202
|
<div transition:slide={{ duration: 150 }} class={_validationMessageClass}>
|
|
@@ -19,6 +19,10 @@ export interface FieldSelectConfigClassesBySize {
|
|
|
19
19
|
export declare class FieldSelectConfig {
|
|
20
20
|
static class: FieldSelectConfigClasses;
|
|
21
21
|
static classBySize: FieldSelectConfigClassesBySize;
|
|
22
|
+
static labelLeft: boolean;
|
|
23
|
+
static labelLeftWidth: 'normal' | 'wide';
|
|
24
|
+
static readonly _preset: FieldSelectConfigClasses;
|
|
25
|
+
static readonly _presetBySize: FieldSelectConfigClassesBySize;
|
|
22
26
|
}
|
|
23
27
|
declare const __propDef: {
|
|
24
28
|
props: {
|