@tedi-design-system/react 17.1.0-rc.8 → 17.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/_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 +2 -2
- package/src/tedi/components/buttons/button-content/button-content.d.ts +1 -1
- package/src/tedi/components/buttons/button-content/button-content.module.scss.cjs.js +1 -1
- package/src/tedi/components/buttons/button-content/button-content.module.scss.es.js +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 +39 -37
- package/src/tedi/components/buttons/floating-button/floating-button.module.scss.cjs.js +1 -1
- package/src/tedi/components/buttons/floating-button/floating-button.module.scss.es.js +1 -1
- package/src/tedi/components/cards/card/card-stories-templates.d.ts +1 -1
- package/src/tedi/components/form/input-group/components/input/input.es.js +8 -8
- package/src/tedi/components/form/input-group/components/prefix/prefix.es.js +10 -10
- package/src/tedi/components/form/input-group/components/suffix/suffix.es.js +6 -6
- package/src/tedi/components/form/input-group/input-group.es.js +13 -13
- package/src/tedi/components/form/select/components/select-bulk-helpers.cjs.js +1 -0
- package/src/tedi/components/form/select/components/select-bulk-helpers.d.ts +55 -0
- package/src/tedi/components/form/select/components/select-bulk-helpers.es.js +34 -0
- package/src/tedi/components/form/select/components/select-group-bulk-context.cjs.js +1 -0
- package/src/tedi/components/form/select/components/select-group-bulk-context.d.ts +18 -0
- package/src/tedi/components/form/select/components/select-group-bulk-context.es.js +6 -0
- package/src/tedi/components/form/select/components/select-group-heading.cjs.js +1 -1
- package/src/tedi/components/form/select/components/select-group-heading.d.ts +4 -1
- package/src/tedi/components/form/select/components/select-group-heading.es.js +43 -8
- package/src/tedi/components/form/select/components/select-group.cjs.js +1 -1
- package/src/tedi/components/form/select/components/select-group.d.ts +4 -1
- package/src/tedi/components/form/select/components/select-group.es.js +18 -6
- package/src/tedi/components/form/select/components/select-menu-list.cjs.js +1 -1
- package/src/tedi/components/form/select/components/select-menu-list.d.ts +9 -1
- package/src/tedi/components/form/select/components/select-menu-list.es.js +22 -8
- package/src/tedi/components/form/select/components/select-multi-option.cjs.js +1 -1
- package/src/tedi/components/form/select/components/select-multi-option.es.js +40 -18
- package/src/tedi/components/form/select/components/select-multi-value.cjs.js +1 -1
- package/src/tedi/components/form/select/components/select-multi-value.d.ts +12 -1
- package/src/tedi/components/form/select/components/select-multi-value.es.js +42 -8
- package/src/tedi/components/form/select/components/select-single-option.cjs.js +1 -1
- package/src/tedi/components/form/select/components/select-single-option.es.js +5 -4
- package/src/tedi/components/form/select/components/select-single-value.cjs.js +1 -0
- package/src/tedi/components/form/select/components/select-single-value.d.ts +3 -0
- package/src/tedi/components/form/select/components/select-single-value.es.js +9 -0
- package/src/tedi/components/form/select/components/select-tags-context.cjs.js +1 -0
- package/src/tedi/components/form/select/components/select-tags-context.d.ts +11 -0
- package/src/tedi/components/form/select/components/select-tags-context.es.js +9 -0
- package/src/tedi/components/form/select/components/select-value-container.cjs.js +1 -1
- package/src/tedi/components/form/select/components/select-value-container.d.ts +12 -2
- package/src/tedi/components/form/select/components/select-value-container.es.js +76 -13
- package/src/tedi/components/form/select/select.cjs.js +1 -1
- package/src/tedi/components/form/select/select.d.ts +258 -0
- package/src/tedi/components/form/select/select.es.js +265 -175
- package/src/tedi/components/form/select/select.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/select/select.module.scss.es.js +14 -5
- package/src/tedi/components/layout/header/components/header-language/header-language.d.ts +45 -0
- package/src/tedi/components/layout/header/components/header-login/header-login.d.ts +22 -0
- package/src/tedi/components/layout/header/components/header-logout/header-logout.d.ts +22 -0
- package/src/tedi/components/layout/header/components/header-mobile-button/header-mobile-button.d.ts +21 -0
- package/src/tedi/components/layout/header/components/header-profile/header-profile.d.ts +43 -0
- package/src/tedi/components/layout/header/components/header-role/header-role-representatives.d.ts +79 -0
- package/src/tedi/components/layout/header/components/header-role/header-role.d.ts +74 -0
- package/src/tedi/components/layout/header/components/header-search/header-search.d.ts +28 -0
- package/src/tedi/components/layout/header/header.d.ts +115 -0
- package/src/tedi/components/layout/header/index.d.ts +7 -0
- package/src/tedi/components/layout/hide-at/hide-at.d.ts +10 -0
- package/src/tedi/components/layout/show-at/show-at.d.ts +10 -0
- package/src/tedi/components/layout/sidenav/components/sidenav-toggle/sidenav-toggle.module.scss.cjs.js +1 -1
- package/src/tedi/components/layout/sidenav/components/sidenav-toggle/sidenav-toggle.module.scss.es.js +1 -0
- package/src/tedi/components/overlays/overlay/overlay.cjs.js +1 -1
- package/src/tedi/components/overlays/overlay/overlay.d.ts +7 -0
- package/src/tedi/components/overlays/overlay/overlay.es.js +41 -40
- package/src/tedi/components/overlays/popover/index.d.ts +1 -0
- package/src/tedi/components/overlays/popover/popover-content.cjs.js +1 -1
- package/src/tedi/components/overlays/popover/popover-content.d.ts +5 -2
- package/src/tedi/components/overlays/popover/popover-content.es.js +36 -27
- package/src/tedi/components/overlays/popover/popover-context.cjs.js +1 -0
- package/src/tedi/components/overlays/popover/popover-context.d.ts +9 -0
- package/src/tedi/components/overlays/popover/popover-context.es.js +7 -0
- package/src/tedi/components/overlays/popover/popover.cjs.js +1 -1
- package/src/tedi/components/overlays/popover/popover.d.ts +12 -2
- package/src/tedi/components/overlays/popover/popover.es.js +18 -16
- package/src/tedi/components/overlays/popover/popover.module.scss.cjs.js +1 -1
- package/src/tedi/components/overlays/popover/popover.module.scss.es.js +2 -0
- package/src/tedi/components/tags/tag/tag.cjs.js +1 -1
- package/src/tedi/components/tags/tag/tag.d.ts +8 -0
- package/src/tedi/components/tags/tag/tag.es.js +14 -13
- package/src/tedi/helpers/hooks/use-breakpoint.cjs.js +1 -1
- package/src/tedi/helpers/hooks/use-breakpoint.es.js +7 -7
- package/src/tedi/providers/label-provider/label-provider.cjs.js +1 -1
- package/src/tedi/providers/label-provider/label-provider.d.ts +2 -0
- package/src/tedi/providers/label-provider/label-provider.es.js +57 -44
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +84 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +118 -34
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +60 -58
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tedi-design-system/react",
|
|
3
|
-
"version": "17.1.0
|
|
3
|
+
"version": "17.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"exports": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@mui/material": "^5.15.13",
|
|
44
44
|
"@mui/x-date-pickers": "^5.0.20",
|
|
45
45
|
"@tanstack/react-table": "^8.13.2",
|
|
46
|
-
"@tedi-design-system/core": "6.0
|
|
46
|
+
"@tedi-design-system/core": "6.4.0",
|
|
47
47
|
"classnames": "^2.5.1",
|
|
48
48
|
"draft-js": "^0.11.7",
|
|
49
49
|
"draftjs-md-converter": "^1.5.2",
|
|
@@ -22,7 +22,7 @@ export type ButtonContentProps<C extends React.ElementType, P extends Record<str
|
|
|
22
22
|
*/
|
|
23
23
|
fullWidth?: boolean;
|
|
24
24
|
/**
|
|
25
|
-
* Color
|
|
25
|
+
* Color scheme of the button. The 'text' value is only supported when visualType is 'link'.
|
|
26
26
|
* @default default
|
|
27
27
|
*/
|
|
28
28
|
color?: ButtonColor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={"tedi-btn":"tedi-btn-f8b478d7","tedi-btn--small":"tedi-btn--small-e94b9068","tedi-btn--icon-only":"tedi-btn--icon-only-ca6a5cf1","tedi-btn--large":"tedi-btn--large-7e783e1a","tedi-btn--neutral":"tedi-btn--neutral-c8726f60","tedi-btn--default":"tedi-btn--default-9fd10888","tedi-btn--danger":"tedi-btn--danger-9c01f2b8","tedi-btn__text":"tedi-btn__text-a9860fef","tedi-btn--primary":"tedi-btn--primary-8ae5fe2e","tedi-btn--is-active":"tedi-btn--is-active-a575ad1a","tedi-btn--is-hovered":"tedi-btn--is-hovered-5b87ccb5","tedi-btn--secondary":"tedi-btn--secondary-770ac807","tedi-btn--success":"tedi-btn--success-92db7606","tedi-btn--inverted":"tedi-btn--inverted-fd168601","tedi-btn--link":"tedi-btn--link-33d9c4c6","tedi-btn--text
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={"tedi-btn":"tedi-btn-f8b478d7","tedi-btn--small":"tedi-btn--small-e94b9068","tedi-btn--icon-only":"tedi-btn--icon-only-ca6a5cf1","tedi-btn--large":"tedi-btn--large-7e783e1a","tedi-btn--neutral":"tedi-btn--neutral-c8726f60","tedi-btn--default":"tedi-btn--default-9fd10888","tedi-btn--danger":"tedi-btn--danger-9c01f2b8","tedi-btn__text":"tedi-btn__text-a9860fef","tedi-btn--primary":"tedi-btn--primary-8ae5fe2e","tedi-btn--is-active":"tedi-btn--is-active-a575ad1a","tedi-btn--is-hovered":"tedi-btn--is-hovered-5b87ccb5","tedi-btn--secondary":"tedi-btn--secondary-770ac807","tedi-btn--success":"tedi-btn--success-92db7606","tedi-btn--inverted":"tedi-btn--inverted-fd168601","tedi-btn--link":"tedi-btn--link-33d9c4c6","tedi-btn--text":"tedi-btn--text-af7055b9","tedi-btn__inner":"tedi-btn__inner-ee6403e9","tedi-btn__icon--left":"tedi-btn__icon--left-63fdbc12","tedi-btn__icon--right":"tedi-btn__icon--right-67cbf204","tedi-btn__icon-responsive":"tedi-btn__icon-responsive-91341acf","tedi-btn--is-loading":"tedi-btn--is-loading-4ead0e89","tedi-btn--icon":"tedi-btn--icon-dbc3eb30","tedi-btn__icon":"tedi-btn__icon-cffac719","tedi-btn__icon-standalone--link":"tedi-btn__icon-standalone--link-d6b6714d","tedi-btn__spinner":"tedi-btn__spinner-abd3f027","tedi-btn--underline":"tedi-btn--underline-bf1600fb","tedi-btn--no-style":"tedi-btn--no-style-f6dfaa4d","tedi-btn--full-width":"tedi-btn--full-width-f1e5f1b3"};exports.default=t;
|
|
@@ -14,7 +14,7 @@ const t = {
|
|
|
14
14
|
"tedi-btn--success": "tedi-btn--success-92db7606",
|
|
15
15
|
"tedi-btn--inverted": "tedi-btn--inverted-fd168601",
|
|
16
16
|
"tedi-btn--link": "tedi-btn--link-33d9c4c6",
|
|
17
|
-
"tedi-btn--text
|
|
17
|
+
"tedi-btn--text": "tedi-btn--text-af7055b9",
|
|
18
18
|
"tedi-btn__inner": "tedi-btn__inner-ee6403e9",
|
|
19
19
|
"tedi-btn__icon--left": "tedi-btn__icon--left-63fdbc12",
|
|
20
20
|
"tedi-btn__icon--right": "tedi-btn__icon--right-67cbf204",
|
|
@@ -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"),
|
|
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"),L=require("../../../helpers/hooks/use-breakpoint.cjs.js"),C=require("../../../providers/label-provider/use-labels.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;
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { jsxs as g, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { Children as x, isValidElement as z, cloneElement as
|
|
2
|
+
import y from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
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
|
-
import { Button as
|
|
5
|
+
import { Button as k } from "../button/button.es.js";
|
|
6
6
|
import r from "./button-group.module.scss.es.js";
|
|
7
|
-
import { useBreakpoint as
|
|
8
|
-
import { useLabels as
|
|
9
|
-
import { Dropdown as
|
|
10
|
-
const P = (
|
|
11
|
-
const { getLabel:
|
|
12
|
-
children:
|
|
7
|
+
import { useBreakpoint as D, isBreakpointBelow as E } from "../../../helpers/hooks/use-breakpoint.es.js";
|
|
8
|
+
import { useLabels as T } from "../../../providers/label-provider/use-labels.es.js";
|
|
9
|
+
import { Dropdown as d } from "../../overlays/dropdown/dropdown.es.js";
|
|
10
|
+
const P = (N) => {
|
|
11
|
+
const { getLabel: _ } = T(), {
|
|
12
|
+
children: v,
|
|
13
13
|
className: h,
|
|
14
|
-
type:
|
|
14
|
+
type: m = "primary",
|
|
15
15
|
onSelectionChange: p,
|
|
16
|
-
stretch:
|
|
17
|
-
ariaLabel:
|
|
16
|
+
stretch: A = !1,
|
|
17
|
+
ariaLabel: b,
|
|
18
18
|
size: u = "default",
|
|
19
19
|
enableMobileDropdown: I = !1,
|
|
20
20
|
mobileBreakpoint: R = "md",
|
|
21
|
-
dropdownLabel:
|
|
21
|
+
dropdownLabel: L = _("sidenav.submenu"),
|
|
22
22
|
dropdownLabelMode: C = "static"
|
|
23
|
-
} =
|
|
24
|
-
(o) => z(o) && o.type ===
|
|
25
|
-
), e = f.find((o) => o.props.isActive), j = C === "static" ?
|
|
26
|
-
return $ && I ? /* @__PURE__ */ g(
|
|
27
|
-
/* @__PURE__ */ i(
|
|
28
|
-
|
|
23
|
+
} = N, M = D(), $ = E(M, R), f = x.toArray(v).filter(
|
|
24
|
+
(o) => z(o) && o.type === k
|
|
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
|
+
return $ && I ? /* @__PURE__ */ g(d, { width: "trigger", children: [
|
|
27
|
+
/* @__PURE__ */ i(d.Trigger, { children: /* @__PURE__ */ g(
|
|
28
|
+
k,
|
|
29
29
|
{
|
|
30
|
-
visualType:
|
|
31
|
-
className:
|
|
30
|
+
visualType: m,
|
|
31
|
+
className: y(
|
|
32
32
|
r["tedi-button-group__dropdown-trigger"],
|
|
33
|
-
r[`tedi-button-group__dropdown-trigger--${
|
|
33
|
+
r[`tedi-button-group__dropdown-trigger--${m}`],
|
|
34
34
|
h
|
|
35
35
|
),
|
|
36
36
|
noStyle: !0,
|
|
@@ -41,15 +41,15 @@ const P = (k) => {
|
|
|
41
41
|
]
|
|
42
42
|
}
|
|
43
43
|
) }),
|
|
44
|
-
/* @__PURE__ */ i(
|
|
45
|
-
|
|
44
|
+
/* @__PURE__ */ i(d.Content, { children: f.map((o, c) => /* @__PURE__ */ g(
|
|
45
|
+
d.Item,
|
|
46
46
|
{
|
|
47
|
-
index:
|
|
47
|
+
index: c,
|
|
48
48
|
active: o == null ? void 0 : o.props.isActive,
|
|
49
49
|
disabled: o == null ? void 0 : o.props.disabled,
|
|
50
50
|
onClick: (s) => {
|
|
51
|
-
var t,
|
|
52
|
-
o.props.disabled || (s.type === "click" && ((
|
|
51
|
+
var t, w;
|
|
52
|
+
o.props.disabled || (s.type === "click" && ((w = (t = o.props).onClick) == null || w.call(t, s)), o.props.id && (p == null || p(o.props.id)));
|
|
53
53
|
},
|
|
54
54
|
className: r["tedi-button-group__dropdown-item"],
|
|
55
55
|
children: [
|
|
@@ -67,25 +67,26 @@ const P = (k) => {
|
|
|
67
67
|
name: typeof o.props.iconRight == "string" ? o.props.iconRight : o.props.iconRight.name,
|
|
68
68
|
color: "inherit"
|
|
69
69
|
}
|
|
70
|
-
)
|
|
70
|
+
),
|
|
71
|
+
o.props.isActive && /* @__PURE__ */ i("span", { className: "sr-only", children: _("button-group.selected") })
|
|
71
72
|
]
|
|
72
73
|
},
|
|
73
|
-
o.props.id ||
|
|
74
|
+
o.props.id || c
|
|
74
75
|
)) })
|
|
75
76
|
] }) : /* @__PURE__ */ i(
|
|
76
77
|
"div",
|
|
77
78
|
{
|
|
78
|
-
className:
|
|
79
|
+
className: y(
|
|
79
80
|
r["tedi-button-group"],
|
|
80
|
-
r[`tedi-button-group--${
|
|
81
|
-
{ [r["tedi-button-group--stretch"]]:
|
|
81
|
+
r[`tedi-button-group--${m}`],
|
|
82
|
+
{ [r["tedi-button-group--stretch"]]: A },
|
|
82
83
|
h
|
|
83
84
|
),
|
|
84
85
|
role: "group",
|
|
85
|
-
"aria-label":
|
|
86
|
+
"aria-label": b,
|
|
86
87
|
children: f.map(
|
|
87
|
-
(o) =>
|
|
88
|
-
className:
|
|
88
|
+
(o) => B(o, {
|
|
89
|
+
className: y(
|
|
89
90
|
r["tedi-button-group__item"],
|
|
90
91
|
{
|
|
91
92
|
[r["tedi-button-group__item--active"]]: o.props.isActive,
|
|
@@ -95,9 +96,10 @@ const P = (k) => {
|
|
|
95
96
|
o.props.className
|
|
96
97
|
),
|
|
97
98
|
size: u,
|
|
98
|
-
|
|
99
|
+
"aria-pressed": !!o.props.isActive,
|
|
100
|
+
onClick: (c) => {
|
|
99
101
|
var s, t;
|
|
100
|
-
(t = (s = o.props).onClick) == null || t.call(s,
|
|
102
|
+
(t = (s = o.props).onClick) == null || t.call(s, c), o.props.id && (p == null || p(o.props.id));
|
|
101
103
|
}
|
|
102
104
|
})
|
|
103
105
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={"tedi-btn":"tedi-btn-46574e9e","tedi-btn--small":"tedi-btn--small-97569c3a","tedi-btn--icon-only":"tedi-btn--icon-only-687afb86","tedi-btn--large":"tedi-btn--large-30b2336f","tedi-btn--neutral":"tedi-btn--neutral-dfb5e967","tedi-btn--default":"tedi-btn--default-1bab37cf","tedi-btn--danger":"tedi-btn--danger-ce1411e6","tedi-btn__text":"tedi-btn__text-24c50120","tedi-btn--primary":"tedi-btn--primary-d127e524","tedi-btn--is-active":"tedi-btn--is-active-05d20ecf","tedi-btn--is-hovered":"tedi-btn--is-hovered-d798316b","tedi-btn--secondary":"tedi-btn--secondary-ca5af8db","tedi-btn--success":"tedi-btn--success-470ed017","tedi-btn--inverted":"tedi-btn--inverted-b218d4df","tedi-btn--link":"tedi-btn--link-5c908f1f","tedi-btn--text
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={"tedi-btn":"tedi-btn-46574e9e","tedi-btn--small":"tedi-btn--small-97569c3a","tedi-btn--icon-only":"tedi-btn--icon-only-687afb86","tedi-btn--large":"tedi-btn--large-30b2336f","tedi-btn--neutral":"tedi-btn--neutral-dfb5e967","tedi-btn--default":"tedi-btn--default-1bab37cf","tedi-btn--danger":"tedi-btn--danger-ce1411e6","tedi-btn__text":"tedi-btn__text-24c50120","tedi-btn--primary":"tedi-btn--primary-d127e524","tedi-btn--is-active":"tedi-btn--is-active-05d20ecf","tedi-btn--is-hovered":"tedi-btn--is-hovered-d798316b","tedi-btn--secondary":"tedi-btn--secondary-ca5af8db","tedi-btn--success":"tedi-btn--success-470ed017","tedi-btn--inverted":"tedi-btn--inverted-b218d4df","tedi-btn--link":"tedi-btn--link-5c908f1f","tedi-btn--text":"tedi-btn--text-9b2f7e3a","tedi-btn__inner":"tedi-btn__inner-df9867b5","tedi-btn__icon--left":"tedi-btn__icon--left-a9b176d3","tedi-btn__icon--right":"tedi-btn__icon--right-bccdacec","tedi-btn__icon-responsive":"tedi-btn__icon-responsive-201b5d44","tedi-btn--is-loading":"tedi-btn--is-loading-6534cc98","tedi-btn--icon":"tedi-btn--icon-21bbe29b","tedi-btn__icon":"tedi-btn__icon-8ff68f98","tedi-btn__icon-standalone--link":"tedi-btn__icon-standalone--link-3ad337b4","tedi-btn__spinner":"tedi-btn__spinner-ac3c6e8f","tedi-btn--underline":"tedi-btn--underline-281af007","tedi-btn--no-style":"tedi-btn--no-style-ed02c4bd","tedi-btn--full-width":"tedi-btn--full-width-90cbf5a9","tedi-floating-button":"tedi-floating-button-3c8f9de2","tedi-floating-button--horizontal":"tedi-floating-button--horizontal-48509abb","tedi-floating-button--vertical":"tedi-floating-button--vertical-0ff466d5","tedi-floating-button--primary":"tedi-floating-button--primary-7c6e48ad","tedi-floating-button--secondary":"tedi-floating-button--secondary-f7a0cd3f","tedi-floating-button--medium":"tedi-floating-button--medium-cddc5b75","tedi-floating-button--icon-only":"tedi-floating-button--icon-only-17b35563","tedi-floating-button--large":"tedi-floating-button--large-a688151c"};exports.default=t;
|
|
@@ -14,7 +14,7 @@ const t = {
|
|
|
14
14
|
"tedi-btn--success": "tedi-btn--success-470ed017",
|
|
15
15
|
"tedi-btn--inverted": "tedi-btn--inverted-b218d4df",
|
|
16
16
|
"tedi-btn--link": "tedi-btn--link-5c908f1f",
|
|
17
|
-
"tedi-btn--text
|
|
17
|
+
"tedi-btn--text": "tedi-btn--text-9b2f7e3a",
|
|
18
18
|
"tedi-btn__inner": "tedi-btn__inner-df9867b5",
|
|
19
19
|
"tedi-btn__icon--left": "tedi-btn__icon--left-a9b176d3",
|
|
20
20
|
"tedi-btn__icon--right": "tedi-btn__icon--right-bccdacec",
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { useInputGroup as
|
|
1
|
+
import t from "../../../../../../../external/classnames/index.es.js";
|
|
2
|
+
import s from "react";
|
|
3
|
+
import { useInputGroup as u } from "../../input-group.es.js";
|
|
4
4
|
import o from "../../input-group.module.scss.es.js";
|
|
5
5
|
const f = ({ children: p }) => {
|
|
6
|
-
const { disabled: r, inputId: e } =
|
|
7
|
-
if (!
|
|
6
|
+
const { disabled: r, inputId: e } = u();
|
|
7
|
+
if (!s.isValidElement(p)) return p;
|
|
8
8
|
const a = typeof p.type == "string", i = {
|
|
9
9
|
disabled: r || p.props.disabled,
|
|
10
10
|
id: p.props.id ?? e,
|
|
11
|
-
className:
|
|
11
|
+
className: t(p.props.className, o["tedi-input-group__input"]),
|
|
12
12
|
...!a && {
|
|
13
|
-
wrapperClassName:
|
|
13
|
+
wrapperClassName: t(p.props.wrapperClassName, o["tedi-input-group__input"])
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
-
return
|
|
16
|
+
return s.cloneElement(p, i);
|
|
17
17
|
};
|
|
18
18
|
export {
|
|
19
19
|
f as Input
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useEffect as
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import m from "../../../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { useEffect as n } from "react";
|
|
4
4
|
import { useInputGroup as a } from "../../input-group.es.js";
|
|
5
5
|
import i from "../../input-group.module.scss.es.js";
|
|
6
|
-
const b = ({ children: r, className: o, ...
|
|
7
|
-
const { registerPrefix: e, unregisterPrefix: t, disabled:
|
|
8
|
-
|
|
6
|
+
const b = ({ children: r, className: o, ...p }) => {
|
|
7
|
+
const { registerPrefix: e, unregisterPrefix: t, disabled: s } = a();
|
|
8
|
+
n(() => (e(), () => t()), [e, t]);
|
|
9
9
|
const f = typeof r == "string" || typeof r == "number";
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ u(
|
|
11
11
|
"div",
|
|
12
12
|
{
|
|
13
|
-
...
|
|
14
|
-
className:
|
|
13
|
+
...p,
|
|
14
|
+
className: m(
|
|
15
15
|
i["tedi-input-group__prefix"],
|
|
16
16
|
{ [i["tedi-input-group__prefix--no-inner-div"]]: f },
|
|
17
17
|
o
|
|
18
18
|
),
|
|
19
|
-
"aria-disabled":
|
|
19
|
+
"aria-disabled": s,
|
|
20
20
|
children: r
|
|
21
21
|
}
|
|
22
22
|
);
|
|
@@ -2,18 +2,18 @@ import { jsx as p } from "react/jsx-runtime";
|
|
|
2
2
|
import m from "../../../../../../../external/classnames/index.es.js";
|
|
3
3
|
import { useEffect as n } from "react";
|
|
4
4
|
import { useInputGroup as a } from "../../input-group.es.js";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import o from "../../input-group.module.scss.es.js";
|
|
6
|
+
const _ = ({ children: r, className: e, ...s }) => {
|
|
7
7
|
const { registerSuffix: t, unregisterSuffix: i, disabled: f } = a();
|
|
8
8
|
n(() => (t(), () => i()), [t, i]);
|
|
9
9
|
const u = typeof r == "string" || typeof r == "number";
|
|
10
10
|
return /* @__PURE__ */ p(
|
|
11
11
|
"div",
|
|
12
12
|
{
|
|
13
|
-
...
|
|
13
|
+
...s,
|
|
14
14
|
className: m(
|
|
15
|
-
|
|
16
|
-
{ [
|
|
15
|
+
o["tedi-input-group__suffix"],
|
|
16
|
+
{ [o["tedi-input-group__suffix--no-inner-div"]]: u },
|
|
17
17
|
e
|
|
18
18
|
),
|
|
19
19
|
"aria-disabled": f,
|
|
@@ -22,5 +22,5 @@ const b = ({ children: r, className: e, ...o }) => {
|
|
|
22
22
|
);
|
|
23
23
|
};
|
|
24
24
|
export {
|
|
25
|
-
|
|
25
|
+
_ as Suffix
|
|
26
26
|
};
|
|
@@ -7,13 +7,13 @@ import { Input as B } from "./components/input/input.es.js";
|
|
|
7
7
|
import { Prefix as M } from "./components/prefix/prefix.es.js";
|
|
8
8
|
import { Suffix as O } from "./components/suffix/suffix.es.js";
|
|
9
9
|
import t from "./input-group.module.scss.es.js";
|
|
10
|
-
const
|
|
11
|
-
const u = G(
|
|
10
|
+
const a = j(null), U = () => {
|
|
11
|
+
const u = G(a);
|
|
12
12
|
if (!u) throw new Error("InputGroupContext missing");
|
|
13
13
|
return u;
|
|
14
|
-
}, W = () => G(
|
|
15
|
-
({ className: u, addons:
|
|
16
|
-
const m = g.useRef(null), N = g.useId(), i = y ?? N, [n, d] = l(!1), [
|
|
14
|
+
}, W = () => G(a), S = H(
|
|
15
|
+
({ className: u, addons: P = !0, helper: r, label: o, children: h, disabled: s, id: y, ...v }, C) => {
|
|
16
|
+
const m = g.useRef(null), N = g.useId(), i = y ?? N, [n, d] = l(!1), [p, c] = l(!1);
|
|
17
17
|
E(C, () => ({
|
|
18
18
|
get root() {
|
|
19
19
|
return m.current;
|
|
@@ -22,7 +22,7 @@ const p = j(null), U = () => {
|
|
|
22
22
|
const w = L(
|
|
23
23
|
() => ({
|
|
24
24
|
hasPrefix: n,
|
|
25
|
-
hasSuffix:
|
|
25
|
+
hasSuffix: p,
|
|
26
26
|
disabled: s,
|
|
27
27
|
hasExternalLabel: !!o,
|
|
28
28
|
inputId: i,
|
|
@@ -31,31 +31,31 @@ const p = j(null), U = () => {
|
|
|
31
31
|
registerSuffix: () => c(!0),
|
|
32
32
|
unregisterSuffix: () => c(!1)
|
|
33
33
|
}),
|
|
34
|
-
[i, n,
|
|
34
|
+
[i, n, p, s, o]
|
|
35
35
|
), A = F(
|
|
36
36
|
t["tedi-input-group"],
|
|
37
37
|
{
|
|
38
|
-
[t["tedi-input-group--addons"]]:
|
|
38
|
+
[t["tedi-input-group--addons"]]: P,
|
|
39
39
|
[t["tedi-input-group--has-prefix"]]: n,
|
|
40
|
-
[t["tedi-input-group--has-suffix"]]:
|
|
40
|
+
[t["tedi-input-group--has-suffix"]]: p,
|
|
41
41
|
[t["tedi-input-group--disabled"]]: s
|
|
42
42
|
},
|
|
43
43
|
u
|
|
44
44
|
), R = () => !r || Array.isArray(r) && r.length === 0 ? null : /* @__PURE__ */ e("div", { className: t["tedi-input-group__feedback-wrapper"], children: Array.isArray(r) ? r.map((_, x) => /* @__PURE__ */ e(I, { ..._, id: `group-helper-${x}` }, x)) : /* @__PURE__ */ e(I, { ...r, id: "group-helper" }) });
|
|
45
|
-
return /* @__PURE__ */ k(
|
|
45
|
+
return /* @__PURE__ */ k(a.Provider, { value: w, children: [
|
|
46
46
|
o && /* @__PURE__ */ e(b, { ...v, label: o, id: i }),
|
|
47
47
|
/* @__PURE__ */ e("div", { ref: m, className: A, "data-name": "tedi-input-group", "aria-disabled": s, children: h }),
|
|
48
48
|
R()
|
|
49
49
|
] });
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
|
-
|
|
53
|
-
const f =
|
|
52
|
+
S.displayName = "InputGroup";
|
|
53
|
+
const f = S;
|
|
54
54
|
f.Prefix = M;
|
|
55
55
|
f.Suffix = O;
|
|
56
56
|
f.Input = B;
|
|
57
57
|
export {
|
|
58
|
-
|
|
58
|
+
S as InputGroupBase,
|
|
59
59
|
f as default,
|
|
60
60
|
U as useInputGroup,
|
|
61
61
|
W as useOptionalInputGroup
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i="__tedi_select_all__",r="__tedi_select_group__:",u=e=>!!e&&typeof e.value=="string"&&e.value.startsWith(r),a=e=>{if(!e||e.length===0)return[];const t=[];for(const s of e)if(s&&typeof s=="object"&&Array.isArray(s.options))for(const n of s.options)n.isDisabled||t.push(n);else{const n=s;n&&!n.isDisabled&&t.push(n)}return t},f=e=>!e||!Array.isArray(e.options)?[]:e.options.filter(t=>!t.isDisabled),l=(e,t)=>t.length===0?!1:t.every(s=>e.some(n=>n.value===s.value)),c=(e,t)=>{if(t.length===0)return!1;const s=t.filter(n=>e.some(o=>o.value===n.value)).length;return s>0&&s<t.length},_=(e,t)=>{if(l(e,t))return e.filter(n=>!t.some(o=>o.value===n.value));const s=[...e];for(const n of t)s.some(o=>o.value===n.value)||s.push(n);return s};exports.GROUP_OPTION_PREFIX=r;exports.SELECT_ALL_VALUE=i;exports.areAllSelected=l;exports.getEnabledOptions=a;exports.getGroupEnabledOptions=f;exports.isGroupSentinel=u;exports.isIndeterminate=c;exports.toggleBulkSelection=_;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { GroupBase, OptionsOrGroups } from 'react-select';
|
|
2
|
+
import { ISelectOption } from '../select';
|
|
3
|
+
/**
|
|
4
|
+
* Sentinel value used by the "Select all" option when it is injected into
|
|
5
|
+
* react-select's option list. The sentinel is stripped from the value before
|
|
6
|
+
* it is exposed to consumers via onChange — it never leaks outside the
|
|
7
|
+
* component.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SELECT_ALL_VALUE = "__tedi_select_all__";
|
|
10
|
+
export declare const isSelectAllSentinel: (option: {
|
|
11
|
+
value?: string;
|
|
12
|
+
} | null | undefined) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Prefix for group sentinel options. When `selectableGroups + multiple` is on,
|
|
15
|
+
* each group is flattened into the option list with a sentinel option at the
|
|
16
|
+
* top of its run; toggling the sentinel toggles every enabled child of that
|
|
17
|
+
* group. The label after the prefix is the original group's label.
|
|
18
|
+
*/
|
|
19
|
+
export declare const GROUP_OPTION_PREFIX = "__tedi_select_group__:";
|
|
20
|
+
export declare const isGroupSentinel: (option: {
|
|
21
|
+
value?: string;
|
|
22
|
+
} | null | undefined) => boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Returns true when `options` is a grouped tree (i.e. each top-level entry
|
|
25
|
+
* has its own `options` array).
|
|
26
|
+
*/
|
|
27
|
+
export declare const isGroupedOptions: (options: OptionsOrGroups<ISelectOption, GroupBase<ISelectOption>>) => options is ReadonlyArray<GroupBase<ISelectOption>>;
|
|
28
|
+
/**
|
|
29
|
+
* Flattens grouped/non-grouped options into a single list of enabled
|
|
30
|
+
* `ISelectOption`s. Used by Select All and group toggles to decide which
|
|
31
|
+
* options to flip on/off.
|
|
32
|
+
*
|
|
33
|
+
* Handles a mixed input where a flat option (e.g. the injected Select-all
|
|
34
|
+
* sentinel) sits alongside groups in the same top-level array, by checking
|
|
35
|
+
* each item individually rather than only inspecting `options[0]`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const getEnabledOptions: (options: OptionsOrGroups<ISelectOption, GroupBase<ISelectOption>>) => ISelectOption[];
|
|
38
|
+
/**
|
|
39
|
+
* Returns the enabled options of a specific group. Pass the group object
|
|
40
|
+
* directly (e.g. `GroupHeadingProps.data` from react-select) — looking groups
|
|
41
|
+
* up by label is unsafe because duplicate labels would always resolve to the
|
|
42
|
+
* first match, mutating the wrong group.
|
|
43
|
+
*/
|
|
44
|
+
export declare const getGroupEnabledOptions: (group: GroupBase<ISelectOption> | null | undefined) => ISelectOption[];
|
|
45
|
+
/** True iff every enabled option is currently in the selection. */
|
|
46
|
+
export declare const areAllSelected: (selected: ReadonlyArray<ISelectOption>, enabled: ReadonlyArray<ISelectOption>) => boolean;
|
|
47
|
+
/** True when some — but not all — enabled options are selected. */
|
|
48
|
+
export declare const isIndeterminate: (selected: ReadonlyArray<ISelectOption>, enabled: ReadonlyArray<ISelectOption>) => boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Toggle behaviour for both Select All and group toggle: when every enabled
|
|
51
|
+
* option in `target` is selected, remove them all; otherwise add the missing
|
|
52
|
+
* ones to the existing selection. Other selected values (e.g. options
|
|
53
|
+
* outside `target`) are preserved.
|
|
54
|
+
*/
|
|
55
|
+
export declare const toggleBulkSelection: (selected: ReadonlyArray<ISelectOption>, target: ReadonlyArray<ISelectOption>) => ISelectOption[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const i = "__tedi_select_all__", o = "__tedi_select_group__:", u = (t) => !!t && typeof t.value == "string" && t.value.startsWith(o), f = (t) => {
|
|
2
|
+
if (!t || t.length === 0) return [];
|
|
3
|
+
const e = [];
|
|
4
|
+
for (const n of t)
|
|
5
|
+
if (n && typeof n == "object" && Array.isArray(n.options))
|
|
6
|
+
for (const s of n.options)
|
|
7
|
+
s.isDisabled || e.push(s);
|
|
8
|
+
else {
|
|
9
|
+
const s = n;
|
|
10
|
+
s && !s.isDisabled && e.push(s);
|
|
11
|
+
}
|
|
12
|
+
return e;
|
|
13
|
+
}, a = (t) => !t || !Array.isArray(t.options) ? [] : t.options.filter((e) => !e.isDisabled), l = (t, e) => e.length === 0 ? !1 : e.every((n) => t.some((s) => s.value === n.value)), c = (t, e) => {
|
|
14
|
+
if (e.length === 0) return !1;
|
|
15
|
+
const n = e.filter((s) => t.some((r) => r.value === s.value)).length;
|
|
16
|
+
return n > 0 && n < e.length;
|
|
17
|
+
}, _ = (t, e) => {
|
|
18
|
+
if (l(t, e))
|
|
19
|
+
return t.filter((s) => !e.some((r) => r.value === s.value));
|
|
20
|
+
const n = [...t];
|
|
21
|
+
for (const s of e)
|
|
22
|
+
n.some((r) => r.value === s.value) || n.push(s);
|
|
23
|
+
return n;
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
o as GROUP_OPTION_PREFIX,
|
|
27
|
+
i as SELECT_ALL_VALUE,
|
|
28
|
+
l as areAllSelected,
|
|
29
|
+
f as getEnabledOptions,
|
|
30
|
+
a as getGroupEnabledOptions,
|
|
31
|
+
u as isGroupSentinel,
|
|
32
|
+
c as isIndeterminate,
|
|
33
|
+
_ as toggleBulkSelection
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=e.createContext(null),u=()=>e.useContext(t);exports.SelectGroupBulkContext=t;exports.useSelectGroupBulkApi=u;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SetValueAction } from 'react-select';
|
|
2
|
+
import { ISelectOption } from '../select';
|
|
3
|
+
/**
|
|
4
|
+
* Exposes react-select's `getValue` / `setValue` helpers from the `Group`
|
|
5
|
+
* component down to `GroupHeading`. react-select only forwards `selectProps`
|
|
6
|
+
* + theme/styles to the heading at runtime, so the heading can't read these
|
|
7
|
+
* helpers from its own props — it has to grab them from this context.
|
|
8
|
+
*
|
|
9
|
+
* Using `selectProps.value` / `selectProps.onChange` instead would only work
|
|
10
|
+
* in fully controlled mode: in uncontrolled mode `value` is undefined and
|
|
11
|
+
* `onChange` bypasses react-select's internal state.
|
|
12
|
+
*/
|
|
13
|
+
export interface SelectGroupBulkApi {
|
|
14
|
+
getValue: () => ReadonlyArray<ISelectOption>;
|
|
15
|
+
setValue: (value: ReadonlyArray<ISelectOption>, action: SetValueAction) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const SelectGroupBulkContext: import('react').Context<SelectGroupBulkApi | null>;
|
|
18
|
+
export declare const useSelectGroupBulkApi: () => SelectGroupBulkApi | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),S=require("../../../../../../external/classnames/index.cjs.js"),q=require("react"),u=require("../../../base/typography/text/text.cjs.js"),G=require("../../checkbox/checkbox.cjs.js"),i=require("../select.module.scss.cjs.js"),s=require("./select-bulk-helpers.cjs.js"),f=require("./select-group-bulk-context.cjs.js"),j=require("../../../../../../external/react-select/dist/index-641ee5b8.esm.cjs.js"),g=({optionGroupHeadingText:x,...e})=>{const _=q.useId(),d=e.data.text||x,{selectableGroups:h,isMulti:b}=e.selectProps,t=f.useSelectGroupBulkApi(),l=!!b&&!!h&&!!t,c=l?s.getGroupEnabledOptions(e.data):[],o=(t==null?void 0:t.getValue())??[],r=l&&s.areAllSelected(o,c),p=l&&s.isIndeterminate(o,c),m=()=>{if(!l||!t||c.length===0)return;const a=s.toggleBulkSelection(o,c);t.setValue(a,r?"deselect-option":"select-option")};return n.jsx(j.c.GroupHeading,{...e,className:S.default(i.default["tedi-select__group-heading"],{[i.default["tedi-select__group-heading--selectable"]]:l}),children:l?n.jsx("div",{className:i.default["tedi-select__group-heading-toggle"],onMouseDown:a=>a.preventDefault(),children:n.jsx(G.Checkbox,{id:`${e.selectProps.instanceId??"tedi-select"}-group-${_}`,name:"tedi-select__group-toggle",value:`__group_${e.data.label}__`,label:n.jsx(u.Text,{...d,children:e.data.label}),checked:r,indeterminate:p,onChange:m})}):n.jsx(u.Text,{...d,children:e.data.label})})};g.displayName="SelectGroupHeading";exports.SelectGroupHeading=g;
|
|
@@ -5,5 +5,8 @@ import { IGroupedOptions, ISelectOption } from '../select';
|
|
|
5
5
|
type GroupHeadingType = GroupHeadingProps<ISelectOption, boolean, IGroupedOptions<ISelectOption>> & {
|
|
6
6
|
optionGroupHeadingText?: Pick<TextProps, 'modifiers' | 'color'>;
|
|
7
7
|
};
|
|
8
|
-
export declare const SelectGroupHeading:
|
|
8
|
+
export declare const SelectGroupHeading: {
|
|
9
|
+
({ optionGroupHeadingText, ...props }: GroupHeadingType): ReactElement;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
9
12
|
export {};
|
|
@@ -1,12 +1,47 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import f from "../../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { useId as b } from "react";
|
|
4
|
+
import { Text as d } from "../../../base/typography/text/text.es.js";
|
|
5
|
+
import { Checkbox as x } from "../../checkbox/checkbox.es.js";
|
|
4
6
|
import i from "../select.module.scss.es.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { getGroupEnabledOptions as S, areAllSelected as G, isIndeterminate as v, toggleBulkSelection as H } from "./select-bulk-helpers.es.js";
|
|
8
|
+
import { useSelectGroupBulkApi as I } from "./select-group-bulk-context.es.js";
|
|
9
|
+
import { c as N } from "../../../../../../external/react-select/dist/index-641ee5b8.esm.es.js";
|
|
10
|
+
const k = ({ optionGroupHeadingText: g, ...e }) => {
|
|
11
|
+
const m = b(), s = e.data.text || g, { selectableGroups: u, isMulti: p } = e.selectProps, t = I(), o = !!p && !!u && !!t, n = o ? S(e.data) : [], a = (t == null ? void 0 : t.getValue()) ?? [], r = o && G(a, n), _ = o && v(a, n), h = () => {
|
|
12
|
+
if (!o || !t || n.length === 0) return;
|
|
13
|
+
const c = H(a, n);
|
|
14
|
+
t.setValue(c, r ? "deselect-option" : "select-option");
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ l(
|
|
17
|
+
N.GroupHeading,
|
|
18
|
+
{
|
|
19
|
+
...e,
|
|
20
|
+
className: f(i["tedi-select__group-heading"], {
|
|
21
|
+
[i["tedi-select__group-heading--selectable"]]: o
|
|
22
|
+
}),
|
|
23
|
+
children: o ? (
|
|
24
|
+
// The Checkbox owns the toggle path through its own `onChange`;
|
|
25
|
+
// attaching another handler to the wrapper would fire `handleToggle`
|
|
26
|
+
// twice on a single user click. The wrapper stays only to swallow the
|
|
27
|
+
// mousedown that would otherwise close react-select's menu.
|
|
28
|
+
/* @__PURE__ */ l("div", { className: i["tedi-select__group-heading-toggle"], onMouseDown: (c) => c.preventDefault(), children: /* @__PURE__ */ l(
|
|
29
|
+
x,
|
|
30
|
+
{
|
|
31
|
+
id: `${e.selectProps.instanceId ?? "tedi-select"}-group-${m}`,
|
|
32
|
+
name: "tedi-select__group-toggle",
|
|
33
|
+
value: `__group_${e.data.label}__`,
|
|
34
|
+
label: /* @__PURE__ */ l(d, { ...s, children: e.data.label }),
|
|
35
|
+
checked: r,
|
|
36
|
+
indeterminate: _,
|
|
37
|
+
onChange: h
|
|
38
|
+
}
|
|
39
|
+
) })
|
|
40
|
+
) : /* @__PURE__ */ l(d, { ...s, children: e.data.label })
|
|
41
|
+
}
|
|
42
|
+
);
|
|
9
43
|
};
|
|
44
|
+
k.displayName = "SelectGroupHeading";
|
|
10
45
|
export {
|
|
11
|
-
|
|
46
|
+
k as SelectGroupHeading
|
|
12
47
|
};
|
|
@@ -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"),o=require("../../../../../../external/classnames/index.cjs.js"),i=require("react"),n=require("../select.module.scss.cjs.js"),s=require("./select-group-bulk-context.cjs.js"),a=require("../../../../../../external/react-select/dist/index-641ee5b8.esm.cjs.js"),u=e=>{const l=i.useMemo(()=>({getValue:()=>e.getValue(),setValue:(r,c)=>e.setValue(r,c)}),[e]);return t.jsx(s.SelectGroupBulkContext.Provider,{value:l,children:t.jsx(a.c.Group,{...e,className:o.default(n.default["tedi-select__group"]),children:e.children})})};u.displayName="SelectGroup";exports.SelectGroup=u;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { GroupProps } from 'react-select';
|
|
2
2
|
import { IGroupedOptions, ISelectOption } from '../select';
|
|
3
|
-
export declare const SelectGroup:
|
|
3
|
+
export declare const SelectGroup: {
|
|
4
|
+
(props: GroupProps<ISelectOption, boolean, IGroupedOptions<ISelectOption>>): JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|