cx 26.4.2 → 26.4.3

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.
Files changed (38) hide show
  1. package/build/jsx-dev-runtime.d.ts +1 -0
  2. package/build/jsx-dev-runtime.d.ts.map +1 -1
  3. package/build/jsx-dev-runtime.js +1 -0
  4. package/dist/manifest.js +889 -889
  5. package/package.json +1 -1
  6. package/src/charts/BarGraph.scss +31 -31
  7. package/src/charts/Legend.scss +57 -57
  8. package/src/charts/LegendEntry.scss +35 -35
  9. package/src/charts/LineGraph.scss +28 -28
  10. package/src/charts/helpers/SnapPointFinder.ts +136 -136
  11. package/src/charts/helpers/ValueAtFinder.ts +72 -72
  12. package/src/data/createAccessorModelProxy.ts +66 -66
  13. package/src/jsx-dev-runtime.ts +1 -0
  14. package/src/ui/DataProxy.ts +55 -55
  15. package/src/ui/Repeater.spec.tsx +181 -181
  16. package/src/ui/Rescope.ts +50 -50
  17. package/src/ui/adapter/ArrayAdapter.ts +229 -229
  18. package/src/ui/exprHelpers.ts +96 -96
  19. package/src/util/scss/include.scss +69 -69
  20. package/src/widgets/Button.maps.scss +103 -103
  21. package/src/widgets/Sandbox.ts +104 -104
  22. package/src/widgets/form/Calendar.tsx +772 -772
  23. package/src/widgets/form/ColorField.scss +112 -112
  24. package/src/widgets/form/DateTimeField.scss +111 -111
  25. package/src/widgets/form/LookupField.maps.scss +26 -26
  26. package/src/widgets/form/LookupField.scss +227 -227
  27. package/src/widgets/form/MonthField.scss +113 -113
  28. package/src/widgets/form/NumberField.scss +72 -72
  29. package/src/widgets/form/Select.scss +104 -104
  30. package/src/widgets/form/TextField.scss +66 -66
  31. package/src/widgets/grid/Grid.scss +657 -657
  32. package/src/widgets/grid/variables.scss +47 -47
  33. package/src/widgets/index.ts +63 -63
  34. package/src/widgets/nav/MenuItem.scss +150 -150
  35. package/src/widgets/nav/MenuItem.tsx +525 -525
  36. package/src/widgets/nav/Tab.ts +122 -122
  37. package/src/widgets/overlay/Overlay.tsx +1029 -1029
  38. package/src/widgets/variables.scss +61 -61
@@ -1,122 +1,122 @@
1
- import { Widget, VDOM } from "../../ui/Widget";
2
- import { HtmlElement, HtmlElementConfigBase, HtmlElementInstance } from "../HtmlElement";
3
- import { Instance } from "../../ui/Instance";
4
- import { RenderingContext } from "../../ui/RenderingContext";
5
- import { preventFocus, preventFocusOnTouch } from "../../ui/FocusManager";
6
- import { isUndefined } from "../../util/isUndefined";
7
- import { BooleanProp, Prop, StringProp } from "../../ui/Prop";
8
-
9
- export interface TabConfig extends HtmlElementConfigBase {
10
- /** A value to be written to the `value` property if the tab is clicked. */
11
- tab?: Prop<string | number>;
12
-
13
- /**
14
- * Value of the currently selected tab.
15
- * If `value` is equal to `tab`, the tab appears active.
16
- */
17
- value?: StringProp;
18
-
19
- /** Set to `true` to disable selection. */
20
- disabled?: BooleanProp;
21
-
22
- /** Base CSS class to be applied to the element. No class is applied by default. */
23
- baseClass?: string;
24
-
25
- /** Name of the HTML element to be rendered. Default is `div`. */
26
- tag?: string;
27
-
28
- /**
29
- * Determines if tab should receive focus on `mousedown` event.
30
- * Default is `false`, which means that focus can be set only using the keyboard `Tab` key.
31
- */
32
- focusOnMouseDown?: boolean;
33
-
34
- /** Set to true to set the default tab. */
35
- default?: boolean;
36
- }
37
-
38
- export class Tab extends HtmlElement<TabConfig> {
39
- declare public baseClass: string;
40
- declare public tag: string;
41
- declare public focusOnMouseDown: boolean;
42
- declare public default: boolean;
43
- declare public shape?: string;
44
- declare public onMouseDown?: any;
45
- declare public onClick?: any;
46
- declareData() {
47
- super.declareData(
48
- {
49
- tab: undefined,
50
- value: undefined,
51
- disabled: undefined,
52
- text: undefined,
53
- },
54
- ...arguments,
55
- );
56
- }
57
-
58
- prepareData(context: RenderingContext, instance: HtmlElementInstance) {
59
- let { data } = instance;
60
- data.stateMods = {
61
- active: data.tab == data.value,
62
- disabled: data.disabled,
63
- shape: this.shape,
64
- };
65
- if (this.default && isUndefined(data.value)) instance.set("value", data.tab);
66
- super.prepareData(context, instance);
67
- }
68
-
69
- isValidHtmlAttribute(attrName: string) {
70
- switch (attrName) {
71
- case "value":
72
- case "tab":
73
- case "text":
74
- case "disabled":
75
- case "default":
76
- return false;
77
-
78
- default:
79
- return super.isValidHtmlAttribute(attrName);
80
- }
81
- }
82
-
83
- attachProps(context: RenderingContext, instance: HtmlElementInstance, props: any) {
84
- super.attachProps(context, instance, props);
85
-
86
- let { data } = instance;
87
- if (!data.disabled) {
88
- props.href = "#";
89
- delete props.value;
90
-
91
- props.onMouseDown = (e: any) => {
92
- if (this.onMouseDown && instance.invoke("onMouseDown", e, instance) === false) return;
93
- if (!this.focusOnMouseDown) preventFocus(e);
94
- else preventFocusOnTouch(e);
95
- };
96
-
97
- props.onClick = (e: any) => this.handleClick(e, instance);
98
- }
99
- }
100
-
101
- handleClick(e: any, instance: Instance) {
102
- if (this.onClick && instance.invoke("onClick", e, instance) === false) {
103
- return;
104
- }
105
-
106
- e.preventDefault();
107
- e.stopPropagation();
108
-
109
- let { data } = instance;
110
-
111
- if (data.disabled) return;
112
-
113
- instance.set("value", data.tab);
114
- }
115
- }
116
-
117
- Tab.prototype.baseClass = "tab";
118
- Tab.prototype.tag = "a";
119
- Tab.prototype.focusOnMouseDown = false;
120
- Tab.prototype.default = false;
121
-
122
- Widget.alias("tab", Tab);
1
+ import { Widget, VDOM } from "../../ui/Widget";
2
+ import { HtmlElement, HtmlElementConfigBase, HtmlElementInstance } from "../HtmlElement";
3
+ import { Instance } from "../../ui/Instance";
4
+ import { RenderingContext } from "../../ui/RenderingContext";
5
+ import { preventFocus, preventFocusOnTouch } from "../../ui/FocusManager";
6
+ import { isUndefined } from "../../util/isUndefined";
7
+ import { BooleanProp, Prop, StringProp } from "../../ui/Prop";
8
+
9
+ export interface TabConfig extends HtmlElementConfigBase {
10
+ /** A value to be written to the `value` property if the tab is clicked. */
11
+ tab?: Prop<string | number>;
12
+
13
+ /**
14
+ * Value of the currently selected tab.
15
+ * If `value` is equal to `tab`, the tab appears active.
16
+ */
17
+ value?: StringProp;
18
+
19
+ /** Set to `true` to disable selection. */
20
+ disabled?: BooleanProp;
21
+
22
+ /** Base CSS class to be applied to the element. No class is applied by default. */
23
+ baseClass?: string;
24
+
25
+ /** Name of the HTML element to be rendered. Default is `div`. */
26
+ tag?: string;
27
+
28
+ /**
29
+ * Determines if tab should receive focus on `mousedown` event.
30
+ * Default is `false`, which means that focus can be set only using the keyboard `Tab` key.
31
+ */
32
+ focusOnMouseDown?: boolean;
33
+
34
+ /** Set to true to set the default tab. */
35
+ default?: boolean;
36
+ }
37
+
38
+ export class Tab extends HtmlElement<TabConfig> {
39
+ declare public baseClass: string;
40
+ declare public tag: string;
41
+ declare public focusOnMouseDown: boolean;
42
+ declare public default: boolean;
43
+ declare public shape?: string;
44
+ declare public onMouseDown?: any;
45
+ declare public onClick?: any;
46
+ declareData() {
47
+ super.declareData(
48
+ {
49
+ tab: undefined,
50
+ value: undefined,
51
+ disabled: undefined,
52
+ text: undefined,
53
+ },
54
+ ...arguments,
55
+ );
56
+ }
57
+
58
+ prepareData(context: RenderingContext, instance: HtmlElementInstance) {
59
+ let { data } = instance;
60
+ data.stateMods = {
61
+ active: data.tab == data.value,
62
+ disabled: data.disabled,
63
+ shape: this.shape,
64
+ };
65
+ if (this.default && isUndefined(data.value)) instance.set("value", data.tab);
66
+ super.prepareData(context, instance);
67
+ }
68
+
69
+ isValidHtmlAttribute(attrName: string) {
70
+ switch (attrName) {
71
+ case "value":
72
+ case "tab":
73
+ case "text":
74
+ case "disabled":
75
+ case "default":
76
+ return false;
77
+
78
+ default:
79
+ return super.isValidHtmlAttribute(attrName);
80
+ }
81
+ }
82
+
83
+ attachProps(context: RenderingContext, instance: HtmlElementInstance, props: any) {
84
+ super.attachProps(context, instance, props);
85
+
86
+ let { data } = instance;
87
+ if (!data.disabled) {
88
+ props.href = "#";
89
+ delete props.value;
90
+
91
+ props.onMouseDown = (e: any) => {
92
+ if (this.onMouseDown && instance.invoke("onMouseDown", e, instance) === false) return;
93
+ if (!this.focusOnMouseDown) preventFocus(e);
94
+ else preventFocusOnTouch(e);
95
+ };
96
+
97
+ props.onClick = (e: any) => this.handleClick(e, instance);
98
+ }
99
+ }
100
+
101
+ handleClick(e: any, instance: Instance) {
102
+ if (this.onClick && instance.invoke("onClick", e, instance) === false) {
103
+ return;
104
+ }
105
+
106
+ e.preventDefault();
107
+ e.stopPropagation();
108
+
109
+ let { data } = instance;
110
+
111
+ if (data.disabled) return;
112
+
113
+ instance.set("value", data.tab);
114
+ }
115
+ }
116
+
117
+ Tab.prototype.baseClass = "tab";
118
+ Tab.prototype.tag = "a";
119
+ Tab.prototype.focusOnMouseDown = false;
120
+ Tab.prototype.default = false;
121
+
122
+ Widget.alias("tab", Tab);