cx 26.7.6 → 26.9.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.
Files changed (73) hide show
  1. package/build/charts/Legend.d.ts +8 -1
  2. package/build/charts/Legend.d.ts.map +1 -1
  3. package/build/charts/Legend.js +8 -4
  4. package/build/charts/LineGraph.d.ts +8 -16
  5. package/build/charts/LineGraph.d.ts.map +1 -1
  6. package/build/charts/LineGraph.js +76 -69
  7. package/build/charts/axis/NumericAxis.d.ts.map +1 -1
  8. package/build/charts/axis/NumericAxis.js +1 -254
  9. package/build/charts/axis/NumericScale.d.ts +59 -0
  10. package/build/charts/axis/NumericScale.d.ts.map +1 -0
  11. package/build/charts/axis/NumericScale.js +254 -0
  12. package/build/jsx-dev-runtime.d.ts +2 -1
  13. package/build/jsx-dev-runtime.d.ts.map +1 -1
  14. package/build/svg/Svg.d.ts +9 -0
  15. package/build/svg/Svg.d.ts.map +1 -1
  16. package/build/svg/Svg.js +9 -1
  17. package/build/ui/index.d.ts +3 -2
  18. package/build/ui/index.d.ts.map +1 -1
  19. package/build/ui/index.js +1 -1
  20. package/build/util/DOM.d.ts.map +1 -1
  21. package/build/util/DOM.js +16 -4
  22. package/build/util/getActiveElement.d.ts +1 -1
  23. package/build/util/getActiveElement.d.ts.map +1 -1
  24. package/build/util/getActiveElement.js +14 -2
  25. package/build/widgets/form/TextArea.d.ts +4 -0
  26. package/build/widgets/form/TextArea.d.ts.map +1 -1
  27. package/build/widgets/form/TextArea.js +7 -1
  28. package/build/widgets/grid/Grid.d.ts +12 -2
  29. package/build/widgets/grid/Grid.d.ts.map +1 -1
  30. package/build/widgets/grid/Grid.js +17 -4
  31. package/build/widgets/nav/MenuItem.js +2 -2
  32. package/build/widgets/overlay/Dropdown.d.ts +4 -4
  33. package/build/widgets/overlay/Dropdown.d.ts.map +1 -1
  34. package/build/widgets/overlay/Dropdown.js +82 -38
  35. package/build/widgets/overlay/Overlay.d.ts.map +1 -1
  36. package/build/widgets/overlay/Overlay.js +7 -3
  37. package/build/widgets/overlay/Window.d.ts.map +1 -1
  38. package/build/widgets/overlay/Window.js +2 -1
  39. package/dist/charts.js +166 -168
  40. package/dist/manifest.js +805 -802
  41. package/dist/svg.js +13 -0
  42. package/dist/util.js +31 -9
  43. package/dist/widgets.js +153 -50
  44. package/package.json +1 -1
  45. package/src/charts/Legend.tsx +22 -2
  46. package/src/charts/LineGraph.tsx +80 -98
  47. package/src/charts/axis/NumericAxis.spec.ts +40 -0
  48. package/src/charts/axis/NumericAxis.tsx +1 -290
  49. package/src/charts/axis/NumericScale.ts +290 -0
  50. package/src/jsx-dev-runtime.ts +2 -1
  51. package/src/svg/Svg.tsx +24 -1
  52. package/src/ui/Cx.tsx +505 -505
  53. package/src/ui/DataProxy.ts +55 -55
  54. package/src/ui/Rescope.ts +50 -50
  55. package/src/ui/exprHelpers.ts +96 -96
  56. package/src/ui/index.ts +3 -6
  57. package/src/util/DOM.ts +15 -4
  58. package/src/util/getActiveElement.ts +16 -2
  59. package/src/widgets/Sandbox.ts +104 -104
  60. package/src/widgets/form/ColorField.scss +112 -112
  61. package/src/widgets/form/DateTimeField.scss +111 -111
  62. package/src/widgets/form/LookupField.maps.scss +26 -26
  63. package/src/widgets/form/MonthField.scss +113 -113
  64. package/src/widgets/form/Select.scss +104 -104
  65. package/src/widgets/form/TextArea.tsx +10 -1
  66. package/src/widgets/form/TextField.scss +66 -66
  67. package/src/widgets/grid/Grid.sorting.spec.tsx +188 -0
  68. package/src/widgets/grid/Grid.tsx +31 -7
  69. package/src/widgets/index.ts +41 -41
  70. package/src/widgets/nav/MenuItem.tsx +2 -2
  71. package/src/widgets/overlay/Dropdown.tsx +87 -27
  72. package/src/widgets/overlay/Overlay.tsx +5 -3
  73. package/src/widgets/overlay/Window.tsx +2 -1
@@ -1,104 +1,104 @@
1
- import { Widget } from "../ui/Widget";
2
- import { PureContainerBase, PureContainerConfig } from "../ui/PureContainer";
3
- import { Binding, BindingInput } from "../data/Binding";
4
- import { ExposedValueView, ExposedValueViewConfig } from "../data/ExposedValueView";
5
- import { RenderingContext } from "../ui/RenderingContext";
6
- import { Instance } from "../ui/Instance";
7
- import { StringProp, WritableProp } from "../ui/Prop";
8
- import { AccessorChain } from "../data/createAccessorModelProxy";
9
-
10
- export interface SandboxConfig extends PureContainerConfig {
11
- /** Binding to the object that holds sandbox data. */
12
- storage: WritableProp<Record<string, any>>;
13
-
14
- /** Key used to identify the sandbox instance within the storage. */
15
- key?: StringProp;
16
-
17
- /** Alias for `key`. */
18
- accessKey?: StringProp;
19
-
20
- /** Alias used to expose sandbox data. Default is `$page`. */
21
- recordName?: string | AccessorChain<any>;
22
-
23
- /** Alias for `recordName`. */
24
- recordAlias?: string | AccessorChain<any>;
25
-
26
- /** Indicate that parent store data should not be mutated. */
27
- immutable?: boolean;
28
-
29
- /** Indicate that sandbox store data should not be mutated. */
30
- sealed?: boolean;
31
- }
32
-
33
- export interface SandboxInstance extends Instance {
34
- store: ExposedValueView;
35
- }
36
-
37
- export class Sandbox extends PureContainerBase<SandboxConfig, SandboxInstance> {
38
- declare storage: WritableProp<Record<string, any>>;
39
- declare key?: StringProp;
40
- declare recordName?: string;
41
- declare recordAlias?: string;
42
- declare accessKey?: StringProp;
43
- declare immutable?: boolean;
44
- declare sealed?: boolean;
45
- declare storageBinding: Binding;
46
- init(): void {
47
- if (this.recordAlias) this.recordName = this.recordAlias;
48
-
49
- if (this.accessKey) this.key = this.accessKey;
50
-
51
- this.storageBinding = Binding.get(this.storage);
52
-
53
- super.init();
54
- }
55
-
56
- initInstance(context: RenderingContext, instance: SandboxInstance): void {
57
- instance.store = new ExposedValueView({
58
- store: instance.parentStore,
59
- containerBinding: this.storageBinding,
60
- key: null,
61
- recordName: this.recordName,
62
- immutable: this.immutable,
63
- });
64
- super.initInstance(context, instance);
65
- }
66
-
67
- applyParentStore(instance: SandboxInstance): void {
68
- instance.store.setStore(instance.parentStore);
69
- }
70
-
71
- declareData(...args: Record<string, unknown>[]): void {
72
- super.declareData(
73
- {
74
- storage: undefined,
75
- key: undefined,
76
- },
77
- ...args,
78
- );
79
- }
80
-
81
- prepareData(context: RenderingContext, instance: SandboxInstance): void {
82
- var { store, data } = instance;
83
- if (store.getKey() !== data.key) {
84
- //when navigating to a page using the same widget tree as the previous page
85
- //everything needs to be reinstantiated, e.g. user/1 => user/2
86
- instance.store = new ExposedValueView({
87
- store: store,
88
- containerBinding: this.storageBinding,
89
- key: data.key,
90
- recordName: this.recordName,
91
- immutable: this.immutable,
92
- sealed: this.sealed,
93
- });
94
- instance.clearChildrenCache();
95
- }
96
- super.prepareData(context, instance);
97
- }
98
- }
99
-
100
- Sandbox.prototype.recordName = "$page";
101
- Sandbox.prototype.immutable = false;
102
- Sandbox.prototype.sealed = false;
103
-
104
- Widget.alias("sandbox", Sandbox);
1
+ import { Widget } from "../ui/Widget";
2
+ import { PureContainerBase, PureContainerConfig } from "../ui/PureContainer";
3
+ import { Binding, BindingInput } from "../data/Binding";
4
+ import { ExposedValueView, ExposedValueViewConfig } from "../data/ExposedValueView";
5
+ import { RenderingContext } from "../ui/RenderingContext";
6
+ import { Instance } from "../ui/Instance";
7
+ import { StringProp, WritableProp } from "../ui/Prop";
8
+ import { AccessorChain } from "../data/createAccessorModelProxy";
9
+
10
+ export interface SandboxConfig extends PureContainerConfig {
11
+ /** Binding to the object that holds sandbox data. */
12
+ storage: WritableProp<Record<string, any>>;
13
+
14
+ /** Key used to identify the sandbox instance within the storage. */
15
+ key?: StringProp;
16
+
17
+ /** Alias for `key`. */
18
+ accessKey?: StringProp;
19
+
20
+ /** Alias used to expose sandbox data. Default is `$page`. */
21
+ recordName?: string | AccessorChain<any>;
22
+
23
+ /** Alias for `recordName`. */
24
+ recordAlias?: string | AccessorChain<any>;
25
+
26
+ /** Indicate that parent store data should not be mutated. */
27
+ immutable?: boolean;
28
+
29
+ /** Indicate that sandbox store data should not be mutated. */
30
+ sealed?: boolean;
31
+ }
32
+
33
+ export interface SandboxInstance extends Instance {
34
+ store: ExposedValueView;
35
+ }
36
+
37
+ export class Sandbox extends PureContainerBase<SandboxConfig, SandboxInstance> {
38
+ declare storage: WritableProp<Record<string, any>>;
39
+ declare key?: StringProp;
40
+ declare recordName?: string;
41
+ declare recordAlias?: string;
42
+ declare accessKey?: StringProp;
43
+ declare immutable?: boolean;
44
+ declare sealed?: boolean;
45
+ declare storageBinding: Binding;
46
+ init(): void {
47
+ if (this.recordAlias) this.recordName = this.recordAlias;
48
+
49
+ if (this.accessKey) this.key = this.accessKey;
50
+
51
+ this.storageBinding = Binding.get(this.storage);
52
+
53
+ super.init();
54
+ }
55
+
56
+ initInstance(context: RenderingContext, instance: SandboxInstance): void {
57
+ instance.store = new ExposedValueView({
58
+ store: instance.parentStore,
59
+ containerBinding: this.storageBinding,
60
+ key: null,
61
+ recordName: this.recordName,
62
+ immutable: this.immutable,
63
+ });
64
+ super.initInstance(context, instance);
65
+ }
66
+
67
+ applyParentStore(instance: SandboxInstance): void {
68
+ instance.store.setStore(instance.parentStore);
69
+ }
70
+
71
+ declareData(...args: Record<string, unknown>[]): void {
72
+ super.declareData(
73
+ {
74
+ storage: undefined,
75
+ key: undefined,
76
+ },
77
+ ...args,
78
+ );
79
+ }
80
+
81
+ prepareData(context: RenderingContext, instance: SandboxInstance): void {
82
+ var { store, data } = instance;
83
+ if (store.getKey() !== data.key) {
84
+ //when navigating to a page using the same widget tree as the previous page
85
+ //everything needs to be reinstantiated, e.g. user/1 => user/2
86
+ instance.store = new ExposedValueView({
87
+ store: store,
88
+ containerBinding: this.storageBinding,
89
+ key: data.key,
90
+ recordName: this.recordName,
91
+ immutable: this.immutable,
92
+ sealed: this.sealed,
93
+ });
94
+ instance.clearChildrenCache();
95
+ }
96
+ super.prepareData(context, instance);
97
+ }
98
+ }
99
+
100
+ Sandbox.prototype.recordName = "$page";
101
+ Sandbox.prototype.immutable = false;
102
+ Sandbox.prototype.sealed = false;
103
+
104
+ Widget.alias("sandbox", Sandbox);
@@ -1,112 +1,112 @@
1
- @use "sass:math";
2
- @use "sass:map";
3
- @use "../variables" as *;
4
- @use "../maps" as *;
5
- @use "../../util/call-once.scss" as *;
6
- @use "../../util/scss/add-rules.scss" as *;
7
- @use "../../util/scss/calc.scss" as *;
8
- @use "../../util/scss/clockwise.scss" as *;
9
- @use "../../util/scss/deep-merge.scss" as *;
10
- @use "../../util/scss/besm.scss" as *;
11
- @use "../../util/scss/include.scss" as *;
12
- @use "./Field.scss" as *;
13
- @use "./ColorPicker.scss" as *;
14
-
15
- @mixin cx-colorfield(
16
- $name: "colorfield",
17
- $state-style-map: $cx-std-field-state-style-map,
18
- $placeholder: $cx-input-placeholder,
19
- $empty-text: $cx-empty-text,
20
- $clear-state-style-map: $cx-clear-state-style-map,
21
- $left-icon-state-style-map: $cx-input-left-icon-state-style-map,
22
- $right-icon-state-style-map: $cx-input-right-icon-state-style-map,
23
- $width: $cx-default-input-width,
24
- $icon-size: $cx-default-icon-size,
25
- $besm: $cx-besm
26
- ) {
27
- $block: map.get($besm, block);
28
- $element: map.get($besm, element);
29
- $state: map.get($besm, state);
30
-
31
- .#{$block}#{$name} {
32
- @include cxb-field($besm, $state-style-map, $width: $width, $input: true);
33
- }
34
-
35
- $padding: cx-get-state-rule($state-style-map, default, "padding");
36
-
37
- .#{$element}#{$name}-input {
38
- @include cxe-field-input(
39
- $besm,
40
- $state-style-map,
41
- $placeholder: $placeholder,
42
- $overrides: (
43
- default: (
44
- font-family: $cx-default-colorfield-font-family,
45
- font-size: 11px,
46
- padding: cx-top($padding) cx-calc(cx-top($padding), $cx-default-clear-size, $cx-default-clear-spacing)
47
- cx-bottom($padding)
48
- cx-calc(cx-top($padding), $cx-default-input-left-tool-size, $cx-default-input-left-tool-spacing),
49
- )
50
- )
51
- );
52
- }
53
-
54
- .#{$element}#{$name}-clear {
55
- @include cxe-field-button($besm, $clear-state-style-map);
56
-
57
- .#{$state}focus > & {
58
- @include cx-add-state-rules($clear-state-style-map, focus);
59
- }
60
- .#{$state}error > & {
61
- @include cx-add-state-rules($clear-state-style-map, error);
62
- }
63
- }
64
-
65
- .#{$element}#{$name}-right-icon {
66
- @include cxe-field-button($besm, $right-icon-state-style-map);
67
-
68
- .#{$state}focus > & {
69
- @include cx-add-state-rules($right-icon-state-style-map, focus);
70
- }
71
- .#{$state}error > & {
72
- @include cx-add-state-rules($right-icon-state-style-map, error);
73
- }
74
- }
75
-
76
- .#{$element}#{$name}-left-icon {
77
- box-sizing: border-box;
78
-
79
- @include cx-checker-background();
80
-
81
- @include cxe-field-button(
82
- $besm,
83
- cx-deep-map-merge(
84
- $left-icon-state-style-map,
85
- (
86
- default: (
87
- opacity: 1,
88
- cursor: pointer,
89
- ),
90
- )
91
- )
92
- );
93
-
94
- div {
95
- width: 100%;
96
- height: 100%;
97
- border-radius: inherit;
98
- }
99
- }
100
-
101
- .#{$element}#{$name}-icon {
102
- @include cxe-field-button-icon($besm, $icon-size);
103
- }
104
-
105
- .#{$element}#{$name}-empty-text {
106
- @include cxe-field-empty-text($empty-text);
107
- }
108
- }
109
-
110
- @if (cx-should-include("cx/widgets/ColorField")) {
111
- @include cx-colorfield();
112
- }
1
+ @use "sass:math";
2
+ @use "sass:map";
3
+ @use "../variables" as *;
4
+ @use "../maps" as *;
5
+ @use "../../util/call-once.scss" as *;
6
+ @use "../../util/scss/add-rules.scss" as *;
7
+ @use "../../util/scss/calc.scss" as *;
8
+ @use "../../util/scss/clockwise.scss" as *;
9
+ @use "../../util/scss/deep-merge.scss" as *;
10
+ @use "../../util/scss/besm.scss" as *;
11
+ @use "../../util/scss/include.scss" as *;
12
+ @use "./Field.scss" as *;
13
+ @use "./ColorPicker.scss" as *;
14
+
15
+ @mixin cx-colorfield(
16
+ $name: "colorfield",
17
+ $state-style-map: $cx-std-field-state-style-map,
18
+ $placeholder: $cx-input-placeholder,
19
+ $empty-text: $cx-empty-text,
20
+ $clear-state-style-map: $cx-clear-state-style-map,
21
+ $left-icon-state-style-map: $cx-input-left-icon-state-style-map,
22
+ $right-icon-state-style-map: $cx-input-right-icon-state-style-map,
23
+ $width: $cx-default-input-width,
24
+ $icon-size: $cx-default-icon-size,
25
+ $besm: $cx-besm
26
+ ) {
27
+ $block: map.get($besm, block);
28
+ $element: map.get($besm, element);
29
+ $state: map.get($besm, state);
30
+
31
+ .#{$block}#{$name} {
32
+ @include cxb-field($besm, $state-style-map, $width: $width, $input: true);
33
+ }
34
+
35
+ $padding: cx-get-state-rule($state-style-map, default, "padding");
36
+
37
+ .#{$element}#{$name}-input {
38
+ @include cxe-field-input(
39
+ $besm,
40
+ $state-style-map,
41
+ $placeholder: $placeholder,
42
+ $overrides: (
43
+ default: (
44
+ font-family: $cx-default-colorfield-font-family,
45
+ font-size: 11px,
46
+ padding: cx-top($padding) cx-calc(cx-top($padding), $cx-default-clear-size, $cx-default-clear-spacing)
47
+ cx-bottom($padding)
48
+ cx-calc(cx-top($padding), $cx-default-input-left-tool-size, $cx-default-input-left-tool-spacing),
49
+ )
50
+ )
51
+ );
52
+ }
53
+
54
+ .#{$element}#{$name}-clear {
55
+ @include cxe-field-button($besm, $clear-state-style-map);
56
+
57
+ .#{$state}focus > & {
58
+ @include cx-add-state-rules($clear-state-style-map, focus);
59
+ }
60
+ .#{$state}error > & {
61
+ @include cx-add-state-rules($clear-state-style-map, error);
62
+ }
63
+ }
64
+
65
+ .#{$element}#{$name}-right-icon {
66
+ @include cxe-field-button($besm, $right-icon-state-style-map);
67
+
68
+ .#{$state}focus > & {
69
+ @include cx-add-state-rules($right-icon-state-style-map, focus);
70
+ }
71
+ .#{$state}error > & {
72
+ @include cx-add-state-rules($right-icon-state-style-map, error);
73
+ }
74
+ }
75
+
76
+ .#{$element}#{$name}-left-icon {
77
+ box-sizing: border-box;
78
+
79
+ @include cx-checker-background();
80
+
81
+ @include cxe-field-button(
82
+ $besm,
83
+ cx-deep-map-merge(
84
+ $left-icon-state-style-map,
85
+ (
86
+ default: (
87
+ opacity: 1,
88
+ cursor: pointer,
89
+ ),
90
+ )
91
+ )
92
+ );
93
+
94
+ div {
95
+ width: 100%;
96
+ height: 100%;
97
+ border-radius: inherit;
98
+ }
99
+ }
100
+
101
+ .#{$element}#{$name}-icon {
102
+ @include cxe-field-button-icon($besm, $icon-size);
103
+ }
104
+
105
+ .#{$element}#{$name}-empty-text {
106
+ @include cxe-field-empty-text($empty-text);
107
+ }
108
+ }
109
+
110
+ @if (cx-should-include("cx/widgets/ColorField")) {
111
+ @include cx-colorfield();
112
+ }
@@ -1,111 +1,111 @@
1
- @use "sass:math";
2
- @use "sass:map";
3
- @use "../variables" as *;
4
- @use "../maps" as *;
5
- @use "../../util/scss/add-rules.scss" as *;
6
- @use "../../util/scss/calc.scss" as *;
7
- @use "../../util/scss/clockwise.scss" as *;
8
- @use "../../util/scss/deep-merge.scss" as *;
9
- @use "../../util/scss/besm.scss" as *;
10
- @use "../../util/scss/include.scss" as *;
11
- @use "./Field.scss" as *;
12
-
13
- @mixin cx-datetimefield(
14
- $name: "datetimefield",
15
- $input-state-style-map: $cx-std-field-state-style-map,
16
- $placeholder: $cx-input-placeholder,
17
- $empty-text: $cx-empty-text,
18
- $clear-state-style-map: $cx-clear-state-style-map,
19
- $left-icon-state-style-map: $cx-input-left-icon-state-style-map,
20
- $right-icon-state-style-map: $cx-input-right-icon-state-style-map,
21
- $icon-size: $cx-default-input-icon-size,
22
- $width: $cx-default-input-width,
23
- $besm: $cx-besm
24
- ) {
25
- $block: map.get($besm, block);
26
- $element: map.get($besm, element);
27
- $state: map.get($besm, state);
28
-
29
- .#{$block}#{$name} {
30
- @include cxb-field($besm, $input-state-style-map, $width: $width, $input: true);
31
- }
32
-
33
- $padding: cx-get-state-rule($input-state-style-map, default, "padding");
34
-
35
- .#{$element}#{$name}-input {
36
- @include cxe-field-input(
37
- $besm,
38
- $input-state-style-map,
39
- $placeholder: $placeholder,
40
- $overrides: (
41
- default: (
42
- padding: cx-top($padding) cx-calc(cx-top($padding), $cx-default-clear-size, $cx-default-clear-spacing)
43
- cx-bottom($padding)
44
- cx-calc(cx-top($padding), $cx-default-input-left-tool-size, $cx-default-input-left-tool-spacing),
45
- )
46
- )
47
- );
48
- }
49
-
50
- .#{$element}#{$name}-clear {
51
- @include cxe-field-button($besm, $clear-state-style-map);
52
-
53
- .#{$state}focus > & {
54
- @include cx-add-state-rules($clear-state-style-map, focus);
55
- }
56
- .#{$state}error > & {
57
- @include cx-add-state-rules($clear-state-style-map, error);
58
- }
59
- }
60
-
61
- .#{$element}#{$name}-left-icon {
62
- @include cxe-field-button(
63
- $besm,
64
- cx-deep-map-merge(
65
- $left-icon-state-style-map,
66
- (
67
- default: (
68
- cursor: pointer,
69
- ),
70
- )
71
- )
72
- );
73
-
74
- .#{$state}disabled > & {
75
- @include cx-add-state-rules($input-state-style-map, disabled);
76
- border-width: 0;
77
- }
78
- .#{$state}focus > & {
79
- @include cx-add-state-rules($left-icon-state-style-map, focus);
80
- }
81
- .#{$state}error > & {
82
- @include cx-add-state-rules($left-icon-state-style-map, error);
83
- }
84
- }
85
-
86
- .#{$element}#{$name}-right-icon {
87
- @include cxe-field-button($besm, $right-icon-state-style-map);
88
- .#{$state}disabled > & {
89
- @include cx-add-state-rules($input-state-style-map, disabled);
90
- border-width: 0;
91
- }
92
- .#{$state}focus > & {
93
- @include cx-add-state-rules($right-icon-state-style-map, focus);
94
- }
95
- .#{$state}error > & {
96
- @include cx-add-state-rules($right-icon-state-style-map, error);
97
- }
98
- }
99
-
100
- .#{$element}#{$name}-icon {
101
- @include cxe-field-button-icon($besm, $icon-size);
102
- }
103
-
104
- .#{$element}#{$name}-empty-text {
105
- @include cxe-field-empty-text($empty-text);
106
- }
107
- }
108
-
109
- @if (cx-should-include("cx/widgets/DateTimeField")) {
110
- @include cx-datetimefield();
111
- }
1
+ @use "sass:math";
2
+ @use "sass:map";
3
+ @use "../variables" as *;
4
+ @use "../maps" as *;
5
+ @use "../../util/scss/add-rules.scss" as *;
6
+ @use "../../util/scss/calc.scss" as *;
7
+ @use "../../util/scss/clockwise.scss" as *;
8
+ @use "../../util/scss/deep-merge.scss" as *;
9
+ @use "../../util/scss/besm.scss" as *;
10
+ @use "../../util/scss/include.scss" as *;
11
+ @use "./Field.scss" as *;
12
+
13
+ @mixin cx-datetimefield(
14
+ $name: "datetimefield",
15
+ $input-state-style-map: $cx-std-field-state-style-map,
16
+ $placeholder: $cx-input-placeholder,
17
+ $empty-text: $cx-empty-text,
18
+ $clear-state-style-map: $cx-clear-state-style-map,
19
+ $left-icon-state-style-map: $cx-input-left-icon-state-style-map,
20
+ $right-icon-state-style-map: $cx-input-right-icon-state-style-map,
21
+ $icon-size: $cx-default-input-icon-size,
22
+ $width: $cx-default-input-width,
23
+ $besm: $cx-besm
24
+ ) {
25
+ $block: map.get($besm, block);
26
+ $element: map.get($besm, element);
27
+ $state: map.get($besm, state);
28
+
29
+ .#{$block}#{$name} {
30
+ @include cxb-field($besm, $input-state-style-map, $width: $width, $input: true);
31
+ }
32
+
33
+ $padding: cx-get-state-rule($input-state-style-map, default, "padding");
34
+
35
+ .#{$element}#{$name}-input {
36
+ @include cxe-field-input(
37
+ $besm,
38
+ $input-state-style-map,
39
+ $placeholder: $placeholder,
40
+ $overrides: (
41
+ default: (
42
+ padding: cx-top($padding) cx-calc(cx-top($padding), $cx-default-clear-size, $cx-default-clear-spacing)
43
+ cx-bottom($padding)
44
+ cx-calc(cx-top($padding), $cx-default-input-left-tool-size, $cx-default-input-left-tool-spacing),
45
+ )
46
+ )
47
+ );
48
+ }
49
+
50
+ .#{$element}#{$name}-clear {
51
+ @include cxe-field-button($besm, $clear-state-style-map);
52
+
53
+ .#{$state}focus > & {
54
+ @include cx-add-state-rules($clear-state-style-map, focus);
55
+ }
56
+ .#{$state}error > & {
57
+ @include cx-add-state-rules($clear-state-style-map, error);
58
+ }
59
+ }
60
+
61
+ .#{$element}#{$name}-left-icon {
62
+ @include cxe-field-button(
63
+ $besm,
64
+ cx-deep-map-merge(
65
+ $left-icon-state-style-map,
66
+ (
67
+ default: (
68
+ cursor: pointer,
69
+ ),
70
+ )
71
+ )
72
+ );
73
+
74
+ .#{$state}disabled > & {
75
+ @include cx-add-state-rules($input-state-style-map, disabled);
76
+ border-width: 0;
77
+ }
78
+ .#{$state}focus > & {
79
+ @include cx-add-state-rules($left-icon-state-style-map, focus);
80
+ }
81
+ .#{$state}error > & {
82
+ @include cx-add-state-rules($left-icon-state-style-map, error);
83
+ }
84
+ }
85
+
86
+ .#{$element}#{$name}-right-icon {
87
+ @include cxe-field-button($besm, $right-icon-state-style-map);
88
+ .#{$state}disabled > & {
89
+ @include cx-add-state-rules($input-state-style-map, disabled);
90
+ border-width: 0;
91
+ }
92
+ .#{$state}focus > & {
93
+ @include cx-add-state-rules($right-icon-state-style-map, focus);
94
+ }
95
+ .#{$state}error > & {
96
+ @include cx-add-state-rules($right-icon-state-style-map, error);
97
+ }
98
+ }
99
+
100
+ .#{$element}#{$name}-icon {
101
+ @include cxe-field-button-icon($besm, $icon-size);
102
+ }
103
+
104
+ .#{$element}#{$name}-empty-text {
105
+ @include cxe-field-empty-text($empty-text);
106
+ }
107
+ }
108
+
109
+ @if (cx-should-include("cx/widgets/DateTimeField")) {
110
+ @include cx-datetimefield();
111
+ }