@mwater/visualization 5.0.0 → 5.1.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.
- package/lib/MWaterAddRelatedFormComponent.d.ts +1 -1
- package/lib/MWaterAddRelatedFormComponent.js +10 -17
- package/lib/MWaterContextComponent.d.ts +17 -7
- package/lib/MWaterContextComponent.js +51 -70
- package/lib/MWaterLoaderComponent.d.ts +2 -2
- package/lib/MWaterLoaderComponent.js +1 -1
- package/lib/MWaterTableSelectComponent.d.ts +0 -1
- package/lib/MWaterTableSelectComponent.js +20 -41
- package/lib/axes/RangesComponent.d.ts +12 -6
- package/lib/axes/RangesComponent.js +21 -10
- package/lib/dashboards/DashboardComponent.d.ts +1 -9
- package/lib/dashboards/DashboardComponent.js +16 -27
- package/lib/dashboards/ServerDashboardDataSource.d.ts +1 -0
- package/lib/dashboards/ServerDashboardDataSource.js +3 -0
- package/lib/datagrids/DatagridComponent.d.ts +10 -4
- package/lib/datagrids/DatagridComponent.js +34 -6
- package/lib/datagrids/DatagridDataSource.d.ts +1 -0
- package/lib/datagrids/DatagridDataSource.js +3 -0
- package/lib/datagrids/DatagridDesign.d.ts +2 -0
- package/lib/datagrids/DatagridDesignerComponent.js +3 -2
- package/lib/datagrids/DatagridViewComponent.d.ts +2 -0
- package/lib/datagrids/DatagridViewComponent.js +4 -3
- package/lib/datagrids/DirectDatagridDataSource.d.ts +1 -0
- package/lib/datagrids/DirectDatagridDataSource.js +26 -0
- package/lib/datagrids/LabeledExprGenerator.js +15 -0
- package/lib/datagrids/ServerDatagridDataSource.d.ts +1 -0
- package/lib/datagrids/ServerDatagridDataSource.js +15 -0
- package/lib/dayjs.d.ts +2 -0
- package/lib/dayjs.js +9 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +2 -4
- package/lib/languages.js +5 -0
- package/lib/layouts/blocks/BlocksDisplayComponent.js +2 -2
- package/lib/layouts/grid/LegoLayoutEngine.d.ts +1 -1
- package/lib/maps/BufferLayerDesignerComponent.js +2 -2
- package/lib/maps/ChoroplethLayerDesigner.js +2 -2
- package/lib/maps/ClusterLayerDesignerComponent.js +2 -2
- package/lib/maps/DetailLevelSelectComponent.d.ts +1 -93
- package/lib/maps/DirectMapDataSource.js +1 -2
- package/lib/maps/GridLayerDesigner.js +2 -2
- package/lib/maps/Layer.js +7 -18
- package/lib/maps/MapComponent.js +1 -1
- package/lib/maps/MapDesignerComponent.d.ts +1 -12
- package/lib/maps/MapDesignerComponent.js +5 -12
- package/lib/maps/MarkersLayerDesignerComponent.js +2 -2
- package/lib/maps/PopupFilterJoinsUtils.d.ts +6 -1
- package/lib/maps/PopupFilterJoinsUtils.js +4 -3
- package/lib/maps/RegionSelectComponent.d.ts +1 -33
- package/lib/maps/UtfGridLayer.js +1 -1
- package/lib/maps/VectorMapViewComponent.js +21 -29
- package/lib/quickfilter/QuickfiltersComponent.d.ts +2 -186
- package/lib/quickfilter/QuickfiltersDesignComponent.js +1 -1
- package/lib/quickfilter/TextLiteralComponent.d.ts +2 -186
- package/lib/quickfilter/TextLiteralComponent.js +3 -0
- package/lib/valueFormatter.js +52 -1
- package/lib/widgets/ImageWidgetComponent.js +2 -2
- package/lib/widgets/charts/calendar/CalendarChartDesignerComponent.js +2 -2
- package/lib/widgets/charts/imagemosaic/ImageMosaicChart.d.ts +1 -1
- package/lib/widgets/charts/imagemosaic/ImageMosaicChart.js +1 -1
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.js +2 -2
- package/lib/widgets/charts/layered/LayeredChartCompiler.d.ts +1 -1
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +2 -2
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +2 -2
- package/lib/widgets/charts/pivot/PivotChartLayout.d.ts +3 -2
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +4 -1
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.js +1 -1
- package/lib/widgets/charts/table/TableChart.js +15 -4
- package/lib/widgets/charts/table/TableChartDesignerComponent.js +2 -2
- package/lib/widgets/charts/table/TableChartViewComponent.d.ts +2 -1
- package/lib/widgets/charts/table/TableChartViewComponent.js +9 -4
- package/lib/widgets/text/ExprItemEditorComponent.js +2 -2
- package/package.json +8 -8
- package/src/MWaterAddRelatedFormComponent.ts +15 -20
- package/src/MWaterAddRelatedIndicatorComponent.ts +1 -1
- package/src/MWaterContextComponent.tsx +140 -0
- package/src/MWaterLoaderComponent.ts +2 -2
- package/src/{MWaterTableSelectComponent.ts → MWaterTableSelectComponent.tsx} +61 -66
- package/src/axes/AxisBuilder.ts +1 -1
- package/src/axes/RangesComponent.ts +27 -16
- package/src/dashboards/{DashboardComponent.ts → DashboardComponent.tsx} +37 -40
- package/src/dashboards/ServerDashboardDataSource.ts +16 -12
- package/src/datagrids/DatagridComponent.ts +59 -14
- package/src/datagrids/DatagridDataSource.ts +8 -0
- package/src/datagrids/DatagridDesign.ts +3 -0
- package/src/datagrids/DatagridDesignerComponent.tsx +9 -1
- package/src/datagrids/DatagridViewComponent.ts +7 -3
- package/src/datagrids/DirectDatagridDataSource.ts +35 -0
- package/src/datagrids/LabeledExprGenerator.ts +15 -0
- package/src/datagrids/ServerDatagridDataSource.ts +22 -4
- package/src/dayjs.ts +5 -0
- package/src/index.ts +0 -2
- package/src/languages.ts +5 -0
- package/src/layouts/blocks/BlocksDisplayComponent.ts +2 -2
- package/src/layouts/grid/LegoLayoutEngine.ts +2 -2
- package/src/layouts/grid/WidgetContainerComponent.ts +2 -2
- package/src/maps/BingLayer.ts +2 -2
- package/src/maps/BufferLayerDesignerComponent.ts +1 -1
- package/src/maps/ChoroplethLayerDesigner.tsx +1 -1
- package/src/maps/ClusterLayerDesignerComponent.ts +1 -1
- package/src/maps/DirectMapDataSource.ts +1 -2
- package/src/maps/GridLayerDesigner.tsx +1 -1
- package/src/maps/Layer.ts +6 -16
- package/src/maps/LegendGroup.ts +1 -1
- package/src/maps/MWaterServerLayer.ts +2 -2
- package/src/maps/MapComponent.ts +1 -1
- package/src/maps/{MapDesignerComponent.ts → MapDesignerComponent.tsx} +8 -16
- package/src/maps/MarkersLayerDesignerComponent.ts +1 -1
- package/src/maps/PopupFilterJoinsUtils.ts +4 -4
- package/src/maps/RasterMapViewComponent.ts +0 -1
- package/src/maps/ServerMapDataSource.ts +6 -6
- package/src/maps/SwitchableTileUrlLayerDesigner.tsx +1 -13
- package/src/maps/UtfGridLayer.ts +4 -4
- package/src/maps/VectorMapViewComponent.tsx +23 -36
- package/src/maps/mapboxUtils.ts +2 -2
- package/src/quickfilter/QuickfiltersDesignComponent.tsx +1 -1
- package/src/quickfilter/TextLiteralComponent.ts +4 -0
- package/src/richtext/ExprItemsHtmlConverter.ts +1 -1
- package/src/richtext/FontColorPaletteItem.ts +1 -1
- package/src/richtext/FontSizePaletteItem.ts +1 -1
- package/src/richtext/ItemsHtmlConverter.ts +2 -2
- package/src/valueFormatter.ts +54 -1
- package/src/widgets/ImageWidgetComponent.ts +1 -1
- package/src/widgets/charts/calendar/CalendarChartDesignerComponent.ts +1 -1
- package/src/widgets/charts/imagemosaic/ImageMosaicChart.ts +1 -1
- package/src/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.ts +1 -1
- package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +1 -1
- package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +1 -1
- package/src/widgets/charts/pivot/PivotChartLayout.ts +3 -2
- package/src/widgets/charts/pivot/PivotChartLayoutBuilder.ts +2 -2
- package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +7 -3
- package/src/widgets/charts/pivot/PivotChartQueryBuilder.ts +1 -1
- package/src/widgets/charts/table/TableChart.ts +24 -14
- package/src/widgets/charts/table/TableChartDesignerComponent.ts +1 -1
- package/src/widgets/charts/table/TableChartViewComponent.ts +10 -5
- package/src/widgets/text/ExprItemEditorComponent.tsx +1 -1
- package/stories/dashboards.js +3 -3
- package/src/MWaterContextComponent.ts +0 -144
- package/src/TableSelectComponent.ts +0 -60
|
@@ -22,192 +22,8 @@ export default class TextLiteralComponent extends React.Component<TextLiteralCom
|
|
|
22
22
|
handleSingleChange: (val: any) => any;
|
|
23
23
|
handleMultipleChange: (val: any) => any;
|
|
24
24
|
getOptions: (input: any, cb: any) => void;
|
|
25
|
-
renderSingle(): React.FunctionComponentElement<Omit<
|
|
26
|
-
|
|
27
|
-
options?: import("react-select").OptionsOrGroups<unknown, import("react-select").GroupBase<unknown>> | undefined;
|
|
28
|
-
placeholder?: React.ReactNode;
|
|
29
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
30
|
-
styles?: import("react-select").StylesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
31
|
-
isLoading?: boolean | undefined;
|
|
32
|
-
isDisabled?: boolean | undefined;
|
|
33
|
-
isRtl?: boolean | undefined;
|
|
34
|
-
isMulti?: boolean | undefined;
|
|
35
|
-
controlShouldRenderValue?: boolean | undefined;
|
|
36
|
-
loadingMessage?: ((obj: {
|
|
37
|
-
inputValue: string;
|
|
38
|
-
}) => React.ReactNode) | undefined;
|
|
39
|
-
noOptionsMessage?: ((obj: {
|
|
40
|
-
inputValue: string;
|
|
41
|
-
}) => React.ReactNode) | undefined;
|
|
42
|
-
backspaceRemovesValue?: boolean | undefined;
|
|
43
|
-
blurInputOnSelect?: boolean | undefined;
|
|
44
|
-
captureMenuScroll?: boolean | undefined;
|
|
45
|
-
classNames?: import("react-select").ClassNamesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
46
|
-
closeMenuOnSelect?: boolean | undefined;
|
|
47
|
-
closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
|
|
48
|
-
components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<unknown, boolean, import("react-select").GroupBase<unknown>>> | undefined;
|
|
49
|
-
escapeClearsValue?: boolean | undefined;
|
|
50
|
-
filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<unknown>, inputValue: string) => boolean) | null | undefined;
|
|
51
|
-
formatGroupLabel?: ((group: import("react-select").GroupBase<unknown>) => React.ReactNode) | undefined;
|
|
52
|
-
getOptionLabel?: import("react-select").GetOptionLabel<unknown> | undefined;
|
|
53
|
-
getOptionValue?: import("react-select").GetOptionValue<unknown> | undefined;
|
|
54
|
-
isOptionDisabled?: ((option: unknown, selectValue: import("react-select").Options<unknown>) => boolean) | undefined;
|
|
55
|
-
isSearchable?: boolean | undefined;
|
|
56
|
-
minMenuHeight?: number | undefined;
|
|
57
|
-
maxMenuHeight?: number | undefined;
|
|
58
|
-
menuIsOpen?: boolean | undefined;
|
|
59
|
-
menuPlacement?: import("react-select").MenuPlacement | undefined;
|
|
60
|
-
menuPosition?: import("react-select").MenuPosition | undefined;
|
|
61
|
-
menuShouldBlockScroll?: boolean | undefined;
|
|
62
|
-
menuShouldScrollIntoView?: boolean | undefined;
|
|
63
|
-
openMenuOnFocus?: boolean | undefined;
|
|
64
|
-
openMenuOnClick?: boolean | undefined;
|
|
65
|
-
pageSize?: number | undefined;
|
|
66
|
-
screenReaderStatus?: ((obj: {
|
|
67
|
-
count: number;
|
|
68
|
-
}) => string) | undefined;
|
|
69
|
-
tabSelectsValue?: boolean | undefined;
|
|
70
|
-
unstyled?: boolean | undefined;
|
|
71
|
-
} & {}, "value" | "onChange" | "inputValue" | "menuIsOpen" | "onInputChange" | "onMenuOpen" | "onMenuClose"> & Partial<Pick<import("react-select/dist/declarations/src/Select").Props<unknown, boolean, import("react-select").GroupBase<unknown>>, "required" | "id" | "name" | "value" | "form" | "className" | "autoFocus" | "aria-errormessage" | "aria-invalid" | "aria-label" | "aria-labelledby" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "isClearable" | "theme" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputValue" | "inputId" | "instanceId" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom"> & {
|
|
72
|
-
tabIndex?: number | undefined;
|
|
73
|
-
options?: import("react-select").OptionsOrGroups<unknown, import("react-select").GroupBase<unknown>> | undefined;
|
|
74
|
-
placeholder?: React.ReactNode;
|
|
75
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
76
|
-
styles?: import("react-select").StylesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
77
|
-
isLoading?: boolean | undefined;
|
|
78
|
-
isDisabled?: boolean | undefined;
|
|
79
|
-
isRtl?: boolean | undefined;
|
|
80
|
-
isMulti?: boolean | undefined;
|
|
81
|
-
controlShouldRenderValue?: boolean | undefined;
|
|
82
|
-
loadingMessage?: ((obj: {
|
|
83
|
-
inputValue: string;
|
|
84
|
-
}) => React.ReactNode) | undefined;
|
|
85
|
-
noOptionsMessage?: ((obj: {
|
|
86
|
-
inputValue: string;
|
|
87
|
-
}) => React.ReactNode) | undefined;
|
|
88
|
-
backspaceRemovesValue?: boolean | undefined;
|
|
89
|
-
blurInputOnSelect?: boolean | undefined;
|
|
90
|
-
captureMenuScroll?: boolean | undefined;
|
|
91
|
-
classNames?: import("react-select").ClassNamesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
92
|
-
closeMenuOnSelect?: boolean | undefined;
|
|
93
|
-
closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
|
|
94
|
-
components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<unknown, boolean, import("react-select").GroupBase<unknown>>> | undefined;
|
|
95
|
-
escapeClearsValue?: boolean | undefined;
|
|
96
|
-
filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<unknown>, inputValue: string) => boolean) | null | undefined;
|
|
97
|
-
formatGroupLabel?: ((group: import("react-select").GroupBase<unknown>) => React.ReactNode) | undefined;
|
|
98
|
-
getOptionLabel?: import("react-select").GetOptionLabel<unknown> | undefined;
|
|
99
|
-
getOptionValue?: import("react-select").GetOptionValue<unknown> | undefined;
|
|
100
|
-
isOptionDisabled?: ((option: unknown, selectValue: import("react-select").Options<unknown>) => boolean) | undefined;
|
|
101
|
-
isSearchable?: boolean | undefined;
|
|
102
|
-
minMenuHeight?: number | undefined;
|
|
103
|
-
maxMenuHeight?: number | undefined;
|
|
104
|
-
menuIsOpen?: boolean | undefined;
|
|
105
|
-
menuPlacement?: import("react-select").MenuPlacement | undefined;
|
|
106
|
-
menuPosition?: import("react-select").MenuPosition | undefined;
|
|
107
|
-
menuShouldBlockScroll?: boolean | undefined;
|
|
108
|
-
menuShouldScrollIntoView?: boolean | undefined;
|
|
109
|
-
openMenuOnFocus?: boolean | undefined;
|
|
110
|
-
openMenuOnClick?: boolean | undefined;
|
|
111
|
-
pageSize?: number | undefined;
|
|
112
|
-
screenReaderStatus?: ((obj: {
|
|
113
|
-
count: number;
|
|
114
|
-
}) => string) | undefined;
|
|
115
|
-
tabSelectsValue?: boolean | undefined;
|
|
116
|
-
unstyled?: boolean | undefined;
|
|
117
|
-
} & {}> & import("react-select/dist/declarations/src/useStateManager").StateManagerAdditionalProps<unknown> & import("react-select/dist/declarations/src/useAsync").AsyncAdditionalProps<unknown, import("react-select").GroupBase<unknown>> & React.RefAttributes<import("react-select/dist/declarations/src/Select").default<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
|
|
118
|
-
renderMultiple(): React.FunctionComponentElement<Omit<Pick<import("react-select/dist/declarations/src/Select").Props<unknown, boolean, import("react-select").GroupBase<unknown>>, "required" | "id" | "name" | "value" | "form" | "className" | "autoFocus" | "aria-errormessage" | "aria-invalid" | "aria-label" | "aria-labelledby" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "isClearable" | "theme" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputValue" | "inputId" | "instanceId" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom"> & {
|
|
119
|
-
tabIndex?: number | undefined;
|
|
120
|
-
options?: import("react-select").OptionsOrGroups<unknown, import("react-select").GroupBase<unknown>> | undefined;
|
|
121
|
-
placeholder?: React.ReactNode;
|
|
122
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
123
|
-
styles?: import("react-select").StylesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
124
|
-
isLoading?: boolean | undefined;
|
|
125
|
-
isDisabled?: boolean | undefined;
|
|
126
|
-
isRtl?: boolean | undefined;
|
|
127
|
-
isMulti?: boolean | undefined;
|
|
128
|
-
controlShouldRenderValue?: boolean | undefined;
|
|
129
|
-
loadingMessage?: ((obj: {
|
|
130
|
-
inputValue: string;
|
|
131
|
-
}) => React.ReactNode) | undefined;
|
|
132
|
-
noOptionsMessage?: ((obj: {
|
|
133
|
-
inputValue: string;
|
|
134
|
-
}) => React.ReactNode) | undefined;
|
|
135
|
-
backspaceRemovesValue?: boolean | undefined;
|
|
136
|
-
blurInputOnSelect?: boolean | undefined;
|
|
137
|
-
captureMenuScroll?: boolean | undefined;
|
|
138
|
-
classNames?: import("react-select").ClassNamesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
139
|
-
closeMenuOnSelect?: boolean | undefined;
|
|
140
|
-
closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
|
|
141
|
-
components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<unknown, boolean, import("react-select").GroupBase<unknown>>> | undefined;
|
|
142
|
-
escapeClearsValue?: boolean | undefined;
|
|
143
|
-
filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<unknown>, inputValue: string) => boolean) | null | undefined;
|
|
144
|
-
formatGroupLabel?: ((group: import("react-select").GroupBase<unknown>) => React.ReactNode) | undefined;
|
|
145
|
-
getOptionLabel?: import("react-select").GetOptionLabel<unknown> | undefined;
|
|
146
|
-
getOptionValue?: import("react-select").GetOptionValue<unknown> | undefined;
|
|
147
|
-
isOptionDisabled?: ((option: unknown, selectValue: import("react-select").Options<unknown>) => boolean) | undefined;
|
|
148
|
-
isSearchable?: boolean | undefined;
|
|
149
|
-
minMenuHeight?: number | undefined;
|
|
150
|
-
maxMenuHeight?: number | undefined;
|
|
151
|
-
menuIsOpen?: boolean | undefined;
|
|
152
|
-
menuPlacement?: import("react-select").MenuPlacement | undefined;
|
|
153
|
-
menuPosition?: import("react-select").MenuPosition | undefined;
|
|
154
|
-
menuShouldBlockScroll?: boolean | undefined;
|
|
155
|
-
menuShouldScrollIntoView?: boolean | undefined;
|
|
156
|
-
openMenuOnFocus?: boolean | undefined;
|
|
157
|
-
openMenuOnClick?: boolean | undefined;
|
|
158
|
-
pageSize?: number | undefined;
|
|
159
|
-
screenReaderStatus?: ((obj: {
|
|
160
|
-
count: number;
|
|
161
|
-
}) => string) | undefined;
|
|
162
|
-
tabSelectsValue?: boolean | undefined;
|
|
163
|
-
unstyled?: boolean | undefined;
|
|
164
|
-
} & {}, "value" | "onChange" | "inputValue" | "menuIsOpen" | "onInputChange" | "onMenuOpen" | "onMenuClose"> & Partial<Pick<import("react-select/dist/declarations/src/Select").Props<unknown, boolean, import("react-select").GroupBase<unknown>>, "required" | "id" | "name" | "value" | "form" | "className" | "autoFocus" | "aria-errormessage" | "aria-invalid" | "aria-label" | "aria-labelledby" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "isClearable" | "theme" | "ariaLiveMessages" | "classNamePrefix" | "delimiter" | "formatOptionLabel" | "hideSelectedOptions" | "inputValue" | "inputId" | "instanceId" | "isOptionSelected" | "menuPortalTarget" | "onInputChange" | "onMenuOpen" | "onMenuClose" | "onMenuScrollToTop" | "onMenuScrollToBottom"> & {
|
|
165
|
-
tabIndex?: number | undefined;
|
|
166
|
-
options?: import("react-select").OptionsOrGroups<unknown, import("react-select").GroupBase<unknown>> | undefined;
|
|
167
|
-
placeholder?: React.ReactNode;
|
|
168
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
169
|
-
styles?: import("react-select").StylesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
170
|
-
isLoading?: boolean | undefined;
|
|
171
|
-
isDisabled?: boolean | undefined;
|
|
172
|
-
isRtl?: boolean | undefined;
|
|
173
|
-
isMulti?: boolean | undefined;
|
|
174
|
-
controlShouldRenderValue?: boolean | undefined;
|
|
175
|
-
loadingMessage?: ((obj: {
|
|
176
|
-
inputValue: string;
|
|
177
|
-
}) => React.ReactNode) | undefined;
|
|
178
|
-
noOptionsMessage?: ((obj: {
|
|
179
|
-
inputValue: string;
|
|
180
|
-
}) => React.ReactNode) | undefined;
|
|
181
|
-
backspaceRemovesValue?: boolean | undefined;
|
|
182
|
-
blurInputOnSelect?: boolean | undefined;
|
|
183
|
-
captureMenuScroll?: boolean | undefined;
|
|
184
|
-
classNames?: import("react-select").ClassNamesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
185
|
-
closeMenuOnSelect?: boolean | undefined;
|
|
186
|
-
closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
|
|
187
|
-
components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<unknown, boolean, import("react-select").GroupBase<unknown>>> | undefined;
|
|
188
|
-
escapeClearsValue?: boolean | undefined;
|
|
189
|
-
filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<unknown>, inputValue: string) => boolean) | null | undefined;
|
|
190
|
-
formatGroupLabel?: ((group: import("react-select").GroupBase<unknown>) => React.ReactNode) | undefined;
|
|
191
|
-
getOptionLabel?: import("react-select").GetOptionLabel<unknown> | undefined;
|
|
192
|
-
getOptionValue?: import("react-select").GetOptionValue<unknown> | undefined;
|
|
193
|
-
isOptionDisabled?: ((option: unknown, selectValue: import("react-select").Options<unknown>) => boolean) | undefined;
|
|
194
|
-
isSearchable?: boolean | undefined;
|
|
195
|
-
minMenuHeight?: number | undefined;
|
|
196
|
-
maxMenuHeight?: number | undefined;
|
|
197
|
-
menuIsOpen?: boolean | undefined;
|
|
198
|
-
menuPlacement?: import("react-select").MenuPlacement | undefined;
|
|
199
|
-
menuPosition?: import("react-select").MenuPosition | undefined;
|
|
200
|
-
menuShouldBlockScroll?: boolean | undefined;
|
|
201
|
-
menuShouldScrollIntoView?: boolean | undefined;
|
|
202
|
-
openMenuOnFocus?: boolean | undefined;
|
|
203
|
-
openMenuOnClick?: boolean | undefined;
|
|
204
|
-
pageSize?: number | undefined;
|
|
205
|
-
screenReaderStatus?: ((obj: {
|
|
206
|
-
count: number;
|
|
207
|
-
}) => string) | undefined;
|
|
208
|
-
tabSelectsValue?: boolean | undefined;
|
|
209
|
-
unstyled?: boolean | undefined;
|
|
210
|
-
} & {}> & import("react-select/dist/declarations/src/useStateManager").StateManagerAdditionalProps<unknown> & import("react-select/dist/declarations/src/useAsync").AsyncAdditionalProps<unknown, import("react-select").GroupBase<unknown>> & React.RefAttributes<import("react-select/dist/declarations/src/Select").default<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
|
|
25
|
+
renderSingle(): React.FunctionComponentElement<Omit<import("react-select/dist/declarations/src/Select").PublicBaseSelectProps<unknown, boolean, import("react-select").GroupBase<unknown>>, "value" | "onChange" | "inputValue" | "menuIsOpen" | "onInputChange" | "onMenuOpen" | "onMenuClose"> & Partial<import("react-select/dist/declarations/src/Select").PublicBaseSelectProps<unknown, boolean, import("react-select").GroupBase<unknown>>> & import("react-select/dist/declarations/src/useStateManager").StateManagerAdditionalProps<unknown> & import("react-select/dist/declarations/src/useAsync").AsyncAdditionalProps<unknown, import("react-select").GroupBase<unknown>> & React.RefAttributes<import("react-select/dist/declarations/src/Select").default<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
|
|
26
|
+
renderMultiple(): React.FunctionComponentElement<Omit<import("react-select/dist/declarations/src/Select").PublicBaseSelectProps<unknown, boolean, import("react-select").GroupBase<unknown>>, "value" | "onChange" | "inputValue" | "menuIsOpen" | "onInputChange" | "onMenuOpen" | "onMenuClose"> & Partial<import("react-select/dist/declarations/src/Select").PublicBaseSelectProps<unknown, boolean, import("react-select").GroupBase<unknown>>> & import("react-select/dist/declarations/src/useStateManager").StateManagerAdditionalProps<unknown> & import("react-select/dist/declarations/src/useAsync").AsyncAdditionalProps<unknown, import("react-select").GroupBase<unknown>> & React.RefAttributes<import("react-select/dist/declarations/src/Select").default<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
|
|
211
27
|
render(): React.DetailedReactHTMLElement<{
|
|
212
28
|
style: {
|
|
213
29
|
width: string;
|
|
@@ -33,6 +33,9 @@ class TextLiteralComponent extends react_1.default.Component {
|
|
|
33
33
|
const exprType = exprUtils.getExprType(this.props.expr);
|
|
34
34
|
// Create query to get matches
|
|
35
35
|
const exprCompiler = new expressions_1.ExprCompiler(this.props.schema);
|
|
36
|
+
if (!this.props.expr.table) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
36
39
|
// Add filter for input (simple if just text)
|
|
37
40
|
if (exprType === "text") {
|
|
38
41
|
if (input) {
|
package/lib/valueFormatter.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.formatValue = exports.getDefaultFormat = exports.getFormatOptions = exports.canFormatType = void 0;
|
|
4
7
|
const d3_format_1 = require("d3-format");
|
|
5
8
|
const utm_1 = require("utm");
|
|
9
|
+
const dayjs_1 = __importDefault(require("./dayjs"));
|
|
6
10
|
/** Determine if can format type */
|
|
7
11
|
function canFormatType(type) {
|
|
8
|
-
return type == "number" || type == "geometry";
|
|
12
|
+
return type == "number" || type == "geometry" || type === "date" || type === "datetime";
|
|
9
13
|
}
|
|
10
14
|
exports.canFormatType = canFormatType;
|
|
11
15
|
/** Get available options for formatting a type. Null if not available */
|
|
@@ -28,6 +32,41 @@ function getFormatOptions(type) {
|
|
|
28
32
|
{ value: "UTM", label: "UTM" }
|
|
29
33
|
];
|
|
30
34
|
}
|
|
35
|
+
if (type == "date") {
|
|
36
|
+
return [
|
|
37
|
+
{ value: "ll", label: (0, dayjs_1.default)().format("ll") },
|
|
38
|
+
{ value: "YYYY-MM-DD", label: (0, dayjs_1.default)().format("YYYY-MM-DD") },
|
|
39
|
+
{ value: "YYYY-MMM-DD", label: (0, dayjs_1.default)().format("YYYY-MMM-DD") },
|
|
40
|
+
{ value: "YYYY-MM", label: (0, dayjs_1.default)().format("YYYY-MM") },
|
|
41
|
+
{ value: "YYYY", label: (0, dayjs_1.default)().format("YYYY") },
|
|
42
|
+
{ value: "MMM YYYY", label: (0, dayjs_1.default)().format("MMM YYYY") },
|
|
43
|
+
{ value: "MMM DD, YYYY", label: (0, dayjs_1.default)().format("MMM DD, YYYY") },
|
|
44
|
+
{ value: "MMMM D, YYYY", label: (0, dayjs_1.default)().format("MMMM D, YYYY") },
|
|
45
|
+
{ value: "MM/DD/YYYY", label: (0, dayjs_1.default)().format("MM/DD/YYYY") },
|
|
46
|
+
{ value: "DD/MM/YYYY", label: (0, dayjs_1.default)().format("DD/MM/YYYY") },
|
|
47
|
+
{ value: "DD-MM-YYYY", label: (0, dayjs_1.default)().format("DD-MM-YYYY") },
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
if (type == "datetime") {
|
|
51
|
+
return [
|
|
52
|
+
{ value: "lll", label: (0, dayjs_1.default)().format("lll") },
|
|
53
|
+
{ value: "llll", label: (0, dayjs_1.default)().format("llll") },
|
|
54
|
+
{ value: "YYYY-MM-DD", label: (0, dayjs_1.default)().format("YYYY-MM-DD") },
|
|
55
|
+
{ value: "YYYY-MMM-DD", label: (0, dayjs_1.default)().format("YYYY-MMM-DD") },
|
|
56
|
+
{ value: "YYYY-MM", label: (0, dayjs_1.default)().format("YYYY-MM") },
|
|
57
|
+
{ value: "YYYY", label: (0, dayjs_1.default)().format("YYYY") },
|
|
58
|
+
{ value: "MMM YYYY", label: (0, dayjs_1.default)().format("MMM YYYY") },
|
|
59
|
+
{ value: "MMM DD, YYYY h:mm A", label: (0, dayjs_1.default)().format("MMM DD, YYYY h:mm A") },
|
|
60
|
+
{ value: "MMMM D, YYYY h:mm A", label: (0, dayjs_1.default)().format("MMMM D, YYYY h:mm A") },
|
|
61
|
+
{ value: "MMM DD, YYYY", label: (0, dayjs_1.default)().format("MMM DD, YYYY") },
|
|
62
|
+
{ value: "MMMM D, YYYY", label: (0, dayjs_1.default)().format("MMMM D, YYYY") },
|
|
63
|
+
{ value: "MM/DD/YYYY", label: (0, dayjs_1.default)().format("MM/DD/YYYY") },
|
|
64
|
+
{ value: "DD/MM/YYYY", label: (0, dayjs_1.default)().format("DD/MM/YYYY") },
|
|
65
|
+
{ value: "DD-MM-YYYY", label: (0, dayjs_1.default)().format("DD-MM-YYYY") },
|
|
66
|
+
{ value: "YYYY-MM-DD HH:mm:ss", label: (0, dayjs_1.default)().format("YYYY-MM-DD HH:mm:ss") },
|
|
67
|
+
{ value: "ISO 8601", label: (0, dayjs_1.default)().toISOString() },
|
|
68
|
+
];
|
|
69
|
+
}
|
|
31
70
|
return null;
|
|
32
71
|
}
|
|
33
72
|
exports.getFormatOptions = getFormatOptions;
|
|
@@ -39,6 +78,12 @@ function getDefaultFormat(type) {
|
|
|
39
78
|
if (type == "geometry") {
|
|
40
79
|
return "lat, lng";
|
|
41
80
|
}
|
|
81
|
+
if (type == "date") {
|
|
82
|
+
return "ll";
|
|
83
|
+
}
|
|
84
|
+
if (type == "datetime") {
|
|
85
|
+
return "lll";
|
|
86
|
+
}
|
|
42
87
|
throw new Error("Not supported");
|
|
43
88
|
}
|
|
44
89
|
exports.getDefaultFormat = getDefaultFormat;
|
|
@@ -59,6 +104,12 @@ function formatValue(type, value, format, locale, legacyPercentFormat) {
|
|
|
59
104
|
}
|
|
60
105
|
return (0, d3_format_1.format)(format)(value);
|
|
61
106
|
}
|
|
107
|
+
if (["date", "datetime"].includes(type)) {
|
|
108
|
+
if (format == "ISO 8601") {
|
|
109
|
+
return (0, dayjs_1.default)(value).toISOString();
|
|
110
|
+
}
|
|
111
|
+
return (0, dayjs_1.default)(value).format(format);
|
|
112
|
+
}
|
|
62
113
|
if (type == "geometry") {
|
|
63
114
|
if (format == "UTM") {
|
|
64
115
|
if (value.type == "Point") {
|
|
@@ -37,7 +37,7 @@ const DropdownWidgetComponent_1 = __importDefault(require("./DropdownWidgetCompo
|
|
|
37
37
|
const ModalPopupComponent_1 = __importDefault(require("@mwater/react-library/lib/ModalPopupComponent"));
|
|
38
38
|
const TabbedComponent_1 = __importDefault(require("@mwater/react-library/lib/TabbedComponent"));
|
|
39
39
|
const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
40
|
-
const
|
|
40
|
+
const expressions_ui_2 = require("@mwater/expressions-ui");
|
|
41
41
|
const ImageUploaderComponent_1 = __importDefault(require("./ImageUploaderComponent"));
|
|
42
42
|
const ImagelistCarouselComponent_1 = __importDefault(require("./ImagelistCarouselComponent"));
|
|
43
43
|
class ImageWidgetComponent extends AsyncLoadComponent_1.default {
|
|
@@ -257,7 +257,7 @@ class ImageWidgetDesignComponent extends react_1.default.Component {
|
|
|
257
257
|
});
|
|
258
258
|
};
|
|
259
259
|
renderExpressionEditor() {
|
|
260
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), ": ", R(
|
|
260
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), ": ", R(expressions_ui_2.TableSelectComponent, { schema: this.props.schema, value: this.state.table, onChange: this.handleTableChange }), R("br"), this.state.table
|
|
261
261
|
? R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, "Field"), ": ", R(expressions_ui_1.ExprComponent, {
|
|
262
262
|
schema: this.props.schema,
|
|
263
263
|
dataSource: this.props.dataSource,
|
|
@@ -32,7 +32,7 @@ const R = react_1.default.createElement;
|
|
|
32
32
|
const ui = __importStar(require("../../../UIComponents"));
|
|
33
33
|
const AxisComponent_1 = __importDefault(require("../../../axes/AxisComponent"));
|
|
34
34
|
const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
35
|
-
const
|
|
35
|
+
const expressions_ui_2 = require("@mwater/expressions-ui");
|
|
36
36
|
const ColorComponent_1 = __importDefault(require("../../../ColorComponent"));
|
|
37
37
|
class CalendarChartDesignerComponent extends react_1.default.Component {
|
|
38
38
|
// Updates design with the specified changes
|
|
@@ -67,7 +67,7 @@ class CalendarChartDesignerComponent extends react_1.default.Component {
|
|
|
67
67
|
this.updateDesign({ cellColor });
|
|
68
68
|
};
|
|
69
69
|
renderTable() {
|
|
70
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), ": ", R(
|
|
70
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), ": ", R(expressions_ui_2.TableSelectComponent, {
|
|
71
71
|
schema: this.props.schema,
|
|
72
72
|
value: this.props.design.table,
|
|
73
73
|
onChange: this.handleTableChange,
|
|
@@ -15,7 +15,7 @@ export default class ImageMosaicChart extends Chart {
|
|
|
15
15
|
}>;
|
|
16
16
|
getData(design: any, schema: Schema, dataSource: DataSource, filters: JsonQLFilter[] | null, callback: any): void;
|
|
17
17
|
createViewElement(options: ChartCreateViewElementOptions): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
18
|
-
createDataTable(design: any, schema: Schema, dataSource: DataSource, data: any):
|
|
18
|
+
createDataTable(design: any, schema: Schema, dataSource: DataSource, data: any): never[];
|
|
19
19
|
getFilterableTables(design: any, schema: Schema): any[];
|
|
20
20
|
getPlaceholderIcon(): string;
|
|
21
21
|
}
|
|
@@ -32,7 +32,7 @@ const R = react_1.default.createElement;
|
|
|
32
32
|
const ui = __importStar(require("../../../UIComponents"));
|
|
33
33
|
const AxisComponent_1 = __importDefault(require("../../../axes/AxisComponent"));
|
|
34
34
|
const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
35
|
-
const
|
|
35
|
+
const expressions_ui_2 = require("@mwater/expressions-ui");
|
|
36
36
|
class ImageMosaicChartDesignerComponent extends react_1.default.Component {
|
|
37
37
|
// Updates design with the specified changes
|
|
38
38
|
updateDesign(changes) {
|
|
@@ -52,7 +52,7 @@ class ImageMosaicChartDesignerComponent extends react_1.default.Component {
|
|
|
52
52
|
return this.updateDesign({ imageAxis });
|
|
53
53
|
};
|
|
54
54
|
renderTable() {
|
|
55
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), ": ", R(
|
|
55
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), ": ", R(expressions_ui_2.TableSelectComponent, {
|
|
56
56
|
schema: this.props.schema,
|
|
57
57
|
value: this.props.design.table,
|
|
58
58
|
onChange: this.handleTableChange,
|
|
@@ -3,7 +3,7 @@ import { ExprUtils } from "@mwater/expressions";
|
|
|
3
3
|
import AxisBuilder from "../../../axes/AxisBuilder";
|
|
4
4
|
import { JsonQLFilter, WidgetScope } from "../../..";
|
|
5
5
|
import { LayeredChartDesign } from "./LayeredChartDesign";
|
|
6
|
-
import { JsonQLQuery } from "@mwater/jsonql";
|
|
6
|
+
import { JsonQLExpr, JsonQLQuery } from "@mwater/jsonql";
|
|
7
7
|
import { ChartOptions, PrimitiveArray, ChartTypes } from "billboard.js";
|
|
8
8
|
/** Data for a chart */
|
|
9
9
|
type C3ChartData = {
|
|
@@ -37,7 +37,7 @@ const ColorComponent_1 = __importDefault(require("../../../ColorComponent"));
|
|
|
37
37
|
const LayeredChartUtils = __importStar(require("./LayeredChartUtils"));
|
|
38
38
|
const LayeredChartCompiler_1 = __importDefault(require("./LayeredChartCompiler"));
|
|
39
39
|
const uiComponents = __importStar(require("../../../UIComponents"));
|
|
40
|
-
const
|
|
40
|
+
const expressions_ui_2 = require("@mwater/expressions-ui");
|
|
41
41
|
const ui = __importStar(require("@mwater/react-library/lib/bootstrap"));
|
|
42
42
|
const bootstrap_1 = require("@mwater/react-library/lib/bootstrap");
|
|
43
43
|
const PopoverHelpComponent_1 = __importDefault(require("@mwater/react-library/lib/PopoverHelpComponent"));
|
|
@@ -165,7 +165,7 @@ class LayeredChartLayerDesignerComponent extends react_1.default.Component {
|
|
|
165
165
|
}
|
|
166
166
|
renderTable() {
|
|
167
167
|
const layer = this.props.design.layers[this.props.index];
|
|
168
|
-
return R(uiComponents.SectionComponent, { icon: "fa-database", label: "Data Source" }, R(
|
|
168
|
+
return R(uiComponents.SectionComponent, { icon: "fa-database", label: "Data Source" }, R(expressions_ui_2.TableSelectComponent, {
|
|
169
169
|
schema: this.props.schema,
|
|
170
170
|
value: layer.table,
|
|
171
171
|
onChange: this.handleTableChange,
|
|
@@ -32,7 +32,7 @@ const R = react_1.default.createElement;
|
|
|
32
32
|
const uuid_1 = __importDefault(require("uuid"));
|
|
33
33
|
const ui = __importStar(require("@mwater/react-library/lib/bootstrap"));
|
|
34
34
|
const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
35
|
-
const
|
|
35
|
+
const expressions_ui_2 = require("@mwater/expressions-ui");
|
|
36
36
|
const AxisComponent_1 = __importDefault(require("../../../axes/AxisComponent"));
|
|
37
37
|
// Designer for overall chart. Has a special setup mode first time it is run
|
|
38
38
|
class PivotChartDesignerComponent extends react_1.default.Component {
|
|
@@ -76,7 +76,7 @@ class PivotChartDesignerComponent extends react_1.default.Component {
|
|
|
76
76
|
return this.updateDesign({ intersections });
|
|
77
77
|
};
|
|
78
78
|
renderTable() {
|
|
79
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), ": ", R(
|
|
79
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), ": ", R(expressions_ui_2.TableSelectComponent, {
|
|
80
80
|
schema: this.props.schema,
|
|
81
81
|
value: this.props.design.table,
|
|
82
82
|
onChange: this.handleTableChange,
|
|
@@ -32,8 +32,9 @@ export interface PivotChartLayoutCell {
|
|
|
32
32
|
text?: string;
|
|
33
33
|
align: "left" | "center" | "right";
|
|
34
34
|
/** section id of either a segment or intersection or blank area. Always a rectangle.
|
|
35
|
-
* Id is like intersection id if intersection, id of segment if segment
|
|
36
|
-
|
|
35
|
+
* Id is like intersection id if intersection, id of segment if segment. Undefined if doesn't
|
|
36
|
+
* exist yet. */
|
|
37
|
+
section?: string;
|
|
37
38
|
/** true if cell is on top edge of section */
|
|
38
39
|
sectionTop?: boolean;
|
|
39
40
|
/** true if cell is on bottom edge of section */
|
|
@@ -62,7 +62,7 @@ class PivotChartLayoutComponent extends react_1.default.Component {
|
|
|
62
62
|
layout: this.props.layout,
|
|
63
63
|
rowIndex,
|
|
64
64
|
columnIndex,
|
|
65
|
-
onHover: this.props.editable ? () => this.setState({ hoverSection: cell.section }) : undefined,
|
|
65
|
+
onHover: this.props.editable ? () => this.setState({ hoverSection: cell.section ?? null }) : undefined,
|
|
66
66
|
hoverSection: this.props.editable ? this.state.hoverSection : undefined,
|
|
67
67
|
onEditSection: this.props.onEditSection ? this.props.onEditSection.bind(null, cell.section) : undefined,
|
|
68
68
|
onSummarizeSegment: this.props.onSummarizeSegment
|
|
@@ -248,6 +248,9 @@ class LayoutCellComponent extends react_1.default.Component {
|
|
|
248
248
|
}
|
|
249
249
|
// Render an unconfigured cell
|
|
250
250
|
renderUnconfigured(cell) {
|
|
251
|
+
if (!cell.section) {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
251
254
|
return R("span", { style: { fontSize: "90%" } }, R("a", { className: "link-plain", onClick: this.props.onEditSection }, "Edit"), cell.summarize
|
|
252
255
|
? [
|
|
253
256
|
R("span", { className: "text-muted" }, " / "),
|
|
@@ -119,7 +119,7 @@ class PivotChartQueryBuilder {
|
|
|
119
119
|
const columnSegment = columnPath[i];
|
|
120
120
|
query.selects.push({
|
|
121
121
|
type: "select",
|
|
122
|
-
expr:
|
|
122
|
+
expr: compileSegmentAxis(columnSegment.valueAxis),
|
|
123
123
|
alias: `c${i}`
|
|
124
124
|
});
|
|
125
125
|
query.groupBy.push(i + 1 + rowPath.length);
|
|
@@ -234,18 +234,29 @@ class TableChart extends Chart_1.default {
|
|
|
234
234
|
}),
|
|
235
235
|
from: { type: "subquery", query, alias: "t" },
|
|
236
236
|
};
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
// Query for the data in question.
|
|
238
|
+
dataSource.performQuery(query, (error, data) => {
|
|
239
|
+
if (error) {
|
|
240
|
+
callback(error);
|
|
241
|
+
}
|
|
242
|
+
else if (totalColumns.length > 0) {
|
|
243
|
+
// Query for the summaries
|
|
239
244
|
dataSource.performQuery(summaryQuery, (error, summary) => {
|
|
240
|
-
|
|
245
|
+
if (error) {
|
|
246
|
+
callback(error);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
callback(error, { main: data, summary: summary[0] });
|
|
250
|
+
}
|
|
241
251
|
});
|
|
252
|
+
}
|
|
242
253
|
else
|
|
243
254
|
callback(error, { main: data });
|
|
244
255
|
});
|
|
245
256
|
}
|
|
246
257
|
// Create a view element for the chart
|
|
247
258
|
// Options include:
|
|
248
|
-
//
|
|
259
|
+
// p schema: schema to use
|
|
249
260
|
// dataSource: dataSource to use
|
|
250
261
|
// design: design of the chart
|
|
251
262
|
// data: results from queries
|
|
@@ -36,7 +36,7 @@ const AxisBuilder_1 = __importDefault(require("../../../axes/AxisBuilder"));
|
|
|
36
36
|
const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
37
37
|
const expressions_ui_2 = require("@mwater/expressions-ui");
|
|
38
38
|
const OrderingsComponent_1 = __importDefault(require("./OrderingsComponent"));
|
|
39
|
-
const
|
|
39
|
+
const expressions_ui_3 = require("@mwater/expressions-ui");
|
|
40
40
|
const ReorderableListComponent_1 = __importDefault(require("@mwater/react-library/lib/reorderable/ReorderableListComponent"));
|
|
41
41
|
const ui = __importStar(require("@mwater/react-library/lib/bootstrap"));
|
|
42
42
|
const valueFormatter_1 = require("../../../valueFormatter");
|
|
@@ -79,7 +79,7 @@ class TableChartDesignerComponent extends react_1.default.Component {
|
|
|
79
79
|
this.updateDesign({ columns });
|
|
80
80
|
};
|
|
81
81
|
renderTable() {
|
|
82
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), ": ", R(
|
|
82
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), ": ", R(expressions_ui_3.TableSelectComponent, {
|
|
83
83
|
schema: this.props.schema,
|
|
84
84
|
value: this.props.design.table,
|
|
85
85
|
onChange: this.handleTableChange,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DataSource, Schema } from "@mwater/expressions";
|
|
3
|
+
import { TableChartDesign } from "./TableChart";
|
|
3
4
|
export interface TableChartViewComponentProps {
|
|
4
5
|
/** Design of chart */
|
|
5
|
-
design:
|
|
6
|
+
design: TableChartDesign;
|
|
6
7
|
/** Data that the table has requested */
|
|
7
8
|
data: any;
|
|
8
9
|
/** Schema to use */
|
|
@@ -7,7 +7,6 @@ const prop_types_1 = __importDefault(require("prop-types"));
|
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const R = react_1.default.createElement;
|
|
10
|
-
const moment_1 = __importDefault(require("moment"));
|
|
11
10
|
const react_linkify_1 = __importDefault(require("react-linkify"));
|
|
12
11
|
const AxisBuilder_1 = __importDefault(require("../../../axes/AxisBuilder"));
|
|
13
12
|
const expressions_1 = require("@mwater/expressions");
|
|
@@ -149,7 +148,13 @@ class TableContentsComponent extends react_1.default.Component {
|
|
|
149
148
|
else {
|
|
150
149
|
// Parse if should be JSON
|
|
151
150
|
if (["image", "imagelist", "geometry", "text[]"].includes(exprType || "") && lodash_1.default.isString(value)) {
|
|
152
|
-
|
|
151
|
+
try {
|
|
152
|
+
value = JSON.parse(value);
|
|
153
|
+
}
|
|
154
|
+
catch (e) {
|
|
155
|
+
// Ignore as can happen when re-arranging columns
|
|
156
|
+
value = null;
|
|
157
|
+
}
|
|
153
158
|
}
|
|
154
159
|
if (column.backgroundColorAxis && row[`bc${columnIndex}`] != null) {
|
|
155
160
|
backgroundColor = axisBuilder.getValueColor(column.backgroundColorAxis, row[`bc${columnIndex}`]) ?? "#fff";
|
|
@@ -170,10 +175,10 @@ class TableContentsComponent extends react_1.default.Component {
|
|
|
170
175
|
node = exprUtils.stringifyExprLiteral(column.textAxis?.expr, value, this.context.locale);
|
|
171
176
|
break;
|
|
172
177
|
case "date":
|
|
173
|
-
node = (0,
|
|
178
|
+
node = (0, valueFormatter_1.formatValue)(exprType, value, column.format);
|
|
174
179
|
break;
|
|
175
180
|
case "datetime":
|
|
176
|
-
node = (0,
|
|
181
|
+
node = (0, valueFormatter_1.formatValue)(exprType, value, column.format);
|
|
177
182
|
break;
|
|
178
183
|
case "image":
|
|
179
184
|
node = this.renderImage(value.id);
|
|
@@ -8,7 +8,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const R = react_1.default.createElement;
|
|
9
9
|
const expressions_1 = require("@mwater/expressions");
|
|
10
10
|
const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
11
|
-
const
|
|
11
|
+
const expressions_ui_2 = require("@mwater/expressions-ui");
|
|
12
12
|
const valueFormatter_1 = require("../../valueFormatter");
|
|
13
13
|
const valueFormatter_2 = require("../../valueFormatter");
|
|
14
14
|
const bootstrap_1 = require("@mwater/react-library/lib/bootstrap");
|
|
@@ -61,7 +61,7 @@ class ExprItemEditorComponent extends react_1.default.Component {
|
|
|
61
61
|
}, lodash_1.default.map(formats, (format) => R("option", { key: format.value, value: format.value }, format.label))));
|
|
62
62
|
}
|
|
63
63
|
render() {
|
|
64
|
-
return R("div", { style: { paddingBottom: 200 } }, R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), ": ", R(
|
|
64
|
+
return R("div", { style: { paddingBottom: 200 } }, R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), ": ", R(expressions_ui_2.TableSelectComponent, {
|
|
65
65
|
schema: this.props.schema,
|
|
66
66
|
value: this.state.table,
|
|
67
67
|
onChange: this.handleTableChange
|