@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
|
@@ -17,6 +17,7 @@ const DatagridUtils_1 = __importDefault(require("./DatagridUtils"));
|
|
|
17
17
|
const QuickfiltersComponent_1 = __importDefault(require("../quickfilter/QuickfiltersComponent"));
|
|
18
18
|
const QuickfilterCompiler_1 = __importDefault(require("../quickfilter/QuickfilterCompiler"));
|
|
19
19
|
const FindReplaceModalComponent_1 = __importDefault(require("./FindReplaceModalComponent"));
|
|
20
|
+
const d3_format_1 = require("d3-format");
|
|
20
21
|
// Datagrid with decorations
|
|
21
22
|
// See README.md for description of datagrid format
|
|
22
23
|
// Design should be cleaned already before being passed in (see DatagridUtils)
|
|
@@ -30,18 +31,44 @@ class DatagridComponent extends react_1.default.Component {
|
|
|
30
31
|
editingDesign: false,
|
|
31
32
|
cellEditingEnabled: false,
|
|
32
33
|
quickfiltersHeight: null,
|
|
33
|
-
quickfiltersValues: null
|
|
34
|
+
quickfiltersValues: null,
|
|
35
|
+
refreshKey: 1
|
|
34
36
|
};
|
|
35
37
|
}
|
|
36
38
|
reload() {
|
|
37
|
-
|
|
39
|
+
this.datagridView?.reload();
|
|
38
40
|
}
|
|
39
41
|
componentDidMount() {
|
|
40
|
-
|
|
42
|
+
this.loadRowCount();
|
|
43
|
+
this.updateHeight();
|
|
41
44
|
}
|
|
42
|
-
componentDidUpdate() {
|
|
43
|
-
|
|
45
|
+
componentDidUpdate(prevProps, prevState) {
|
|
46
|
+
if (!lodash_1.default.isEqual(prevProps.design, this.props.design) || !lodash_1.default.isEqual(prevState.quickfiltersValues, this.state.quickfiltersValues) || prevState.refreshKey !== this.state.refreshKey) {
|
|
47
|
+
this.loadRowCount();
|
|
48
|
+
}
|
|
49
|
+
this.updateHeight();
|
|
50
|
+
}
|
|
51
|
+
loadRowCount() {
|
|
52
|
+
if (!this.props.design.showNumRows) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
let filters = this.props.filters || [];
|
|
56
|
+
// Compile quickfilters
|
|
57
|
+
filters = filters.concat(this.getQuickfilterFilters());
|
|
58
|
+
this.props.datagridDataSource.countRows(this.props.design, filters, (error, numRows) => {
|
|
59
|
+
if (error) {
|
|
60
|
+
console.error(error);
|
|
61
|
+
alert(T("Error loading data"));
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
console.log(numRows);
|
|
65
|
+
this.setState({ numRows });
|
|
66
|
+
});
|
|
44
67
|
}
|
|
68
|
+
handleRefreshData = () => {
|
|
69
|
+
this.props.dataSource.clearCache?.();
|
|
70
|
+
this.setState({ refreshKey: this.state.refreshKey + 1 });
|
|
71
|
+
};
|
|
45
72
|
updateHeight() {
|
|
46
73
|
// Calculate quickfilters height
|
|
47
74
|
if (this.quickfilters) {
|
|
@@ -159,7 +186,7 @@ class DatagridComponent extends react_1.default.Component {
|
|
|
159
186
|
}, T("Find/Replace"));
|
|
160
187
|
}
|
|
161
188
|
renderTitleBar() {
|
|
162
|
-
return R("div", { style: { position: "absolute", top: 0, left: 0, right: 0, height: 40, padding: 4 } }, R("div", { style: { float: "right" } }, this.renderFindReplace(), this.renderCellEdit(), this.renderEditButton(), this.props.extraTitleButtonsElem), this.props.titleElem);
|
|
189
|
+
return R("div", { style: { position: "absolute", top: 0, left: 0, right: 0, height: 40, padding: 4 } }, R("div", { style: { float: "right" } }, this.props.design.showNumRows && this.state.numRows ? R("small", { className: 'text-muted text-sm' }, `${(0, d3_format_1.format)(',')(this.state.numRows)} rows`) : undefined, this.renderFindReplace(), this.renderCellEdit(), this.renderEditButton(), R("a", { key: "refresh", className: "btn btn-link btn-sm", onClick: this.handleRefreshData }, R("span", { className: "fas fa-sync" }), R("span", { className: "hide-600px" }, " Refresh")), this.props.extraTitleButtonsElem), this.props.titleElem);
|
|
163
190
|
}
|
|
164
191
|
renderQuickfilter() {
|
|
165
192
|
return R("div", {
|
|
@@ -247,6 +274,7 @@ class DatagridComponent extends react_1.default.Component {
|
|
|
247
274
|
onRowDoubleClick: this.props.onRowDoubleClick,
|
|
248
275
|
canEditExpr: this.state.cellEditingEnabled ? this.props.canEditExpr : undefined,
|
|
249
276
|
updateExprValues: this.state.cellEditingEnabled ? this.props.updateExprValues : undefined,
|
|
277
|
+
refreshKey: this.state.refreshKey
|
|
250
278
|
});
|
|
251
279
|
}
|
|
252
280
|
else if (this.props.onDesignChange) {
|
|
@@ -4,6 +4,7 @@ import { QuickfiltersDataSource } from "../quickfilter/QuickfiltersDataSource";
|
|
|
4
4
|
export default class DatagridDataSource {
|
|
5
5
|
/** Gets the rows specified */
|
|
6
6
|
getRows(design: DatagridDesign, offset: number, limit: number, filters: JsonQLFilter[] | undefined, callback: (error: any, rows: Row[]) => void): void;
|
|
7
|
+
countRows(design: DatagridDesign, filters: JsonQLFilter[] | undefined, callback: (error: any, numRows: number) => void): void;
|
|
7
8
|
/** Gets the quickfilters data source */
|
|
8
9
|
getQuickfiltersDataSource(): QuickfiltersDataSource;
|
|
9
10
|
}
|
|
@@ -5,6 +5,9 @@ class DatagridDataSource {
|
|
|
5
5
|
getRows(design, offset, limit, filters, callback) {
|
|
6
6
|
throw new Error("Not implemented");
|
|
7
7
|
}
|
|
8
|
+
countRows(design, filters, callback) {
|
|
9
|
+
throw new Error("Not implemented");
|
|
10
|
+
}
|
|
8
11
|
/** Gets the quickfilters data source */
|
|
9
12
|
getQuickfiltersDataSource() {
|
|
10
13
|
throw new Error("Not implemented");
|
|
@@ -23,6 +23,8 @@ export interface DatagridDesign {
|
|
|
23
23
|
showRowNumbers?: boolean;
|
|
24
24
|
/** array of global filters. See below. */
|
|
25
25
|
globalFilters?: DatagridDesignGlobalFilter[];
|
|
26
|
+
/** true to show number of rows */
|
|
27
|
+
showNumRows?: boolean;
|
|
26
28
|
}
|
|
27
29
|
export interface DatagridDesignColumn {
|
|
28
30
|
/** unique id of the column */
|
|
@@ -41,7 +41,7 @@ const OrderBysDesignerComponent_1 = __importDefault(require("./OrderBysDesignerC
|
|
|
41
41
|
const ReorderableListComponent_1 = __importDefault(require("@mwater/react-library/lib/reorderable/ReorderableListComponent"));
|
|
42
42
|
const QuickfiltersDesignComponent_1 = __importDefault(require("../quickfilter/QuickfiltersDesignComponent"));
|
|
43
43
|
const LabeledExprGenerator_1 = __importDefault(require("./LabeledExprGenerator"));
|
|
44
|
-
const
|
|
44
|
+
const expressions_ui_3 = require("@mwater/expressions-ui");
|
|
45
45
|
const uuid_1 = __importDefault(require("uuid"));
|
|
46
46
|
const update_object_1 = __importDefault(require("update-object"));
|
|
47
47
|
const ui = __importStar(require("@mwater/react-library/lib/bootstrap"));
|
|
@@ -140,7 +140,7 @@ class DatagridDesignerComponent extends react_1.default.Component {
|
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
142
|
render() {
|
|
143
|
-
return R("div", null, R("label", null, T("Data Source:")), R(
|
|
143
|
+
return R("div", null, R("label", null, T("Data Source:")), R(expressions_ui_3.TableSelectComponent, {
|
|
144
144
|
schema: this.props.schema,
|
|
145
145
|
value: this.props.design.table,
|
|
146
146
|
onChange: this.handleTableChange
|
|
@@ -158,6 +158,7 @@ function DatagridOptionsComponent(props) {
|
|
|
158
158
|
}, []);
|
|
159
159
|
return react_1.default.createElement("div", null,
|
|
160
160
|
react_1.default.createElement(ui.Checkbox, { value: props.design.showRowNumbers, onChange: (showRowNumbers) => props.onDesignChange({ ...props.design, showRowNumbers }) }, T("Show row numbers")),
|
|
161
|
+
react_1.default.createElement(ui.Checkbox, { value: props.design.showNumRows, onChange: (showNumRows) => props.onDesignChange({ ...props.design, showNumRows }) }, T("Show number of rows")),
|
|
161
162
|
react_1.default.createElement(ui.FormGroup, { label: T("Language"), hint: T("Preferred language of the datagrid") },
|
|
162
163
|
react_1.default.createElement(react_select_1.default, { value: localeOptions.find(opt => opt.value == (props.design.locale || "en")) || null, options: localeOptions, onChange: (locale) => props.onDesignChange({ ...props.design, locale: locale.value }) })));
|
|
163
164
|
}
|
|
@@ -25,6 +25,8 @@ export interface DatagridViewComponentProps {
|
|
|
25
25
|
onRowDoubleClick?: (tableId: string, rowId: any, rowIndex: number) => void;
|
|
26
26
|
/** Called when a row is clicked with (tableId, rowId, rowIndex) */
|
|
27
27
|
onRowClick?: (tableId: string, rowId: any, rowIndex: number) => void;
|
|
28
|
+
/** Change to force a refresh */
|
|
29
|
+
refreshKey?: any;
|
|
28
30
|
}
|
|
29
31
|
/** Update to one row expression value */
|
|
30
32
|
export interface RowUpdate {
|
|
@@ -31,8 +31,8 @@ class DatagridViewComponent extends react_1.default.Component {
|
|
|
31
31
|
componentWillReceiveProps(nextProps) {
|
|
32
32
|
// If design or filters changed, delete all rows
|
|
33
33
|
// TODO won't this reload on column resize?
|
|
34
|
-
if (!lodash_1.default.isEqual(nextProps.design, this.props.design) || !lodash_1.default.isEqual(nextProps.filters, this.props.filters)) {
|
|
35
|
-
|
|
34
|
+
if (!lodash_1.default.isEqual(nextProps.design, this.props.design) || !lodash_1.default.isEqual(nextProps.filters, this.props.filters) || nextProps.refreshKey !== this.props.refreshKey) {
|
|
35
|
+
this.setState({ rows: [], entirelyLoaded: false });
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
// Loads more rows because the placeholder last row has been rendered
|
|
@@ -314,7 +314,8 @@ class DatagridViewComponent extends react_1.default.Component {
|
|
|
314
314
|
onRowDoubleClick: this.handleRowDoubleClick,
|
|
315
315
|
onRowClick: this.handleRowClick,
|
|
316
316
|
isColumnResizing: false,
|
|
317
|
-
onColumnResizeEndCallback: this.handleColumnResize
|
|
317
|
+
onColumnResizeEndCallback: this.handleColumnResize,
|
|
318
|
+
touchScrollEnabled: true
|
|
318
319
|
}, this.renderColumns());
|
|
319
320
|
}
|
|
320
321
|
}
|
|
@@ -14,6 +14,7 @@ export default class DirectDatagridDataSource implements DatagridDataSource {
|
|
|
14
14
|
});
|
|
15
15
|
/** Gets the rows specified */
|
|
16
16
|
getRows(design: DatagridDesign, offset: number, limit: number, filters: JsonQLFilter[] | undefined, callback: (error: any, rows: Row[]) => void): void;
|
|
17
|
+
countRows(design: DatagridDesign, filters: JsonQLFilter[] | undefined, callback: (error: any, numRows: number) => void): void;
|
|
17
18
|
getQuickfiltersDataSource(): {
|
|
18
19
|
getValues: (index: any, expr: any, filters: any, offset: any, limit: any, callback: any) => void;
|
|
19
20
|
};
|
|
@@ -28,6 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const DatagridQueryBuilder_1 = __importDefault(require("./DatagridQueryBuilder"));
|
|
30
30
|
const QuickfilterUtils = __importStar(require("../quickfilter/QuickfilterUtils"));
|
|
31
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
31
32
|
/** Uses direct DataSource queries */
|
|
32
33
|
class DirectDatagridDataSource {
|
|
33
34
|
options;
|
|
@@ -49,6 +50,31 @@ class DirectDatagridDataSource {
|
|
|
49
50
|
});
|
|
50
51
|
return this.options.dataSource.performQuery(query, callback);
|
|
51
52
|
}
|
|
53
|
+
countRows(design, filters, callback) {
|
|
54
|
+
const queryBuilder = new DatagridQueryBuilder_1.default(this.options.schema);
|
|
55
|
+
// Create query to get the page of rows at the specific offset
|
|
56
|
+
const query = queryBuilder.createQuery(design, {
|
|
57
|
+
extraFilters: filters
|
|
58
|
+
});
|
|
59
|
+
const countQuery = {
|
|
60
|
+
...lodash_1.default.omit(query, 'orderBy'),
|
|
61
|
+
selects: [
|
|
62
|
+
{
|
|
63
|
+
type: 'select',
|
|
64
|
+
expr: {
|
|
65
|
+
type: 'op',
|
|
66
|
+
op: 'count',
|
|
67
|
+
exprs: []
|
|
68
|
+
},
|
|
69
|
+
alias: 'cnt'
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
};
|
|
73
|
+
console.log(countQuery);
|
|
74
|
+
return this.options.dataSource.performQuery(countQuery, (error, rows) => {
|
|
75
|
+
callback(error, rows?.[0]?.cnt);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
52
78
|
// Gets the quickfilters data source
|
|
53
79
|
getQuickfiltersDataSource() {
|
|
54
80
|
return {
|
|
@@ -92,6 +92,21 @@ class LabeledExprGenerator {
|
|
|
92
92
|
}
|
|
93
93
|
];
|
|
94
94
|
}
|
|
95
|
+
else if (column.idTable.match(/^custom./)) { // Support cascading ref question
|
|
96
|
+
return this.schema
|
|
97
|
+
.getColumns(column.idTable)
|
|
98
|
+
.filter((c) => c.id[0] !== "_")
|
|
99
|
+
.map((c) => ({
|
|
100
|
+
expr: {
|
|
101
|
+
type: "scalar",
|
|
102
|
+
table,
|
|
103
|
+
joins: [column.id],
|
|
104
|
+
expr: { type: "field", table: column.idTable, column: c.id }
|
|
105
|
+
},
|
|
106
|
+
label: `${createLabel(column)} > ${createLabel(c)}`,
|
|
107
|
+
joins
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
95
110
|
else {
|
|
96
111
|
// Use label, code, full name, or name of dest table
|
|
97
112
|
const destTable = this.schema.getTable(column.idTable);
|
|
@@ -18,6 +18,7 @@ export default class ServerDatagridDataSource extends DatagridDataSource {
|
|
|
18
18
|
options: ServerDatagridDataSourceOptions;
|
|
19
19
|
constructor(options: ServerDatagridDataSourceOptions);
|
|
20
20
|
getRows(design: DatagridDesign, offset: any, limit: any, filters: any, callback: any): JQuery.jqXHR<any>;
|
|
21
|
+
countRows(design: DatagridDesign, filters: any, callback: any): JQuery.jqXHR<any>;
|
|
21
22
|
getQuickfiltersDataSource(): ServerQuickfilterDataSource;
|
|
22
23
|
}
|
|
23
24
|
interface ServerQuickfilterDataSourceOptions {
|
|
@@ -40,6 +40,21 @@ class ServerDatagridDataSource extends DatagridDataSource_1.default {
|
|
|
40
40
|
return callback(new Error(xhr.responseText));
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
+
countRows(design, filters, callback) {
|
|
44
|
+
const query = {
|
|
45
|
+
client: this.options.client,
|
|
46
|
+
share: this.options.share,
|
|
47
|
+
filters: (0, compressJson_1.default)(filters),
|
|
48
|
+
rev: this.options.rev,
|
|
49
|
+
};
|
|
50
|
+
const url = this.options.apiUrl + `datagrids/${this.options.datagridId}/summary?` + querystring_1.default.stringify(query);
|
|
51
|
+
return jquery_1.default.getJSON(url, (data) => {
|
|
52
|
+
return callback(null, data?.[0]?.cnt);
|
|
53
|
+
}).fail((xhr) => {
|
|
54
|
+
console.log(xhr.responseText);
|
|
55
|
+
return callback(new Error(xhr.responseText));
|
|
56
|
+
});
|
|
57
|
+
}
|
|
43
58
|
getQuickfiltersDataSource() {
|
|
44
59
|
return new ServerQuickfilterDataSource(this.options);
|
|
45
60
|
}
|
package/lib/dayjs.d.ts
ADDED
package/lib/dayjs.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
7
|
+
const localizedFormat_1 = __importDefault(require("dayjs/plugin/localizedFormat"));
|
|
8
|
+
dayjs_1.default.extend(localizedFormat_1.default);
|
|
9
|
+
exports.default = dayjs_1.default;
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export { default as LeafletMapComponent, MapBounds, TileLayer, GeoJsonLayer, Map
|
|
|
2
2
|
export { default as DateRangeComponent } from "./DateRangeComponent";
|
|
3
3
|
export { default as RegionSelectComponent } from "./maps/RegionSelectComponent";
|
|
4
4
|
export * from "./datagrids/DatagridDesign";
|
|
5
|
-
export { default as TableSelectComponent } from "./TableSelectComponent";
|
|
6
5
|
export * from "./JsonQLFilter";
|
|
7
6
|
export { default as DashboardComponent } from "./dashboards/DashboardComponent";
|
|
8
7
|
export { default as DashboardDataSource } from "./dashboards/DashboardDataSource";
|
package/lib/index.js
CHANGED
|
@@ -17,8 +17,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.RichTextComponent = exports.AxisColorEditorComponent = exports.MarkerSymbolSelectComponent = exports.DetailLevelSelectComponent = exports.LayoutManager = exports.LabeledExprGenerator = exports.DirectDatagridDataSource = exports.ServerDatagridDataSource = exports.DirectMapDataSource = exports.ServerMapDataSource = exports.ServerDashboardDataSource = exports.DatagridViewComponent = exports.DatagridComponent = exports.ColorSchemeFactory = exports.AxisBuilder = exports.WidgetScopesViewComponent = exports.WidgetScoper = exports.ChartViewComponent = exports.ImageMosaicChart = exports.CalendarChart = exports.TableChart = exports.LayeredChart = exports.CheckboxComponent = exports.RadioButtonComponent = exports.VerticalLayoutComponent = exports.MapComponent = exports.MapDesignerComponent = exports.LayerFactory = exports.UtfGridLayer = exports.BingLayer = exports.DashboardViewComponent = exports.UndoStack = exports.setMapTilerApiKey = exports.DirectWidgetDataSource = exports.mWaterLoader = exports.MWaterContextComponent = exports.MWaterLoaderComponent = exports.languages = exports.DatagridUtils = exports.Widget = exports.WidgetFactory = exports.LocaleContextInjector = exports.compressJson = exports.DirectDashboardDataSource = exports.DashboardDataSource = exports.DashboardComponent = exports.
|
|
21
|
-
exports.OptionListComponent = exports.ToggleEditComponent = exports.QuickfilterCompiler = exports.DropdownWidgetComponent =
|
|
20
|
+
exports.ItemsHtmlConverter = exports.RichTextComponent = exports.AxisColorEditorComponent = exports.MarkerSymbolSelectComponent = exports.DetailLevelSelectComponent = exports.LayoutManager = exports.LabeledExprGenerator = exports.DirectDatagridDataSource = exports.ServerDatagridDataSource = exports.DirectMapDataSource = exports.ServerMapDataSource = exports.ServerDashboardDataSource = exports.DatagridViewComponent = exports.DatagridComponent = exports.ColorSchemeFactory = exports.AxisBuilder = exports.WidgetScopesViewComponent = exports.WidgetScoper = exports.ChartViewComponent = exports.ImageMosaicChart = exports.CalendarChart = exports.TableChart = exports.LayeredChart = exports.CheckboxComponent = exports.RadioButtonComponent = exports.VerticalLayoutComponent = exports.MapComponent = exports.MapDesignerComponent = exports.LayerFactory = exports.UtfGridLayer = exports.BingLayer = exports.DashboardViewComponent = exports.UndoStack = exports.setMapTilerApiKey = exports.DirectWidgetDataSource = exports.mWaterLoader = exports.MWaterContextComponent = exports.MWaterLoaderComponent = exports.languages = exports.DatagridUtils = exports.Widget = exports.WidgetFactory = exports.LocaleContextInjector = exports.compressJson = exports.DirectDashboardDataSource = exports.DashboardDataSource = exports.DashboardComponent = exports.RegionSelectComponent = exports.DateRangeComponent = exports.LeafletMapComponent = void 0;
|
|
21
|
+
exports.OptionListComponent = exports.ToggleEditComponent = exports.QuickfilterCompiler = exports.DropdownWidgetComponent = void 0;
|
|
22
22
|
var LeafletMapComponent_1 = require("./maps/LeafletMapComponent");
|
|
23
23
|
Object.defineProperty(exports, "LeafletMapComponent", { enumerable: true, get: function () { return __importDefault(LeafletMapComponent_1).default; } });
|
|
24
24
|
var DateRangeComponent_1 = require("./DateRangeComponent");
|
|
@@ -26,8 +26,6 @@ Object.defineProperty(exports, "DateRangeComponent", { enumerable: true, get: fu
|
|
|
26
26
|
var RegionSelectComponent_1 = require("./maps/RegionSelectComponent");
|
|
27
27
|
Object.defineProperty(exports, "RegionSelectComponent", { enumerable: true, get: function () { return __importDefault(RegionSelectComponent_1).default; } });
|
|
28
28
|
__exportStar(require("./datagrids/DatagridDesign"), exports);
|
|
29
|
-
var TableSelectComponent_1 = require("./TableSelectComponent");
|
|
30
|
-
Object.defineProperty(exports, "TableSelectComponent", { enumerable: true, get: function () { return __importDefault(TableSelectComponent_1).default; } });
|
|
31
29
|
__exportStar(require("./JsonQLFilter"), exports);
|
|
32
30
|
var DashboardComponent_1 = require("./dashboards/DashboardComponent");
|
|
33
31
|
Object.defineProperty(exports, "DashboardComponent", { enumerable: true, get: function () { return __importDefault(DashboardComponent_1).default; } });
|
package/lib/languages.js
CHANGED
|
@@ -265,7 +265,7 @@ class BlocksDisplayComponent extends react_1.default.Component {
|
|
|
265
265
|
innerParentStyle = {};
|
|
266
266
|
innerParentStyle.maxWidth = layoutOptions.maximumWidth || undefined;
|
|
267
267
|
return R("div", { style: { width: "100%", height: "100%", overflow: "hidden", position: "relative" } }, this.renderPalette(), R("div", {
|
|
268
|
-
style: { position: "absolute", left: 141, top: 0, bottom: 0, right: 0,
|
|
268
|
+
style: { position: "absolute", left: 141, top: 0, bottom: 0, right: 0, overflowX: "auto", overflowY: "scroll" },
|
|
269
269
|
className: `mwater-visualization-block-parent-outer mwater-visualization-block-parent-outer-${this.props.style || "default"} mwater-visualization-block-editing`
|
|
270
270
|
}, R("div", {
|
|
271
271
|
key: "inner",
|
|
@@ -275,7 +275,7 @@ class BlocksDisplayComponent extends react_1.default.Component {
|
|
|
275
275
|
}
|
|
276
276
|
else {
|
|
277
277
|
return R(AutoSizeComponent_1.default, { injectWidth: true, injectHeight: true }, (size) => {
|
|
278
|
-
const outerParentStyle = { width: "100%", height: "100%", overflowX: "auto" };
|
|
278
|
+
const outerParentStyle = { width: "100%", height: "100%", overflowX: "auto", overflowY: "scroll" };
|
|
279
279
|
innerParentStyle = {};
|
|
280
280
|
// Remove padding if small
|
|
281
281
|
if (size.width < 600) {
|
|
@@ -34,7 +34,7 @@ const expressions_1 = require("@mwater/expressions");
|
|
|
34
34
|
const NumberInputComponent_1 = __importDefault(require("@mwater/react-library/lib/NumberInputComponent"));
|
|
35
35
|
const AxisComponent_1 = __importDefault(require("./../axes/AxisComponent"));
|
|
36
36
|
const ColorComponent_1 = __importDefault(require("../ColorComponent"));
|
|
37
|
-
const
|
|
37
|
+
const expressions_ui_2 = require("@mwater/expressions-ui");
|
|
38
38
|
const rc_slider_1 = __importDefault(require("rc-slider"));
|
|
39
39
|
const EditPopupComponent_1 = __importDefault(require("./EditPopupComponent"));
|
|
40
40
|
const ZoomLevelsComponent_1 = __importDefault(require("./ZoomLevelsComponent"));
|
|
@@ -77,7 +77,7 @@ class BufferLayerDesignerComponent extends react_1.default.Component {
|
|
|
77
77
|
this.props.onDesignChange({ ...this.props.design, unionShapes });
|
|
78
78
|
};
|
|
79
79
|
renderTable() {
|
|
80
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), R("div", { style: { marginLeft: 10 } }, R(
|
|
80
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), R("div", { style: { marginLeft: 10 } }, R(expressions_ui_2.TableSelectComponent, {
|
|
81
81
|
schema: this.props.schema,
|
|
82
82
|
value: this.props.design.table,
|
|
83
83
|
onChange: this.handleTableChange,
|
|
@@ -33,7 +33,7 @@ const immer_1 = require("immer");
|
|
|
33
33
|
const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
34
34
|
const expressions_1 = require("@mwater/expressions");
|
|
35
35
|
const AxisComponent_1 = __importDefault(require("./../axes/AxisComponent"));
|
|
36
|
-
const
|
|
36
|
+
const expressions_ui_2 = require("@mwater/expressions-ui");
|
|
37
37
|
const ColorComponent_1 = __importDefault(require("../ColorComponent"));
|
|
38
38
|
const rc_slider_1 = __importDefault(require("rc-slider"));
|
|
39
39
|
const EditPopupComponent_1 = __importDefault(require("./EditPopupComponent"));
|
|
@@ -147,7 +147,7 @@ class ChoroplethLayerDesigner extends react_1.default.Component {
|
|
|
147
147
|
react_1.default.createElement("label", { className: "text-muted" },
|
|
148
148
|
react_1.default.createElement("i", { className: "fa fa-database" }),
|
|
149
149
|
" Data Source"),
|
|
150
|
-
react_1.default.createElement(
|
|
150
|
+
react_1.default.createElement(expressions_ui_2.TableSelectComponent, { schema: this.props.schema, value: this.props.design.table, onChange: this.handleTableChange, filter: this.props.design.filter, onFilterChange: this.handleFilterChange })));
|
|
151
151
|
}
|
|
152
152
|
renderRegionsTable() {
|
|
153
153
|
let options = lodash_1.default.map(lodash_1.default.filter(this.props.schema.getTables(), table => table.id.startsWith("regions.")), table => ({ value: table.id, label: table.name.en }));
|
|
@@ -10,7 +10,7 @@ const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
|
10
10
|
const expressions_1 = require("@mwater/expressions");
|
|
11
11
|
const AxisComponent_1 = __importDefault(require("./../axes/AxisComponent"));
|
|
12
12
|
const ColorComponent_1 = __importDefault(require("../ColorComponent"));
|
|
13
|
-
const
|
|
13
|
+
const expressions_ui_2 = require("@mwater/expressions-ui");
|
|
14
14
|
const ZoomLevelsComponent_1 = __importDefault(require("./ZoomLevelsComponent"));
|
|
15
15
|
class ClusterLayerDesignerComponent extends react_1.default.Component {
|
|
16
16
|
// Apply updates to design
|
|
@@ -38,7 +38,7 @@ class ClusterLayerDesignerComponent extends react_1.default.Component {
|
|
|
38
38
|
return this.update({ fillColor: color });
|
|
39
39
|
};
|
|
40
40
|
renderTable() {
|
|
41
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), R("div", { style: { marginLeft: 10 } }, R(
|
|
41
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"), R("div", { style: { marginLeft: 10 } }, R(expressions_ui_2.TableSelectComponent, {
|
|
42
42
|
schema: this.props.schema,
|
|
43
43
|
value: this.props.design.table,
|
|
44
44
|
onChange: this.handleTableChange,
|
|
@@ -23,99 +23,7 @@ export default class DetailLevelSelectComponent extends React.Component<DetailLe
|
|
|
23
23
|
componentWillMount(): any;
|
|
24
24
|
componentWillReceiveProps(nextProps: any): any;
|
|
25
25
|
loadLevels(props: any): any;
|
|
26
|
-
render(): React.FunctionComponentElement<Omit<
|
|
27
|
-
tabIndex?: number | undefined;
|
|
28
|
-
options?: import("react-select").OptionsOrGroups<unknown, import("react-select").GroupBase<unknown>> | undefined;
|
|
29
|
-
placeholder?: React.ReactNode;
|
|
30
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
31
|
-
styles?: import("react-select").StylesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
32
|
-
isLoading?: boolean | undefined;
|
|
33
|
-
isDisabled?: boolean | undefined;
|
|
34
|
-
isRtl?: boolean | undefined;
|
|
35
|
-
isMulti?: boolean | undefined;
|
|
36
|
-
controlShouldRenderValue?: boolean | undefined;
|
|
37
|
-
loadingMessage?: ((obj: {
|
|
38
|
-
inputValue: string;
|
|
39
|
-
}) => React.ReactNode) | undefined;
|
|
40
|
-
noOptionsMessage?: ((obj: {
|
|
41
|
-
inputValue: string;
|
|
42
|
-
}) => React.ReactNode) | undefined;
|
|
43
|
-
backspaceRemovesValue?: boolean | undefined;
|
|
44
|
-
blurInputOnSelect?: boolean | undefined;
|
|
45
|
-
captureMenuScroll?: boolean | undefined;
|
|
46
|
-
classNames?: import("react-select").ClassNamesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
47
|
-
closeMenuOnSelect?: boolean | undefined;
|
|
48
|
-
closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
|
|
49
|
-
components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<unknown, boolean, import("react-select").GroupBase<unknown>>> | undefined;
|
|
50
|
-
escapeClearsValue?: boolean | undefined;
|
|
51
|
-
filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<unknown>, inputValue: string) => boolean) | null | undefined;
|
|
52
|
-
formatGroupLabel?: ((group: import("react-select").GroupBase<unknown>) => React.ReactNode) | undefined;
|
|
53
|
-
getOptionLabel?: import("react-select").GetOptionLabel<unknown> | undefined;
|
|
54
|
-
getOptionValue?: import("react-select").GetOptionValue<unknown> | undefined;
|
|
55
|
-
isOptionDisabled?: ((option: unknown, selectValue: import("react-select").Options<unknown>) => boolean) | undefined;
|
|
56
|
-
isSearchable?: boolean | undefined;
|
|
57
|
-
minMenuHeight?: number | undefined;
|
|
58
|
-
maxMenuHeight?: number | undefined;
|
|
59
|
-
menuIsOpen?: boolean | undefined;
|
|
60
|
-
menuPlacement?: import("react-select").MenuPlacement | undefined;
|
|
61
|
-
menuPosition?: import("react-select").MenuPosition | undefined;
|
|
62
|
-
menuShouldBlockScroll?: boolean | undefined;
|
|
63
|
-
menuShouldScrollIntoView?: boolean | undefined;
|
|
64
|
-
openMenuOnFocus?: boolean | undefined;
|
|
65
|
-
openMenuOnClick?: boolean | undefined;
|
|
66
|
-
pageSize?: number | undefined;
|
|
67
|
-
screenReaderStatus?: ((obj: {
|
|
68
|
-
count: number;
|
|
69
|
-
}) => string) | undefined;
|
|
70
|
-
tabSelectsValue?: boolean | undefined;
|
|
71
|
-
unstyled?: boolean | undefined;
|
|
72
|
-
} & {}, "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"> & {
|
|
73
|
-
tabIndex?: number | undefined;
|
|
74
|
-
options?: import("react-select").OptionsOrGroups<unknown, import("react-select").GroupBase<unknown>> | undefined;
|
|
75
|
-
placeholder?: React.ReactNode;
|
|
76
|
-
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
77
|
-
styles?: import("react-select").StylesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
78
|
-
isLoading?: boolean | undefined;
|
|
79
|
-
isDisabled?: boolean | undefined;
|
|
80
|
-
isRtl?: boolean | undefined;
|
|
81
|
-
isMulti?: boolean | undefined;
|
|
82
|
-
controlShouldRenderValue?: boolean | undefined;
|
|
83
|
-
loadingMessage?: ((obj: {
|
|
84
|
-
inputValue: string;
|
|
85
|
-
}) => React.ReactNode) | undefined;
|
|
86
|
-
noOptionsMessage?: ((obj: {
|
|
87
|
-
inputValue: string;
|
|
88
|
-
}) => React.ReactNode) | undefined;
|
|
89
|
-
backspaceRemovesValue?: boolean | undefined;
|
|
90
|
-
blurInputOnSelect?: boolean | undefined;
|
|
91
|
-
captureMenuScroll?: boolean | undefined;
|
|
92
|
-
classNames?: import("react-select").ClassNamesConfig<unknown, boolean, import("react-select").GroupBase<unknown>> | undefined;
|
|
93
|
-
closeMenuOnSelect?: boolean | undefined;
|
|
94
|
-
closeMenuOnScroll?: boolean | ((event: Event) => boolean) | undefined;
|
|
95
|
-
components?: Partial<import("react-select/dist/declarations/src/components").SelectComponents<unknown, boolean, import("react-select").GroupBase<unknown>>> | undefined;
|
|
96
|
-
escapeClearsValue?: boolean | undefined;
|
|
97
|
-
filterOption?: ((option: import("react-select/dist/declarations/src/filters").FilterOptionOption<unknown>, inputValue: string) => boolean) | null | undefined;
|
|
98
|
-
formatGroupLabel?: ((group: import("react-select").GroupBase<unknown>) => React.ReactNode) | undefined;
|
|
99
|
-
getOptionLabel?: import("react-select").GetOptionLabel<unknown> | undefined;
|
|
100
|
-
getOptionValue?: import("react-select").GetOptionValue<unknown> | undefined;
|
|
101
|
-
isOptionDisabled?: ((option: unknown, selectValue: import("react-select").Options<unknown>) => boolean) | undefined;
|
|
102
|
-
isSearchable?: boolean | undefined;
|
|
103
|
-
minMenuHeight?: number | undefined;
|
|
104
|
-
maxMenuHeight?: number | undefined;
|
|
105
|
-
menuIsOpen?: boolean | undefined;
|
|
106
|
-
menuPlacement?: import("react-select").MenuPlacement | undefined;
|
|
107
|
-
menuPosition?: import("react-select").MenuPosition | undefined;
|
|
108
|
-
menuShouldBlockScroll?: boolean | undefined;
|
|
109
|
-
menuShouldScrollIntoView?: boolean | undefined;
|
|
110
|
-
openMenuOnFocus?: boolean | undefined;
|
|
111
|
-
openMenuOnClick?: boolean | undefined;
|
|
112
|
-
pageSize?: number | undefined;
|
|
113
|
-
screenReaderStatus?: ((obj: {
|
|
114
|
-
count: number;
|
|
115
|
-
}) => string) | undefined;
|
|
116
|
-
tabSelectsValue?: boolean | undefined;
|
|
117
|
-
unstyled?: boolean | undefined;
|
|
118
|
-
} & {}> & 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>>>> | React.DetailedReactHTMLElement<{
|
|
26
|
+
render(): 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>>>> | React.DetailedReactHTMLElement<{
|
|
119
27
|
className: string;
|
|
120
28
|
}, HTMLElement>;
|
|
121
29
|
}
|
|
@@ -157,8 +157,7 @@ class DirectLayerDataSource {
|
|
|
157
157
|
const { url, expires } = await getVectorTileFromDirectRequest({
|
|
158
158
|
apiUrl: this.options.apiUrl,
|
|
159
159
|
client: this.options.client,
|
|
160
|
-
directTokenRequest
|
|
161
|
-
createdAfter
|
|
160
|
+
directTokenRequest
|
|
162
161
|
});
|
|
163
162
|
return { url, expires };
|
|
164
163
|
}
|
|
@@ -33,7 +33,7 @@ const immer_1 = require("immer");
|
|
|
33
33
|
const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
34
34
|
const expressions_1 = require("@mwater/expressions");
|
|
35
35
|
const AxisComponent_1 = __importDefault(require("../axes/AxisComponent"));
|
|
36
|
-
const
|
|
36
|
+
const expressions_ui_2 = require("@mwater/expressions-ui");
|
|
37
37
|
const rc_slider_1 = __importDefault(require("rc-slider"));
|
|
38
38
|
const ZoomLevelsComponent_1 = __importDefault(require("./ZoomLevelsComponent"));
|
|
39
39
|
const ui = __importStar(require("@mwater/react-library/lib/bootstrap"));
|
|
@@ -127,7 +127,7 @@ class GridLayerDesigner extends react_1.default.Component {
|
|
|
127
127
|
react_1.default.createElement("label", { className: "text-muted" },
|
|
128
128
|
react_1.default.createElement("i", { className: "fa fa-database" }),
|
|
129
129
|
" Data Source"),
|
|
130
|
-
react_1.default.createElement(
|
|
130
|
+
react_1.default.createElement(expressions_ui_2.TableSelectComponent, { schema: this.props.schema, value: this.props.design.table, onChange: this.handleTableChange, filter: this.props.design.filter, onFilterChange: this.handleFilterChange })));
|
|
131
131
|
}
|
|
132
132
|
renderGeometryExpr() {
|
|
133
133
|
// If no data, hide
|
package/lib/maps/Layer.js
CHANGED
|
@@ -166,24 +166,13 @@ class Layer {
|
|
|
166
166
|
let bounds = null;
|
|
167
167
|
if (results[0].bounds) {
|
|
168
168
|
const [w, s, e, n] = (0, bbox_1.default)(results[0].bounds);
|
|
169
|
-
// Pad to
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
};
|
|
177
|
-
// Pad bounds to prevent too small box (10m)
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
bounds = {
|
|
181
|
-
w: w - 0.001,
|
|
182
|
-
s: s - 0.001,
|
|
183
|
-
e: e + 0.001,
|
|
184
|
-
n: n + 0.001
|
|
185
|
-
};
|
|
186
|
-
}
|
|
169
|
+
// Pad bounds to prevent too small box (100m)
|
|
170
|
+
bounds = {
|
|
171
|
+
w: w - 0.001,
|
|
172
|
+
s: s - 0.001,
|
|
173
|
+
e: e + 0.001,
|
|
174
|
+
n: n + 0.001
|
|
175
|
+
};
|
|
187
176
|
}
|
|
188
177
|
return callback(null, bounds);
|
|
189
178
|
}
|
package/lib/maps/MapComponent.js
CHANGED
|
@@ -180,7 +180,7 @@ class MapComponent extends react_1.default.Component {
|
|
|
180
180
|
gridTemplateRows: "auto auto 1fr",
|
|
181
181
|
gridTemplateAreas: `"header designer" "quickfilters designer" "view designer"`
|
|
182
182
|
}
|
|
183
|
-
}, this.renderHeader(), this.state.hideQuickfilters ? null : this.renderQuickfilter(), R("div", { style: { width: "100%", height: "100%", gridArea: "view", overflow: "hidden" } }, this.renderView()), designerVisible ? this.renderDesigner() : null);
|
|
183
|
+
}, this.props.hideTitleBar != true ? this.renderHeader() : null, this.state.hideQuickfilters ? null : this.renderQuickfilter(), R("div", { style: { width: "100%", height: "100%", gridArea: "view", overflow: "hidden" } }, this.renderView()), designerVisible ? this.renderDesigner() : null);
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
exports.default = MapComponent;
|