@tedi-design-system/react 18.0.0-rc.4 → 18.0.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/_virtual/index.es13.js +2 -2
- package/_virtual/index.es14.js +2 -2
- package/bundle-stats.html +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/tedi/components/buttons/button-group/button-group.cjs.js +1 -1
- package/src/tedi/components/buttons/button-group/button-group.es.js +4 -4
- package/src/tedi/components/buttons/collapse/collapse.cjs.js +1 -1
- package/src/tedi/components/buttons/collapse/collapse.d.ts +15 -0
- package/src/tedi/components/buttons/collapse/collapse.es.js +55 -54
- package/src/tedi/components/content/calendar/calendar.cjs.js +1 -1
- package/src/tedi/components/content/calendar/calendar.d.ts +9 -1
- package/src/tedi/components/content/calendar/calendar.es.js +72 -71
- package/src/tedi/components/content/calendar/calendar.module.scss.cjs.js +1 -1
- package/src/tedi/components/content/calendar/calendar.module.scss.es.js +3 -2
- package/src/tedi/components/content/table/index.d.ts +6 -0
- package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.cjs.js +1 -0
- package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.d.ts +15 -0
- package/src/tedi/components/content/table/table-columns-menu/table-columns-menu.es.js +37 -0
- package/src/tedi/components/content/table/table-context.cjs.js +1 -0
- package/src/tedi/components/content/table/table-context.d.ts +3 -0
- package/src/tedi/components/content/table/table-context.es.js +11 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.cjs.js +1 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.d.ts +51 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.es.js +42 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.module.scss.cjs.js +1 -0
- package/src/tedi/components/content/table/table-header-button/table-header-button.module.scss.es.js +7 -0
- package/src/tedi/components/content/table/table-toolbar/table-toolbar.cjs.js +1 -0
- package/src/tedi/components/content/table/table-toolbar/table-toolbar.d.ts +21 -0
- package/src/tedi/components/content/table/table-toolbar/table-toolbar.es.js +9 -0
- package/src/tedi/components/content/table/table.cjs.js +1 -0
- package/src/tedi/components/content/table/table.d.ts +519 -0
- package/src/tedi/components/content/table/table.es.js +856 -0
- package/src/tedi/components/content/table/table.module.scss.cjs.js +1 -0
- package/src/tedi/components/content/table/table.module.scss.es.js +54 -0
- package/src/tedi/components/content/table/use-table-persistence.cjs.js +1 -0
- package/src/tedi/components/content/table/use-table-persistence.d.ts +13 -0
- package/src/tedi/components/content/table/use-table-persistence.es.js +53 -0
- package/src/tedi/components/filter/filter/filter-group-context.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter-group-context.d.ts +8 -0
- package/src/tedi/components/filter/filter/filter-group-context.es.js +5 -0
- package/src/tedi/components/filter/filter/filter-group.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter-group.d.ts +94 -0
- package/src/tedi/components/filter/filter/filter-group.es.js +64 -0
- package/src/tedi/components/filter/filter/filter.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter.d.ts +98 -0
- package/src/tedi/components/filter/filter/filter.es.js +236 -0
- package/src/tedi/components/filter/filter/filter.module.scss.cjs.js +1 -0
- package/src/tedi/components/filter/filter/filter.module.scss.es.js +21 -0
- package/src/tedi/components/filter/filter/index.d.ts +3 -0
- package/src/tedi/components/form/search/search.cjs.js +1 -1
- package/src/tedi/components/form/search/search.es.js +22 -20
- package/src/tedi/components/navigation/pagination/pagination.cjs.js +1 -1
- package/src/tedi/components/navigation/pagination/pagination.d.ts +7 -0
- package/src/tedi/components/navigation/pagination/pagination.es.js +132 -91
- package/src/tedi/components/navigation/pagination/pagination.module.scss.cjs.js +1 -1
- package/src/tedi/components/navigation/pagination/pagination.module.scss.es.js +7 -1
- package/src/tedi/components/navigation/pagination/pagination.types.d.ts +100 -0
- package/src/tedi/components/overlays/tooltip/tooltip.cjs.js +1 -1
- package/src/tedi/components/overlays/tooltip/tooltip.es.js +14 -6
- 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 +146 -6
- package/src/tedi/providers/label-provider/labels-map.es.js +163 -14
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +205 -185
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),g=require("../../../../../external/classnames/index.cjs.js"),_=require("react"),n=require("../../base/icon/icon.cjs.js"),x=require("../button/button.cjs.js"),r=require("./button-group.module.scss.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),g=require("../../../../../external/classnames/index.cjs.js"),_=require("react"),n=require("../../base/icon/icon.cjs.js"),x=require("../button/button.cjs.js"),r=require("./button-group.module.scss.cjs.js"),C=require("../../../providers/label-provider/use-labels.cjs.js"),L=require("../../../helpers/hooks/use-breakpoint.cjs.js"),l=require("../../overlays/dropdown/dropdown.cjs.js"),b=k=>{const{getLabel:j}=C.useLabels(),{children:q,className:w,type:c="primary",onSelectionChange:i,stretch:v=!1,ariaLabel:I,size:f="default",enableMobileDropdown:A=!1,mobileBreakpoint:N="md",dropdownLabel:y=j("sidenav.submenu"),dropdownLabelMode:R="static"}=k,B=L.useBreakpoint(),D=L.isBreakpointBelow(B,N),m=_.Children.toArray(q).filter(e=>_.isValidElement(e)&&e.type===x.Button),s=m.find(e=>e.props.isActive),M=R==="static"?y:(s==null?void 0:s.props.children)??y,a=s==null?void 0:s.props.iconLeft,d=s==null?void 0:s.props.icon;return D&&A?o.jsxs(l.Dropdown,{width:"trigger",children:[o.jsx(l.Dropdown.Trigger,{children:o.jsxs(x.Button,{visualType:c,className:g.default(r.default["tedi-button-group__dropdown-trigger"],r.default[`tedi-button-group__dropdown-trigger--${c}`],w),noStyle:!0,fullWidth:!0,children:[a?o.jsx(n.Icon,{name:typeof a=="string"?a:a.name,color:"inherit"}):d?o.jsx(n.Icon,{name:typeof d=="string"?d:d.name,color:"inherit"}):o.jsx(n.Icon,{name:"menu",color:"inherit"}),M]})}),o.jsx(l.Dropdown.Content,{children:m.map((e,u)=>o.jsxs(l.Dropdown.Item,{index:u,active:e==null?void 0:e.props.isActive,disabled:e==null?void 0:e.props.disabled,onClick:t=>{var p,h;e.props.disabled||(t.type==="click"&&((h=(p=e.props).onClick)==null||h.call(p,t)),e.props.id&&(i==null||i(e.props.id)))},className:r.default["tedi-button-group__dropdown-item"],children:[e.props.iconLeft&&o.jsx(n.Icon,{name:typeof e.props.iconLeft=="string"?e.props.iconLeft:e.props.iconLeft.name,color:"inherit"}),e.props.children,e.props.iconRight&&o.jsx(n.Icon,{name:typeof e.props.iconRight=="string"?e.props.iconRight:e.props.iconRight.name,color:"inherit"}),e.props.isActive&&o.jsx("span",{className:"sr-only",children:j("button-group.selected")})]},e.props.id||u))})]}):o.jsx("div",{className:g.default(r.default["tedi-button-group"],r.default[`tedi-button-group--${c}`],{[r.default["tedi-button-group--stretch"]]:v},w),role:"group","aria-label":I,children:m.map(e=>_.cloneElement(e,{className:g.default(r.default["tedi-button-group__item"],{[r.default["tedi-button-group__item--active"]]:e.props.isActive,[r.default["tedi-button-group__item--disabled"]]:e.props.disabled,[r.default[`tedi-button-group__item--size-${f}`]]:f},e.props.className),size:f,"aria-pressed":!!e.props.isActive,onClick:u=>{var t,p;(p=(t=e.props).onClick)==null||p.call(t,u),e.props.id&&(i==null||i(e.props.id))}}))})};exports.ButtonGroup=b;exports.default=b;
|
|
@@ -4,11 +4,11 @@ import { Children as x, isValidElement as z, cloneElement as B } from "react";
|
|
|
4
4
|
import { Icon as a } from "../../base/icon/icon.es.js";
|
|
5
5
|
import { Button as k } from "../button/button.es.js";
|
|
6
6
|
import r from "./button-group.module.scss.es.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useLabels as D } from "../../../providers/label-provider/use-labels.es.js";
|
|
8
|
+
import { useBreakpoint as E, isBreakpointBelow as T } from "../../../helpers/hooks/use-breakpoint.es.js";
|
|
9
9
|
import { Dropdown as d } from "../../overlays/dropdown/dropdown.es.js";
|
|
10
10
|
const P = (N) => {
|
|
11
|
-
const { getLabel: _ } =
|
|
11
|
+
const { getLabel: _ } = D(), {
|
|
12
12
|
children: v,
|
|
13
13
|
className: h,
|
|
14
14
|
type: m = "primary",
|
|
@@ -20,7 +20,7 @@ const P = (N) => {
|
|
|
20
20
|
mobileBreakpoint: R = "md",
|
|
21
21
|
dropdownLabel: L = _("sidenav.submenu"),
|
|
22
22
|
dropdownLabelMode: C = "static"
|
|
23
|
-
} = N, M =
|
|
23
|
+
} = N, M = E(), $ = T(M, R), f = x.toArray(v).filter(
|
|
24
24
|
(o) => z(o) && o.type === k
|
|
25
25
|
), e = f.find((o) => o.props.isActive), j = C === "static" ? L : (e == null ? void 0 : e.props.children) ?? L, n = e == null ? void 0 : e.props.iconLeft, l = e == null ? void 0 : e.props.icon;
|
|
26
26
|
return $ && I ? /* @__PURE__ */ g(d, { width: "trigger", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),n=require("../../../../../external/classnames/index.cjs.js"),_=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),n=require("../../../../../external/classnames/index.cjs.js"),_=require("react"),H=require("../../../../../external/react-animate-height/dist/esm/index.cjs.js"),J=require("../../../providers/printing-provider/printing-provider.cjs.js"),Q=require("../../base/icon/icon.cjs.js"),U=require("../../base/typography/text/text.cjs.js"),V=require("../../misc/print/print.cjs.js"),e=require("./collapse.module.scss.cjs.js"),W=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),X=require("../../../providers/label-provider/use-labels.cjs.js"),N=require("../../layout/grid/row.cjs.js"),i=require("../../layout/grid/col.cjs.js"),P=x=>{const{getCurrentBreakpointProps:k}=W.useBreakpointProps(x.defaultServerBreakpoint),{getLabel:h}=X.useLabels(),{id:r,children:w,className:O,openText:j=h("open"),closeText:y=h("close"),hideCollapseText:$=!1,title:d,titleRowProps:S,defaultOpen:B,open:c,onToggle:u,arrowType:s="default",size:o="default",underline:M=!0,toggleLabel:g,iconOnly:R=!1,controlsId:v,inverted:T=!1,...L}=k(x),b=v!==void 0,p=`${r}__trigger`,f=`${r}__content`,D=`${r}__animate`,[C,E]=_.useState(()=>B),m=J.usePrint(),a=_.useMemo(()=>m||(c!==void 0?c:C),[m,c,C]),z=R===!0&&!d,K=T&&s!=="secondary",A=n.default(e.default["tedi-collapse"],o==="small"&&e.default["tedi-collapse--small"],a&&e.default["tedi-collapse--is-open"],z&&e.default["tedi-collapse--icon-only"],K&&e.default["tedi-collapse--inverted"],e.default[`tedi-collapse--arrow-${s}`],O),q=()=>{const l=!a;E(l),u==null||u(l)},F=l=>{(l.key==="Enter"||l.key===" ")&&!l.repeat&&(l.preventDefault(),q())},G=g||(a?y:j),I=_.useMemo(()=>t.jsx("div",{id:f,role:"region","aria-labelledby":p,className:e.default["tedi-collapse__content"],children:w}),[w,f,p]);return t.jsxs("div",{"data-name":"collapse",...L,className:A,children:[t.jsx("button",{id:p,type:"button","data-name":"collapse-trigger",className:e.default["tedi-collapse__title"],"aria-label":G,"aria-expanded":a,"aria-controls":b?v:f,onKeyDown:F,onClick:q,children:t.jsxs(N.Row,{justifyContent:"between",alignItems:"center",wrap:"nowrap",...S,element:"span",children:[d&&t.jsx(i.Col,{"aria-hidden":"true",children:d}),t.jsx(i.Col,{width:"auto",children:t.jsxs(N.Row,{element:"span",alignItems:"center",gutter:0,wrap:"nowrap",children:[t.jsx(V.Print,{visibility:"hide",children:t.jsx(i.Col,{width:"auto",className:n.default({"visually-hidden":$}),children:t.jsx(U.Text,{element:"span",className:n.default(e.default["tedi-collapse__text"],{[e.default["tedi-collapse__text--underline"]]:M}),children:a?y:j})})}),t.jsx(i.Col,{width:"auto",children:t.jsx("div",{className:n.default(e.default["tedi-collapse__icon-wrapper"],e.default[`tedi-collapse__icon-wrapper--${s}`],o==="small"&&e.default["tedi-collapse__icon-wrapper--small"]),children:t.jsx(Q.Icon,{className:n.default(e.default["tedi-collapse__icon"],e.default[`tedi-collapse__icon--${s}`],o==="small"&&e.default["tedi-collapse__icon--small"]),name:"expand_more",size:o==="small"||s==="secondary"?18:24})})})]})})]})}),!b&&(m?I:t.jsx(H.default,{id:D,duration:300,height:a?"auto":0,"data-testid":"collapse-inner",children:I}))]})};exports.Collapse=P;exports.default=P;
|
|
@@ -84,6 +84,21 @@ export interface CollapseProps extends BreakpointSupport<CollapseBreakpointProps
|
|
|
84
84
|
* If provided, overrides the default open/close text for the accessible name.
|
|
85
85
|
*/
|
|
86
86
|
toggleLabel?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Use Collapse purely as a toggle trigger for content rendered elsewhere.
|
|
89
|
+
*
|
|
90
|
+
* When set, the toggle button's `aria-controls` points at the supplied id
|
|
91
|
+
* instead of Collapse's internal content panel, and the internal panel is
|
|
92
|
+
* **not rendered**. Useful when the disclosed region must live outside
|
|
93
|
+
* Collapse's DOM subtree (e.g. a table row whose details live in a
|
|
94
|
+
* sibling `<tr>`). The consumer is responsible for rendering the target
|
|
95
|
+
* element with the matching `id` and an appropriate `role` (typically
|
|
96
|
+
* `region`).
|
|
97
|
+
*
|
|
98
|
+
* When omitted (default), Collapse renders its own `children` inside a
|
|
99
|
+
* built-in `role="region"` panel.
|
|
100
|
+
*/
|
|
101
|
+
controlsId?: string;
|
|
87
102
|
}
|
|
88
103
|
export declare const Collapse: (props: CollapseProps) => JSX.Element;
|
|
89
104
|
export default Collapse;
|
|
@@ -1,57 +1,58 @@
|
|
|
1
1
|
import { jsx as t, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import n from "../../../../../external/classnames/index.es.js";
|
|
3
3
|
import h from "react";
|
|
4
|
-
import
|
|
5
|
-
import { usePrint as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { Text as
|
|
8
|
-
import { Print as
|
|
4
|
+
import G from "../../../../../external/react-animate-height/dist/esm/index.es.js";
|
|
5
|
+
import { usePrint as J } from "../../../providers/printing-provider/printing-provider.es.js";
|
|
6
|
+
import { Icon as Q } from "../../base/icon/icon.es.js";
|
|
7
|
+
import { Text as U } from "../../base/typography/text/text.es.js";
|
|
8
|
+
import { Print as V } from "../../misc/print/print.es.js";
|
|
9
9
|
import e from "./collapse.module.scss.es.js";
|
|
10
|
-
import { useBreakpointProps as
|
|
11
|
-
import { useLabels as
|
|
12
|
-
import { Row as
|
|
10
|
+
import { useBreakpointProps as W } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
11
|
+
import { useLabels as X } from "../../../providers/label-provider/use-labels.es.js";
|
|
12
|
+
import { Row as P } from "../../layout/grid/row.es.js";
|
|
13
13
|
import { Col as s } from "../../layout/grid/col.es.js";
|
|
14
|
-
const
|
|
15
|
-
const { getCurrentBreakpointProps:
|
|
14
|
+
const pe = (w) => {
|
|
15
|
+
const { getCurrentBreakpointProps: $ } = W(w.defaultServerBreakpoint), { getLabel: y } = X(), {
|
|
16
16
|
id: r,
|
|
17
17
|
children: g,
|
|
18
|
-
className:
|
|
19
|
-
openText:
|
|
20
|
-
closeText:
|
|
21
|
-
hideCollapseText:
|
|
18
|
+
className: B,
|
|
19
|
+
openText: v = y("open"),
|
|
20
|
+
closeText: x = y("close"),
|
|
21
|
+
hideCollapseText: S = !1,
|
|
22
22
|
title: c,
|
|
23
|
-
titleRowProps:
|
|
24
|
-
defaultOpen:
|
|
23
|
+
titleRowProps: T,
|
|
24
|
+
defaultOpen: j,
|
|
25
25
|
open: d,
|
|
26
26
|
onToggle: p,
|
|
27
|
-
arrowType:
|
|
27
|
+
arrowType: a = "default",
|
|
28
28
|
size: i = "default",
|
|
29
|
-
underline:
|
|
30
|
-
toggleLabel:
|
|
31
|
-
iconOnly:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
underline: D = !0,
|
|
30
|
+
toggleLabel: b,
|
|
31
|
+
iconOnly: E = !1,
|
|
32
|
+
controlsId: C,
|
|
33
|
+
inverted: L = !1,
|
|
34
|
+
...M
|
|
35
|
+
} = $(w), I = C !== void 0, m = `${r}__trigger`, u = `${r}__content`, R = `${r}__animate`, [N, z] = h.useState(() => j), _ = J(), o = h.useMemo(
|
|
35
36
|
() => _ || (d !== void 0 ? d : N),
|
|
36
37
|
[_, d, N]
|
|
37
|
-
),
|
|
38
|
+
), K = E === !0 && !c, A = L && a !== "secondary", H = n(
|
|
38
39
|
e["tedi-collapse"],
|
|
39
40
|
i === "small" && e["tedi-collapse--small"],
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
e[`tedi-collapse--arrow-${
|
|
44
|
-
|
|
45
|
-
),
|
|
46
|
-
const l = !
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
(l.key === "Enter" || l.key === " ") && !l.repeat && (l.preventDefault(),
|
|
50
|
-
},
|
|
41
|
+
o && e["tedi-collapse--is-open"],
|
|
42
|
+
K && e["tedi-collapse--icon-only"],
|
|
43
|
+
A && e["tedi-collapse--inverted"],
|
|
44
|
+
e[`tedi-collapse--arrow-${a}`],
|
|
45
|
+
B
|
|
46
|
+
), k = () => {
|
|
47
|
+
const l = !o;
|
|
48
|
+
z(l), p == null || p(l);
|
|
49
|
+
}, q = (l) => {
|
|
50
|
+
(l.key === "Enter" || l.key === " ") && !l.repeat && (l.preventDefault(), k());
|
|
51
|
+
}, F = b || (o ? x : v), O = h.useMemo(
|
|
51
52
|
() => /* @__PURE__ */ t("div", { id: u, role: "region", "aria-labelledby": m, className: e["tedi-collapse__content"], children: g }),
|
|
52
53
|
[g, u, m]
|
|
53
54
|
);
|
|
54
|
-
return /* @__PURE__ */ f("div", { "data-name": "collapse", ...
|
|
55
|
+
return /* @__PURE__ */ f("div", { "data-name": "collapse", ...M, className: H, children: [
|
|
55
56
|
/* @__PURE__ */ t(
|
|
56
57
|
"button",
|
|
57
58
|
{
|
|
@@ -59,22 +60,22 @@ const ce = (w) => {
|
|
|
59
60
|
type: "button",
|
|
60
61
|
"data-name": "collapse-trigger",
|
|
61
62
|
className: e["tedi-collapse__title"],
|
|
62
|
-
"aria-label":
|
|
63
|
-
"aria-expanded":
|
|
64
|
-
"aria-controls": u,
|
|
65
|
-
onKeyDown:
|
|
66
|
-
onClick:
|
|
67
|
-
children: /* @__PURE__ */ f(
|
|
63
|
+
"aria-label": F,
|
|
64
|
+
"aria-expanded": o,
|
|
65
|
+
"aria-controls": I ? C : u,
|
|
66
|
+
onKeyDown: q,
|
|
67
|
+
onClick: k,
|
|
68
|
+
children: /* @__PURE__ */ f(P, { justifyContent: "between", alignItems: "center", wrap: "nowrap", ...T, element: "span", children: [
|
|
68
69
|
c && /* @__PURE__ */ t(s, { "aria-hidden": "true", children: c }),
|
|
69
|
-
/* @__PURE__ */ t(s, { width: "auto", children: /* @__PURE__ */ f(
|
|
70
|
-
/* @__PURE__ */ t(
|
|
71
|
-
|
|
70
|
+
/* @__PURE__ */ t(s, { width: "auto", children: /* @__PURE__ */ f(P, { element: "span", alignItems: "center", gutter: 0, wrap: "nowrap", children: [
|
|
71
|
+
/* @__PURE__ */ t(V, { visibility: "hide", children: /* @__PURE__ */ t(s, { width: "auto", className: n({ "visually-hidden": S }), children: /* @__PURE__ */ t(
|
|
72
|
+
U,
|
|
72
73
|
{
|
|
73
74
|
element: "span",
|
|
74
75
|
className: n(e["tedi-collapse__text"], {
|
|
75
|
-
[e["tedi-collapse__text--underline"]]:
|
|
76
|
+
[e["tedi-collapse__text--underline"]]: D
|
|
76
77
|
}),
|
|
77
|
-
children:
|
|
78
|
+
children: o ? x : v
|
|
78
79
|
}
|
|
79
80
|
) }) }),
|
|
80
81
|
/* @__PURE__ */ t(s, { width: "auto", children: /* @__PURE__ */ t(
|
|
@@ -82,19 +83,19 @@ const ce = (w) => {
|
|
|
82
83
|
{
|
|
83
84
|
className: n(
|
|
84
85
|
e["tedi-collapse__icon-wrapper"],
|
|
85
|
-
e[`tedi-collapse__icon-wrapper--${
|
|
86
|
+
e[`tedi-collapse__icon-wrapper--${a}`],
|
|
86
87
|
i === "small" && e["tedi-collapse__icon-wrapper--small"]
|
|
87
88
|
),
|
|
88
89
|
children: /* @__PURE__ */ t(
|
|
89
|
-
|
|
90
|
+
Q,
|
|
90
91
|
{
|
|
91
92
|
className: n(
|
|
92
93
|
e["tedi-collapse__icon"],
|
|
93
|
-
e[`tedi-collapse__icon--${
|
|
94
|
+
e[`tedi-collapse__icon--${a}`],
|
|
94
95
|
i === "small" && e["tedi-collapse__icon--small"]
|
|
95
96
|
),
|
|
96
97
|
name: "expand_more",
|
|
97
|
-
size: i === "small" ||
|
|
98
|
+
size: i === "small" || a === "secondary" ? 18 : 24
|
|
98
99
|
}
|
|
99
100
|
)
|
|
100
101
|
}
|
|
@@ -103,10 +104,10 @@ const ce = (w) => {
|
|
|
103
104
|
] })
|
|
104
105
|
}
|
|
105
106
|
),
|
|
106
|
-
_ ?
|
|
107
|
+
!I && (_ ? O : /* @__PURE__ */ t(G, { id: R, duration: 300, height: o ? "auto" : 0, "data-testid": "collapse-inner", children: O }))
|
|
107
108
|
] });
|
|
108
109
|
};
|
|
109
110
|
export {
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
pe as Collapse,
|
|
112
|
+
pe as default
|
|
112
113
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),S=require("../../../../../external/classnames/index.cjs.js"),a=require("./calendar.module.scss.cjs.js"),F=require("./components/calendar-header/calendar-header.cjs.js"),H=require("./components/calendar-month-grid/calendar-month-grid.cjs.js"),M=require("./components/calendar-year-grid/calendar-year-grid.cjs.js"),R=require("../../../../../external/react-day-picker/dist/esm/DayPicker.cjs.js"),T=require("../../../../../external/react-day-picker/dist/esm/locale/et.cjs.js"),j=({view:o="days",selectionLevel:f="days",currentMonth:c,setCurrentMonth:i,setView:l=()=>"days",mode:q="single",value:d,locale:x=T.et,localeCode:m="et-EE",showOutsideDays:N=!0,disabledMatchers:k,required:G,availableDays:t,unavailableDays:n,footer:Y,monthYearSelectType:C,handleSelect:P,applyValue:g,showNavigation:_=!0,className:y,bordered:O=!0,...w})=>{const h=O?void 0:a.default["tedi-calendar--borderless"],p=S.default(h,y),b=e=>t?Array.isArray(t)?t.some(u=>u.toDateString()===e.toDateString()):t(e):!0,A=e=>n?Array.isArray(n)?n.some(u=>u.toDateString()===e.toDateString()):n(e):!1,s=[...k??[],...t?[e=>!b(e)]:[],...n?[e=>A(e)]:[]],E=(()=>{switch(q){case"multiple":return{mode:"multiple",selected:Array.isArray(d)?d:void 0};case"range":return{mode:"range",selected:d&&!Array.isArray(d)&&!(d instanceof Date)?d:void 0};default:return{mode:"single",selected:d instanceof Date?d:void 0}}})();return r.jsxs("div",{className:a.default["tedi-calendar__wrapper"],children:[o==="years"&&r.jsx(M.YearGrid,{currentMonth:c,onNavigate:i,showNavigation:_,onSelectYear:e=>{i(e),f==="years"?g(new Date(e.getFullYear(),0,1)):l("months")},className:p}),o==="months"&&r.jsx(H.MonthGrid,{currentMonth:c,onNavigate:i,showNavigation:_,localeCode:m,onSelectMonth:e=>{i(e),f==="months"?g(e):l("days")},className:p}),o==="days"&&r.jsx(R.DayPicker,{...w,...E,locale:x,month:c,onMonthChange:i,showOutsideDays:N,disabled:s.length?s:void 0,required:G,components:{MonthCaption:e=>r.jsx(F.CalendarHeader,{...e,monthYearSelectType:C,onOpenMonthGrid:()=>l("months"),onOpenYearGrid:()=>l("years"),showNavigation:_,localeCode:m,disabledMatchers:s.length?s:void 0}),Nav:()=>r.jsx(r.Fragment,{})},footer:Y,classNames:{root:S.default(a.default["tedi-calendar"],h,y),month_caption:a.default["tedi-calendar__caption"],head:a.default["tedi-calendar__head"],row:a.default["tedi-calendar__row"],day:a.default["tedi-calendar__day"],selected:a.default["tedi-calendar__day--selected"],weekday:a.default["tedi-calendar__weekday"],outside:a.default["tedi-calendar__outside-days"],range_start:a.default["tedi-calendar__range-start"],range_middle:a.default["tedi-calendar__range-middle"],range_end:a.default["tedi-calendar__range-end"],today:a.default["tedi-calendar__today"],disabled:a.default["tedi-calendar__disabled"],month:a.default["tedi-calendar__month"],months:a.default["tedi-calendar__months-container"],footer:a.default["tedi-calendar__footer"],week_number:a.default["tedi-calendar__week-number"]},modifiers:{available:e=>t?b(e):!1,unavailable:e=>n?A(e):!1},modifiersClassNames:{available:a.default["tedi-calendar__available-day"],unavailable:a.default["tedi-calendar__unavailable-day"]},onSelect:P})]})};j.displayName="Calendar";exports.Calendar=j;
|
|
@@ -107,8 +107,16 @@ export interface CalendarProps extends Omit<DayPickerProps, 'mode' | 'selected'
|
|
|
107
107
|
* Optional additional CSS class for the calendar container.
|
|
108
108
|
*/
|
|
109
109
|
className?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Whether to render the surrounding card (border, background, radius).
|
|
112
|
+
* Set to `false` when embedding inside a parent that already provides
|
|
113
|
+
* its own surface — e.g. alongside a calendar inside `DateTimeField`.
|
|
114
|
+
* The inner gradient masks and column separators are preserved either way.
|
|
115
|
+
* @default true
|
|
116
|
+
*/
|
|
117
|
+
bordered?: boolean;
|
|
110
118
|
}
|
|
111
119
|
export declare const Calendar: {
|
|
112
|
-
({ view, selectionLevel, currentMonth, setCurrentMonth, setView, mode, value, locale, localeCode, showOutsideDays, disabledMatchers, required, availableDays, unavailableDays, footer, monthYearSelectType, handleSelect, applyValue, showNavigation, className, ...dayPickerProps }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
120
|
+
({ view, selectionLevel, currentMonth, setCurrentMonth, setView, mode, value, locale, localeCode, showOutsideDays, disabledMatchers, required, availableDays, unavailableDays, footer, monthYearSelectType, handleSelect, applyValue, showNavigation, className, bordered, ...dayPickerProps }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
113
121
|
displayName: string;
|
|
114
122
|
};
|
|
@@ -1,106 +1,107 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as P, jsx as o, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import u from "../../../../../external/classnames/index.es.js";
|
|
3
3
|
import r from "./calendar.module.scss.es.js";
|
|
4
|
-
import { CalendarHeader as
|
|
5
|
-
import { MonthGrid as
|
|
6
|
-
import { YearGrid as
|
|
7
|
-
import { DayPicker as
|
|
8
|
-
import { et as
|
|
9
|
-
const
|
|
10
|
-
view:
|
|
11
|
-
selectionLevel:
|
|
12
|
-
currentMonth:
|
|
4
|
+
import { CalendarHeader as U } from "./components/calendar-header/calendar-header.es.js";
|
|
5
|
+
import { MonthGrid as q } from "./components/calendar-month-grid/calendar-month-grid.es.js";
|
|
6
|
+
import { YearGrid as z } from "./components/calendar-year-grid/calendar-year-grid.es.js";
|
|
7
|
+
import { DayPicker as B } from "../../../../../external/react-day-picker/dist/esm/DayPicker.es.js";
|
|
8
|
+
import { et as I } from "../../../../../external/react-day-picker/dist/esm/locale/et.es.js";
|
|
9
|
+
const J = ({
|
|
10
|
+
view: c = "days",
|
|
11
|
+
selectionLevel: f = "days",
|
|
12
|
+
currentMonth: l,
|
|
13
13
|
setCurrentMonth: n,
|
|
14
|
-
setView:
|
|
14
|
+
setView: i = () => "days",
|
|
15
15
|
mode: S = "single",
|
|
16
|
-
value:
|
|
17
|
-
locale:
|
|
18
|
-
localeCode:
|
|
19
|
-
showOutsideDays:
|
|
20
|
-
disabledMatchers:
|
|
21
|
-
required:
|
|
22
|
-
availableDays:
|
|
16
|
+
value: a,
|
|
17
|
+
locale: k = I,
|
|
18
|
+
localeCode: p = "et-EE",
|
|
19
|
+
showOutsideDays: G = !0,
|
|
20
|
+
disabledMatchers: Y,
|
|
21
|
+
required: x,
|
|
22
|
+
availableDays: d,
|
|
23
23
|
unavailableDays: t,
|
|
24
|
-
footer:
|
|
25
|
-
monthYearSelectType:
|
|
26
|
-
handleSelect:
|
|
27
|
-
applyValue:
|
|
28
|
-
showNavigation:
|
|
29
|
-
className:
|
|
30
|
-
|
|
24
|
+
footer: C,
|
|
25
|
+
monthYearSelectType: j,
|
|
26
|
+
handleSelect: w,
|
|
27
|
+
applyValue: g,
|
|
28
|
+
showNavigation: m = !0,
|
|
29
|
+
className: y,
|
|
30
|
+
bordered: E = !0,
|
|
31
|
+
...F
|
|
31
32
|
}) => {
|
|
32
|
-
const h = (e) =>
|
|
33
|
-
...
|
|
34
|
-
...
|
|
35
|
-
...t ? [(e) =>
|
|
36
|
-
],
|
|
33
|
+
const h = E ? void 0 : r["tedi-calendar--borderless"], A = u(h, y), N = (e) => d ? Array.isArray(d) ? d.some((_) => _.toDateString() === e.toDateString()) : d(e) : !0, b = (e) => t ? Array.isArray(t) ? t.some((_) => _.toDateString() === e.toDateString()) : t(e) : !1, s = [
|
|
34
|
+
...Y ?? [],
|
|
35
|
+
...d ? [(e) => !N(e)] : [],
|
|
36
|
+
...t ? [(e) => b(e)] : []
|
|
37
|
+
], O = (() => {
|
|
37
38
|
switch (S) {
|
|
38
39
|
case "multiple":
|
|
39
|
-
return { mode: "multiple", selected: Array.isArray(
|
|
40
|
+
return { mode: "multiple", selected: Array.isArray(a) ? a : void 0 };
|
|
40
41
|
case "range":
|
|
41
42
|
return {
|
|
42
43
|
mode: "range",
|
|
43
|
-
selected:
|
|
44
|
+
selected: a && !Array.isArray(a) && !(a instanceof Date) ? a : void 0
|
|
44
45
|
};
|
|
45
46
|
default:
|
|
46
|
-
return { mode: "single", selected:
|
|
47
|
+
return { mode: "single", selected: a instanceof Date ? a : void 0 };
|
|
47
48
|
}
|
|
48
49
|
})();
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
return /* @__PURE__ */ P("div", { className: r["tedi-calendar__wrapper"], children: [
|
|
51
|
+
c === "years" && /* @__PURE__ */ o(
|
|
52
|
+
z,
|
|
52
53
|
{
|
|
53
|
-
currentMonth:
|
|
54
|
+
currentMonth: l,
|
|
54
55
|
onNavigate: n,
|
|
55
|
-
showNavigation:
|
|
56
|
+
showNavigation: m,
|
|
56
57
|
onSelectYear: (e) => {
|
|
57
|
-
n(e),
|
|
58
|
+
n(e), f === "years" ? g(new Date(e.getFullYear(), 0, 1)) : i("months");
|
|
58
59
|
},
|
|
59
|
-
className:
|
|
60
|
+
className: A
|
|
60
61
|
}
|
|
61
62
|
),
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
c === "months" && /* @__PURE__ */ o(
|
|
64
|
+
q,
|
|
64
65
|
{
|
|
65
|
-
currentMonth:
|
|
66
|
+
currentMonth: l,
|
|
66
67
|
onNavigate: n,
|
|
67
|
-
showNavigation:
|
|
68
|
-
localeCode:
|
|
68
|
+
showNavigation: m,
|
|
69
|
+
localeCode: p,
|
|
69
70
|
onSelectMonth: (e) => {
|
|
70
|
-
n(e),
|
|
71
|
+
n(e), f === "months" ? g(e) : i("days");
|
|
71
72
|
},
|
|
72
|
-
className:
|
|
73
|
+
className: A
|
|
73
74
|
}
|
|
74
75
|
),
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
c === "days" && /* @__PURE__ */ o(
|
|
77
|
+
B,
|
|
77
78
|
{
|
|
78
|
-
...
|
|
79
|
-
...
|
|
80
|
-
locale:
|
|
81
|
-
month:
|
|
79
|
+
...F,
|
|
80
|
+
...O,
|
|
81
|
+
locale: k,
|
|
82
|
+
month: l,
|
|
82
83
|
onMonthChange: n,
|
|
83
|
-
showOutsideDays:
|
|
84
|
+
showOutsideDays: G,
|
|
84
85
|
disabled: s.length ? s : void 0,
|
|
85
|
-
required:
|
|
86
|
+
required: x,
|
|
86
87
|
components: {
|
|
87
|
-
MonthCaption: (e) => /* @__PURE__ */
|
|
88
|
-
|
|
88
|
+
MonthCaption: (e) => /* @__PURE__ */ o(
|
|
89
|
+
U,
|
|
89
90
|
{
|
|
90
91
|
...e,
|
|
91
|
-
monthYearSelectType:
|
|
92
|
-
onOpenMonthGrid: () =>
|
|
93
|
-
onOpenYearGrid: () =>
|
|
94
|
-
showNavigation:
|
|
95
|
-
localeCode:
|
|
92
|
+
monthYearSelectType: j,
|
|
93
|
+
onOpenMonthGrid: () => i("months"),
|
|
94
|
+
onOpenYearGrid: () => i("years"),
|
|
95
|
+
showNavigation: m,
|
|
96
|
+
localeCode: p,
|
|
96
97
|
disabledMatchers: s.length ? s : void 0
|
|
97
98
|
}
|
|
98
99
|
),
|
|
99
|
-
Nav: () => /* @__PURE__ */
|
|
100
|
+
Nav: () => /* @__PURE__ */ o(H, {})
|
|
100
101
|
},
|
|
101
|
-
footer:
|
|
102
|
+
footer: C,
|
|
102
103
|
classNames: {
|
|
103
|
-
root:
|
|
104
|
+
root: u(r["tedi-calendar"], h, y),
|
|
104
105
|
month_caption: r["tedi-calendar__caption"],
|
|
105
106
|
head: r["tedi-calendar__head"],
|
|
106
107
|
row: r["tedi-calendar__row"],
|
|
@@ -119,19 +120,19 @@ const z = ({
|
|
|
119
120
|
week_number: r["tedi-calendar__week-number"]
|
|
120
121
|
},
|
|
121
122
|
modifiers: {
|
|
122
|
-
available: (e) =>
|
|
123
|
-
unavailable: (e) => t ?
|
|
123
|
+
available: (e) => d ? N(e) : !1,
|
|
124
|
+
unavailable: (e) => t ? b(e) : !1
|
|
124
125
|
},
|
|
125
126
|
modifiersClassNames: {
|
|
126
127
|
available: r["tedi-calendar__available-day"],
|
|
127
128
|
unavailable: r["tedi-calendar__unavailable-day"]
|
|
128
129
|
},
|
|
129
|
-
onSelect:
|
|
130
|
+
onSelect: w
|
|
130
131
|
}
|
|
131
132
|
)
|
|
132
133
|
] });
|
|
133
134
|
};
|
|
134
|
-
|
|
135
|
+
J.displayName = "Calendar";
|
|
135
136
|
export {
|
|
136
|
-
|
|
137
|
+
J as Calendar
|
|
137
138
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-calendar__picker-grid-container":"tedi-calendar__picker-grid-container-1b2bfc55","tedi-calendar__week-number":"tedi-calendar__week-number-c1a67f28","tedi-calendar__day":"tedi-calendar__day-baa13412","tedi-calendar__weekday":"tedi-calendar__weekday-9dce46ba","tedi-calendar":"tedi-calendar-a8c2a0a4","tedi-calendar__months-container":"tedi-calendar__months-container-793f3f7b","tedi-calendar__month":"tedi-calendar__month-b0e4d350","tedi-calendar__footer":"tedi-calendar__footer-bb297fb5","tedi-calendar__head":"tedi-calendar__head-bbd962e1","tedi-calendar__disabled":"tedi-calendar__disabled-30620859","tedi-calendar__day--selected":"tedi-calendar__day--selected-9f3dc090","tedi-calendar__today":"tedi-calendar__today-fa050850","tedi-calendar__available-day":"tedi-calendar__available-day-a0b09cf3","tedi-calendar__unavailable-day":"tedi-calendar__unavailable-day-05d8742d","tedi-calendar__range-middle":"tedi-calendar__range-middle-fa3459d1","tedi-calendar__range-start":"tedi-calendar__range-start-aaf20ea3","tedi-calendar__range-end":"tedi-calendar__range-end-097f2a3b","tedi-calendar__outside-days":"tedi-calendar__outside-days-703857de","tedi-calendar__picker-grid":"tedi-calendar__picker-grid-9b167adf","tedi-calendar__picker-grid-header":"tedi-calendar__picker-grid-header-30f8748f","tedi-calendar__picker--no-navigation":"tedi-calendar__picker--no-navigation-695a34ca","tedi-calendar__grid-button":"tedi-calendar__grid-button-889a2a85","tedi-calendar__grid-button--selected":"tedi-calendar__grid-button--selected-2019301b"};exports.default=e;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-calendar__picker-grid-container":"tedi-calendar__picker-grid-container-1b2bfc55","tedi-calendar__week-number":"tedi-calendar__week-number-c1a67f28","tedi-calendar__day":"tedi-calendar__day-baa13412","tedi-calendar__weekday":"tedi-calendar__weekday-9dce46ba","tedi-calendar":"tedi-calendar-a8c2a0a4","tedi-calendar--borderless":"tedi-calendar--borderless-22d5d627","tedi-calendar__months-container":"tedi-calendar__months-container-793f3f7b","tedi-calendar__month":"tedi-calendar__month-b0e4d350","tedi-calendar__footer":"tedi-calendar__footer-bb297fb5","tedi-calendar__head":"tedi-calendar__head-bbd962e1","tedi-calendar__disabled":"tedi-calendar__disabled-30620859","tedi-calendar__day--selected":"tedi-calendar__day--selected-9f3dc090","tedi-calendar__today":"tedi-calendar__today-fa050850","tedi-calendar__available-day":"tedi-calendar__available-day-a0b09cf3","tedi-calendar__unavailable-day":"tedi-calendar__unavailable-day-05d8742d","tedi-calendar__range-middle":"tedi-calendar__range-middle-fa3459d1","tedi-calendar__range-start":"tedi-calendar__range-start-aaf20ea3","tedi-calendar__range-end":"tedi-calendar__range-end-097f2a3b","tedi-calendar__outside-days":"tedi-calendar__outside-days-703857de","tedi-calendar__picker-grid":"tedi-calendar__picker-grid-9b167adf","tedi-calendar__picker-grid-header":"tedi-calendar__picker-grid-header-30f8748f","tedi-calendar__picker--no-navigation":"tedi-calendar__picker--no-navigation-695a34ca","tedi-calendar__grid-button":"tedi-calendar__grid-button-889a2a85","tedi-calendar__grid-button--selected":"tedi-calendar__grid-button--selected-2019301b"};exports.default=e;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = {
|
|
2
2
|
"tedi-calendar__picker-grid-container": "tedi-calendar__picker-grid-container-1b2bfc55",
|
|
3
3
|
"tedi-calendar__week-number": "tedi-calendar__week-number-c1a67f28",
|
|
4
4
|
"tedi-calendar__day": "tedi-calendar__day-baa13412",
|
|
5
5
|
"tedi-calendar__weekday": "tedi-calendar__weekday-9dce46ba",
|
|
6
6
|
"tedi-calendar": "tedi-calendar-a8c2a0a4",
|
|
7
|
+
"tedi-calendar--borderless": "tedi-calendar--borderless-22d5d627",
|
|
7
8
|
"tedi-calendar__months-container": "tedi-calendar__months-container-793f3f7b",
|
|
8
9
|
"tedi-calendar__month": "tedi-calendar__month-b0e4d350",
|
|
9
10
|
"tedi-calendar__footer": "tedi-calendar__footer-bb297fb5",
|
|
@@ -24,5 +25,5 @@ const a = {
|
|
|
24
25
|
"tedi-calendar__grid-button--selected": "tedi-calendar__grid-button--selected-2019301b"
|
|
25
26
|
};
|
|
26
27
|
export {
|
|
27
|
-
|
|
28
|
+
e as default
|
|
28
29
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './table';
|
|
2
|
+
export * from './table-context';
|
|
3
|
+
export * from './use-table-persistence';
|
|
4
|
+
export * from './table-columns-menu/table-columns-menu';
|
|
5
|
+
export * from './table-header-button/table-header-button';
|
|
6
|
+
export * from './table-toolbar/table-toolbar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),x=require("../../../buttons/button/button.cjs.js"),m=require("../../../form/checkbox/checkbox.cjs.js"),j=require("../../../overlays/dropdown/dropdown.cjs.js"),q=require("../../../overlays/dropdown/dropdown-content/dropdown-content.cjs.js"),T=require("../../../overlays/dropdown/dropdown-item/dropdown-item.cjs.js"),f=require("../../../overlays/dropdown/dropdown-trigger/dropdown-trigger.cjs.js"),w=require("../table-context.cjs.js"),L=require("../../../../providers/label-provider/use-labels.cjs.js"),r=({triggerLabel:i,className:l})=>{const{table:d,id:c}=w.useTableContext(),{getLabel:a}=L.useLabels(),u=i??a("table.columns"),o=d.getAllLeafColumns().filter(e=>e.getCanHide()),b=o.filter(e=>e.getIsVisible()).length,g=e=>{const n=e.columnDef.header;return typeof n=="string"?n:e.id};return t.jsxs(j.Dropdown,{placement:"bottom-end",children:[t.jsx(f.DropdownTrigger,{children:t.jsx(x.Button,{type:"button",visualType:"neutral",iconLeft:"tune",className:l,children:u})}),t.jsx(q.DropdownContent,{children:o.map(e=>{const n=e.getIsVisible(),h=n&&b===1,s=`${c}-columns-menu-${e.id}`,p=g(e);return t.jsx(T.DropdownItem,{asChild:!0,closeOnSelect:!1,children:t.jsx("div",{onClick:C=>C.stopPropagation(),children:t.jsx(m.Checkbox,{id:s,name:s,label:p,value:e.id,checked:n,disabled:h,onChange:()=>e.toggleVisibility()})})},e.id)})})]})};r.displayName="Table.ColumnsMenu";exports.TableColumnsMenu=r;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface TableColumnsMenuProps {
|
|
2
|
+
/**
|
|
3
|
+
* Trigger label. Falls back to the localised `table.columns` label from
|
|
4
|
+
* `LabelProvider` when not provided.
|
|
5
|
+
*/
|
|
6
|
+
triggerLabel?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Additional class name on the dropdown trigger button.
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const TableColumnsMenu: {
|
|
13
|
+
({ triggerLabel, className }: TableColumnsMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs as h, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Button as g } from "../../../buttons/button/button.es.js";
|
|
3
|
+
import { Checkbox as C } from "../../../form/checkbox/checkbox.es.js";
|
|
4
|
+
import { Dropdown as L } from "../../../overlays/dropdown/dropdown.es.js";
|
|
5
|
+
import { DropdownContent as v } from "../../../overlays/dropdown/dropdown-content/dropdown-content.es.js";
|
|
6
|
+
import { DropdownItem as x } from "../../../overlays/dropdown/dropdown-item/dropdown-item.es.js";
|
|
7
|
+
import { DropdownTrigger as T } from "../../../overlays/dropdown/dropdown-trigger/dropdown-trigger.es.js";
|
|
8
|
+
import { useTableContext as y } from "../table-context.es.js";
|
|
9
|
+
import { useLabels as D } from "../../../../providers/label-provider/use-labels.es.js";
|
|
10
|
+
const V = ({ triggerLabel: n, className: s }) => {
|
|
11
|
+
const { table: l, id: a } = y(), { getLabel: d } = D(), m = n ?? d("table.columns"), i = l.getAllLeafColumns().filter((e) => e.getCanHide()), c = i.filter((e) => e.getIsVisible()).length, b = (e) => {
|
|
12
|
+
const o = e.columnDef.header;
|
|
13
|
+
return typeof o == "string" ? o : e.id;
|
|
14
|
+
};
|
|
15
|
+
return /* @__PURE__ */ h(L, { placement: "bottom-end", children: [
|
|
16
|
+
/* @__PURE__ */ t(T, { children: /* @__PURE__ */ t(g, { type: "button", visualType: "neutral", iconLeft: "tune", className: s, children: m }) }),
|
|
17
|
+
/* @__PURE__ */ t(v, { children: i.map((e) => {
|
|
18
|
+
const o = e.getIsVisible(), p = o && c === 1, r = `${a}-columns-menu-${e.id}`, u = b(e);
|
|
19
|
+
return /* @__PURE__ */ t(x, { asChild: !0, closeOnSelect: !1, children: /* @__PURE__ */ t("div", { onClick: (f) => f.stopPropagation(), children: /* @__PURE__ */ t(
|
|
20
|
+
C,
|
|
21
|
+
{
|
|
22
|
+
id: r,
|
|
23
|
+
name: r,
|
|
24
|
+
label: u,
|
|
25
|
+
value: e.id,
|
|
26
|
+
checked: o,
|
|
27
|
+
disabled: p,
|
|
28
|
+
onChange: () => e.toggleVisibility()
|
|
29
|
+
}
|
|
30
|
+
) }) }, e.id);
|
|
31
|
+
}) })
|
|
32
|
+
] });
|
|
33
|
+
};
|
|
34
|
+
V.displayName = "Table.ColumnsMenu";
|
|
35
|
+
export {
|
|
36
|
+
V as TableColumnsMenu
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),n=t.createContext(null);function o(){const e=t.useContext(n);if(!e)throw new Error("TableContext missing — wrap the component in <Table>.");return e}exports.TableContext=n;exports.useTableContext=o;
|