cx 23.5.1 → 23.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/dist/widgets.js CHANGED
@@ -6517,7 +6517,8 @@ var Label = /*#__PURE__*/ (function (_HtmlElement) {
6517
6517
  data._disabled,
6518
6518
  context.parentDisabled
6519
6519
  );
6520
- if (instance.cache("disabled", data.disabled)) {
6520
+ data.asterisk = context.parentAsterisk || this.asterisk;
6521
+ if (instance.cache("disabled", data.disabled) || instance.cache("asterisk", data.asterisk)) {
6521
6522
  instance.markShouldUpdate(context);
6522
6523
  this.prepareCSS(context, instance);
6523
6524
  }
@@ -6544,7 +6545,7 @@ var Label = /*#__PURE__*/ (function (_HtmlElement) {
6544
6545
  };
6545
6546
  }
6546
6547
  if (!props.id && data.htmlFor) props.id = data.htmlFor + "-label";
6547
- if (this.asterisk && data.required) {
6548
+ if (data.required && data.asterisk) {
6548
6549
  if (!isArray(props.children)) props.children = [props.children];
6549
6550
  props.children.push(" ");
6550
6551
  props.children.push(
@@ -10530,6 +10531,7 @@ var ValidationGroup = /*#__PURE__*/ (function (_PureContainer) {
10530
10531
  isolated: undefined,
10531
10532
  visited: undefined,
10532
10533
  strict: undefined,
10534
+ asterisk: undefined,
10533
10535
  },
10534
10536
  ])
10535
10537
  );
@@ -10545,6 +10547,7 @@ var ValidationGroup = /*#__PURE__*/ (function (_PureContainer) {
10545
10547
  context.push("parentViewMode", coalesce(instance.data.viewMode, context.parentViewMode));
10546
10548
  context.push("parentTabOnEnterKey", coalesce(instance.data.tabOnEnterKey, context.parentTabOnEnterKey));
10547
10549
  context.push("parentVisited", coalesce(instance.data.visited, context.parentVisited));
10550
+ context.push("parentAsterisk", coalesce(instance.data.asterisk, context.parentAsterisk));
10548
10551
  context.push("validation", instance.validation);
10549
10552
  _PureContainer.prototype.explore.call(this, context, instance);
10550
10553
  };
@@ -10557,6 +10560,7 @@ var ValidationGroup = /*#__PURE__*/ (function (_PureContainer) {
10557
10560
  context.pop("parentViewMode");
10558
10561
  context.pop("parentTabOnEnterKey");
10559
10562
  context.pop("parentStrict");
10563
+ context.pop("parentAsterisk");
10560
10564
  instance.valid = instance.validation.errors.length == 0;
10561
10565
  if (!instance.valid && !this.isolated && context.validation)
10562
10566
  (_context$validation$e = context.validation.errors).push.apply(_context$validation$e, instance.validation.errors);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cx",
3
- "version": "23.5.1",
3
+ "version": "23.6.0",
4
4
  "description": "Advanced JavaScript UI framework for admin and dashboard applications with ready to use grid, form and chart components.",
5
5
  "main": "index.js",
6
6
  "jsnext:main": "src/index.js",
@@ -1,82 +1,96 @@
1
- import { Instance } from "./../../ui/Instance.d";
2
- import * as Cx from "../../core";
3
- import { BoundedObject, BoundedObjectProps } from "../../svg/BoundedObject";
4
-
5
- export interface AxisProps extends BoundedObjectProps {
6
- /** Set to `true` for vertical axes. */
7
- vertical?: boolean;
8
-
9
- /** Used as a secondary axis. Displayed at the top/right. */
10
- secondary?: boolean;
11
-
12
- /** When set to `true`, the values are displayed in descending order. */
13
- inverted?: Cx.BooleanProp;
14
-
15
- /** When set to `true`, rendering of visual elements of the axis, such as ticks and labels, is skipped, but their function is preserved. */
16
- hidden?: boolean;
17
-
18
- tickSize?: number;
19
- minTickDistance?: number;
20
- minLabelDistanceVertical?: number;
21
- minLabelDistanceHorizontal?: number;
22
-
23
- /** Distance between labels and the axis. */
24
- labelOffset?: number | string;
25
-
26
- /** Label rotation angle in degrees. */
27
- labelRotation?: Cx.Prop<number | string>;
28
-
29
- /** Label text-anchor value. Allowed values are start, end and middle. Default value is set based on the value of vertical and secondary flags. */
30
- labelAnchor?: "start" | "end" | "middle" | "auto";
31
-
32
- /** Horizontal text offset. */
33
- labelDx?: number | string;
34
-
35
- /** Vertical text offset which can be used for vertical alignment. */
36
- labelDy?: number | string;
37
-
38
- /** Set to `true` to break long labels into multiple lines. Default value is `false`. Text is split at space characters. See also `labelMaxLineLength` and `labelLineCountDyFactor`. */
39
- labelWrap?: boolean;
40
-
41
- /**
42
- * Used for vertical adjustment of multi-line labels. Default value is `auto` which means
43
- * that value is initialized based on axis configuration. Value `0` means that label will grow towards
44
- * the bottom of the screen. Value `-1` will make labels to grow towards the top of the screen.
45
- * `-0.5` will make labels vertically centered.
46
- */
47
- labelLineCountDyFactor?: number | string;
48
-
49
- /** If `labelWrap` is on, this number is used as a measure to split labels into multiple lines. Default value is `10`. */
50
- labelMaxLineLength?: number;
51
-
52
- /** Set to true to hide the axis labels. */
53
- hideLabels?: boolean;
54
-
55
- /** Set to true to hide the axis line. */
56
- hideLine?: boolean;
57
-
58
- /** Set to true to hide the axis ticks. */
59
- hideTicks?: boolean;
60
-
61
- /** Additional CSS style to be applied to the axis line. */
62
- lineStyle?: Cx.StyleProp;
63
-
64
- /** Additional CSS style to be applied to the axis ticks. */
65
- tickStyle?: Cx.StyleProp;
66
-
67
- /** Additional CSS style to be applied to the axis labels. */
68
- labelStyle?: Cx.StyleProp;
69
-
70
- /** Additional CSS class to be applied to the axis line. */
71
- lineClass?: Cx.ClassProp;
72
-
73
- /** Additional CSS class to be applied to the axis ticks. */
74
- tickClass?: Cx.ClassProp;
75
-
76
- /** Additional CSS class to be applied to the axis labels. */
77
- labelClass?: Cx.ClassProp;
78
-
79
- onMeasured?: (info: any, instance: Instance) => void;
80
- }
81
-
82
- export class Axis extends BoundedObject {}
1
+ import { Instance } from "./../../ui/Instance.d";
2
+ import * as Cx from "../../core";
3
+ import { BoundedObject, BoundedObjectProps } from "../../svg/BoundedObject";
4
+
5
+ export interface AxisProps extends BoundedObjectProps {
6
+ /** Set to `true` for vertical axes. */
7
+ vertical?: boolean;
8
+
9
+ /** Used as a secondary axis. Displayed at the top/right. */
10
+ secondary?: boolean;
11
+
12
+ /** When set to `true`, the values are displayed in descending order. */
13
+ inverted?: Cx.BooleanProp;
14
+
15
+ /** When set to `true`, rendering of visual elements of the axis, such as ticks and labels, is skipped, but their function is preserved. */
16
+ hidden?: boolean;
17
+
18
+ tickSize?: number;
19
+ minTickDistance?: number;
20
+ minLabelDistanceVertical?: number;
21
+ minLabelDistanceHorizontal?: number;
22
+
23
+ /** Distance between labels and the axis. */
24
+ labelOffset?: number | string;
25
+
26
+ /** Label rotation angle in degrees. */
27
+ labelRotation?: Cx.Prop<number | string>;
28
+
29
+ /** Label text-anchor value. Allowed values are start, end and middle. Default value is set based on the value of vertical and secondary flags. */
30
+ labelAnchor?: "start" | "end" | "middle" | "auto";
31
+
32
+ /** Horizontal text offset. */
33
+ labelDx?: number | string;
34
+
35
+ /** Vertical text offset which can be used for vertical alignment. */
36
+ labelDy?: number | string;
37
+
38
+ /** Set to `true` to break long labels into multiple lines. Default value is `false`. Text is split at space characters. See also `labelMaxLineLength` and `labelLineCountDyFactor`. */
39
+ labelWrap?: boolean;
40
+
41
+ /**
42
+ * Used for vertical adjustment of multi-line labels. Default value is `auto` which means
43
+ * that value is initialized based on axis configuration. Value `0` means that label will grow towards
44
+ * the bottom of the screen. Value `-1` will make labels to grow towards the top of the screen.
45
+ * `-0.5` will make labels vertically centered.
46
+ */
47
+ labelLineCountDyFactor?: number | string;
48
+
49
+ /**
50
+ * Used for vertical adjustment of multi-line labels. Default value is 1 which means
51
+ * that labels are stacked without any space between them. Value of 1.4 will add 40% of the label height as a space between labels.
52
+ */
53
+ labelLineHeight?: number | string;
54
+
55
+ /** If `labelWrap` is on, this number is used as a measure to split labels into multiple lines. Default value is `10`. */
56
+ labelMaxLineLength?: number;
57
+
58
+ /** Set to true to hide the axis labels. */
59
+ hideLabels?: boolean;
60
+
61
+ /** Set to true to hide the axis line. */
62
+ hideLine?: boolean;
63
+
64
+ /** Set to true to hide the axis ticks. */
65
+ hideTicks?: boolean;
66
+
67
+ /** Additional CSS style to be applied to the axis line. */
68
+ lineStyle?: Cx.StyleProp;
69
+
70
+ /** Additional CSS style to be applied to the axis ticks. */
71
+ tickStyle?: Cx.StyleProp;
72
+
73
+ /** Additional CSS style to be applied to the axis labels. */
74
+ labelStyle?: Cx.StyleProp;
75
+
76
+ /** Additional CSS class to be applied to the axis line. */
77
+ lineClass?: Cx.ClassProp;
78
+
79
+ /** Additional CSS class to be applied to the axis ticks. */
80
+ tickClass?: Cx.ClassProp;
81
+
82
+ /** Additional CSS class to be applied to the axis labels. */
83
+ labelClass?: Cx.ClassProp;
84
+
85
+ onMeasured?: (info: any, instance: Instance) => void;
86
+
87
+ /** A function used to create a formatter function for axis labels. See Complex Labels example in the CxJS documentation for more info. */
88
+ onCreateLabelFormatter?:
89
+ | string
90
+ | ((
91
+ context: any,
92
+ instance: Instance
93
+ ) => (formattedValue: string, value: any) => { text: string; style?: any; className?: string }[]);
94
+ }
95
+
96
+ export class Axis extends BoundedObject {}