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/dist/ui.js
CHANGED
|
@@ -15,12 +15,12 @@ import {
|
|
|
15
15
|
ZoomIntoPropertyView,
|
|
16
16
|
setGetExpressionCacheCallback,
|
|
17
17
|
setGetStringTemplateCacheCallback,
|
|
18
|
+
StringTemplate,
|
|
18
19
|
SubscribableView,
|
|
19
20
|
Store,
|
|
20
21
|
NestedDataView,
|
|
21
22
|
Grouper,
|
|
22
23
|
getComparer,
|
|
23
|
-
StringTemplate,
|
|
24
24
|
} from "cx/data";
|
|
25
25
|
export { computable, createAccessorModelProxy, createModel } from "cx/data";
|
|
26
26
|
import {
|
|
@@ -53,7 +53,9 @@ import {
|
|
|
53
53
|
Format as Format$1,
|
|
54
54
|
resolveMinMaxFractionDigits,
|
|
55
55
|
parseDateInvariant,
|
|
56
|
+
dayBefore,
|
|
56
57
|
setGetFormatCacheCallback,
|
|
58
|
+
dateQuarter,
|
|
57
59
|
TraversalStack,
|
|
58
60
|
reverseSlice,
|
|
59
61
|
appDataFlag,
|
|
@@ -1902,6 +1904,31 @@ class ZIndexManager {
|
|
|
1902
1904
|
}
|
|
1903
1905
|
|
|
1904
1906
|
const Format = Format$1;
|
|
1907
|
+
// The `quarter` formatter renders a calendar quarter via a string-template
|
|
1908
|
+
// pattern with `{q}` (quarter number), `{yyyy}` and `{yy}` (year) placeholders.
|
|
1909
|
+
// Placeholders are case-insensitive (`{Q}`, `{YYYY}`, `{YY}` work too). It lives
|
|
1910
|
+
// here rather than in util/Format because it depends on StringTemplate from the
|
|
1911
|
+
// data layer, which util/ cannot import. It is registered eagerly since it does
|
|
1912
|
+
// not depend on culture settings.
|
|
1913
|
+
Format$1.registerFactory("quarter", (fmt, pattern, mode) => {
|
|
1914
|
+
let exclusive = mode === "exclusive" || mode === "ex" || mode === "e";
|
|
1915
|
+
let template = StringTemplate.get(pattern || "Q{q} {yyyy}");
|
|
1916
|
+
return (value) => {
|
|
1917
|
+
let date = parseDateInvariant(value);
|
|
1918
|
+
if (exclusive) date = dayBefore(date);
|
|
1919
|
+
let q = dateQuarter(date);
|
|
1920
|
+
let yyyy = date.getFullYear();
|
|
1921
|
+
let yy = String(yyyy % 100).padStart(2, "0");
|
|
1922
|
+
return template({
|
|
1923
|
+
q,
|
|
1924
|
+
Q: q,
|
|
1925
|
+
yyyy,
|
|
1926
|
+
YYYY: yyyy,
|
|
1927
|
+
yy,
|
|
1928
|
+
YY: yy,
|
|
1929
|
+
});
|
|
1930
|
+
};
|
|
1931
|
+
});
|
|
1905
1932
|
let cultureSensitiveFormatsRegistered = false;
|
|
1906
1933
|
function resolveNumberFormattingFlags(flags) {
|
|
1907
1934
|
if (!flags) return null;
|
|
@@ -1966,6 +1993,11 @@ function enableCultureSensitiveFormatting() {
|
|
|
1966
1993
|
let formatter = culture.getFormatter(format);
|
|
1967
1994
|
return (value) => formatter.format(parseDateInvariant(value));
|
|
1968
1995
|
});
|
|
1996
|
+
Format$1.registerFactory(["dayBefore", "daybefore"], (fmt, format = "yyyyMd hhmm") => {
|
|
1997
|
+
let culture = Culture.getDateTimeCulture();
|
|
1998
|
+
let formatter = culture.getFormatter(format);
|
|
1999
|
+
return (value) => formatter.format(dayBefore(parseDateInvariant(value)));
|
|
2000
|
+
});
|
|
1969
2001
|
setGetFormatCacheCallback(() => {
|
|
1970
2002
|
let cache = getCurrentCultureCache();
|
|
1971
2003
|
if (!cache.formatCache) cache.formatCache = {};
|
package/dist/util.js
CHANGED
|
@@ -156,6 +156,22 @@ function overrideParseDateInvariant(newImpl) {
|
|
|
156
156
|
impl = newImpl;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
+
/**
|
|
160
|
+
* Returns a new `Date` representing the calendar day before the given date,
|
|
161
|
+
* keeping the same time of day. Month and year boundaries are handled
|
|
162
|
+
* automatically. The input is not mutated.
|
|
163
|
+
*
|
|
164
|
+
* Useful for displaying the exclusive end of a date range as an inclusive
|
|
165
|
+
* value, e.g. a period ending at `2021-01-01` shown as `Dec 2020`.
|
|
166
|
+
* @param date
|
|
167
|
+
* @returns {Date}
|
|
168
|
+
*/
|
|
169
|
+
function dayBefore(date) {
|
|
170
|
+
let result = new Date(date.getTime());
|
|
171
|
+
result.setDate(result.getDate() - 1);
|
|
172
|
+
return result;
|
|
173
|
+
}
|
|
174
|
+
|
|
159
175
|
const defaultFormatter = (v) => v.toString();
|
|
160
176
|
let formatFactory = {
|
|
161
177
|
string: function () {
|
|
@@ -225,6 +241,10 @@ let formatFactory = {
|
|
|
225
241
|
let time = formatFactory.time();
|
|
226
242
|
return (value) => date(value) + " " + time(value);
|
|
227
243
|
},
|
|
244
|
+
dayBefore: function () {
|
|
245
|
+
let datetime = formatFactory.datetime();
|
|
246
|
+
return (value) => datetime(dayBefore(parseDateInvariant(value)));
|
|
247
|
+
},
|
|
228
248
|
ellipsis: function (part0, length, where) {
|
|
229
249
|
length = Number(length);
|
|
230
250
|
if (!(length > 3)) length = 10;
|
|
@@ -288,6 +308,7 @@ formatFactory.ps = formatFactory.percentageSign;
|
|
|
288
308
|
formatFactory.d = formatFactory.date;
|
|
289
309
|
formatFactory.t = formatFactory.time;
|
|
290
310
|
formatFactory.dt = formatFactory.datetime;
|
|
311
|
+
formatFactory.daybefore = formatFactory.dayBefore;
|
|
291
312
|
formatFactory.zeropad = formatFactory.zeroPad;
|
|
292
313
|
formatFactory.leftpad = formatFactory.leftPad;
|
|
293
314
|
formatFactory.capitalize = formatFactory.capitalize;
|
|
@@ -715,6 +736,15 @@ function dateDiff(d1, d2) {
|
|
|
715
736
|
return d1.getTime() - d2.getTime();
|
|
716
737
|
}
|
|
717
738
|
|
|
739
|
+
/**
|
|
740
|
+
* Returns the calendar quarter (1-4) the given date falls in.
|
|
741
|
+
* @param date
|
|
742
|
+
* @returns {number}
|
|
743
|
+
*/
|
|
744
|
+
function dateQuarter(date) {
|
|
745
|
+
return Math.floor(date.getMonth() / 3) + 1;
|
|
746
|
+
}
|
|
747
|
+
|
|
718
748
|
/**
|
|
719
749
|
* Zeros out time for the given Date object. E.g. for date object representing Wed Apr 19 2017 14:31:51 GMT+0200
|
|
720
750
|
* returns Wed Apr 19 2017 00:00:00 GMT+0200.
|
|
@@ -1575,6 +1605,8 @@ export {
|
|
|
1575
1605
|
coalesce,
|
|
1576
1606
|
createComponentFactory,
|
|
1577
1607
|
dateDiff,
|
|
1608
|
+
dateQuarter,
|
|
1609
|
+
dayBefore,
|
|
1578
1610
|
debounce,
|
|
1579
1611
|
debug,
|
|
1580
1612
|
deprecatedFlag,
|
package/dist/widgets.css
CHANGED
|
@@ -5313,6 +5313,10 @@ th.cxe-calendar-display {
|
|
|
5313
5313
|
content: counter(cx-row-number);
|
|
5314
5314
|
}
|
|
5315
5315
|
|
|
5316
|
+
.cxe-grid-group-caption.cxs-reset-row-numbers {
|
|
5317
|
+
counter-set: cx-row-number 0;
|
|
5318
|
+
}
|
|
5319
|
+
|
|
5316
5320
|
.cxe-grid-fixed-header {
|
|
5317
5321
|
overflow: hidden;
|
|
5318
5322
|
position: absolute;
|