@deck.gl/widgets 9.2.10 → 9.3.0-alpha.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/dist/compass-widget.js +5 -5
- package/dist/compass-widget.js.map +1 -1
- package/dist/context-menu-widget.d.ts +23 -18
- package/dist/context-menu-widget.d.ts.map +1 -1
- package/dist/context-menu-widget.js +44 -48
- package/dist/context-menu-widget.js.map +1 -1
- package/dist/dist.dev.js +2533 -420
- package/dist/fullscreen-widget.js +1 -1
- package/dist/fullscreen-widget.js.map +1 -1
- package/dist/geocoder-widget.d.ts +2 -4
- package/dist/geocoder-widget.d.ts.map +1 -1
- package/dist/geocoder-widget.js +16 -20
- package/dist/geocoder-widget.js.map +1 -1
- package/dist/gimbal-widget.d.ts +0 -3
- package/dist/gimbal-widget.d.ts.map +1 -1
- package/dist/gimbal-widget.js +4 -22
- package/dist/gimbal-widget.js.map +1 -1
- package/dist/index.cjs +921 -370
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/info-widget.d.ts +38 -17
- package/dist/info-widget.d.ts.map +1 -1
- package/dist/info-widget.js +40 -130
- package/dist/info-widget.js.map +1 -1
- package/dist/lib/components/dropdown-menu.d.ts +10 -4
- package/dist/lib/components/dropdown-menu.d.ts.map +1 -1
- package/dist/lib/components/dropdown-menu.js +12 -7
- package/dist/lib/components/dropdown-menu.js.map +1 -1
- package/dist/lib/components/icon-menu.d.ts.map +1 -1
- package/dist/lib/components/icon-menu.js +2 -3
- package/dist/lib/components/icon-menu.js.map +1 -1
- package/dist/lib/components/popover.d.ts +30 -0
- package/dist/lib/components/popover.d.ts.map +1 -0
- package/dist/lib/components/popover.js +93 -0
- package/dist/lib/components/popover.js.map +1 -0
- package/dist/lib/components/range-input.d.ts +26 -0
- package/dist/lib/components/range-input.d.ts.map +1 -0
- package/dist/lib/components/range-input.js +261 -0
- package/dist/lib/components/range-input.js.map +1 -0
- package/dist/lib/components/user-content.d.ts +8 -0
- package/dist/lib/components/user-content.d.ts.map +1 -0
- package/dist/lib/components/user-content.js +15 -0
- package/dist/lib/components/user-content.js.map +1 -0
- package/dist/popup-widget.d.ts +63 -0
- package/dist/popup-widget.d.ts.map +1 -0
- package/dist/popup-widget.js +70 -0
- package/dist/popup-widget.js.map +1 -0
- package/dist/reset-view-widget.d.ts +1 -1
- package/dist/reset-view-widget.d.ts.map +1 -1
- package/dist/reset-view-widget.js +12 -11
- package/dist/reset-view-widget.js.map +1 -1
- package/dist/scrollbar-widget.d.ts +68 -0
- package/dist/scrollbar-widget.d.ts.map +1 -0
- package/dist/scrollbar-widget.js +181 -0
- package/dist/scrollbar-widget.js.map +1 -0
- package/dist/stats-widget.d.ts +4 -0
- package/dist/stats-widget.d.ts.map +1 -1
- package/dist/stats-widget.js +3 -3
- package/dist/stats-widget.js.map +1 -1
- package/dist/stylesheet.css +244 -29
- package/dist/theme-widget.d.ts.map +1 -1
- package/dist/theme-widget.js +7 -5
- package/dist/theme-widget.js.map +1 -1
- package/dist/themes.d.ts +30 -0
- package/dist/themes.d.ts.map +1 -1
- package/dist/themes.js +28 -4
- package/dist/themes.js.map +1 -1
- package/dist/timeline-widget.d.ts +25 -6
- package/dist/timeline-widget.d.ts.map +1 -1
- package/dist/timeline-widget.js +46 -18
- package/dist/timeline-widget.js.map +1 -1
- package/dist/zoom-widget.d.ts +2 -8
- package/dist/zoom-widget.d.ts.map +1 -1
- package/dist/zoom-widget.js +23 -18
- package/dist/zoom-widget.js.map +1 -1
- package/dist.min.js +2 -2
- package/package.json +4 -3
- package/src/compass-widget.tsx +5 -5
- package/src/context-menu-widget.tsx +86 -76
- package/src/fullscreen-widget.tsx +1 -1
- package/src/geocoder-widget.tsx +17 -24
- package/src/gimbal-widget.tsx +4 -26
- package/src/index.ts +11 -6
- package/src/info-widget.tsx +93 -157
- package/src/lib/components/dropdown-menu.tsx +42 -20
- package/src/lib/components/icon-menu.tsx +3 -4
- package/src/lib/components/popover.tsx +167 -0
- package/src/lib/components/range-input.tsx +432 -0
- package/src/lib/components/user-content.tsx +30 -0
- package/src/popup-widget.tsx +163 -0
- package/src/reset-view-widget.tsx +12 -11
- package/src/scrollbar-widget.tsx +288 -0
- package/src/stats-widget.tsx +10 -4
- package/src/stylesheet.css +244 -29
- package/src/theme-widget.tsx +7 -5
- package/src/themes.ts +35 -4
- package/src/timeline-widget.tsx +96 -33
- package/src/zoom-widget.tsx +25 -21
- package/dist/lib/components/grouped-icon-button.d.ts +0 -10
- package/dist/lib/components/grouped-icon-button.d.ts.map +0 -1
- package/dist/lib/components/grouped-icon-button.js +0 -7
- package/dist/lib/components/grouped-icon-button.js.map +0 -1
- package/dist/lib/components/simple-menu.d.ts +0 -16
- package/dist/lib/components/simple-menu.d.ts.map +0 -1
- package/dist/lib/components/simple-menu.js +0 -30
- package/dist/lib/components/simple-menu.js.map +0 -1
- package/src/lib/components/grouped-icon-button.tsx +0 -27
- package/src/lib/components/simple-menu.tsx +0 -52
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ export { FullscreenWidget } from "./fullscreen-widget.js";
|
|
|
8
8
|
export { SplitterWidget as _SplitterWidget } from "./splitter-widget.js";
|
|
9
9
|
export { ViewSelectorWidget as _ViewSelectorWidget } from "./view-selector-widget.js";
|
|
10
10
|
export { InfoWidget as _InfoWidget } from "./info-widget.js";
|
|
11
|
+
export { PopupWidget } from "./popup-widget.js";
|
|
11
12
|
export { ContextMenuWidget as _ContextMenuWidget } from "./context-menu-widget.js";
|
|
13
|
+
export { ScrollbarWidget } from "./scrollbar-widget.js";
|
|
12
14
|
export { TimelineWidget as _TimelineWidget } from "./timeline-widget.js";
|
|
13
15
|
export { ScreenshotWidget } from "./screenshot-widget.js";
|
|
14
16
|
export { ThemeWidget as _ThemeWidget } from "./theme-widget.js";
|
|
@@ -32,14 +34,14 @@ export type { SplitterWidgetProps } from "./splitter-widget.js";
|
|
|
32
34
|
export type { TimelineWidgetProps } from "./timeline-widget.js";
|
|
33
35
|
export type { ViewSelectorWidgetProps } from "./view-selector-widget.js";
|
|
34
36
|
export type { GimbalWidgetProps } from "./gimbal-widget.js";
|
|
37
|
+
export type { ContentBounds, ScrollbarWidgetProps, ScrollbarDecoration } from "./scrollbar-widget.js";
|
|
35
38
|
export { LightTheme, DarkTheme, LightGlassTheme, DarkGlassTheme } from "./themes.js";
|
|
36
39
|
export type { DeckWidgetTheme } from "./themes.js";
|
|
37
40
|
export { ButtonGroup as _ButtonGroup, type ButtonGroupProps } from "./lib/components/button-group.js";
|
|
38
41
|
export { IconButton as _IconButton, type IconButtonProps } from "./lib/components/icon-button.js";
|
|
39
|
-
export {
|
|
40
|
-
export { DropdownMenu as _DropdownMenu, type DropdownMenuProps } from "./lib/components/dropdown-menu.js";
|
|
41
|
-
export { SimpleMenu as _SimpleMenu, type SimpleMenuProps } from "./lib/components/simple-menu.js";
|
|
42
|
+
export { DropdownMenu as _DropdownMenu, type DropdownMenuProps, SimpleMenu as _SimpleMenu, type SimpleMenuProps } from "./lib/components/dropdown-menu.js";
|
|
42
43
|
export { IconMenu as _IconMenu, type IconMenuProps } from "./lib/components/icon-menu.js";
|
|
44
|
+
export { RangeInput as _RangeInput, type RangeInputProps, type RangeInputDecoration } from "./lib/components/range-input.js";
|
|
43
45
|
export { type Geocoder } from "./lib/geocode/geocoder.js";
|
|
44
46
|
export { GoogleGeocoder as _GoogleGeocoder, MapboxGeocoder as _MapboxGeocoder, OpenCageGeocoder as _OpenCageGeocoder, CoordinatesGeocoder as _CoordinatesGeocoder, CurrentLocationGeocoder as _CurrentLocationGeocoder } from "./lib/geocode/geocoders.js";
|
|
45
47
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO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,eAAe,EAAC,wCAAqC;AAC7F,OAAO,EACL,YAAY,IAAI,aAAa,EAC7B,KAAK,iBAAiB,EACtB,UAAU,IAAI,WAAW,EACzB,KAAK,eAAe,EACrB,0CAAuC;AACxC,OAAO,EAAC,QAAQ,IAAI,SAAS,EAAE,KAAK,aAAa,EAAC,sCAAmC;AACrF,OAAO,EACL,UAAU,IAAI,WAAW,EACzB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,wCAAqC;AAGtC,OAAO,EAAC,KAAK,QAAQ,EAAC,kCAA+B;AACrD,OAAO,EACL,cAAc,IAAI,eAAe,EACjC,cAAc,IAAI,eAAe,EACjC,gBAAgB,IAAI,iBAAiB,EACrC,mBAAmB,IAAI,oBAAoB,EAC3C,uBAAuB,IAAI,wBAAwB,EACpD,mCAAgC"}
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,9 @@ export { SplitterWidget as _SplitterWidget } from "./splitter-widget.js";
|
|
|
15
15
|
export { ViewSelectorWidget as _ViewSelectorWidget } from "./view-selector-widget.js";
|
|
16
16
|
// Information widgets
|
|
17
17
|
export { InfoWidget as _InfoWidget } from "./info-widget.js";
|
|
18
|
+
export { PopupWidget } from "./popup-widget.js";
|
|
18
19
|
export { ContextMenuWidget as _ContextMenuWidget } from "./context-menu-widget.js";
|
|
20
|
+
export { ScrollbarWidget } from "./scrollbar-widget.js";
|
|
19
21
|
// Control widgets
|
|
20
22
|
export { TimelineWidget as _TimelineWidget } from "./timeline-widget.js";
|
|
21
23
|
// Utility widgets
|
|
@@ -28,9 +30,8 @@ export { LightTheme, DarkTheme, LightGlassTheme, DarkGlassTheme } from "./themes
|
|
|
28
30
|
// Experimental preact components
|
|
29
31
|
export { ButtonGroup as _ButtonGroup } from "./lib/components/button-group.js";
|
|
30
32
|
export { IconButton as _IconButton } from "./lib/components/icon-button.js";
|
|
31
|
-
export {
|
|
32
|
-
export { DropdownMenu as _DropdownMenu } from "./lib/components/dropdown-menu.js";
|
|
33
|
-
export { SimpleMenu as _SimpleMenu } from "./lib/components/simple-menu.js";
|
|
33
|
+
export { DropdownMenu as _DropdownMenu, SimpleMenu as _SimpleMenu } from "./lib/components/dropdown-menu.js";
|
|
34
34
|
export { IconMenu as _IconMenu } from "./lib/components/icon-menu.js";
|
|
35
|
+
export { RangeInput as _RangeInput } from "./lib/components/range-input.js";
|
|
35
36
|
export { GoogleGeocoder as _GoogleGeocoder, MapboxGeocoder as _MapboxGeocoder, OpenCageGeocoder as _OpenCageGeocoder, CoordinatesGeocoder as _CoordinatesGeocoder, CurrentLocationGeocoder as _CurrentLocationGeocoder } from "./lib/geocode/geocoders.js";
|
|
36
37
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,qBAAqB;AACrB,OAAO,EAAC,UAAU,EAAC,yBAAsB;AACzC,OAAO,EAAC,eAAe,EAAC,+BAA4B;AACpD,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAE7C,qBAAqB;AACrB,OAAO,EAAC,aAAa,EAAC,4BAAyB;AAC/C,OAAO,EAAC,WAAW,IAAI,YAAY,EAAC,0BAAuB;AAC3D,OAAO,EAAC,cAAc,IAAI,eAAe,EAAC,6BAA0B;AAEpE,eAAe;AACf,OAAO,EAAC,gBAAgB,EAAC,+BAA4B;AACrD,OAAO,EAAC,cAAc,IAAI,eAAe,EAAC,6BAA0B;AACpE,OAAO,EAAC,kBAAkB,IAAI,mBAAmB,EAAC,kCAA+B;AAEjF,sBAAsB;AACtB,OAAO,EAAC,UAAU,IAAI,WAAW,EAAC,yBAAsB;AACxD,OAAO,EAAC,iBAAiB,IAAI,kBAAkB,EAAC,iCAA8B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,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AE7B,UAAU,IAAI,WAAW,EAE1B,0CAAuC;AACxC,OAAO,EAAC,QAAQ,IAAI,SAAS,EAAqB,sCAAmC;AACrF,OAAO,EACL,UAAU,IAAI,WAAW,EAG1B,wCAAqC;AAItC,OAAO,EACL,cAAc,IAAI,eAAe,EACjC,cAAc,IAAI,eAAe,EACjC,gBAAgB,IAAI,iBAAiB,EACrC,mBAAmB,IAAI,oBAAoB,EAC3C,uBAAuB,IAAI,wBAAwB,EACpD,mCAAgC"}
|
package/dist/info-widget.d.ts
CHANGED
|
@@ -1,38 +1,59 @@
|
|
|
1
1
|
import { Widget } from '@deck.gl/core';
|
|
2
2
|
import type { Deck, PickingInfo, Viewport, WidgetProps } from '@deck.gl/core';
|
|
3
|
+
import { type PopoverProps } from "./lib/components/popover.js";
|
|
4
|
+
export type TooltipContent = {
|
|
5
|
+
/** Anchor of the popup in world coordinates, e.g. [longitude, latitude].
|
|
6
|
+
* If not supplied, default to the mouse position where the popup was triggered.
|
|
7
|
+
*/
|
|
8
|
+
position?: number[];
|
|
9
|
+
/** Text content to display in the popup */
|
|
10
|
+
text?: string;
|
|
11
|
+
/** HTML content to display in the popup. If supplied, `text` is ignored. */
|
|
12
|
+
html?: string;
|
|
13
|
+
/** HTML element to attach inside the popup. */
|
|
14
|
+
element?: HTMLElement | null;
|
|
15
|
+
/** Custom class name to add to the popup */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** CSS style overrides of the popup */
|
|
18
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
19
|
+
};
|
|
3
20
|
export type InfoWidgetProps = WidgetProps & {
|
|
4
21
|
/** View to attach to and interact with. Required when using multiple views */
|
|
5
22
|
viewId?: string | null;
|
|
6
23
|
/** Determines the interaction mode of the widget */
|
|
7
|
-
mode: 'click' | 'hover'
|
|
24
|
+
mode: 'click' | 'hover';
|
|
8
25
|
/** Function to generate the popup contents from the selected element */
|
|
9
|
-
getTooltip?: (info: PickingInfo, widget: InfoWidget) =>
|
|
10
|
-
/** Position
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
|
|
26
|
+
getTooltip?: (info: PickingInfo, widget: InfoWidget) => TooltipContent | string | null | undefined;
|
|
27
|
+
/** Position popup relative to the anchor.
|
|
28
|
+
* @default 'right'
|
|
29
|
+
*/
|
|
30
|
+
placement?: PopoverProps['placement'];
|
|
31
|
+
/** Pixel offset
|
|
32
|
+
* @default 10
|
|
33
|
+
*/
|
|
34
|
+
offset?: PopoverProps['offset'];
|
|
35
|
+
/**
|
|
36
|
+
* Show an arrow pointing at the anchor. Optionally accepts a pixel size.
|
|
37
|
+
* @default 10
|
|
38
|
+
*/
|
|
39
|
+
arrow?: PopoverProps['arrow'];
|
|
20
40
|
};
|
|
21
41
|
export declare class InfoWidget extends Widget<InfoWidgetProps> {
|
|
22
42
|
static defaultProps: Required<InfoWidgetProps>;
|
|
23
43
|
className: string;
|
|
24
44
|
placement: "fill";
|
|
25
45
|
viewport?: Viewport;
|
|
46
|
+
tooltip: Required<TooltipContent> | null;
|
|
26
47
|
constructor(props: InfoWidgetProps);
|
|
27
48
|
setProps(props: Partial<InfoWidgetProps>): void;
|
|
28
|
-
|
|
29
|
-
onViewportChange(viewport: any): void;
|
|
30
|
-
onHover(info: PickingInfo): void;
|
|
31
|
-
onClick(info: PickingInfo): boolean;
|
|
32
|
-
onAdd({ deck, viewId }: {
|
|
49
|
+
onAdd({ deck }: {
|
|
33
50
|
deck: Deck<any>;
|
|
34
51
|
viewId: string | null;
|
|
35
52
|
}): void;
|
|
53
|
+
onViewportChange(viewport: any): void;
|
|
54
|
+
onHover(info: PickingInfo): void;
|
|
55
|
+
onClick(info: PickingInfo): void;
|
|
56
|
+
protected _getTooltip(info: PickingInfo): Required<TooltipContent> | null;
|
|
36
57
|
onRenderHTML(rootElement: HTMLElement): void;
|
|
37
58
|
}
|
|
38
59
|
//# sourceMappingURL=info-widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info-widget.d.ts","sourceRoot":"","sources":["../src/info-widget.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,EAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"info-widget.d.ts","sourceRoot":"","sources":["../src/info-widget.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,EAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AAE5E,OAAO,EAAU,KAAK,YAAY,EAAC,oCAAiC;AAGpE,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,oDAAoD;IACpD,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IACxB,wEAAwE;IACxE,UAAU,CAAC,EAAE,CACX,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,UAAU,KACf,cAAc,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChD;;OAEG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IACtC;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAChC;;;OAGG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;CAC/B,CAAC;AAEF,qBAAa,UAAW,SAAQ,MAAM,CAAC,eAAe,CAAC;IACrD,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,eAAe,CAAC,CAS5C;IAEF,SAAS,SAAsB;IAC/B,SAAS,SAAmB;IAC5B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,IAAI,CAAQ;gBAEpC,KAAK,EAAE,eAAe;IAKlC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC;IAKxC,KAAK,CAAC,EAAC,IAAI,EAAC,EAAE;QAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;KAAC;IAItD,gBAAgB,CAAC,QAAQ,KAAA;IAKzB,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAMhC,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAMhC,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,QAAQ,CAAC,cAAc,CAAC,GAAG,IAAI;IAsBzE,YAAY,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI;CAkC7C"}
|
package/dist/info-widget.js
CHANGED
|
@@ -1,175 +1,85 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "preact/jsx-runtime";
|
|
2
2
|
// deck.gl
|
|
3
3
|
// SPDX-License-Identifier: MIT
|
|
4
4
|
// Copyright (c) vis.gl contributors
|
|
5
5
|
import { Widget } from '@deck.gl/core';
|
|
6
6
|
import { render } from 'preact';
|
|
7
|
+
import { Popover } from "./lib/components/popover.js";
|
|
8
|
+
import { UserContent } from "./lib/components/user-content.js";
|
|
7
9
|
export class InfoWidget extends Widget {
|
|
8
10
|
constructor(props) {
|
|
9
11
|
super(props);
|
|
10
12
|
this.className = 'deck-widget-info';
|
|
11
13
|
this.placement = 'fill';
|
|
14
|
+
this.tooltip = null;
|
|
12
15
|
this.setProps(this.props);
|
|
13
16
|
}
|
|
14
17
|
setProps(props) {
|
|
15
18
|
this.viewId = props.viewId ?? this.viewId;
|
|
16
19
|
super.setProps(props);
|
|
17
20
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const style = { margin: '0px', top: '0px', left: '0px', position: 'absolute' };
|
|
21
|
-
Object.entries(style).forEach(([key, value]) => element.style.setProperty(key, value));
|
|
22
|
-
return element;
|
|
21
|
+
onAdd({ deck }) {
|
|
22
|
+
this.deck = deck;
|
|
23
23
|
}
|
|
24
24
|
onViewportChange(viewport) {
|
|
25
25
|
this.viewport = viewport;
|
|
26
26
|
this.updateHTML();
|
|
27
27
|
}
|
|
28
28
|
onHover(info) {
|
|
29
|
-
if (this.props.mode === 'hover'
|
|
30
|
-
|
|
31
|
-
// hover tooltips should show over static and click infos
|
|
32
|
-
this.setProps({
|
|
33
|
-
visible: tooltip !== null,
|
|
34
|
-
...tooltip,
|
|
35
|
-
style: { zIndex: '1', ...tooltip?.style }
|
|
36
|
-
});
|
|
29
|
+
if (this.props.mode === 'hover') {
|
|
30
|
+
this.tooltip = this._getTooltip(info);
|
|
37
31
|
}
|
|
38
32
|
}
|
|
39
33
|
onClick(info) {
|
|
40
|
-
if (this.props.mode === 'click'
|
|
41
|
-
|
|
42
|
-
this.setProps({
|
|
43
|
-
visible: tooltip !== null,
|
|
44
|
-
...tooltip
|
|
45
|
-
});
|
|
46
|
-
return tooltip !== null;
|
|
34
|
+
if (this.props.mode === 'click') {
|
|
35
|
+
this.tooltip = this._getTooltip(info);
|
|
47
36
|
}
|
|
48
|
-
// Original behavior
|
|
49
|
-
return this.props.onClick?.(this, info) || false;
|
|
50
37
|
}
|
|
51
|
-
|
|
52
|
-
this.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
38
|
+
_getTooltip(info) {
|
|
39
|
+
if (!this.props.getTooltip)
|
|
40
|
+
return null;
|
|
41
|
+
const content = this.props.getTooltip(info, this) ?? null;
|
|
42
|
+
if (content === null)
|
|
43
|
+
return null;
|
|
44
|
+
const normalizedTooltip = typeof content === 'string' ? { text: content } : content;
|
|
45
|
+
const position = normalizedTooltip.position || info.coordinate;
|
|
46
|
+
if (!position)
|
|
47
|
+
return null;
|
|
48
|
+
return {
|
|
49
|
+
position,
|
|
50
|
+
text: '',
|
|
51
|
+
html: '',
|
|
52
|
+
element: null,
|
|
53
|
+
className: '',
|
|
54
|
+
style: {},
|
|
55
|
+
...normalizedTooltip
|
|
56
|
+
};
|
|
59
57
|
}
|
|
60
58
|
onRenderHTML(rootElement) {
|
|
61
|
-
if (!this.viewport) {
|
|
59
|
+
if (!this.viewport || this.tooltip === null) {
|
|
60
|
+
render(null, rootElement);
|
|
62
61
|
return;
|
|
63
62
|
}
|
|
64
|
-
const
|
|
63
|
+
const style = {
|
|
64
|
+
...this.props.style,
|
|
65
|
+
...this.tooltip.style
|
|
66
|
+
};
|
|
65
67
|
// Project the clicked geographic coordinate to canvas (x, y)
|
|
66
|
-
const [x, y] = this.viewport.project(
|
|
67
|
-
const minOffset = this.props.minOffset || 0;
|
|
68
|
-
const gap = 10; // gap between clicked point and popup box
|
|
69
|
-
const arrowHeight = 8; // height of the triangle arrow
|
|
70
|
-
const arrowWidth = 16; // full width of the arrow
|
|
71
|
-
// Decide vertical orientation.
|
|
72
|
-
// If the clicked point is in the bottom half, place the popup above the point.
|
|
73
|
-
const isAbove = y > this.viewport.height / 2;
|
|
74
|
-
const background = (this.props.style && this.props.style.background) || 'rgba(255,255,255,0.9)';
|
|
68
|
+
const [x, y] = this.viewport.project(this.tooltip.position);
|
|
75
69
|
// Render the popup container with a content box and a placeholder for the arrow.
|
|
76
70
|
// The container is positioned absolutely (initially at 0,0) and will be repositioned after measuring.
|
|
77
|
-
const ui =
|
|
78
|
-
background,
|
|
79
|
-
padding: '10px',
|
|
80
|
-
position: 'relative',
|
|
81
|
-
// Include any additional styles
|
|
82
|
-
...this.props.style
|
|
83
|
-
}, children: this.props.text }), _jsx("div", { className: "popup-arrow", style: { position: 'absolute', width: '0px', height: '0px' } })] })) : null;
|
|
71
|
+
const ui = (_jsx(Popover, { x: x, y: y, placement: this.props.placement, arrow: this.props.arrow, arrowColor: "var(--menu-background, #fff)", offset: this.props.offset, children: _jsx(UserContent, { className: `deck-widget-popup-content ${this.tooltip.className} ${this.props.className}`, style: style, html: this.tooltip.html, text: this.tooltip.text, element: this.tooltip.element }) }));
|
|
84
72
|
render(ui, rootElement);
|
|
85
|
-
// After rendering, measure the content and adjust positioning so that:
|
|
86
|
-
// - The popup (with its arrow) does not cover the clicked point.
|
|
87
|
-
// - The arrow's tip points to the clicked point.
|
|
88
|
-
// - The popup remains within the canvas bounds, with minOffset.
|
|
89
|
-
// eslint-disable-next-line max-statements, complexity
|
|
90
|
-
requestAnimationFrame(() => {
|
|
91
|
-
if (!this.props.visible || !rootElement.firstChild || !this.viewport)
|
|
92
|
-
return;
|
|
93
|
-
const container = rootElement.firstChild;
|
|
94
|
-
const contentEl = container.querySelector('.popup-content');
|
|
95
|
-
const arrowEl = container.querySelector('.popup-arrow');
|
|
96
|
-
if (!contentEl || !arrowEl)
|
|
97
|
-
return;
|
|
98
|
-
const contentRect = contentEl.getBoundingClientRect();
|
|
99
|
-
const popupWidth = contentRect.width;
|
|
100
|
-
const popupHeight = contentRect.height;
|
|
101
|
-
// Compute ideal horizontal position: center the popup on the clicked x
|
|
102
|
-
let computedLeft = x - popupWidth / 2;
|
|
103
|
-
// Compute vertical position based on orientation:
|
|
104
|
-
// If the popup is above, position its bottom edge (minus arrow & gap) at the clicked y.
|
|
105
|
-
// Otherwise, position its top edge (plus arrow & gap) at the clicked y.
|
|
106
|
-
let computedTop;
|
|
107
|
-
if (isAbove) {
|
|
108
|
-
computedTop = y - gap - arrowHeight - popupHeight;
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
computedTop = y + gap + arrowHeight;
|
|
112
|
-
}
|
|
113
|
-
// Ensure the popup (content) stays within horizontal bounds of the canvas
|
|
114
|
-
if (computedLeft < minOffset) {
|
|
115
|
-
computedLeft = minOffset;
|
|
116
|
-
}
|
|
117
|
-
if (computedLeft + popupWidth > this.viewport.width - minOffset) {
|
|
118
|
-
computedLeft = this.viewport.width - minOffset - popupWidth;
|
|
119
|
-
}
|
|
120
|
-
// Ensure the vertical position (including the arrow) stays within canvas bounds.
|
|
121
|
-
if (isAbove) {
|
|
122
|
-
if (computedTop < minOffset) {
|
|
123
|
-
computedTop = minOffset;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
else if (computedTop + popupHeight + arrowHeight > this.viewport.height - minOffset) {
|
|
127
|
-
computedTop = this.viewport.height - minOffset - popupHeight - arrowHeight;
|
|
128
|
-
}
|
|
129
|
-
// Update container position (remove any transform and set left/top explicitly)
|
|
130
|
-
container.style.left = `${computedLeft}px`;
|
|
131
|
-
container.style.top = `${computedTop}px`;
|
|
132
|
-
container.style.transform = '';
|
|
133
|
-
// Compute arrow's horizontal offset relative to the container.
|
|
134
|
-
// We want the arrow's tip to align with the clicked point.
|
|
135
|
-
let arrowLeft = x - computedLeft - arrowWidth / 2;
|
|
136
|
-
// Optionally constrain arrowLeft so it stays within the popup's width.
|
|
137
|
-
arrowLeft = Math.max(arrowLeft, 0);
|
|
138
|
-
arrowLeft = Math.min(arrowLeft, popupWidth - arrowWidth);
|
|
139
|
-
// Update arrow element's style based on orientation.
|
|
140
|
-
if (isAbove) {
|
|
141
|
-
// Popup is above the clicked point so arrow appears at the bottom of the popup.
|
|
142
|
-
arrowEl.style.left = `${arrowLeft}px`;
|
|
143
|
-
arrowEl.style.bottom = `-${arrowHeight}px`;
|
|
144
|
-
arrowEl.style.top = '';
|
|
145
|
-
arrowEl.style.borderLeft = `${arrowWidth / 2}px solid transparent`;
|
|
146
|
-
arrowEl.style.borderRight = `${arrowWidth / 2}px solid transparent`;
|
|
147
|
-
arrowEl.style.borderTop = `${arrowHeight}px solid ${background}`;
|
|
148
|
-
arrowEl.style.borderBottom = '';
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
// Popup is below the clicked point so arrow appears at the top.
|
|
152
|
-
arrowEl.style.left = `${arrowLeft}px`;
|
|
153
|
-
arrowEl.style.top = `-${arrowHeight}px`;
|
|
154
|
-
arrowEl.style.bottom = '';
|
|
155
|
-
arrowEl.style.borderLeft = `${arrowWidth / 2}px solid transparent`;
|
|
156
|
-
arrowEl.style.borderRight = `${arrowWidth / 2}px solid transparent`;
|
|
157
|
-
arrowEl.style.borderBottom = `${arrowHeight}px solid ${background}`;
|
|
158
|
-
arrowEl.style.borderTop = '';
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
73
|
}
|
|
162
74
|
}
|
|
163
75
|
InfoWidget.defaultProps = {
|
|
164
76
|
...Widget.defaultProps,
|
|
165
77
|
id: 'info',
|
|
166
|
-
position: [0, 0],
|
|
167
|
-
text: '',
|
|
168
|
-
visible: false,
|
|
169
|
-
minOffset: 0,
|
|
170
78
|
viewId: null,
|
|
171
79
|
mode: 'hover',
|
|
172
80
|
getTooltip: undefined,
|
|
173
|
-
|
|
81
|
+
placement: 'right',
|
|
82
|
+
offset: 10,
|
|
83
|
+
arrow: 10
|
|
174
84
|
};
|
|
175
85
|
//# sourceMappingURL=info-widget.js.map
|
package/dist/info-widget.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info-widget.js","sourceRoot":"","sources":["../src/info-widget.tsx"],"names":[],"mappings":";AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,MAAM,EAAC,MAAM,e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,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAE5D,iFAAiF;QACjF,sGAAsG;QACtG,MAAM,EAAE,GAAG,CACT,KAAC,OAAO,IACN,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,UAAU,EAAC,8BAA8B,EACzC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,YAEzB,KAAC,WAAW,IACV,SAAS,EAAE,6BAA6B,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,EACxF,KAAK,EAAE,KAA0B,EACjC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EACvB,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EACvB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,GAC7B,GACM,CACX,CAAC;QACF,MAAM,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;IAC1B,CAAC;;AAtGM,uBAAY,GAA8B;IAC/C,GAAG,MAAM,CAAC,YAAY;IACtB,EAAE,EAAE,MAAM;IACV,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,SAAU;IACtB,SAAS,EAAE,OAAO;IAClB,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;CACV,AATkB,CASjB"}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { type JSX } from 'preact';
|
|
1
|
+
import { type JSX, type ComponentChild } from 'preact';
|
|
2
2
|
export type MenuItem = string | {
|
|
3
3
|
label: string;
|
|
4
|
-
value
|
|
4
|
+
value?: string;
|
|
5
5
|
icon?: string;
|
|
6
6
|
};
|
|
7
7
|
export type DropdownMenuProps = {
|
|
8
8
|
menuItems: MenuItem[];
|
|
9
9
|
onSelect: (value: string) => void;
|
|
10
|
-
style?:
|
|
10
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
11
11
|
};
|
|
12
|
-
export declare const DropdownMenu: (props: DropdownMenuProps) => JSX.Element
|
|
12
|
+
export declare const DropdownMenu: (props: DropdownMenuProps) => JSX.Element;
|
|
13
|
+
export type SimpleMenuProps = DropdownMenuProps & {
|
|
14
|
+
trigger?: ComponentChild;
|
|
15
|
+
isOpen: boolean;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
};
|
|
18
|
+
export declare const SimpleMenu: (props: SimpleMenuProps) => JSX.Element | null;
|
|
13
19
|
//# sourceMappingURL=dropdown-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../src/lib/components/dropdown-menu.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,GAAG,EAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../src/lib/components/dropdown-menu.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,GAAG,EAAE,KAAK,cAAc,EAAC,MAAM,QAAQ,CAAC;AAGrD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AAE/E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACtC,CAAC;AAcF,eAAO,MAAM,YAAY,UAAW,iBAAiB,gBAgBpD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG;IAChD,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,UAAU,UAAW,eAAe,uBAwDhD,CAAC"}
|
|
@@ -11,11 +11,13 @@ function getMenuItemIcon(item) {
|
|
|
11
11
|
}
|
|
12
12
|
export const DropdownMenu = (props) => {
|
|
13
13
|
const [isOpen, setIsOpen] = useState(false);
|
|
14
|
+
return (_jsx(SimpleMenu, { ...props, style: { ...props.style, position: 'absolute' }, isOpen: isOpen, onClose: () => setIsOpen(false), trigger: _jsx("button", { className: "deck-widget-dropdown-button", onClick: () => setIsOpen(!isOpen), children: _jsx("span", { className: `deck-widget-dropdown-icon ${isOpen ? 'open' : ''}` }) }) }));
|
|
15
|
+
};
|
|
16
|
+
export const SimpleMenu = (props) => {
|
|
14
17
|
const dropdownRef = useRef(null);
|
|
15
|
-
const toggleDropdown = () => setIsOpen(!isOpen);
|
|
16
18
|
const handleClickOutside = (event) => {
|
|
17
19
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
18
|
-
|
|
20
|
+
props.onClose();
|
|
19
21
|
}
|
|
20
22
|
};
|
|
21
23
|
useEffect(() => {
|
|
@@ -24,17 +26,20 @@ export const DropdownMenu = (props) => {
|
|
|
24
26
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
25
27
|
};
|
|
26
28
|
}, []);
|
|
27
|
-
const handleSelect = (
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
const handleSelect = (value) => {
|
|
30
|
+
if (value) {
|
|
31
|
+
props.onSelect(value);
|
|
32
|
+
props.onClose();
|
|
33
|
+
}
|
|
30
34
|
};
|
|
31
35
|
// Don't render anything if there are no menu items
|
|
32
36
|
if (props.menuItems.length === 0) {
|
|
33
37
|
return null;
|
|
34
38
|
}
|
|
35
|
-
return (_jsxs("div", { className: "deck-widget-dropdown-container", ref: dropdownRef,
|
|
39
|
+
return (_jsxs("div", { className: "deck-widget-dropdown-container", ref: dropdownRef, children: [props.trigger, props.isOpen && (_jsx("ul", { className: "deck-widget-dropdown-menu", style: props.style, children: props.menuItems.map((item, i) => {
|
|
40
|
+
const value = getMenuItemValue(item);
|
|
36
41
|
const icon = getMenuItemIcon(item);
|
|
37
|
-
return (_jsxs("li", { className:
|
|
42
|
+
return (_jsxs("li", { className: `deck-widget-dropdown-item ${value ? '' : 'disabled'}`, onClick: () => handleSelect(value), children: [icon && (_jsx("span", { className: "deck-widget-dropdown-item-icon", style: { maskImage: `url("${icon}")`, WebkitMaskImage: `url("${icon}")` } })), getMenuItemLabel(item)] }, i));
|
|
38
43
|
}) }))] }));
|
|
39
44
|
};
|
|
40
45
|
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../../src/lib/components/dropdown-menu.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAC,MAAM,cAAc,CAAC;AAUzD,SAAS,gBAAgB,CAAC,IAAc;IACtC,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;AACtD,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAc;IACtC,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;AACtD,CAAC;AAED,SAAS,eAAe,CAAC,IAAc;IACrC,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;AAC1D,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,EAAE;IACvD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC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CAAC,IAAI,CAAC,CAAC;oBACnC,OAAO,CACL,cACE,SAAS,EAAE,6BAA6B,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,EAEjE,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,aAEjC,IAAI,IAAI,CACP,eACE,SAAS,EAAC,gCAAgC,EAC1C,KAAK,EAAE,EAAC,SAAS,EAAE,QAAQ,IAAI,IAAI,EAAE,eAAe,EAAE,QAAQ,IAAI,IAAI,EAAC,GACvE,CACH,EACA,gBAAgB,CAAC,IAAI,CAAC,KATlB,CAAC,CAUH,CACN,CAAC;gBACJ,CAAC,CAAC,GACC,CACN,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-menu.d.ts","sourceRoot":"","sources":["../../../src/lib/components/icon-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"icon-menu.d.ts","sourceRoot":"","sources":["../../../src/lib/components/icon-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,QAAQ,CAAC;AAKhC,MAAM,MAAM,aAAa,CAAC,OAAO,GAAG,MAAM,IAAI;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAChE,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,kDAAkD;AAClD,wBAAgB,QAAQ,CAAC,OAAO,SAAS,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,eAsD7E"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
2
|
import { useState, useRef, useEffect } from 'preact/hooks';
|
|
3
|
-
import { IconButton } from "./icon-button.js";
|
|
4
3
|
import { ButtonGroup } from "./button-group.js";
|
|
5
|
-
import {
|
|
4
|
+
import { IconButton } from "./icon-button.js";
|
|
6
5
|
/** A component that renders an icon popup menu */
|
|
7
6
|
export function IconMenu(props) {
|
|
8
7
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
@@ -29,6 +28,6 @@ export function IconMenu(props) {
|
|
|
29
28
|
const selectedMenuItem = props.menuItems.find(item => item.value === selectedItem);
|
|
30
29
|
const label = props.label || selectedMenuItem?.label || '';
|
|
31
30
|
const icon = (props.icon || selectedMenuItem?.icon);
|
|
32
|
-
return (_jsxs("div", { style: { position: 'relative', display: 'inline-block' }, ref: containerRef, children: [_jsx(IconButton, { className: props.className, label: label, onClick: handleButtonClick, children: icon }), menuOpen && (_jsx("div", { className: "deck-widget-icon-menu", children: _jsx(ButtonGroup, { orientation: "vertical", children: props.menuItems.map(item => (_jsx(
|
|
31
|
+
return (_jsxs("div", { style: { position: 'relative', display: 'inline-block' }, ref: containerRef, children: [_jsx(IconButton, { className: props.className, label: label, onClick: handleButtonClick, children: icon }), menuOpen && (_jsx("div", { className: "deck-widget-icon-menu", children: _jsx(ButtonGroup, { orientation: "vertical", children: props.menuItems.map(item => (_jsx(IconButton, { label: item.label, onClick: () => handleSelectItem(item.value), children: item.icon }, item.value))) }) }))] }));
|
|
33
32
|
}
|
|
34
33
|
//# sourceMappingURL=icon-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-menu.js","sourceRoot":"","sources":["../../../src/lib/components/icon-menu.tsx"],"names":[],"mappings":";AACA,OAAO,EAAC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
|
5
|
+
x: number;
|
|
6
|
+
/** Anchor y */
|
|
7
|
+
y: number;
|
|
8
|
+
/** Position content relative to the anchor.
|
|
9
|
+
* @default 'right'
|
|
10
|
+
*/
|
|
11
|
+
placement?: Placement;
|
|
12
|
+
/** Pixel offset
|
|
13
|
+
* @default 0
|
|
14
|
+
*/
|
|
15
|
+
offset?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Show an arrow pointing at the anchor. Optionally accepts a pixel size.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
arrow?: false | number | [width: number, height: number];
|
|
21
|
+
/**
|
|
22
|
+
* CSS color of the arrow
|
|
23
|
+
* @default 'white'
|
|
24
|
+
*/
|
|
25
|
+
arrowColor?: string;
|
|
26
|
+
/** Content of the popover */
|
|
27
|
+
children: ComponentChildren;
|
|
28
|
+
};
|
|
29
|
+
export declare const Popover: ({ x, y, placement, offset: pixelOffset, arrow: arrowSize, arrowColor, children }: PopoverProps) => JSX.Element;
|
|
30
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/lib/components/popover.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,GAAG,EAAE,iBAAiB,EAAC,MAAM,QAAQ,CAAC;AAEnD,OAAO,EAOL,KAAK,SAAS,EAEf,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,YAAY,GAAG;IACzB,eAAe;IACf,CAAC,EAAE,MAAM,CAAC;IACV,eAAe;IACf,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACzD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6BAA6B;IAC7B,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,OAAO,qFAQjB,YAAY,gBAyEd,CAAC"}
|