@kws3/ui 2.0.1 → 2.0.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/CHANGELOG.mdx +8 -1
- package/charts/AreaChart.svelte +6 -5
- package/charts/BarChart.svelte +6 -5
- package/charts/DonutChart.svelte +6 -5
- package/charts/LineChart.svelte +6 -5
- package/charts/MixedChart.svelte +6 -5
- package/charts/PieChart.svelte +6 -5
- package/charts/RadialChart.svelte +6 -5
- package/forms/actions.js +4 -0
- package/forms/colorpicker/Colorpicker.js +6 -2
- package/internal/index.js +8 -6
- package/package.json +2 -2
- package/resizeObserver/index.js +4 -1
- package/utils/index.js +14 -12
package/CHANGELOG.mdx
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
## 2.0.3
|
|
2
|
+
- Sveltkit compatibility fix ('window' not defined)
|
|
3
|
+
|
|
4
|
+
## 2.0.2
|
|
5
|
+
- Bugfixes with chart default colours
|
|
6
|
+
- Set today's date on datepicker initialisation so that long running pages don't stick to the date of first load as today's date
|
|
7
|
+
|
|
1
8
|
## 2.0.1
|
|
2
|
-
- Hardcoded color bugfix on pagination styles
|
|
9
|
+
- Hardcoded color bugfix on pagination styles
|
|
3
10
|
|
|
4
11
|
## 2.0.0
|
|
5
12
|
- Add support for custom CSS classes for the table in `GridView` component
|
package/charts/AreaChart.svelte
CHANGED
|
@@ -142,11 +142,12 @@ This is to prevent unnecessary event subscriptions., Default: `[]`
|
|
|
142
142
|
let _data = [];
|
|
143
143
|
let yAxis = {};
|
|
144
144
|
|
|
145
|
-
$: usedColors =
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
$: usedColors =
|
|
146
|
+
colors && colors.length
|
|
147
|
+
? colors
|
|
148
|
+
: $defaultChartColors
|
|
149
|
+
? $defaultChartColors
|
|
150
|
+
: [];
|
|
150
151
|
|
|
151
152
|
$: data, sets, normaliseAll();
|
|
152
153
|
$: _options = merge(
|
package/charts/BarChart.svelte
CHANGED
|
@@ -162,11 +162,12 @@ This is to prevent unnecessary event subscriptions., Default: `[]`
|
|
|
162
162
|
let _data = [];
|
|
163
163
|
let yAxis = {};
|
|
164
164
|
|
|
165
|
-
$: usedColors =
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
165
|
+
$: usedColors =
|
|
166
|
+
colors && colors.length
|
|
167
|
+
? colors
|
|
168
|
+
: $defaultChartColors
|
|
169
|
+
? $defaultChartColors
|
|
170
|
+
: [];
|
|
170
171
|
|
|
171
172
|
$: data, sets, normaliseAll();
|
|
172
173
|
$: _options = merge(
|
package/charts/DonutChart.svelte
CHANGED
|
@@ -129,11 +129,12 @@ This is to prevent unnecessary event subscriptions., Default: `[]`
|
|
|
129
129
|
$: __class =
|
|
130
130
|
"kws-donut-chart " + `${sparklines ? "kws-sparklines" : ""} ` + klass;
|
|
131
131
|
|
|
132
|
-
$: usedColors =
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
$: usedColors =
|
|
133
|
+
colors && colors.length
|
|
134
|
+
? colors
|
|
135
|
+
: $defaultChartColors
|
|
136
|
+
? $defaultChartColors
|
|
137
|
+
: [];
|
|
137
138
|
|
|
138
139
|
$: _data = data || Array(labels.length || 0).fill(0);
|
|
139
140
|
$: _options = merge(
|
package/charts/LineChart.svelte
CHANGED
|
@@ -142,11 +142,12 @@ This is to prevent unnecessary event subscriptions., Default: `[]`
|
|
|
142
142
|
let _data = [];
|
|
143
143
|
let yAxis = {};
|
|
144
144
|
|
|
145
|
-
$: usedColors =
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
$: usedColors =
|
|
146
|
+
colors && colors.length
|
|
147
|
+
? colors
|
|
148
|
+
: $defaultChartColors
|
|
149
|
+
? $defaultChartColors
|
|
150
|
+
: [];
|
|
150
151
|
|
|
151
152
|
$: data, sets, normaliseAll();
|
|
152
153
|
$: _options = merge(
|
package/charts/MixedChart.svelte
CHANGED
|
@@ -147,11 +147,12 @@ This is to prevent unnecessary event subscriptions., Default: `[]`
|
|
|
147
147
|
let _data = [];
|
|
148
148
|
let yAxis = [];
|
|
149
149
|
|
|
150
|
-
$: usedColors =
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
$: usedColors =
|
|
151
|
+
colors && colors.length
|
|
152
|
+
? colors
|
|
153
|
+
: $defaultChartColors
|
|
154
|
+
? $defaultChartColors
|
|
155
|
+
: [];
|
|
155
156
|
|
|
156
157
|
$: data, sets, normaliseAll();
|
|
157
158
|
$: _options = merge(
|
package/charts/PieChart.svelte
CHANGED
|
@@ -129,11 +129,12 @@ This is to prevent unnecessary event subscriptions., Default: `[]`
|
|
|
129
129
|
$: __class =
|
|
130
130
|
"kws-pie-chart " + `${sparklines ? "kws-sparklines" : ""} ` + klass;
|
|
131
131
|
|
|
132
|
-
$: usedColors =
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
$: usedColors =
|
|
133
|
+
colors && colors.length
|
|
134
|
+
? colors
|
|
135
|
+
: $defaultChartColors
|
|
136
|
+
? $defaultChartColors
|
|
137
|
+
: [];
|
|
137
138
|
|
|
138
139
|
$: _data = data || Array(labels.length || 0).fill(0);
|
|
139
140
|
$: _options = merge(
|
|
@@ -142,11 +142,12 @@ This is to prevent unnecessary event subscriptions., Default: `[]`
|
|
|
142
142
|
$: __class =
|
|
143
143
|
"kws-radial-chart " + `${sparklines ? "kws-sparklines" : ""} ` + klass;
|
|
144
144
|
|
|
145
|
-
$: usedColors =
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
$: usedColors =
|
|
146
|
+
colors && colors.length
|
|
147
|
+
? colors
|
|
148
|
+
: $defaultChartColors
|
|
149
|
+
? $defaultChartColors
|
|
150
|
+
: [];
|
|
150
151
|
|
|
151
152
|
$: data, normaliseData();
|
|
152
153
|
$: labels, normaliseLabels();
|
package/forms/actions.js
CHANGED
|
@@ -34,6 +34,10 @@ function createFlatpickrAction(defaultOpts, hooks, type) {
|
|
|
34
34
|
_opts["onChange"] = createFirer("dateChange");
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
//set today's date on initilisation
|
|
38
|
+
//otherwise pages that are open overnight do not update their "Today's date"
|
|
39
|
+
_opts.now = new Date();
|
|
40
|
+
|
|
37
41
|
let OPTS = Object.assign(defaultOpts, _opts, opts);
|
|
38
42
|
|
|
39
43
|
let picker = flatpickr(node, OPTS);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
function initialize(win, doc) {
|
|
2
2
|
var CP,
|
|
3
3
|
instance = "__instance__",
|
|
4
4
|
first = "firstChild",
|
|
@@ -619,4 +619,8 @@ export default (function (win, doc) {
|
|
|
619
619
|
return $;
|
|
620
620
|
})
|
|
621
621
|
);
|
|
622
|
-
}
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
export default typeof window !== "undefined"
|
|
625
|
+
? initialize(window, document)
|
|
626
|
+
: function () {};
|
package/internal/index.js
CHANGED
|
@@ -18,10 +18,12 @@ export function isEscKey(e) {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export const IS_MAC =
|
|
21
|
-
"
|
|
22
|
-
?
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
typeof window !== "undefined"
|
|
22
|
+
? "navigator" in window
|
|
23
|
+
? /mac/i.test(
|
|
24
|
+
window.navigator.userAgentData
|
|
25
|
+
? window.navigator.userAgentData.platform
|
|
26
|
+
: window.navigator.platform
|
|
27
|
+
)
|
|
28
|
+
: false
|
|
27
29
|
: false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kws3/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "UI components for use with Svelte v3 applications.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"svelte": "index.js",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"text-mask-core": "^5.1.2",
|
|
33
33
|
"tippy.js": "^6.3.1"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "25bba9ec00504040f662c73b524bb719e62c3e6e"
|
|
36
36
|
}
|
package/resizeObserver/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export const hasResizeObserver =
|
|
1
|
+
export const hasResizeObserver =
|
|
2
|
+
typeof window !== "undefined"
|
|
3
|
+
? typeof window.ResizeObserver !== "undefined"
|
|
4
|
+
: false;
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
* Usage: `<div use:resizeObserver on:resize={resizeHandler}>`
|
package/utils/index.js
CHANGED
|
@@ -32,18 +32,20 @@ export function cloneObject(obj) {
|
|
|
32
32
|
* @param {function} [callback=function(){}] - callback function
|
|
33
33
|
*/
|
|
34
34
|
export var rAF =
|
|
35
|
-
window
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
typeof window !== "undefined"
|
|
36
|
+
? window.requestAnimationFrame ||
|
|
37
|
+
//@ts-ignore
|
|
38
|
+
window.webkitRequestAnimationFrame ||
|
|
39
|
+
//@ts-ignore
|
|
40
|
+
window.mozRequestAnimationFrame ||
|
|
41
|
+
//@ts-ignore
|
|
42
|
+
window.oRequestAnimationFrame ||
|
|
43
|
+
//@ts-ignore
|
|
44
|
+
window.msRequestAnimationFrame ||
|
|
45
|
+
function (callback) {
|
|
46
|
+
window.setTimeout(callback, 1000 / 60);
|
|
47
|
+
}
|
|
48
|
+
: () => {};
|
|
47
49
|
|
|
48
50
|
/**
|
|
49
51
|
* Returns a function, that, as long as it continues to be invoked, will not
|