@uwdata/mosaic-inputs 0.7.0 → 0.8.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/dist/mosaic-inputs.js +521 -341
- package/dist/mosaic-inputs.min.js +5 -5
- package/package.json +5 -5
- package/src/Menu.js +4 -0
- package/src/Search.js +4 -0
- package/src/Slider.js +5 -1
- package/src/Table.js +4 -0
- package/src/util/format.js +5 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uwdata/mosaic-inputs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Mosaic input components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"inputs",
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"prebuild": "rimraf dist && mkdir dist",
|
|
22
22
|
"build": "node ../../esbuild.js mosaic-inputs",
|
|
23
|
-
"lint": "eslint src test
|
|
23
|
+
"lint": "eslint src test",
|
|
24
24
|
"test": "mocha 'test/**/*-test.js'",
|
|
25
25
|
"prepublishOnly": "npm run test && npm run lint && npm run build"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@uwdata/mosaic-core": "^0.
|
|
29
|
-
"@uwdata/mosaic-sql": "^0.
|
|
28
|
+
"@uwdata/mosaic-core": "^0.8.0",
|
|
29
|
+
"@uwdata/mosaic-sql": "^0.8.0",
|
|
30
30
|
"isoformat": "^0.2.1"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "a24b4c9f7dfa1c38c6af96ec17e075326c1af9b0"
|
|
33
33
|
}
|
package/src/Menu.js
CHANGED
package/src/Search.js
CHANGED
|
@@ -10,6 +10,10 @@ let _id = 0;
|
|
|
10
10
|
export const search = options => input(Search, options);
|
|
11
11
|
|
|
12
12
|
export class Search extends MosaicClient {
|
|
13
|
+
/**
|
|
14
|
+
* Create a new Search instance.
|
|
15
|
+
* @param {object} options Options object
|
|
16
|
+
*/
|
|
13
17
|
constructor({
|
|
14
18
|
element,
|
|
15
19
|
filterBy,
|
package/src/Slider.js
CHANGED
|
@@ -7,6 +7,10 @@ let _id = 0;
|
|
|
7
7
|
export const slider = options => input(Slider, options);
|
|
8
8
|
|
|
9
9
|
export class Slider extends MosaicClient {
|
|
10
|
+
/**
|
|
11
|
+
* Create a new Slider instance.
|
|
12
|
+
* @param {object} options Options object
|
|
13
|
+
*/
|
|
10
14
|
constructor({
|
|
11
15
|
element,
|
|
12
16
|
filterBy,
|
|
@@ -80,7 +84,7 @@ export class Slider extends MosaicClient {
|
|
|
80
84
|
const { min, max } = Array.from(data)[0];
|
|
81
85
|
if (this.min == null) this.slider.setAttribute('min', min);
|
|
82
86
|
if (this.max == null) this.slider.setAttribute('max', max);
|
|
83
|
-
if (this.step == null) this.slider.setAttribute('step', (max - min) / 500);
|
|
87
|
+
if (this.step == null) this.slider.setAttribute('step', String((max - min) / 500));
|
|
84
88
|
return this;
|
|
85
89
|
}
|
|
86
90
|
|
package/src/Table.js
CHANGED
package/src/util/format.js
CHANGED
|
@@ -42,6 +42,9 @@ export function formatDate(date) {
|
|
|
42
42
|
|
|
43
43
|
// Memoize the last-returned locale.
|
|
44
44
|
export function localize(f) {
|
|
45
|
-
let key =
|
|
46
|
-
|
|
45
|
+
let key = null;
|
|
46
|
+
let value;
|
|
47
|
+
return (locale = 'en') => locale === key
|
|
48
|
+
? value
|
|
49
|
+
: (value = f(key = locale));
|
|
47
50
|
}
|