@tedi-design-system/react 19.1.0-rc.8 → 19.1.0
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 +215 -223
- package/component.manifest.json +63 -20
- package/external/@floating-ui/core/dist/floating-ui.core.es.js +1 -1
- package/external/@floating-ui/dom/dist/floating-ui.dom.es.js +2 -2
- package/external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js +5 -5
- package/external/@mui/x-date-pickers/DatePicker/shared.es.js +1 -1
- package/external/@mui/x-date-pickers/DateTimePicker/shared.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/index.css +1 -1
- package/package.json +2 -2
- package/src/community/components/accordion/accordion.cjs.js +1 -1
- package/src/community/components/accordion/accordion.es.js +14 -9
- package/src/community/components/card/card-notification/card-notification.cjs.js +1 -1
- package/src/community/components/card/card-notification/card-notification.es.js +10 -8
- package/src/community/components/dock-panel/dock-panel.cjs.js +2 -0
- package/src/community/components/dock-panel/dock-panel.d.ts +110 -0
- package/src/community/components/dock-panel/dock-panel.es.js +138 -0
- package/src/community/components/dock-panel/dock-panel.module.scss.cjs.js +1 -0
- package/src/community/components/dock-panel/dock-panel.module.scss.es.js +18 -0
- package/src/community/components/dropdown/dropdown.cjs.js +1 -1
- package/src/community/components/dropdown/dropdown.es.js +34 -32
- package/src/community/components/form/category-search/category-search.cjs.js +1 -0
- package/src/community/components/form/category-search/category-search.d.ts +9 -0
- package/src/community/components/form/category-search/category-search.es.js +297 -0
- package/src/community/components/form/category-search/category-search.module.scss.cjs.js +1 -0
- package/src/community/components/form/category-search/category-search.module.scss.es.js +21 -0
- package/src/community/components/form/category-search/category-search.types.d.ts +162 -0
- package/src/community/components/form/category-search/define-category-search-category.cjs.js +1 -0
- package/src/community/components/form/category-search/define-category-search-category.d.ts +7 -0
- package/src/community/components/form/category-search/define-category-search-category.es.js +25 -0
- package/src/community/components/form/category-search/index.d.ts +3 -0
- package/src/community/components/form/category-search/use-category-search.cjs.js +1 -0
- package/src/community/components/form/category-search/use-category-search.d.ts +17 -0
- package/src/community/components/form/category-search/use-category-search.es.js +64 -0
- package/src/community/components/form/file-upload/file-upload.cjs.js +1 -1
- package/src/community/components/form/file-upload/file-upload.es.js +43 -41
- package/src/community/components/form/pickers/calendar/calendar.cjs.js +1 -1
- package/src/community/components/form/pickers/calendar/calendar.es.js +41 -39
- package/src/community/components/form/pickers/timepicker/timepicker.cjs.js +1 -1
- package/src/community/components/form/pickers/timepicker/timepicker.es.js +33 -31
- package/src/community/components/form/toggle/toggle.cjs.js +1 -1
- package/src/community/components/form/toggle/toggle.es.js +30 -28
- 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.es.js +19 -19
- package/src/community/components/map-components/carousel/carousel.cjs.js +1 -1
- package/src/community/components/map-components/carousel/carousel.es.js +19 -17
- package/src/community/components/map-components/map-button/map-button.cjs.js +1 -1
- package/src/community/components/map-components/map-button/map-button.d.ts +10 -1
- package/src/community/components/map-components/map-button/map-button.es.js +31 -29
- package/src/community/components/map-components/map-dropdown/map-dropdown.cjs.js +1 -1
- package/src/community/components/map-components/map-dropdown/map-dropdown.es.js +51 -49
- package/src/community/components/status/status.cjs.js +1 -1
- package/src/community/components/status/status.es.js +14 -12
- package/src/community/components/stepper/stepper.cjs.js +1 -1
- package/src/community/components/stepper/stepper.es.js +33 -31
- package/src/community/components/table/table.cjs.js +1 -1
- package/src/community/components/table/table.es.js +9 -9
- package/src/community/components/table-of-contents/table-of-contents.cjs.js +1 -1
- package/src/community/components/table-of-contents/table-of-contents.es.js +21 -19
- package/src/community/components/tabs/tabs/tabs.cjs.js +1 -1
- package/src/community/components/tabs/tabs/tabs.es.js +29 -27
- package/src/community/components/vertical-stepper/vertical-stepper.cjs.js +1 -1
- package/src/community/components/vertical-stepper/vertical-stepper.es.js +8 -6
- package/src/community/deprecated-exports.cjs.js +1 -0
- package/src/community/deprecated-exports.d.ts +19 -0
- package/src/community/deprecated-exports.es.js +112 -0
- package/src/community/index.d.ts +3 -0
- package/src/tedi/components/content/card/card.d.ts +4 -0
- package/src/tedi/components/content/carousel/carousel.cjs.js +1 -1
- package/src/tedi/components/content/carousel/carousel.d.ts +5 -0
- package/src/tedi/components/content/carousel/carousel.es.js +20 -20
- package/src/tedi/components/content/carousel/use-carousel.cjs.js +1 -1
- package/src/tedi/components/content/carousel/use-carousel.d.ts +1 -1
- package/src/tedi/components/content/carousel/use-carousel.es.js +127 -127
- package/src/tedi/components/content/table-card/index.d.ts +1 -0
- package/src/tedi/components/content/table-card/table-card.cjs.js +1 -0
- package/src/tedi/components/content/table-card/table-card.d.ts +131 -0
- package/src/tedi/components/content/table-card/table-card.es.js +206 -0
- package/src/tedi/components/content/table-card/table-card.module.scss.cjs.js +1 -0
- package/src/tedi/components/content/table-card/table-card.module.scss.es.js +18 -0
- package/src/tedi/components/content/text-group/text-group-list/text-group-list.cjs.js +1 -1
- package/src/tedi/components/content/text-group/text-group-list/text-group-list.d.ts +42 -0
- package/src/tedi/components/content/text-group/text-group-list/text-group-list.es.js +41 -23
- package/src/tedi/components/content/text-group/text-group.cjs.js +1 -1
- package/src/tedi/components/content/text-group/text-group.d.ts +10 -0
- package/src/tedi/components/content/text-group/text-group.es.js +14 -13
- package/src/tedi/components/content/text-group/text-group.module.scss.cjs.js +1 -1
- package/src/tedi/components/content/text-group/text-group.module.scss.es.js +5 -1
- package/src/tedi/components/form/date-field/date-field-helpers.cjs.js +1 -1
- package/src/tedi/components/form/date-field/date-field-helpers.d.ts +12 -19
- package/src/tedi/components/form/date-field/date-field-helpers.es.js +27 -21
- package/src/tedi/components/form/date-field/date-field.cjs.js +1 -1
- package/src/tedi/components/form/date-field/date-field.d.ts +1 -1
- package/src/tedi/components/form/date-field/date-field.es.js +169 -164
- package/src/tedi/components/form/date-time-field/date-time-field.cjs.js +1 -1
- package/src/tedi/components/form/date-time-field/date-time-field.es.js +181 -176
- package/src/tedi/components/form/search/index.d.ts +1 -0
- package/src/tedi/components/form/search/search.cjs.js +1 -1
- package/src/tedi/components/form/search/search.d.ts +92 -1
- package/src/tedi/components/form/search/search.es.js +265 -69
- package/src/tedi/components/form/search/search.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/search/search.module.scss.es.js +9 -1
- package/src/tedi/components/form/slider/slider.cjs.js +1 -1
- package/src/tedi/components/form/slider/slider.es.js +38 -38
- package/src/tedi/components/form/slider/slider.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/slider/slider.module.scss.es.js +0 -1
- package/src/tedi/components/form/textfield/textfield.cjs.js +1 -1
- package/src/tedi/components/form/textfield/textfield.es.js +21 -21
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.cjs.js +1 -1
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.d.ts +1 -1
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.es.js +28 -27
- package/src/tedi/components/layout/mobile-nav/mobile-nav.cjs.js +1 -1
- package/src/tedi/components/layout/mobile-nav/mobile-nav.d.ts +1 -1
- package/src/tedi/components/layout/mobile-nav/mobile-nav.es.js +124 -92
- package/src/tedi/components/layout/sidenav/sidenav.module.scss.cjs.js +1 -1
- package/src/tedi/components/layout/sidenav/sidenav.module.scss.es.js +1 -0
- package/src/tedi/components/navigation/tabs/tabs-helpers.cjs.js +1 -1
- package/src/tedi/components/navigation/tabs/tabs-helpers.d.ts +5 -0
- package/src/tedi/components/navigation/tabs/tabs-helpers.es.js +7 -4
- package/src/tedi/components/navigation/tabs/tabs-trigger/tabs-trigger.cjs.js +1 -1
- package/src/tedi/components/navigation/tabs/tabs-trigger/tabs-trigger.es.js +17 -17
- package/src/tedi/components/overlays/dropdown/dropdown.cjs.js +1 -1
- package/src/tedi/components/overlays/dropdown/dropdown.es.js +8 -6
- package/src/tedi/helpers/warn-deprecated/warn-deprecated.cjs.js +1 -0
- package/src/tedi/helpers/warn-deprecated/warn-deprecated.d.ts +12 -0
- package/src/tedi/helpers/warn-deprecated/warn-deprecated.es.js +11 -0
- package/src/tedi/index.d.ts +2 -1
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +30 -2
- package/src/tedi/providers/label-provider/labels-map.es.js +29 -1
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +326 -324
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { FloatingButton as
|
|
1
|
+
import { jsxs as v, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import n from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import y, { useState as N } from "react";
|
|
4
|
+
import { FloatingButton as c } from "../../../../tedi/components/buttons/floating-button/floating-button.es.js";
|
|
5
|
+
import { warnDeprecated as x } from "../../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
|
|
5
6
|
import e from "./carousel.module.scss.es.js";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const I = (d) => {
|
|
8
|
+
x("Community Carousel", "Use `Carousel` from `@tedi-design-system/react/tedi` instead.");
|
|
9
|
+
const { itemCountShown: r, children: m, className: u } = d, [t, o] = N(0), i = y.Children.toArray(m), l = i.length, _ = () => {
|
|
10
|
+
t + r < l && o((s) => s + 1);
|
|
9
11
|
}, p = () => {
|
|
10
|
-
t > 0 &&
|
|
11
|
-
},
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
t > 0 && o((s) => s - 1);
|
|
13
|
+
}, f = `translateX(-${100 / r * t}%)`;
|
|
14
|
+
return /* @__PURE__ */ v("div", { className: `${e["tedi-carousel__wrapper"]} ${u ?? ""}`, children: [
|
|
13
15
|
/* @__PURE__ */ a(
|
|
14
|
-
|
|
16
|
+
c,
|
|
15
17
|
{
|
|
16
|
-
className:
|
|
18
|
+
className: n(e["tedi-carousel__navigation-button"], e["tedi-carousel__prev"]),
|
|
17
19
|
onClick: p,
|
|
18
20
|
visualType: "secondary",
|
|
19
21
|
disabled: t === 0,
|
|
@@ -21,14 +23,14 @@ const $ = (d) => {
|
|
|
21
23
|
children: "Prev"
|
|
22
24
|
}
|
|
23
25
|
),
|
|
24
|
-
/* @__PURE__ */ a("div", { className: e["tedi-carousel__viewport"], children: /* @__PURE__ */ a("div", { className: e["tedi-carousel__carousel-track"], style: { transform:
|
|
26
|
+
/* @__PURE__ */ a("div", { className: e["tedi-carousel__viewport"], children: /* @__PURE__ */ a("div", { className: e["tedi-carousel__carousel-track"], style: { transform: f }, children: i.map((s, h) => /* @__PURE__ */ a("div", { className: e["tedi-carousel__item"], style: { flex: `0 0 ${100 / r}%` }, children: s }, h)) }) }),
|
|
25
27
|
/* @__PURE__ */ a(
|
|
26
|
-
|
|
28
|
+
c,
|
|
27
29
|
{
|
|
28
|
-
className:
|
|
30
|
+
className: n(e["tedi-carousel__navigation-button"], e["tedi-carousel__next"]),
|
|
29
31
|
onClick: _,
|
|
30
32
|
visualType: "secondary",
|
|
31
|
-
disabled: t +
|
|
33
|
+
disabled: t + r >= l,
|
|
32
34
|
icon: "east",
|
|
33
35
|
children: "Next"
|
|
34
36
|
}
|
|
@@ -36,5 +38,5 @@ const $ = (d) => {
|
|
|
36
38
|
] });
|
|
37
39
|
};
|
|
38
40
|
export {
|
|
39
|
-
|
|
41
|
+
I as Carousel
|
|
40
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),b=require("../../../../../external/classnames/index.cjs.js"),h=require("react"),y=require("../../../../tedi/components/base/icon/icon.cjs.js"),O=require("../../../../tedi/components/loaders/spinner/spinner.cjs.js"),A=require("../../../../tedi/components/buttons/button/button.cjs.js"),l=require("../map-dropdown/map-dropdown.cjs.js"),t=require("./map-button.module.scss.cjs.js"),d=require("../../../../tedi/components/overlays/tooltip/tooltip.cjs.js"),u=h.forwardRef((x,j)=>{const{size:n="default",icon:c,selected:g=!1,className:w,children:i,hideLabel:p=!1,tooltipContent:m=i,dropdownItems:s,showDropdownIndicator:v=!1,isActive:q,isHovered:D,underline:M,isLoading:a,iconSize:f,..._}=x,[S,B]=h.useState(!1),C=g||S,N=b.default(t.default["tedi-map-button"],t.default[`tedi-map-button--${n}`],C&&t.default["tedi-map-button--selected"],(s||v)&&t.default["tedi-map-button--dropdown"],q&&t.default["tedi-map-button--is-active"],D&&t.default["tedi-map-button--is-hovered"],M&&t.default["tedi-map-button--underline"],a&&t.default["tedi-map-button--loading"],w),T=()=>f||(n==="small"?24:18),z=e.jsxs(e.Fragment,{children:[a?e.jsx(O.Spinner,{size:n==="small"?16:18,className:t.default["tedi-map-button__icon"]}):c&&e.jsx(y.Icon,{name:c,className:t.default["tedi-map-button__icon"],size:T()}),p?e.jsx("span",{className:"sr-only",children:i}):e.jsx("div",{className:b.default(t.default["tedi-map-button__text"]),children:i})]}),r=e.jsx(A.Button,{noStyle:!0,isLoading:a,className:N,size:n,..._,ref:j,children:z}),I=p&&m?e.jsxs(d.Tooltip,{placement:"right",children:[e.jsx(d.Tooltip.Trigger,{children:r}),e.jsx(d.Tooltip.Content,{children:m})]}):r;return s?e.jsxs(l.MapDropdown,{onOpenChange:B,placement:"right-start",children:[e.jsx(l.MapDropdown.Trigger,{children:r}),e.jsx(l.MapDropdown.Content,{items:s.map(o=>({children:o.children,onClick:o.onClick,isActive:o.isActive,isDisabled:o.isDisabled}))})]}):I});u.displayName="MapButton";exports.MapButton=u;exports.default=u;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonProps } from '../../../../tedi';
|
|
1
|
+
import { ButtonProps, IconSize } from '../../../../tedi';
|
|
2
2
|
import { MapDropdownItem } from '../map-dropdown/map-dropdown';
|
|
3
3
|
/**
|
|
4
4
|
* Button props that don't apply to MapButton because it renders `<Button noStyle>` with its own
|
|
@@ -37,6 +37,15 @@ export interface MapButtonProps extends Omit<ButtonProps, OmittedButtonProps> {
|
|
|
37
37
|
* When provided, the button can toggle a dropdown menu.
|
|
38
38
|
*/
|
|
39
39
|
dropdownItems?: MapDropdownItem[];
|
|
40
|
+
/**
|
|
41
|
+
* Renders the dropdown indicator arrow in the bottom-right corner without wiring up a dropdown.
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
showDropdownIndicator?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Size of the icon displayed on the button.
|
|
47
|
+
*/
|
|
48
|
+
iconSize?: IconSize;
|
|
40
49
|
}
|
|
41
50
|
export declare const MapButton: import('react').ForwardRefExoticComponent<Omit<MapButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
42
51
|
export default MapButton;
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import { jsxs as l, Fragment as
|
|
1
|
+
import { jsxs as l, Fragment as A, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import b from "../../../../../external/classnames/index.es.js";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { Spinner as
|
|
6
|
-
import { Button as
|
|
3
|
+
import { forwardRef as O, useState as j } from "react";
|
|
4
|
+
import { Icon as k } from "../../../../tedi/components/base/icon/icon.es.js";
|
|
5
|
+
import { Spinner as E } from "../../../../tedi/components/loaders/spinner/spinner.es.js";
|
|
6
|
+
import { Button as L } from "../../../../tedi/components/buttons/button/button.es.js";
|
|
7
7
|
import { MapDropdown as d } from "../map-dropdown/map-dropdown.es.js";
|
|
8
8
|
import t from "./map-button.module.scss.es.js";
|
|
9
9
|
import { Tooltip as m } from "../../../../tedi/components/overlays/tooltip/tooltip.es.js";
|
|
10
|
-
const
|
|
10
|
+
const F = O((h, g) => {
|
|
11
11
|
const {
|
|
12
12
|
size: o = "default",
|
|
13
|
-
icon:
|
|
14
|
-
selected:
|
|
15
|
-
className:
|
|
13
|
+
icon: c,
|
|
14
|
+
selected: v = !1,
|
|
15
|
+
className: w,
|
|
16
16
|
children: i,
|
|
17
|
-
hideLabel:
|
|
17
|
+
hideLabel: p = !1,
|
|
18
18
|
tooltipContent: u = i,
|
|
19
19
|
dropdownItems: s,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
showDropdownIndicator: N = !1,
|
|
21
|
+
isActive: C,
|
|
22
|
+
isHovered: D,
|
|
23
|
+
underline: S,
|
|
23
24
|
isLoading: r,
|
|
25
|
+
iconSize: f,
|
|
24
26
|
..._
|
|
25
|
-
} =
|
|
27
|
+
} = h, [z, B] = j(!1), I = v || z, x = b(
|
|
26
28
|
t["tedi-map-button"],
|
|
27
29
|
t[`tedi-map-button--${o}`],
|
|
28
|
-
|
|
29
|
-
s && t["tedi-map-button--dropdown"],
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
I && t["tedi-map-button--selected"],
|
|
31
|
+
(s || N) && t["tedi-map-button--dropdown"],
|
|
32
|
+
C && t["tedi-map-button--is-active"],
|
|
33
|
+
D && t["tedi-map-button--is-hovered"],
|
|
34
|
+
S && t["tedi-map-button--underline"],
|
|
33
35
|
r && t["tedi-map-button--loading"],
|
|
34
|
-
|
|
35
|
-
), M = /* @__PURE__ */ l(
|
|
36
|
-
r ? /* @__PURE__ */ e(
|
|
37
|
-
|
|
38
|
-
] }), a = /* @__PURE__ */ e(
|
|
36
|
+
w
|
|
37
|
+
), y = () => f || (o === "small" ? 24 : 18), M = /* @__PURE__ */ l(A, { children: [
|
|
38
|
+
r ? /* @__PURE__ */ e(E, { size: o === "small" ? 16 : 18, className: t["tedi-map-button__icon"] }) : c && /* @__PURE__ */ e(k, { name: c, className: t["tedi-map-button__icon"], size: y() }),
|
|
39
|
+
p ? /* @__PURE__ */ e("span", { className: "sr-only", children: i }) : /* @__PURE__ */ e("div", { className: b(t["tedi-map-button__text"]), children: i })
|
|
40
|
+
] }), a = /* @__PURE__ */ e(L, { noStyle: !0, isLoading: r, className: x, size: o, ..._, ref: g, children: M }), T = p && u ? /* @__PURE__ */ l(m, { placement: "right", children: [
|
|
39
41
|
/* @__PURE__ */ e(m.Trigger, { children: a }),
|
|
40
42
|
/* @__PURE__ */ e(m.Content, { children: u })
|
|
41
43
|
] }) : a;
|
|
42
|
-
return s ? /* @__PURE__ */ l(d, { onOpenChange:
|
|
44
|
+
return s ? /* @__PURE__ */ l(d, { onOpenChange: B, placement: "right-start", children: [
|
|
43
45
|
/* @__PURE__ */ e(d.Trigger, { children: a }),
|
|
44
46
|
/* @__PURE__ */ e(
|
|
45
47
|
d.Content,
|
|
@@ -52,10 +54,10 @@ const k = z((f, h) => {
|
|
|
52
54
|
}))
|
|
53
55
|
}
|
|
54
56
|
)
|
|
55
|
-
] }) :
|
|
57
|
+
] }) : T;
|
|
56
58
|
});
|
|
57
|
-
|
|
59
|
+
F.displayName = "MapButton";
|
|
58
60
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
F as MapButton,
|
|
62
|
+
F as default
|
|
61
63
|
};
|
|
@@ -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 r=require("react/jsx-runtime"),o=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),F=require("../../../../../external/classnames/index.cjs.js"),l=require("react"),ne=require("../../../../tedi/helpers/get-element-ref.cjs.js"),a=require("./map-dropdown.module.scss.cjs.js"),oe=require("../../../../tedi/providers/label-provider/use-labels.cjs.js"),se=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"),q=({children:i})=>i,C=({items:i,children:x})=>null,p=i=>{const{children:x,onItemClick:f,closeMenuOnClick:j=!0,onOpenChange:g,placement:N="bottom-start",layout:I="column",isOpen:m,sameWidth:O=!1,className:A}=i,{initialFocus:S=-1,modal:b=!1,...M}=i.focusManager??{},{getLabel:T}=oe.useLabels(),{visuallyHiddenDismiss:L=b?T("close"):!1}=M??{},U=o.useFloatingNodeId(),y=l.useRef([]),[W,w]=l.useState(!1),v=m!==void 0?m:W,[R,K]=l.useState(null);let u=[],_=null,s=null;if(l.Children.forEach(x,e=>{if(l.isValidElement(e)){if(e.type===q)s=e.props.children;else if(e.type===C){const n=e.props,{items:t,children:c}=n;Array.isArray(t)&&t.every(h=>typeof h=="object"&&h!==null&&"children"in h)?u=t:c&&(_=c)}}}),!s)throw new Error("Dropdown must have a Dropdown.Trigger child");const k={name:"sameWidth",fn:({rects:e,elements:n})=>{const t=e.reference.width;return n.floating.style.width=`${t}px`,{data:{width:t}}}},{x:B,y:H,strategy:V,refs:P,placement:$,context:d}=o.useFloating({placement:N,nodeId:U,open:v,onOpenChange:e=>{m===void 0&&w(e),g==null||g(e)},middleware:[...O?[k]:[],D.flip(),D.shift(),D.offset(5)],whileElementsMounted:se.autoUpdate}),z=u.findIndex(e=>e.isActive),{getReferenceProps:G,getFloatingProps:J,getItemProps:Q}=o.useInteractions([o.useClick(d),o.useListNavigation(d,{listRef:y,activeIndex:R,selectedIndex:z,onNavigate:K,loop:!0}),o.useRole(d,{role:"listbox"}),o.useDismiss(d,{outsidePress:e=>!(e.target instanceof Element&&e.target.closest("[data-floating-ui-portal]")),escapeKey:!1,referencePress:!1})]),X=o.useMergeRefs([P.setReference,s?ne.getElementRef(s):null]),Y=()=>v?r.jsx(o.FloatingFocusManager,{context:d,initialFocus:S,visuallyHiddenDismiss:L,modal:b,...M,children:r.jsx("div",{...J({ref:P.setFloating,style:{position:V,left:B??0,top:H??0},className:F.default(a.default["tedi-map-dropdown"],{[a.default["tedi-map-dropdown--row"]]:I==="row",[a.default["tedi-map-dropdown--column"]]:I==="column"},A),onKeyDown(n){n.key==="Tab"&&w(!1)}}),"data-placement":$,children:u.length>0?u.map((n,t)=>ee(n,t)):_})}):null,Z=e=>F.default(a.default["tedi-map-dropdown__item"],{[a.default["tedi-map-dropdown__item--active"]]:e.isActive,[a.default["tedi-map-dropdown__item--disabled"]]:e.isDisabled}),E=(e,n,t)=>{var c;f==null||f(e,n,t),(c=e==null?void 0:e.onClick)==null||c.call(e,t),j&&w(!1)},ee=(e,n)=>r.jsx("button",{...Q({disabled:e.isDisabled,tabIndex:R===n?0:-1,role:"option",className:Z(e),onClick:t=>E(e,n,t),onKeyDown(t){t.key==="Enter"&&E(e,n,t)},ref(t){y.current[n]=t}}),children:e.children},n),te=s?l.cloneElement(s,G({tabIndex:0,...s.props,ref:X})):null;return r.jsxs(r.Fragment,{children:[te,r.jsx(o.FloatingPortal,{children:Y()})]})};p.Trigger=q;p.Content=C;exports.MapDropdown=p;exports.default=p;
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useFloatingNodeId as
|
|
1
|
+
import { jsxs as ee, Fragment as te, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useFloatingNodeId as ne, useFloating as oe, useInteractions as se, useClick as re, useListNavigation as le, useRole as ie, useDismiss as ae, useMergeRefs as de, FloatingPortal as ce, FloatingFocusManager as pe } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
3
3
|
import P from "../../../../../external/classnames/index.es.js";
|
|
4
|
-
import a, { cloneElement as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
4
|
+
import a, { cloneElement as fe } from "react";
|
|
5
|
+
import { getElementRef as ue } from "../../../../tedi/helpers/get-element-ref.es.js";
|
|
6
|
+
import s from "./map-dropdown.module.scss.es.js";
|
|
7
|
+
import { useLabels as me } from "../../../../tedi/providers/label-provider/use-labels.es.js";
|
|
8
|
+
import { autoUpdate as ge } from "../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
|
|
9
|
+
import { flip as we, shift as he, offset as Ie } from "../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
|
|
10
|
+
const R = ({ children: r }) => r, C = ({ items: r, children: w }) => null, E = (r) => {
|
|
10
11
|
const {
|
|
11
12
|
children: w,
|
|
12
13
|
onItemClick: p,
|
|
13
|
-
closeMenuOnClick:
|
|
14
|
+
closeMenuOnClick: N = !0,
|
|
14
15
|
onOpenChange: f,
|
|
15
|
-
placement:
|
|
16
|
+
placement: _ = "bottom-start",
|
|
16
17
|
layout: h = "column",
|
|
17
18
|
isOpen: u,
|
|
18
19
|
sameWidth: O = !1,
|
|
19
20
|
className: A
|
|
20
|
-
} =
|
|
21
|
-
let d = [],
|
|
21
|
+
} = r, { initialFocus: T = -1, modal: I = !1, ...D } = r.focusManager ?? {}, { getLabel: W } = me(), { visuallyHiddenDismiss: j = I ? W("close") : !1 } = D ?? {}, K = ne(), x = a.useRef([]), [L, m] = a.useState(!1), y = u !== void 0 ? u : L, [b, S] = a.useState(null);
|
|
22
|
+
let d = [], M = null, o = null;
|
|
22
23
|
if (a.Children.forEach(w, (e) => {
|
|
23
24
|
if (a.isValidElement(e)) {
|
|
24
|
-
if (e.type ===
|
|
25
|
-
|
|
26
|
-
else if (e.type ===
|
|
25
|
+
if (e.type === R)
|
|
26
|
+
o = e.props.children;
|
|
27
|
+
else if (e.type === C) {
|
|
27
28
|
const n = e.props, { items: t, children: i } = n;
|
|
28
29
|
Array.isArray(t) && t.every(
|
|
29
30
|
(g) => typeof g == "object" && g !== null && "children" in g
|
|
30
|
-
) ? d = t : i && (
|
|
31
|
+
) ? d = t : i && (M = i);
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
|
-
}), !
|
|
34
|
+
}), !o)
|
|
34
35
|
throw new Error("Dropdown must have a Dropdown.Trigger child");
|
|
35
36
|
const k = {
|
|
36
37
|
name: "sameWidth",
|
|
@@ -40,32 +41,32 @@ const C = ({ children: s }) => s, N = ({ items: s, children: w }) => null, E = (
|
|
|
40
41
|
data: { width: t }
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
|
-
}, { x: B, y: H, strategy: U, refs:
|
|
44
|
-
placement:
|
|
44
|
+
}, { x: B, y: H, strategy: U, refs: v, placement: V, context: l } = oe({
|
|
45
|
+
placement: _,
|
|
45
46
|
nodeId: K,
|
|
46
47
|
open: y,
|
|
47
48
|
onOpenChange: (e) => {
|
|
48
49
|
u === void 0 && m(e), f == null || f(e);
|
|
49
50
|
},
|
|
50
|
-
middleware: [...O ? [k] : [],
|
|
51
|
-
whileElementsMounted:
|
|
52
|
-
}), $ = d.findIndex((e) => e.isActive), { getReferenceProps: q, getFloatingProps: z, getItemProps: G } =
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
middleware: [...O ? [k] : [], we(), he(), Ie(5)],
|
|
52
|
+
whileElementsMounted: ge
|
|
53
|
+
}), $ = d.findIndex((e) => e.isActive), { getReferenceProps: q, getFloatingProps: z, getItemProps: G } = se([
|
|
54
|
+
re(l),
|
|
55
|
+
le(l, {
|
|
55
56
|
listRef: x,
|
|
56
57
|
activeIndex: b,
|
|
57
58
|
selectedIndex: $,
|
|
58
59
|
onNavigate: S,
|
|
59
60
|
loop: !0
|
|
60
61
|
}),
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
ie(l, { role: "listbox" }),
|
|
63
|
+
ae(l, {
|
|
63
64
|
outsidePress: (e) => !(e.target instanceof Element && e.target.closest("[data-floating-ui-portal]")),
|
|
64
65
|
escapeKey: !1,
|
|
65
66
|
referencePress: !1
|
|
66
67
|
})
|
|
67
|
-
]), J = () => y ? /* @__PURE__ */ c(
|
|
68
|
-
|
|
68
|
+
]), J = de([v.setReference, o ? ue(o) : null]), Q = () => y ? /* @__PURE__ */ c(
|
|
69
|
+
pe,
|
|
69
70
|
{
|
|
70
71
|
context: l,
|
|
71
72
|
initialFocus: T,
|
|
@@ -76,17 +77,17 @@ const C = ({ children: s }) => s, N = ({ items: s, children: w }) => null, E = (
|
|
|
76
77
|
"div",
|
|
77
78
|
{
|
|
78
79
|
...z({
|
|
79
|
-
ref:
|
|
80
|
+
ref: v.setFloating,
|
|
80
81
|
style: {
|
|
81
82
|
position: U,
|
|
82
83
|
left: B ?? 0,
|
|
83
84
|
top: H ?? 0
|
|
84
85
|
},
|
|
85
86
|
className: P(
|
|
86
|
-
|
|
87
|
+
s["tedi-map-dropdown"],
|
|
87
88
|
{
|
|
88
|
-
[
|
|
89
|
-
[
|
|
89
|
+
[s["tedi-map-dropdown--row"]]: h === "row",
|
|
90
|
+
[s["tedi-map-dropdown--column"]]: h === "column"
|
|
90
91
|
},
|
|
91
92
|
A
|
|
92
93
|
),
|
|
@@ -95,24 +96,24 @@ const C = ({ children: s }) => s, N = ({ items: s, children: w }) => null, E = (
|
|
|
95
96
|
}
|
|
96
97
|
}),
|
|
97
98
|
"data-placement": V,
|
|
98
|
-
children: d.length > 0 ? d.map((n, t) =>
|
|
99
|
+
children: d.length > 0 ? d.map((n, t) => Y(n, t)) : M
|
|
99
100
|
}
|
|
100
101
|
)
|
|
101
102
|
}
|
|
102
|
-
) : null,
|
|
103
|
-
[
|
|
104
|
-
[
|
|
103
|
+
) : null, X = (e) => P(s["tedi-map-dropdown__item"], {
|
|
104
|
+
[s["tedi-map-dropdown__item--active"]]: e.isActive,
|
|
105
|
+
[s["tedi-map-dropdown__item--disabled"]]: e.isDisabled
|
|
105
106
|
}), F = (e, n, t) => {
|
|
106
107
|
var i;
|
|
107
|
-
p == null || p(e, n, t), (i = e == null ? void 0 : e.onClick) == null || i.call(e, t),
|
|
108
|
-
},
|
|
108
|
+
p == null || p(e, n, t), (i = e == null ? void 0 : e.onClick) == null || i.call(e, t), N && m(!1);
|
|
109
|
+
}, Y = (e, n) => /* @__PURE__ */ c(
|
|
109
110
|
"button",
|
|
110
111
|
{
|
|
111
112
|
...G({
|
|
112
113
|
disabled: e.isDisabled,
|
|
113
114
|
tabIndex: b === n ? 0 : -1,
|
|
114
115
|
role: "option",
|
|
115
|
-
className:
|
|
116
|
+
className: X(e),
|
|
116
117
|
onClick: (t) => F(e, n, t),
|
|
117
118
|
onKeyDown(t) {
|
|
118
119
|
t.key === "Enter" && F(e, n, t);
|
|
@@ -124,21 +125,22 @@ const C = ({ children: s }) => s, N = ({ items: s, children: w }) => null, E = (
|
|
|
124
125
|
children: e.children
|
|
125
126
|
},
|
|
126
127
|
n
|
|
127
|
-
),
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
), Z = o ? fe(
|
|
129
|
+
o,
|
|
130
|
+
q({
|
|
130
131
|
tabIndex: 0,
|
|
131
132
|
// @ts-expect-error: 'rest' props do not fully match Anchor's expected props, but they are validated elsewhere
|
|
132
|
-
...
|
|
133
|
+
...o.props,
|
|
134
|
+
ref: J
|
|
133
135
|
})
|
|
134
|
-
|
|
135
|
-
return /* @__PURE__ */
|
|
136
|
-
|
|
137
|
-
/* @__PURE__ */ c(
|
|
136
|
+
) : null;
|
|
137
|
+
return /* @__PURE__ */ ee(te, { children: [
|
|
138
|
+
Z,
|
|
139
|
+
/* @__PURE__ */ c(ce, { children: Q() })
|
|
138
140
|
] });
|
|
139
141
|
};
|
|
140
|
-
E.Trigger =
|
|
141
|
-
E.Content =
|
|
142
|
+
E.Trigger = R;
|
|
143
|
+
E.Content = C;
|
|
142
144
|
export {
|
|
143
145
|
E as MapDropdown,
|
|
144
146
|
E as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("../../../../external/classnames/index.cjs.js"),d=require("../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),e=require("./status.module.scss.cjs.js"),l=require("../tooltip/tooltip-provider.cjs.js"),m=require("../tooltip/tooltip-trigger.cjs.js"),p=require("../tooltip/tooltip.cjs.js"),j=r=>{d.warnDeprecated("Community Status","Use `StatusIndicator` from `@tedi-design-system/react/tedi` instead.");const{children:a,type:i,className:o,tooltipContent:s,...u}=r,c=n.default(e.default.status,o,e.default[`status--${i}`]);return t.jsxs("div",{"data-name":"status",...u,className:c,children:[s?t.jsxs(l.TooltipProvider,{children:[t.jsx(m.TooltipTrigger,{children:t.jsx("div",{className:e.default.status__circle})}),t.jsx(p.Tooltip,{children:s})]}):t.jsx("div",{className:e.default.status__circle}),t.jsx("div",{className:e.default.status__content,children:a})]})};exports.Status=j;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import l from "../../../../external/classnames/index.es.js";
|
|
3
|
+
import { warnDeprecated as d } from "../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
|
|
3
4
|
import s from "./status.module.scss.es.js";
|
|
4
5
|
import { TooltipProvider as p } from "../tooltip/tooltip-provider.es.js";
|
|
5
|
-
import { TooltipTrigger as
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/* @__PURE__ */ t(u, { children:
|
|
6
|
+
import { TooltipTrigger as u } from "../tooltip/tooltip-trigger.es.js";
|
|
7
|
+
import { Tooltip as f } from "../tooltip/tooltip.es.js";
|
|
8
|
+
const g = (o) => {
|
|
9
|
+
d("Community Status", "Use `StatusIndicator` from `@tedi-design-system/react/tedi` instead.");
|
|
10
|
+
const { children: a, type: i, className: m, tooltipContent: r, ...c } = o, n = l(s.status, m, s[`status--${i}`]);
|
|
11
|
+
return /* @__PURE__ */ e("div", { "data-name": "status", ...c, className: n, children: [
|
|
12
|
+
r ? /* @__PURE__ */ e(p, { children: [
|
|
13
|
+
/* @__PURE__ */ t(u, { children: /* @__PURE__ */ t("div", { className: s.status__circle }) }),
|
|
14
|
+
/* @__PURE__ */ t(f, { children: r })
|
|
13
15
|
] }) : /* @__PURE__ */ t("div", { className: s.status__circle }),
|
|
14
|
-
/* @__PURE__ */ t("div", { className: s.status__content, children:
|
|
16
|
+
/* @__PURE__ */ t("div", { className: s.status__content, children: a })
|
|
15
17
|
] });
|
|
16
18
|
};
|
|
17
19
|
export {
|
|
18
|
-
|
|
20
|
+
g as Status
|
|
19
21
|
};
|
|
@@ -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"),P=require("../../../../external/classnames/index.cjs.js"),t=require("react"),V=require("../../../tedi/helpers/warn-deprecated/warn-deprecated.cjs.js"),b=require("./step.cjs.js"),g=require("./stepper.module.scss.cjs.js"),D=require("./stepper-context.cjs.js"),j=require("./stepper-nav.cjs.js"),I=require("../card/card.cjs.js"),R=require("../card/card-header/card-header.cjs.js"),z=require("../card/card-content/card-content.cjs.js"),B=a=>{V.warnDeprecated("Community Stepper","Use `HorizontalStepper` from `@tedi-design-system/react/tedi` instead.");const{activeStep:n,defaultActiveStep:h,onActiveStepChange:s,allowStepLabelClick:d=!0,children:y,className:l,ariaLabel:u,completedLabel:m,notCompletedLabel:S,card:c}=a,[C,N]=t.useState(h||0),o=t.useCallback((e=a.activeStep)=>typeof e<"u",[a.activeStep]),v=t.useCallback(e=>{s==null||s(e),o(n)||N(e)},[n,o,s]),f=t.useMemo(()=>o(n)?n:C,[n,C,o]),p=t.Children.map(y,e=>t.isValidElement(e)&&e.type===b.Step?e:null),q=p==null?void 0:p.map((e,i)=>t.cloneElement(e,{key:i,index:i,...e.props})),x=()=>t.Children.toArray(a.children).filter(e=>t.isValidElement(e)&&e.type===b.Step).map((e,i)=>{const{label:E,completed:L,id:M,showCompletedIcon:H}=e.props;return{label:E,completed:!!L,index:i,id:M,showCompletedIcon:H}}),k=t.useMemo(()=>({activeStep:f,handleActiveStepChange:v,allowStepLabelClick:d}),[d,f,v]),w=P.default(g.default.stepper,l,{[g.default["stepper--card"]]:!!c}),A=()=>{if(c){const e=c===!0?{}:c;return r.jsxs(I.Card,{padding:1.5,...e,"data-name":"stepper",className:w,children:[r.jsx(R.CardHeader,{padding:0,background:"white",children:r.jsx(j.StepperNav,{items:x(),ariaLabel:u,completedLabel:m,notCompletedLabel:S})}),r.jsx(z.CardContent,{children:q})]})}return r.jsxs("div",{"data-name":"stepper",className:l,children:[r.jsx(j.StepperNav,{items:x(),ariaLabel:u,completedLabel:m,notCompletedLabel:S}),q]})};return r.jsx(D.StepperContext.Provider,{value:k,children:A()})};exports.Stepper=B;
|
|
@@ -1,50 +1,52 @@
|
|
|
1
1
|
import { jsx as o, jsxs as g } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import I from "../../../../external/classnames/index.es.js";
|
|
3
3
|
import t from "react";
|
|
4
|
-
import {
|
|
5
|
-
import y from "./
|
|
6
|
-
import
|
|
4
|
+
import { warnDeprecated as _ } from "../../../tedi/helpers/warn-deprecated/warn-deprecated.es.js";
|
|
5
|
+
import { Step as y } from "./step.es.js";
|
|
6
|
+
import k from "./stepper.module.scss.es.js";
|
|
7
|
+
import { StepperContext as z } from "./stepper-context.es.js";
|
|
7
8
|
import { StepperNav as N } from "./stepper-nav.es.js";
|
|
8
|
-
import { Card as
|
|
9
|
-
import { CardHeader as
|
|
10
|
-
import { CardContent as
|
|
11
|
-
const
|
|
9
|
+
import { Card as B } from "../card/card.es.js";
|
|
10
|
+
import { CardHeader as D } from "../card/card-header/card-header.es.js";
|
|
11
|
+
import { CardContent as R } from "../card/card-content/card-content.es.js";
|
|
12
|
+
const Y = (a) => {
|
|
13
|
+
_("Community Stepper", "Use `HorizontalStepper` from `@tedi-design-system/react/tedi` instead.");
|
|
12
14
|
const {
|
|
13
15
|
activeStep: r,
|
|
14
16
|
defaultActiveStep: x,
|
|
15
17
|
onActiveStepChange: n,
|
|
16
|
-
allowStepLabelClick:
|
|
18
|
+
allowStepLabelClick: c = !0,
|
|
17
19
|
children: A,
|
|
18
|
-
className:
|
|
20
|
+
className: l,
|
|
19
21
|
ariaLabel: d,
|
|
20
22
|
completedLabel: u,
|
|
21
23
|
notCompletedLabel: f,
|
|
22
24
|
card: p
|
|
23
|
-
} = a, [C, E] = t.useState(x || 0),
|
|
25
|
+
} = a, [C, E] = t.useState(x || 0), i = t.useCallback(
|
|
24
26
|
(e = a.activeStep) => typeof e < "u",
|
|
25
27
|
[a.activeStep]
|
|
26
28
|
), S = t.useCallback(
|
|
27
29
|
(e) => {
|
|
28
|
-
n == null || n(e),
|
|
30
|
+
n == null || n(e), i(r) || E(e);
|
|
29
31
|
},
|
|
30
|
-
[r,
|
|
32
|
+
[r, i, n]
|
|
31
33
|
), v = t.useMemo(
|
|
32
|
-
() =>
|
|
33
|
-
[r, C,
|
|
34
|
-
),
|
|
35
|
-
key:
|
|
36
|
-
index:
|
|
34
|
+
() => i(r) ? r : C,
|
|
35
|
+
[r, C, i]
|
|
36
|
+
), m = t.Children.map(A, (e) => t.isValidElement(e) && e.type === y ? e : null), b = m == null ? void 0 : m.map((e, s) => t.cloneElement(e, {
|
|
37
|
+
key: s,
|
|
38
|
+
index: s,
|
|
37
39
|
...e.props
|
|
38
|
-
})), h = () => t.Children.toArray(a.children).filter((e) => t.isValidElement(e) && e.type ===
|
|
39
|
-
const { label:
|
|
40
|
-
return { label:
|
|
40
|
+
})), h = () => t.Children.toArray(a.children).filter((e) => t.isValidElement(e) && e.type === y).map((e, s) => {
|
|
41
|
+
const { label: P, completed: V, id: j, showCompletedIcon: H } = e.props;
|
|
42
|
+
return { label: P, completed: !!V, index: s, id: j, showCompletedIcon: H };
|
|
41
43
|
}), L = t.useMemo(
|
|
42
|
-
() => ({ activeStep: v, handleActiveStepChange: S, allowStepLabelClick:
|
|
43
|
-
[
|
|
44
|
-
),
|
|
45
|
-
[
|
|
46
|
-
}),
|
|
47
|
-
/* @__PURE__ */ o(
|
|
44
|
+
() => ({ activeStep: v, handleActiveStepChange: S, allowStepLabelClick: c }),
|
|
45
|
+
[c, v, S]
|
|
46
|
+
), w = I(k.stepper, l, {
|
|
47
|
+
[k["stepper--card"]]: !!p
|
|
48
|
+
}), M = () => p ? /* @__PURE__ */ g(B, { padding: 1.5, ...p === !0 ? {} : p, "data-name": "stepper", className: w, children: [
|
|
49
|
+
/* @__PURE__ */ o(D, { padding: 0, background: "white", children: /* @__PURE__ */ o(
|
|
48
50
|
N,
|
|
49
51
|
{
|
|
50
52
|
items: h(),
|
|
@@ -53,8 +55,8 @@ const W = (a) => {
|
|
|
53
55
|
notCompletedLabel: f
|
|
54
56
|
}
|
|
55
57
|
) }),
|
|
56
|
-
/* @__PURE__ */ o(
|
|
57
|
-
] }) : /* @__PURE__ */ g("div", { "data-name": "stepper", className:
|
|
58
|
+
/* @__PURE__ */ o(R, { children: b })
|
|
59
|
+
] }) : /* @__PURE__ */ g("div", { "data-name": "stepper", className: l, children: [
|
|
58
60
|
/* @__PURE__ */ o(
|
|
59
61
|
N,
|
|
60
62
|
{
|
|
@@ -66,8 +68,8 @@ const W = (a) => {
|
|
|
66
68
|
),
|
|
67
69
|
b
|
|
68
70
|
] });
|
|
69
|
-
return /* @__PURE__ */ o(
|
|
71
|
+
return /* @__PURE__ */ o(z.Provider, { value: L, children: M() });
|
|
70
72
|
};
|
|
71
73
|
export {
|
|
72
|
-
|
|
74
|
+
Y as Stepper
|
|
73
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),We=require("../../../../external/@tanstack/react-table/build/lib/index.cjs.js"),Ze=require("../../../../external/classnames/index.cjs.js"),o=require("react"),Je=require("./components/pagination/pagination.cjs.js"),i=require("./components/table-filter/filter-fn.cjs.js"),Qe=require("./components/table-layout/table-layout.cjs.js"),u=require("./table.module.scss.cjs.js"),Xe=require("./table-context.cjs.js"),Ye=require("../../../tedi/providers/label-provider/use-labels.cjs.js"),en=require("../../../tedi/providers/printing-provider/printing-provider.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),We=require("../../../../external/@tanstack/react-table/build/lib/index.cjs.js"),Ze=require("../../../../external/classnames/index.cjs.js"),o=require("react"),Je=require("./components/pagination/pagination.cjs.js"),i=require("./components/table-filter/filter-fn.cjs.js"),Qe=require("./components/table-layout/table-layout.cjs.js"),u=require("./table.module.scss.cjs.js"),Xe=require("./table-context.cjs.js"),Ye=require("../../../tedi/providers/label-provider/use-labels.cjs.js"),en=require("../../../tedi/providers/printing-provider/printing-provider.cjs.js"),d=require("../../../../external/@tanstack/table-core/build/lib/index.cjs.js"),nn=require("../card/card.cjs.js"),tn=require("../card/card-content/card-content.cjs.js"),J=1e4,Z=[];function on(c){const{getLabel:y}=Ye.useLabels(),{id:Q,data:l,columns:X,caption:Y,columnFilters:h,onColumnFiltersChange:R,cardProps:{padding:ee=0,...ne}={},hidePagination:g,defaultPagination:te={pageIndex:0,pageSize:g?J:10},pagination:a,manualPagination:oe=!!c.pagination,manualSorting:ie=!!c.sorting,manualFiltering:re=!!c.columnFilters,sorting:C,defaultSorting:le=[],defaultExpanded:ae={},autoResetPageIndex:se,onPaginationChange:x,onSortingChange:M,rowSelection:f,onRowSelectionChange:q,enableRowSelection:ue,defaultColumnVisibility:de={},columnVisibility:w,onColumnVisibilityChange:G,columnPinning:b,onColumnPinningChange:I,getRowId:ce,onRowClick:ge,defaultRowSelection:me,totalRows:P,renderSubComponent:pe,getRowCanExpand:he,groupRowsBy:s,renderGroupHeading:Ce,isLoading:fe=!1,isError:we=!1,placeholder:be,errorPlaceholder:Pe,loadingLabel:Fe=y("table.loading"),verticalAlign:Se="middle",enableFilters:ye=!1,enableSorting:Re=!0,hideRowBorder:E=!1,size:T="medium",hideCardBorder:V,...xe}=c,m=o.useMemo(()=>(l!=null&&l.length?l:Z)??Z,[l]),O=en.usePrint(),[{pageIndex:v,pageSize:j},Me]=o.useState(te),[D,qe]=o.useState(le),[K,Ge]=o.useState(ae),[N,Ie]=o.useState(me||{}),[A,Ee]=o.useState([]),[B,Te]=o.useState(de),[L,Ve]=o.useState({left:[],right:[]}),Oe=o.useMemo(()=>O?!0:K,[K,O]),_=o.useMemo(()=>a||{pageIndex:v,pageSize:j},[v,j,a]),$=o.useMemo(()=>C||D,[D,C]),k=o.useMemo(()=>h||A,[A,h]),z=o.useMemo(()=>f||N,[N,f]),H=o.useMemo(()=>w||B,[B,w]),U=o.useMemo(()=>b||L,[L,b]),ve=n=>{if(typeof n!="function")return;const e=n(_);a&&x?x(e):Me(e)},je=n=>{if(typeof n!="function")return;const e=n($);C&&M?M(e):qe(e)},De=n=>{if(typeof n!="function")return;const e=n(z);f&&q?q(e):Ie(e)},Ke=n=>{if(typeof n!="function")return;const e=n(k);h&&R?R(e):Ee(e)},Ne=n=>{if(typeof n!="function")return;const e=n(H);w&&G?G(e):Te(e)},Ae=n=>{if(typeof n!="function")return;const e=n(U);b&&I?I(e):Ve(e)},Be=o.useMemo(()=>{const n=(m==null?void 0:m.map(e=>typeof s=="string"?{...e,rowGroupKey:e[s]}:s?{...e,rowGroupKey:s(e)}:e))??[];return n.reduce((e,t)=>(t.rowGroupKey&&e.keys.includes(t.rowGroupKey)||(t.rowGroupKey?(e.keys=[...e.keys,t.rowGroupKey],e.list=[...e.list,...n.filter(S=>S.rowGroupKey===t.rowGroupKey)]):e.list=[...e.list,t]),e),{keys:[],list:[]}).list},[m,s]),p=We.useReactTable({data:Be,columns:X,state:{rowSelection:z,columnFilters:k,pagination:_,sorting:$,expanded:Oe,columnVisibility:H,columnPinning:U},manualSorting:ie,manualFiltering:re,pageCount:a&&P?Math.ceil(P/a.pageSize):void 0,autoResetPageIndex:se,onRowSelectionChange:De,enableRowSelection:ue,onExpandedChange:Ge,onPaginationChange:ve,onSortingChange:je,onColumnFiltersChange:Ke,onColumnVisibilityChange:Ne,onColumnPinningChange:Ae,getCoreRowModel:d.getCoreRowModel(),getSortedRowModel:d.getSortedRowModel(),getPaginationRowModel:d.getPaginationRowModel(),getFilteredRowModel:d.getFilteredRowModel(),getExpandedRowModel:d.getExpandedRowModel(),getRowCanExpand:he,getSubRows:n=>n.subRows,manualPagination:oe,enableFilters:ye,enableSorting:Re,getRowId:ce,filterFns:{text:(n,e,t)=>i.mapFilterFn(n,e,t,i.textFilterFn),select:(n,e,t)=>i.mapFilterFn(n,e,t,i.selectFilterFn),"multi-select":(n,e,t)=>i.mapFilterFn(n,e,t,i.multiSelectFilterFn),"date-range":(n,e,t)=>i.mapFilterFn(n,e,t,i.dateRangeFilterFn),"date-range-period":(n,e,t)=>i.mapFilterFn(n,e,t,i.dateRangePeriodFilterFn)}}),F=!!p.getFooterGroups().find(n=>!!n.headers.find(e=>e.column.columnDef.footer)),Le=!!(!V&&g&&!F),_e=!E&&F&&!g,$e=Ze.default(u.default.table,u.default[`table--vertical-align-${Se}`],u.default[`table--${T}`],{[u.default["table--hidden-bottom-border"]]:Le,[u.default["table--footer-bottom-border"]]:_e}),W=(n,e)=>{const{children:t=y(`table.${n}`),isNested:S=!0,icon:ke=n==="error"?"error":void 0,cardProps:{padding:ze=1,...He}={},...Ue}=e||{cardProps:{}};return{children:t,isNested:S,icon:ke,cardProps:{padding:ze,...He},...Ue}};return r.jsx(Xe.TableContext.Provider,{value:{table:p,id:Q,caption:Y,onRowClick:ge,renderSubComponent:pe,isFooterVisible:F,renderGroupHeading:Ce,placeholder:W("empty",be),errorPlaceholder:W("error",Pe),loadingLabel:Fe,isLoading:fe,isError:we,hideRowBorder:E,size:T},children:r.jsx(nn.Card,{"data-name":"table",...xe,borderless:V,padding:ee,...ne,children:r.jsxs(tn.CardContent,{children:[r.jsx("div",{className:$e,children:r.jsx(Qe.default,{})}),!g&&p&&r.jsx(Je.default,{totalRows:P||p.getFilteredRowModel().rows.length})]})})})}exports.PAGE_SIZE_WITHOUT_PAGINATION=J;exports.Table=on;
|