@soleil-se/config-svelte 1.27.2 → 1.27.4
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/.stylelintrc.js +3 -3
- package/CHANGELOG.md +8 -0
- package/actions/inputPrefix.js +15 -0
- package/actions/resizer.js +5 -0
- package/actions/show.js +6 -0
- package/components/CustomList/i18n.js +6 -0
- package/components/CustomList/internal/SortableItem.svelte +5 -2
- package/components/Modal/Component.svelte +6 -2
- package/components/NodeSelector/Component.svelte +1 -1
- package/components/TextList/i18n.js +9 -0
- package/components/TextList/internal/Item.svelte +12 -4
- package/createConfigApp/index.js +4 -0
- package/createTypeDefinitions.js +23 -0
- package/index.js +3 -1
- package/package.json +34 -11
- package/server/index.js +2 -1
- package/types/actions/index.d.ts +3 -0
- package/types/actions/inputPrefix.d.ts +18 -0
- package/types/actions/resizer.d.ts +7 -0
- package/types/actions/show.d.ts +7 -0
- package/types/components/Checkbox/Component.svelte.d.ts +54 -0
- package/types/components/CheckboxGroup/Component.svelte.d.ts +59 -0
- package/types/components/CheckboxGroup/types.d.ts +1 -0
- package/types/components/CustomList/Component.svelte.d.ts +50 -0
- package/types/components/CustomList/CustomListItemTemplate.svelte.d.ts +9 -0
- package/types/components/CustomSelector/Component.svelte.d.ts +79 -0
- package/types/components/CustomSelector/types.d.ts +1 -0
- package/types/components/DropdownSelector/Component.svelte.d.ts +64 -0
- package/types/components/DropdownSelector/types.d.ts +30 -0
- package/types/components/ImageSelector/Component.svelte.d.ts +54 -0
- package/types/components/InputField/Component.svelte.d.ts +79 -0
- package/types/components/LinkSelector/Component.svelte.d.ts +54 -0
- package/types/components/ListSelector/Component.svelte.d.ts +65 -0
- package/types/components/ListSelector/types.d.ts +23 -0
- package/types/components/Modal/Component.svelte.d.ts +28 -0
- package/types/components/NodeSelector/Component.svelte.d.ts +74 -0
- package/types/components/NodeSelector/types.d.ts +23 -0
- package/types/components/NumberSpinner/Component.svelte.d.ts +74 -0
- package/types/components/Panel/Component.svelte.d.ts +34 -0
- package/types/components/RadioGroup/Component.svelte.d.ts +59 -0
- package/types/components/RadioGroup/types.d.ts +1 -0
- package/types/components/RepositoryNodeSelector/Component.svelte.d.ts +64 -0
- package/types/components/RepositoryNodeSelector/types.d.ts +23 -0
- package/types/components/SelectField/Component.svelte.d.ts +54 -0
- package/types/components/SelectField/types.d.ts +1 -0
- package/types/components/TagSelector/Component.svelte.d.ts +54 -0
- package/types/components/TextList/Component.svelte.d.ts +49 -0
- package/types/createConfigApp/index.d.ts +5 -0
- package/types/index.d.ts +23 -0
- package/types/server/index.d.ts +18 -0
- package/types/utils/addPrefix.d.ts +7 -0
- package/types/utils/createI18n.d.ts +6 -0
- package/types/utils/generateId.d.ts +12 -0
- package/types/utils/getAppContext.d.ts +7 -0
- package/types/utils/getAppProps.d.ts +7 -0
- package/types/utils/index.d.ts +9 -0
- package/types/utils/onSave.d.ts +6 -0
- package/types/utils/pluckPrefix.d.ts +9 -0
- package/types/utils/setupComponent.d.ts +6 -0
- package/types/utils/triggerInput.d.ts +6 -0
- package/utils/addPrefix.js +6 -0
- package/utils/createI18n.js +5 -0
- package/utils/generateId.js +10 -0
- package/utils/onSave.js +5 -0
- package/utils/setupComponent.js +5 -0
- package/utils/triggerInput.js +5 -0
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/{.prettierrc.js → .prettierrc.cjs} +0 -0
package/.stylelintrc.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
extends: '@soleil/stylelint-config'
|
|
3
|
-
}
|
|
1
|
+
export default {
|
|
2
|
+
extends: '@soleil/stylelint-config',
|
|
3
|
+
};
|
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.27.3] - 2024-09-26
|
|
11
|
+
|
|
12
|
+
- Add TypeScript definitions for API functions and move all type declarations to the types folder.
|
|
13
|
+
|
|
14
|
+
## [1.27.2] - 2024-08-19
|
|
15
|
+
|
|
16
|
+
- Custom template for CustomSelector options and results now works properly with `multiple` prop.
|
|
17
|
+
|
|
10
18
|
## [1.27.1] - 2024-08-12
|
|
11
19
|
|
|
12
20
|
- Adjust import paths for components in index.js.
|
package/actions/inputPrefix.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Add https prefix to input value
|
|
3
|
+
* @param {HTMLInputElement} node
|
|
4
|
+
* @returns {void}
|
|
5
|
+
*/
|
|
1
6
|
export function prefixHttps(node) {
|
|
2
7
|
const addPrefix = () => {
|
|
3
8
|
const { type, value } = node;
|
|
@@ -9,6 +14,11 @@ export function prefixHttps(node) {
|
|
|
9
14
|
node.addEventListener('input', addPrefix);
|
|
10
15
|
}
|
|
11
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Add mail prefix to input value
|
|
19
|
+
* @param {HTMLInputElement} node
|
|
20
|
+
* @returns {void}
|
|
21
|
+
*/
|
|
12
22
|
export function prefixMail(node) {
|
|
13
23
|
const addPrefix = () => {
|
|
14
24
|
const { value } = node;
|
|
@@ -21,6 +31,11 @@ export function prefixMail(node) {
|
|
|
21
31
|
node.addEventListener('input', addPrefix);
|
|
22
32
|
}
|
|
23
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Add tel prefix to input value
|
|
36
|
+
* @param {HTMLInputElement} node
|
|
37
|
+
* @returns {void}
|
|
38
|
+
*/
|
|
24
39
|
export function prefixTel(node) {
|
|
25
40
|
const addPrefix = () => {
|
|
26
41
|
const { value } = node;
|
package/actions/resizer.js
CHANGED
package/actions/show.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Show or hide an element
|
|
3
|
+
* @param {HTMLElement} element Element to show or hide
|
|
4
|
+
* @param {boolean} initialShow Initial state of the element
|
|
5
|
+
* @returns {object} Object with update method
|
|
6
|
+
*/
|
|
1
7
|
export default function show(element, initialShow) {
|
|
2
8
|
const toggle = (isVisible) => {
|
|
3
9
|
/* eslint-disable-next-line no-param-reassign */
|
|
@@ -4,13 +4,19 @@ export default createI18n({
|
|
|
4
4
|
sv: {
|
|
5
5
|
add: 'Lägg till...',
|
|
6
6
|
edit: 'Redigera',
|
|
7
|
+
ok: 'OK',
|
|
8
|
+
remove: 'Ta bort',
|
|
7
9
|
},
|
|
8
10
|
no: {
|
|
9
11
|
add: 'Legg till...',
|
|
10
12
|
edit: 'Redigere',
|
|
13
|
+
ok: 'OK',
|
|
14
|
+
remove: 'Fjern',
|
|
11
15
|
},
|
|
12
16
|
en: {
|
|
13
17
|
add: 'Add...',
|
|
14
18
|
edit: 'Edit',
|
|
19
|
+
ok: 'OK',
|
|
20
|
+
remove: 'Remove',
|
|
15
21
|
},
|
|
16
22
|
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { createEventDispatcher } from 'svelte';
|
|
3
3
|
|
|
4
|
+
import i18n from '../i18n';
|
|
5
|
+
|
|
4
6
|
export let id;
|
|
5
7
|
export let disabled;
|
|
6
8
|
export let icon;
|
|
@@ -17,6 +19,7 @@
|
|
|
17
19
|
</script>
|
|
18
20
|
|
|
19
21
|
<!-- This is handled by the click event on the edit button -->
|
|
22
|
+
<!-- eslint-disable-next-line svelte/no-unused-svelte-ignore -->
|
|
20
23
|
<!-- svelte-ignore a11y-click-events-have-key-events a11y-no-static-element-interactions -->
|
|
21
24
|
<div class="list-component__item" on:dblclick={editItem} on:click>
|
|
22
25
|
{#if icon}
|
|
@@ -26,10 +29,10 @@
|
|
|
26
29
|
<slot />
|
|
27
30
|
</span>
|
|
28
31
|
<div class="list-component__item-actions">
|
|
29
|
-
<button {disabled} on:click={editItem}>
|
|
32
|
+
<button aria-label={i18n('ok')} {disabled} on:click={editItem}>
|
|
30
33
|
<i class="glyphicons edit" aria-hidden="true"></i>
|
|
31
34
|
</button>
|
|
32
|
-
<button {disabled} on:click={removeItem}>
|
|
35
|
+
<button aria-label={i18n('remove')} {disabled} on:click={removeItem}>
|
|
33
36
|
<i class="glyphicons remove-2" aria-hidden="true"></i>
|
|
34
37
|
</button>
|
|
35
38
|
<i class="glyphicons move" aria-hidden="true"></i>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* eslint svelte/no-unused-svelte-ignore: "off" */
|
|
3
3
|
|
|
4
4
|
import validate from '@soleil-se/config-validate';
|
|
5
|
-
import { onMount, createEventDispatcher } from 'svelte';
|
|
5
|
+
import { onMount, onDestroy, createEventDispatcher } from 'svelte';
|
|
6
6
|
import A11yDialog from 'a11y-dialog';
|
|
7
7
|
import { generateId } from '../../utils';
|
|
8
8
|
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
onMount(() => {
|
|
107
|
-
a11yDialog = new A11yDialog(element)
|
|
107
|
+
a11yDialog = new A11yDialog(element);
|
|
108
108
|
|
|
109
109
|
a11yDialog.on('show', () => {
|
|
110
110
|
select2DropAddedObserver.observe(document.body, { childList: true });
|
|
@@ -131,6 +131,10 @@
|
|
|
131
131
|
|
|
132
132
|
if (open) a11yDialog.show();
|
|
133
133
|
});
|
|
134
|
+
|
|
135
|
+
onDestroy(() => {
|
|
136
|
+
a11yDialog?.destroy();
|
|
137
|
+
});
|
|
134
138
|
</script>
|
|
135
139
|
|
|
136
140
|
<svelte:window on:keydown={handleEscape} />
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
export let show = true;
|
|
30
30
|
|
|
31
31
|
selectable = Array.isArray(selectable) ? selectable.join(',') : selectable;
|
|
32
|
-
value = name ? values[name] ?? value : value;
|
|
32
|
+
value = name ? (values[name] ?? value) : value;
|
|
33
33
|
|
|
34
34
|
let className = '';
|
|
35
35
|
export { className as class };
|
|
@@ -3,11 +3,20 @@ import createI18n from '../../utils/createI18n';
|
|
|
3
3
|
export default createI18n({
|
|
4
4
|
sv: {
|
|
5
5
|
add: 'Lägg till...',
|
|
6
|
+
ok: 'OK',
|
|
7
|
+
remove: 'Ta bort',
|
|
8
|
+
cancel: 'Avbryt',
|
|
6
9
|
},
|
|
7
10
|
no: {
|
|
8
11
|
add: 'Legg till...',
|
|
12
|
+
ok: 'OK',
|
|
13
|
+
remove: 'Fjern',
|
|
14
|
+
cancel: 'Avbryt',
|
|
9
15
|
},
|
|
10
16
|
en: {
|
|
11
17
|
add: 'Add...',
|
|
18
|
+
ok: 'OK',
|
|
19
|
+
remove: 'Remove',
|
|
20
|
+
cancel: 'Cancel',
|
|
12
21
|
},
|
|
13
22
|
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { tick, createEventDispatcher, onMount } from 'svelte';
|
|
3
3
|
|
|
4
|
+
import i18n from '../i18n';
|
|
5
|
+
|
|
4
6
|
export let id;
|
|
5
7
|
export let value;
|
|
6
8
|
export let edit = false;
|
|
@@ -67,24 +69,30 @@
|
|
|
67
69
|
/>
|
|
68
70
|
|
|
69
71
|
<span class="input-group-btn">
|
|
70
|
-
<button class="btn btn-default" type="button" on:click={updateItem}>
|
|
72
|
+
<button class="btn btn-default" aria-label={i18n('ok')} type="button" on:click={updateItem}>
|
|
71
73
|
<i class="glyphicons ok-2"></i>
|
|
72
74
|
</button>
|
|
73
|
-
<button
|
|
75
|
+
<button
|
|
76
|
+
class="btn btn-default"
|
|
77
|
+
aria-label={i18n('remove')}
|
|
78
|
+
type="button"
|
|
79
|
+
on:click={abortEdit}
|
|
80
|
+
>
|
|
74
81
|
<i class="glyphicons remove-2"></i>
|
|
75
82
|
</button>
|
|
76
83
|
</span>
|
|
77
84
|
</div>
|
|
78
85
|
</div>
|
|
79
86
|
{:else}
|
|
87
|
+
<!-- eslint-disable-next-line svelte/no-unused-svelte-ignore -->
|
|
80
88
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
81
89
|
<div on:dblclick={editItem}>
|
|
82
90
|
<span class="item-name">{value}</span>
|
|
83
91
|
<div class="list-component__item-actions">
|
|
84
|
-
<button on:click={editItem}>
|
|
92
|
+
<button aria-label={i18n('ok')} on:click={editItem}>
|
|
85
93
|
<i class="glyphicons edit" aria-hidden="true"></i>
|
|
86
94
|
</button>
|
|
87
|
-
<button on:click={removeItem}>
|
|
95
|
+
<button aria-label={i18n('cancel')} on:click={removeItem}>
|
|
88
96
|
<i class="glyphicons remove-2" aria-hidden="true"></i>
|
|
89
97
|
</button>
|
|
90
98
|
<i class="glyphicons move" aria-hidden="true"></i>
|
package/createConfigApp/index.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
+
import { sveld } from 'sveld';
|
|
3
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
4
|
+
import { globSync } from 'glob';
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { execSync } from 'node:child_process';
|
|
8
|
+
|
|
9
|
+
sveld({
|
|
10
|
+
input: './index.js',
|
|
11
|
+
glob: true,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
globSync('./components/*/types.d.ts').forEach((file) => {
|
|
15
|
+
const destinationPath = path.join('types', file);
|
|
16
|
+
const destinationDir = path.dirname(destinationPath);
|
|
17
|
+
fs.mkdirSync(destinationDir, { recursive: true });
|
|
18
|
+
fs.copyFileSync(file, destinationPath);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
['actions', 'createConfigApp', 'server', 'utils'].forEach((dir) => {
|
|
22
|
+
execSync(`npx -p typescript tsc ./${dir}/index.js --declaration --allowJs --emitDeclarationOnly --outDir types/${dir} --skipLibCheck`, { stdio: 'inherit' });
|
|
23
|
+
});
|
package/index.js
CHANGED
|
@@ -20,4 +20,6 @@ export { default as RepositoryNodeSelector } from './components/RepositoryNodeSe
|
|
|
20
20
|
|
|
21
21
|
export { default as createConfigApp } from './createConfigApp';
|
|
22
22
|
|
|
23
|
-
export { generateId
|
|
23
|
+
export { generateId } from './utils/generateId';
|
|
24
|
+
export { default as onSave } from './utils/onSave';
|
|
25
|
+
export { default as setupComponent } from './utils/setupComponent';
|
package/package.json
CHANGED
|
@@ -1,34 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soleil-se/config-svelte",
|
|
3
|
-
"version": "1.27.
|
|
3
|
+
"version": "1.27.4",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"module": "./index.js",
|
|
6
6
|
"svelte": "./index.js",
|
|
7
|
+
"types": "./types/index.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
"*": {
|
|
10
|
+
"actions": [
|
|
11
|
+
"./types/actions/index.d.ts"
|
|
12
|
+
],
|
|
13
|
+
"createConfigApp": [
|
|
14
|
+
"./types/createConfigApp/index.d.ts"
|
|
15
|
+
],
|
|
16
|
+
"server": [
|
|
17
|
+
"./types/server/index.d.ts"
|
|
18
|
+
],
|
|
19
|
+
"utils": [
|
|
20
|
+
"./types/utils/index.d.ts"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
7
24
|
"author": "Soleil AB",
|
|
8
25
|
"license": "UNLICENSED",
|
|
9
26
|
"sideEffects": false,
|
|
27
|
+
"type": "module",
|
|
10
28
|
"peerDependencies": {
|
|
11
29
|
"@sitevision/api": "*",
|
|
12
30
|
"svelte": "^3.46.0 || ^4.0.0 || ^5.0.0-next || ^5.0.0"
|
|
13
31
|
},
|
|
14
32
|
"devDependencies": {
|
|
15
|
-
"@soleil-se/eslint-config": "^5.
|
|
16
|
-
"@soleil-se/stylelint-config": "^
|
|
17
|
-
"eslint": "^8.57.
|
|
33
|
+
"@soleil-se/eslint-config": "^5.2.0",
|
|
34
|
+
"@soleil-se/stylelint-config": "^4.2.0",
|
|
35
|
+
"eslint": "^8.57.1",
|
|
18
36
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
19
37
|
"eslint-config-prettier": "^9.1.0",
|
|
20
|
-
"eslint-plugin-import": "^2.
|
|
21
|
-
"eslint-plugin-svelte": "^2.
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
38
|
+
"eslint-plugin-import": "^2.30.0",
|
|
39
|
+
"eslint-plugin-svelte": "^2.44.1",
|
|
40
|
+
"glob": "^11.0.0",
|
|
41
|
+
"stylelint": "^16.9.0",
|
|
42
|
+
"sveld": "^0.20.2",
|
|
43
|
+
"svelte": "^4.2.19",
|
|
44
|
+
"svelte-preprocess": "^6.0.3"
|
|
25
45
|
},
|
|
26
46
|
"dependencies": {
|
|
27
47
|
"@soleil-se/config-validate": "^1.2.1",
|
|
28
|
-
"a11y-dialog": "
|
|
29
|
-
"svelte-dnd-action": "^0.9.
|
|
48
|
+
"a11y-dialog": "8.1.1",
|
|
49
|
+
"svelte-dnd-action": "^0.9.51"
|
|
30
50
|
},
|
|
31
51
|
"homepage": "https://docs.soleil.se/packages/config-svelte",
|
|
52
|
+
"scripts": {
|
|
53
|
+
"create-type-definitions": "node ./createTypeDefinitions.js"
|
|
54
|
+
},
|
|
32
55
|
"description": "A collection of Svelte components and utilities for WebApp, RESTApp and Widget configurations.",
|
|
33
56
|
"keywords": [
|
|
34
57
|
"Sitevision",
|
package/server/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
1
2
|
import { getCurrentPage } from '@sitevision/api/server/PortletContextUtil';
|
|
2
3
|
import appInfo from '@sitevision/api/server/appInfo';
|
|
3
4
|
import { getSite } from '@sitevision/api/server/ResourceLocatorUtil';
|
|
@@ -28,7 +29,7 @@ export function createAppData(data) {
|
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* Creates app context global variable.
|
|
31
|
-
* @param {Response} res Response from
|
|
32
|
+
* @param {import('@sitevision/api/common/router/index').Response} res Response from \@sitevision/common/router.
|
|
32
33
|
*/
|
|
33
34
|
export function createAppContext(res) {
|
|
34
35
|
const siteNode = getSite();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Add https prefix to input value
|
|
3
|
+
* @param {HTMLInputElement} node
|
|
4
|
+
* @returns {void}
|
|
5
|
+
*/
|
|
6
|
+
export function prefixHttps(node: HTMLInputElement): void;
|
|
7
|
+
/**
|
|
8
|
+
* Add mail prefix to input value
|
|
9
|
+
* @param {HTMLInputElement} node
|
|
10
|
+
* @returns {void}
|
|
11
|
+
*/
|
|
12
|
+
export function prefixMail(node: HTMLInputElement): void;
|
|
13
|
+
/**
|
|
14
|
+
* Add tel prefix to input value
|
|
15
|
+
* @param {HTMLInputElement} node
|
|
16
|
+
* @returns {void}
|
|
17
|
+
*/
|
|
18
|
+
export function prefixTel(node: HTMLInputElement): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Show or hide an element
|
|
3
|
+
* @param {HTMLElement} element Element to show or hide
|
|
4
|
+
* @param {boolean} initialShow Initial state of the element
|
|
5
|
+
* @returns {object} Object with update method
|
|
6
|
+
*/
|
|
7
|
+
export default function show(element: HTMLElement, initialShow: boolean): object;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { SvelteComponentTyped } from "svelte";
|
|
2
|
+
|
|
3
|
+
export interface CheckboxProps {
|
|
4
|
+
/**
|
|
5
|
+
* @default undefined
|
|
6
|
+
*/
|
|
7
|
+
id?: string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @default undefined
|
|
11
|
+
*/
|
|
12
|
+
label: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @default undefined
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
checked?: boolean;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
show?: boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @default undefined
|
|
36
|
+
*/
|
|
37
|
+
value: boolean;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @default ''
|
|
41
|
+
*/
|
|
42
|
+
class?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A checkbox component.
|
|
47
|
+
*
|
|
48
|
+
* [README](https://docs.soleil.se/packages/soleil/svelte-config/components/checkbox/)
|
|
49
|
+
*/
|
|
50
|
+
export default class Checkbox extends SvelteComponentTyped<
|
|
51
|
+
CheckboxProps,
|
|
52
|
+
{ input: CustomEvent<any>; change: CustomEvent<any> },
|
|
53
|
+
{ default: {}; label: {} }
|
|
54
|
+
> {}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { SvelteComponentTyped } from "svelte";
|
|
2
|
+
|
|
3
|
+
export interface CheckboxGroupProps {
|
|
4
|
+
/**
|
|
5
|
+
* @default undefined
|
|
6
|
+
*/
|
|
7
|
+
id?: string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @default undefined
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @default undefined
|
|
16
|
+
*/
|
|
17
|
+
options: import("./types.d.ts").Option[];
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @default undefined
|
|
21
|
+
*/
|
|
22
|
+
legend: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
legendVisuallyHidden?: boolean;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
show?: boolean;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @default []
|
|
41
|
+
*/
|
|
42
|
+
value?: string[];
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @default ''
|
|
46
|
+
*/
|
|
47
|
+
class?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* A checkbox group component.
|
|
52
|
+
*
|
|
53
|
+
* [README](https://docs.soleil.se/packages/soleil/svelte-config/components/checkboxgroup/)
|
|
54
|
+
*/
|
|
55
|
+
export default class CheckboxGroup extends SvelteComponentTyped<
|
|
56
|
+
CheckboxGroupProps,
|
|
57
|
+
{ input: CustomEvent<any>; change: CustomEvent<any> },
|
|
58
|
+
{ default: {}; legend: {} }
|
|
59
|
+
> {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Option = ({string} | {label: string, value: string})[]
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { SvelteComponentTyped } from "svelte";
|
|
2
|
+
|
|
3
|
+
export interface CustomListProps {
|
|
4
|
+
/**
|
|
5
|
+
* @default undefined
|
|
6
|
+
*/
|
|
7
|
+
label: string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
required?: boolean;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @default undefined
|
|
16
|
+
*/
|
|
17
|
+
name?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
show?: boolean;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @default undefined
|
|
31
|
+
*/
|
|
32
|
+
icon: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @default []
|
|
36
|
+
*/
|
|
37
|
+
value?: [];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Custom list component for adding multiple modal windows containting configuration components and
|
|
42
|
+
* sorting them.
|
|
43
|
+
*
|
|
44
|
+
* [README](https://docs.soleil.se/packages/soleil/svelte-config/components/customlist/)
|
|
45
|
+
*/
|
|
46
|
+
export default class CustomList extends SvelteComponentTyped<
|
|
47
|
+
CustomListProps,
|
|
48
|
+
{ input: CustomEvent<any>; change: CustomEvent<any> },
|
|
49
|
+
{ default: { id: any; triggerUpdate: any }; label: {} }
|
|
50
|
+
> {}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { SvelteComponentTyped } from "svelte";
|
|
2
|
+
|
|
3
|
+
export interface CustomSelectorProps {
|
|
4
|
+
/**
|
|
5
|
+
* @default undefined
|
|
6
|
+
*/
|
|
7
|
+
id?: string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @default undefined
|
|
11
|
+
*/
|
|
12
|
+
label: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @default undefined
|
|
16
|
+
*/
|
|
17
|
+
name?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @default undefined
|
|
21
|
+
*/
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @default []
|
|
26
|
+
*/
|
|
27
|
+
options?: import("./types.d.ts").Option[];
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
searchable?: boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
removable?: boolean;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
required?: boolean;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
multiple?: boolean;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
show?: boolean;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @default undefined
|
|
61
|
+
*/
|
|
62
|
+
value?: string | string[];
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @default ''
|
|
66
|
+
*/
|
|
67
|
+
class?: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Wrapper component for Sitevision [Custom selector](https://developer.sitevision.se/docs/webapps/webapps-2/configuration/sitevision-components#h-Customselectorsince91).
|
|
72
|
+
*
|
|
73
|
+
* [README](https://docs.soleil.se/packages/soleil/svelte-config/components/customselector/)
|
|
74
|
+
*/
|
|
75
|
+
export default class CustomSelector extends SvelteComponentTyped<
|
|
76
|
+
CustomSelectorProps,
|
|
77
|
+
{ input: CustomEvent<any>; change: CustomEvent<any> },
|
|
78
|
+
{ default: {}; label: {}; option: { option: any } }
|
|
79
|
+
> {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Option = ({string} | {label: string, value: string})[]
|