@longline/aqua-ui 1.0.136 → 1.0.138
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/controls/LinearChart/LinearChart.js +1 -1
- package/controls/ListView/Body.js +1 -1
- package/controls/ListView/IListViewProps.d.ts +5 -0
- package/controls/ListView/ListView.d.ts +1 -1
- package/controls/ListView/ListView.js +2 -2
- package/controls/ListView/Table.js +6 -0
- package/map/Map/Map.js +5 -5
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@ var LinearChartBase = function (props) {
|
|
|
36
36
|
var Label = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 120px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n height: 18px;\n line-height: 18px; // If not, will chop accents of \u00C3 and \u00C7.\n font-weight: 700; // TODO: Needs to use theme font weight\n"], ["\n width: 120px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n height: 18px;\n line-height: 18px; // If not, will chop accents of \u00C3 and \u00C7.\n font-weight: 700; // TODO: Needs to use theme font weight\n"])));
|
|
37
37
|
var Number = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 40px;\n text-align: right;\n height: 18px; // If not, will chop accents of \u00C3 and \u00C7.\n line-height: 18px;\n"], ["\n width: 40px;\n text-align: right;\n height: 18px; // If not, will chop accents of \u00C3 and \u00C7.\n line-height: 18px;\n"])));
|
|
38
38
|
var Bar = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative; \n box-sizing: border-box;\n flex: 1;\n height: 14px;\n\n background-color: ", ";\n border-radius: 7px;\n\n &:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n box-sizing: border-box;\n transition: width ", "ms ease;\n border-radius: 7px;\n } \n"], ["\n position: relative; \n box-sizing: border-box;\n flex: 1;\n height: 14px;\n\n background-color: ", ";\n border-radius: 7px;\n\n &:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n box-sizing: border-box;\n transition: width ", "ms ease;\n border-radius: 7px;\n } \n"])), function (p) { return p.theme.colors.primary[4]; }, function (p) { return p.theme.animation.duration * 2; });
|
|
39
|
-
var LinearChartStyled = styled(LinearChartBase)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: space-between;\n height: 18px;\n gap: 8px;\n min-width: 200px;\n\n font: ", ";\n color: ", ";\n line-height: 0;\n text-transform: uppercase;\n\n ", " {\n &:before {\n width: ", "%;\n background-color: ", ";\n }\n }\n"], ["\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: space-between;\n height: 18px;\n gap: 8px;\n min-width: 200px;\n\n font: ", ";\n color: ", ";\n line-height: 0;\n text-transform: uppercase;\n\n ", " {\n &:before {\n width: ", "%;\n background-color: ", ";\n }\n }\n"
|
|
39
|
+
var LinearChartStyled = styled(LinearChartBase)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: space-between;\n height: 18px;\n gap: 8px;\n min-width: 200px;\n user-select: none;\n\n font: ", ";\n color: ", ";\n line-height: 0;\n text-transform: uppercase;\n\n ", " {\n &:before {\n width: ", "%;\n background-color: ", ";\n }\n }\n"], ["\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: space-between;\n height: 18px;\n gap: 8px;\n min-width: 200px;\n user-select: none;\n\n font: ", ";\n color: ", ";\n line-height: 0;\n text-transform: uppercase;\n\n ", " {\n &:before {\n width: ", "%;\n background-color: ", ";\n }\n }\n"
|
|
40
40
|
/**
|
|
41
41
|
* Data visualization element.
|
|
42
42
|
*
|
|
@@ -21,7 +21,7 @@ var Body = React.forwardRef(function (props, ref) {
|
|
|
21
21
|
" ",
|
|
22
22
|
col.children(row)),
|
|
23
23
|
index == props.columns.length - 1 &&
|
|
24
|
-
React.createElement("div", { style: { position: 'absolute', top: 0, right: 0 }, ref: (props.active == row ? ref : null) }));
|
|
24
|
+
React.createElement("div", { style: { position: 'absolute', top: 0, right: 0, scrollMargin: "".concat(props.rowHeight, "px") }, ref: (props.active == row ? ref : null) }));
|
|
25
25
|
}),
|
|
26
26
|
props.columnsEditable && React.createElement("td", null)));
|
|
27
27
|
if (props.expanded && props.active == row) {
|
|
@@ -103,6 +103,11 @@ interface IListViewProps {
|
|
|
103
103
|
* Content to show when active row is expanded.
|
|
104
104
|
*/
|
|
105
105
|
expansion?: React.ReactNode;
|
|
106
|
+
/**
|
|
107
|
+
* If set, when an item is activated it scrolls into view.
|
|
108
|
+
* @fefault false
|
|
109
|
+
*/
|
|
110
|
+
focusActive?: boolean;
|
|
106
111
|
/**
|
|
107
112
|
* Fired when a row is clicked.
|
|
108
113
|
* @param item Clicked item
|
|
@@ -11,7 +11,7 @@ interface IProps extends IListViewProps {
|
|
|
11
11
|
children?: React.ReactElement<IColumnProps> | React.ReactElement<IColumnProps>[];
|
|
12
12
|
}
|
|
13
13
|
declare const ListView: {
|
|
14
|
-
({ dark, noheader, hover, striped, grid, total, singular, plural, narrow, shadow, ghost, rowHeight, columnsEditable, expanded, ...props }: IProps): React.JSX.Element;
|
|
14
|
+
({ dark, noheader, hover, striped, grid, total, singular, plural, narrow, shadow, ghost, rowHeight, columnsEditable, expanded, focusActive, ...props }: IProps): React.JSX.Element;
|
|
15
15
|
Column: {
|
|
16
16
|
(_: IColumnProps): null;
|
|
17
17
|
displayName: string;
|
|
@@ -99,8 +99,8 @@ var ListViewBase = function (props) {
|
|
|
99
99
|
};
|
|
100
100
|
// Wrapper for default values:
|
|
101
101
|
var ListView = function (_a) {
|
|
102
|
-
var _b = _a.dark, dark = _b === void 0 ? false : _b, _c = _a.noheader, noheader = _c === void 0 ? false : _c, _d = _a.hover, hover = _d === void 0 ? false : _d, _e = _a.striped, striped = _e === void 0 ? false : _e, _f = _a.grid, grid = _f === void 0 ? false : _f, _g = _a.total, total = _g === void 0 ? false : _g, _h = _a.singular, singular = _h === void 0 ? "record" : _h, _j = _a.plural, plural = _j === void 0 ? "records" : _j, _k = _a.narrow, narrow = _k === void 0 ? false : _k, _l = _a.shadow, shadow = _l === void 0 ? false : _l, _m = _a.ghost, ghost = _m === void 0 ? false : _m, _o = _a.rowHeight, rowHeight = _o === void 0 ? 48 : _o, _p = _a.columnsEditable, columnsEditable = _p === void 0 ? false : _p, _q = _a.expanded, expanded = _q === void 0 ? false : _q, props = __rest(_a, ["dark", "noheader", "hover", "striped", "grid", "total", "singular", "plural", "narrow", "shadow", "ghost", "rowHeight", "columnsEditable", "expanded"]);
|
|
103
|
-
return React.createElement(ListViewBase, __assign({ dark: dark, noheader: noheader, hover: hover, striped: striped, grid: grid, total: total, singular: singular, plural: plural, narrow: narrow, shadow: shadow, ghost: ghost, rowHeight: rowHeight, columnsEditable: columnsEditable, expanded: expanded }, props));
|
|
102
|
+
var _b = _a.dark, dark = _b === void 0 ? false : _b, _c = _a.noheader, noheader = _c === void 0 ? false : _c, _d = _a.hover, hover = _d === void 0 ? false : _d, _e = _a.striped, striped = _e === void 0 ? false : _e, _f = _a.grid, grid = _f === void 0 ? false : _f, _g = _a.total, total = _g === void 0 ? false : _g, _h = _a.singular, singular = _h === void 0 ? "record" : _h, _j = _a.plural, plural = _j === void 0 ? "records" : _j, _k = _a.narrow, narrow = _k === void 0 ? false : _k, _l = _a.shadow, shadow = _l === void 0 ? false : _l, _m = _a.ghost, ghost = _m === void 0 ? false : _m, _o = _a.rowHeight, rowHeight = _o === void 0 ? 48 : _o, _p = _a.columnsEditable, columnsEditable = _p === void 0 ? false : _p, _q = _a.expanded, expanded = _q === void 0 ? false : _q, _r = _a.focusActive, focusActive = _r === void 0 ? false : _r, props = __rest(_a, ["dark", "noheader", "hover", "striped", "grid", "total", "singular", "plural", "narrow", "shadow", "ghost", "rowHeight", "columnsEditable", "expanded", "focusActive"]);
|
|
103
|
+
return React.createElement(ListViewBase, __assign({ dark: dark, noheader: noheader, hover: hover, striped: striped, grid: grid, total: total, singular: singular, plural: plural, narrow: narrow, shadow: shadow, ghost: ghost, rowHeight: rowHeight, columnsEditable: columnsEditable, expanded: expanded, focusActive: focusActive }, props));
|
|
104
104
|
};
|
|
105
105
|
ListView.Column = Column;
|
|
106
106
|
export { ListView };
|
|
@@ -80,6 +80,12 @@ var TableBase = function (_a) {
|
|
|
80
80
|
resizeObserver.observe(auxRef.current);
|
|
81
81
|
return function () { return resizeObserver.disconnect(); };
|
|
82
82
|
}, []);
|
|
83
|
+
// If desired, scroll newly selected item into view.
|
|
84
|
+
React.useEffect(function () {
|
|
85
|
+
if (activeRef && props.focusActive) {
|
|
86
|
+
activeRef.scrollIntoView({ behavior: 'smooth' });
|
|
87
|
+
}
|
|
88
|
+
}, [activeRef]);
|
|
83
89
|
return (React.createElement(Wrapper, { "$dark": props.dark },
|
|
84
90
|
props.columnsMode &&
|
|
85
91
|
React.createElement(Anchor, { right: "32px", top: "64px" },
|
package/map/Map/Map.js
CHANGED
|
@@ -84,11 +84,11 @@ var MapBase = function (props) {
|
|
|
84
84
|
bearing: props.bearing,
|
|
85
85
|
padding: { top: 0, bottom: 0, left: 0, right: 0 }
|
|
86
86
|
}), viewState = _a[0], setViewState = _a[1];
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}, []);
|
|
87
|
+
// TODO: REMOVE THIS!
|
|
88
|
+
// React.useEffect(() => {
|
|
89
|
+
// // Clears entire Mapbox tile cache for testing of clipping strategy.
|
|
90
|
+
// MapboxGL.clearStorage();
|
|
91
|
+
// }, []);
|
|
92
92
|
var loadImage = function (url) {
|
|
93
93
|
return new Promise(function (res, rej) {
|
|
94
94
|
var img = new Image();
|