@soleil-se/config-svelte 1.12.0 → 1.13.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.
package/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,15 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [1.
|
|
8
|
+
## [1.13.0] - 2022-06-23
|
|
9
|
+
|
|
10
|
+
- Add `icon` prop to CustomList for setting an icon to the list items.
|
|
11
|
+
|
|
12
|
+
## [1.12.1] - 2022-05-24
|
|
13
|
+
|
|
14
|
+
- Fixed that values wasn't saved properly in Modal and CustomList.
|
|
15
|
+
|
|
16
|
+
## [1.12.0] - 2022-05-23
|
|
9
17
|
|
|
10
18
|
- New component: [Modal](./components/Modal).
|
|
11
19
|
- New component: [CustomList](./components/CustomList).
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
export let required = false;
|
|
18
18
|
export let name = undefined;
|
|
19
19
|
export let disabled = false;
|
|
20
|
+
export let icon;
|
|
20
21
|
|
|
21
22
|
export let value = [];
|
|
22
23
|
value = name ? values[name] ?? value : value;
|
|
@@ -105,6 +106,7 @@
|
|
|
105
106
|
<SortableItem
|
|
106
107
|
{...item}
|
|
107
108
|
{disabled}
|
|
109
|
+
{icon}
|
|
108
110
|
on:edit={onEdit}
|
|
109
111
|
on:remove={onRemove}
|
|
110
112
|
on:click={tempDisableDrag}
|
|
@@ -14,6 +14,7 @@ export let label;
|
|
|
14
14
|
export let required = false;
|
|
15
15
|
export let name = undefined;
|
|
16
16
|
export let disabled = false;
|
|
17
|
+
export let icon;
|
|
17
18
|
export let value = [];
|
|
18
19
|
```
|
|
19
20
|
|
|
@@ -61,3 +62,21 @@ function getCustomList() {
|
|
|
61
62
|
})) || [];
|
|
62
63
|
}
|
|
63
64
|
```
|
|
65
|
+
|
|
66
|
+
## Icons
|
|
67
|
+
|
|
68
|
+
Pass an icon class to the list item, this can be an already existing icon from `sitevision-icon` or `glyphicons` that are available in edit mode or a custom class.
|
|
69
|
+
No list of icons is available, but you can inspect an icon in the edit interface and copy the class name.
|
|
70
|
+
|
|
71
|
+
```svelte
|
|
72
|
+
<script>
|
|
73
|
+
import { Panel, CustomList, InputField, NodeSelector } from '@soleil-se/svelte-config';
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<Panel heading="Inställningar">
|
|
77
|
+
<CustomList name="customList" label="Custom list" icon="sitevision-icons file" let:id>
|
|
78
|
+
<InputField name="{id}_name" label="Name" />
|
|
79
|
+
<NodeSelector name="{id}_page" label="Page" type="page-selector" />
|
|
80
|
+
</CustomList>
|
|
81
|
+
</Panel>
|
|
82
|
+
```
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
export let id;
|
|
5
5
|
export let name;
|
|
6
6
|
export let disabled;
|
|
7
|
+
export let icon;
|
|
7
8
|
|
|
8
9
|
const dispatch = createEventDispatcher();
|
|
9
10
|
|
|
@@ -18,6 +19,9 @@
|
|
|
18
19
|
</script>
|
|
19
20
|
|
|
20
21
|
<div class="list-component__item" on:dblclick={editItem} on:click>
|
|
22
|
+
{#if icon}
|
|
23
|
+
<i class="sv-list-icon {icon}" aria-hidden="true" />
|
|
24
|
+
{/if}
|
|
21
25
|
<span class="item-name">{name}</span>
|
|
22
26
|
<div class="list-component__item-actions">
|
|
23
27
|
<button {disabled} on:click={editItem}>
|
package/createConfigApp/index.js
CHANGED
|
@@ -17,4 +17,13 @@ export default function createConfigApp(App) {
|
|
|
17
17
|
|
|
18
18
|
return app;
|
|
19
19
|
};
|
|
20
|
+
|
|
21
|
+
window.getValues = () => {
|
|
22
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
23
|
+
const values = window._getValues();
|
|
24
|
+
return {
|
|
25
|
+
...values,
|
|
26
|
+
__lastEditTimestamp: new Date().getTime(),
|
|
27
|
+
};
|
|
28
|
+
};
|
|
20
29
|
}
|