@kws3/ui 2.0.4 → 2.1.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.mdx +13 -1
- package/buttons/ConfirmButton.svelte +7 -6
- package/buttons/DeleteButton.svelte +14 -8
- package/buttons/ProcessButton.svelte +15 -9
- package/buttons/SubmitButton.svelte +11 -8
- package/canvas/Canvas.svelte +263 -0
- package/canvas/ESignature.svelte +101 -0
- package/canvas/PenControls.svelte +234 -0
- package/canvas/PenInput.svelte +152 -0
- package/charts/AreaChart.svelte +2 -2
- package/charts/BarChart.svelte +2 -2
- package/charts/Chart.svelte +16 -12
- package/charts/DonutChart.svelte +2 -2
- package/charts/LineChart.svelte +2 -2
- package/charts/MixedChart.svelte +2 -2
- package/charts/PieChart.svelte +2 -2
- package/charts/RadialChart.svelte +2 -2
- package/charts/utils.d.ts +553 -0
- package/charts/utils.d.ts.map +1 -0
- package/charts/utils.js +27 -4
- package/controls/Checkbox.svelte +7 -6
- package/controls/FileUpload.svelte +5 -4
- package/controls/NumberInput.svelte +5 -5
- package/controls/Radio.svelte +2 -2
- package/controls/RangeSlider.svelte +4 -2
- package/controls/Toggle.svelte +2 -2
- package/controls/ToggleButtons.svelte +1 -1
- package/datagrid/GridView/GridRow.svelte +4 -4
- package/datagrid/GridView/GridView.svelte +7 -4
- package/datagrid/Pagination/Pagination.svelte +12 -11
- package/form/index.d.ts +15 -0
- package/form/index.d.ts.map +1 -0
- package/forms/AutoComplete.svelte +12 -6
- package/forms/Datepicker.svelte +4 -3
- package/forms/PasswordInput.svelte +224 -0
- package/forms/PasswordValidator/validatePassword.d.ts +5 -0
- package/forms/PasswordValidator/validatePassword.d.ts.map +1 -0
- package/forms/SearchInput.svelte +18 -7
- package/forms/Timepicker.svelte +9 -6
- package/forms/actions.d.ts +9 -0
- package/forms/actions.d.ts.map +1 -0
- package/forms/actions.js +6 -0
- package/forms/colorpicker/Colorpicker.d.ts +3 -0
- package/forms/colorpicker/Colorpicker.d.ts.map +1 -0
- package/forms/colorpicker/Colorpicker.js +12 -2
- package/forms/colorpicker/Colorpicker.svelte +10 -3
- package/forms/select/MultiSelect.svelte +14 -9
- package/forms/select/SearchableSelect.svelte +10 -5
- package/helpers/CardModal.svelte +7 -2
- package/helpers/ClipboardCopier.svelte +3 -3
- package/helpers/Dialog/Dialog.svelte +9 -7
- package/helpers/Dialog/index.d.ts +42 -0
- package/helpers/Dialog/index.d.ts.map +1 -0
- package/helpers/Dialog/index.js +58 -19
- package/helpers/Divider.svelte +10 -4
- package/helpers/FloatingUI/Floatie.svelte +1 -1
- package/helpers/FloatingUI/index.d.ts +51 -0
- package/helpers/FloatingUI/index.d.ts.map +1 -0
- package/helpers/FloatingUI/index.js +13 -0
- package/helpers/Icon.svelte +14 -7
- package/helpers/Loader.svelte +5 -5
- package/helpers/Message.svelte +11 -6
- package/helpers/Modal.svelte +7 -2
- package/helpers/Notification.svelte +6 -2
- package/helpers/Popover.svelte +13 -6
- package/helpers/Skeleton.svelte +3 -3
- package/helpers/Timeline/Timeline.svelte +1 -1
- package/helpers/Timeline/TimelineItem.svelte +8 -4
- package/helpers/Tooltip.d.ts +19 -0
- package/helpers/Tooltip.d.ts.map +1 -0
- package/helpers/Tooltip.js +14 -1
- package/index.d.ts +69 -0
- package/index.d.ts.map +1 -0
- package/index.js +7 -0
- package/internal/DrawingPad.d.ts +86 -0
- package/internal/DrawingPad.d.ts.map +1 -0
- package/internal/DrawingPad.js +306 -0
- package/internal/UndoManager.d.ts +17 -0
- package/internal/UndoManager.d.ts.map +1 -0
- package/internal/UndoManager.js +84 -0
- package/internal/fuzzy.d.ts +24 -0
- package/internal/fuzzy.d.ts.map +1 -0
- package/internal/index.d.ts +16 -0
- package/internal/index.d.ts.map +1 -0
- package/internal/index.js +5 -1
- package/internal/scrollIntoActiveElement.d.ts +2 -0
- package/internal/scrollIntoActiveElement.d.ts.map +1 -0
- package/keyboard/index.d.ts +30 -0
- package/keyboard/index.d.ts.map +1 -0
- package/keyboard/index.js +1 -1
- package/package.json +6 -3
- package/resizeObserver/index.d.ts +8 -0
- package/resizeObserver/index.d.ts.map +1 -0
- package/search/index.d.ts +17 -0
- package/search/index.d.ts.map +1 -0
- package/settings.d.ts +22 -0
- package/settings.d.ts.map +1 -0
- package/settings.js +6 -1
- package/styles/Canvas.scss +100 -0
- package/styles/RangeSlider.scss +12 -0
- package/transitions/components/getEasing.d.ts +2 -0
- package/transitions/components/getEasing.d.ts.map +1 -0
- package/tsconfig.json +33 -0
- package/types/index.d.ts +103 -9
- package/types/type-defs/index.d.ts +64 -0
- package/utils/index.d.ts +77 -0
- package/utils/index.d.ts.map +1 -0
- package/types/type-defs/index.ts +0 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Colorpicker.d.ts","sourceRoot":"","sources":["Colorpicker.js"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {window} win
|
|
4
|
+
* @param {document} doc
|
|
5
|
+
* @returns {any}
|
|
6
|
+
*/
|
|
1
7
|
function initialize(win, doc) {
|
|
2
|
-
|
|
3
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @type {any}
|
|
10
|
+
*/
|
|
11
|
+
var CP;
|
|
12
|
+
|
|
13
|
+
var instance = "__instance__",
|
|
4
14
|
first = "firstChild",
|
|
5
15
|
scroll_left = "scrollLeft",
|
|
6
16
|
scroll_top = "scrollTop",
|
|
@@ -9,7 +9,7 @@ This property can be bound to, to fetch the current colour, Default: `"000000"`
|
|
|
9
9
|
@param {boolean} [readonly=false] - Enables read-only mode, Default: `false`
|
|
10
10
|
@param {boolean} [mini=false] - Alternate mini colour picker without typeable input, Default: `false`
|
|
11
11
|
@param {boolean} [disabled=false] - Disables the component, Default: `false`
|
|
12
|
-
@param {
|
|
12
|
+
@param {SizeOptions} [size=] - Size of the colour picker trigger, Default: ``
|
|
13
13
|
|
|
14
14
|
### Events
|
|
15
15
|
- `change` - Triggered when color changes
|
|
@@ -36,7 +36,7 @@ This property can be bound to, to fetch the current colour, Default: `"000000"`
|
|
|
36
36
|
on:focus={focused}
|
|
37
37
|
{disabled}
|
|
38
38
|
bind:value={color}
|
|
39
|
-
use:colorpicker />
|
|
39
|
+
use:colorpicker={color} />
|
|
40
40
|
{#if !mini}
|
|
41
41
|
<Icon icon="hashtag" class="is-left" inner_style="color:#{color}" />
|
|
42
42
|
{/if}
|
|
@@ -60,6 +60,10 @@ This property can be bound to, to fetch the current colour, Default: `"000000"`
|
|
|
60
60
|
fire("change");
|
|
61
61
|
}, 300);
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
|
|
65
|
+
*/
|
|
66
|
+
|
|
63
67
|
/**
|
|
64
68
|
* Current selected colour (hex format only)
|
|
65
69
|
*
|
|
@@ -84,13 +88,16 @@ This property can be bound to, to fetch the current colour, Default: `"000000"`
|
|
|
84
88
|
disabled = false,
|
|
85
89
|
/**
|
|
86
90
|
* Size of the colour picker trigger
|
|
87
|
-
* @type {
|
|
91
|
+
* @type {SizeOptions}
|
|
88
92
|
*/
|
|
89
93
|
size = "";
|
|
90
94
|
|
|
91
95
|
let dragover = false,
|
|
92
96
|
_colorpicker;
|
|
93
97
|
|
|
98
|
+
/**
|
|
99
|
+
* @type {import("svelte/action").Action}
|
|
100
|
+
*/
|
|
94
101
|
function colorpicker(node) {
|
|
95
102
|
_colorpicker = new ColorPicker(node);
|
|
96
103
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
@param {Array|?string} [value=undefined] - Value of the Input
|
|
6
6
|
|
|
7
7
|
This property can be bound to, to fetch the current value, Default: `undefined`
|
|
8
|
-
@param {
|
|
8
|
+
@param {?number} [max=null] - Maximum number of selectable items from dropdown list.
|
|
9
9
|
|
|
10
10
|
Accepts a `null` value for unlimited selected items.
|
|
11
11
|
Or a number value, Default: `null`
|
|
@@ -22,9 +22,10 @@ Only send this prop if you want to fetch `options` asynchronously.
|
|
|
22
22
|
`options` prop will be ignored if this prop is set., Default: `null`
|
|
23
23
|
@param {string|'fuzzy'|'strict'} [search_strategy="fuzzy"] - Filtered options to be displayed strictly based on search text or perform a fuzzy match.
|
|
24
24
|
Fuzzy match will not work if `search` function is set, as the backend service is meant to do the matching., Default: `"fuzzy"`
|
|
25
|
-
@param {number} [
|
|
26
|
-
@param {
|
|
27
|
-
@param {
|
|
25
|
+
@param {number} [score_threshold=3] - Score threshold for fuzzy search strategy, setting high score gives more fuzzy matches., Default: `3`
|
|
26
|
+
@param {number} [scoreThreshold=undefined] - (deprecated) Score threshold for fuzzy search strategy, setting high score gives more fuzzy matches., Default: `undefined`
|
|
27
|
+
@param {SizeOptions} [size=] - Size of the input, Default: ``
|
|
28
|
+
@param {ColorOptions} [color=] - Color of the input, Default: ``
|
|
28
29
|
@param {string} [style=""] - Inline CSS for input container, Default: `""`
|
|
29
30
|
@param {boolean} [readonly=false] - Marks component as read-only, Default: `false`
|
|
30
31
|
@param {boolean} [disabled=false] - Disables the component, Default: `false`
|
|
@@ -70,8 +71,7 @@ Default value: `<span>{option[search_key] || option}</span>`
|
|
|
70
71
|
<li class="tag summary-count is-{size} is-{color || 'primary'}">
|
|
71
72
|
{selectedOptions.length}
|
|
72
73
|
</li>
|
|
73
|
-
<li
|
|
74
|
-
class="tag is-{size} summary-text is-{color || 'primary'} is-light">
|
|
74
|
+
<li class="tag is-{size} summary-text is-{color || 'primary'} is-light">
|
|
75
75
|
Item{selectedOptions.length === 1 ? "" : "s"} selected
|
|
76
76
|
</li>
|
|
77
77
|
{:else}
|
|
@@ -260,15 +260,20 @@ Default value: `<span>{option[search_key] || option}</span>`
|
|
|
260
260
|
* Score threshold for fuzzy search strategy, setting high score gives more fuzzy matches.
|
|
261
261
|
* @type {number}
|
|
262
262
|
*/
|
|
263
|
-
export let
|
|
263
|
+
export let score_threshold = 3;
|
|
264
|
+
/**
|
|
265
|
+
* (deprecated) Score threshold for fuzzy search strategy, setting high score gives more fuzzy matches.
|
|
266
|
+
* @type {number}
|
|
267
|
+
*/
|
|
268
|
+
export let scoreThreshold = score_threshold;
|
|
264
269
|
/**
|
|
265
270
|
* Size of the input
|
|
266
|
-
* @type {
|
|
271
|
+
* @type {SizeOptions}
|
|
267
272
|
*/
|
|
268
273
|
export let size = "";
|
|
269
274
|
/**
|
|
270
275
|
* Color of the input
|
|
271
|
-
* @type {
|
|
276
|
+
* @type {ColorOptions}
|
|
272
277
|
*/
|
|
273
278
|
export let color = "";
|
|
274
279
|
/**
|
|
@@ -12,15 +12,15 @@ Used to populate the list of options in the dropdown, Default: `[]`
|
|
|
12
12
|
this property of each object will be searched, Default: `"name"`
|
|
13
13
|
@param {string} [value_key="id"] - If `options` is an array of objects,
|
|
14
14
|
this property of each object will be returned as the value, Default: `"id"`
|
|
15
|
-
@param {
|
|
16
|
-
@param {
|
|
15
|
+
@param {SizeOptions} [size=] - Size of the input, Default: ``
|
|
16
|
+
@param {ColorOptions} [color=] - Color of the input, Default: ``
|
|
17
17
|
@param {string} [style=""] - Inline CSS for input container, Default: `""`
|
|
18
18
|
@param {boolean} [readonly=false] - Marks component as read-only, Default: `false`
|
|
19
19
|
@param {function|null} [search=null] - Async function to fetch options
|
|
20
20
|
|
|
21
21
|
Only send this prop if you want to fetch `options` asynchronously.
|
|
22
22
|
`options` prop will be ignored if this prop is set., Default: `null`
|
|
23
|
-
@param {'fuzzy'|'strict'} [search_strategy="fuzzy"] - Filtered options to be displayed strictly based on search text or perform a fuzzy match.
|
|
23
|
+
@param {string|'fuzzy'|'strict'} [search_strategy="fuzzy"] - Filtered options to be displayed strictly based on search text or perform a fuzzy match.
|
|
24
24
|
Fuzzy match will not work if `search` function is set, as the backend service is meant to do the matching., Default: `"fuzzy"`
|
|
25
25
|
@param {boolean} [disabled=false] - Disables the component, Default: `false`
|
|
26
26
|
@param {string} [selected_icon="check"] - Icon used to mark selected items in dropdown list, Default: `"check"`
|
|
@@ -84,6 +84,11 @@ Default value: `<span>{option[search_key] || option}</span>`
|
|
|
84
84
|
|
|
85
85
|
const rootContainerId = "kws-overlay-root";
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* @typedef {import('@kws3/ui/types').ColorOptions} ColorOptions
|
|
89
|
+
* @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
|
|
90
|
+
*/
|
|
91
|
+
|
|
87
92
|
/**
|
|
88
93
|
* Value of the Input
|
|
89
94
|
*
|
|
@@ -113,12 +118,12 @@ Default value: `<span>{option[search_key] || option}</span>`
|
|
|
113
118
|
export let value_key = "id";
|
|
114
119
|
/**
|
|
115
120
|
* Size of the input
|
|
116
|
-
* @type {
|
|
121
|
+
* @type {SizeOptions}
|
|
117
122
|
*/
|
|
118
123
|
export let size = "";
|
|
119
124
|
/**
|
|
120
125
|
* Color of the input
|
|
121
|
-
* @type {
|
|
126
|
+
* @type {ColorOptions}
|
|
122
127
|
*/
|
|
123
128
|
export let color = "";
|
|
124
129
|
/**
|
package/helpers/CardModal.svelte
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
@param {string} [title=""] - Title of the modal, Default: `""`
|
|
6
|
-
@param {
|
|
6
|
+
@param {SizeOptions} [size=small] - Size of the modal, Default: `small`
|
|
7
7
|
@param {boolean} [is_active=false] - Determines whether modal is displayed or not, Default: `false`
|
|
8
8
|
@param {boolean} [closable=true] - If this is set to false, the modal cannot be closed using the UI
|
|
9
9
|
|
|
@@ -110,6 +110,11 @@ Only visible when the
|
|
|
110
110
|
<script>
|
|
111
111
|
import { fade, scale } from "svelte/transition";
|
|
112
112
|
import { hasTransitions } from "../settings";
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
|
|
116
|
+
*/
|
|
117
|
+
|
|
113
118
|
/**
|
|
114
119
|
* Title of the modal
|
|
115
120
|
* @type {string}
|
|
@@ -117,7 +122,7 @@ Only visible when the
|
|
|
117
122
|
export let title = "",
|
|
118
123
|
/**
|
|
119
124
|
* Size of the modal
|
|
120
|
-
* @type {
|
|
125
|
+
* @type {SizeOptions}
|
|
121
126
|
*/
|
|
122
127
|
size = "small",
|
|
123
128
|
/**
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
@param {string} [copied_icon="check"] - Icon displayed on successful copy operation, Default: `"check"`
|
|
9
9
|
@param {string} [copy=""] - Text to be copied into clipboard, Default: `""`
|
|
10
10
|
@param {boolean} [copied=false] - Determines if the copy operation has taken place, Default: `false`
|
|
11
|
-
@param {
|
|
11
|
+
@param {ColorOptions} [copied_icon_color=success] - Colour of the `copied_icon` after a succesful copy operation
|
|
12
12
|
|
|
13
|
-
If `''` is selected, Icon will not change colour after copying, Default: `
|
|
13
|
+
If `''` is selected, Icon will not change colour after copying, Default: `success`
|
|
14
14
|
@param {string} [class=""] - CSS classes for the whole component, Default: `""`
|
|
15
15
|
|
|
16
16
|
### Slots
|
|
@@ -73,7 +73,7 @@ If `''` is selected, Icon will not change colour after copying, Default: `"succe
|
|
|
73
73
|
*
|
|
74
74
|
* If `''` is selected, Icon will not change colour after copying
|
|
75
75
|
*
|
|
76
|
-
* @type {
|
|
76
|
+
* @type {ColorOptions}
|
|
77
77
|
*/
|
|
78
78
|
copied_icon_color = "success";
|
|
79
79
|
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
@component
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
@param {string} [title=""] - Title text of the Dialog box
|
|
5
|
+
@param {string} [title=""] - Title text of the Dialog box.
|
|
6
|
+
Will default to `Alert`, `Confirm` or `Prompt` depending on the dialog type, Default: `""`
|
|
6
7
|
@param {string} [help_text=""] - Additional text to provide further context to the user, Default: `""`
|
|
7
|
-
@param {
|
|
8
|
+
@param {SizeOptions} [size=small] - Size of the Dialog box, Default: `small`
|
|
8
9
|
@param {string} [input_value=""] - Default value inside text input displayed on `prompt()` Dialogs, Default: `""`
|
|
9
10
|
@param {string} [icon=""] - Icon in the Dialog box, Default: `""`
|
|
10
|
-
@param {
|
|
11
|
-
@param {
|
|
11
|
+
@param {ColorOptions} [icon_color=primary] - Color of the Icon in the Dialog box, Default: `primary`
|
|
12
|
+
@param {SizeOptions} [icon_size=] - Size of the Icon in the Dialog box, Default: ``
|
|
12
13
|
@param {string} [ok_button_text="Ok"] - Text to be displayed in the OK button, Default: `"Ok"`
|
|
13
|
-
@param {
|
|
14
|
+
@param {ColorOptions} [ok_button_color=primary] - Color of OK button, Default: `primary`
|
|
14
15
|
@param {string} [ok_button_icon="check"] - Icon in the OK button, Default: `"check"`
|
|
15
16
|
@param {string} [cancel_button_text="Cancel"] - Text to be displayed in the Cancel button, Default: `"Cancel"`
|
|
16
|
-
@param {
|
|
17
|
+
@param {ColorOptions} [cancel_button_color=] - Color of Cancel button, Default: ``
|
|
17
18
|
@param {string} [cancel_button_icon="ban"] - Icon in the Cancel button, Default: `"ban"`
|
|
18
19
|
@param {string} [_type=""] - Determines the type of Dialog.
|
|
19
20
|
|
|
@@ -99,7 +100,8 @@ For internal use only - not part of config object, Default: `""`
|
|
|
99
100
|
*/
|
|
100
101
|
|
|
101
102
|
/**
|
|
102
|
-
* Title text of the Dialog box
|
|
103
|
+
* Title text of the Dialog box.
|
|
104
|
+
* Will default to `Alert`, `Confirm` or `Prompt` depending on the dialog type
|
|
103
105
|
* @type {string}
|
|
104
106
|
*/
|
|
105
107
|
export let title = "",
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {string} msg
|
|
4
|
+
* @param {DialogProps} [props={}]
|
|
5
|
+
*/
|
|
6
|
+
export function alert(msg: string, props?: DialogProps): Promise<any>;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param {string} msg
|
|
10
|
+
* @param {DialogProps} [props={}]
|
|
11
|
+
*/
|
|
12
|
+
export function prompt(msg: string, props?: DialogProps): Promise<any>;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param {string} msg
|
|
16
|
+
* @param {DialogProps} [props={}]
|
|
17
|
+
*/
|
|
18
|
+
export function confirm(msg: string, props?: DialogProps): Promise<any>;
|
|
19
|
+
declare const _default: Dialog;
|
|
20
|
+
export default _default;
|
|
21
|
+
export type DialogProps = import('@kws3/ui/types').DialogProps;
|
|
22
|
+
declare class Dialog {
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @param {string} msg
|
|
26
|
+
* @param {DialogProps} [props={}]
|
|
27
|
+
*/
|
|
28
|
+
alert(msg: string, props?: DialogProps): Promise<any>;
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @param {string} msg
|
|
32
|
+
* @param {DialogProps} [props={}]
|
|
33
|
+
*/
|
|
34
|
+
prompt(msg: string, props?: DialogProps): Promise<any>;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @param {string} msg
|
|
38
|
+
* @param {DialogProps} [props={}]
|
|
39
|
+
*/
|
|
40
|
+
confirm(msg: string, props?: DialogProps): Promise<any>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA4DA;;;;GAIG;AACH,2BAHW,MAAM,UACN,WAAW,gBAKrB;AAED;;;;GAIG;AACH,4BAHW,MAAM,UACN,WAAW,gBAKrB;AAED;;;;GAIG;AACH,6BAHW,MAAM,UACN,WAAW,gBAKrB;;;0BArFY,OAAO,gBAAgB,EAAE,WAAW;AA2BjD;IACE;;;;OAIG;IAEH,WAJW,MAAM,UACN,WAAW,gBAKrB;IAED;;;;OAIG;IACH,YAHW,MAAM,UACN,WAAW,gBAIrB;IAED;;;;OAIG;IACH,aAHW,MAAM,UACN,WAAW,gBAIrB;CACF"}
|
package/helpers/Dialog/index.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { default as _Dialog } from "./Dialog.svelte";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {import('@kws3/ui/types').DialogProps} DialogProps
|
|
5
|
+
*/
|
|
2
6
|
|
|
3
7
|
function createDialog(msg, props) {
|
|
4
8
|
props = Object.assign(props, { _text: msg });
|
|
5
9
|
|
|
6
10
|
const promise = new Promise((fulfil) => {
|
|
7
11
|
//@ts-ignore
|
|
8
|
-
const dialog = new
|
|
12
|
+
const dialog = new _Dialog({
|
|
9
13
|
target: document.body,
|
|
10
14
|
props,
|
|
11
15
|
intro: true,
|
|
@@ -24,29 +28,64 @@ function createDialog(msg, props) {
|
|
|
24
28
|
return promise;
|
|
25
29
|
}
|
|
26
30
|
|
|
31
|
+
class Dialog {
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @param {string} msg
|
|
35
|
+
* @param {DialogProps} [props={}]
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
alert(msg, props = {}) {
|
|
39
|
+
return createDialog(msg, { ...props, _type: "alert" });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @param {string} msg
|
|
45
|
+
* @param {DialogProps} [props={}]
|
|
46
|
+
*/
|
|
47
|
+
prompt(msg, props) {
|
|
48
|
+
return createDialog(msg, { ...props, _type: "prompt" });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @param {string} msg
|
|
54
|
+
* @param {DialogProps} [props={}]
|
|
55
|
+
*/
|
|
56
|
+
confirm(msg, props) {
|
|
57
|
+
return createDialog(msg, { ...props, _type: "confirm" });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @param {string} msg
|
|
64
|
+
* @param {DialogProps} [props={}]
|
|
65
|
+
*/
|
|
27
66
|
export function alert(msg, props) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return createDialog(msg, props);
|
|
67
|
+
let dialog = new Dialog();
|
|
68
|
+
return dialog.alert(msg, props);
|
|
31
69
|
}
|
|
32
70
|
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @param {string} msg
|
|
74
|
+
* @param {DialogProps} [props={}]
|
|
75
|
+
*/
|
|
33
76
|
export function prompt(msg, props) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return createDialog(msg, props);
|
|
77
|
+
let dialog = new Dialog();
|
|
78
|
+
return dialog.prompt(msg, props);
|
|
37
79
|
}
|
|
38
80
|
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
* @param {string} msg
|
|
84
|
+
* @param {DialogProps} [props={}]
|
|
85
|
+
*/
|
|
39
86
|
export function confirm(msg, props) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return createDialog(msg, props);
|
|
87
|
+
let dialog = new Dialog();
|
|
88
|
+
return dialog.confirm(msg, props);
|
|
43
89
|
}
|
|
44
90
|
|
|
45
|
-
|
|
46
|
-
Dialog.alert = alert;
|
|
47
|
-
//@ts-ignore
|
|
48
|
-
Dialog.confirm = confirm;
|
|
49
|
-
//@ts-ignore
|
|
50
|
-
Dialog.prompt = prompt;
|
|
51
|
-
|
|
52
|
-
export default Dialog;
|
|
91
|
+
export default new Dialog();
|
package/helpers/Divider.svelte
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
@component
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
@param {
|
|
5
|
+
@param {ColorOptions} [color=] - Color of the Divider lines, Default: ``
|
|
6
6
|
@param {boolean} [light=false] - Whether to display a lighter variant of the `color`, Default: `false`
|
|
7
7
|
@param {boolean} [vertical=false] - Whether to orient the Divider vertically. Vertical Divider take up the height of their parent., Default: `false`
|
|
8
|
-
@param {
|
|
8
|
+
@param {Exclude<Positions, 'start'|'end'>} [alignment=center] - Alignment of the Divider text. `top`/`left` and `bottom`/`right` are analogous for vertical Dividers, Default: `center`
|
|
9
9
|
@param {string} [style=""] - Inline CSS styles for the Divider, Default: `""`
|
|
10
10
|
@param {string} [class=""] - CSS class for Divider, Default: `""`
|
|
11
11
|
|
|
@@ -23,9 +23,15 @@
|
|
|
23
23
|
</div>
|
|
24
24
|
|
|
25
25
|
<script>
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {import('@kws3/ui/types').ColorOptions} ColorOptions
|
|
28
|
+
* @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
|
|
29
|
+
* @typedef {import('@kws3/ui/types').Positions} Positions
|
|
30
|
+
*/
|
|
31
|
+
|
|
26
32
|
/**
|
|
27
33
|
* Color of the Divider lines
|
|
28
|
-
* @type {
|
|
34
|
+
* @type {ColorOptions}
|
|
29
35
|
*/
|
|
30
36
|
export let color = "",
|
|
31
37
|
/**
|
|
@@ -38,7 +44,7 @@
|
|
|
38
44
|
vertical = false,
|
|
39
45
|
/**
|
|
40
46
|
* Alignment of the Divider text. `top`/`left` and `bottom`/`right` are analogous for vertical Dividers
|
|
41
|
-
* @type {
|
|
47
|
+
* @type {Exclude<Positions, 'start'|'end'>}
|
|
42
48
|
*/
|
|
43
49
|
alignment = "center",
|
|
44
50
|
/**
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
@param {string} [message=""] - Message in the notification, Default: `""`
|
|
7
7
|
@param {'notification'|'snackbar'|'toast'} [variant="notification"] - variation of floating UI, Default: `"notification"`
|
|
8
8
|
@param {number} [duration=3000] - Duration of the notification, Default: `3000`
|
|
9
|
-
@param {
|
|
9
|
+
@param {ColorOptions} [color=primary] - Toast notification background color, Default: `primary`
|
|
10
10
|
@param {boolean} [light=false] - Inverted colors for notification box and contents, Default: `false`
|
|
11
11
|
@param {boolean} [dismissable=true] - Determines if notification is dismissable, Default: `true`
|
|
12
12
|
@param {boolean} [persistent=false] - A persistent notification without duration, stays till dismissed, Default: `false`
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export namespace FloatiesStore {
|
|
2
|
+
export { create };
|
|
3
|
+
export { remove };
|
|
4
|
+
export { subscribe };
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {import("@kws3/ui/types").FloatieType} FloatieType
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @type {FloatieType}
|
|
11
|
+
*/
|
|
12
|
+
export const Notifications: FloatieType;
|
|
13
|
+
/**
|
|
14
|
+
* @type {FloatieType}
|
|
15
|
+
*/
|
|
16
|
+
export const Toasts: FloatieType;
|
|
17
|
+
/**
|
|
18
|
+
* @type {FloatieType}
|
|
19
|
+
*/
|
|
20
|
+
export const Snackbars: FloatieType;
|
|
21
|
+
export type FloatieType = import("@kws3/ui/types").FloatieType;
|
|
22
|
+
declare function create(newItem: any): {
|
|
23
|
+
props: any;
|
|
24
|
+
destroy: () => void;
|
|
25
|
+
};
|
|
26
|
+
declare function remove(props: any): void;
|
|
27
|
+
declare const subscribe: (this: void, run: import("svelte/store").Subscriber<{
|
|
28
|
+
top: {
|
|
29
|
+
notification: any[];
|
|
30
|
+
snackbar: any[];
|
|
31
|
+
toast: any[];
|
|
32
|
+
};
|
|
33
|
+
bottom: {
|
|
34
|
+
notification: any[];
|
|
35
|
+
snackbar: any[];
|
|
36
|
+
toast: any[];
|
|
37
|
+
};
|
|
38
|
+
}>, invalidate?: (value?: {
|
|
39
|
+
top: {
|
|
40
|
+
notification: any[];
|
|
41
|
+
snackbar: any[];
|
|
42
|
+
toast: any[];
|
|
43
|
+
};
|
|
44
|
+
bottom: {
|
|
45
|
+
notification: any[];
|
|
46
|
+
snackbar: any[];
|
|
47
|
+
toast: any[];
|
|
48
|
+
};
|
|
49
|
+
}) => void) => import("svelte/store").Unsubscriber;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;AA4GA;;GAEG;AAEH;;GAEG;AACH,4BAFU,WAAW,CAgBnB;AAEF;;GAEG;AACH,qBAFU,WAAW,CAiBnB;AAEF;;GAEG;AACH,wBAFU,WAAW,CAiBnB;0BA5DW,OAAO,gBAAgB,EAAE,WAAW;AAxD/C;;;EA6BC;AAED,0CAYC"}
|
|
@@ -106,6 +106,13 @@ const buildInitialiser = (defaultOpts, mandatoryOpts) => {
|
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* @typedef {import("@kws3/ui/types").FloatieType} FloatieType
|
|
111
|
+
*/
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @type {FloatieType}
|
|
115
|
+
*/
|
|
109
116
|
export const Notifications = {
|
|
110
117
|
create: buildInitialiser(
|
|
111
118
|
{
|
|
@@ -122,6 +129,9 @@ export const Notifications = {
|
|
|
122
129
|
remove: FloatiesStore.remove,
|
|
123
130
|
};
|
|
124
131
|
|
|
132
|
+
/**
|
|
133
|
+
* @type {FloatieType}
|
|
134
|
+
*/
|
|
125
135
|
export const Toasts = {
|
|
126
136
|
create: buildInitialiser(
|
|
127
137
|
{
|
|
@@ -139,6 +149,9 @@ export const Toasts = {
|
|
|
139
149
|
remove: FloatiesStore.remove,
|
|
140
150
|
};
|
|
141
151
|
|
|
152
|
+
/**
|
|
153
|
+
* @type {FloatieType}
|
|
154
|
+
*/
|
|
142
155
|
export const Snackbars = {
|
|
143
156
|
create: buildInitialiser(
|
|
144
157
|
{
|
package/helpers/Icon.svelte
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
@component
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
@param {
|
|
6
|
-
@param {
|
|
5
|
+
@param {SizeOptions} [size=] - Size of the Icon, Default: ``
|
|
6
|
+
@param {ExtendedColorOptions} [color=] - Color of the Icon, Default: ``
|
|
7
7
|
@param {string} [icon=""] - The name of the icon that is to be displayed, from the relevant icon family, Default: `""`
|
|
8
|
-
@param {
|
|
8
|
+
@param {FontFamilies} [family=] - Icon family, can be modified globally in framework settings
|
|
9
9
|
|
|
10
|
-
Ultimately defaults to `fa`, if family is not set anywhere, Default:
|
|
10
|
+
Ultimately defaults to `fa`, if family is not set anywhere, Default: ``
|
|
11
11
|
@param {string} [style=""] - Inline CSS for icon container, Default: `""`
|
|
12
12
|
@param {string} [inner_class=""] - CSS classes for icon, Default: `""`
|
|
13
13
|
@param {string} [inner_style=""] - Inline CSS for icon, Default: `""`
|
|
@@ -65,14 +65,21 @@ Ultimately defaults to `fa`, if family is not set anywhere, Default: `""`
|
|
|
65
65
|
<script>
|
|
66
66
|
import { defaultIconFamily } from "../settings";
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* @typedef {import('@kws3/ui/types').ExtendedColorOptions} ExtendedColorOptions
|
|
70
|
+
* @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
|
|
71
|
+
* @typedef {import('@kws3/ui/types').FontFamilies} FontFamilies
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
|
|
68
75
|
/**
|
|
69
76
|
* Size of the Icon
|
|
70
|
-
* @type {
|
|
77
|
+
* @type {SizeOptions}
|
|
71
78
|
*/
|
|
72
79
|
export let size = "",
|
|
73
80
|
/**
|
|
74
81
|
* Color of the Icon
|
|
75
|
-
* @type {
|
|
82
|
+
* @type {ExtendedColorOptions}
|
|
76
83
|
*/
|
|
77
84
|
color = "",
|
|
78
85
|
/**
|
|
@@ -83,7 +90,7 @@ Ultimately defaults to `fa`, if family is not set anywhere, Default: `""`
|
|
|
83
90
|
* Icon family, can be modified globally in framework settings
|
|
84
91
|
*
|
|
85
92
|
* Ultimately defaults to `fa`, if family is not set anywhere
|
|
86
|
-
* @type {
|
|
93
|
+
* @type {FontFamilies}
|
|
87
94
|
*/
|
|
88
95
|
family = "",
|
|
89
96
|
/**
|
package/helpers/Loader.svelte
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
@component
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
@param {
|
|
6
|
-
@param {
|
|
7
|
-
@param {
|
|
5
|
+
@param {ExtendedColorOptions} [spinner_color=grey] - Color of the Spinner, Default: `grey`
|
|
6
|
+
@param {SizeOptions} [spinner_size=medium] - Size of the Spinner, Default: `medium`
|
|
7
|
+
@param {BGColorOptions} [background_color=transparent] - Backgound color of the Spinner container, Default: `transparent`
|
|
8
8
|
@param {string} [background_size="medium"] - Size of the Spinner container. It can also accept css units
|
|
9
9
|
|
|
10
10
|
**Examples:** `small` | `medium` | `large` | `halfheight` | `fullheight` | `10px` | `5rem` | `100vh`, Default: `"medium"`
|
|
@@ -33,7 +33,7 @@ The overlay is absolutely positioned. Ensure that the parent container is relati
|
|
|
33
33
|
<script>
|
|
34
34
|
/**
|
|
35
35
|
|
|
36
|
-
* @typedef {import('@kws3/ui/types').
|
|
36
|
+
* @typedef {import('@kws3/ui/types').ExtendedColorOptions} ExtendedColorOptions
|
|
37
37
|
* @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
|
|
38
38
|
* @typedef {import('@kws3/ui/types').BGColorOptions} BGColorOptions
|
|
39
39
|
*
|
|
@@ -41,7 +41,7 @@ The overlay is absolutely positioned. Ensure that the parent container is relati
|
|
|
41
41
|
/**
|
|
42
42
|
* Color of the Spinner
|
|
43
43
|
* @link https://bulma.io/documentation/helpers/color-helpers/
|
|
44
|
-
* @type {
|
|
44
|
+
* @type {ExtendedColorOptions}
|
|
45
45
|
*/
|
|
46
46
|
export let spinner_color = "grey",
|
|
47
47
|
/**
|