@mwater/visualization 5.0.0 → 5.0.1
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/MWaterContextComponent.js +1 -4
- package/lib/datagrids/DatagridComponent.d.ts +2 -0
- package/lib/datagrids/DatagridComponent.js +8 -2
- package/lib/datagrids/DatagridViewComponent.d.ts +2 -0
- package/lib/datagrids/DatagridViewComponent.js +3 -2
- package/lib/datagrids/LabeledExprGenerator.js +15 -0
- package/lib/dayjs.d.ts +2 -0
- package/lib/dayjs.js +9 -0
- package/lib/languages.js +5 -0
- package/lib/maps/DetailLevelSelectComponent.d.ts +1 -93
- package/lib/maps/Layer.js +7 -18
- package/lib/maps/MapComponent.js +1 -1
- package/lib/maps/RegionSelectComponent.d.ts +1 -33
- 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/charts/layered/LayeredChartCompiler.d.ts +1 -1
- 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/TableChartViewComponent.d.ts +2 -1
- package/lib/widgets/charts/table/TableChartViewComponent.js +9 -4
- package/package.json +8 -8
- package/src/MWaterAddRelatedIndicatorComponent.ts +1 -1
- package/src/MWaterContextComponent.ts +1 -4
- package/src/datagrids/DatagridComponent.ts +15 -1
- package/src/datagrids/DatagridViewComponent.ts +6 -2
- package/src/datagrids/LabeledExprGenerator.ts +15 -0
- package/src/dayjs.ts +5 -0
- package/src/languages.ts +5 -0
- package/src/maps/Layer.ts +6 -16
- package/src/maps/MapComponent.ts +1 -1
- package/src/maps/RasterMapViewComponent.ts +0 -1
- package/src/maps/VectorMapViewComponent.tsx +23 -36
- package/src/quickfilter/QuickfiltersDesignComponent.tsx +1 -1
- package/src/quickfilter/TextLiteralComponent.ts +4 -0
- package/src/valueFormatter.ts +54 -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/TableChartViewComponent.ts +10 -5
- package/stories/dashboards.js +3 -3
|
@@ -57,192 +57,8 @@ declare class EnumQuickfilterComponent extends React.Component<EnumQuickfilterCo
|
|
|
57
57
|
};
|
|
58
58
|
handleSingleChange: (val: any) => any;
|
|
59
59
|
handleMultiChange: (val: any) => any;
|
|
60
|
-
renderSingleSelect(options: any[]): React.FunctionComponentElement<Omit<
|
|
61
|
-
|
|
62
|
-
options?: import("react-select").OptionsOrGroups<unknown, import("react-select").GroupBase<unknown>> | undefined;
|
|
63
|
-
placeholder?: React.ReactNode;
|
|
64
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
65
|
-
styles?: import("react-select").StylesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
66
|
-
isLoading?: boolean | undefined;
|
|
67
|
-
isDisabled?: boolean | undefined;
|
|
68
|
-
isRtl?: boolean | undefined;
|
|
69
|
-
isMulti?: boolean | undefined;
|
|
70
|
-
controlShouldRenderValue?: boolean | undefined;
|
|
71
|
-
loadingMessage?: ((obj: {
|
|
72
|
-
inputValue: string;
|
|
73
|
-
}) => React.ReactNode) | undefined;
|
|
74
|
-
noOptionsMessage?: ((obj: {
|
|
75
|
-
inputValue: string;
|
|
76
|
-
}) => React.ReactNode) | undefined;
|
|
77
|
-
backspaceRemovesValue?: boolean | undefined;
|
|
78
|
-
blurInputOnSelect?: boolean | undefined;
|
|
79
|
-
captureMenuScroll?: boolean | undefined;
|
|
80
|
-
classNames?: import("react-select").ClassNamesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
81
|
-
closeMenuOnSelect?: boolean | undefined;
|
|
82
|
-
closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
|
|
83
|
-
components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<unknown, boolean, import("react-select").GroupBase<unknown>>> | undefined;
|
|
84
|
-
escapeClearsValue?: boolean | undefined;
|
|
85
|
-
filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<unknown>, inputValue: string) => boolean) | null | undefined;
|
|
86
|
-
formatGroupLabel?: ((group: import("react-select").GroupBase<unknown>) => React.ReactNode) | undefined;
|
|
87
|
-
getOptionLabel?: import("react-select").GetOptionLabel<unknown> | undefined;
|
|
88
|
-
getOptionValue?: import("react-select").GetOptionValue<unknown> | undefined;
|
|
89
|
-
isOptionDisabled?: ((option: unknown, selectValue: import("react-select").Options<unknown>) => boolean) | undefined;
|
|
90
|
-
isSearchable?: boolean | undefined;
|
|
91
|
-
minMenuHeight?: number | undefined;
|
|
92
|
-
maxMenuHeight?: number | undefined;
|
|
93
|
-
menuIsOpen?: boolean | undefined;
|
|
94
|
-
menuPlacement?: import("react-select").MenuPlacement | undefined;
|
|
95
|
-
menuPosition?: import("react-select").MenuPosition | undefined;
|
|
96
|
-
menuShouldBlockScroll?: boolean | undefined;
|
|
97
|
-
menuShouldScrollIntoView?: boolean | undefined;
|
|
98
|
-
openMenuOnFocus?: boolean | undefined;
|
|
99
|
-
openMenuOnClick?: boolean | undefined;
|
|
100
|
-
pageSize?: number | undefined;
|
|
101
|
-
screenReaderStatus?: ((obj: {
|
|
102
|
-
count: number;
|
|
103
|
-
}) => string) | undefined;
|
|
104
|
-
tabSelectsValue?: boolean | undefined;
|
|
105
|
-
unstyled?: boolean | undefined;
|
|
106
|
-
} & {}, "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"> & {
|
|
107
|
-
tabIndex?: number | undefined;
|
|
108
|
-
options?: import("react-select").OptionsOrGroups<unknown, import("react-select").GroupBase<unknown>> | undefined;
|
|
109
|
-
placeholder?: React.ReactNode;
|
|
110
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
111
|
-
styles?: import("react-select").StylesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
112
|
-
isLoading?: boolean | undefined;
|
|
113
|
-
isDisabled?: boolean | undefined;
|
|
114
|
-
isRtl?: boolean | undefined;
|
|
115
|
-
isMulti?: boolean | undefined;
|
|
116
|
-
controlShouldRenderValue?: boolean | undefined;
|
|
117
|
-
loadingMessage?: ((obj: {
|
|
118
|
-
inputValue: string;
|
|
119
|
-
}) => React.ReactNode) | undefined;
|
|
120
|
-
noOptionsMessage?: ((obj: {
|
|
121
|
-
inputValue: string;
|
|
122
|
-
}) => React.ReactNode) | undefined;
|
|
123
|
-
backspaceRemovesValue?: boolean | undefined;
|
|
124
|
-
blurInputOnSelect?: boolean | undefined;
|
|
125
|
-
captureMenuScroll?: boolean | undefined;
|
|
126
|
-
classNames?: import("react-select").ClassNamesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
127
|
-
closeMenuOnSelect?: boolean | undefined;
|
|
128
|
-
closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
|
|
129
|
-
components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<unknown, boolean, import("react-select").GroupBase<unknown>>> | undefined;
|
|
130
|
-
escapeClearsValue?: boolean | undefined;
|
|
131
|
-
filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<unknown>, inputValue: string) => boolean) | null | undefined;
|
|
132
|
-
formatGroupLabel?: ((group: import("react-select").GroupBase<unknown>) => React.ReactNode) | undefined;
|
|
133
|
-
getOptionLabel?: import("react-select").GetOptionLabel<unknown> | undefined;
|
|
134
|
-
getOptionValue?: import("react-select").GetOptionValue<unknown> | undefined;
|
|
135
|
-
isOptionDisabled?: ((option: unknown, selectValue: import("react-select").Options<unknown>) => boolean) | undefined;
|
|
136
|
-
isSearchable?: boolean | undefined;
|
|
137
|
-
minMenuHeight?: number | undefined;
|
|
138
|
-
maxMenuHeight?: number | undefined;
|
|
139
|
-
menuIsOpen?: boolean | undefined;
|
|
140
|
-
menuPlacement?: import("react-select").MenuPlacement | undefined;
|
|
141
|
-
menuPosition?: import("react-select").MenuPosition | undefined;
|
|
142
|
-
menuShouldBlockScroll?: boolean | undefined;
|
|
143
|
-
menuShouldScrollIntoView?: boolean | undefined;
|
|
144
|
-
openMenuOnFocus?: boolean | undefined;
|
|
145
|
-
openMenuOnClick?: boolean | undefined;
|
|
146
|
-
pageSize?: number | undefined;
|
|
147
|
-
screenReaderStatus?: ((obj: {
|
|
148
|
-
count: number;
|
|
149
|
-
}) => string) | undefined;
|
|
150
|
-
tabSelectsValue?: boolean | undefined;
|
|
151
|
-
unstyled?: boolean | undefined;
|
|
152
|
-
} & {}> & import("react-select/dist/declarations/src/useStateManager").StateManagerAdditionalProps<unknown> & React.RefAttributes<import("react-select/dist/declarations/src/Select").default<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
|
|
153
|
-
renderMultiSelect(options: any[]): 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"> & {
|
|
154
|
-
tabIndex?: number | undefined;
|
|
155
|
-
options?: import("react-select").OptionsOrGroups<unknown, import("react-select").GroupBase<unknown>> | undefined;
|
|
156
|
-
placeholder?: React.ReactNode;
|
|
157
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
158
|
-
styles?: import("react-select").StylesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
159
|
-
isLoading?: boolean | undefined;
|
|
160
|
-
isDisabled?: boolean | undefined;
|
|
161
|
-
isRtl?: boolean | undefined;
|
|
162
|
-
isMulti?: boolean | undefined;
|
|
163
|
-
controlShouldRenderValue?: boolean | undefined;
|
|
164
|
-
loadingMessage?: ((obj: {
|
|
165
|
-
inputValue: string;
|
|
166
|
-
}) => React.ReactNode) | undefined;
|
|
167
|
-
noOptionsMessage?: ((obj: {
|
|
168
|
-
inputValue: string;
|
|
169
|
-
}) => React.ReactNode) | undefined;
|
|
170
|
-
backspaceRemovesValue?: boolean | undefined;
|
|
171
|
-
blurInputOnSelect?: boolean | undefined;
|
|
172
|
-
captureMenuScroll?: boolean | undefined;
|
|
173
|
-
classNames?: import("react-select").ClassNamesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
174
|
-
closeMenuOnSelect?: boolean | undefined;
|
|
175
|
-
closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
|
|
176
|
-
components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<unknown, boolean, import("react-select").GroupBase<unknown>>> | undefined;
|
|
177
|
-
escapeClearsValue?: boolean | undefined;
|
|
178
|
-
filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<unknown>, inputValue: string) => boolean) | null | undefined;
|
|
179
|
-
formatGroupLabel?: ((group: import("react-select").GroupBase<unknown>) => React.ReactNode) | undefined;
|
|
180
|
-
getOptionLabel?: import("react-select").GetOptionLabel<unknown> | undefined;
|
|
181
|
-
getOptionValue?: import("react-select").GetOptionValue<unknown> | undefined;
|
|
182
|
-
isOptionDisabled?: ((option: unknown, selectValue: import("react-select").Options<unknown>) => boolean) | undefined;
|
|
183
|
-
isSearchable?: boolean | undefined;
|
|
184
|
-
minMenuHeight?: number | undefined;
|
|
185
|
-
maxMenuHeight?: number | undefined;
|
|
186
|
-
menuIsOpen?: boolean | undefined;
|
|
187
|
-
menuPlacement?: import("react-select").MenuPlacement | undefined;
|
|
188
|
-
menuPosition?: import("react-select").MenuPosition | undefined;
|
|
189
|
-
menuShouldBlockScroll?: boolean | undefined;
|
|
190
|
-
menuShouldScrollIntoView?: boolean | undefined;
|
|
191
|
-
openMenuOnFocus?: boolean | undefined;
|
|
192
|
-
openMenuOnClick?: boolean | undefined;
|
|
193
|
-
pageSize?: number | undefined;
|
|
194
|
-
screenReaderStatus?: ((obj: {
|
|
195
|
-
count: number;
|
|
196
|
-
}) => string) | undefined;
|
|
197
|
-
tabSelectsValue?: boolean | undefined;
|
|
198
|
-
unstyled?: boolean | undefined;
|
|
199
|
-
} & {}, "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"> & {
|
|
200
|
-
tabIndex?: number | undefined;
|
|
201
|
-
options?: import("react-select").OptionsOrGroups<unknown, import("react-select").GroupBase<unknown>> | undefined;
|
|
202
|
-
placeholder?: React.ReactNode;
|
|
203
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
204
|
-
styles?: import("react-select").StylesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
205
|
-
isLoading?: boolean | undefined;
|
|
206
|
-
isDisabled?: boolean | undefined;
|
|
207
|
-
isRtl?: boolean | undefined;
|
|
208
|
-
isMulti?: boolean | undefined;
|
|
209
|
-
controlShouldRenderValue?: boolean | undefined;
|
|
210
|
-
loadingMessage?: ((obj: {
|
|
211
|
-
inputValue: string;
|
|
212
|
-
}) => React.ReactNode) | undefined;
|
|
213
|
-
noOptionsMessage?: ((obj: {
|
|
214
|
-
inputValue: string;
|
|
215
|
-
}) => React.ReactNode) | undefined;
|
|
216
|
-
backspaceRemovesValue?: boolean | undefined;
|
|
217
|
-
blurInputOnSelect?: boolean | undefined;
|
|
218
|
-
captureMenuScroll?: boolean | undefined;
|
|
219
|
-
classNames?: import("react-select").ClassNamesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
220
|
-
closeMenuOnSelect?: boolean | undefined;
|
|
221
|
-
closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
|
|
222
|
-
components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<unknown, boolean, import("react-select").GroupBase<unknown>>> | undefined;
|
|
223
|
-
escapeClearsValue?: boolean | undefined;
|
|
224
|
-
filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<unknown>, inputValue: string) => boolean) | null | undefined;
|
|
225
|
-
formatGroupLabel?: ((group: import("react-select").GroupBase<unknown>) => React.ReactNode) | undefined;
|
|
226
|
-
getOptionLabel?: import("react-select").GetOptionLabel<unknown> | undefined;
|
|
227
|
-
getOptionValue?: import("react-select").GetOptionValue<unknown> | undefined;
|
|
228
|
-
isOptionDisabled?: ((option: unknown, selectValue: import("react-select").Options<unknown>) => boolean) | undefined;
|
|
229
|
-
isSearchable?: boolean | undefined;
|
|
230
|
-
minMenuHeight?: number | undefined;
|
|
231
|
-
maxMenuHeight?: number | undefined;
|
|
232
|
-
menuIsOpen?: boolean | undefined;
|
|
233
|
-
menuPlacement?: import("react-select").MenuPlacement | undefined;
|
|
234
|
-
menuPosition?: import("react-select").MenuPosition | undefined;
|
|
235
|
-
menuShouldBlockScroll?: boolean | undefined;
|
|
236
|
-
menuShouldScrollIntoView?: boolean | undefined;
|
|
237
|
-
openMenuOnFocus?: boolean | undefined;
|
|
238
|
-
openMenuOnClick?: boolean | undefined;
|
|
239
|
-
pageSize?: number | undefined;
|
|
240
|
-
screenReaderStatus?: ((obj: {
|
|
241
|
-
count: number;
|
|
242
|
-
}) => string) | undefined;
|
|
243
|
-
tabSelectsValue?: boolean | undefined;
|
|
244
|
-
unstyled?: boolean | undefined;
|
|
245
|
-
} & {}> & import("react-select/dist/declarations/src/useStateManager").StateManagerAdditionalProps<unknown> & React.RefAttributes<import("react-select/dist/declarations/src/Select").default<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
|
|
60
|
+
renderSingleSelect(options: any[]): 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> & React.RefAttributes<import("react-select/dist/declarations/src/Select").default<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
|
|
61
|
+
renderMultiSelect(options: any[]): 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> & React.RefAttributes<import("react-select/dist/declarations/src/Select").default<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
|
|
246
62
|
render(): React.DetailedReactHTMLElement<{
|
|
247
63
|
style: {
|
|
248
64
|
display: "inline-block";
|
|
@@ -152,7 +152,7 @@ class QuickfilterDesignComponent extends react_1.default.Component {
|
|
|
152
152
|
table: this.state.table,
|
|
153
153
|
value: this.props.design.expr,
|
|
154
154
|
onChange: this.handleExprChange,
|
|
155
|
-
types: ["enum", "text", "enumset", "date", "datetime", "id[]", "text[]"]
|
|
155
|
+
types: ["enum", "text", "enumset", "date", "datetime", "id[]", "text[]"],
|
|
156
156
|
}))), this.props.design.expr
|
|
157
157
|
? R("div", { className: "mb-3", key: "label" }, R("label", { className: "text-muted" }, "Label"), R("input", {
|
|
158
158
|
type: "text",
|
|
@@ -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") {
|
|
@@ -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 = {
|
|
@@ -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
|
|
@@ -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 */
|