@tedi-design-system/react 18.1.0-rc.13 → 18.1.0-rc.15
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/_virtual/index.cjs10.js +1 -1
- package/_virtual/index.cjs11.js +1 -1
- package/_virtual/index.cjs12.js +1 -1
- package/_virtual/index.cjs13.js +1 -1
- package/_virtual/index.cjs5.js +1 -1
- package/_virtual/index.cjs6.js +1 -1
- package/_virtual/index.cjs7.js +1 -1
- package/_virtual/index.cjs8.js +1 -1
- package/_virtual/index.cjs9.js +1 -1
- package/_virtual/index.es10.js +1 -1
- package/_virtual/index.es11.js +1 -1
- package/_virtual/index.es12.js +1 -1
- package/_virtual/index.es13.js +2 -4
- package/_virtual/index.es14.js +2 -2
- package/_virtual/index.es5.js +4 -2
- package/_virtual/index.es6.js +1 -1
- package/_virtual/index.es7.js +1 -1
- package/_virtual/index.es8.js +1 -1
- package/_virtual/index.es9.js +1 -1
- package/bundle-stats.html +1 -1
- package/external/@mui/system/colorManipulator.cjs.js +1 -1
- package/external/@mui/system/colorManipulator.es.js +2 -2
- package/external/@mui/system/createStyled.cjs.js +1 -1
- package/external/@mui/system/createStyled.es.js +6 -6
- package/external/@mui/system/useThemeWithoutDefault.cjs.js +1 -1
- package/external/@mui/system/useThemeWithoutDefault.es.js +1 -1
- 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/external/react-is/index.cjs.js +1 -1
- package/external/react-is/index.es.js +1 -1
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/community/components/dropdown/dropdown.cjs.js +1 -1
- package/src/community/components/dropdown/dropdown.es.js +5 -6
- package/src/community/components/form/toggle/toggle.cjs.js +1 -1
- package/src/community/components/form/toggle/toggle.es.js +5 -6
- package/src/community/components/map-components/left-panel/left-panel-content.cjs.js +1 -1
- package/src/community/components/map-components/left-panel/left-panel-content.d.ts +10 -5
- package/src/community/components/map-components/left-panel/left-panel-content.es.js +7 -21
- package/src/community/components/map-components/left-panel/left-panel-footer.cjs.js +1 -1
- package/src/community/components/map-components/left-panel/left-panel-footer.d.ts +11 -1
- package/src/community/components/map-components/left-panel/left-panel-footer.es.js +7 -24
- package/src/community/components/map-components/left-panel/left-panel-header.cjs.js +1 -1
- package/src/community/components/map-components/left-panel/left-panel-header.d.ts +11 -1
- package/src/community/components/map-components/left-panel/left-panel-header.es.js +7 -62
- package/src/community/components/map-components/left-panel/left-panel.cjs.js +1 -1
- package/src/community/components/map-components/left-panel/left-panel.d.ts +67 -5
- package/src/community/components/map-components/left-panel/left-panel.es.js +85 -14
- package/src/community/components/map-components/left-panel/left-panel.module.scss.cjs.js +1 -1
- package/src/community/components/map-components/left-panel/left-panel.module.scss.es.js +4 -4
- package/src/community/components/map-components/resizer/resizer.cjs.js +1 -1
- package/src/community/components/map-components/resizer/resizer.es.js +9 -10
- package/src/tedi/components/layout/hide-at/hide-at.cjs.js +1 -0
- package/src/tedi/components/layout/hide-at/hide-at.es.js +10 -0
- package/src/tedi/components/layout/show-at/show-at.cjs.js +1 -0
- package/src/tedi/components/layout/show-at/show-at.es.js +10 -0
- package/src/tedi/index.d.ts +2 -0
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +21 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +23 -2
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +281 -277
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),B=require("../../../../external/classnames/index.cjs.js"),c=require("react"),K=require("../button/button.cjs.js"),a=require("./dropdown.module.scss.cjs.js"),T=require("../../../tedi/providers/label-provider/use-labels.cjs.js"),H=require("../../../../external/@floating-ui/dom/dist/floating-ui.dom.cjs.js"),D=require("../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js"),$=d=>{const{getLabel:F}=T.useLabels(),{button:_,items:u,onItemClick:l,closeMenuOnClick:h=!0,...q}=d,{initialFocus:v=-1,modal:f=!1,...p}=d.focusManager??{},{visuallyHiddenDismiss:j=f?F("close"):!1}=p??{},R=o.useFloatingNodeId(),g=c.useRef([]),[b,i]=c.useState(!1),[x,M]=c.useState(null),{x:y,y:C,strategy:N,refs:w,placement:O,context:r}=o.useFloating({placement:"bottom-start",nodeId:R,open:b,onOpenChange:i,middleware:[D.flip(),D.shift()],whileElementsMounted:H.autoUpdate}),P=u.findIndex(e=>e.isActive),{getReferenceProps:S,getFloatingProps:L,getItemProps:U}=o.useInteractions([o.useClick(r),o.useListNavigation(r,{listRef:g,activeIndex:x,selectedIndex:P,onNavigate:M,loop:!0}),o.useRole(r,{role:"listbox"}),o.useDismiss(r)]),A=()=>{const e=s.jsx(o.FloatingFocusManager,{context:r,initialFocus:v,visuallyHiddenDismiss:j,modal:f,...p,children:s.jsx("div",{...L({ref:w.setFloating,style:{position:N,left:y??0,top:C??0},className:a.default.dropdown,onKeyDown(t){t.key==="Tab"&&i(!1)}}),"data-placement":O,children:u.map((t,n)=>k(t,n))})});return b?e:null},E=e=>B.default(a.default.dropdown__item,{[a.default["dropdown__item--active"]]:e.isActive,[a.default["dropdown__item--disabled"]]:e.isDisabled}),I=(e,t,n)=>{var m;l==null||l(e,t,n),(m=e==null?void 0:e.onClick)==null||m.call(e,n),h&&i(!1)},k=(e,t)=>s.jsx("button",{...U({disabled:e.isDisabled,tabIndex:x===t?0:-1,role:"option",className:E(e),onClick:n=>I(e,t,n),onKeyDown(n){n.key==="Enter"&&I(e,t,n)},ref(n){g.current[t]=n}}),children:e.children},t);return s.jsxs(s.Fragment,{children:[s.jsx(K.Button,{"data-name":"dropdown",...q,..._,...S({ref:w.setReference,tabIndex:0})}),s.jsx(o.FloatingPortal,{children:A()})]})};exports.Dropdown=$;
|
|
@@ -7,15 +7,15 @@ import r from "./dropdown.module.scss.es.js";
|
|
|
7
7
|
import { useLabels as Y } from "../../../tedi/providers/label-provider/use-labels.es.js";
|
|
8
8
|
import { autoUpdate as Z } from "../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
|
|
9
9
|
import { flip as $, shift as ee } from "../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
|
|
10
|
-
const
|
|
11
|
-
const { getLabel: x } = Y(), { button: D, items:
|
|
10
|
+
const de = (c) => {
|
|
11
|
+
const { getLabel: x } = Y(), { button: D, items: d, onItemClick: a, closeMenuOnClick: F = !0, ...h } = c, { initialFocus: v = -1, modal: p = !1, ...f } = c.focusManager ?? {}, { visuallyHiddenDismiss: _ = p ? x("close") : !1 } = f ?? {}, R = H(), u = i.useRef([]), [m, l] = i.useState(!1), [g, M] = i.useState(null), { x: N, y, strategy: C, refs: I, placement: O, context: n } = T({
|
|
12
12
|
placement: "bottom-start",
|
|
13
13
|
nodeId: R,
|
|
14
14
|
open: m,
|
|
15
15
|
onOpenChange: l,
|
|
16
16
|
middleware: [$(), ee()],
|
|
17
17
|
whileElementsMounted: Z
|
|
18
|
-
}), P =
|
|
18
|
+
}), P = d.findIndex((e) => e.isActive), { getReferenceProps: A, getFloatingProps: E, getItemProps: L } = U([
|
|
19
19
|
q(n),
|
|
20
20
|
z(n, {
|
|
21
21
|
listRef: u,
|
|
@@ -51,7 +51,7 @@ const ce = (d) => {
|
|
|
51
51
|
}
|
|
52
52
|
}),
|
|
53
53
|
"data-placement": O,
|
|
54
|
-
children:
|
|
54
|
+
children: d.map((o, t) => k(o, t))
|
|
55
55
|
}
|
|
56
56
|
)
|
|
57
57
|
}
|
|
@@ -100,6 +100,5 @@ const ce = (d) => {
|
|
|
100
100
|
] });
|
|
101
101
|
};
|
|
102
102
|
export {
|
|
103
|
-
|
|
104
|
-
ce as default
|
|
103
|
+
de as Dropdown
|
|
105
104
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),x=require("../../../../../external/classnames/index.cjs.js"),i=require("react"),w=require("../../../../tedi/components/base/icon/icon.cjs.js"),z=require("../../../../tedi/components/loaders/spinner/spinner.cjs.js"),k=require("../../button/button.cjs.js"),e=require("./toggle.module.scss.cjs.js"),j=i.forwardRef((c,C)=>{const{ariaLabel:N,className:y,checked:n,defaultChecked:q,onChange:a,size:r=c.icon?"large":"medium",color:S="default",type:g,icon:T,disabled:u=!1,isLoading:d=!1,extraContent:f,label:m,...l}=c,[_,v]=i.useState(q||!1),o=i.useMemo(()=>a&&typeof n<"u"?n:_,[a,_,n]),$=x.default(e.default.toggle,e.default[`toggle--${r}`],e.default[`toggle--${S}`],{[e.default["toggle--active"]]:o,[e.default["toggle--disabled"]]:u,[e.default[`toggle--${g}`]]:g},y),h=()=>{if(d)return;const s=!o;typeof n>"u"&&v(s),a==null||a(s)},b={noStyle:!0,type:"button","aria-label":N,"aria-pressed":o,disabled:u,"aria-disabled":d,...l,onClick:h};return t.jsxs("div",{className:e.default["toggle-wrapper"],children:[t.jsx(k.Button,{...b,onClick:s=>{var p;(p=l==null?void 0:l.onClick)==null||p.call(l,s),h()},ref:C,"data-name":"toggle",className:$,children:t.jsx("span",{className:e.default.toggle__dot,children:d?t.jsx(z.Spinner,{size:r==="large"?16:10,className:x.default(e.default.toggle__icon,e.default.toggle__spinner)}):T?t.jsx(w.Icon,{className:e.default.toggle__icon,name:o?"lock_open_right":"lock",size:16}):null})}),m&&t.jsx(k.Button,{...b,className:e.default.toggle__label,"aria-hidden":!0,tabIndex:-1,children:m}),f&&t.jsx("div",{className:e.default["toggle__extra-content"],children:f})]})});j.displayName="Toggle";exports.Toggle=j;
|
|
@@ -9,9 +9,9 @@ const L = $((r, C) => {
|
|
|
9
9
|
const {
|
|
10
10
|
ariaLabel: y,
|
|
11
11
|
className: x,
|
|
12
|
-
checked:
|
|
12
|
+
checked: a,
|
|
13
13
|
defaultChecked: v,
|
|
14
|
-
onChange:
|
|
14
|
+
onChange: l,
|
|
15
15
|
size: c = r.icon ? "large" : "medium",
|
|
16
16
|
color: w = "default",
|
|
17
17
|
type: g,
|
|
@@ -21,7 +21,7 @@ const L = $((r, C) => {
|
|
|
21
21
|
extraContent: m,
|
|
22
22
|
label: f,
|
|
23
23
|
...o
|
|
24
|
-
} = r, [p, I] = b.useState(v || !1), n = b.useMemo(() =>
|
|
24
|
+
} = r, [p, I] = b.useState(v || !1), n = b.useMemo(() => l && typeof a < "u" ? a : p, [l, p, a]), S = k(
|
|
25
25
|
e.toggle,
|
|
26
26
|
e[`toggle--${c}`],
|
|
27
27
|
e[`toggle--${w}`],
|
|
@@ -35,7 +35,7 @@ const L = $((r, C) => {
|
|
|
35
35
|
if (i)
|
|
36
36
|
return;
|
|
37
37
|
const s = !n;
|
|
38
|
-
typeof
|
|
38
|
+
typeof a > "u" && I(s), l == null || l(s);
|
|
39
39
|
}, _ = {
|
|
40
40
|
noStyle: !0,
|
|
41
41
|
type: "button",
|
|
@@ -73,6 +73,5 @@ const L = $((r, C) => {
|
|
|
73
73
|
});
|
|
74
74
|
L.displayName = "Toggle";
|
|
75
75
|
export {
|
|
76
|
-
L as Toggle
|
|
77
|
-
L as default
|
|
76
|
+
L as Toggle
|
|
78
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),a=require("../../../../../external/classnames/index.cjs.js"),o=require("./left-panel.module.scss.cjs.js"),e=({className:t,children:n})=>l.jsx("div",{className:a.default(o.default["tedi-left-panel__content-wrapper"],t),children:n});e.displayName="LeftPanel.Content";exports.LeftPanelContent=e;exports.default=e;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { JSX, ReactNode } from 'react';
|
|
2
|
+
export interface LeftPanelContentProps {
|
|
3
|
+
/** Additional class name applied to the content region. */
|
|
4
|
+
className?: string;
|
|
5
|
+
/** Main scrollable content of the panel. */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const LeftPanelContent: {
|
|
9
|
+
({ className, children }: LeftPanelContentProps): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
5
11
|
};
|
|
6
|
-
declare const LeftPanelContent: ({ showAlert, show2D3DButtons, children, }: LeftPanelContentProps) => JSX.Element;
|
|
7
12
|
export default LeftPanelContent;
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { VerticalSpacing as d } from "../../../../tedi/components/layout/vertical-spacing/vertical-spacing.es.js";
|
|
7
|
-
const _ = ({
|
|
8
|
-
showAlert: r = !0,
|
|
9
|
-
show2D3DButtons: l = !0,
|
|
10
|
-
children: s
|
|
11
|
-
}) => /* @__PURE__ */ t("div", { className: i["tedi-left-panel__content-wrapper"], children: [
|
|
12
|
-
r || l && /* @__PURE__ */ t("div", { className: i["tedi-left-panel__content"], children: [
|
|
13
|
-
r && /* @__PURE__ */ e(c, { className: i["tedi-left-panel__alert"], children: "Kõikide sisselülitatud kihtide kuvamiseks tuleb sisse suumida." }),
|
|
14
|
-
/* @__PURE__ */ e(d, { size: 0.5, children: l && /* @__PURE__ */ t(a, { type: "primary", stretch: !0, children: [
|
|
15
|
-
/* @__PURE__ */ e(n, { id: "1", isActive: !0, iconLeft: "checked", children: "2D" }),
|
|
16
|
-
/* @__PURE__ */ e(n, { id: "2", children: "3D" })
|
|
17
|
-
] }) })
|
|
18
|
-
] }),
|
|
19
|
-
s
|
|
20
|
-
] });
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import o from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import s from "./left-panel.module.scss.es.js";
|
|
4
|
+
const n = ({ className: e, children: t }) => /* @__PURE__ */ a("div", { className: o(s["tedi-left-panel__content-wrapper"], e), children: t });
|
|
5
|
+
n.displayName = "LeftPanel.Content";
|
|
21
6
|
export {
|
|
22
|
-
|
|
7
|
+
n as LeftPanelContent,
|
|
8
|
+
n as default
|
|
23
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),a=require("../../../../../external/classnames/index.cjs.js"),r=require("./left-panel.module.scss.cjs.js"),e=({className:t,children:l})=>o.jsx("div",{className:a.default(r.default["tedi-left-panel__footer"],t),children:l});e.displayName="LeftPanel.Footer";exports.LeftPanelFooter=e;exports.default=e;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { JSX, ReactNode } from 'react';
|
|
2
|
+
export interface LeftPanelFooterProps {
|
|
3
|
+
/** Additional class name applied to the footer region. */
|
|
4
|
+
className?: string;
|
|
5
|
+
/** Content placed in the gray footer area. */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const LeftPanelFooter: {
|
|
9
|
+
({ className, children }: LeftPanelFooterProps): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
2
12
|
export default LeftPanelFooter;
|
|
@@ -1,26 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import d from "./left-panel.module.scss.es.js";
|
|
7
|
-
import { Row as o } from "../../../../tedi/components/layout/grid/row.es.js";
|
|
8
|
-
import { Col as r } from "../../../../tedi/components/layout/grid/col.es.js";
|
|
9
|
-
const k = () => /* @__PURE__ */ i("div", { className: d["tedi-left-panel__footer"], children: [
|
|
10
|
-
/* @__PURE__ */ i("div", { className: d["tedi-left-panel__footer__theme-switch"], children: [
|
|
11
|
-
/* @__PURE__ */ e(t, { ariaLabel: "Toggle dark mode", label: /* @__PURE__ */ e(l, { children: "Tume režiim" }) }),
|
|
12
|
-
/* @__PURE__ */ e(m, { color: "primary", spacing: 1 })
|
|
13
|
-
] }),
|
|
14
|
-
/* @__PURE__ */ i(o, { children: [
|
|
15
|
-
/* @__PURE__ */ e(r, { width: "auto", children: /* @__PURE__ */ e(l, { color: "secondary", modifiers: "small", children: "Tehniline tugi" }) }),
|
|
16
|
-
/* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(a, { href: "#", size: "small", children: "kaardirakendus@maaruum.ee" }) })
|
|
17
|
-
] }),
|
|
18
|
-
/* @__PURE__ */ i(o, { children: [
|
|
19
|
-
/* @__PURE__ */ e(r, { width: "auto", children: /* @__PURE__ */ e(l, { color: "secondary", modifiers: "small", children: "Telefon" }) }),
|
|
20
|
-
/* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(a, { href: "#", size: "small", children: "6 650 600" }) })
|
|
21
|
-
] }),
|
|
22
|
-
/* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(l, { color: "secondary", modifiers: "small", children: "Maa- ja Ruumiamet. Kõik õigused kaitstud." }) }) })
|
|
23
|
-
] });
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import a from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import s from "./left-panel.module.scss.es.js";
|
|
4
|
+
const r = ({ className: e, children: o }) => /* @__PURE__ */ t("div", { className: a(s["tedi-left-panel__footer"], e), children: o });
|
|
5
|
+
r.displayName = "LeftPanel.Footer";
|
|
24
6
|
export {
|
|
25
|
-
|
|
7
|
+
r as LeftPanelFooter,
|
|
8
|
+
r as default
|
|
26
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),r=require("../../../../../external/classnames/index.cjs.js"),d=require("./left-panel.module.scss.cjs.js"),e=({className:t,children:a})=>l.jsx("div",{className:r.default(d.default["tedi-left-panel__header-controls"],t),children:a});e.displayName="LeftPanel.Header";exports.LeftPanelHeader=e;exports.default=e;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { JSX, ReactNode } from 'react';
|
|
2
|
+
export interface LeftPanelHeaderProps {
|
|
3
|
+
/** Additional class name applied to the header region. */
|
|
4
|
+
className?: string;
|
|
5
|
+
/** Content placed in the blue header area, under the icon. */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const LeftPanelHeader: {
|
|
9
|
+
({ className, children }: LeftPanelHeaderProps): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
2
12
|
export default LeftPanelHeader;
|
|
@@ -1,64 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const f = () => /* @__PURE__ */ i(n, { children: [
|
|
7
|
-
/* @__PURE__ */ i("div", { className: t["tedi-left-panel__header"], children: [
|
|
8
|
-
/* @__PURE__ */ e(
|
|
9
|
-
"img",
|
|
10
|
-
{
|
|
11
|
-
src: "logo.svg",
|
|
12
|
-
alt: "logo",
|
|
13
|
-
style: { filter: "brightness(0) saturate(100%) invert(100%)", height: "40px" }
|
|
14
|
-
}
|
|
15
|
-
),
|
|
16
|
-
/* @__PURE__ */ e(r, { name: "close", color: "white" })
|
|
17
|
-
] }),
|
|
18
|
-
/* @__PURE__ */ i("div", { className: t["tedi-left-panel__header-controls"], children: [
|
|
19
|
-
/* @__PURE__ */ e(
|
|
20
|
-
l,
|
|
21
|
-
{
|
|
22
|
-
onClick: () => {
|
|
23
|
-
console.log("Log in");
|
|
24
|
-
},
|
|
25
|
-
color: "inverted",
|
|
26
|
-
iconLeft: "logout",
|
|
27
|
-
visualType: "neutral",
|
|
28
|
-
children: "Logi sisse"
|
|
29
|
-
}
|
|
30
|
-
),
|
|
31
|
-
/* @__PURE__ */ e(
|
|
32
|
-
c,
|
|
33
|
-
{
|
|
34
|
-
button: {
|
|
35
|
-
children: "EST",
|
|
36
|
-
iconRight: "expand_more",
|
|
37
|
-
visualType: "link",
|
|
38
|
-
color: "inverted"
|
|
39
|
-
},
|
|
40
|
-
items: [
|
|
41
|
-
{
|
|
42
|
-
children: "EST",
|
|
43
|
-
onClick: function() {
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
children: "ENG",
|
|
48
|
-
isActive: !0,
|
|
49
|
-
onClick: function() {
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
children: "RUS",
|
|
54
|
-
onClick: function() {
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
] })
|
|
61
|
-
] });
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import t from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import r from "./left-panel.module.scss.es.js";
|
|
4
|
+
const l = ({ className: e, children: a }) => /* @__PURE__ */ s("div", { className: t(r["tedi-left-panel__header-controls"], e), children: a });
|
|
5
|
+
l.displayName = "LeftPanel.Header";
|
|
62
6
|
export {
|
|
63
|
-
|
|
7
|
+
l as LeftPanelHeader,
|
|
8
|
+
l as default
|
|
64
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),S=require("../../../../../external/classnames/index.cjs.js"),l=require("react"),B=require("../../../../tedi/components/base/icon/icon.cjs.js"),M=require("../../../../tedi/components/buttons/closing-button/closing-button.cjs.js"),O=require("../../../../tedi/components/buttons/button/button.cjs.js"),V=require("../resizer/resizer.cjs.js"),n=require("./left-panel.module.scss.cjs.js"),y=require("./left-panel-content.cjs.js"),N=require("./left-panel-footer.cjs.js"),R=require("./left-panel-header.cjs.js"),W=require("../../../../tedi/providers/label-provider/use-labels.cjs.js"),m=(o,i)=>{let a=null;return l.Children.forEach(o,e=>{l.isValidElement(e)&&e.type===i&&(a=e)}),a},g=({className:o,icon:i,hideCloseButton:a=!1,hideOpenButton:e=!1,defaultOpen:v=!0,open:p,onOpenChange:c,resizable:_=!0,children:u,width:L=350,minWidth:F=350,maxWidth:H=600})=>{const{getLabel:f}=W.useLabels(),d=l.useId(),b=p!==void 0,[I,h]=l.useState(v),s=b?p:I,P=l.useRef(!1),q=l.useRef(null),x=r=>{P.current=!0,b||h(r),c==null||c(r)};if(l.useEffect(()=>{var r;P.current&&(P.current=!1,!s&&!e&&((r=q.current)==null||r.focus()))},[s,e]),!s&&e)return null;if(!s)return t.jsx(O.Button,{ref:q,"aria-label":f("leftPanelOpen"),"aria-controls":d,"aria-expanded":!1,noStyle:!0,onClick:()=>x(!0),className:n.default["tedi-left-panel__expander-button"],children:t.jsx(B.Icon,{name:"keyboard_double_arrow_right",color:"brand"})});const k=S.default(n.default["tedi-left-panel"],o),E=_?void 0:{width:L},j=m(u,R.LeftPanelHeader),T=m(u,y.LeftPanelContent),w=m(u,N.LeftPanelFooter),z=S.default(n.default["tedi-left-panel__header"],{[n.default["tedi-left-panel__header--rounded"]]:!j}),C=t.jsxs("aside",{id:d,"aria-label":f("leftPanel"),className:k,style:E,children:[t.jsxs("div",{className:n.default["tedi-left-panel__actions"],children:[t.jsxs("div",{className:z,children:[i,!a&&t.jsx(M.ClosingButton,{className:n.default["tedi-left-panel__close"],color:"white",onClick:()=>x(!1),title:f("leftPanelClose"),"aria-controls":d,"aria-expanded":!0})]}),j,T]}),w]});return _?t.jsx(V.Resizer,{minWidth:F,initialWidth:L,maxWidth:H,children:C}):C};g.displayName="LeftPanel";const A=Object.assign(g,{Header:R.LeftPanelHeader,Content:y.LeftPanelContent,Footer:N.LeftPanelFooter});exports.LeftPanel=A;
|
|
@@ -1,8 +1,70 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
1
|
+
import { JSX, ReactNode } from 'react';
|
|
2
|
+
import { LeftPanelContentProps } from './left-panel-content';
|
|
3
|
+
import { LeftPanelFooterProps } from './left-panel-footer';
|
|
4
|
+
import { LeftPanelHeaderProps } from './left-panel-header';
|
|
5
|
+
export type { LeftPanelContentProps, LeftPanelFooterProps, LeftPanelHeaderProps };
|
|
2
6
|
export interface LeftPanelProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
/** Additional class name applied to the panel root. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Icon shown on the left of the (blue) header. */
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Hide the close button that collapses the panel.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
hideCloseButton?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Hide the reopen button shown when collapsed.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
hideOpenButton?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Uncontrolled initial open state. Ignored when `open` is provided.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
defaultOpen?: boolean;
|
|
26
|
+
/** Controlled open state. When set, the component does not manage its own state. */
|
|
27
|
+
open?: boolean;
|
|
28
|
+
/** Notified whenever the panel wants to open or close. */
|
|
29
|
+
onOpenChange?: (open: boolean) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Allow the user to drag-resize the panel width.
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
resizable?: boolean;
|
|
35
|
+
/** `LeftPanel.Header`, `LeftPanel.Content` and `LeftPanel.Footer`. */
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Panel width in pixels. Initial width when resizable, fixed width otherwise.
|
|
39
|
+
* @default 350
|
|
40
|
+
*/
|
|
41
|
+
width?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Maximum resize width in pixels. Only applies when resizable.
|
|
44
|
+
* @default 600
|
|
45
|
+
*/
|
|
46
|
+
maxWidth?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Minimum resize width in pixels. Only applies when resizable.
|
|
49
|
+
* @default 350
|
|
50
|
+
*/
|
|
51
|
+
minWidth?: number;
|
|
6
52
|
}
|
|
7
|
-
export declare const LeftPanel:
|
|
53
|
+
export declare const LeftPanel: {
|
|
54
|
+
({ className, icon, hideCloseButton, hideOpenButton, defaultOpen, open, onOpenChange, resizable, children, width, minWidth, maxWidth, }: LeftPanelProps): JSX.Element | null;
|
|
55
|
+
displayName: string;
|
|
56
|
+
} & {
|
|
57
|
+
Header: {
|
|
58
|
+
({ className, children }: LeftPanelHeaderProps): JSX.Element;
|
|
59
|
+
displayName: string;
|
|
60
|
+
};
|
|
61
|
+
Content: {
|
|
62
|
+
({ className, children }: LeftPanelContentProps): JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
Footer: {
|
|
66
|
+
({ className, children }: LeftPanelFooterProps): JSX.Element;
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
8
70
|
export default LeftPanel;
|
|
@@ -1,16 +1,87 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx as a, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import x from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { useId as z, useState as A, useRef as v, useEffect as B, Children as D, isValidElement as G } from "react";
|
|
4
|
+
import { Icon as J } from "../../../../tedi/components/base/icon/icon.es.js";
|
|
5
|
+
import { ClosingButton as K } from "../../../../tedi/components/buttons/closing-button/closing-button.es.js";
|
|
6
|
+
import { Button as M } from "../../../../tedi/components/buttons/button/button.es.js";
|
|
7
|
+
import { Resizer as O } from "../resizer/resizer.es.js";
|
|
8
|
+
import t from "./left-panel.module.scss.es.js";
|
|
9
|
+
import { LeftPanelContent as I } from "./left-panel-content.es.js";
|
|
10
|
+
import { LeftPanelFooter as R } from "./left-panel-footer.es.js";
|
|
11
|
+
import { LeftPanelHeader as h } from "./left-panel-header.es.js";
|
|
12
|
+
import { useLabels as Q } from "../../../../tedi/providers/label-provider/use-labels.es.js";
|
|
13
|
+
const p = (n, s) => {
|
|
14
|
+
let o = null;
|
|
15
|
+
return D.forEach(n, (e) => {
|
|
16
|
+
G(e) && e.type === s && (o = e);
|
|
17
|
+
}), o;
|
|
18
|
+
}, j = ({
|
|
19
|
+
className: n,
|
|
20
|
+
icon: s,
|
|
21
|
+
hideCloseButton: o = !1,
|
|
22
|
+
hideOpenButton: e = !1,
|
|
23
|
+
defaultOpen: k = !0,
|
|
24
|
+
open: _,
|
|
25
|
+
onOpenChange: i,
|
|
26
|
+
resizable: N = !0,
|
|
27
|
+
children: f,
|
|
28
|
+
width: P = 350,
|
|
29
|
+
minWidth: E = 350,
|
|
30
|
+
maxWidth: g = 600
|
|
31
|
+
}) => {
|
|
32
|
+
const { getLabel: c } = Q(), d = z(), b = _ !== void 0, [F, H] = A(k), l = b ? _ : F, m = v(!1), L = v(null), y = (r) => {
|
|
33
|
+
m.current = !0, b || H(r), i == null || i(r);
|
|
34
|
+
};
|
|
35
|
+
if (B(() => {
|
|
36
|
+
var r;
|
|
37
|
+
m.current && (m.current = !1, !l && !e && ((r = L.current) == null || r.focus()));
|
|
38
|
+
}, [l, e]), !l && e)
|
|
39
|
+
return null;
|
|
40
|
+
if (!l)
|
|
41
|
+
return /* @__PURE__ */ a(
|
|
42
|
+
M,
|
|
43
|
+
{
|
|
44
|
+
ref: L,
|
|
45
|
+
"aria-label": c("leftPanelOpen"),
|
|
46
|
+
"aria-controls": d,
|
|
47
|
+
"aria-expanded": !1,
|
|
48
|
+
noStyle: !0,
|
|
49
|
+
onClick: () => y(!0),
|
|
50
|
+
className: t["tedi-left-panel__expander-button"],
|
|
51
|
+
children: /* @__PURE__ */ a(J, { name: "keyboard_double_arrow_right", color: "brand" })
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
const w = x(t["tedi-left-panel"], n), T = N ? void 0 : { width: P }, C = p(f, h), V = p(f, I), W = p(f, R), q = x(t["tedi-left-panel__header"], {
|
|
55
|
+
[t["tedi-left-panel__header--rounded"]]: !C
|
|
56
|
+
}), S = /* @__PURE__ */ u("aside", { id: d, "aria-label": c("leftPanel"), className: w, style: T, children: [
|
|
57
|
+
/* @__PURE__ */ u("div", { className: t["tedi-left-panel__actions"], children: [
|
|
58
|
+
/* @__PURE__ */ u("div", { className: q, children: [
|
|
59
|
+
s,
|
|
60
|
+
!o && /* @__PURE__ */ a(
|
|
61
|
+
K,
|
|
62
|
+
{
|
|
63
|
+
className: t["tedi-left-panel__close"],
|
|
64
|
+
color: "white",
|
|
65
|
+
onClick: () => y(!1),
|
|
66
|
+
title: c("leftPanelClose"),
|
|
67
|
+
"aria-controls": d,
|
|
68
|
+
"aria-expanded": !0
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] }),
|
|
72
|
+
C,
|
|
73
|
+
V
|
|
74
|
+
] }),
|
|
75
|
+
W
|
|
76
|
+
] });
|
|
77
|
+
return N ? /* @__PURE__ */ a(O, { minWidth: E, initialWidth: P, maxWidth: g, children: S }) : S;
|
|
78
|
+
};
|
|
79
|
+
j.displayName = "LeftPanel";
|
|
80
|
+
const se = Object.assign(j, {
|
|
81
|
+
Header: h,
|
|
82
|
+
Content: I,
|
|
83
|
+
Footer: R
|
|
84
|
+
});
|
|
14
85
|
export {
|
|
15
|
-
|
|
86
|
+
se as LeftPanel
|
|
16
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-left-panel":"tedi-left-panel-13d31e79","tedi-left-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-left-panel":"tedi-left-panel-13d31e79","tedi-left-panel__header":"tedi-left-panel__header-c0424743","tedi-left-panel__close":"tedi-left-panel__close-79045a44","tedi-left-panel__footer":"tedi-left-panel__footer-673c7499","tedi-left-panel__header-controls":"tedi-left-panel__header-controls-4f3151da","tedi-left-panel__actions":"tedi-left-panel__actions-f90416f1","tedi-left-panel__content-wrapper":"tedi-left-panel__content-wrapper-a8939393","tedi-left-panel__expander-button":"tedi-left-panel__expander-button-8d65cded"};exports.default=e;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const e = {
|
|
2
2
|
"tedi-left-panel": "tedi-left-panel-13d31e79",
|
|
3
|
-
"tedi-left-panel__alert": "tedi-left-panel__alert-ab0beebf",
|
|
4
3
|
"tedi-left-panel__header": "tedi-left-panel__header-c0424743",
|
|
5
|
-
"tedi-left-
|
|
4
|
+
"tedi-left-panel__close": "tedi-left-panel__close-79045a44",
|
|
6
5
|
"tedi-left-panel__footer": "tedi-left-panel__footer-673c7499",
|
|
7
|
-
"tedi-left-panel__footer__theme-switch": "tedi-left-panel__footer__theme-switch-f7e013a8",
|
|
8
6
|
"tedi-left-panel__header-controls": "tedi-left-panel__header-controls-4f3151da",
|
|
9
|
-
"tedi-left-
|
|
7
|
+
"tedi-left-panel__actions": "tedi-left-panel__actions-f90416f1",
|
|
8
|
+
"tedi-left-panel__content-wrapper": "tedi-left-panel__content-wrapper-a8939393",
|
|
9
|
+
"tedi-left-panel__expander-button": "tedi-left-panel__expander-button-8d65cded"
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
12
12
|
e as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),r=require("react"),z=require("../../../../tedi/components/base/icon/icon.cjs.js"),s=require("./resizer.module.scss.cjs.js"),D=j=>{const{children:R,minWidth:a=300,maxWidth:d=600,initialWidth:g=350,minHeight:c=200,maxHeight:h=600,initialHeight:x=350,className:b,handlePosition:e="right",showIndicator:w=!1}=j,p=r.useRef(null),u=r.useRef(!1),t=r.useRef({x:0,y:0,width:g,height:x}),[o,$]=r.useState({width:g,height:x});r.useEffect(()=>{const n=l=>{if(!u.current||!p.current)return;l.preventDefault();const M=l.clientX-t.current.x,_=l.clientY-t.current.y;$(y=>{let m=y.width,f=y.height;return e==="right"?m=Math.min(Math.max(t.current.width+M,a),d):e==="left"?m=Math.min(Math.max(t.current.width-M,a),d):e==="bottom"?f=Math.min(Math.max(t.current.height+_,c),h):e==="top"&&(f=Math.min(Math.max(t.current.height-_,c),h)),{width:m,height:f}})},v=()=>{u.current=!1,document.body.style.userSelect=""};return document.addEventListener("mousemove",n),document.addEventListener("mouseup",v),()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",v)}},[e,a,d,c,h]);const N=n=>{n.preventDefault(),u.current=!0,document.body.style.userSelect="none",t.current={x:n.clientX,y:n.clientY,width:o.width,height:o.height}};return i.jsxs("div",{ref:p,className:`${s.default["tedi-resize__wrapper"]} ${b||""}`,style:{width:`${o.width}px`,height:e==="top"||e==="bottom"?`${o.height}px`:"auto",position:"relative",display:"block"},children:[i.jsx("div",{className:s.default["tedi-resize__content"],children:R}),i.jsxs("div",{className:`${s.default["tedi-resize__handle-wrapper"]} ${s.default[`direction-${e}`]}`,onMouseDown:N,"data-show-indicator":w,children:[i.jsx("div",{className:s.default["tedi-resize__drag-handle"],children:i.jsx(z.Icon,{name:"drag_handle",size:18})}),!w&&i.jsx("div",{className:s.default["tedi-resize__drag-indicator"],children:i.jsx(z.Icon,{name:"drag_handle",color:"brand",size:18})})]})]})};exports.Resizer=D;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as z, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
2
|
+
import { useRef as g, useState as L, useEffect as R } from "react";
|
|
3
3
|
import { Icon as $ } from "../../../../tedi/components/base/icon/icon.es.js";
|
|
4
4
|
import n from "./resizer.module.scss.es.js";
|
|
5
5
|
const P = (b) => {
|
|
@@ -7,21 +7,21 @@ const P = (b) => {
|
|
|
7
7
|
children: N,
|
|
8
8
|
minWidth: o = 300,
|
|
9
9
|
maxWidth: a = 600,
|
|
10
|
-
initialWidth:
|
|
10
|
+
initialWidth: p = 350,
|
|
11
11
|
minHeight: d = 200,
|
|
12
12
|
maxHeight: h = 600,
|
|
13
|
-
initialHeight:
|
|
13
|
+
initialHeight: f = 350,
|
|
14
14
|
className: D,
|
|
15
15
|
handlePosition: e = "right",
|
|
16
16
|
showIndicator: w = !1
|
|
17
|
-
} = b, v =
|
|
17
|
+
} = b, v = g(null), c = g(!1), t = g({
|
|
18
18
|
x: 0,
|
|
19
19
|
y: 0,
|
|
20
|
-
width:
|
|
21
|
-
height:
|
|
20
|
+
width: p,
|
|
21
|
+
height: f
|
|
22
22
|
}), [s, E] = L({
|
|
23
|
-
width:
|
|
24
|
-
height:
|
|
23
|
+
width: p,
|
|
24
|
+
height: f
|
|
25
25
|
});
|
|
26
26
|
R(() => {
|
|
27
27
|
const i = (l) => {
|
|
@@ -77,6 +77,5 @@ const P = (b) => {
|
|
|
77
77
|
);
|
|
78
78
|
};
|
|
79
79
|
export {
|
|
80
|
-
P as Resizer
|
|
81
|
-
P as default
|
|
80
|
+
P as Resizer
|
|
82
81
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../../../helpers/hooks/use-breakpoint.cjs.js"),r=({children:i,...n})=>{const s=t.default();return Object.entries(n).some(([u,o])=>o?!t.isBreakpointBelow(s,u):!1)?null:e.jsx(e.Fragment,{children:i})};r.displayName="HideAt";exports.HideAt=r;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as n, Fragment as s } from "react/jsx-runtime";
|
|
2
|
+
import u, { isBreakpointBelow as d } from "../../../helpers/hooks/use-breakpoint.es.js";
|
|
3
|
+
const l = ({ children: e, ...r }) => {
|
|
4
|
+
const t = u();
|
|
5
|
+
return Object.entries(r).some(([o, i]) => i ? !d(t, o) : !1) ? null : /* @__PURE__ */ n(s, { children: e });
|
|
6
|
+
};
|
|
7
|
+
l.displayName = "HideAt";
|
|
8
|
+
export {
|
|
9
|
+
l as HideAt
|
|
10
|
+
};
|