cx 26.3.3 → 26.3.5

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 (65) hide show
  1. package/build/charts/helpers/SnapPointFinder.d.ts +2 -2
  2. package/build/charts/helpers/SnapPointFinder.d.ts.map +1 -1
  3. package/build/charts/helpers/ValueAtFinder.d.ts +4 -4
  4. package/build/charts/helpers/ValueAtFinder.d.ts.map +1 -1
  5. package/build/charts/helpers/ValueAtFinder.js +5 -2
  6. package/build/data/createAccessorModelProxy.d.ts +11 -6
  7. package/build/data/createAccessorModelProxy.d.ts.map +1 -1
  8. package/build/data/createAccessorModelProxy.js +3 -1
  9. package/build/jsx-runtime.d.ts +1 -2
  10. package/build/jsx-runtime.d.ts.map +1 -1
  11. package/build/ui/createFunctionalComponent.d.ts +1 -4
  12. package/build/ui/createFunctionalComponent.d.ts.map +1 -1
  13. package/build/widgets/form/Calendar.d.ts +0 -1
  14. package/build/widgets/form/Calendar.d.ts.map +1 -1
  15. package/build/widgets/form/Calendar.js +22 -14
  16. package/build/widgets/form/TimeList.d.ts +1 -3
  17. package/build/widgets/form/TimeList.d.ts.map +1 -1
  18. package/build/widgets/index.d.ts +1 -3
  19. package/build/widgets/index.d.ts.map +1 -1
  20. package/build/widgets/index.js +1 -3
  21. package/build/widgets/overlay/Overlay.d.ts +1 -1
  22. package/build/widgets/overlay/Overlay.d.ts.map +1 -1
  23. package/build/widgets/overlay/Overlay.js +19 -10
  24. package/build/widgets/overlay/Window.d.ts.map +1 -1
  25. package/build/widgets/overlay/Window.js +11 -5
  26. package/dist/charts.css +256 -256
  27. package/dist/manifest.js +728 -737
  28. package/dist/widgets.css +6 -14
  29. package/dist/widgets.js +13 -26
  30. package/package.json +1 -1
  31. package/src/charts/BarGraph.scss +31 -31
  32. package/src/charts/Legend.scss +57 -57
  33. package/src/charts/LegendEntry.scss +35 -35
  34. package/src/charts/LineGraph.scss +28 -28
  35. package/src/charts/helpers/SnapPointFinder.ts +136 -136
  36. package/src/charts/helpers/ValueAtFinder.ts +72 -72
  37. package/src/charts/variables.scss +1 -2
  38. package/src/data/createAccessorModelProxy.ts +66 -66
  39. package/src/ui/DataProxy.ts +55 -55
  40. package/src/ui/Rescope.ts +50 -50
  41. package/src/ui/adapter/ArrayAdapter.ts +229 -229
  42. package/src/ui/exprHelpers.ts +96 -96
  43. package/src/util/scss/include.scss +40 -27
  44. package/src/widgets/Button.maps.scss +103 -103
  45. package/src/widgets/Sandbox.ts +104 -104
  46. package/src/widgets/drag-drop/variables.scss +1 -2
  47. package/src/widgets/form/Calendar.tsx +772 -772
  48. package/src/widgets/form/ColorField.scss +112 -117
  49. package/src/widgets/form/DateTimeField.scss +111 -125
  50. package/src/widgets/form/LookupField.scss +228 -251
  51. package/src/widgets/form/MonthField.scss +113 -122
  52. package/src/widgets/form/NumberField.scss +72 -80
  53. package/src/widgets/form/Select.scss +104 -117
  54. package/src/widgets/form/TextField.scss +66 -78
  55. package/src/widgets/form/variables.scss +110 -111
  56. package/src/widgets/grid/Grid.tsx +3885 -4428
  57. package/src/widgets/grid/variables.scss +47 -48
  58. package/src/widgets/index.ts +63 -63
  59. package/src/widgets/nav/Menu.variables.scss +1 -2
  60. package/src/widgets/nav/Tab.ts +6 -4
  61. package/src/widgets/nav/variables.scss +1 -2
  62. package/src/widgets/overlay/Overlay.tsx +1028 -1028
  63. package/src/widgets/overlay/Window.tsx +320 -320
  64. package/src/widgets/overlay/variables.scss +1 -2
  65. package/src/widgets/variables.scss +61 -62
@@ -1,96 +1,96 @@
1
- import { computable } from "../data/computable";
2
- import { AccessorChain } from "../data/createAccessorModelProxy";
3
- import { Selector } from "../data/Selector";
4
- import { Format } from "../util/Format";
5
- import { expr } from "./expr";
6
-
7
- /** Returns a selector that converts the value to boolean using !! */
8
- export function truthy<V>(arg: AccessorChain<V>): Selector<boolean> {
9
- return expr(arg, (x) => !!x);
10
- }
11
-
12
- /** Returns a selector that checks if the value is falsy using ! */
13
- export function falsy<V>(arg: AccessorChain<V>): Selector<boolean> {
14
- return expr(arg, (x) => !x);
15
- }
16
-
17
- /** Returns a selector that checks if the value is strictly true (=== true) */
18
- export function isTrue(arg: AccessorChain<any>): Selector<boolean> {
19
- return expr(arg, (x) => x === true);
20
- }
21
-
22
- /** Returns a selector that checks if the value is strictly false (=== false) */
23
- export function isFalse(arg: AccessorChain<any>): Selector<boolean> {
24
- return expr(arg, (x) => x === false);
25
- }
26
-
27
- /** Returns a selector that checks if the value is not null or undefined (x != null) */
28
- export function hasValue<V>(arg: AccessorChain<V>): Selector<boolean> {
29
- return expr(arg, (x) => x != null);
30
- }
31
-
32
- /** Returns a selector that checks if a string or array is empty (null, undefined, or length === 0) */
33
- export function isEmpty(arg: AccessorChain<string | any[] | null | undefined>): Selector<boolean> {
34
- return expr(arg, (x) => x == null || x.length === 0);
35
- }
36
-
37
- /** Returns a selector that checks if a string or array is non-empty (not null/undefined and length > 0) */
38
- export function isNonEmpty(arg: AccessorChain<string | any[] | null | undefined>): Selector<boolean> {
39
- return expr(arg, (x) => x != null && x.length > 0);
40
- }
41
-
42
- /** Returns a selector that checks if the value is less than the given value */
43
- export function lessThan<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
44
- return expr(arg, (x) => x < value);
45
- }
46
-
47
- /** Returns a selector that checks if the value is less than or equal to the given value */
48
- export function lessThanOrEqual<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
49
- return expr(arg, (x) => x <= value);
50
- }
51
-
52
- /** Returns a selector that checks if the value is greater than the given value */
53
- export function greaterThan<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
54
- return expr(arg, (x) => x > value);
55
- }
56
-
57
- /** Returns a selector that checks if the value is greater than or equal to the given value */
58
- export function greaterThanOrEqual<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
59
- return expr(arg, (x) => x >= value);
60
- }
61
-
62
- /** Returns a selector that checks if the value equals the given value using == */
63
- export function equal<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
64
- return expr(arg, (x) => x == value);
65
- }
66
-
67
- /** Returns a selector that checks if the value does not equal the given value using != */
68
- export function notEqual<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
69
- return expr(arg, (x) => x != value);
70
- }
71
-
72
- /** Returns a selector that checks if the value strictly equals the given value using === */
73
- export function strictEqual<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
74
- return expr(arg, (x) => x === value);
75
- }
76
-
77
- /** Returns a selector that checks if the value strictly does not equal the given value using !== */
78
- export function strictNotEqual<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
79
- return expr(arg, (x) => x !== value);
80
- }
81
-
82
- /** Returns a selector that formats the value using the specified format string.
83
- * Format strings use semicolon-separated syntax: "formatType;param1;param2"
84
- * @param arg - The accessor chain to the value
85
- * @param fmt - The format string
86
- * @param nullText - Optional text to display for null/undefined values
87
- * @example
88
- * format(m.price, "n;2") // formats as number with 2 decimal places
89
- * format(m.date, "d") // formats as date
90
- * format(m.value, "p;0;2") // formats as percentage with 0-2 decimal places
91
- * format(m.value, "n;2", "N/A") // shows "N/A" for null values
92
- */
93
- export function format<V>(arg: AccessorChain<V>, fmt: string, nullText?: string): Selector<string> {
94
- let f = nullText != null ? `${fmt}|${nullText}` : fmt;
95
- return computable(arg, (x) => Format.value(x, f));
96
- }
1
+ import { computable } from "../data/computable";
2
+ import { AccessorChain } from "../data/createAccessorModelProxy";
3
+ import { Selector } from "../data/Selector";
4
+ import { Format } from "../util/Format";
5
+ import { expr } from "./expr";
6
+
7
+ /** Returns a selector that converts the value to boolean using !! */
8
+ export function truthy<V>(arg: AccessorChain<V>): Selector<boolean> {
9
+ return expr(arg, (x) => !!x);
10
+ }
11
+
12
+ /** Returns a selector that checks if the value is falsy using ! */
13
+ export function falsy<V>(arg: AccessorChain<V>): Selector<boolean> {
14
+ return expr(arg, (x) => !x);
15
+ }
16
+
17
+ /** Returns a selector that checks if the value is strictly true (=== true) */
18
+ export function isTrue(arg: AccessorChain<any>): Selector<boolean> {
19
+ return expr(arg, (x) => x === true);
20
+ }
21
+
22
+ /** Returns a selector that checks if the value is strictly false (=== false) */
23
+ export function isFalse(arg: AccessorChain<any>): Selector<boolean> {
24
+ return expr(arg, (x) => x === false);
25
+ }
26
+
27
+ /** Returns a selector that checks if the value is not null or undefined (x != null) */
28
+ export function hasValue<V>(arg: AccessorChain<V>): Selector<boolean> {
29
+ return expr(arg, (x) => x != null);
30
+ }
31
+
32
+ /** Returns a selector that checks if a string or array is empty (null, undefined, or length === 0) */
33
+ export function isEmpty(arg: AccessorChain<string | any[] | null | undefined>): Selector<boolean> {
34
+ return expr(arg, (x) => x == null || x.length === 0);
35
+ }
36
+
37
+ /** Returns a selector that checks if a string or array is non-empty (not null/undefined and length > 0) */
38
+ export function isNonEmpty(arg: AccessorChain<string | any[] | null | undefined>): Selector<boolean> {
39
+ return expr(arg, (x) => x != null && x.length > 0);
40
+ }
41
+
42
+ /** Returns a selector that checks if the value is less than the given value */
43
+ export function lessThan<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
44
+ return expr(arg, (x) => x < value);
45
+ }
46
+
47
+ /** Returns a selector that checks if the value is less than or equal to the given value */
48
+ export function lessThanOrEqual<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
49
+ return expr(arg, (x) => x <= value);
50
+ }
51
+
52
+ /** Returns a selector that checks if the value is greater than the given value */
53
+ export function greaterThan<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
54
+ return expr(arg, (x) => x > value);
55
+ }
56
+
57
+ /** Returns a selector that checks if the value is greater than or equal to the given value */
58
+ export function greaterThanOrEqual<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
59
+ return expr(arg, (x) => x >= value);
60
+ }
61
+
62
+ /** Returns a selector that checks if the value equals the given value using == */
63
+ export function equal<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
64
+ return expr(arg, (x) => x == value);
65
+ }
66
+
67
+ /** Returns a selector that checks if the value does not equal the given value using != */
68
+ export function notEqual<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
69
+ return expr(arg, (x) => x != value);
70
+ }
71
+
72
+ /** Returns a selector that checks if the value strictly equals the given value using === */
73
+ export function strictEqual<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
74
+ return expr(arg, (x) => x === value);
75
+ }
76
+
77
+ /** Returns a selector that checks if the value strictly does not equal the given value using !== */
78
+ export function strictNotEqual<V>(arg: AccessorChain<V>, value: V): Selector<boolean> {
79
+ return expr(arg, (x) => x !== value);
80
+ }
81
+
82
+ /** Returns a selector that formats the value using the specified format string.
83
+ * Format strings use semicolon-separated syntax: "formatType;param1;param2"
84
+ * @param arg - The accessor chain to the value
85
+ * @param fmt - The format string
86
+ * @param nullText - Optional text to display for null/undefined values
87
+ * @example
88
+ * format(m.price, "n;2") // formats as number with 2 decimal places
89
+ * format(m.date, "d") // formats as date
90
+ * format(m.value, "p;0;2") // formats as percentage with 0-2 decimal places
91
+ * format(m.value, "n;2", "N/A") // shows "N/A" for null values
92
+ */
93
+ export function format<V>(arg: AccessorChain<V>, fmt: string, nullText?: string): Selector<string> {
94
+ let f = nullText != null ? `${fmt}|${nullText}` : fmt;
95
+ return computable(arg, (x) => Format.value(x, f));
96
+ }
@@ -10,13 +10,43 @@ $cx-used: null !default;
10
10
 
11
11
  $cx-dependencies: () !default;
12
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
+
13
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
+
14
47
  @return (
15
48
  (map.get($cx-excluded, $name) != true) and
16
- (
17
- $cx-include-all or
18
- ($cx-used != null and map.get($cx-used, $name) == true)
19
- )
49
+ ($cx-include-all or ($cx-used != null and map.get($cx-used, $name) == true))
20
50
  )
21
51
  and ($once != true or cx-call-once($name));
22
52
  }
@@ -25,32 +55,15 @@ $cx-dependencies: () !default;
25
55
  @return cx-called-once($name);
26
56
  }
27
57
 
28
- @function cx-widget($name) {
29
- @if (map.get($cx-excluded, $name)) {
30
- @return 0;
31
- }
32
- $cx-used: map.merge(
33
- $cx-used,
34
- (
35
- $name: true,
36
- )
37
- ) !global;
38
- $dummy: 1;
39
- $deps: map.get($cx-dependencies, $name);
40
- @if ($deps == null) {
41
- @return 0;
42
- }
43
- @each $dep in $deps {
44
- $dummy: cx-widget($dep);
45
- }
46
- @return $dummy;
47
- }
48
-
49
58
  @mixin cx-widgets($names...) {
50
- $dummy: 1;
51
59
  $cx-used: () !default !global;
52
60
 
53
61
  @each $name in $names {
54
- $dummy: cx-widget($name);
62
+ $cx-used: map.merge(
63
+ $cx-used,
64
+ (
65
+ $name: true,
66
+ )
67
+ ) !global;
55
68
  }
56
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;