@kws3/ui 1.6.9 → 1.7.2
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 +17 -0
- package/buttons/SubmitButton.svelte +8 -8
- package/controls/Checkbox.svelte +5 -5
- package/controls/FileUpload.svelte +4 -4
- package/controls/NumberInput.svelte +2 -2
- package/controls/ToggleButtons.svelte +1 -1
- package/datagrid/DataSearch/DataSearch.svelte +7 -6
- package/datagrid/DataSearch/SearchFilter.svelte +25 -10
- package/datagrid/GridView/GridCell.svelte +1 -0
- package/datagrid/GridView/GridRow.svelte +1 -1
- package/datagrid/Pagination/Pagination.svelte +119 -55
- package/datagrid/TileView/TileViewItem.svelte +1 -0
- package/forms/MaskedInput.svelte +1 -1
- package/forms/PasswordValidator/validatePassword.js +2 -2
- package/forms/actions.js +11 -8
- package/forms/colorpicker/Colorpicker.js +18 -13
- package/forms/colorpicker/Colorpicker.svelte +2 -2
- package/forms/select/MultiSelect.svelte +11 -13
- package/helpers/Dialog/Dialog.svelte +13 -14
- package/helpers/Divider.svelte +55 -0
- package/helpers/FloatingUI/Floatie.svelte +11 -5
- package/helpers/FloatingUI/index.js +2 -2
- package/helpers/Icon.svelte +1 -1
- package/helpers/Loader.svelte +4 -4
- package/helpers/Message.svelte +4 -1
- package/helpers/Modal.svelte +10 -2
- package/helpers/Nl2br.svelte +1 -1
- package/helpers/Notification.svelte +1 -1
- package/helpers/Panel.svelte +3 -1
- package/helpers/Popover.svelte +5 -5
- package/helpers/Skeleton.svelte +66 -0
- package/index.js +2 -0
- package/package.json +2 -2
- package/sliding-panes/SlidingPaneSet.svelte +2 -2
- package/styles/DataSort.scss +5 -0
- package/styles/Divider.scss +102 -0
- package/styles/Loader.scss +35 -34
- package/styles/RangeSlider.scss +2 -1
- package/styles/Skeleton.scss +52 -0
- package/styles/Timeline.scss +2 -1
- package/utils/index.js +1 -1
- package/utils/keyboard-events.js +3 -3
|
@@ -7,7 +7,7 @@ export default function (password, options) {
|
|
|
7
7
|
result.items = (options || []).slice().map((_opt) => {
|
|
8
8
|
const opt = Object.assign({}, _opt);
|
|
9
9
|
if (opt && opt.active) {
|
|
10
|
-
if (opt.name
|
|
10
|
+
if (opt.name === "kws_pv_min_length") {
|
|
11
11
|
if (password && password.length >= opt.value) {
|
|
12
12
|
opt.passed = true;
|
|
13
13
|
}
|
|
@@ -24,7 +24,7 @@ export default function (password, options) {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
result.overall =
|
|
27
|
-
result.items.filter((el) => el.passed).length
|
|
27
|
+
result.items.filter((el) => el.passed).length === result.items.length;
|
|
28
28
|
|
|
29
29
|
return result;
|
|
30
30
|
}
|
package/forms/actions.js
CHANGED
|
@@ -3,6 +3,7 @@ import flatpickr from "flatpickr";
|
|
|
3
3
|
function createFlatpickrAction(defaultOpts, hooks) {
|
|
4
4
|
return function (
|
|
5
5
|
node,
|
|
6
|
+
// eslint-disable-next-line no-unused-vars
|
|
6
7
|
{ opts, value, placeholder, klass, style, disabled, color }
|
|
7
8
|
) {
|
|
8
9
|
const _opts = {};
|
|
@@ -49,17 +50,19 @@ function createFlatpickrAction(defaultOpts, hooks) {
|
|
|
49
50
|
|
|
50
51
|
function applyColorClass(instance, color) {
|
|
51
52
|
let contains = false;
|
|
52
|
-
instance.calendarContainer
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
if (instance && instance.calendarContainer) {
|
|
54
|
+
instance.calendarContainer.classList.forEach((c) => {
|
|
55
|
+
if (c.charAt(3).toLowerCase() === "is-") {
|
|
56
|
+
contains = c;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (contains) {
|
|
61
|
+
instance.calendarContainer.classList.remove(contains);
|
|
55
62
|
}
|
|
56
|
-
});
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
instance.calendarContainer.classList.remove(contains);
|
|
64
|
+
instance.calendarContainer.classList.add("is-" + color);
|
|
60
65
|
}
|
|
61
|
-
|
|
62
|
-
instance.calendarContainer.classList.add("is-" + color);
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
function applyInitialInputAttributes(instance, { style }) {
|
|
@@ -255,7 +255,9 @@ export default (function (win, doc) {
|
|
|
255
255
|
|
|
256
256
|
// get mouse/finger coordinate
|
|
257
257
|
function point(el, e) {
|
|
258
|
+
// eslint-disable-next-line no-extra-boolean-cast
|
|
258
259
|
var x = !!e.touches ? e.touches[0].pageX : e.pageX,
|
|
260
|
+
// eslint-disable-next-line no-extra-boolean-cast
|
|
259
261
|
y = !!e.touches ? e.touches[0].pageY : e.pageY,
|
|
260
262
|
left = offset(el).l,
|
|
261
263
|
top = offset(el).t;
|
|
@@ -396,18 +398,21 @@ export default (function (win, doc) {
|
|
|
396
398
|
H_point_H = size(H_point).h,
|
|
397
399
|
SV_point_W = SV_point_size.w,
|
|
398
400
|
SV_point_H = SV_point_size.h;
|
|
401
|
+
|
|
402
|
+
function click(e) {
|
|
403
|
+
var t = e.target,
|
|
404
|
+
is_target = t === target || closest(t, target) === target;
|
|
405
|
+
if (is_target) {
|
|
406
|
+
create();
|
|
407
|
+
} else {
|
|
408
|
+
$.exit();
|
|
409
|
+
}
|
|
410
|
+
trigger(is_target ? "enter" : "exit", [$]);
|
|
411
|
+
}
|
|
412
|
+
|
|
399
413
|
if (first) {
|
|
400
414
|
picker.style.left = picker.style.top = "-9999px";
|
|
401
|
-
|
|
402
|
-
var t = e.target,
|
|
403
|
-
is_target = t === target || closest(t, target) === target;
|
|
404
|
-
if (is_target) {
|
|
405
|
-
create();
|
|
406
|
-
} else {
|
|
407
|
-
$.exit();
|
|
408
|
-
}
|
|
409
|
-
trigger(is_target ? "enter" : "exit", [$]);
|
|
410
|
-
}
|
|
415
|
+
|
|
411
416
|
if (events !== false) {
|
|
412
417
|
on(events, target, click);
|
|
413
418
|
}
|
|
@@ -430,7 +435,7 @@ export default (function (win, doc) {
|
|
|
430
435
|
SV_point.style.right = SV_W - SV_point_W / 2 - SV_W * +HSV[1] + "px";
|
|
431
436
|
SV_point.style.top = SV_H - SV_point_H / 2 - SV_H * +HSV[2] + "px";
|
|
432
437
|
};
|
|
433
|
-
$.exit = function (
|
|
438
|
+
$.exit = function () {
|
|
434
439
|
if (visible()) {
|
|
435
440
|
visible().removeChild(picker);
|
|
436
441
|
$.visible = false;
|
|
@@ -443,8 +448,8 @@ export default (function (win, doc) {
|
|
|
443
448
|
return $;
|
|
444
449
|
};
|
|
445
450
|
function color(e) {
|
|
446
|
-
var a = HSV2RGB(HSV),
|
|
447
|
-
|
|
451
|
+
//var a = HSV2RGB(HSV),
|
|
452
|
+
var b = HSV2RGB([HSV[0], 1, 1]);
|
|
448
453
|
SV.style.backgroundColor = "rgb(" + b.join(",") + ")";
|
|
449
454
|
set_data(HSV);
|
|
450
455
|
prevent(e);
|
|
@@ -116,7 +116,7 @@ This property can be bound to, to fetch the current colour, Default: `"000000"`
|
|
|
116
116
|
e && e.target && e.target.select();
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
function onDragOver(
|
|
119
|
+
function onDragOver() {
|
|
120
120
|
if (!readonly && !disabled) {
|
|
121
121
|
dragover = true;
|
|
122
122
|
}
|
|
@@ -131,7 +131,7 @@ This property can be bound to, to fetch the current colour, Default: `"000000"`
|
|
|
131
131
|
return false;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
function onDragLeave(
|
|
134
|
+
function onDragLeave() {
|
|
135
135
|
if (!readonly && !disabled) {
|
|
136
136
|
dragover = false;
|
|
137
137
|
}
|
|
@@ -22,9 +22,7 @@ this property of each object will be returned as the value, Default: `"id"`
|
|
|
22
22
|
@param {boolean} [readonly=false] - Marks component as read-only, Default: `false`
|
|
23
23
|
@param {boolean} [disabled=false] - Disables the component, Default: `false`
|
|
24
24
|
@param {string} [selected_icon="check"] - Icon used to mark selected items in dropdown list, Default: `"check"`
|
|
25
|
-
@param {boolean} [summary_mode=false] -
|
|
26
|
-
|
|
27
|
-
Instead of listing all the selected items inside the input., Default: `false`
|
|
25
|
+
@param {boolean} [summary_mode=false] - Shows only the number of items selected, instead of listing all the selected items in the input., Default: `false`
|
|
28
26
|
@param {string} [no_options_msg="No matching options"] - Message to display when no matching options are found, Default: `"No matching options"`
|
|
29
27
|
@param {string} [remove_btn_tip="Remove"] - Tooltip text for Remove Item button. This `string` will precede the selected Item Name in the tooltip., Default: `"Remove"`
|
|
30
28
|
@param {string} [remove_all_tip="Remove all"] - Tooltip text for the Clear All button, Default: `"Remove all"`
|
|
@@ -66,7 +64,7 @@ Default value: `<span>{option[search_key] || option}</span>`
|
|
|
66
64
|
</li>
|
|
67
65
|
<li
|
|
68
66
|
class="tag is-{size} summary-text is-{color || 'primary'} is-light">
|
|
69
|
-
Item{selectedOptions.length
|
|
67
|
+
Item{selectedOptions.length === 1 ? "" : "s"} selected
|
|
70
68
|
</li>
|
|
71
69
|
{:else}
|
|
72
70
|
{#each selectedOptions as tag}
|
|
@@ -225,9 +223,7 @@ Default value: `<span>{option[search_key] || option}</span>`
|
|
|
225
223
|
*/
|
|
226
224
|
export let selected_icon = "check";
|
|
227
225
|
/**
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
* Instead of listing all the selected items inside the input.
|
|
226
|
+
* Shows only the number of items selected, instead of listing all the selected items in the input.
|
|
231
227
|
*/
|
|
232
228
|
export let summary_mode = false;
|
|
233
229
|
/**
|
|
@@ -298,9 +294,10 @@ Default value: `<span>{option[search_key] || option}</span>`
|
|
|
298
294
|
$: _placeholder = hasValue ? "" : placeholder;
|
|
299
295
|
|
|
300
296
|
//ensure search_key and value_key are no empty strings
|
|
301
|
-
$: used_search_key = search_key && search_key
|
|
302
|
-
$: used_value_key = value_key && value_key
|
|
297
|
+
$: used_search_key = search_key && search_key !== "" ? search_key : "name";
|
|
298
|
+
$: used_value_key = value_key && value_key !== "" ? value_key : "id";
|
|
303
299
|
|
|
300
|
+
// eslint-disable-next-line no-redeclare
|
|
304
301
|
$: shouldShowClearAll = hasValue;
|
|
305
302
|
|
|
306
303
|
$: options, normaliseOptions();
|
|
@@ -322,7 +319,7 @@ Default value: `<span>{option[search_key] || option}</span>`
|
|
|
322
319
|
//TODO: optimise isSelected function
|
|
323
320
|
$: isSelected = (option) => {
|
|
324
321
|
if (single) return matchesValue(value, option);
|
|
325
|
-
if (!(value && value.length > 0) || value
|
|
322
|
+
if (!(value && value.length > 0) || value === "") return false;
|
|
326
323
|
// nothing is selected if `value` is the empty array or string
|
|
327
324
|
else return value.some((v) => matchesValue(v, option));
|
|
328
325
|
};
|
|
@@ -384,13 +381,13 @@ Default value: `<span>{option[search_key] || option}</span>`
|
|
|
384
381
|
function fillSelectedOptions() {
|
|
385
382
|
if (single) {
|
|
386
383
|
selectedOptions = normalisedOptions.filter(
|
|
387
|
-
(v) => `${v[used_value_key]}`
|
|
384
|
+
(v) => `${v[used_value_key]}` === `${value}`
|
|
388
385
|
);
|
|
389
386
|
setSingleVisibleValue();
|
|
390
387
|
} else {
|
|
391
388
|
selectedOptions = normalisedOptions
|
|
392
389
|
.filter(
|
|
393
|
-
(v) => value && value.some((vl) => `${v[used_value_key]}`
|
|
390
|
+
(v) => value && value.some((vl) => `${v[used_value_key]}` === `${vl}`)
|
|
394
391
|
)
|
|
395
392
|
.sort(
|
|
396
393
|
(a, b) =>
|
|
@@ -440,7 +437,8 @@ Default value: `<span>{option[search_key] || option}</span>`
|
|
|
440
437
|
if (!isAlreadySelected && !single && (max === null || value.length < max)) {
|
|
441
438
|
//attach to value array while filtering out invalid values
|
|
442
439
|
value = [...value, token[used_value_key]].filter((v) => {
|
|
443
|
-
return normalisedOptions.filter((nv) => nv[used_value_key]
|
|
440
|
+
return normalisedOptions.filter((nv) => nv[used_value_key] === v)
|
|
441
|
+
.length;
|
|
444
442
|
});
|
|
445
443
|
searchText = ""; // reset search string on selection
|
|
446
444
|
|
|
@@ -30,15 +30,16 @@ For internal use only - not part of config object, Default: `""`
|
|
|
30
30
|
<CardModal title={titleToUse} {size} {is_active} closable={false}>
|
|
31
31
|
<div slot="default">
|
|
32
32
|
<div class="columns is-vcentered is-mobile">
|
|
33
|
-
{#if icon && icon
|
|
33
|
+
{#if icon && icon !== ""}
|
|
34
34
|
<div class="column is-narrow">
|
|
35
35
|
<Icon {icon} size={icon_size} color={icon_color} />
|
|
36
36
|
</div>
|
|
37
37
|
{/if}
|
|
38
38
|
<div class="column">
|
|
39
39
|
<div>
|
|
40
|
+
<!-- eslint-disable-next-line @ota-meshi/svelte/no-at-html-tags -->
|
|
40
41
|
<span class="is-block">{@html _text}</span>
|
|
41
|
-
{#if _type
|
|
42
|
+
{#if _type === "prompt"}
|
|
42
43
|
<div class="field" style="margin-top:0.5rem;">
|
|
43
44
|
<div class="control">
|
|
44
45
|
<input
|
|
@@ -50,7 +51,7 @@ For internal use only - not part of config object, Default: `""`
|
|
|
50
51
|
</div>
|
|
51
52
|
</div>
|
|
52
53
|
{/if}
|
|
53
|
-
{#if help_text && help_text
|
|
54
|
+
{#if help_text && help_text !== ""}
|
|
54
55
|
<span class="help">{help_text}</span>
|
|
55
56
|
{/if}
|
|
56
57
|
</div>
|
|
@@ -59,20 +60,24 @@ For internal use only - not part of config object, Default: `""`
|
|
|
59
60
|
</div>
|
|
60
61
|
<div slot="footer" style="width:100%">
|
|
61
62
|
<div class="field is-grouped is-grouped-right">
|
|
62
|
-
{#if _type
|
|
63
|
+
{#if _type !== "alert"}
|
|
63
64
|
<div class="control">
|
|
64
|
-
<button
|
|
65
|
-
|
|
65
|
+
<button
|
|
66
|
+
type="button"
|
|
67
|
+
on:click={cancel}
|
|
68
|
+
class="button is-{cancel_button_color}"
|
|
69
|
+
>{#if cancel_button_icon !== ""}<Icon
|
|
66
70
|
icon={cancel_button_icon}
|
|
67
71
|
size="small" />{/if}<span>{cancel_button_text}</span></button>
|
|
68
72
|
</div>
|
|
69
73
|
{/if}
|
|
70
74
|
<div class="control">
|
|
71
75
|
<button
|
|
76
|
+
type="button"
|
|
72
77
|
bind:this={ok_button}
|
|
73
78
|
on:click={ok}
|
|
74
79
|
class="button is-{ok_button_color}"
|
|
75
|
-
>{#if ok_button_icon
|
|
80
|
+
>{#if ok_button_icon !== ""}<Icon
|
|
76
81
|
icon={ok_button_icon}
|
|
77
82
|
size="small" />{/if}<span>{ok_button_text}</span></button>
|
|
78
83
|
</div>
|
|
@@ -170,7 +175,7 @@ For internal use only - not part of config object, Default: `""`
|
|
|
170
175
|
input_box,
|
|
171
176
|
ok_button;
|
|
172
177
|
|
|
173
|
-
$: titleToUse = title
|
|
178
|
+
$: titleToUse = title !== "" ? title : capitaliseFirstLetter(_type);
|
|
174
179
|
|
|
175
180
|
/**
|
|
176
181
|
* Determines the type of Dialog.
|
|
@@ -204,13 +209,10 @@ For internal use only - not part of config object, Default: `""`
|
|
|
204
209
|
switch (_type) {
|
|
205
210
|
case "alert":
|
|
206
211
|
return;
|
|
207
|
-
break;
|
|
208
212
|
case "confirm":
|
|
209
213
|
return true;
|
|
210
|
-
break;
|
|
211
214
|
case "prompt":
|
|
212
215
|
return input_value;
|
|
213
|
-
break;
|
|
214
216
|
}
|
|
215
217
|
}
|
|
216
218
|
|
|
@@ -218,13 +220,10 @@ For internal use only - not part of config object, Default: `""`
|
|
|
218
220
|
switch (_type) {
|
|
219
221
|
case "alert":
|
|
220
222
|
return;
|
|
221
|
-
break;
|
|
222
223
|
case "confirm":
|
|
223
224
|
return false;
|
|
224
|
-
break;
|
|
225
225
|
case "prompt":
|
|
226
226
|
return null;
|
|
227
|
-
break;
|
|
228
227
|
}
|
|
229
228
|
}
|
|
230
229
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@param {'' | 'warning' | 'info' | 'danger' | 'primary' | 'success' | 'link' | 'dark' | 'light'} [color=""] - Color of the Divider lines, Default: `""`
|
|
6
|
+
@param {boolean} [light=false] - Whether to display a lighter variant of the `color`, Default: `false`
|
|
7
|
+
@param {boolean} [vertical=false] - Whether to orient the Divider vertically. Vertical Divider take up the height of their parent., Default: `false`
|
|
8
|
+
@param {'center' | 'left' | 'right' | 'top' | 'bottom'} [alignment="center"] - Alignment of the Divider text. `top`/`left` and `bottom`/`right` are analogous for vertical Dividers, Default: `"center"`
|
|
9
|
+
@param {string} [style=""] - Inline CSS styles for the Divider, Default: `""`
|
|
10
|
+
@param {string} [class=""] - CSS class for Divider, Default: `""`
|
|
11
|
+
|
|
12
|
+
### Slots
|
|
13
|
+
- `<slot name="default" />` - Default slot for text inside Divider
|
|
14
|
+
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
<div
|
|
18
|
+
class:is-vertical={vertical}
|
|
19
|
+
class:is-light={light}
|
|
20
|
+
class="kws-divider is-{alignment} is-{color} {klass}"
|
|
21
|
+
{style}>
|
|
22
|
+
<!--Default slot for text inside Divider--><slot />
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
/**
|
|
27
|
+
* Color of the Divider lines
|
|
28
|
+
* @type {'' | 'warning' | 'info' | 'danger' | 'primary' | 'success' | 'link' | 'dark' | 'light'}
|
|
29
|
+
*/
|
|
30
|
+
export let color = "",
|
|
31
|
+
/**
|
|
32
|
+
* Whether to display a lighter variant of the `color`
|
|
33
|
+
*/
|
|
34
|
+
light = false,
|
|
35
|
+
/**
|
|
36
|
+
* Whether to orient the Divider vertically. Vertical Divider take up the height of their parent.
|
|
37
|
+
*/
|
|
38
|
+
vertical = false,
|
|
39
|
+
/**
|
|
40
|
+
* Alignment of the Divider text. `top`/`left` and `bottom`/`right` are analogous for vertical Dividers
|
|
41
|
+
* @type {'center' | 'left' | 'right' | 'top' | 'bottom'}
|
|
42
|
+
*/
|
|
43
|
+
alignment = "center",
|
|
44
|
+
/**
|
|
45
|
+
* Inline CSS styles for the Divider
|
|
46
|
+
*/
|
|
47
|
+
style = "";
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* CSS class for Divider
|
|
51
|
+
* @type {string}
|
|
52
|
+
*/
|
|
53
|
+
let klass = "";
|
|
54
|
+
export { klass as class };
|
|
55
|
+
</script>
|
|
@@ -18,12 +18,13 @@
|
|
|
18
18
|
|
|
19
19
|
-->
|
|
20
20
|
|
|
21
|
-
{#if variant
|
|
21
|
+
{#if variant === "snackbar"}
|
|
22
22
|
<div class="snackbar is-{color} {light ? 'is-light' : ''}">
|
|
23
23
|
<div class="text">{message}</div>
|
|
24
24
|
<div class="action">
|
|
25
25
|
{#each buttonsToRender as { text, color: text_color, click }}
|
|
26
26
|
<button
|
|
27
|
+
type="button"
|
|
27
28
|
class="button is-{color} has-text-{text_color}"
|
|
28
29
|
on:click={click}
|
|
29
30
|
on:click={destroy}>{text}</button>
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
<div class="floatie-progress" style="animation-duration:{duration}ms" />
|
|
34
35
|
{/if}
|
|
35
36
|
</div>
|
|
36
|
-
{:else if variant
|
|
37
|
+
{:else if variant === "toast"}
|
|
37
38
|
<div class="toast is-{color} {light ? 'is-light' : ''}">
|
|
38
39
|
{message}
|
|
39
40
|
</div>
|
|
@@ -43,12 +44,13 @@
|
|
|
43
44
|
<svelte:component this={component} {...$$props} on:destroy={destroy} />
|
|
44
45
|
{:else}
|
|
45
46
|
{#if dismissable}
|
|
46
|
-
<button class="delete" on:click={destroy} />
|
|
47
|
+
<button type="button" class="delete" on:click={destroy} />
|
|
47
48
|
{/if}
|
|
48
49
|
{#if title}
|
|
49
50
|
<h4 class="title is-5 is-marginless">{title}</h4>
|
|
50
51
|
{/if}
|
|
51
52
|
|
|
53
|
+
<!-- eslint-disable-next-line @ota-meshi/svelte/no-at-html-tags -->
|
|
52
54
|
<p>{@html message}</p>
|
|
53
55
|
|
|
54
56
|
{#if !persistent}
|
|
@@ -109,11 +111,15 @@
|
|
|
109
111
|
/**
|
|
110
112
|
* Callback function call before close event
|
|
111
113
|
*/
|
|
112
|
-
beforeClose = (props) => {
|
|
114
|
+
beforeClose = (props) => {
|
|
115
|
+
props;
|
|
116
|
+
},
|
|
113
117
|
/**
|
|
114
118
|
* Callback function call after close event
|
|
115
119
|
*/
|
|
116
|
-
afterClose = (props) => {
|
|
120
|
+
afterClose = (props) => {
|
|
121
|
+
props;
|
|
122
|
+
},
|
|
117
123
|
/**
|
|
118
124
|
* List of buttons to show in snackbar
|
|
119
125
|
*/
|
|
@@ -62,7 +62,7 @@ export const FloatiesStore = (() => {
|
|
|
62
62
|
newItem.variant = "notification";
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
if (!newItem.position || newItem.position
|
|
65
|
+
if (!newItem.position || newItem.position === "") {
|
|
66
66
|
newItem.position = DEFAULT_POSITIONS[newItem.variant];
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -88,7 +88,7 @@ export const FloatiesStore = (() => {
|
|
|
88
88
|
let _items = items[_position][_variant];
|
|
89
89
|
|
|
90
90
|
items[_position][_variant] = _items.slice().filter((el) => {
|
|
91
|
-
return el && el.id && el.id
|
|
91
|
+
return el && el.id && el.id !== props.id;
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
return items;
|
package/helpers/Icon.svelte
CHANGED
|
@@ -99,7 +99,7 @@ Ultimately defaults to `fa`, if family is not set anywhere, Default: `""`
|
|
|
99
99
|
|
|
100
100
|
$: {
|
|
101
101
|
usedFamily =
|
|
102
|
-
family && family
|
|
102
|
+
family && family !== "" ? family : globalFamily ? globalFamily : "fa";
|
|
103
103
|
|
|
104
104
|
switch (usedFamily) {
|
|
105
105
|
case "lar":
|
package/helpers/Loader.svelte
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
@param {'grey' | 'light' | 'warning' | 'info' | 'danger' | 'primary' | 'success'} [spinner_color="grey"] - Color of the Spinner, Default: `"grey"`
|
|
6
6
|
@param {'small'|'medium'|'large'} [spinner_size="medium"] - Size of the Spinner, Default: `"medium"`
|
|
7
7
|
@param {'transparent' | 'warning' | 'info' | 'danger' | 'primary' | 'success' | 'link'} [background_color="transparent"] - Backgound color of the Spinner container, Default: `"transparent"`
|
|
8
|
-
@param {string} [background_size="medium"] - Size of the Spinner container.
|
|
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"`
|
|
11
11
|
@param {boolean} [is_inline=false] - Determines if the Loader is inline or not, Default: `false`
|
|
@@ -48,7 +48,7 @@ The overlay is absolutely positioned. Ensure that the parent container is relati
|
|
|
48
48
|
*/
|
|
49
49
|
background_color = "transparent",
|
|
50
50
|
/**
|
|
51
|
-
* Size of the Spinner container.
|
|
51
|
+
* Size of the Spinner container. It can also accept css units
|
|
52
52
|
*
|
|
53
53
|
* **Examples:** `small` | `medium` | `large` | `halfheight` | `fullheight` | `10px` | `5rem` | `100vh`
|
|
54
54
|
*/
|
|
@@ -86,14 +86,14 @@ The overlay is absolutely positioned. Ensure that the parent container is relati
|
|
|
86
86
|
|
|
87
87
|
function determineHeightStyles() {
|
|
88
88
|
if (
|
|
89
|
-
bg_sizes.indexOf(background_size)
|
|
89
|
+
bg_sizes.indexOf(background_size) === -1 &&
|
|
90
90
|
typeof background_size == "string" &&
|
|
91
91
|
background_size.length
|
|
92
92
|
) {
|
|
93
93
|
_height = "height: " + background_size + ";";
|
|
94
94
|
|
|
95
95
|
_style =
|
|
96
|
-
(style.length && style.charAt(style.length - 1)
|
|
96
|
+
(style.length && style.charAt(style.length - 1) !== ";"
|
|
97
97
|
? style + ";"
|
|
98
98
|
: style) + _height;
|
|
99
99
|
_background_size = "";
|
package/helpers/Message.svelte
CHANGED
|
@@ -41,7 +41,10 @@ The parent can then decide what to do with the component
|
|
|
41
41
|
<slot name="title"><p>{title}</p></slot>
|
|
42
42
|
{/if}
|
|
43
43
|
{#if dismissable}
|
|
44
|
-
<button
|
|
44
|
+
<button
|
|
45
|
+
type="button"
|
|
46
|
+
class="delete is-pulled-right is-{size}"
|
|
47
|
+
on:click={dismiss} />
|
|
45
48
|
{/if}
|
|
46
49
|
</div>
|
|
47
50
|
<div class="message-body {inner_class}" style={inner_style}>
|
package/helpers/Modal.svelte
CHANGED
|
@@ -13,6 +13,8 @@ Only programmatic closing is possible, Default: `true`
|
|
|
13
13
|
@param {string} [inner_class=""] - CSS classes for modal content, Default: `""`
|
|
14
14
|
@param {string} [cy=""] - data-cy attribute for cypress, Default: `""`
|
|
15
15
|
@param {string} [class=""] - CSS class for modal container, Default: `""`
|
|
16
|
+
@method `close()` - Call this method to close modal programmatically
|
|
17
|
+
@method `open()` - Call this method to open modal programmatically
|
|
16
18
|
|
|
17
19
|
### Slots
|
|
18
20
|
- `<slot name="default" />` - Used for the Modal content
|
|
@@ -114,11 +116,17 @@ Only programmatic closing is possible, Default: `true`
|
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
118
|
|
|
117
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Call this method to close modal programmatically
|
|
121
|
+
*/
|
|
122
|
+
export function close() {
|
|
118
123
|
is_active = false;
|
|
119
124
|
}
|
|
120
125
|
|
|
121
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Call this method to open modal programmatically
|
|
128
|
+
*/
|
|
129
|
+
export function open() {
|
|
122
130
|
is_active = true;
|
|
123
131
|
}
|
|
124
132
|
</script>
|
package/helpers/Nl2br.svelte
CHANGED
|
@@ -23,7 +23,7 @@ The parent can then decide what to do with the component
|
|
|
23
23
|
class="notification is-{color} {light ? 'is-light' : ''} {klass}"
|
|
24
24
|
{style}>
|
|
25
25
|
{#if dismissable}
|
|
26
|
-
<button class="delete" on:click={dismiss} />
|
|
26
|
+
<button type="button" class="delete" on:click={dismiss} />
|
|
27
27
|
{/if}
|
|
28
28
|
<!--Used for notification content--><slot />
|
|
29
29
|
</div>
|
package/helpers/Panel.svelte
CHANGED
|
@@ -43,11 +43,12 @@ This will not work if there is no title area
|
|
|
43
43
|
class="panel {klass}"
|
|
44
44
|
{style}
|
|
45
45
|
data-cy={cy}>
|
|
46
|
-
{#if title
|
|
46
|
+
{#if title !== "" || has_title}
|
|
47
47
|
<div class="panel-heading" on:click={toggle}>
|
|
48
48
|
<div class="level is-mobile">
|
|
49
49
|
<div class="level-left">
|
|
50
50
|
<div class="level-item">
|
|
51
|
+
<!-- eslint-disable-next-line @ota-meshi/svelte/no-at-html-tags -->
|
|
51
52
|
<h2 class="subtitle">{@html title}</h2>
|
|
52
53
|
</div>
|
|
53
54
|
</div>
|
|
@@ -73,6 +74,7 @@ This will not work if there is no title area
|
|
|
73
74
|
</div>
|
|
74
75
|
{/if}
|
|
75
76
|
<div class="level-item">
|
|
77
|
+
<!-- eslint-disable-next-line @ota-meshi/svelte/no-at-html-tags -->
|
|
76
78
|
<h2 class="subtitle is-6">{@html subtitle}</h2>
|
|
77
79
|
</div>
|
|
78
80
|
<span class="collapsor level-item">
|
package/helpers/Popover.svelte
CHANGED
|
@@ -23,11 +23,11 @@ When set to `null`, it will use the content of the `popover` slot, Default: `nul
|
|
|
23
23
|
It can be any CSS value associated with `max-width` property, including `"none"`, Default: `"none"`
|
|
24
24
|
@param {string} [style=""] - Inline CSS for Popover trigger, Default: `""`
|
|
25
25
|
@param {string} [class=""] - CSS classes for Popover trigger, Default: `""`
|
|
26
|
-
@
|
|
27
|
-
@
|
|
28
|
-
@
|
|
29
|
-
@
|
|
30
|
-
@
|
|
26
|
+
@method `open()` - Open method
|
|
27
|
+
@method `close()` - Close method
|
|
28
|
+
@method `enable()` - Enable method
|
|
29
|
+
@method `disable()` - Disable method
|
|
30
|
+
@method `setProps(props)` - SetProps method
|
|
31
31
|
|
|
32
32
|
### Events
|
|
33
33
|
- `opening` - Triggered when popover is opening
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@param {number} [lines=1] - Lines property, Default: `1`
|
|
6
|
+
@param {string} [width="100%"] - CSS string denoting width of the Skeleton
|
|
7
|
+
**Examples:** `10px` | `5rem` | `100vh`, Default: `"100%"`
|
|
8
|
+
@param {string} [height="auto"] - CSS string denoting height of the Skeleton
|
|
9
|
+
**Examples:** `10px` | `5rem` | `100vh` | `auto`, Default: `"auto"`
|
|
10
|
+
@param {string} [radius="0px"] - CSS string denoting border-radius of the Skeleton
|
|
11
|
+
**Examples:** `10px` | `5rem`, Default: `"0px"`
|
|
12
|
+
@param {boolean} [circle=false] - Whether the Skeleton should be rendered as a circle.
|
|
13
|
+
If this is set to `true`, the `radius` property will be ignored., Default: `false`
|
|
14
|
+
@param {'' | 'transparent' | 'warning' | 'info' | 'danger' | 'primary' | 'success' | 'link'} [color=""] - Color of the Skeleton lines, Default: `""`
|
|
15
|
+
@param {string} [class=""] - CSS class for Skeleton, Default: `""`
|
|
16
|
+
|
|
17
|
+
-->
|
|
18
|
+
<!-- eslint-disable-next-line no-unused-vars -->
|
|
19
|
+
{#each { length: lines } as _, i}
|
|
20
|
+
<span
|
|
21
|
+
class="kws-skeleton is-{color} {klass}"
|
|
22
|
+
style="width:{width};height:{height};border-radius:{border_radius}">
|
|
23
|
+
‌
|
|
24
|
+
</span>
|
|
25
|
+
{/each}
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
export let /**
|
|
29
|
+
* Number of lines of text to display.
|
|
30
|
+
*/
|
|
31
|
+
lines = 1,
|
|
32
|
+
/**
|
|
33
|
+
* CSS string denoting width of the Skeleton
|
|
34
|
+
* **Examples:** `10px` | `5rem` | `100vh`
|
|
35
|
+
*/
|
|
36
|
+
width = "100%",
|
|
37
|
+
/**
|
|
38
|
+
* CSS string denoting height of the Skeleton
|
|
39
|
+
* **Examples:** `10px` | `5rem` | `100vh` | `auto`
|
|
40
|
+
*/
|
|
41
|
+
height = "auto",
|
|
42
|
+
/**
|
|
43
|
+
* CSS string denoting border-radius of the Skeleton
|
|
44
|
+
* **Examples:** `10px` | `5rem`
|
|
45
|
+
*/
|
|
46
|
+
radius = "0px",
|
|
47
|
+
/**
|
|
48
|
+
* Whether the Skeleton should be rendered as a circle.
|
|
49
|
+
* If this is set to `true`, the `radius` property will be ignored.
|
|
50
|
+
*/
|
|
51
|
+
circle = false,
|
|
52
|
+
/**
|
|
53
|
+
* Color of the Skeleton lines
|
|
54
|
+
* @type {'' | 'transparent' | 'warning' | 'info' | 'danger' | 'primary' | 'success' | 'link'}
|
|
55
|
+
*/
|
|
56
|
+
color = "";
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* CSS class for Skeleton
|
|
60
|
+
* @type {string}
|
|
61
|
+
*/
|
|
62
|
+
let klass = "";
|
|
63
|
+
export { klass as class };
|
|
64
|
+
|
|
65
|
+
$: border_radius = circle ? "50%" : radius;
|
|
66
|
+
</script>
|
package/index.js
CHANGED
|
@@ -10,6 +10,8 @@ export { default as Panel } from "./helpers/Panel.svelte";
|
|
|
10
10
|
export { default as Notification } from "./helpers/Notification.svelte";
|
|
11
11
|
export { default as Loader } from "./helpers/Loader.svelte";
|
|
12
12
|
export { default as ActionSheet } from "./helpers/ActionSheet.svelte";
|
|
13
|
+
export { default as Skeleton } from "./helpers/Skeleton.svelte";
|
|
14
|
+
export { default as Divider } from "./helpers/Divider.svelte";
|
|
13
15
|
export { default as Timeline } from "./helpers/Timeline/Timeline.svelte";
|
|
14
16
|
export { default as TimelineItem } from "./helpers/Timeline/TimelineItem.svelte";
|
|
15
17
|
export { default as TimelineHeader } from "./helpers/Timeline/TimelineHeader.svelte";
|