cx 24.9.1 → 24.9.2

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 (55) hide show
  1. package/dist/charts.js +22 -25
  2. package/dist/data.js +26 -29
  3. package/dist/manifest.js +775 -775
  4. package/dist/svg.js +59 -56
  5. package/dist/ui.js +51 -52
  6. package/dist/widgets.js +46 -49
  7. package/package.json +32 -32
  8. package/src/charts/Legend.js +151 -151
  9. package/src/charts/PieLabel.js +71 -71
  10. package/src/charts/axis/NumericAxis.js +347 -347
  11. package/src/charts/axis/Stack.js +55 -55
  12. package/src/charts/helpers/PointReducer.js +43 -43
  13. package/src/charts/helpers/SnapPointFinder.js +69 -69
  14. package/src/data/Binding.spec.js +69 -69
  15. package/src/data/StringTemplate.spec.js +105 -105
  16. package/src/data/getAccessor.spec.js +11 -11
  17. package/src/index.scss +6 -6
  18. package/src/svg/Text.d.ts +40 -40
  19. package/src/ui/Culture.d.ts +55 -55
  20. package/src/ui/Culture.js +139 -139
  21. package/src/ui/FocusManager.js +171 -171
  22. package/src/ui/Instance.d.ts +72 -72
  23. package/src/ui/VDOM.d.ts +12 -12
  24. package/src/ui/app/startAppLoop.js +58 -58
  25. package/src/ui/index.d.ts +42 -42
  26. package/src/ui/layout/LabelsTopLayout.js +134 -134
  27. package/src/util/Console.d.ts +4 -4
  28. package/src/util/scss/add-rules.scss +38 -38
  29. package/src/widgets/CxCredit.scss +37 -37
  30. package/src/widgets/List.scss +91 -91
  31. package/src/widgets/drag-drop/DropZone.js +214 -214
  32. package/src/widgets/form/Calendar.scss +196 -196
  33. package/src/widgets/form/ColorField.js +397 -397
  34. package/src/widgets/form/ColorPicker.scss +283 -283
  35. package/src/widgets/form/DateTimeField.js +573 -573
  36. package/src/widgets/form/MonthField.js +516 -516
  37. package/src/widgets/form/MonthPicker.scss +118 -118
  38. package/src/widgets/form/NumberField.js +459 -459
  39. package/src/widgets/form/NumberField.scss +61 -61
  40. package/src/widgets/form/Select.scss +99 -99
  41. package/src/widgets/form/Slider.scss +118 -118
  42. package/src/widgets/form/Switch.scss +140 -140
  43. package/src/widgets/form/TextArea.scss +43 -43
  44. package/src/widgets/form/TextField.js +290 -289
  45. package/src/widgets/form/TextField.scss +55 -55
  46. package/src/widgets/form/UploadButton.d.ts +34 -34
  47. package/src/widgets/grid/TreeNode.scss +88 -88
  48. package/src/widgets/grid/variables.scss +88 -88
  49. package/src/widgets/nav/Menu.scss +74 -74
  50. package/src/widgets/overlay/Dropdown.js +612 -612
  51. package/src/widgets/overlay/FlyweightTooltipTracker.js +39 -39
  52. package/src/widgets/overlay/Tooltip.js +300 -300
  53. package/src/widgets/overlay/Window.js +196 -196
  54. package/src/widgets/overlay/captureMouse.js +124 -124
  55. package/src/widgets/overlay/variables.scss +83 -83
@@ -1,55 +1,55 @@
1
- @mixin cx-textfield(
2
- $name: "textfield",
3
- $state-style-map: $cx-std-field-state-style-map,
4
- $placeholder: $cx-input-placeholder,
5
- $empty-text: $cx-empty-text,
6
- $left-icon-state-style-map: $cx-input-left-icon-state-style-map,
7
- $clear-state-style-map: $cx-clear-state-style-map,
8
- $icon-size: $cx-default-input-icon-size,
9
- $width: $cx-default-input-width,
10
- $besm: $cx-besm
11
- ) {
12
- $block: map-get($besm, block);
13
- $element: map-get($besm, element);
14
- $state: map-get($besm, state);
15
- $mod: map-get($besm, mod);
16
-
17
- .#{$block}#{$name} {
18
- @include cxb-field($besm, $state-style-map, $width: $width, $input: true);
19
- }
20
-
21
- $padding: cx-get-state-rule($state-style-map, default, "padding");
22
-
23
- .#{$element}#{$name}-input {
24
- @include cxe-field-input($besm, $state-style-map, $placeholder: $placeholder);
25
-
26
- .#{$state}icon > & {
27
- padding-left: cx-calc(2 * cx-left($padding), $icon-size);
28
- }
29
-
30
- .#{$state}clear > & {
31
- padding-right: cx-calc(cx-right($padding), $cx-default-clear-size, $cx-default-clear-spacing);
32
- }
33
- }
34
-
35
- .#{$element}#{$name}-left-icon {
36
- pointer-events: none;
37
- @include cxe-field-button($besm, $left-icon-state-style-map);
38
- }
39
-
40
- .#{$element}#{$name}-clear {
41
- @include cxe-field-button($besm, $clear-state-style-map);
42
- }
43
-
44
- .#{$element}#{$name}-icon {
45
- @include cxe-field-button-icon($besm, $icon-size);
46
- }
47
-
48
- .#{$element}#{$name}-empty-text {
49
- @include cxe-field-empty-text($empty-text);
50
- }
51
- }
52
-
53
- @if (cx-should-include("cx/widgets/TextField")) {
54
- @include cx-textfield();
55
- }
1
+ @mixin cx-textfield(
2
+ $name: "textfield",
3
+ $state-style-map: $cx-std-field-state-style-map,
4
+ $placeholder: $cx-input-placeholder,
5
+ $empty-text: $cx-empty-text,
6
+ $left-icon-state-style-map: $cx-input-left-icon-state-style-map,
7
+ $clear-state-style-map: $cx-clear-state-style-map,
8
+ $icon-size: $cx-default-input-icon-size,
9
+ $width: $cx-default-input-width,
10
+ $besm: $cx-besm
11
+ ) {
12
+ $block: map-get($besm, block);
13
+ $element: map-get($besm, element);
14
+ $state: map-get($besm, state);
15
+ $mod: map-get($besm, mod);
16
+
17
+ .#{$block}#{$name} {
18
+ @include cxb-field($besm, $state-style-map, $width: $width, $input: true);
19
+ }
20
+
21
+ $padding: cx-get-state-rule($state-style-map, default, "padding");
22
+
23
+ .#{$element}#{$name}-input {
24
+ @include cxe-field-input($besm, $state-style-map, $placeholder: $placeholder);
25
+
26
+ .#{$state}icon > & {
27
+ padding-left: cx-calc(2 * cx-left($padding), $icon-size);
28
+ }
29
+
30
+ .#{$state}clear > & {
31
+ padding-right: cx-calc(cx-right($padding), $cx-default-clear-size, $cx-default-clear-spacing);
32
+ }
33
+ }
34
+
35
+ .#{$element}#{$name}-left-icon {
36
+ pointer-events: none;
37
+ @include cxe-field-button($besm, $left-icon-state-style-map);
38
+ }
39
+
40
+ .#{$element}#{$name}-clear {
41
+ @include cxe-field-button($besm, $clear-state-style-map);
42
+ }
43
+
44
+ .#{$element}#{$name}-icon {
45
+ @include cxe-field-button-icon($besm, $icon-size);
46
+ }
47
+
48
+ .#{$element}#{$name}-empty-text {
49
+ @include cxe-field-empty-text($empty-text);
50
+ }
51
+ }
52
+
53
+ @if (cx-should-include("cx/widgets/TextField")) {
54
+ @include cx-textfield();
55
+ }
@@ -1,34 +1,34 @@
1
- import * as Cx from "../../core";
2
- import { FieldProps } from "./Field";
3
-
4
- interface UploadButtonProps extends FieldProps {
5
- /** Text description. */
6
- text?: Cx.StringProp;
7
-
8
- url?: Cx.StringProp;
9
-
10
- /** Base CSS class to be applied to the element. Default is 'uploadbutton'. */
11
- baseClass?: string;
12
-
13
- /** Defaults to `false`. Set to `true` to enable multiple selection. */
14
- multiple?: boolean;
15
-
16
- method?: string;
17
- uploadInProgressText?: string;
18
-
19
- /** Defaults to `false`. Set to `true` to abort uploads if the button is destroyed (unmounted). */
20
- abortOnDestroy?: boolean;
21
-
22
- /** Defines file types that are accepted for upload. */
23
- accept?: Cx.StringProp;
24
-
25
- /** Name of the icon to be put on the left side of the button. */
26
- icon?: Cx.StringProp;
27
-
28
- onUploadStarting?: ((xhr: XMLHttpRequest, instance: any, file: File, formData: FormData) => boolean) | string;
29
- onUploadComplete?: ((xhr: XMLHttpRequest, instance: any, file: File, formData: FormData) => void) | string;
30
- onUploadProgress?: ((event: ProgressEvent, instance: any, file: File, formData: FormData) => void) | string;
31
- onUploadError?: ((event: ProgressEvent, instance: any, file: File, formData: FormData) => void) | string;
32
- }
33
-
34
- export class UploadButton extends Cx.Widget<UploadButtonProps> {}
1
+ import * as Cx from "../../core";
2
+ import { FieldProps } from "./Field";
3
+
4
+ interface UploadButtonProps extends FieldProps {
5
+ /** Text description. */
6
+ text?: Cx.StringProp;
7
+
8
+ url?: Cx.StringProp;
9
+
10
+ /** Base CSS class to be applied to the element. Default is 'uploadbutton'. */
11
+ baseClass?: string;
12
+
13
+ /** Defaults to `false`. Set to `true` to enable multiple selection. */
14
+ multiple?: boolean;
15
+
16
+ method?: string;
17
+ uploadInProgressText?: string;
18
+
19
+ /** Defaults to `false`. Set to `true` to abort uploads if the button is destroyed (unmounted). */
20
+ abortOnDestroy?: boolean;
21
+
22
+ /** Defines file types that are accepted for upload. */
23
+ accept?: Cx.StringProp;
24
+
25
+ /** Name of the icon to be put on the left side of the button. */
26
+ icon?: Cx.StringProp;
27
+
28
+ onUploadStarting?: ((xhr: XMLHttpRequest, instance: any, file: File, formData: FormData) => boolean) | string;
29
+ onUploadComplete?: ((xhr: XMLHttpRequest, instance: any, file: File, formData: FormData) => void) | string;
30
+ onUploadProgress?: ((event: ProgressEvent, instance: any, file: File, formData: FormData) => void) | string;
31
+ onUploadError?: ((event: ProgressEvent, instance: any, file: File, formData: FormData) => void) | string;
32
+ }
33
+
34
+ export class UploadButton extends Cx.Widget<UploadButtonProps> {}
@@ -1,88 +1,88 @@
1
- @mixin cx-treenode(
2
- $name: "treenode",
3
- $icon-size: $cx-default-icon-size,
4
- $handle-size: $cx-default-input-tool-size,
5
- $handle-state-style-map: $cx-input-right-icon-state-style-map,
6
- $besm: $cx-besm
7
- ) {
8
- $block: map-get($besm, block);
9
- $element: map-get($besm, element);
10
- $state: map-get($besm, state);
11
- $mod: map-get($besm, mod);
12
-
13
- .#{$block}#{$name} {
14
- padding-left: $handle-size + $icon-size * 0.25;
15
- position: relative;
16
-
17
- &.#{$state}icon {
18
- padding-left: $handle-size + $icon-size + $icon-size * 0.25;
19
- }
20
-
21
- @for $i from 1 through 20 {
22
- &.#{$state}level-#{$i} {
23
- margin-left: #{($i * 20)}px;
24
- }
25
- }
26
- }
27
-
28
- .#{$element}#{$name}-handle {
29
- position: absolute;
30
-
31
- @include cx-add-state-rules($handle-state-style-map, default);
32
-
33
- left: 0;
34
- top: 50%;
35
- margin-top: -$handle-size * 0.5;
36
- bottom: 0;
37
- width: $handle-size + $icon-size;
38
- height: $handle-size;
39
-
40
- &:hover {
41
- @include cx-add-state-rules($handle-state-style-map, hover);
42
- }
43
-
44
- &:active {
45
- @include cx-add-state-rules($handle-state-style-map, active);
46
- }
47
- }
48
-
49
- .#{$element}#{$name}-arrow {
50
- display: block;
51
- position: absolute;
52
- left: 0;
53
- top: 50%;
54
- margin-top: -$icon-size * 0.5;
55
- margin-left: ($handle-size - $icon-size) * 0.5;
56
- height: $icon-size;
57
- width: $icon-size;
58
- line-height: $icon-size;
59
- transform: rotate(-90deg);
60
- transition: transform 0.2s;
61
-
62
- .#{$state}expanded & {
63
- transform: rotate(0);
64
- }
65
- }
66
-
67
- .#{$element}#{$name}-icon {
68
- display: block;
69
- position: absolute;
70
- left: 0;
71
- top: 50%;
72
- margin-top: -$icon-size * 0.5;
73
- margin-left: ($handle-size + $icon-size) * 0.5;
74
- height: $icon-size;
75
- width: $icon-size;
76
- line-height: $icon-size;
77
- }
78
-
79
- .#{$block}grid.#{$mod}tree {
80
- td {
81
- border-top: none;
82
- }
83
- }
84
- }
85
-
86
- @if (cx-should-include("cx/widgets/TreeNode")) {
87
- @include cx-treenode();
88
- }
1
+ @mixin cx-treenode(
2
+ $name: "treenode",
3
+ $icon-size: $cx-default-icon-size,
4
+ $handle-size: $cx-default-input-tool-size,
5
+ $handle-state-style-map: $cx-input-right-icon-state-style-map,
6
+ $besm: $cx-besm
7
+ ) {
8
+ $block: map-get($besm, block);
9
+ $element: map-get($besm, element);
10
+ $state: map-get($besm, state);
11
+ $mod: map-get($besm, mod);
12
+
13
+ .#{$block}#{$name} {
14
+ padding-left: $handle-size + $icon-size * 0.25;
15
+ position: relative;
16
+
17
+ &.#{$state}icon {
18
+ padding-left: $handle-size + $icon-size + $icon-size * 0.25;
19
+ }
20
+
21
+ @for $i from 1 through 20 {
22
+ &.#{$state}level-#{$i} {
23
+ margin-left: #{($i * 20)}px;
24
+ }
25
+ }
26
+ }
27
+
28
+ .#{$element}#{$name}-handle {
29
+ position: absolute;
30
+
31
+ @include cx-add-state-rules($handle-state-style-map, default);
32
+
33
+ left: 0;
34
+ top: 50%;
35
+ margin-top: -$handle-size * 0.5;
36
+ bottom: 0;
37
+ width: $handle-size + $icon-size;
38
+ height: $handle-size;
39
+
40
+ &:hover {
41
+ @include cx-add-state-rules($handle-state-style-map, hover);
42
+ }
43
+
44
+ &:active {
45
+ @include cx-add-state-rules($handle-state-style-map, active);
46
+ }
47
+ }
48
+
49
+ .#{$element}#{$name}-arrow {
50
+ display: block;
51
+ position: absolute;
52
+ left: 0;
53
+ top: 50%;
54
+ margin-top: -$icon-size * 0.5;
55
+ margin-left: ($handle-size - $icon-size) * 0.5;
56
+ height: $icon-size;
57
+ width: $icon-size;
58
+ line-height: $icon-size;
59
+ transform: rotate(-90deg);
60
+ transition: transform 0.2s;
61
+
62
+ .#{$state}expanded & {
63
+ transform: rotate(0);
64
+ }
65
+ }
66
+
67
+ .#{$element}#{$name}-icon {
68
+ display: block;
69
+ position: absolute;
70
+ left: 0;
71
+ top: 50%;
72
+ margin-top: -$icon-size * 0.5;
73
+ margin-left: ($handle-size + $icon-size) * 0.5;
74
+ height: $icon-size;
75
+ width: $icon-size;
76
+ line-height: $icon-size;
77
+ }
78
+
79
+ .#{$block}grid.#{$mod}tree {
80
+ td {
81
+ border-top: none;
82
+ }
83
+ }
84
+ }
85
+
86
+ @if (cx-should-include("cx/widgets/TreeNode")) {
87
+ @include cx-treenode();
88
+ }
@@ -1,88 +1,88 @@
1
- // GRID
2
- $cx-default-grid-font-size: $cx-default-box-font-size !default;
3
- $cx-default-grid-border-color: $cx-default-border-color !default;
4
- $cx-default-grid-border-radius: null !default;
5
- $cx-default-grid-box-shadow: null !default;
6
-
7
- // header
8
- $cx-default-grid-header-font-size: $cx-default-box-font-size !default;
9
- $cx-default-grid-header-font-weight: normal !default;
10
- $cx-default-grid-header-line-height: null !default;
11
- $cx-default-grid-header-color: $cx-default-color !default;
12
- $cx-default-grid-header-background-color: #eee !default;
13
- $cx-default-grid-header-border-color: $cx-default-border-color !default;
14
- $cx-default-grid-header-box-shadow: null !default;
15
- $cx-default-grid-header-padding: null !default;
16
-
17
- $cx-grid-header-state-style-map: (
18
- default: (
19
- font-size: $cx-default-grid-header-font-size,
20
- font-weight: $cx-default-grid-header-font-weight,
21
- line-height: $cx-default-grid-header-line-height,
22
- color: $cx-default-grid-header-color,
23
- background-color: $cx-default-grid-header-background-color,
24
- border-color: $cx-default-grid-header-border-color,
25
- background-clip: border-box,
26
- padding: $cx-default-grid-header-padding,
27
- ),
28
- hover: (
29
- background-color: darken($cx-default-grid-header-background-color, 2),
30
- ),
31
- sorted: (
32
- background-color: darken($cx-default-grid-header-background-color, 7),
33
- ),
34
- sorted-hover: (
35
- background-color: darken($cx-default-grid-header-background-color, 5),
36
- ),
37
- ) !default;
38
-
39
- // data
40
- $cx-default-grid-data-font-size: null !default;
41
- $cx-default-grid-data-font-weight: null !default;
42
- $cx-default-grid-data-line-height: null !default;
43
- $cx-default-grid-data-background-color: transparent !default;
44
- $cx-default-grid-data-alternate-background-color: null !default;
45
- $cx-default-grid-data-border-color: $cx-default-grid-border-color !default;
46
- $cx-default-grid-data-padding: 5px !default;
47
-
48
- $cx-grid-data-state-style-map: cx-deep-map-merge(
49
- $cx-list-item,
50
- (
51
- default: (
52
- font-size: $cx-default-grid-data-font-size,
53
- line-height: $cx-default-grid-data-line-height,
54
- font-weight: $cx-default-grid-data-font-weight,
55
- background-color: $cx-default-grid-data-background-color,
56
- border-color: $cx-default-grid-data-border-color,
57
- padding: $cx-default-grid-data-padding,
58
- ),
59
- alternate: (
60
- background-color: $cx-default-grid-data-alternate-background-color,
61
- ),
62
- )
63
- ) !default;
64
-
65
- // pagination
66
- $cx-grid-pagination-default-border-width: $cx-default-border-width !default;
67
- $cx-grid-pagination-default-border-color: $cx-default-border-color !default;
68
- $cx-grid-pagination-default-border-radius: null !default;
69
- $cx-grid-pagination-default-outer-border-radius: $cx-default-border-radius !default;
70
- $cx-grid-pagination-default-padding: cx-top($cx-default-box-padding) 2 * cx-top($cx-default-box-padding) !default;
71
-
72
- $cx-grid-pagination-state-style-map: cx-deep-map-merge($cx-list-item, ()) !default;
73
-
74
- $cx-grid-cell-cursor-style: (
75
- left: -1px,
76
- top: -1px,
77
- right: -1px,
78
- bottom: -1px,
79
- background: rgba(green, 0.1),
80
- border: 2px solid rgba(green, 1),
81
- );
82
-
83
- $cx-dependencies: map-merge(
84
- $cx-dependencies,
85
- (
86
- "cx/widgets/Grid": "cx/widgets/DragClone",
87
- )
88
- );
1
+ // GRID
2
+ $cx-default-grid-font-size: $cx-default-box-font-size !default;
3
+ $cx-default-grid-border-color: $cx-default-border-color !default;
4
+ $cx-default-grid-border-radius: null !default;
5
+ $cx-default-grid-box-shadow: null !default;
6
+
7
+ // header
8
+ $cx-default-grid-header-font-size: $cx-default-box-font-size !default;
9
+ $cx-default-grid-header-font-weight: normal !default;
10
+ $cx-default-grid-header-line-height: null !default;
11
+ $cx-default-grid-header-color: $cx-default-color !default;
12
+ $cx-default-grid-header-background-color: #eee !default;
13
+ $cx-default-grid-header-border-color: $cx-default-border-color !default;
14
+ $cx-default-grid-header-box-shadow: null !default;
15
+ $cx-default-grid-header-padding: null !default;
16
+
17
+ $cx-grid-header-state-style-map: (
18
+ default: (
19
+ font-size: $cx-default-grid-header-font-size,
20
+ font-weight: $cx-default-grid-header-font-weight,
21
+ line-height: $cx-default-grid-header-line-height,
22
+ color: $cx-default-grid-header-color,
23
+ background-color: $cx-default-grid-header-background-color,
24
+ border-color: $cx-default-grid-header-border-color,
25
+ background-clip: border-box,
26
+ padding: $cx-default-grid-header-padding,
27
+ ),
28
+ hover: (
29
+ background-color: darken($cx-default-grid-header-background-color, 2),
30
+ ),
31
+ sorted: (
32
+ background-color: darken($cx-default-grid-header-background-color, 7),
33
+ ),
34
+ sorted-hover: (
35
+ background-color: darken($cx-default-grid-header-background-color, 5),
36
+ ),
37
+ ) !default;
38
+
39
+ // data
40
+ $cx-default-grid-data-font-size: null !default;
41
+ $cx-default-grid-data-font-weight: null !default;
42
+ $cx-default-grid-data-line-height: null !default;
43
+ $cx-default-grid-data-background-color: transparent !default;
44
+ $cx-default-grid-data-alternate-background-color: null !default;
45
+ $cx-default-grid-data-border-color: $cx-default-grid-border-color !default;
46
+ $cx-default-grid-data-padding: 5px !default;
47
+
48
+ $cx-grid-data-state-style-map: cx-deep-map-merge(
49
+ $cx-list-item,
50
+ (
51
+ default: (
52
+ font-size: $cx-default-grid-data-font-size,
53
+ line-height: $cx-default-grid-data-line-height,
54
+ font-weight: $cx-default-grid-data-font-weight,
55
+ background-color: $cx-default-grid-data-background-color,
56
+ border-color: $cx-default-grid-data-border-color,
57
+ padding: $cx-default-grid-data-padding,
58
+ ),
59
+ alternate: (
60
+ background-color: $cx-default-grid-data-alternate-background-color,
61
+ ),
62
+ )
63
+ ) !default;
64
+
65
+ // pagination
66
+ $cx-grid-pagination-default-border-width: $cx-default-border-width !default;
67
+ $cx-grid-pagination-default-border-color: $cx-default-border-color !default;
68
+ $cx-grid-pagination-default-border-radius: null !default;
69
+ $cx-grid-pagination-default-outer-border-radius: $cx-default-border-radius !default;
70
+ $cx-grid-pagination-default-padding: cx-top($cx-default-box-padding) 2 * cx-top($cx-default-box-padding) !default;
71
+
72
+ $cx-grid-pagination-state-style-map: cx-deep-map-merge($cx-list-item, ()) !default;
73
+
74
+ $cx-grid-cell-cursor-style: (
75
+ left: -1px,
76
+ top: -1px,
77
+ right: -1px,
78
+ bottom: -1px,
79
+ background: rgba(green, 0.1),
80
+ border: 2px solid rgba(green, 1),
81
+ );
82
+
83
+ $cx-dependencies: map-merge(
84
+ $cx-dependencies,
85
+ (
86
+ "cx/widgets/Grid": "cx/widgets/DragClone",
87
+ )
88
+ );