cx 23.4.5 → 23.5.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/charts.js +16 -4
- package/dist/manifest.js +830 -830
- package/dist/widgets.js +1 -0
- package/package.json +1 -1
- package/src/charts/Legend.d.ts +13 -13
- package/src/charts/Legend.js +11 -5
- package/src/charts/PieChart.js +16 -18
- package/src/widgets/form/DateTimeField.d.ts +86 -83
- package/src/widgets/form/DateTimeField.js +572 -571
package/dist/widgets.js
CHANGED
|
@@ -14589,6 +14589,7 @@ var DateTimeInput = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
14589
14589
|
type: DateTimePicker,
|
|
14590
14590
|
segment: widget.segment,
|
|
14591
14591
|
encoding: widget.encoding,
|
|
14592
|
+
showSeconds: widget.showSeconds,
|
|
14592
14593
|
};
|
|
14593
14594
|
break;
|
|
14594
14595
|
}
|
package/package.json
CHANGED
package/src/charts/Legend.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import * as Cx from
|
|
1
|
+
import * as Cx from "../core";
|
|
2
2
|
|
|
3
3
|
interface LegendProps extends Cx.HtmlElementProps {
|
|
4
|
-
|
|
5
4
|
/** Name of the legend. Default is `legend`. */
|
|
6
|
-
name?: string
|
|
7
|
-
|
|
5
|
+
name?: string;
|
|
6
|
+
|
|
8
7
|
/** Base CSS class to be applied to the element. Defaults to `legend`. */
|
|
9
|
-
baseClass?: string
|
|
10
|
-
|
|
8
|
+
baseClass?: string;
|
|
9
|
+
|
|
11
10
|
/** Switch to vertical mode. */
|
|
12
|
-
vertical?: boolean
|
|
11
|
+
vertical?: boolean;
|
|
13
12
|
|
|
14
13
|
/** Size of the svg shape container in pixels. Default value is 20. */
|
|
15
|
-
svgSize?: number
|
|
14
|
+
svgSize?: number;
|
|
16
15
|
|
|
17
16
|
/** Shape size in pixels. Default value is 18. */
|
|
18
|
-
shapeSize?: number
|
|
17
|
+
shapeSize?: number;
|
|
18
|
+
|
|
19
|
+
/** Default shape that will be applied to the all legend items. */
|
|
20
|
+
shape?: Cx.StringProp;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
export class Legend extends Cx.Widget<LegendProps> {
|
|
22
|
-
static Scope()
|
|
24
|
+
static Scope(): any;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
export class LegendScope extends
|
|
26
|
-
|
|
27
|
-
}
|
|
27
|
+
export class LegendScope extends Cx.Widget<Cx.PureContainerProps> {}
|
package/src/charts/Legend.js
CHANGED
|
@@ -15,6 +15,12 @@ export class Legend extends HtmlElement {
|
|
|
15
15
|
super.prepareData(context, instance);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
declareData() {
|
|
19
|
+
super.declareData(...arguments, {
|
|
20
|
+
shape: undefined,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
isValidHtmlAttribute(attrName) {
|
|
19
25
|
switch (attrName) {
|
|
20
26
|
case "shapeSize":
|
|
@@ -74,7 +80,7 @@ export class Legend extends HtmlElement {
|
|
|
74
80
|
onMouseMove={onMouseMove}
|
|
75
81
|
onMouseLeave={onMouseLeave}
|
|
76
82
|
>
|
|
77
|
-
{this.renderShape(e)}
|
|
83
|
+
{this.renderShape(e, instance.data.shape)}
|
|
78
84
|
{e.name}
|
|
79
85
|
</div>
|
|
80
86
|
))
|
|
@@ -86,11 +92,11 @@ export class Legend extends HtmlElement {
|
|
|
86
92
|
return [list, super.renderChildren(context, instance)];
|
|
87
93
|
}
|
|
88
94
|
|
|
89
|
-
renderShape(entry) {
|
|
95
|
+
renderShape(entry, legendEntriesShape) {
|
|
90
96
|
const className = this.CSS.element(this.baseClass, "shape", {
|
|
91
97
|
[`color-${entry.colorIndex}`]: entry.colorIndex != null && (isUndefined(entry.active) || entry.active),
|
|
92
98
|
});
|
|
93
|
-
const shape = getShape(entry.shape || "square");
|
|
99
|
+
const shape = getShape(legendEntriesShape || entry.shape || "square");
|
|
94
100
|
|
|
95
101
|
return (
|
|
96
102
|
<svg
|
|
@@ -115,14 +121,14 @@ Legend.prototype.baseClass = "legend";
|
|
|
115
121
|
Legend.prototype.vertical = false;
|
|
116
122
|
Legend.prototype.memoize = false;
|
|
117
123
|
Legend.prototype.shapeSize = 18;
|
|
124
|
+
Legend.prototype.shape = null;
|
|
118
125
|
Legend.prototype.svgSize = 20;
|
|
119
126
|
|
|
120
127
|
Widget.alias("legend", Legend);
|
|
121
128
|
|
|
122
129
|
Legend.Scope = class extends PureContainer {
|
|
123
130
|
explore(context, instance) {
|
|
124
|
-
context.push("legends", (instance.legends = {
|
|
125
|
-
}));
|
|
131
|
+
context.push("legends", (instance.legends = {}));
|
|
126
132
|
super.explore(context, instance);
|
|
127
133
|
}
|
|
128
134
|
|
package/src/charts/PieChart.js
CHANGED
|
@@ -13,7 +13,7 @@ export class PieChart extends BoundedObject {
|
|
|
13
13
|
super.declareData(...arguments, {
|
|
14
14
|
angle: undefined,
|
|
15
15
|
startAngle: 0,
|
|
16
|
-
clockwise: undefined
|
|
16
|
+
clockwise: undefined,
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -42,7 +42,7 @@ export class PieChart extends BoundedObject {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
PieChart.prototype.anchors = "0 1 1 0";
|
|
46
46
|
|
|
47
47
|
class PieCalculator {
|
|
48
48
|
reset(angle, startAngle, clockwise) {
|
|
@@ -88,10 +88,8 @@ class PieCalculator {
|
|
|
88
88
|
var angle = value * s.angleFactor;
|
|
89
89
|
var startAngle = s.lastAngle;
|
|
90
90
|
|
|
91
|
-
if (!this.clockwise)
|
|
92
|
-
|
|
93
|
-
else
|
|
94
|
-
s.lastAngle -= angle;
|
|
91
|
+
if (!this.clockwise) s.lastAngle += angle;
|
|
92
|
+
else s.lastAngle -= angle;
|
|
95
93
|
|
|
96
94
|
return {
|
|
97
95
|
startAngle,
|
|
@@ -354,17 +352,17 @@ export class PieSlice extends Container {
|
|
|
354
352
|
}
|
|
355
353
|
}
|
|
356
354
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
355
|
+
PieSlice.prototype.offset = 0;
|
|
356
|
+
PieSlice.prototype.r0 = 0;
|
|
357
|
+
PieSlice.prototype.r = 50;
|
|
358
|
+
PieSlice.prototype.percentageRadius = true;
|
|
359
|
+
PieSlice.prototype.baseClass = "pieslice";
|
|
360
|
+
PieSlice.prototype.legend = "legend";
|
|
361
|
+
PieSlice.prototype.active = true;
|
|
362
|
+
PieSlice.prototype.stack = "stack";
|
|
363
|
+
PieSlice.prototype.legendAction = "auto";
|
|
364
|
+
PieSlice.prototype.legendShape = "circle";
|
|
365
|
+
PieSlice.prototype.hoverChannel = "default";
|
|
366
|
+
PieSlice.prototype.styled = true;
|
|
369
367
|
|
|
370
368
|
Widget.alias("pie-chart", PieChart);
|
|
@@ -1,83 +1,86 @@
|
|
|
1
|
-
import * as Cx from "../../core";
|
|
2
|
-
import { FieldProps } from "./Field";
|
|
3
|
-
|
|
4
|
-
export interface DateTimeFieldProps extends FieldProps {
|
|
5
|
-
/** Selected date. This should be a Date object or a valid date string consumable by Date.parse function. */
|
|
6
|
-
value?: Cx.Prop<string | Date>;
|
|
7
|
-
|
|
8
|
-
/** Defaults to false. Used to make the field read-only. */
|
|
9
|
-
readOnly?: Cx.BooleanProp;
|
|
10
|
-
|
|
11
|
-
/** The opposite of `disabled`. */
|
|
12
|
-
enabled?: Cx.BooleanProp;
|
|
13
|
-
|
|
14
|
-
/** Default text displayed when the field is empty. */
|
|
15
|
-
placeholder?: Cx.StringProp;
|
|
16
|
-
|
|
17
|
-
/** Minimum date value. This should be a Date object or a valid date string consumable by Date.parse function. */
|
|
18
|
-
minValue?: Cx.Prop<string | Date>;
|
|
19
|
-
|
|
20
|
-
/** Set to `true` to disallow the `minValue`. Default value is `false`. */
|
|
21
|
-
minExclusive?: Cx.BooleanProp;
|
|
22
|
-
|
|
23
|
-
/** Maximum date value. This should be a Date object or a valid date string consumable by Date.parse function. */
|
|
24
|
-
maxValue?: Cx.Prop<string | Date>;
|
|
25
|
-
|
|
26
|
-
/** Set to `true` to disallow the `maxValue`. Default value is `false`. */
|
|
27
|
-
maxExclusive?: Cx.BooleanProp;
|
|
28
|
-
|
|
29
|
-
/** Date format used to display the selected date. See Formatting for more details. */
|
|
30
|
-
format?: Cx.StringProp;
|
|
31
|
-
|
|
32
|
-
/** Base CSS class to be applied to the field. Defaults to `datefield`. */
|
|
33
|
-
baseClass?: string;
|
|
34
|
-
|
|
35
|
-
/** Maximum value error text. */
|
|
36
|
-
maxValueErrorText?: string;
|
|
37
|
-
|
|
38
|
-
/** Maximum exclusive value error text. */
|
|
39
|
-
maxExclusiveErrorText?: string;
|
|
40
|
-
|
|
41
|
-
/** Minimum value error text. */
|
|
42
|
-
minValueErrorText?: string;
|
|
43
|
-
|
|
44
|
-
/** Minimum exclusive value error text. */
|
|
45
|
-
minExclusiveErrorText?: string;
|
|
46
|
-
|
|
47
|
-
/** Error message used to indicate wrong user input, e.g. invalid date entered. */
|
|
48
|
-
inputErrorText?: string;
|
|
49
|
-
|
|
50
|
-
/** Name of the icon to be put on the left side of the input. */
|
|
51
|
-
icon?: string;
|
|
52
|
-
|
|
53
|
-
/** Set to false to hide the clear button. It can be used interchangeably with the hideClear property. Default value is true. */
|
|
54
|
-
showClear?: boolean;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Set to `true` to display the clear button even if `required` is set. Default is `false`.
|
|
58
|
-
*/
|
|
59
|
-
alwaysShowClear?: boolean;
|
|
60
|
-
|
|
61
|
-
/** Set to true to hide the clear button. It can be used interchangeably with the showClear property. Default value is false. */
|
|
62
|
-
hideClear?: boolean;
|
|
63
|
-
|
|
64
|
-
/** Determines which segment of date/time is used. Default value is `datetime`. */
|
|
65
|
-
segment?: "date" | "time" | "datetime";
|
|
66
|
-
|
|
67
|
-
/** Set to `true` to indicate that only one segment of the selected date is affected. */
|
|
68
|
-
partial?: boolean;
|
|
69
|
-
|
|
70
|
-
/** The function that will be used to convert Date objects before writing data to the store.
|
|
71
|
-
* Default implementation is Date.toISOString.
|
|
72
|
-
* See also Culture.setDefaultDateEncoding.
|
|
73
|
-
*/
|
|
74
|
-
encoding?: (date: Date) => any;
|
|
75
|
-
|
|
76
|
-
/** Defines which days of week should be displayed as disabled, i.e. `[0, 6]` will make Sunday and Saturday unselectable. */
|
|
77
|
-
disabledDaysOfWeek?: number[];
|
|
78
|
-
|
|
79
|
-
/** Set to true to focus the input field instead of the picker first. */
|
|
80
|
-
focusInputFirst?: boolean;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
1
|
+
import * as Cx from "../../core";
|
|
2
|
+
import { FieldProps } from "./Field";
|
|
3
|
+
|
|
4
|
+
export interface DateTimeFieldProps extends FieldProps {
|
|
5
|
+
/** Selected date. This should be a Date object or a valid date string consumable by Date.parse function. */
|
|
6
|
+
value?: Cx.Prop<string | Date>;
|
|
7
|
+
|
|
8
|
+
/** Defaults to false. Used to make the field read-only. */
|
|
9
|
+
readOnly?: Cx.BooleanProp;
|
|
10
|
+
|
|
11
|
+
/** The opposite of `disabled`. */
|
|
12
|
+
enabled?: Cx.BooleanProp;
|
|
13
|
+
|
|
14
|
+
/** Default text displayed when the field is empty. */
|
|
15
|
+
placeholder?: Cx.StringProp;
|
|
16
|
+
|
|
17
|
+
/** Minimum date value. This should be a Date object or a valid date string consumable by Date.parse function. */
|
|
18
|
+
minValue?: Cx.Prop<string | Date>;
|
|
19
|
+
|
|
20
|
+
/** Set to `true` to disallow the `minValue`. Default value is `false`. */
|
|
21
|
+
minExclusive?: Cx.BooleanProp;
|
|
22
|
+
|
|
23
|
+
/** Maximum date value. This should be a Date object or a valid date string consumable by Date.parse function. */
|
|
24
|
+
maxValue?: Cx.Prop<string | Date>;
|
|
25
|
+
|
|
26
|
+
/** Set to `true` to disallow the `maxValue`. Default value is `false`. */
|
|
27
|
+
maxExclusive?: Cx.BooleanProp;
|
|
28
|
+
|
|
29
|
+
/** Date format used to display the selected date. See Formatting for more details. */
|
|
30
|
+
format?: Cx.StringProp;
|
|
31
|
+
|
|
32
|
+
/** Base CSS class to be applied to the field. Defaults to `datefield`. */
|
|
33
|
+
baseClass?: string;
|
|
34
|
+
|
|
35
|
+
/** Maximum value error text. */
|
|
36
|
+
maxValueErrorText?: string;
|
|
37
|
+
|
|
38
|
+
/** Maximum exclusive value error text. */
|
|
39
|
+
maxExclusiveErrorText?: string;
|
|
40
|
+
|
|
41
|
+
/** Minimum value error text. */
|
|
42
|
+
minValueErrorText?: string;
|
|
43
|
+
|
|
44
|
+
/** Minimum exclusive value error text. */
|
|
45
|
+
minExclusiveErrorText?: string;
|
|
46
|
+
|
|
47
|
+
/** Error message used to indicate wrong user input, e.g. invalid date entered. */
|
|
48
|
+
inputErrorText?: string;
|
|
49
|
+
|
|
50
|
+
/** Name of the icon to be put on the left side of the input. */
|
|
51
|
+
icon?: string;
|
|
52
|
+
|
|
53
|
+
/** Set to false to hide the clear button. It can be used interchangeably with the hideClear property. Default value is true. */
|
|
54
|
+
showClear?: boolean;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Set to `true` to display the clear button even if `required` is set. Default is `false`.
|
|
58
|
+
*/
|
|
59
|
+
alwaysShowClear?: boolean;
|
|
60
|
+
|
|
61
|
+
/** Set to true to hide the clear button. It can be used interchangeably with the showClear property. Default value is false. */
|
|
62
|
+
hideClear?: boolean;
|
|
63
|
+
|
|
64
|
+
/** Determines which segment of date/time is used. Default value is `datetime`. */
|
|
65
|
+
segment?: "date" | "time" | "datetime";
|
|
66
|
+
|
|
67
|
+
/** Set to `true` to indicate that only one segment of the selected date is affected. */
|
|
68
|
+
partial?: boolean;
|
|
69
|
+
|
|
70
|
+
/** The function that will be used to convert Date objects before writing data to the store.
|
|
71
|
+
* Default implementation is Date.toISOString.
|
|
72
|
+
* See also Culture.setDefaultDateEncoding.
|
|
73
|
+
*/
|
|
74
|
+
encoding?: (date: Date) => any;
|
|
75
|
+
|
|
76
|
+
/** Defines which days of week should be displayed as disabled, i.e. `[0, 6]` will make Sunday and Saturday unselectable. */
|
|
77
|
+
disabledDaysOfWeek?: number[];
|
|
78
|
+
|
|
79
|
+
/** Set to true to focus the input field instead of the picker first. */
|
|
80
|
+
focusInputFirst?: boolean;
|
|
81
|
+
|
|
82
|
+
/** Set to true to enable seconds segment in the picker. */
|
|
83
|
+
showSeconds?: boolean;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export class DateTimeField extends Cx.Widget<DateTimeFieldProps> {}
|