@tedi-design-system/react 18.1.0-rc.4 → 18.1.0-rc.6
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/bundle-stats.html +1 -1
- package/community.cjs.js +1 -1
- package/community.es.js +156 -152
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/prop-types/external/react-is/index.cjs.js +1 -1
- package/external/prop-types/external/react-is/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/community/components/map-components/base-map-selection/base-map-option.cjs.js +1 -0
- package/src/community/components/map-components/base-map-selection/base-map-option.d.ts +51 -0
- package/src/community/components/map-components/base-map-selection/base-map-option.es.js +39 -0
- package/src/community/components/map-components/base-map-selection/base-map-selection.cjs.js +1 -1
- package/src/community/components/map-components/base-map-selection/base-map-selection.d.ts +37 -22
- package/src/community/components/map-components/base-map-selection/base-map-selection.es.js +76 -17
- package/src/community/components/map-components/base-map-selection/base-map-selection.module.scss.cjs.js +1 -1
- package/src/community/components/map-components/base-map-selection/base-map-selection.module.scss.es.js +4 -1
- package/src/community/components/map-components/split-pane/split-pane.cjs.js +1 -0
- package/src/community/components/map-components/split-pane/split-pane.d.ts +37 -0
- package/src/community/components/map-components/split-pane/split-pane.es.js +128 -0
- package/src/community/components/map-components/split-pane/split-pane.module.scss.cjs.js +1 -0
- package/src/community/components/map-components/split-pane/split-pane.module.scss.es.js +17 -0
- package/src/community/index.d.ts +1 -0
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +7 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +7 -0
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),v=require("../../../../../external/classnames/index.cjs.js"),e=require("./base-map-selection.module.scss.cjs.js"),l=o=>{const{title:r,content:c,selected:d,onSelect:t,type:n="selection",className:u,id:p,multiple:m,disabled:a}=o,b=()=>{a||t==null||t()},f=i=>{a||(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),t==null||t())},_=v.default(e.default["tedi-base-map-selection__wrapper"],d&&e.default["tedi-base-map-selection--selected"],n&&e.default[`tedi-base-map-selection--${n}`],m&&e.default["tedi-base-map-selection--multiple"],a&&e.default["tedi-base-map-selection--disabled"],u);return s.jsxs("div",{role:"button",tabIndex:a?-1:0,"aria-pressed":!!d,"aria-disabled":a||void 0,onClick:b,onKeyDown:f,className:_,id:p,children:[s.jsx("div",{"aria-hidden":!0,className:e.default["tedi-base-map-selection__content"],children:c}),s.jsx("div",{className:e.default["tedi-base-map-selection__title"],children:r})]})};l.displayName="BaseMapOption";exports.BaseMapOption=l;exports.default=l;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
export type BaseMapOptionType = 'button' | 'historical' | 'selection';
|
|
3
|
+
export interface BaseMapOptionProps {
|
|
4
|
+
/**
|
|
5
|
+
* The title displayed within the option.
|
|
6
|
+
*/
|
|
7
|
+
title: string;
|
|
8
|
+
/**
|
|
9
|
+
* The main content of the option, typically a thumbnail. Can be any valid React node.
|
|
10
|
+
*/
|
|
11
|
+
content: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Indicates whether the option is currently selected.
|
|
14
|
+
* Used to apply specific visual styles.
|
|
15
|
+
*/
|
|
16
|
+
selected?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Callback triggered when the option is clicked
|
|
19
|
+
* or activated via keyboard (Enter or Space).
|
|
20
|
+
*/
|
|
21
|
+
onSelect?: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* The type of the option, which controls styling.
|
|
24
|
+
* - `'selection'`: thumbnail with the title rendered below (default)
|
|
25
|
+
* - `'button'`: square thumbnail with the title overlaid
|
|
26
|
+
* - `'historical'`: styled for historical context
|
|
27
|
+
* @default 'selection'
|
|
28
|
+
*/
|
|
29
|
+
type?: BaseMapOptionType;
|
|
30
|
+
/**
|
|
31
|
+
* Optional custom class name to apply additional styles.
|
|
32
|
+
*/
|
|
33
|
+
className?: string;
|
|
34
|
+
/**
|
|
35
|
+
* HTML `id` attribute to identify the element.
|
|
36
|
+
*/
|
|
37
|
+
id: string;
|
|
38
|
+
/**
|
|
39
|
+
* When `true`, renders a "stacked" visual indicating multiple maps.
|
|
40
|
+
*/
|
|
41
|
+
multiple?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Applies disabled style.
|
|
44
|
+
*/
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export declare const BaseMapOption: {
|
|
48
|
+
(props: BaseMapOptionProps): JSX.Element;
|
|
49
|
+
displayName: string;
|
|
50
|
+
};
|
|
51
|
+
export default BaseMapOption;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as y, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import h from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import e from "./base-map-selection.module.scss.es.js";
|
|
4
|
+
const N = (d) => {
|
|
5
|
+
const { title: o, content: r, selected: i, onSelect: t, type: n = "selection", className: c, id: p, multiple: m, disabled: s } = d, b = () => {
|
|
6
|
+
s || t == null || t();
|
|
7
|
+
}, u = (a) => {
|
|
8
|
+
s || (a.key === "Enter" || a.key === " ") && (a.preventDefault(), t == null || t());
|
|
9
|
+
}, f = h(
|
|
10
|
+
e["tedi-base-map-selection__wrapper"],
|
|
11
|
+
i && e["tedi-base-map-selection--selected"],
|
|
12
|
+
n && e[`tedi-base-map-selection--${n}`],
|
|
13
|
+
m && e["tedi-base-map-selection--multiple"],
|
|
14
|
+
s && e["tedi-base-map-selection--disabled"],
|
|
15
|
+
c
|
|
16
|
+
);
|
|
17
|
+
return /* @__PURE__ */ y(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
role: "button",
|
|
21
|
+
tabIndex: s ? -1 : 0,
|
|
22
|
+
"aria-pressed": !!i,
|
|
23
|
+
"aria-disabled": s || void 0,
|
|
24
|
+
onClick: b,
|
|
25
|
+
onKeyDown: u,
|
|
26
|
+
className: f,
|
|
27
|
+
id: p,
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ l("div", { "aria-hidden": !0, className: e["tedi-base-map-selection__content"], children: r }),
|
|
30
|
+
/* @__PURE__ */ l("div", { className: e["tedi-base-map-selection__title"], children: o })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
N.displayName = "BaseMapOption";
|
|
36
|
+
export {
|
|
37
|
+
N as BaseMapOption,
|
|
38
|
+
N as default
|
|
39
|
+
};
|
package/src/community/components/map-components/base-map-selection/base-map-selection.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),N=require("../../../../../external/classnames/index.cjs.js"),S=require("react"),B=require("../../../../tedi/components/buttons/button/button.cjs.js"),T=require("../../../../tedi/components/form/field/field.cjs.js"),O=require("../../../../tedi/components/form/input-group/input-group.cjs.js"),C=require("../../../../tedi/components/form/slider/slider.cjs.js"),f=require("./base-map-option.cjs.js"),n=require("./base-map-selection.module.scss.cjs.js"),l=require("../../../../tedi/components/overlays/popover/popover.cjs.js"),L=require("../../../../tedi/components/form/input-group/components/input/input.cjs.js"),P=require("../../../../tedi/components/form/input-group/components/suffix/suffix.cjs.js"),c=a=>{const t=Number(a);return Number.isNaN(t)?0:Math.min(100,Math.max(0,t))};function o(a){const{title:t,content:x,children:h,multiple:y=!1,showTransparency:j=!1,transparency:d,defaultTransparency:_,onTransparencyChange:s,transparencyLabel:r="",id:i}=a,p=d!==void 0,[v,g]=S.useState(()=>c(_??0)),u=c(p?d:v),m=M=>{const b=c(M);p||g(b),s==null||s(b)},q=N.default(n.default["tedi-base-map-selection__wrapper"],n.default["tedi-base-map-selection__trigger"],n.default["tedi-base-map-selection--button"],y&&n.default["tedi-base-map-selection--multiple"]);return e.jsxs(l.Popover,{placement:"top-end",children:[e.jsx(l.Popover.Trigger,{children:e.jsxs(B.Button,{noStyle:!0,id:i,className:q,children:[e.jsx("div",{className:n.default["tedi-base-map-selection__content"],"aria-hidden":!0,children:x}),e.jsx("div",{className:n.default["tedi-base-map-selection__title"],children:t})]})}),e.jsxs(l.Popover.Content,{width:"medium",children:[e.jsx("div",{className:n.default["tedi-base-map-selection__options"],children:h}),j&&e.jsx("div",{className:n.default["tedi-base-map-selection__transparency"],children:e.jsx(C.Slider,{label:r,"aria-label":r||"Transparency",min:0,max:100,value:u,onChange:m,minLabel:"0%",maxLabel:"100%",addonRight:e.jsx("div",{className:n.default["tedi-base-map-selection__transparency-field"],children:e.jsxs(O.InputGroupBase,{id:`${i}-transparency`,label:r||"Transparency",hideLabel:!0,children:[e.jsx(L.Input,{children:e.jsx(T.Field,{type:"number",id:`${i}-transparency`,value:String(u),onChange:m})}),e.jsx(P.Suffix,{children:"%"})]})})})})]})]})}o.Option=f.BaseMapOption;o.displayName="BaseMapSelection";exports.BaseMapOption=f.BaseMapOption;exports.BaseMapSelection=o;
|
|
@@ -1,44 +1,59 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
-
|
|
2
|
+
import { default as BaseMapOption } from './base-map-option';
|
|
3
3
|
export interface BaseMapSelectionProps {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Title of the trigger button and used as its accessible label.
|
|
6
6
|
*/
|
|
7
7
|
title: string;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Visual content (thumbnail) of the currently active base map, shown on the trigger button.
|
|
10
10
|
*/
|
|
11
11
|
content: React.ReactNode;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* Used to apply specific visual styles.
|
|
13
|
+
* Selectable base map options rendered inside the popover, typically `BaseMapSelection.Option` elements.
|
|
15
14
|
*/
|
|
16
|
-
|
|
15
|
+
children: React.ReactNode;
|
|
17
16
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* Renders a "stacked" trigger, indicating that multiple base maps are available.
|
|
18
|
+
* @default false
|
|
20
19
|
*/
|
|
21
|
-
|
|
20
|
+
multiple?: boolean;
|
|
22
21
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* - `'historical'`: styled for historical context
|
|
26
|
-
* - `'selection'`: styled for multi-selection context
|
|
22
|
+
* When `true`, renders a transparency slider at the bottom of the popover.
|
|
23
|
+
* @default false
|
|
27
24
|
*/
|
|
28
|
-
|
|
25
|
+
showTransparency?: boolean;
|
|
29
26
|
/**
|
|
30
|
-
*
|
|
27
|
+
* Controlled transparency value (0-100). Use together with `onTransparencyChange`.
|
|
28
|
+
* Values outside the range are clamped. Omit for uncontrolled usage.
|
|
31
29
|
*/
|
|
32
|
-
|
|
30
|
+
transparency?: number;
|
|
33
31
|
/**
|
|
34
|
-
*
|
|
32
|
+
* Initial transparency value (0-100) for uncontrolled usage. Ignored when `transparency` is provided.
|
|
33
|
+
* @default 0
|
|
35
34
|
*/
|
|
36
|
-
|
|
35
|
+
defaultTransparency?: number;
|
|
37
36
|
/**
|
|
38
|
-
*
|
|
39
|
-
* Affects the visual style.
|
|
37
|
+
* Callback fired when the transparency value changes. The reported value is always clamped to 0-100.
|
|
40
38
|
*/
|
|
41
|
-
|
|
39
|
+
onTransparencyChange?: (value: number) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Label for the transparency slider.
|
|
42
|
+
*/
|
|
43
|
+
transparencyLabel?: string;
|
|
44
|
+
/**
|
|
45
|
+
* HTML `id` attribute applied to the trigger button.
|
|
46
|
+
*/
|
|
47
|
+
id: string;
|
|
48
|
+
}
|
|
49
|
+
export declare function BaseMapSelection(props: BaseMapSelectionProps): JSX.Element;
|
|
50
|
+
export declare namespace BaseMapSelection {
|
|
51
|
+
var Option: {
|
|
52
|
+
(props: import("./base-map-option").BaseMapOptionProps): JSX.Element;
|
|
53
|
+
displayName: string;
|
|
54
|
+
};
|
|
55
|
+
var displayName: string;
|
|
42
56
|
}
|
|
43
|
-
export
|
|
57
|
+
export type { BaseMapOptionProps, BaseMapOptionType } from './base-map-option';
|
|
58
|
+
export { BaseMapOption };
|
|
44
59
|
export default BaseMapSelection;
|
|
@@ -1,21 +1,80 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import B from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { useState as M } from "react";
|
|
4
|
+
import { Button as C } from "../../../../tedi/components/buttons/button/button.es.js";
|
|
5
|
+
import { Field as L } from "../../../../tedi/components/form/field/field.es.js";
|
|
6
|
+
import { InputGroupBase as w } from "../../../../tedi/components/form/input-group/input-group.es.js";
|
|
7
|
+
import { Slider as j } from "../../../../tedi/components/form/slider/slider.es.js";
|
|
8
|
+
import { BaseMapOption as I } from "./base-map-option.es.js";
|
|
9
|
+
import a from "./base-map-selection.module.scss.es.js";
|
|
10
|
+
import { Popover as l } from "../../../../tedi/components/overlays/popover/popover.es.js";
|
|
11
|
+
import { Input as O } from "../../../../tedi/components/form/input-group/components/input/input.es.js";
|
|
12
|
+
import { Suffix as $ } from "../../../../tedi/components/form/input-group/components/suffix/suffix.es.js";
|
|
13
|
+
const c = (r) => {
|
|
14
|
+
const n = Number(r);
|
|
15
|
+
return Number.isNaN(n) ? 0 : Math.min(100, Math.max(0, n));
|
|
16
|
+
};
|
|
17
|
+
function f(r) {
|
|
18
|
+
const {
|
|
19
|
+
title: n,
|
|
20
|
+
content: b,
|
|
21
|
+
children: y,
|
|
22
|
+
multiple: _ = !1,
|
|
23
|
+
showTransparency: N = !1,
|
|
24
|
+
transparency: m,
|
|
25
|
+
defaultTransparency: g,
|
|
26
|
+
onTransparencyChange: i,
|
|
27
|
+
transparencyLabel: s = "",
|
|
28
|
+
id: o
|
|
29
|
+
} = r, p = m !== void 0, [v, x] = M(
|
|
30
|
+
() => c(g ?? 0)
|
|
31
|
+
), d = c(p ? m : v), u = (S) => {
|
|
32
|
+
const h = c(S);
|
|
33
|
+
p || x(h), i == null || i(h);
|
|
34
|
+
}, T = B(
|
|
35
|
+
a["tedi-base-map-selection__wrapper"],
|
|
36
|
+
a["tedi-base-map-selection__trigger"],
|
|
37
|
+
a["tedi-base-map-selection--button"],
|
|
38
|
+
_ && a["tedi-base-map-selection--multiple"]
|
|
13
39
|
);
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
|
|
40
|
+
return /* @__PURE__ */ t(l, { placement: "top-end", children: [
|
|
41
|
+
/* @__PURE__ */ e(l.Trigger, { children: /* @__PURE__ */ t(C, { noStyle: !0, id: o, className: T, children: [
|
|
42
|
+
/* @__PURE__ */ e("div", { className: a["tedi-base-map-selection__content"], "aria-hidden": !0, children: b }),
|
|
43
|
+
/* @__PURE__ */ e("div", { className: a["tedi-base-map-selection__title"], children: n })
|
|
44
|
+
] }) }),
|
|
45
|
+
/* @__PURE__ */ t(l.Content, { width: "medium", children: [
|
|
46
|
+
/* @__PURE__ */ e("div", { className: a["tedi-base-map-selection__options"], children: y }),
|
|
47
|
+
N && /* @__PURE__ */ e("div", { className: a["tedi-base-map-selection__transparency"], children: /* @__PURE__ */ e(
|
|
48
|
+
j,
|
|
49
|
+
{
|
|
50
|
+
label: s,
|
|
51
|
+
"aria-label": s || "Transparency",
|
|
52
|
+
min: 0,
|
|
53
|
+
max: 100,
|
|
54
|
+
value: d,
|
|
55
|
+
onChange: u,
|
|
56
|
+
minLabel: "0%",
|
|
57
|
+
maxLabel: "100%",
|
|
58
|
+
addonRight: /* @__PURE__ */ e("div", { className: a["tedi-base-map-selection__transparency-field"], children: /* @__PURE__ */ t(w, { id: `${o}-transparency`, label: s || "Transparency", hideLabel: !0, children: [
|
|
59
|
+
/* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
|
|
60
|
+
L,
|
|
61
|
+
{
|
|
62
|
+
type: "number",
|
|
63
|
+
id: `${o}-transparency`,
|
|
64
|
+
value: String(d),
|
|
65
|
+
onChange: u
|
|
66
|
+
}
|
|
67
|
+
) }),
|
|
68
|
+
/* @__PURE__ */ e($, { children: "%" })
|
|
69
|
+
] }) })
|
|
70
|
+
}
|
|
71
|
+
) })
|
|
72
|
+
] })
|
|
17
73
|
] });
|
|
18
|
-
}
|
|
74
|
+
}
|
|
75
|
+
f.Option = I;
|
|
76
|
+
f.displayName = "BaseMapSelection";
|
|
19
77
|
export {
|
|
20
|
-
|
|
78
|
+
I as BaseMapOption,
|
|
79
|
+
f as BaseMapSelection
|
|
21
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-base-map-selection__wrapper":"tedi-base-map-selection__wrapper-aae7464f","tedi-base-map-selection__content":"tedi-base-map-selection__content-3145448d","tedi-base-map-selection--historical":"tedi-base-map-selection--historical-159d3def","tedi-base-map-selection__title":"tedi-base-map-selection__title-d46b74ec","tedi-map-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-base-map-selection__wrapper":"tedi-base-map-selection__wrapper-aae7464f","tedi-base-map-selection__content":"tedi-base-map-selection__content-3145448d","tedi-base-map-selection__options":"tedi-base-map-selection__options-dce549ce","tedi-base-map-selection__transparency":"tedi-base-map-selection__transparency-d4be551d","tedi-base-map-selection__transparency-field":"tedi-base-map-selection__transparency-field-d8b5a065","tedi-base-map-selection--historical":"tedi-base-map-selection--historical-159d3def","tedi-base-map-selection__title":"tedi-base-map-selection__title-d46b74ec","tedi-base-map-selection--selected":"tedi-base-map-selection--selected-914a0483","tedi-base-map-selection--disabled":"tedi-base-map-selection--disabled-a957b2c8","tedi-base-map-selection--button":"tedi-base-map-selection--button-0e9e36f4","tedi-base-map-selection--selection":"tedi-base-map-selection--selection-910cae90","tedi-base-map-selection--multiple":"tedi-base-map-selection--multiple-58cb365c"};exports.default=e;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
const e = {
|
|
2
2
|
"tedi-base-map-selection__wrapper": "tedi-base-map-selection__wrapper-aae7464f",
|
|
3
3
|
"tedi-base-map-selection__content": "tedi-base-map-selection__content-3145448d",
|
|
4
|
+
"tedi-base-map-selection__options": "tedi-base-map-selection__options-dce549ce",
|
|
5
|
+
"tedi-base-map-selection__transparency": "tedi-base-map-selection__transparency-d4be551d",
|
|
6
|
+
"tedi-base-map-selection__transparency-field": "tedi-base-map-selection__transparency-field-d8b5a065",
|
|
4
7
|
"tedi-base-map-selection--historical": "tedi-base-map-selection--historical-159d3def",
|
|
5
8
|
"tedi-base-map-selection__title": "tedi-base-map-selection__title-d46b74ec",
|
|
6
|
-
"tedi-map-selection__title": "tedi-map-selection__title-20651d60",
|
|
7
9
|
"tedi-base-map-selection--selected": "tedi-base-map-selection--selected-914a0483",
|
|
10
|
+
"tedi-base-map-selection--disabled": "tedi-base-map-selection--disabled-a957b2c8",
|
|
8
11
|
"tedi-base-map-selection--button": "tedi-base-map-selection--button-0e9e36f4",
|
|
9
12
|
"tedi-base-map-selection--selection": "tedi-base-map-selection--selection-910cae90",
|
|
10
13
|
"tedi-base-map-selection--multiple": "tedi-base-map-selection--multiple-58cb365c"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),P=require("../../../../../external/classnames/index.cjs.js"),p=require("react"),I=require("../../../../tedi/components/base/icon/icon.cjs.js"),K=require("../../../../tedi/components/buttons/button/button.cjs.js"),s=require("./split-pane.module.scss.cjs.js"),O=require("../../../../tedi/providers/label-provider/use-labels.cjs.js"),B=20,F=80,M=2,S=(c,a,d)=>Math.max(a,Math.min(d,c)),U=(c,a)=>c?a==="first"?"right":"left":a==="first"?"bottom":"top",A=({direction:c,side:a})=>{const d=U(c==="horizontal",a);return i.jsx("div",{"data-testid":"active-pane-ring","aria-hidden":!0,className:P.default(s.default["tedi-split-pane__ring"],s.default[`tedi-split-pane__ring--omit-${d}`])})},T=c=>{const{first:a,second:d,direction:m,highlightedSide:E,onClose:y,initialRatio:b=50,minRatio:f=B,maxRatio:h=F,onRatioChange:x}=c,{getLabel:g}=O.useLabels(),[v,N]=p.useState(()=>S(b,f,h)),_=p.useRef(v),R=p.useRef(null),r=p.useRef(null),l=m==="horizontal",w=e=>{const o=S(e,f,h);_.current=o,N(o)},L=(e,o)=>{if(!R.current)return;const n=R.current.getBoundingClientRect(),t=l?n.width:n.height;if(t<=0)return;const u=l?(e-n.left)/t*100:(o-n.top)/t*100;w(u)},j=()=>{x==null||x(_.current)},D=()=>{const e=t=>L(t.clientX,t.clientY),o=t=>{const u=t.touches[0];u&&L(u.clientX,u.clientY)},n=()=>{var t;(t=r.current)==null||t.call(r),j()};r.current=()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",n),document.removeEventListener("touchmove",o),document.removeEventListener("touchend",n),r.current=null},document.addEventListener("mousemove",e),document.addEventListener("mouseup",n),document.addEventListener("touchmove",o),document.addEventListener("touchend",n)};p.useEffect(()=>()=>{var e;(e=r.current)==null||e.call(r)},[]);const q=e=>{e.preventDefault(),D()},z=()=>{D()},k=e=>{const o=l?"ArrowLeft":"ArrowUp",n=l?"ArrowRight":"ArrowDown";let t=null;e.key===o?t=_.current-M:e.key===n?t=_.current+M:e.key==="Home"?t=f:e.key==="End"&&(t=h),t!==null&&(e.preventDefault(),w(t),j())};return i.jsxs("div",{ref:R,"data-testid":"split-pane",className:P.default(s.default["tedi-split-pane"],s.default[`tedi-split-pane--${m}`]),children:[i.jsxs("div",{"data-testid":"split-pane-first",className:s.default["tedi-split-pane__pane"],style:{flexGrow:v},children:[a,E==="first"&&i.jsx(A,{direction:m,side:"first"})]}),i.jsxs("div",{role:"separator",tabIndex:0,"aria-orientation":l?"vertical":"horizontal","aria-valuemin":f,"aria-valuemax":h,"aria-valuenow":Math.round(v),"aria-label":g("splitPaneResize"),"data-testid":"split-pane-divider",className:s.default["tedi-split-pane__divider"],onMouseDown:q,onTouchStart:z,onKeyDown:k,children:[i.jsx("span",{"data-testid":"split-pane-handle","aria-hidden":!0,className:s.default["tedi-split-pane__handle"],children:i.jsx(I.Icon,{name:l?"code":"unfold_more",size:18})}),y&&i.jsx("div",{className:s.default["tedi-split-pane__close"],children:i.jsx(K.Button,{"data-testid":"split-pane-close",visualType:"secondary",icon:"close",onClick:y,onMouseDown:e=>e.stopPropagation(),children:g("close")})})]}),i.jsxs("div",{"data-testid":"split-pane-second",className:s.default["tedi-split-pane__pane"],style:{flexGrow:100-v},children:[d,E==="second"&&i.jsx(A,{direction:m,side:"second"})]})]})};T.displayName="SplitPane";exports.SplitPane=T;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { JSX, ReactNode } from 'react';
|
|
2
|
+
type PaneSide = 'first' | 'second';
|
|
3
|
+
type SplitPaneDirection = 'horizontal' | 'vertical';
|
|
4
|
+
export interface SplitPaneProps {
|
|
5
|
+
/** Content of the first (left in horizontal, top in vertical) pane. */
|
|
6
|
+
first: ReactNode;
|
|
7
|
+
/** Content of the second (right in horizontal, bottom in vertical) pane. */
|
|
8
|
+
second: ReactNode;
|
|
9
|
+
/** Layout axis: `horizontal` places panes side by side, `vertical` stacks them. */
|
|
10
|
+
direction: SplitPaneDirection;
|
|
11
|
+
/** Draws an accent ring around the given pane to mark it as active. */
|
|
12
|
+
highlightedSide?: PaneSide;
|
|
13
|
+
/** When provided, renders a close button on the divider. */
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Initial size of the first pane as a percentage of the container, clamped to `minRatio`–`maxRatio`.
|
|
17
|
+
* @default 50
|
|
18
|
+
*/
|
|
19
|
+
initialRatio?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Minimum size of the first pane, as a percentage of the container.
|
|
22
|
+
* @default 20
|
|
23
|
+
*/
|
|
24
|
+
minRatio?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Maximum size of the first pane, as a percentage of the container.
|
|
27
|
+
* @default 80
|
|
28
|
+
*/
|
|
29
|
+
maxRatio?: number;
|
|
30
|
+
/** Called with the final ratio (%) when a drag or keyboard adjustment event ends. */
|
|
31
|
+
onRatioChange?: (ratio: number) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const SplitPane: {
|
|
34
|
+
(props: SplitPaneProps): JSX.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
37
|
+
export default SplitPane;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { jsxs as _, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import z from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { useState as O, useRef as y, useEffect as B } from "react";
|
|
4
|
+
import { Icon as F } from "../../../../tedi/components/base/icon/icon.es.js";
|
|
5
|
+
import { Button as U } from "../../../../tedi/components/buttons/button/button.es.js";
|
|
6
|
+
import i from "./split-pane.module.scss.es.js";
|
|
7
|
+
import { useLabels as X } from "../../../../tedi/providers/label-provider/use-labels.es.js";
|
|
8
|
+
const Y = 20, j = 80, N = 2, T = (a, s, d) => Math.max(s, Math.min(d, a)), G = (a, s) => a ? s === "first" ? "right" : "left" : s === "first" ? "bottom" : "top", S = ({ direction: a, side: s }) => {
|
|
9
|
+
const d = G(a === "horizontal", s);
|
|
10
|
+
return /* @__PURE__ */ c(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
"data-testid": "active-pane-ring",
|
|
14
|
+
"aria-hidden": !0,
|
|
15
|
+
className: z(i["tedi-split-pane__ring"], i[`tedi-split-pane__ring--omit-${d}`])
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}, H = (a) => {
|
|
19
|
+
const {
|
|
20
|
+
first: s,
|
|
21
|
+
second: d,
|
|
22
|
+
direction: m,
|
|
23
|
+
highlightedSide: R,
|
|
24
|
+
onClose: g,
|
|
25
|
+
initialRatio: P = 50,
|
|
26
|
+
minRatio: p = Y,
|
|
27
|
+
maxRatio: h = j,
|
|
28
|
+
onRatioChange: E
|
|
29
|
+
} = a, { getLabel: L } = X(), [f, b] = O(() => T(P, p, h)), v = y(f), w = y(null), r = y(null), l = m === "horizontal", D = (e) => {
|
|
30
|
+
const o = T(e, p, h);
|
|
31
|
+
v.current = o, b(o);
|
|
32
|
+
}, M = (e, o) => {
|
|
33
|
+
if (!w.current)
|
|
34
|
+
return;
|
|
35
|
+
const n = w.current.getBoundingClientRect(), t = l ? n.width : n.height;
|
|
36
|
+
if (t <= 0)
|
|
37
|
+
return;
|
|
38
|
+
const u = l ? (e - n.left) / t * 100 : (o - n.top) / t * 100;
|
|
39
|
+
D(u);
|
|
40
|
+
}, x = () => {
|
|
41
|
+
E == null || E(v.current);
|
|
42
|
+
}, A = () => {
|
|
43
|
+
const e = (t) => M(t.clientX, t.clientY), o = (t) => {
|
|
44
|
+
const u = t.touches[0];
|
|
45
|
+
u && M(u.clientX, u.clientY);
|
|
46
|
+
}, n = () => {
|
|
47
|
+
var t;
|
|
48
|
+
(t = r.current) == null || t.call(r), x();
|
|
49
|
+
};
|
|
50
|
+
r.current = () => {
|
|
51
|
+
document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", n), document.removeEventListener("touchmove", o), document.removeEventListener("touchend", n), r.current = null;
|
|
52
|
+
}, document.addEventListener("mousemove", e), document.addEventListener("mouseup", n), document.addEventListener("touchmove", o), document.addEventListener("touchend", n);
|
|
53
|
+
};
|
|
54
|
+
B(() => () => {
|
|
55
|
+
var e;
|
|
56
|
+
(e = r.current) == null || e.call(r);
|
|
57
|
+
}, []);
|
|
58
|
+
const k = (e) => {
|
|
59
|
+
e.preventDefault(), A();
|
|
60
|
+
}, I = () => {
|
|
61
|
+
A();
|
|
62
|
+
}, K = (e) => {
|
|
63
|
+
const o = l ? "ArrowLeft" : "ArrowUp", n = l ? "ArrowRight" : "ArrowDown";
|
|
64
|
+
let t = null;
|
|
65
|
+
e.key === o ? t = v.current - N : e.key === n ? t = v.current + N : e.key === "Home" ? t = p : e.key === "End" && (t = h), t !== null && (e.preventDefault(), D(t), x());
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ _(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
ref: w,
|
|
71
|
+
"data-testid": "split-pane",
|
|
72
|
+
className: z(i["tedi-split-pane"], i[`tedi-split-pane--${m}`]),
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ _("div", { "data-testid": "split-pane-first", className: i["tedi-split-pane__pane"], style: { flexGrow: f }, children: [
|
|
75
|
+
s,
|
|
76
|
+
R === "first" && /* @__PURE__ */ c(S, { direction: m, side: "first" })
|
|
77
|
+
] }),
|
|
78
|
+
/* @__PURE__ */ _(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
role: "separator",
|
|
82
|
+
tabIndex: 0,
|
|
83
|
+
"aria-orientation": l ? "vertical" : "horizontal",
|
|
84
|
+
"aria-valuemin": p,
|
|
85
|
+
"aria-valuemax": h,
|
|
86
|
+
"aria-valuenow": Math.round(f),
|
|
87
|
+
"aria-label": L("splitPaneResize"),
|
|
88
|
+
"data-testid": "split-pane-divider",
|
|
89
|
+
className: i["tedi-split-pane__divider"],
|
|
90
|
+
onMouseDown: k,
|
|
91
|
+
onTouchStart: I,
|
|
92
|
+
onKeyDown: K,
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ c("span", { "data-testid": "split-pane-handle", "aria-hidden": !0, className: i["tedi-split-pane__handle"], children: /* @__PURE__ */ c(F, { name: l ? "code" : "unfold_more", size: 18 }) }),
|
|
95
|
+
g && /* @__PURE__ */ c("div", { className: i["tedi-split-pane__close"], children: /* @__PURE__ */ c(
|
|
96
|
+
U,
|
|
97
|
+
{
|
|
98
|
+
"data-testid": "split-pane-close",
|
|
99
|
+
visualType: "secondary",
|
|
100
|
+
icon: "close",
|
|
101
|
+
onClick: g,
|
|
102
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
103
|
+
children: L("close")
|
|
104
|
+
}
|
|
105
|
+
) })
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ _(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
"data-testid": "split-pane-second",
|
|
113
|
+
className: i["tedi-split-pane__pane"],
|
|
114
|
+
style: { flexGrow: 100 - f },
|
|
115
|
+
children: [
|
|
116
|
+
d,
|
|
117
|
+
R === "second" && /* @__PURE__ */ c(S, { direction: m, side: "second" })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
H.displayName = "SplitPane";
|
|
126
|
+
export {
|
|
127
|
+
H as SplitPane
|
|
128
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i={"tedi-split-pane":"tedi-split-pane-2f8739d4","tedi-split-pane--horizontal":"tedi-split-pane--horizontal-89c953f4","tedi-split-pane--vertical":"tedi-split-pane--vertical-ca3d67c4","tedi-split-pane__pane":"tedi-split-pane__pane-96c0c744","tedi-split-pane__divider":"tedi-split-pane__divider-096d4854","tedi-split-pane__handle":"tedi-split-pane__handle-373bdc4c","tedi-split-pane__close":"tedi-split-pane__close-928a5d26","tedi-split-pane__ring":"tedi-split-pane__ring-70ed59d7","tedi-split-pane__ring--omit-top":"tedi-split-pane__ring--omit-top-1037b0f4","tedi-split-pane__ring--omit-right":"tedi-split-pane__ring--omit-right-7955a195","tedi-split-pane__ring--omit-bottom":"tedi-split-pane__ring--omit-bottom-aa8724f3","tedi-split-pane__ring--omit-left":"tedi-split-pane__ring--omit-left-c20a6747"};exports.default=i;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const i = {
|
|
2
|
+
"tedi-split-pane": "tedi-split-pane-2f8739d4",
|
|
3
|
+
"tedi-split-pane--horizontal": "tedi-split-pane--horizontal-89c953f4",
|
|
4
|
+
"tedi-split-pane--vertical": "tedi-split-pane--vertical-ca3d67c4",
|
|
5
|
+
"tedi-split-pane__pane": "tedi-split-pane__pane-96c0c744",
|
|
6
|
+
"tedi-split-pane__divider": "tedi-split-pane__divider-096d4854",
|
|
7
|
+
"tedi-split-pane__handle": "tedi-split-pane__handle-373bdc4c",
|
|
8
|
+
"tedi-split-pane__close": "tedi-split-pane__close-928a5d26",
|
|
9
|
+
"tedi-split-pane__ring": "tedi-split-pane__ring-70ed59d7",
|
|
10
|
+
"tedi-split-pane__ring--omit-top": "tedi-split-pane__ring--omit-top-1037b0f4",
|
|
11
|
+
"tedi-split-pane__ring--omit-right": "tedi-split-pane__ring--omit-right-7955a195",
|
|
12
|
+
"tedi-split-pane__ring--omit-bottom": "tedi-split-pane__ring--omit-bottom-aa8724f3",
|
|
13
|
+
"tedi-split-pane__ring--omit-left": "tedi-split-pane__ring--omit-left-c20a6747"
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
i as default
|
|
17
|
+
};
|
package/src/community/index.d.ts
CHANGED
|
@@ -52,4 +52,5 @@ export * from './components/map-components/right-panel/right-panel';
|
|
|
52
52
|
export * from './components/map-components/scale-bar/scale-bar';
|
|
53
53
|
export * from './components/map-components/map-select/map-select';
|
|
54
54
|
export * from './components/map-components/sheet/sheet';
|
|
55
|
+
export * from './components/map-components/split-pane/split-pane';
|
|
55
56
|
export * from './components/map-components/timeline/timeline';
|