cx 26.4.4 → 26.6.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/build/charts/axis/Axis.d.ts +8 -0
- package/build/charts/axis/Axis.d.ts.map +1 -1
- package/build/charts/axis/Axis.js +18 -1
- package/build/charts/axis/TimeAxis.js +1 -0
- package/build/locale/de-de.js +1 -0
- package/build/locale/en-us.js +1 -0
- package/build/locale/es-es.js +1 -0
- package/build/locale/fr-fr.js +1 -0
- package/build/locale/nl-nl.js +1 -0
- package/build/locale/pt-pt.js +1 -0
- package/build/locale/sr-latn-ba.js +1 -0
- package/build/ui/Format.d.ts.map +1 -1
- package/build/ui/Format.js +26 -2
- package/build/util/Format.d.ts.map +1 -1
- package/build/util/Format.js +6 -0
- package/build/util/date/dateQuarter.d.ts +7 -0
- package/build/util/date/dateQuarter.d.ts.map +1 -0
- package/build/util/date/dateQuarter.js +8 -0
- package/build/util/date/dayBefore.d.ts +12 -0
- package/build/util/date/dayBefore.d.ts.map +1 -0
- package/build/util/date/dayBefore.js +15 -0
- package/build/util/date/index.d.ts +2 -0
- package/build/util/date/index.d.ts.map +1 -1
- package/build/util/date/index.js +2 -0
- package/build/widgets/form/DateTimePicker.d.ts.map +1 -1
- package/build/widgets/form/DateTimePicker.js +53 -31
- package/build/widgets/form/Field.d.ts.map +1 -1
- package/build/widgets/form/Field.js +2 -1
- package/build/widgets/form/LookupField.d.ts +6 -0
- package/build/widgets/form/LookupField.d.ts.map +1 -1
- package/build/widgets/form/LookupField.js +12 -0
- package/build/widgets/form/Wheel.d.ts +8 -0
- package/build/widgets/form/Wheel.d.ts.map +1 -1
- package/build/widgets/form/Wheel.js +30 -7
- package/build/widgets/grid/Grid.d.ts +6 -1
- package/build/widgets/grid/Grid.d.ts.map +1 -1
- package/build/widgets/grid/Grid.js +3 -2
- package/dist/charts.css +6 -0
- package/dist/charts.js +18 -1
- package/dist/manifest.js +880 -871
- package/dist/ui.js +33 -1
- package/dist/util.js +32 -0
- package/dist/widgets.css +4 -0
- package/dist/widgets.js +243 -175
- package/package.json +1 -1
- package/src/charts/BarGraph.scss +31 -31
- package/src/charts/Legend.scss +57 -57
- package/src/charts/LegendEntry.scss +35 -35
- package/src/charts/LineGraph.scss +28 -28
- package/src/charts/RangeMarker.scss +3 -0
- package/src/charts/axis/Axis.tsx +31 -1
- package/src/charts/axis/TimeAxis.tsx +1 -0
- package/src/charts/helpers/SnapPointFinder.ts +136 -136
- package/src/charts/helpers/ValueAtFinder.ts +72 -72
- package/src/charts/index.scss +1 -0
- package/src/data/AugmentedViewBase.ts +89 -89
- package/src/data/View.ts +301 -301
- package/src/data/createAccessorModelProxy.ts +66 -66
- package/src/locale/de-de.ts +1 -0
- package/src/locale/en-us.ts +1 -0
- package/src/locale/es-es.ts +1 -0
- package/src/locale/fr-fr.ts +1 -0
- package/src/locale/nl-nl.ts +1 -0
- package/src/locale/pt-pt.ts +1 -0
- package/src/locale/sr-latn-ba.ts +1 -0
- package/src/ui/Format.spec.ts +32 -0
- package/src/ui/Format.ts +27 -2
- package/src/ui/Repeater.spec.tsx +181 -181
- package/src/util/Format.spec.ts +11 -0
- package/src/util/Format.ts +7 -0
- package/src/util/date/dateQuarter.ts +8 -0
- package/src/util/date/dayBefore.ts +15 -0
- package/src/util/date/index.ts +2 -0
- package/src/util/scss/include.scss +69 -69
- package/src/widgets/Button.maps.scss +103 -103
- package/src/widgets/form/Calendar.tsx +772 -772
- package/src/widgets/form/DateTimePicker.tsx +453 -392
- package/src/widgets/form/Field.tsx +2 -1
- package/src/widgets/form/LookupField.spec.tsx +149 -0
- package/src/widgets/form/LookupField.tsx +27 -0
- package/src/widgets/form/ValidationGroup.spec.tsx +30 -1
- package/src/widgets/form/Wheel.tsx +36 -7
- package/src/widgets/grid/Grid.scss +663 -657
- package/src/widgets/grid/Grid.tsx +9 -3
- package/src/widgets/grid/variables.scss +47 -47
- package/src/widgets/index.ts +63 -63
- package/src/widgets/nav/MenuItem.scss +150 -150
- package/src/widgets/nav/Tab.ts +122 -122
- package/src/widgets/overlay/Overlay.tsx +1029 -1029
- package/src/widgets/variables.scss +61 -61
package/src/util/Format.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { isUndefined } from "../util/isUndefined";
|
|
|
5
5
|
import { isArray } from "../util/isArray";
|
|
6
6
|
import { capitalize } from "./capitalize";
|
|
7
7
|
import { parseDateInvariant } from "./date/parseDateInvariant";
|
|
8
|
+
import { dayBefore } from "./date/dayBefore";
|
|
8
9
|
|
|
9
10
|
//Culture dependent formatters are defined in the ui package.
|
|
10
11
|
|
|
@@ -98,6 +99,11 @@ let formatFactory: Record<string, (...args: any[]) => (value: any) => string> =
|
|
|
98
99
|
return (value: any) => date(value) + " " + time(value);
|
|
99
100
|
},
|
|
100
101
|
|
|
102
|
+
dayBefore: function () {
|
|
103
|
+
let datetime = formatFactory.datetime();
|
|
104
|
+
return (value: any) => datetime(dayBefore(parseDateInvariant(value)));
|
|
105
|
+
},
|
|
106
|
+
|
|
101
107
|
ellipsis: function (part0, length, where) {
|
|
102
108
|
length = Number(length);
|
|
103
109
|
if (!(length > 3)) length = 10;
|
|
@@ -168,6 +174,7 @@ formatFactory.ps = formatFactory.percentageSign;
|
|
|
168
174
|
formatFactory.d = formatFactory.date;
|
|
169
175
|
formatFactory.t = formatFactory.time;
|
|
170
176
|
formatFactory.dt = formatFactory.datetime;
|
|
177
|
+
formatFactory.daybefore = formatFactory.dayBefore;
|
|
171
178
|
formatFactory.zeropad = formatFactory.zeroPad;
|
|
172
179
|
formatFactory.leftpad = formatFactory.leftPad;
|
|
173
180
|
formatFactory.capitalize = formatFactory.capitalize;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a new `Date` representing the calendar day before the given date,
|
|
3
|
+
* keeping the same time of day. Month and year boundaries are handled
|
|
4
|
+
* automatically. The input is not mutated.
|
|
5
|
+
*
|
|
6
|
+
* Useful for displaying the exclusive end of a date range as an inclusive
|
|
7
|
+
* value, e.g. a period ending at `2021-01-01` shown as `Dec 2020`.
|
|
8
|
+
* @param date
|
|
9
|
+
* @returns {Date}
|
|
10
|
+
*/
|
|
11
|
+
export function dayBefore(date: Date): Date {
|
|
12
|
+
let result = new Date(date.getTime());
|
|
13
|
+
result.setDate(result.getDate() - 1);
|
|
14
|
+
return result;
|
|
15
|
+
}
|
package/src/util/date/index.ts
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
@forward "colors";
|
|
2
|
-
@use "call-once" as *;
|
|
3
|
-
@use "colors" as *;
|
|
4
|
-
@use "sass:map";
|
|
5
|
-
|
|
6
|
-
$cx-include-all: true !default;
|
|
7
|
-
|
|
8
|
-
$cx-excluded: () !default;
|
|
9
|
-
$cx-used: null !default;
|
|
10
|
-
|
|
11
|
-
$cx-dependencies: () !default;
|
|
12
|
-
|
|
13
|
-
@mixin cx-register-dependencies($deps) {
|
|
14
|
-
$cx-dependencies: map.merge($cx-dependencies, $deps) !global;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
$cx-deps-resolved: false !default;
|
|
18
|
-
|
|
19
|
-
// Recursively add all transitive dependencies of $name into $used
|
|
20
|
-
@function cx-resolve-module-deps($name, $used) {
|
|
21
|
-
$deps: map.get($cx-dependencies, $name);
|
|
22
|
-
@if $deps != null {
|
|
23
|
-
@each $dep in $deps {
|
|
24
|
-
@if map.get($used, $dep) != true {
|
|
25
|
-
$used: map.merge(
|
|
26
|
-
$used,
|
|
27
|
-
(
|
|
28
|
-
$dep: true,
|
|
29
|
-
)
|
|
30
|
-
);
|
|
31
|
-
$used: cx-resolve-module-deps($dep, $used);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
@return $used;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@function cx-should-include($name, $once: true) {
|
|
39
|
-
// Resolve dependencies once, on first call (after all deps are registered)
|
|
40
|
-
@if not $cx-deps-resolved and $cx-used != null {
|
|
41
|
-
@each $module in map.keys($cx-used) {
|
|
42
|
-
$cx-used: cx-resolve-module-deps($module, $cx-used) !global;
|
|
43
|
-
}
|
|
44
|
-
$cx-deps-resolved: true !global;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@return (
|
|
48
|
-
(map.get($cx-excluded, $name) != true) and
|
|
49
|
-
($cx-include-all or ($cx-used != null and map.get($cx-used, $name) == true))
|
|
50
|
-
)
|
|
51
|
-
and ($once != true or cx-call-once($name));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@function cx-included($name) {
|
|
55
|
-
@return cx-called-once($name);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
@mixin cx-widgets($names...) {
|
|
59
|
-
$cx-used: () !default !global;
|
|
60
|
-
|
|
61
|
-
@each $name in $names {
|
|
62
|
-
$cx-used: map.merge(
|
|
63
|
-
$cx-used,
|
|
64
|
-
(
|
|
65
|
-
$name: true,
|
|
66
|
-
)
|
|
67
|
-
) !global;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
1
|
+
@forward "colors";
|
|
2
|
+
@use "call-once" as *;
|
|
3
|
+
@use "colors" as *;
|
|
4
|
+
@use "sass:map";
|
|
5
|
+
|
|
6
|
+
$cx-include-all: true !default;
|
|
7
|
+
|
|
8
|
+
$cx-excluded: () !default;
|
|
9
|
+
$cx-used: null !default;
|
|
10
|
+
|
|
11
|
+
$cx-dependencies: () !default;
|
|
12
|
+
|
|
13
|
+
@mixin cx-register-dependencies($deps) {
|
|
14
|
+
$cx-dependencies: map.merge($cx-dependencies, $deps) !global;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
$cx-deps-resolved: false !default;
|
|
18
|
+
|
|
19
|
+
// Recursively add all transitive dependencies of $name into $used
|
|
20
|
+
@function cx-resolve-module-deps($name, $used) {
|
|
21
|
+
$deps: map.get($cx-dependencies, $name);
|
|
22
|
+
@if $deps != null {
|
|
23
|
+
@each $dep in $deps {
|
|
24
|
+
@if map.get($used, $dep) != true {
|
|
25
|
+
$used: map.merge(
|
|
26
|
+
$used,
|
|
27
|
+
(
|
|
28
|
+
$dep: true,
|
|
29
|
+
)
|
|
30
|
+
);
|
|
31
|
+
$used: cx-resolve-module-deps($dep, $used);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
@return $used;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@function cx-should-include($name, $once: true) {
|
|
39
|
+
// Resolve dependencies once, on first call (after all deps are registered)
|
|
40
|
+
@if not $cx-deps-resolved and $cx-used != null {
|
|
41
|
+
@each $module in map.keys($cx-used) {
|
|
42
|
+
$cx-used: cx-resolve-module-deps($module, $cx-used) !global;
|
|
43
|
+
}
|
|
44
|
+
$cx-deps-resolved: true !global;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@return (
|
|
48
|
+
(map.get($cx-excluded, $name) != true) and
|
|
49
|
+
($cx-include-all or ($cx-used != null and map.get($cx-used, $name) == true))
|
|
50
|
+
)
|
|
51
|
+
and ($once != true or cx-call-once($name));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@function cx-included($name) {
|
|
55
|
+
@return cx-called-once($name);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@mixin cx-widgets($names...) {
|
|
59
|
+
$cx-used: () !default !global;
|
|
60
|
+
|
|
61
|
+
@each $name in $names {
|
|
62
|
+
$cx-used: map.merge(
|
|
63
|
+
$cx-used,
|
|
64
|
+
(
|
|
65
|
+
$name: true,
|
|
66
|
+
)
|
|
67
|
+
) !global;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
@use "sass:map";
|
|
2
|
-
@use "./lists" as *;
|
|
3
|
-
@use "./variables" as *;
|
|
4
|
-
|
|
5
|
-
$cx-button-state-style-map: (
|
|
6
|
-
default: (
|
|
7
|
-
background-color: $cx-default-button-background-color,
|
|
8
|
-
box-shadow: $cx-default-button-box-shadow,
|
|
9
|
-
border-color: $cx-default-button-border-color,
|
|
10
|
-
border-width: $cx-default-button-border-width,
|
|
11
|
-
border-radius: $cx-default-button-border-radius,
|
|
12
|
-
border-style: solid,
|
|
13
|
-
user-select: none,
|
|
14
|
-
color: $cx-default-button-color,
|
|
15
|
-
font-family: $cx-default-button-font-family,
|
|
16
|
-
font-size: $cx-default-button-font-size,
|
|
17
|
-
font-weight: $cx-default-button-font-weight,
|
|
18
|
-
line-height: $cx-default-button-line-height,
|
|
19
|
-
padding: $cx-default-button-padding,
|
|
20
|
-
cursor: pointer,
|
|
21
|
-
-webkit-appearance: none,
|
|
22
|
-
-moz-appearance: none,
|
|
23
|
-
appearance: none,
|
|
24
|
-
white-space: nowrap,
|
|
25
|
-
text-decoration: none,
|
|
26
|
-
),
|
|
27
|
-
hover: (
|
|
28
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3),
|
|
29
|
-
text-decoration: none,
|
|
30
|
-
),
|
|
31
|
-
focus: (
|
|
32
|
-
outline: none,
|
|
33
|
-
box-shadow: 0 0 1px 1px rgba(77, 144, 254, 0.8),
|
|
34
|
-
),
|
|
35
|
-
hover-focus: (),
|
|
36
|
-
disabled: (
|
|
37
|
-
color: gray,
|
|
38
|
-
box-shadow: none,
|
|
39
|
-
pointer-events: none,
|
|
40
|
-
),
|
|
41
|
-
active: (
|
|
42
|
-
top: 1px,
|
|
43
|
-
box-shadow: none,
|
|
44
|
-
),
|
|
45
|
-
) !default;
|
|
46
|
-
|
|
47
|
-
$cx-button-mods: (
|
|
48
|
-
primary: (
|
|
49
|
-
default: (
|
|
50
|
-
background-color: #1f99f8,
|
|
51
|
-
border-color: #1e88e5,
|
|
52
|
-
color: white,
|
|
53
|
-
),
|
|
54
|
-
disabled: (
|
|
55
|
-
background-color: rgba(31, 153, 248, 0.5),
|
|
56
|
-
border-color: rgba(30, 136, 229, 0.1),
|
|
57
|
-
color: rgba(255, 255, 255, 0.6),
|
|
58
|
-
),
|
|
59
|
-
hover: (
|
|
60
|
-
background-color: #1f99f8,
|
|
61
|
-
),
|
|
62
|
-
),
|
|
63
|
-
danger: (
|
|
64
|
-
default: (
|
|
65
|
-
background-color: #d32f2f,
|
|
66
|
-
border-color: #c62828,
|
|
67
|
-
color: white,
|
|
68
|
-
),
|
|
69
|
-
disabled: (
|
|
70
|
-
background-color: rgba(211, 47, 47, 0.6),
|
|
71
|
-
border-color: rgba(198, 40, 40, 0.1),
|
|
72
|
-
color: rgba(255, 255, 255, 0.5),
|
|
73
|
-
),
|
|
74
|
-
hover: (
|
|
75
|
-
background-color: #d32f2f,
|
|
76
|
-
),
|
|
77
|
-
),
|
|
78
|
-
hollow: (
|
|
79
|
-
default: (
|
|
80
|
-
background-color: transparent,
|
|
81
|
-
border-color: transparent,
|
|
82
|
-
color: inherit,
|
|
83
|
-
box-shadow: none,
|
|
84
|
-
),
|
|
85
|
-
hover: map.merge(
|
|
86
|
-
map.get($cx-list-item, hover),
|
|
87
|
-
(
|
|
88
|
-
box-shadow: none,
|
|
89
|
-
border-color: transparent,
|
|
90
|
-
)
|
|
91
|
-
),
|
|
92
|
-
focus: map.merge(
|
|
93
|
-
map.get($cx-list-item, selected-cursor),
|
|
94
|
-
(
|
|
95
|
-
box-shadow: none,
|
|
96
|
-
border-color: transparent,
|
|
97
|
-
)
|
|
98
|
-
),
|
|
99
|
-
disabled: (
|
|
100
|
-
color: rgba(128, 128, 128, 0.5),
|
|
101
|
-
),
|
|
102
|
-
),
|
|
103
|
-
) !default;
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "./lists" as *;
|
|
3
|
+
@use "./variables" as *;
|
|
4
|
+
|
|
5
|
+
$cx-button-state-style-map: (
|
|
6
|
+
default: (
|
|
7
|
+
background-color: $cx-default-button-background-color,
|
|
8
|
+
box-shadow: $cx-default-button-box-shadow,
|
|
9
|
+
border-color: $cx-default-button-border-color,
|
|
10
|
+
border-width: $cx-default-button-border-width,
|
|
11
|
+
border-radius: $cx-default-button-border-radius,
|
|
12
|
+
border-style: solid,
|
|
13
|
+
user-select: none,
|
|
14
|
+
color: $cx-default-button-color,
|
|
15
|
+
font-family: $cx-default-button-font-family,
|
|
16
|
+
font-size: $cx-default-button-font-size,
|
|
17
|
+
font-weight: $cx-default-button-font-weight,
|
|
18
|
+
line-height: $cx-default-button-line-height,
|
|
19
|
+
padding: $cx-default-button-padding,
|
|
20
|
+
cursor: pointer,
|
|
21
|
+
-webkit-appearance: none,
|
|
22
|
+
-moz-appearance: none,
|
|
23
|
+
appearance: none,
|
|
24
|
+
white-space: nowrap,
|
|
25
|
+
text-decoration: none,
|
|
26
|
+
),
|
|
27
|
+
hover: (
|
|
28
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3),
|
|
29
|
+
text-decoration: none,
|
|
30
|
+
),
|
|
31
|
+
focus: (
|
|
32
|
+
outline: none,
|
|
33
|
+
box-shadow: 0 0 1px 1px rgba(77, 144, 254, 0.8),
|
|
34
|
+
),
|
|
35
|
+
hover-focus: (),
|
|
36
|
+
disabled: (
|
|
37
|
+
color: gray,
|
|
38
|
+
box-shadow: none,
|
|
39
|
+
pointer-events: none,
|
|
40
|
+
),
|
|
41
|
+
active: (
|
|
42
|
+
top: 1px,
|
|
43
|
+
box-shadow: none,
|
|
44
|
+
),
|
|
45
|
+
) !default;
|
|
46
|
+
|
|
47
|
+
$cx-button-mods: (
|
|
48
|
+
primary: (
|
|
49
|
+
default: (
|
|
50
|
+
background-color: #1f99f8,
|
|
51
|
+
border-color: #1e88e5,
|
|
52
|
+
color: white,
|
|
53
|
+
),
|
|
54
|
+
disabled: (
|
|
55
|
+
background-color: rgba(31, 153, 248, 0.5),
|
|
56
|
+
border-color: rgba(30, 136, 229, 0.1),
|
|
57
|
+
color: rgba(255, 255, 255, 0.6),
|
|
58
|
+
),
|
|
59
|
+
hover: (
|
|
60
|
+
background-color: #1f99f8,
|
|
61
|
+
),
|
|
62
|
+
),
|
|
63
|
+
danger: (
|
|
64
|
+
default: (
|
|
65
|
+
background-color: #d32f2f,
|
|
66
|
+
border-color: #c62828,
|
|
67
|
+
color: white,
|
|
68
|
+
),
|
|
69
|
+
disabled: (
|
|
70
|
+
background-color: rgba(211, 47, 47, 0.6),
|
|
71
|
+
border-color: rgba(198, 40, 40, 0.1),
|
|
72
|
+
color: rgba(255, 255, 255, 0.5),
|
|
73
|
+
),
|
|
74
|
+
hover: (
|
|
75
|
+
background-color: #d32f2f,
|
|
76
|
+
),
|
|
77
|
+
),
|
|
78
|
+
hollow: (
|
|
79
|
+
default: (
|
|
80
|
+
background-color: transparent,
|
|
81
|
+
border-color: transparent,
|
|
82
|
+
color: inherit,
|
|
83
|
+
box-shadow: none,
|
|
84
|
+
),
|
|
85
|
+
hover: map.merge(
|
|
86
|
+
map.get($cx-list-item, hover),
|
|
87
|
+
(
|
|
88
|
+
box-shadow: none,
|
|
89
|
+
border-color: transparent,
|
|
90
|
+
)
|
|
91
|
+
),
|
|
92
|
+
focus: map.merge(
|
|
93
|
+
map.get($cx-list-item, selected-cursor),
|
|
94
|
+
(
|
|
95
|
+
box-shadow: none,
|
|
96
|
+
border-color: transparent,
|
|
97
|
+
)
|
|
98
|
+
),
|
|
99
|
+
disabled: (
|
|
100
|
+
color: rgba(128, 128, 128, 0.5),
|
|
101
|
+
),
|
|
102
|
+
),
|
|
103
|
+
) !default;
|