@soleil-se/config-svelte 1.23.0 → 1.24.1
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/CHANGELOG.md +8 -0
- package/components/Checkbox/Component.svelte +9 -5
- package/components/CheckboxGroup/Component.svelte +4 -1
- package/components/CustomList/Component.svelte +1 -1
- package/components/CustomSelector/Component.svelte +5 -1
- package/components/DropdownSelector/Component.svelte +3 -1
- package/components/ImageSelector/Component.svelte +5 -5
- package/components/InputField/Component.svelte +9 -9
- package/components/ListSelector/Component.svelte +5 -3
- package/components/NodeSelector/Component.svelte +8 -8
- package/components/NumberSpinner/Component.svelte +6 -4
- package/components/RadioGroup/Component.svelte +4 -1
- package/components/RepositoryNodeSelector/Component.svelte +6 -4
- package/components/SelectField/Component.svelte +4 -3
- package/components/TagSelector/Component.svelte +5 -5
- package/components/TextList/Component.svelte +5 -3
- package/createConfigApp/index.js +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,14 @@ All notable changes to this project will be documented in this file.
|
|
|
7
7
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
8
8
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
9
|
|
|
10
|
+
## [1.24.1] - 2024-04-29
|
|
11
|
+
|
|
12
|
+
- Add Svelte 5 as a peer dependency.
|
|
13
|
+
|
|
14
|
+
## [1.24.0] - 2024-04-18
|
|
15
|
+
|
|
16
|
+
- Add label slot for most components.
|
|
17
|
+
|
|
10
18
|
## [1.23.0] - 2024-03-07
|
|
11
19
|
|
|
12
20
|
- List item templating in `CustomList` with [CustomListItemTemplate](/packages/soleil/svelte-config/components/customlist/#list-item-template).
|
|
@@ -32,18 +32,22 @@
|
|
|
32
32
|
|
|
33
33
|
<div class="form-group {className}" class:hidden={!show}>
|
|
34
34
|
<input
|
|
35
|
-
bind:checked={value}
|
|
36
|
-
{name}
|
|
37
35
|
{id}
|
|
38
|
-
{
|
|
36
|
+
{name}
|
|
39
37
|
class="sr-only"
|
|
40
|
-
type="checkbox"
|
|
41
38
|
data-value-type="boolean"
|
|
39
|
+
{disabled}
|
|
40
|
+
type="checkbox"
|
|
41
|
+
bind:checked={value}
|
|
42
42
|
on:change={onChange}
|
|
43
43
|
/>
|
|
44
|
-
<label
|
|
44
|
+
<label class="checkbox-inline" class:disabled for={id}>
|
|
45
|
+
<slot name="label">{label}</slot>
|
|
46
|
+
</label>
|
|
47
|
+
<slot />
|
|
45
48
|
</div>
|
|
46
49
|
|
|
50
|
+
<!-- eslint-disable max-len -->
|
|
47
51
|
<style lang="scss">
|
|
48
52
|
label {
|
|
49
53
|
position: relative;
|
|
@@ -41,7 +41,9 @@
|
|
|
41
41
|
-->
|
|
42
42
|
|
|
43
43
|
<fieldset class="form-group {className}" class:hidden={!show}>
|
|
44
|
-
<legend class:sr-only={legendVisuallyHidden}>
|
|
44
|
+
<legend class:sr-only={legendVisuallyHidden}>
|
|
45
|
+
<slot name="legend">{legend}</slot>
|
|
46
|
+
</legend>
|
|
45
47
|
{#each options as option, index}
|
|
46
48
|
<input
|
|
47
49
|
id={`${id}_${index}`}
|
|
@@ -62,6 +64,7 @@
|
|
|
62
64
|
{option.label || option}
|
|
63
65
|
</label>
|
|
64
66
|
{/each}
|
|
67
|
+
<slot />
|
|
65
68
|
</fieldset>
|
|
66
69
|
|
|
67
70
|
<!-- eslint-disable -->
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
|
|
122
122
|
<div class="form-group" class:hidden={!show}>
|
|
123
123
|
<label class="control-label {required ? 'control-label--required' : ''}" for={domId}>
|
|
124
|
-
{label}
|
|
124
|
+
<slot name="label">{label}</slot>
|
|
125
125
|
</label>
|
|
126
126
|
<div class="list-component">
|
|
127
127
|
<div class="list-component__list-wrapper ui-resizable">
|
|
@@ -79,7 +79,11 @@
|
|
|
79
79
|
</span>
|
|
80
80
|
{/each}
|
|
81
81
|
{/if}
|
|
82
|
-
<label class="control-label {required ? 'control-label--required' : ''}" for={id}>
|
|
82
|
+
<label class="control-label {required ? 'control-label--required' : ''}" for={id}>
|
|
83
|
+
<slot name="label">
|
|
84
|
+
{label}
|
|
85
|
+
</slot>
|
|
86
|
+
</label>
|
|
83
87
|
<select
|
|
84
88
|
bind:this={element}
|
|
85
89
|
{id}
|
|
@@ -59,7 +59,9 @@
|
|
|
59
59
|
-->
|
|
60
60
|
|
|
61
61
|
<div class="form-group {className}" class:hidden={!show} {hidden}>
|
|
62
|
-
<label class="control-label {required ? 'control-label--required' : ''}" for={id}>
|
|
62
|
+
<label class="control-label {required ? 'control-label--required' : ''}" for={id}>
|
|
63
|
+
<slot name="label">{label}</slot>
|
|
64
|
+
</label>
|
|
63
65
|
<select
|
|
64
66
|
{id}
|
|
65
67
|
{name}
|
|
@@ -72,18 +72,18 @@
|
|
|
72
72
|
<NodeSelector
|
|
73
73
|
name="{name}Node"
|
|
74
74
|
label={i18n('selectImage')}
|
|
75
|
+
{required}
|
|
75
76
|
type="image"
|
|
76
77
|
bind:value={node}
|
|
77
78
|
on:change={onChange}
|
|
78
|
-
{required}
|
|
79
79
|
/>
|
|
80
80
|
<div class="form-group">
|
|
81
81
|
{#if !hideDecorative}
|
|
82
82
|
<Checkbox
|
|
83
|
-
class="checkbox-group"
|
|
84
|
-
bind:value={decorative}
|
|
85
83
|
name="{name}Decorative"
|
|
84
|
+
class="checkbox-group"
|
|
86
85
|
label={i18n('imageIsDecorative')}
|
|
86
|
+
bind:value={decorative}
|
|
87
87
|
on:change={onChange}
|
|
88
88
|
/>
|
|
89
89
|
{/if}
|
|
@@ -91,15 +91,15 @@
|
|
|
91
91
|
{#if useCustomAlt}
|
|
92
92
|
<InputField name="{name}Alt" label={i18n('altText')} required bind:value={alt} />
|
|
93
93
|
{:else}
|
|
94
|
-
<InputField label={i18n('altFromCaption')} value={imageArchiveAlt}
|
|
94
|
+
<InputField disabled label={i18n('altFromCaption')} readonly value={imageArchiveAlt}>
|
|
95
95
|
<input bind:this={validationEl} class="sr-only" />
|
|
96
96
|
</InputField>
|
|
97
97
|
{/if}
|
|
98
98
|
|
|
99
99
|
<Checkbox
|
|
100
100
|
class="checkbox-group"
|
|
101
|
-
bind:value={useCustomAlt}
|
|
102
101
|
label={i18n('customAltText')}
|
|
102
|
+
bind:value={useCustomAlt}
|
|
103
103
|
on:change={onUseCustomToggle}
|
|
104
104
|
/>
|
|
105
105
|
{/if}
|
|
@@ -54,35 +54,35 @@
|
|
|
54
54
|
-->
|
|
55
55
|
|
|
56
56
|
<div class="form-group {className}" class:hidden={!show}>
|
|
57
|
-
<label
|
|
58
|
-
{label}
|
|
57
|
+
<label class="control-label {isRequired ? 'control-label--required' : ''}" for={id}>
|
|
58
|
+
<slot name="label">{label}</slot>
|
|
59
59
|
</label>
|
|
60
60
|
{#if isTextarea}
|
|
61
61
|
<textarea
|
|
62
|
-
class="form-control"
|
|
63
|
-
required={isRequired}
|
|
64
62
|
{id}
|
|
65
63
|
{name}
|
|
64
|
+
class="form-control"
|
|
66
65
|
{disabled}
|
|
67
66
|
{readonly}
|
|
68
|
-
{
|
|
67
|
+
required={isRequired}
|
|
69
68
|
{rows}
|
|
69
|
+
{value}
|
|
70
70
|
{...$$restProps}
|
|
71
71
|
on:input={onInput}
|
|
72
72
|
/>
|
|
73
73
|
{:else}
|
|
74
74
|
<input
|
|
75
|
-
class="form-control"
|
|
76
|
-
required={isRequired}
|
|
77
75
|
{id}
|
|
78
76
|
{name}
|
|
79
|
-
|
|
77
|
+
class="form-control"
|
|
80
78
|
{disabled}
|
|
81
79
|
{readonly}
|
|
80
|
+
required={isRequired}
|
|
81
|
+
{type}
|
|
82
82
|
{value}
|
|
83
83
|
{...$$restProps}
|
|
84
|
-
use:action
|
|
85
84
|
on:input={onInput}
|
|
85
|
+
use:action
|
|
86
86
|
/>
|
|
87
87
|
{/if}
|
|
88
88
|
<slot />
|
|
@@ -50,15 +50,17 @@
|
|
|
50
50
|
-->
|
|
51
51
|
|
|
52
52
|
<div class="form-group" class:disabled class:hidden={!show}>
|
|
53
|
-
<label
|
|
53
|
+
<label class="control-label {required ? 'control-label--required' : ''}" for={id}>
|
|
54
|
+
<slot name="label">{label}</slot>
|
|
55
|
+
</label>
|
|
54
56
|
<input
|
|
55
57
|
{id}
|
|
56
58
|
{name}
|
|
57
|
-
type="hidden"
|
|
58
59
|
data-component={component}
|
|
59
|
-
{required}
|
|
60
60
|
data-sortable={sortable || undefined}
|
|
61
61
|
data-types={selectable}
|
|
62
|
+
{required}
|
|
63
|
+
type="hidden"
|
|
62
64
|
value={value.join(',')}
|
|
63
65
|
/>
|
|
64
66
|
{#if disabled}
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
if (type.startsWith('tags')) {
|
|
38
|
-
throw new Error(
|
|
38
|
+
throw new Error("Type 'tags-selector' is not supported, use TagsSelector component.");
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
onMount(() => {
|
|
@@ -63,21 +63,21 @@
|
|
|
63
63
|
-->
|
|
64
64
|
|
|
65
65
|
<div class="form-group {className}" class:hidden={!show}>
|
|
66
|
-
<label
|
|
67
|
-
{label}
|
|
66
|
+
<label class="control-label {isRequired ? 'control-label--required' : ''}" for={id}>
|
|
67
|
+
<slot name="label">{label}</slot>
|
|
68
68
|
</label>
|
|
69
69
|
<input
|
|
70
|
-
class="form-control"
|
|
71
70
|
{id}
|
|
72
71
|
{name}
|
|
72
|
+
class="form-control"
|
|
73
|
+
data-component={component}
|
|
74
|
+
data-removable={removable ? '' : undefined}
|
|
75
|
+
data-types={selectable}
|
|
76
|
+
data-value={value}
|
|
73
77
|
{disabled}
|
|
74
78
|
{readonly}
|
|
75
79
|
required={isRequired}
|
|
76
|
-
data-removable={removable ? '' : undefined}
|
|
77
|
-
data-component={component}
|
|
78
|
-
data-types={selectable}
|
|
79
80
|
value={displayName}
|
|
80
|
-
data-value={value}
|
|
81
81
|
/>
|
|
82
82
|
{#if disabled}
|
|
83
83
|
<div class="disabled-overlay" />
|
|
@@ -49,18 +49,20 @@
|
|
|
49
49
|
-->
|
|
50
50
|
|
|
51
51
|
<div class="form-group {className}" class:hidden={!show}>
|
|
52
|
-
<label
|
|
52
|
+
<label class="control-label" for={id}>
|
|
53
|
+
<slot name="label">{label}</slot>
|
|
54
|
+
</label>
|
|
53
55
|
<input
|
|
54
56
|
{id}
|
|
55
57
|
{name}
|
|
56
|
-
{value}
|
|
57
58
|
class="form-control"
|
|
58
|
-
data-
|
|
59
|
+
data-component="number-spinner"
|
|
59
60
|
data-max={max}
|
|
61
|
+
data-min={min}
|
|
60
62
|
data-step={step}
|
|
61
63
|
{disabled}
|
|
62
64
|
{readonly}
|
|
63
|
-
|
|
65
|
+
{value}
|
|
64
66
|
/>
|
|
65
67
|
{#if disabled}
|
|
66
68
|
<div class="disabled-overlay" />
|
|
@@ -37,7 +37,9 @@
|
|
|
37
37
|
-->
|
|
38
38
|
|
|
39
39
|
<fieldset class="form-group" class:hidden={!show}>
|
|
40
|
-
<legend class:sr-only={legendVisuallyHidden}>
|
|
40
|
+
<legend class:sr-only={legendVisuallyHidden}>
|
|
41
|
+
<slot name="legend">{legend}</slot>
|
|
42
|
+
</legend>
|
|
41
43
|
{#each options as option, index}
|
|
42
44
|
<input
|
|
43
45
|
id={`${id}_${index}`}
|
|
@@ -58,6 +60,7 @@
|
|
|
58
60
|
</label>
|
|
59
61
|
{/each}
|
|
60
62
|
<input {name} type="hidden" {value} />
|
|
63
|
+
<slot />
|
|
61
64
|
</fieldset>
|
|
62
65
|
|
|
63
66
|
<style lang="scss">
|
|
@@ -54,20 +54,22 @@
|
|
|
54
54
|
|
|
55
55
|
<CustomSelector
|
|
56
56
|
{id}
|
|
57
|
-
{label}
|
|
58
57
|
{name}
|
|
59
|
-
{searchable}
|
|
60
|
-
{required}
|
|
61
58
|
{disabled}
|
|
59
|
+
{label}
|
|
62
60
|
{multiple}
|
|
63
|
-
{show}
|
|
64
61
|
{options}
|
|
62
|
+
{required}
|
|
63
|
+
{searchable}
|
|
64
|
+
{show}
|
|
65
65
|
{value}
|
|
66
66
|
on:input
|
|
67
67
|
on:change
|
|
68
68
|
>
|
|
69
|
+
<slot name="label" />
|
|
69
70
|
<slot />
|
|
70
71
|
{#if error}
|
|
72
|
+
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
|
71
73
|
<p class="alert alert-danger">{@html i18n('error')}</p>
|
|
72
74
|
{/if}
|
|
73
75
|
</CustomSelector>
|
|
@@ -27,9 +27,10 @@
|
|
|
27
27
|
[README](https://docs.soleilit.se/03.packages/@soleil&svelte-config/components/SelectField/)
|
|
28
28
|
-->
|
|
29
29
|
<div class="form-group" class:hidden={!show}>
|
|
30
|
-
<label class="control-label {required ? 'control-label--required' : ''}" for={id}>
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
<label class="control-label {required ? 'control-label--required' : ''}" for={id}>
|
|
31
|
+
<slot name="label">{label}</slot>
|
|
32
|
+
</label>
|
|
33
|
+
<select {id} {name} class="form-control" {disabled} {required} bind:value on:change={onChange}>
|
|
33
34
|
{#each options as option}
|
|
34
35
|
<option value={option.value ?? option}>
|
|
35
36
|
{option.label ?? option}
|
|
@@ -52,16 +52,16 @@
|
|
|
52
52
|
-->
|
|
53
53
|
|
|
54
54
|
<div class="form-group {className}" class:hidden={!show}>
|
|
55
|
-
<label
|
|
56
|
-
{label}
|
|
55
|
+
<label class="control-label {isRequired ? 'control-label--required' : ''}" for={id}>
|
|
56
|
+
<slot name="label">{label}</slot>
|
|
57
57
|
</label>
|
|
58
58
|
<input
|
|
59
|
-
class="form-control"
|
|
60
|
-
required={isRequired}
|
|
61
|
-
data-component="tags-selector"
|
|
62
59
|
{id}
|
|
63
60
|
{name}
|
|
61
|
+
class="form-control"
|
|
62
|
+
data-component="tags-selector"
|
|
64
63
|
{disabled}
|
|
64
|
+
required={isRequired}
|
|
65
65
|
{value}
|
|
66
66
|
/>
|
|
67
67
|
{#if disabled}
|
|
@@ -77,7 +77,9 @@
|
|
|
77
77
|
-->
|
|
78
78
|
|
|
79
79
|
<div class="form-group" class:hidden={!show}>
|
|
80
|
-
<label
|
|
80
|
+
<label class="control-label {required ? 'control-label--required' : ''}" for={id}>
|
|
81
|
+
<slot name="label">{label}</slot>
|
|
82
|
+
</label>
|
|
81
83
|
<div class="list-component">
|
|
82
84
|
<div class="list-component__list-wrapper ui-resizable">
|
|
83
85
|
<Sortable {items} on:finalize={onFinalize} let:item>
|
|
@@ -89,7 +91,7 @@
|
|
|
89
91
|
on:enter={() => addButtonElement.focus()}
|
|
90
92
|
/>
|
|
91
93
|
</Sortable>
|
|
92
|
-
<div
|
|
94
|
+
<div class="ui-resizable-handle ui-resizable-s" use:resizer />
|
|
93
95
|
</div>
|
|
94
96
|
<button
|
|
95
97
|
bind:this={addButtonElement}
|
|
@@ -103,7 +105,7 @@
|
|
|
103
105
|
{#if disabled}
|
|
104
106
|
<div class="disabled-overlay" />
|
|
105
107
|
{/if}
|
|
106
|
-
<DataHolder {id} {name} {
|
|
108
|
+
<DataHolder {id} {name} {required} {value} />
|
|
107
109
|
</div>
|
|
108
110
|
|
|
109
111
|
<style lang="scss">
|
package/createConfigApp/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soleil-se/config-svelte",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.1",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"module": "./index.js",
|
|
6
6
|
"svelte": "./index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"sideEffects": false,
|
|
10
10
|
"peerDependencies": {
|
|
11
11
|
"@sitevision/api": "*",
|
|
12
|
-
"svelte": "^3.46.0 || ^4.0.0"
|
|
12
|
+
"svelte": "^3.46.0 || ^4.0.0 || ^5.0.0"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@soleil-se/eslint-config": "^5.1.1",
|