cx 26.2.2 → 26.2.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.
- package/build/charts/Chart.d.ts.map +1 -1
- package/build/charts/Chart.js +5 -4
- package/build/charts/ColumnBarBase.d.ts +3 -3
- package/build/charts/ColumnBarBase.d.ts.map +1 -1
- package/build/charts/ColumnBarBase.js +1 -1
- package/build/charts/Legend.d.ts.map +1 -1
- package/build/charts/Legend.js +11 -4
- package/build/charts/Marker.d.ts +3 -3
- package/build/charts/Marker.d.ts.map +1 -1
- package/build/charts/MarkerLine.d.ts +7 -7
- package/build/charts/MarkerLine.d.ts.map +1 -1
- package/build/charts/MarkerLine.js +14 -10
- package/build/charts/PieChart.d.ts +4 -4
- package/build/charts/PieChart.d.ts.map +1 -1
- package/build/charts/PieChart.js +36 -14
- package/build/charts/PieLabel.d.ts.map +1 -1
- package/build/charts/PieLabel.js +2 -1
- package/build/charts/RangeMarker.d.ts +3 -3
- package/build/charts/RangeMarker.d.ts.map +1 -1
- package/build/charts/RangeMarker.js +1 -1
- package/build/charts/axis/TimeAxis.d.ts +3 -3
- package/build/charts/axis/TimeAxis.d.ts.map +1 -1
- package/build/charts/axis/TimeAxis.js +70 -21
- package/build/charts/helpers/ValueAtFinder.d.ts +1 -1
- package/build/charts/helpers/ValueAtFinder.d.ts.map +1 -1
- package/build/charts/helpers/ValueAtFinder.js +5 -2
- package/build/data/StructuredSelector.js +3 -4
- package/build/data/createAccessorModelProxy.d.ts +6 -11
- package/build/data/createAccessorModelProxy.d.ts.map +1 -1
- package/build/data/createAccessorModelProxy.js +1 -3
- package/build/svg/Ellipse.d.ts +5 -4
- package/build/svg/Ellipse.d.ts.map +1 -1
- package/build/svg/Ellipse.js +9 -6
- package/build/svg/Line.d.ts +1 -0
- package/build/svg/Line.d.ts.map +1 -1
- package/build/svg/Line.js +4 -1
- package/build/svg/Text.d.ts +12 -6
- package/build/svg/Text.d.ts.map +1 -1
- package/build/svg/Text.js +12 -4
- package/build/ui/Controller.d.ts +2 -0
- package/build/ui/Controller.d.ts.map +1 -1
- package/build/ui/Controller.js +3 -0
- package/build/ui/HoverSync.d.ts.map +1 -1
- package/build/ui/HoverSync.js +7 -2
- package/build/ui/Prop.d.ts +1 -1
- package/build/ui/Prop.d.ts.map +1 -1
- package/build/ui/Text.d.ts +3 -3
- package/build/ui/Text.d.ts.map +1 -1
- package/build/ui/Text.js +5 -5
- package/build/ui/adapter/GroupAdapter.d.ts.map +1 -1
- package/build/ui/adapter/GroupAdapter.js +20 -10
- package/build/ui/app/History.js +1 -1
- package/build/widgets/List.d.ts.map +1 -1
- package/build/widgets/List.js +6 -7
- package/build/widgets/drag-drop/DropZone.d.ts +3 -3
- package/build/widgets/drag-drop/DropZone.d.ts.map +1 -1
- package/build/widgets/form/Calendar.d.ts.map +1 -1
- package/build/widgets/form/Calendar.js +30 -11
- package/build/widgets/form/ColorField.d.ts.map +1 -1
- package/build/widgets/form/ColorField.js +16 -7
- package/build/widgets/form/DateTimeField.d.ts.map +1 -1
- package/build/widgets/form/DateTimeField.js +23 -10
- package/build/widgets/form/Field.d.ts +2 -0
- package/build/widgets/form/Field.d.ts.map +1 -1
- package/build/widgets/form/Field.js +11 -5
- package/build/widgets/form/LookupField.d.ts +1 -1
- package/build/widgets/form/LookupField.d.ts.map +1 -1
- package/build/widgets/form/LookupField.js +6 -6
- package/build/widgets/form/MonthField.d.ts.map +1 -1
- package/build/widgets/form/MonthField.js +15 -7
- package/build/widgets/form/MonthPicker.d.ts +1 -2
- package/build/widgets/form/MonthPicker.d.ts.map +1 -1
- package/build/widgets/form/MonthPicker.js +84 -41
- package/build/widgets/form/NumberField.d.ts +2 -0
- package/build/widgets/form/NumberField.d.ts.map +1 -1
- package/build/widgets/form/NumberField.js +45 -15
- package/build/widgets/form/TextField.d.ts +1 -9
- package/build/widgets/form/TextField.d.ts.map +1 -1
- package/build/widgets/form/TextField.js +1 -1
- package/build/widgets/grid/Grid.d.ts +2 -2
- package/build/widgets/grid/Grid.d.ts.map +1 -1
- package/build/widgets/grid/Grid.js +14 -11
- package/build/widgets/grid/Pagination.d.ts.map +1 -1
- package/build/widgets/grid/Pagination.js +4 -4
- package/build/widgets/grid/TreeNode.d.ts.map +1 -1
- package/build/widgets/grid/TreeNode.js +10 -2
- package/build/widgets/icons/folder.d.ts.map +1 -1
- package/build/widgets/icons/folder.js +1 -0
- package/build/widgets/icons/forward.d.ts.map +1 -1
- package/build/widgets/icons/forward.js +4 -3
- package/build/widgets/icons/loading.d.ts.map +1 -1
- package/build/widgets/icons/loading.js +6 -5
- package/build/widgets/icons/square.d.ts.map +1 -1
- package/build/widgets/icons/square.js +3 -3
- package/build/widgets/index.d.ts +3 -1
- package/build/widgets/index.d.ts.map +1 -1
- package/build/widgets/index.js +3 -1
- package/build/widgets/overlay/ContextMenu.d.ts.map +1 -1
- package/build/widgets/overlay/ContextMenu.js +2 -0
- package/build/widgets/overlay/Dropdown.d.ts +2 -1
- package/build/widgets/overlay/Dropdown.d.ts.map +1 -1
- package/build/widgets/overlay/Dropdown.js +75 -20
- package/build/widgets/overlay/MsgBox.d.ts +1 -0
- package/build/widgets/overlay/MsgBox.d.ts.map +1 -1
- package/build/widgets/overlay/MsgBox.js +2 -2
- package/build/widgets/overlay/Overlay.d.ts +32 -2
- package/build/widgets/overlay/Overlay.d.ts.map +1 -1
- package/build/widgets/overlay/Overlay.js +47 -16
- package/build/widgets/overlay/Toast.d.ts +1 -1
- package/build/widgets/overlay/Toast.d.ts.map +1 -1
- package/build/widgets/overlay/Toast.js +4 -1
- package/build/widgets/overlay/Tooltip.d.ts +6 -0
- package/build/widgets/overlay/Tooltip.d.ts.map +1 -1
- package/build/widgets/overlay/Tooltip.js +24 -9
- package/build/widgets/overlay/Window.d.ts.map +1 -1
- package/build/widgets/overlay/Window.js +24 -9
- package/dist/charts.css +325 -272
- package/dist/charts.js +11 -5
- package/dist/data.js +2 -2
- package/dist/manifest.js +821 -809
- package/dist/svg.css +14 -8
- package/dist/svg.js +9 -1
- package/dist/ui.js +29 -16
- package/dist/widgets.css +997 -294
- package/dist/widgets.js +319 -126
- package/package.json +1 -1
- package/src/charts/Bar.scss +13 -10
- package/src/charts/BarGraph.scss +31 -29
- package/src/charts/BubbleGraph.scss +11 -8
- package/src/charts/Chart.ts +5 -3
- package/src/charts/Column.scss +13 -10
- package/src/charts/ColumnBarBase.tsx +255 -230
- package/src/charts/ColumnGraph.scss +13 -11
- package/src/charts/Gridlines.scss +10 -8
- package/src/charts/Legend.scss +57 -50
- package/src/charts/Legend.tsx +257 -213
- package/src/charts/LegendEntry.scss +35 -29
- package/src/charts/LineGraph.scss +28 -25
- package/src/charts/Marker.scss +12 -10
- package/src/charts/Marker.tsx +3 -2
- package/src/charts/MarkerLine.scss +11 -8
- package/src/charts/MarkerLine.tsx +196 -177
- package/src/charts/PieChart.scss +12 -9
- package/src/charts/PieChart.tsx +717 -591
- package/src/charts/PieLabel.tsx +99 -81
- package/src/charts/Range.scss +11 -8
- package/src/charts/RangeMarker.tsx +204 -187
- package/src/charts/ScatterGraph.scss +12 -9
- package/src/charts/axis/Axis.scss +6 -5
- package/src/charts/axis/CategoryAxis.scss +10 -8
- package/src/charts/axis/NumericAxis.scss +9 -6
- package/src/charts/axis/TimeAxis.scss +9 -6
- package/src/charts/axis/TimeAxis.tsx +753 -637
- package/src/charts/axis/index.scss +4 -5
- package/src/charts/axis/variables.scss +4 -2
- package/src/charts/helpers/ValueAtFinder.ts +19 -5
- package/src/charts/index.scss +16 -19
- package/src/charts/maps.scss +0 -0
- package/src/charts/palette.scss +11 -31
- package/src/charts/palette.variables.scss +23 -0
- package/src/charts/variables.scss +35 -3
- package/src/data/StructuredSelector.ts +2 -2
- package/src/data/createAccessorModelProxy.ts +66 -74
- package/src/index.scss +5 -6
- package/src/maps.scss +5 -0
- package/src/svg/Ellipse.tsx +62 -55
- package/src/svg/Line.tsx +57 -42
- package/src/svg/Svg.scss +6 -6
- package/src/svg/Text.scss +19 -0
- package/src/svg/Text.tsx +172 -116
- package/src/svg/index.scss +3 -2
- package/src/svg/maps.scss +0 -0
- package/src/svg/variables.scss +0 -0
- package/src/ui/Container.spec.ts +59 -0
- package/src/ui/Controller.spec.tsx +30 -0
- package/src/ui/Controller.ts +5 -0
- package/src/ui/HoverSync.tsx +179 -147
- package/src/ui/Prop.ts +1 -1
- package/src/ui/Text.ts +12 -9
- package/src/ui/adapter/GroupAdapter.spec.ts +42 -0
- package/src/ui/adapter/GroupAdapter.ts +25 -14
- package/src/ui/app/History.ts +1 -1
- package/src/ui/index.scss +1 -1
- package/src/ui/layout/LabelsLeftLayout.scss +5 -7
- package/src/ui/layout/LabelsTopLayout.scss +4 -6
- package/src/ui/layout/index.scss +2 -3
- package/src/ui/maps.scss +0 -0
- package/src/ui/variables.scss +1 -2
- package/src/util/index.scss +4 -2
- package/src/util/maps.scss +1 -0
- package/src/util/scss/besm.scss +15 -0
- package/src/util/scss/calc.scss +103 -11
- package/src/util/scss/defaults.scss +24 -0
- package/src/util/scss/elements.scss +78 -0
- package/src/util/scss/global.scss +15 -0
- package/src/util/scss/include.scss +17 -9
- package/src/util/scss/index.scss +1 -9
- package/src/util/scss/maps.scss +2 -0
- package/src/util/scss/pad-size.scss +9 -0
- package/src/util/scss/padding.scss +6 -0
- package/src/util/scss/screen-size.scss +5 -0
- package/src/util/scss/variables.scss +6 -0
- package/src/util/variables.scss +1 -0
- package/src/variables.scss +5 -217
- package/src/widgets/Button.maps.scss +103 -0
- package/src/widgets/Button.scss +33 -9
- package/src/widgets/Button.variables.scss +8 -104
- package/src/widgets/CxCredit.scss +2 -0
- package/src/widgets/FlexBox.scss +16 -11
- package/src/widgets/Heading.scss +6 -0
- package/src/widgets/HighlightedSearchText.scss +8 -1
- package/src/widgets/Icon.scss +6 -0
- package/src/widgets/List.scss +7 -0
- package/src/widgets/List.tsx +6 -7
- package/src/widgets/ProgressBar.scss +9 -0
- package/src/widgets/Resizer.scss +9 -7
- package/src/widgets/Section.scss +53 -56
- package/src/widgets/animations.scss +4 -2
- package/src/widgets/box.scss +47 -0
- package/src/widgets/drag-drop/DragClone.scss +12 -4
- package/src/widgets/drag-drop/DragHandle.scss +12 -6
- package/src/widgets/drag-drop/DragSource.scss +12 -6
- package/src/widgets/drag-drop/DropZone.scss +9 -0
- package/src/widgets/drag-drop/DropZone.tsx +3 -3
- package/src/widgets/drag-drop/index.scss +4 -4
- package/src/widgets/drag-drop/maps.scss +7 -0
- package/src/widgets/drag-drop/variables.scss +8 -5
- package/src/widgets/form/Calendar.maps.scss +54 -0
- package/src/widgets/form/Calendar.scss +49 -11
- package/src/widgets/form/Calendar.tsx +755 -653
- package/src/widgets/form/Calendar.variables.scss +3 -46
- package/src/widgets/form/Checkbox.maps.scss +34 -0
- package/src/widgets/form/Checkbox.scss +14 -3
- package/src/widgets/form/Checkbox.variables.scss +4 -36
- package/src/widgets/form/ColorField.scss +21 -2
- package/src/widgets/form/ColorField.tsx +485 -431
- package/src/widgets/form/ColorPicker.maps.scss +21 -0
- package/src/widgets/form/ColorPicker.scss +26 -9
- package/src/widgets/form/ColorPicker.variables.scss +3 -16
- package/src/widgets/form/DateTimeField.scss +54 -21
- package/src/widgets/form/DateTimeField.tsx +697 -615
- package/src/widgets/form/DateTimePicker.scss +14 -4
- package/src/widgets/form/Field.maps.scss +122 -0
- package/src/widgets/form/Field.scss +54 -18
- package/src/widgets/form/Field.tsx +611 -504
- package/src/widgets/form/Field.variables.scss +46 -0
- package/src/widgets/form/HelpText.scss +8 -5
- package/src/widgets/form/Label.scss +10 -3
- package/src/widgets/form/LookupField.maps.scss +26 -0
- package/src/widgets/form/LookupField.scss +54 -24
- package/src/widgets/form/LookupField.tsx +25 -21
- package/src/widgets/form/MonthField.scss +48 -26
- package/src/widgets/form/MonthField.tsx +645 -567
- package/src/widgets/form/MonthPicker.maps.scss +50 -0
- package/src/widgets/form/MonthPicker.scss +44 -35
- package/src/widgets/form/MonthPicker.tsx +954 -724
- package/src/widgets/form/MonthPicker.variables.scss +24 -0
- package/src/widgets/form/NumberField.scss +19 -2
- package/src/widgets/form/NumberField.tsx +576 -466
- package/src/widgets/form/Radio.maps.scss +36 -0
- package/src/widgets/form/Radio.scss +12 -2
- package/src/widgets/form/Radio.variables.scss +3 -42
- package/src/widgets/form/Select.scss +25 -9
- package/src/widgets/form/Slider.scss +23 -14
- package/src/widgets/form/Switch.scss +18 -8
- package/src/widgets/form/TextArea.scss +14 -1
- package/src/widgets/form/TextField.scss +24 -3
- package/src/widgets/form/TextField.tsx +9 -21
- package/src/widgets/form/UploadButton.scss +14 -6
- package/src/widgets/form/ValidationError.scss +10 -6
- package/src/widgets/form/Wheel.scss +14 -4
- package/src/widgets/form/index.scss +22 -24
- package/src/widgets/form/maps.scss +81 -0
- package/src/widgets/form/variables.scss +111 -355
- package/src/widgets/grid/Grid.scss +19 -2
- package/src/widgets/grid/Grid.spec.ts +42 -0
- package/src/widgets/grid/Grid.tsx +18 -13
- package/src/widgets/grid/Pagination.scss +11 -2
- package/src/widgets/grid/Pagination.tsx +110 -102
- package/src/widgets/grid/TreeNode.scss +25 -8
- package/src/widgets/grid/TreeNode.tsx +127 -116
- package/src/widgets/grid/index.scss +3 -4
- package/src/widgets/grid/maps.scss +110 -0
- package/src/widgets/grid/variables.scss +48 -137
- package/src/widgets/icons/folder.tsx +1 -2
- package/src/widgets/icons/forward.tsx +23 -20
- package/src/widgets/icons/loading.tsx +22 -19
- package/src/widgets/icons/square.tsx +20 -17
- package/src/widgets/index.scss +16 -16
- package/src/widgets/index.ts +63 -58
- package/src/widgets/lists.scss +42 -0
- package/src/widgets/maps.scss +139 -0
- package/src/widgets/nav/Link.scss +14 -1
- package/src/widgets/nav/Menu.scss +13 -7
- package/src/widgets/nav/Menu.variables.scss +1 -12
- package/src/widgets/nav/MenuItem.scss +21 -6
- package/src/widgets/nav/Scroller.scss +11 -2
- package/src/widgets/nav/Tab.maps.scss +78 -0
- package/src/widgets/nav/Tab.scss +12 -6
- package/src/widgets/nav/Tab.variables.scss +7 -76
- package/src/widgets/nav/cover.scss +6 -4
- package/src/widgets/nav/index.scss +6 -6
- package/src/widgets/nav/maps.scss +32 -0
- package/src/widgets/nav/variables.scss +4 -11
- package/src/widgets/overlay/ContextMenu.ts +3 -0
- package/src/widgets/overlay/Dropdown.scss +47 -16
- package/src/widgets/overlay/Dropdown.tsx +851 -676
- package/src/widgets/overlay/MsgBox.tsx +125 -111
- package/src/widgets/overlay/Overlay.scss +60 -40
- package/src/widgets/overlay/Overlay.tsx +948 -800
- package/src/widgets/overlay/Toast.scss +42 -34
- package/src/widgets/overlay/Toast.ts +11 -1
- package/src/widgets/overlay/Tooltip.scss +27 -96
- package/src/widgets/overlay/Tooltip.tsx +376 -309
- package/src/widgets/overlay/Window.maps.scss +51 -0
- package/src/widgets/overlay/Window.scss +17 -17
- package/src/widgets/overlay/Window.tsx +291 -236
- package/src/widgets/overlay/Window.variables.scss +2 -43
- package/src/widgets/overlay/index.d.ts +11 -11
- package/src/widgets/overlay/index.scss +6 -15
- package/src/widgets/overlay/maps.scss +44 -0
- package/src/widgets/overlay/variables.scss +11 -42
- package/src/widgets/variables.scss +33 -117
- package/src/global.scss +0 -14
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
/** @jsxImportSource react */
|
|
2
2
|
import { Widget, VDOM, getContent } from "../../ui/Widget";
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
Overlay,
|
|
5
|
+
OverlayBase,
|
|
6
|
+
OverlayBeacon,
|
|
7
|
+
OverlayComponent,
|
|
8
|
+
OverlayComponentProps,
|
|
9
|
+
OverlayComponentState,
|
|
10
|
+
OverlayConfig,
|
|
11
|
+
OverlayInstance,
|
|
11
12
|
} from "./Overlay";
|
|
12
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
ContentPlaceholder,
|
|
15
|
+
ContentPlaceholderInstance,
|
|
16
|
+
} from "../../ui/layout/ContentPlaceholder";
|
|
13
17
|
import { ZIndexManager } from "../../ui/ZIndexManager";
|
|
14
18
|
import { Button } from "../Button";
|
|
15
19
|
import { parseStyle } from "../../util/parseStyle";
|
|
@@ -22,160 +26,203 @@ import { BooleanProp, StringProp, StyleProp, ClassProp } from "../../ui/Prop";
|
|
|
22
26
|
import { RenderingContext } from "../../ui/RenderingContext";
|
|
23
27
|
|
|
24
28
|
export interface WindowConfig extends OverlayConfig {
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
/** Text to be displayed in the header. */
|
|
30
|
+
title?: StringProp;
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
/** Controls the close button visibility. Defaults to `true`. */
|
|
33
|
+
closable?: BooleanProp;
|
|
30
34
|
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
/** A custom style which will be applied to the body. */
|
|
36
|
+
bodyStyle?: StyleProp;
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
/** A custom style which will be applied to the header. */
|
|
39
|
+
headerStyle?: StyleProp;
|
|
36
40
|
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
/** A custom style which will be applied to the footer. */
|
|
42
|
+
footerStyle?: StyleProp;
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
/** Base CSS class to be applied to the field. Defaults to `window`. */
|
|
45
|
+
baseClass?: string;
|
|
42
46
|
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
/** Additional CSS class to be applied to the section body. */
|
|
48
|
+
bodyClass?: ClassProp;
|
|
45
49
|
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
/** Set to `true` to enable resizing. */
|
|
51
|
+
resizable?: boolean;
|
|
48
52
|
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
/** Set to `true` to automatically focus the field, after it renders for the first time. */
|
|
54
|
+
autoFocus?: boolean;
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
/** Set to `false` to prevent the window itself to be focusable. Default value is true.*/
|
|
57
|
+
focusable?: boolean;
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
/** Set to `true` to disable moving the window by dragging the header. */
|
|
60
|
+
fixed?: boolean;
|
|
57
61
|
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
/** Set to `true` to add default padding to the window body. */
|
|
63
|
+
pad?: boolean;
|
|
60
64
|
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
/** Optional header widget. */
|
|
66
|
+
header?: any;
|
|
63
67
|
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
/** Optional footer widget. */
|
|
69
|
+
footer?: any;
|
|
66
70
|
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
/** Custom event handler for closeable. */
|
|
72
|
+
closeable?: BooleanProp;
|
|
69
73
|
}
|
|
70
74
|
|
|
71
75
|
export class WindowInstance extends OverlayInstance<Window> {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
headerEl?: HTMLElement;
|
|
77
|
+
footerEl?: HTMLElement;
|
|
78
|
+
bodyEl?: HTMLElement;
|
|
79
|
+
containerEl?: HTMLElement;
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
export class Window extends OverlayBase<WindowConfig, WindowInstance> {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
83
|
+
declare closable?: BooleanProp;
|
|
84
|
+
declare closeable?: BooleanProp;
|
|
85
|
+
declare resizable?: boolean;
|
|
86
|
+
declare fixed?: boolean;
|
|
87
|
+
declare autoFocus?: boolean;
|
|
88
|
+
declare focusable?: boolean;
|
|
89
|
+
declare pad?: boolean;
|
|
90
|
+
declare bodyStyle?: StyleProp;
|
|
91
|
+
declare headerStyle?: StyleProp;
|
|
92
|
+
declare footerStyle?: StyleProp;
|
|
93
|
+
declare bodyClass?: ClassProp;
|
|
94
|
+
declare title?: StringProp;
|
|
95
|
+
declare header?: any;
|
|
96
|
+
declare footer?: any;
|
|
97
|
+
declare baseClass: string;
|
|
98
|
+
|
|
99
|
+
init() {
|
|
100
|
+
if (isDefined(this.closeable)) this.closable = this.closeable;
|
|
101
|
+
|
|
102
|
+
if (isString(this.headerStyle))
|
|
103
|
+
this.headerStyle = parseStyle(this.headerStyle);
|
|
104
|
+
|
|
105
|
+
if (isString(this.footerStyle))
|
|
106
|
+
this.footerStyle = parseStyle(this.footerStyle);
|
|
107
|
+
|
|
108
|
+
if (isString(this.bodyStyle)) this.bodyStyle = parseStyle(this.bodyStyle);
|
|
109
|
+
|
|
110
|
+
super.init();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
declareData(...args: any) {
|
|
114
|
+
return super.declareData(...args, {
|
|
115
|
+
title: undefined,
|
|
116
|
+
closable: undefined,
|
|
117
|
+
bodyStyle: { structured: true },
|
|
118
|
+
bodyClass: { structured: true },
|
|
119
|
+
headerStyle: { structured: true },
|
|
120
|
+
footerStyle: { structured: true },
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
initHelpers(...args: any) {
|
|
125
|
+
return super.initHelpers(...args, {
|
|
126
|
+
header: Widget.create(
|
|
127
|
+
this.header || {
|
|
128
|
+
type: ContentPlaceholder,
|
|
129
|
+
name: "header",
|
|
130
|
+
scoped: true,
|
|
131
|
+
},
|
|
132
|
+
),
|
|
133
|
+
footer: Widget.create(
|
|
134
|
+
this.footer || {
|
|
135
|
+
type: ContentPlaceholder,
|
|
136
|
+
name: "footer",
|
|
137
|
+
scoped: true,
|
|
138
|
+
},
|
|
139
|
+
),
|
|
140
|
+
close:
|
|
141
|
+
this.closable &&
|
|
142
|
+
Button.create({
|
|
143
|
+
mod: "hollow",
|
|
144
|
+
dismiss: true,
|
|
145
|
+
icon: "close",
|
|
146
|
+
style: "margin-left: auto",
|
|
147
|
+
onTouchStart: stopPropagation,
|
|
148
|
+
onMouseDown: stopPropagation,
|
|
149
|
+
}),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
exploreCleanup(context: RenderingContext, instance: WindowInstance): void {
|
|
154
|
+
super.exploreCleanup(context, instance);
|
|
155
|
+
|
|
156
|
+
let { helpers } = instance;
|
|
157
|
+
let unregisterHeader =
|
|
158
|
+
helpers!.header &&
|
|
159
|
+
(helpers!.header as ContentPlaceholderInstance)
|
|
160
|
+
.unregisterContentPlaceholder;
|
|
161
|
+
if (unregisterHeader) unregisterHeader();
|
|
162
|
+
|
|
163
|
+
let unregisterFooter =
|
|
164
|
+
helpers!.footer &&
|
|
165
|
+
(helpers!.footer as ContentPlaceholderInstance)
|
|
166
|
+
.unregisterContentPlaceholder;
|
|
167
|
+
if (unregisterFooter) unregisterFooter();
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
renderHeader(
|
|
171
|
+
context: RenderingContext,
|
|
172
|
+
instance: WindowInstance,
|
|
173
|
+
key: string,
|
|
174
|
+
): any[] {
|
|
175
|
+
let { data } = instance;
|
|
176
|
+
let result = [];
|
|
177
|
+
if (data.title) result.push(data.title);
|
|
178
|
+
if (instance.helpers) {
|
|
179
|
+
let header = getContent(
|
|
180
|
+
instance.helpers.header && instance.helpers.header.render(context),
|
|
181
|
+
);
|
|
182
|
+
if (header) result.push(header);
|
|
183
|
+
if (data.closable && instance.helpers.close)
|
|
184
|
+
result.push(getContent(instance.helpers.close.render(context)));
|
|
185
|
+
}
|
|
186
|
+
return result;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
renderFooter(
|
|
190
|
+
context: RenderingContext,
|
|
191
|
+
instance: WindowInstance,
|
|
192
|
+
key: string,
|
|
193
|
+
): any {
|
|
194
|
+
return getContent(
|
|
195
|
+
instance.helpers &&
|
|
196
|
+
instance.helpers.footer &&
|
|
197
|
+
instance.helpers.footer.render(context),
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
render(
|
|
202
|
+
context: RenderingContext,
|
|
203
|
+
instance: WindowInstance,
|
|
204
|
+
key: string,
|
|
205
|
+
): any {
|
|
206
|
+
var header = this.renderHeader(context, instance, "header");
|
|
207
|
+
var footer = this.renderFooter(context, instance, "footer");
|
|
208
|
+
return (
|
|
209
|
+
<OverlayBeacon
|
|
210
|
+
childrenFactory={(beaconEl) => (
|
|
211
|
+
<WindowComponent
|
|
212
|
+
beaconEl={beaconEl}
|
|
169
213
|
key={key}
|
|
170
214
|
instance={instance}
|
|
171
215
|
header={header}
|
|
172
216
|
footer={footer}
|
|
173
217
|
subscribeToBeforeDismiss={context.options.subscribeToBeforeDismiss}
|
|
174
|
-
|
|
218
|
+
parentEl={context.options.parentEl}
|
|
219
|
+
>
|
|
175
220
|
{this.renderContents(context, instance)}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
221
|
+
</WindowComponent>
|
|
222
|
+
)}
|
|
223
|
+
/>
|
|
224
|
+
);
|
|
225
|
+
}
|
|
179
226
|
}
|
|
180
227
|
|
|
181
228
|
Window.prototype.baseClass = "window";
|
|
@@ -185,115 +232,123 @@ Window.prototype.fixed = false;
|
|
|
185
232
|
Window.prototype.autoFocus = true;
|
|
186
233
|
Window.prototype.focusable = true;
|
|
187
234
|
Window.prototype.pad = true;
|
|
235
|
+
Window.prototype.needsBeacon = true;
|
|
188
236
|
|
|
189
237
|
Widget.alias("window", Window);
|
|
190
238
|
Localization.registerPrototype("cx/widgets/Window", Window);
|
|
191
239
|
|
|
192
240
|
interface WindowComponentProps extends OverlayComponentProps {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
241
|
+
header: any[];
|
|
242
|
+
footer: any;
|
|
243
|
+
instance: WindowInstance;
|
|
196
244
|
}
|
|
197
245
|
|
|
198
246
|
interface WindowComponentState extends OverlayComponentState {
|
|
199
|
-
|
|
247
|
+
active?: boolean;
|
|
200
248
|
}
|
|
201
249
|
|
|
202
|
-
class WindowComponent extends OverlayComponent<
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
if (this.props.footer) {
|
|
235
|
-
footer = (
|
|
236
|
-
<footer
|
|
237
|
-
key="footer"
|
|
238
|
-
ref={(c) => {
|
|
239
|
-
this.footerEl = c;
|
|
240
|
-
}}
|
|
241
|
-
className={CSS.element(baseClass, "footer")}
|
|
242
|
-
style={data.footerStyle}
|
|
243
|
-
>
|
|
244
|
-
{this.props.footer}
|
|
245
|
-
</footer>
|
|
246
|
-
);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
var body = (
|
|
250
|
-
<div
|
|
251
|
-
key="body"
|
|
252
|
-
ref={(c) => {
|
|
253
|
-
this.bodyEl = c;
|
|
254
|
-
}}
|
|
255
|
-
className={CSS.expand(CSS.element(baseClass, "body", { pad }), data.bodyClass)}
|
|
256
|
-
style={data.bodyStyle}
|
|
257
|
-
>
|
|
258
|
-
{this.props.children}
|
|
259
|
-
</div>
|
|
250
|
+
class WindowComponent extends OverlayComponent<
|
|
251
|
+
WindowComponentProps,
|
|
252
|
+
WindowComponentState
|
|
253
|
+
> {
|
|
254
|
+
headerEl?: HTMLElement | null;
|
|
255
|
+
footerEl?: HTMLElement | null;
|
|
256
|
+
bodyEl?: HTMLElement | null;
|
|
257
|
+
|
|
258
|
+
renderOverlayBody() {
|
|
259
|
+
var { widget, data } = this.props.instance;
|
|
260
|
+
var { CSS, baseClass, pad } = widget;
|
|
261
|
+
|
|
262
|
+
let header, footer;
|
|
263
|
+
|
|
264
|
+
if (this.props.header.length > 0) {
|
|
265
|
+
header = (
|
|
266
|
+
<header
|
|
267
|
+
key="header"
|
|
268
|
+
ref={(c) => {
|
|
269
|
+
this.headerEl = c;
|
|
270
|
+
}}
|
|
271
|
+
className={CSS.element(baseClass, "header")}
|
|
272
|
+
style={data.headerStyle}
|
|
273
|
+
onMouseDown={this.onHeaderMouseDown.bind(this)}
|
|
274
|
+
onMouseUp={ddMouseUp}
|
|
275
|
+
onMouseMove={this.onHeaderMouseMove.bind(this)}
|
|
276
|
+
onTouchStart={this.onHeaderMouseDown.bind(this)}
|
|
277
|
+
onTouchEnd={ddMouseUp}
|
|
278
|
+
onTouchMove={this.onHeaderMouseMove.bind(this)}
|
|
279
|
+
>
|
|
280
|
+
{this.props.header}
|
|
281
|
+
</header>
|
|
260
282
|
);
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (this.props.footer) {
|
|
286
|
+
footer = (
|
|
287
|
+
<footer
|
|
288
|
+
key="footer"
|
|
289
|
+
ref={(c) => {
|
|
290
|
+
this.footerEl = c;
|
|
291
|
+
}}
|
|
292
|
+
className={CSS.element(baseClass, "footer")}
|
|
293
|
+
style={data.footerStyle}
|
|
294
|
+
>
|
|
295
|
+
{this.props.footer}
|
|
296
|
+
</footer>
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
var body = (
|
|
301
|
+
<div
|
|
302
|
+
key="body"
|
|
303
|
+
ref={(c) => {
|
|
304
|
+
this.bodyEl = c;
|
|
305
|
+
}}
|
|
306
|
+
className={CSS.expand(
|
|
307
|
+
CSS.element(baseClass, "body", { pad }),
|
|
308
|
+
data.bodyClass,
|
|
309
|
+
)}
|
|
310
|
+
style={data.bodyStyle}
|
|
311
|
+
>
|
|
312
|
+
{this.props.children}
|
|
313
|
+
</div>
|
|
314
|
+
);
|
|
315
|
+
|
|
316
|
+
return [header, body, footer];
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
getOverlayCssClass() {
|
|
320
|
+
var cls = super.getOverlayCssClass();
|
|
321
|
+
if (this.state.active) cls += " cxs-active";
|
|
322
|
+
return cls;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
onFocusIn() {
|
|
326
|
+
super.onFocusIn();
|
|
327
|
+
if (!this.state.active) {
|
|
328
|
+
if (this.containerEl?.contains(document.activeElement))
|
|
329
|
+
this.setZIndex(ZIndexManager.next());
|
|
330
|
+
this.setState({ active: true });
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
onFocusOut() {
|
|
335
|
+
super.onFocusOut();
|
|
336
|
+
if (this.state.active) {
|
|
337
|
+
this.setState({
|
|
338
|
+
active: false,
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
onHeaderMouseDown(e: any) {
|
|
344
|
+
e.stopPropagation();
|
|
345
|
+
ddMouseDown(e);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
onHeaderMouseMove(e: any) {
|
|
349
|
+
e.stopPropagation();
|
|
350
|
+
if (!(this.props.instance.widget as Window).fixed && ddDetect(e)) {
|
|
351
|
+
this.startMoveOperation(e);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
299
354
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "../../util/scss/defaults.scss" as *;
|
|
2
|
+
|
|
1
3
|
$cx-default-window-background-color: transparent !default;
|
|
2
4
|
$cx-default-window-box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.29) !default;
|
|
3
5
|
$cx-default-window-border-radius: $cx-default-border-radius !default;
|
|
@@ -17,46 +19,3 @@ $cx-default-window-footer-color: null !default;
|
|
|
17
19
|
$cx-default-window-footer-background-color: rgba(246, 246, 246, 0.9) !default;
|
|
18
20
|
$cx-default-window-footer-padding: $cx-default-window-header-padding !default;
|
|
19
21
|
$cx-default-window-footer-font-size: 16px !default;
|
|
20
|
-
|
|
21
|
-
$cx-window-state-style-map: (
|
|
22
|
-
default: (
|
|
23
|
-
box-shadow: $cx-default-window-box-shadow,
|
|
24
|
-
background-color: $cx-default-window-background-color,
|
|
25
|
-
border-radius: $cx-default-window-border-radius,
|
|
26
|
-
),
|
|
27
|
-
resizable: (
|
|
28
|
-
box-shadow: 0 0 20px 1px rgba(0, 0, 0, 0.29),
|
|
29
|
-
),
|
|
30
|
-
) !default;
|
|
31
|
-
|
|
32
|
-
$cx-window-header-state-style-map: (
|
|
33
|
-
default: (
|
|
34
|
-
color: $cx-default-window-header-color,
|
|
35
|
-
background: $cx-default-window-header-background-color,
|
|
36
|
-
padding: $cx-default-window-header-padding,
|
|
37
|
-
font-size: $cx-default-window-header-font-size,
|
|
38
|
-
),
|
|
39
|
-
active: (),
|
|
40
|
-
) !default;
|
|
41
|
-
|
|
42
|
-
$cx-window-footer-state-style-map: (
|
|
43
|
-
default: (
|
|
44
|
-
background: $cx-default-window-footer-background-color,
|
|
45
|
-
padding: $cx-default-window-footer-padding,
|
|
46
|
-
),
|
|
47
|
-
) !default;
|
|
48
|
-
|
|
49
|
-
$cx-window-body-state-style-map: (
|
|
50
|
-
default: (
|
|
51
|
-
background: $cx-default-window-body-background-color,
|
|
52
|
-
padding: $cx-default-window-body-padding,
|
|
53
|
-
),
|
|
54
|
-
) !default;
|
|
55
|
-
|
|
56
|
-
$cx-window-mods: (
|
|
57
|
-
alert: (
|
|
58
|
-
frame: (),
|
|
59
|
-
body: (),
|
|
60
|
-
footer: (),
|
|
61
|
-
),
|
|
62
|
-
);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from "./Overlay";
|
|
2
|
-
export * from "./Dropdown";
|
|
3
|
-
export * from "./tooltip-ops";
|
|
4
|
-
export * from "./Tooltip";
|
|
5
|
-
export * from "./Window";
|
|
6
|
-
export * from "./MsgBox";
|
|
7
|
-
export * from "./Toast";
|
|
8
|
-
export * from "./captureMouse";
|
|
9
|
-
export * from "./ContextMenu";
|
|
10
|
-
export * from "./FlyweightTooltipTracker";
|
|
11
|
-
export * from "./createHotPromiseWindowFactory";
|
|
1
|
+
export * from "./Overlay";
|
|
2
|
+
export * from "./Dropdown";
|
|
3
|
+
export * from "./tooltip-ops";
|
|
4
|
+
export * from "./Tooltip";
|
|
5
|
+
export * from "./Window";
|
|
6
|
+
export * from "./MsgBox";
|
|
7
|
+
export * from "./Toast";
|
|
8
|
+
export * from "./captureMouse";
|
|
9
|
+
export * from "./ContextMenu";
|
|
10
|
+
export * from "./FlyweightTooltipTracker";
|
|
11
|
+
export * from "./createHotPromiseWindowFactory";
|