@soleil-se/config-svelte 1.27.1 → 1.27.3
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/CustomSelector/Component.svelte +1 -1
- package/components/NodeSelector/Component.svelte +1 -1
- 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 */
|
|
@@ -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 };
|
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.3",
|
|
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.0",
|
|
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.2"
|
|
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.50"
|
|
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})[]
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { SvelteComponentTyped } from "svelte";
|
|
2
|
+
|
|
3
|
+
export interface DropdownSelectorProps {
|
|
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 'metadata'
|
|
21
|
+
*/
|
|
22
|
+
type?: import("./types.d.ts").Type;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @default []
|
|
26
|
+
*/
|
|
27
|
+
selectable?: import("./types.d.ts").Selectable;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
required?: boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @default true
|
|
41
|
+
*/
|
|
42
|
+
show?: boolean;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @default ''
|
|
46
|
+
*/
|
|
47
|
+
value?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @default ''
|
|
51
|
+
*/
|
|
52
|
+
class?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Wrapper component for Sitevision [selects](https://developer.sitevision.se/docs/webapps/webapps-2/configuration/sitevision-components).
|
|
57
|
+
*
|
|
58
|
+
* [README](https://docs.soleilit.se/03.packages/@soleil&svelte-config/components/DropdownSelector/)
|
|
59
|
+
*/
|
|
60
|
+
export default class DropdownSelector extends SvelteComponentTyped<
|
|
61
|
+
DropdownSelectorProps,
|
|
62
|
+
{ input: CustomEvent<any>; change: CustomEvent<any> },
|
|
63
|
+
{ default: {}; label: {} }
|
|
64
|
+
> {}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type NodeType =
|
|
2
|
+
"sv:metadataDateDefinition" |
|
|
3
|
+
"sv:metadataUserDefinition" |
|
|
4
|
+
"sv:metadataDirectoryDefinition" |
|
|
5
|
+
"sv:metadataTextDefinition" |
|
|
6
|
+
"sv:metadataSingleDefinition" |
|
|
7
|
+
"sv:metadataMultipleDefinition" |
|
|
8
|
+
"sv:metadataSystemLinkDefinition" |
|
|
9
|
+
"sv:metadataSystemIntegerDefinition" |
|
|
10
|
+
"sv:metadataSystemTextDefinition" |
|
|
11
|
+
"sv:metadataSystemDefinition" |
|
|
12
|
+
"sv:metadataLinkDefinition" |
|
|
13
|
+
"sv:metadataTextPortletDefinition" |
|
|
14
|
+
"sv:metadataImagePortletDefinition" |
|
|
15
|
+
"sv:metadataKeywordDefinition" |
|
|
16
|
+
"sv:metadataRelatedInformationDefinition" |
|
|
17
|
+
"sv:metadataMediaPortletDefinition" |
|
|
18
|
+
"sv:metadataSingleTagDefinition" |
|
|
19
|
+
"sv:metadataMultipleTagDefinition";
|
|
20
|
+
|
|
21
|
+
export type Selectable = NodeType | NodeType[]
|
|
22
|
+
|
|
23
|
+
export type Type =
|
|
24
|
+
"metadata" |
|
|
25
|
+
"template" |
|
|
26
|
+
"oauth2-configuration" |
|
|
27
|
+
"virtual-group" |
|
|
28
|
+
"search-index" |
|
|
29
|
+
"font" |
|
|
30
|
+
"color"
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { SvelteComponentTyped } from "svelte";
|
|
2
|
+
|
|
3
|
+
export interface ImageSelectorProps {
|
|
4
|
+
/**
|
|
5
|
+
* @default undefined
|
|
6
|
+
*/
|
|
7
|
+
name?: string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @default undefined
|
|
11
|
+
*/
|
|
12
|
+
heading?: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
required?: boolean;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @default undefined
|
|
21
|
+
*/
|
|
22
|
+
node: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @default undefined
|
|
26
|
+
*/
|
|
27
|
+
alt: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
hideDecorative?: boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
decorative?: boolean;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @default undefined
|
|
41
|
+
*/
|
|
42
|
+
show: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Custom panel component for selecting an image.
|
|
47
|
+
*
|
|
48
|
+
* [README](https://docs.soleil.se/packages/soleil/svelte-config/components/imageselector/)
|
|
49
|
+
*/
|
|
50
|
+
export default class ImageSelector extends SvelteComponentTyped<
|
|
51
|
+
ImageSelectorProps,
|
|
52
|
+
{ input: CustomEvent<any>; change: CustomEvent<any> },
|
|
53
|
+
{ default: {} }
|
|
54
|
+
> {}
|