@longline/aqua-ui 1.0.250 → 1.0.252
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.
|
@@ -7,7 +7,7 @@ interface IColumnProps {
|
|
|
7
7
|
/**
|
|
8
8
|
* Optional label. `name` will be used if not specified.
|
|
9
9
|
*/
|
|
10
|
-
label?: string;
|
|
10
|
+
label?: string | React.ReactNode;
|
|
11
11
|
/**
|
|
12
12
|
* Column width. If a number, e.g. `1`, then it is the column's weight,
|
|
13
13
|
* relative to other columns. If it is a string, e.g. `50px`, then it is
|
|
@@ -30,8 +30,28 @@ var SourceColumnsBase = function (props) {
|
|
|
30
30
|
var handleQ = function (value) {
|
|
31
31
|
setQ(value);
|
|
32
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Convert a React node into a plain text string.
|
|
35
|
+
* Handles strings, numbers, arrays, and nested React elements recursively.
|
|
36
|
+
*/
|
|
37
|
+
var reactNodeToString = function (node) {
|
|
38
|
+
if (node === null || node === undefined || typeof node === 'boolean')
|
|
39
|
+
return null;
|
|
40
|
+
if (typeof node === 'string' || typeof node === 'number')
|
|
41
|
+
return String(node);
|
|
42
|
+
// If it's an array of nodes, recursively join them
|
|
43
|
+
if (Array.isArray(node)) {
|
|
44
|
+
return node.map(reactNodeToString).join('');
|
|
45
|
+
}
|
|
46
|
+
// If it's a React element, recurse into its children
|
|
47
|
+
if (React.isValidElement(node)) {
|
|
48
|
+
return reactNodeToString(node.props.children);
|
|
49
|
+
}
|
|
50
|
+
// Fallback
|
|
51
|
+
return '';
|
|
52
|
+
};
|
|
33
53
|
return (React.createElement("div", { className: props.className },
|
|
34
|
-
React.createElement(List, { maxItems: 6, search: q, placeholder: "Search...", onSearch: handleQ }, props.columns.filter(function (c) { return !q || (c.label || c.name).toLowerCase().includes(q); }).sort(function (a, b) { return (a.label || a.name).localeCompare(b.label || b.name); }).map(function (c) {
|
|
54
|
+
React.createElement(List, { maxItems: 6, search: q, placeholder: "Search...", onSearch: handleQ }, props.columns.filter(function (c) { return !q || (reactNodeToString(c.label) || c.name).toLowerCase().includes(q); }).sort(function (a, b) { return (reactNodeToString(a.label) || a.name).localeCompare(reactNodeToString(b.label) || b.name); }).map(function (c) {
|
|
35
55
|
return React.createElement(Entry, { key: c.name },
|
|
36
56
|
React.createElement(Selector, { disabled: c.fixed, checked: !!c.active, onChange: function () { return handleChange(c.name); } }),
|
|
37
57
|
c.label || c.name);
|
|
@@ -6,6 +6,13 @@ interface IFullscreenButtonProps {
|
|
|
6
6
|
* will be the map's direct container.
|
|
7
7
|
*/
|
|
8
8
|
container?: HTMLDivElement;
|
|
9
|
+
/**
|
|
10
|
+
* For `map` mode, fullscreen mode affect map control only, but this will
|
|
11
|
+
* not work if the map has children that have expanding elements using
|
|
12
|
+
* portals. In `document` mode, the entire application is made fullscreen.
|
|
13
|
+
* @default document
|
|
14
|
+
*/
|
|
15
|
+
mode?: 'map' | 'document';
|
|
9
16
|
}
|
|
10
17
|
/**
|
|
11
18
|
* The `FullscreenButton` toggles the map full-screen when clicked.
|
|
@@ -18,7 +25,7 @@ interface IFullscreenButtonProps {
|
|
|
18
25
|
* ```
|
|
19
26
|
*/
|
|
20
27
|
declare const FullscreenButton: {
|
|
21
|
-
({ hint, ...props }: IMapButtonProps & IFullscreenButtonProps): React.JSX.Element;
|
|
28
|
+
({ hint, mode, ...props }: IMapButtonProps & IFullscreenButtonProps): React.JSX.Element;
|
|
22
29
|
displayName: string;
|
|
23
30
|
};
|
|
24
31
|
export { FullscreenButton, IFullscreenButtonProps };
|
|
@@ -34,9 +34,8 @@ import { MapButton } from '../base/MapButton';
|
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
36
|
var FullscreenButton = function (_a) {
|
|
37
|
-
var _b = _a.hint, hint = _b === void 0 ? React.createElement(React.Fragment, null, "Toggle fullscreen map") : _b, props = __rest(_a, ["hint"]);
|
|
37
|
+
var _b = _a.hint, hint = _b === void 0 ? React.createElement(React.Fragment, null, "Toggle fullscreen map") : _b, _c = _a.mode, mode = _c === void 0 ? 'document' : _c, props = __rest(_a, ["hint", "mode"]);
|
|
38
38
|
var map = useMap().current;
|
|
39
|
-
//
|
|
40
39
|
// Does the browser offer full screen support?
|
|
41
40
|
var checkFullscreenSupport = function () {
|
|
42
41
|
return !!(window.document.fullscreenEnabled ||
|
|
@@ -44,11 +43,16 @@ var FullscreenButton = function (_a) {
|
|
|
44
43
|
};
|
|
45
44
|
var toggle = function () {
|
|
46
45
|
if (document.fullscreenElement === null) {
|
|
47
|
-
if (
|
|
48
|
-
props.container
|
|
46
|
+
if (mode == 'map') {
|
|
47
|
+
if (props.container) {
|
|
48
|
+
props.container.requestFullscreen();
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
map.getContainer().requestFullscreen();
|
|
52
|
+
}
|
|
49
53
|
}
|
|
50
54
|
else {
|
|
51
|
-
|
|
55
|
+
window.document.documentElement.requestFullscreen();
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
else {
|