@kws3/ui 1.6.9 → 1.7.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 +5 -0
- package/buttons/SubmitButton.svelte +6 -6
- package/datagrid/DataSearch/SearchFilter.svelte +20 -5
- package/helpers/Popover.svelte +5 -5
- package/helpers/Skeleton.svelte +65 -0
- package/index.js +1 -0
- package/package.json +2 -2
- package/sliding-panes/SlidingPaneSet.svelte +2 -2
- package/styles/DataSort.scss +5 -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/CHANGELOG.mdx
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## 1.7.0
|
|
2
|
+
- Ensure uniform usage of $kws-theme-colors across all components, this means $kws-theme-colors can be indepnedent of the global $colors SCSS variable.
|
|
3
|
+
- `DataSearch` component: Expand filters to fill area when main search input is not present.
|
|
4
|
+
- `DataSort` component: Increase click area for activating dropdown, and provide visual segementation between label and dropdown.
|
|
5
|
+
- New `Skeleton` component.
|
|
1
6
|
|
|
2
7
|
## 1.6.9
|
|
3
8
|
- New `Timeline`, `TimelineItem` and `TimelineHeader` components.
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
@param {number} [completion_timeout=600] - How long to wait before `saved` event is fired, and the UI state reverts back to normal, Default: `600`
|
|
16
16
|
@param {number} [error_timeout=3000] - How long to wait before `error` event is fired, and the UI state reverts back to normal, Default: `3000`
|
|
17
17
|
@param {string} [class=""] - CSS classes for Button container, Default: `""`
|
|
18
|
-
@
|
|
19
|
-
@
|
|
20
|
-
@
|
|
18
|
+
@method `saving()` - call this method on form saving state
|
|
19
|
+
@method `saved(callback, timeout)` - call this method after form saved
|
|
20
|
+
@method `error(callback, timeout)` - call this method on form error state
|
|
21
21
|
|
|
22
22
|
### Events
|
|
23
23
|
- `saved` - Fired on successful submission
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
export { klass as class };
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
|
-
* call this
|
|
118
|
+
* call this method on form saving state
|
|
119
119
|
*/
|
|
120
120
|
export function saving() {
|
|
121
121
|
tracker = {
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
|
-
* call this
|
|
129
|
+
* call this method after form saved
|
|
130
130
|
*/
|
|
131
131
|
export function saved(callback, timeout = completion_timeout) {
|
|
132
132
|
tracker = {
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
/**
|
|
153
|
-
* call this
|
|
153
|
+
* call this method on form error state
|
|
154
154
|
*/
|
|
155
155
|
export function error(callback, timeout = error_timeout) {
|
|
156
156
|
tracker = {
|
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
-->
|
|
12
12
|
|
|
13
13
|
{#if filter.type == "multiselect"}
|
|
14
|
-
<div
|
|
14
|
+
<div
|
|
15
|
+
class="control search-control"
|
|
16
|
+
class:is-expanded={shouldExpandToFill}
|
|
17
|
+
style={filterWidthStyle}>
|
|
15
18
|
<MultiSelect
|
|
16
19
|
options={sanitizedOptions}
|
|
17
20
|
placeholder={`Any ${name}`}
|
|
@@ -23,14 +26,20 @@
|
|
|
23
26
|
class={hilightClass} />
|
|
24
27
|
</div>
|
|
25
28
|
{:else if filter.type == "date"}
|
|
26
|
-
<div
|
|
29
|
+
<div
|
|
30
|
+
class="control search-control"
|
|
31
|
+
class:is-expanded={shouldExpandToFill}
|
|
32
|
+
style={filterWidthStyle}>
|
|
27
33
|
<Datepicker
|
|
28
34
|
class={hilightClass}
|
|
29
35
|
bind:value={filterVals[filter.name]}
|
|
30
36
|
placeholder="{capitaliseFirstLetter(name)} Date" />
|
|
31
37
|
</div>
|
|
32
38
|
{:else if filter.type == "daterange"}
|
|
33
|
-
<div
|
|
39
|
+
<div
|
|
40
|
+
class="control search-control"
|
|
41
|
+
class:is-expanded={shouldExpandToFill}
|
|
42
|
+
style={filterWidthStyle}>
|
|
34
43
|
<Datepicker
|
|
35
44
|
class={hilightClass}
|
|
36
45
|
bind:value={filterVals[filter.name]}
|
|
@@ -38,7 +47,10 @@
|
|
|
38
47
|
placeholder="{capitaliseFirstLetter(name)} Date Range" />
|
|
39
48
|
</div>
|
|
40
49
|
{:else if filter.options.length > 10}
|
|
41
|
-
<div
|
|
50
|
+
<div
|
|
51
|
+
class="control search-control"
|
|
52
|
+
class:is-expanded={shouldExpandToFill}
|
|
53
|
+
style={filterWidthStyle}>
|
|
42
54
|
<SearchableSelect
|
|
43
55
|
options={sanitizedOptions}
|
|
44
56
|
placeholder={`Any ${name}`}
|
|
@@ -50,12 +62,13 @@
|
|
|
50
62
|
{:else}
|
|
51
63
|
<div
|
|
52
64
|
class="select control search-control {hilightClass}"
|
|
65
|
+
class:is-expanded={shouldExpandToFill}
|
|
53
66
|
style={filterWidthStyle}
|
|
54
67
|
data-cy="select-container">
|
|
55
68
|
<select
|
|
56
69
|
bind:value={filterVals[filter.name]}
|
|
57
70
|
class="is-radiusless {hilightClass}"
|
|
58
|
-
style="max-width:100
|
|
71
|
+
style="max-width:100%;width:100%;"
|
|
59
72
|
data-cy={cy}>
|
|
60
73
|
{#each sanitizedOptions as option}
|
|
61
74
|
{#if option}
|
|
@@ -103,6 +116,8 @@
|
|
|
103
116
|
|
|
104
117
|
$: filterVals, filter, convertToValuesArray();
|
|
105
118
|
|
|
119
|
+
$: shouldExpandToFill = !filterWidthStyle || filterWidthStyle.trim() == "";
|
|
120
|
+
|
|
106
121
|
function convertValuesToString() {
|
|
107
122
|
tick().then(() => {
|
|
108
123
|
filterVals[filter.name] = multiSelectValue
|
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,65 @@
|
|
|
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
|
+
{#each { length: lines } as _, i}
|
|
19
|
+
<span
|
|
20
|
+
class="kws-skeleton is-{color} {klass}"
|
|
21
|
+
style="width:{width};height:{height};border-radius:{border_radius}">
|
|
22
|
+
‌
|
|
23
|
+
</span>
|
|
24
|
+
{/each}
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
export let /**
|
|
28
|
+
* Number of lines of text to display.
|
|
29
|
+
*/
|
|
30
|
+
lines = 1,
|
|
31
|
+
/**
|
|
32
|
+
* CSS string denoting width of the Skeleton
|
|
33
|
+
* **Examples:** `10px` | `5rem` | `100vh`
|
|
34
|
+
*/
|
|
35
|
+
width = "100%",
|
|
36
|
+
/**
|
|
37
|
+
* CSS string denoting height of the Skeleton
|
|
38
|
+
* **Examples:** `10px` | `5rem` | `100vh` | `auto`
|
|
39
|
+
*/
|
|
40
|
+
height = "auto",
|
|
41
|
+
/**
|
|
42
|
+
* CSS string denoting border-radius of the Skeleton
|
|
43
|
+
* **Examples:** `10px` | `5rem`
|
|
44
|
+
*/
|
|
45
|
+
radius = "0px",
|
|
46
|
+
/**
|
|
47
|
+
* Whether the Skeleton should be rendered as a circle.
|
|
48
|
+
* If this is set to `true`, the `radius` property will be ignored.
|
|
49
|
+
*/
|
|
50
|
+
circle = false,
|
|
51
|
+
/**
|
|
52
|
+
* Color of the Skeleton lines
|
|
53
|
+
* @type {'transparent' | 'warning' | 'info' | 'danger' | 'primary' | 'success' | 'link'}
|
|
54
|
+
*/
|
|
55
|
+
color = "";
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* CSS class for Skeleton
|
|
59
|
+
* @type {string}
|
|
60
|
+
*/
|
|
61
|
+
let klass = "";
|
|
62
|
+
export { klass as class };
|
|
63
|
+
|
|
64
|
+
$: border_radius = circle ? "50%" : radius;
|
|
65
|
+
</script>
|
package/index.js
CHANGED
|
@@ -10,6 +10,7 @@ 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";
|
|
13
14
|
export { default as Timeline } from "./helpers/Timeline/Timeline.svelte";
|
|
14
15
|
export { default as TimelineItem } from "./helpers/Timeline/TimelineItem.svelte";
|
|
15
16
|
export { default as TimelineHeader } from "./helpers/Timeline/TimelineHeader.svelte";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kws3/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "UI components for use with Svelte v3 applications.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"text-mask-core": "^5.1.2",
|
|
30
30
|
"tippy.js": "^6.3.1"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "2da51d63a233a8129e31898f0a134f3a68d7f1ec"
|
|
33
33
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
@component
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
@param {string} [classes=""] - Additional classes, Default: `""`
|
|
6
5
|
@param {string} [style=""] - Inline style of component, Default: `""`
|
|
7
|
-
@param {boolean} [vertical=false] - Vertical
|
|
6
|
+
@param {boolean} [vertical=false] - Vertical transform of SlidingPane., Default: `false`
|
|
7
|
+
@param {string} [class=""] - CSS classes for the SlidingPaneSet, Default: `""`
|
|
8
8
|
|
|
9
9
|
### Slots
|
|
10
10
|
- `<slot name="default" />`
|
package/styles/DataSort.scss
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
&:first-child {
|
|
10
10
|
padding-left: calc(0.625rem - 1px);
|
|
11
11
|
border-radius: 0 0 0 $radius-large;
|
|
12
|
+
background: darken($input-border-color, 5%);
|
|
13
|
+
padding-right: calc(0.625rem - 1px);
|
|
12
14
|
}
|
|
13
15
|
&:last-child {
|
|
14
16
|
border-radius: 0 0 $radius-large 0;
|
|
@@ -29,6 +31,9 @@
|
|
|
29
31
|
border: none;
|
|
30
32
|
box-shadow: none;
|
|
31
33
|
}
|
|
34
|
+
&.is-fullwidth {
|
|
35
|
+
width: 100%;
|
|
36
|
+
}
|
|
32
37
|
}
|
|
33
38
|
&::after {
|
|
34
39
|
border-color: $primary;
|
package/styles/Loader.scss
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
$kws-theme-colors: $colors !default;
|
|
1
2
|
$kws-loader-width: 2rem !default;
|
|
2
3
|
$kws-loader-height: 2rem !default;
|
|
3
4
|
$kws-loader-width-medium: ($kws-loader-width * 1.5) !default;
|
|
@@ -5,45 +6,45 @@ $kws-loader-height-medium: ($kws-loader-height * 1.5) !default;
|
|
|
5
6
|
$kws-loader-width-large: ($kws-loader-width * 3) !default;
|
|
6
7
|
$kws-loader-height-large: ($kws-loader-height * 3) !default;
|
|
7
8
|
$kws-loader-color: #ccc !default;
|
|
8
|
-
$kws-loader-overlay-background: rgba(0,0,0,0.15) !default;
|
|
9
|
+
$kws-loader-overlay-background: rgba(0, 0, 0, 0.15) !default;
|
|
9
10
|
|
|
10
|
-
.kws-loader{
|
|
11
|
-
.hero-body{
|
|
12
|
-
position:relative;
|
|
13
|
-
&:after{
|
|
11
|
+
.kws-loader {
|
|
12
|
+
.hero-body {
|
|
13
|
+
position: relative;
|
|
14
|
+
&:after {
|
|
14
15
|
@include loader();
|
|
15
|
-
border-left-color
|
|
16
|
-
border-bottom-color
|
|
16
|
+
border-left-color: $kws-loader-color;
|
|
17
|
+
border-bottom-color: $kws-loader-color;
|
|
17
18
|
position: absolute !important;
|
|
18
|
-
width
|
|
19
|
-
height
|
|
19
|
+
width: $kws-loader-width;
|
|
20
|
+
height: $kws-loader-height;
|
|
20
21
|
left: calc(50% - (#{$kws-loader-width} / 2));
|
|
21
22
|
top: calc(50% - (#{$kws-loader-height} / 2));
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
@each $name, $pair in $colors{
|
|
25
|
+
@each $name, $pair in $kws-theme-colors {
|
|
25
26
|
$color: nth($pair, 1);
|
|
26
|
-
&.is-#{$name}{
|
|
27
|
-
&:after{
|
|
28
|
-
border-left-color
|
|
29
|
-
border-bottom-color
|
|
27
|
+
&.is-#{$name} {
|
|
28
|
+
&:after {
|
|
29
|
+
border-left-color: $color !important;
|
|
30
|
+
border-bottom-color: $color !important;
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
&.is-medium{
|
|
35
|
-
&:after{
|
|
36
|
-
width
|
|
37
|
-
height
|
|
35
|
+
&.is-medium {
|
|
36
|
+
&:after {
|
|
37
|
+
width: $kws-loader-width-medium;
|
|
38
|
+
height: $kws-loader-height-medium;
|
|
38
39
|
left: calc(50% - (#{$kws-loader-width-medium} / 2));
|
|
39
40
|
top: calc(50% - (#{$kws-loader-height-medium} / 2));
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
&.is-large{
|
|
44
|
-
&:after{
|
|
45
|
-
width
|
|
46
|
-
height
|
|
44
|
+
&.is-large {
|
|
45
|
+
&:after {
|
|
46
|
+
width: $kws-loader-width-large;
|
|
47
|
+
height: $kws-loader-height-large;
|
|
47
48
|
left: calc(50% - (#{$kws-loader-width-large} / 2));
|
|
48
49
|
top: calc(50% - (#{$kws-loader-height-large} / 2));
|
|
49
50
|
}
|
|
@@ -51,17 +52,17 @@ $kws-loader-overlay-background: rgba(0,0,0,0.15) !default;
|
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
.is-overlay{
|
|
55
|
-
z-index:4;
|
|
56
|
-
.kws-loader{
|
|
57
|
-
padding:0;
|
|
58
|
-
height:100%;
|
|
59
|
-
width:100%;
|
|
60
|
-
position:relative;
|
|
61
|
-
background
|
|
62
|
-
z-index:3;
|
|
63
|
-
.hero-body{
|
|
64
|
-
padding:0;
|
|
55
|
+
.is-overlay {
|
|
56
|
+
z-index: 4;
|
|
57
|
+
.kws-loader {
|
|
58
|
+
padding: 0;
|
|
59
|
+
height: 100%;
|
|
60
|
+
width: 100%;
|
|
61
|
+
position: relative;
|
|
62
|
+
background: $kws-loader-overlay-background;
|
|
63
|
+
z-index: 3;
|
|
64
|
+
.hero-body {
|
|
65
|
+
padding: 0;
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
}
|
|
68
|
+
}
|
package/styles/RangeSlider.scss
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
$kws-theme-colors: $colors !default;
|
|
1
2
|
$kws-slider-radius: $radius !default;
|
|
2
3
|
$kws-slider-track-background: $grey-lighter !default;
|
|
3
4
|
$kws-slider-track-radius: $radius !default;
|
|
@@ -222,7 +223,7 @@ $kws-slider-output-radius: $radius !default;
|
|
|
222
223
|
&.is-large {
|
|
223
224
|
@include slider-size($size-large);
|
|
224
225
|
}
|
|
225
|
-
@each $name, $pair in $colors {
|
|
226
|
+
@each $name, $pair in $kws-theme-colors {
|
|
226
227
|
$color: nth($pair, 1);
|
|
227
228
|
$color-invert: nth($pair, 2);
|
|
228
229
|
$color-light: findLightColor($color);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
$kws-theme-colors: $colors !default;
|
|
2
|
+
$kws-skeleton-color: lighten($text, 60%) !default;
|
|
3
|
+
$kws-skeleton-hilight-color: lighten($text, 65%) !default;
|
|
4
|
+
|
|
5
|
+
.kws-skeleton {
|
|
6
|
+
width: 100%;
|
|
7
|
+
line-height: 1;
|
|
8
|
+
display: inline-block;
|
|
9
|
+
background-color: $kws-skeleton-color;
|
|
10
|
+
background-image: linear-gradient(
|
|
11
|
+
90deg,
|
|
12
|
+
$kws-skeleton-color,
|
|
13
|
+
$kws-skeleton-hilight-color,
|
|
14
|
+
$kws-skeleton-color
|
|
15
|
+
);
|
|
16
|
+
background-size: 200px 100%;
|
|
17
|
+
background-repeat: no-repeat;
|
|
18
|
+
animation: kws-skeleton-shine 1.2s infinite;
|
|
19
|
+
|
|
20
|
+
@each $name, $pair in $kws-theme-colors {
|
|
21
|
+
$color: nth($pair, 1);
|
|
22
|
+
$color-light: findLightColor($color);
|
|
23
|
+
&.is-#{$name} {
|
|
24
|
+
background-color: $color-light;
|
|
25
|
+
background-image: linear-gradient(
|
|
26
|
+
90deg,
|
|
27
|
+
$color-light,
|
|
28
|
+
darken($color-light, 10%),
|
|
29
|
+
$color-light
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.is-transparent {
|
|
35
|
+
background-color: transparent;
|
|
36
|
+
background-image: linear-gradient(
|
|
37
|
+
90deg,
|
|
38
|
+
transparent,
|
|
39
|
+
transparentize($kws-skeleton-hilight-color, 0.6),
|
|
40
|
+
transparent
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@keyframes kws-skeleton-shine {
|
|
46
|
+
0% {
|
|
47
|
+
background-position: -200px 0;
|
|
48
|
+
}
|
|
49
|
+
100% {
|
|
50
|
+
background-position: calc(200px + 100%) 0;
|
|
51
|
+
}
|
|
52
|
+
}
|
package/styles/Timeline.scss
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
$kws-theme-colors: $colors !default;
|
|
1
2
|
$kws-timeline-default-color: $grey !default;
|
|
2
3
|
$kws-timeline-default-color-invert: $light !default;
|
|
3
4
|
|
|
@@ -92,7 +93,7 @@ $kws-timeline-default-color-invert: $light !default;
|
|
|
92
93
|
top: 0;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
@each $name, $pair in $colors {
|
|
96
|
+
@each $name, $pair in $kws-theme-colors {
|
|
96
97
|
$color: nth($pair, 1);
|
|
97
98
|
$color-invert: nth($pair, 2);
|
|
98
99
|
&.is-#{$name} {
|