@tedi-design-system/react 18.1.0-rc.2 → 18.1.0-rc.20
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/community.cjs.js +1 -1
- package/community.es.js +156 -152
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/prop-types/external/react-is/index.cjs.js +1 -1
- package/external/prop-types/external/react-is/index.es.js +1 -1
- package/external/react-is/index.cjs.js +1 -1
- package/external/react-is/index.es.js +1 -1
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/community/components/anchor/anchor.d.ts +1 -0
- package/src/community/components/button/button.d.ts +1 -0
- package/src/community/components/card/card-content/card-content.d.ts +3 -0
- package/src/community/components/card/card-header/card-header.d.ts +3 -0
- package/src/community/components/card/card-notification/card-notification.d.ts +3 -0
- package/src/community/components/card/card.d.ts +3 -0
- package/src/community/components/dropdown/dropdown.cjs.js +1 -1
- package/src/community/components/dropdown/dropdown.d.ts +3 -0
- package/src/community/components/dropdown/dropdown.es.js +5 -6
- package/src/community/components/form/choice-group/choice-group.d.ts +3 -0
- package/src/community/components/form/file-upload/file-upload.d.ts +6 -0
- package/src/community/components/form/radio/radio.d.ts +3 -0
- package/src/community/components/form/select/select.d.ts +3 -0
- package/src/community/components/form/toggle/toggle.cjs.js +1 -1
- package/src/community/components/form/toggle/toggle.d.ts +3 -0
- package/src/community/components/form/toggle/toggle.es.js +5 -6
- package/src/community/components/layout/header/components/header-language/header-language.d.ts +3 -0
- package/src/community/components/layout/header/components/header-role/header-role.d.ts +3 -0
- package/src/community/components/layout/header/components/sidenav-toggle/sidenav-toggle.d.ts +3 -0
- package/src/community/components/layout/header/header/header.d.ts +3 -0
- package/src/community/components/layout/sidenav/sidenav.d.ts +3 -0
- package/src/community/components/map-components/base-map-selection/base-map-option.cjs.js +1 -0
- package/src/community/components/map-components/base-map-selection/base-map-option.d.ts +64 -0
- package/src/community/components/map-components/base-map-selection/base-map-option.es.js +75 -0
- package/src/community/components/map-components/base-map-selection/base-map-selection.cjs.js +1 -1
- package/src/community/components/map-components/base-map-selection/base-map-selection.d.ts +37 -22
- package/src/community/components/map-components/base-map-selection/base-map-selection.es.js +76 -17
- package/src/community/components/map-components/base-map-selection/base-map-selection.module.scss.cjs.js +1 -1
- package/src/community/components/map-components/base-map-selection/base-map-selection.module.scss.es.js +5 -1
- package/src/community/components/map-components/button-group/button-group.module.scss.cjs.js +1 -1
- package/src/community/components/map-components/button-group/button-group.module.scss.es.js +1 -0
- package/src/community/components/map-components/left-panel/left-panel-content.cjs.js +1 -1
- package/src/community/components/map-components/left-panel/left-panel-content.d.ts +10 -5
- package/src/community/components/map-components/left-panel/left-panel-content.es.js +7 -21
- package/src/community/components/map-components/left-panel/left-panel-footer.cjs.js +1 -1
- package/src/community/components/map-components/left-panel/left-panel-footer.d.ts +11 -1
- package/src/community/components/map-components/left-panel/left-panel-footer.es.js +7 -24
- package/src/community/components/map-components/left-panel/left-panel-header.cjs.js +1 -1
- package/src/community/components/map-components/left-panel/left-panel-header.d.ts +11 -1
- package/src/community/components/map-components/left-panel/left-panel-header.es.js +7 -62
- package/src/community/components/map-components/left-panel/left-panel.cjs.js +1 -1
- package/src/community/components/map-components/left-panel/left-panel.d.ts +67 -5
- package/src/community/components/map-components/left-panel/left-panel.es.js +85 -14
- package/src/community/components/map-components/left-panel/left-panel.module.scss.cjs.js +1 -1
- package/src/community/components/map-components/left-panel/left-panel.module.scss.es.js +4 -4
- package/src/community/components/map-components/map-button/map-button.cjs.js +1 -1
- package/src/community/components/map-components/map-button/map-button.d.ts +8 -3
- package/src/community/components/map-components/map-button/map-button.es.js +42 -33
- package/src/community/components/map-components/map-button/map-button.module.scss.cjs.js +1 -1
- package/src/community/components/map-components/map-button/map-button.module.scss.es.js +3 -0
- package/src/community/components/map-components/resizer/resizer.cjs.js +1 -1
- package/src/community/components/map-components/resizer/resizer.es.js +9 -10
- package/src/community/components/map-components/split-pane/split-pane.cjs.js +1 -0
- package/src/community/components/map-components/split-pane/split-pane.d.ts +37 -0
- package/src/community/components/map-components/split-pane/split-pane.es.js +128 -0
- package/src/community/components/map-components/split-pane/split-pane.module.scss.cjs.js +1 -0
- package/src/community/components/map-components/split-pane/split-pane.module.scss.es.js +17 -0
- package/src/community/components/status/status.d.ts +3 -0
- package/src/community/components/table/table.d.ts +3 -0
- package/src/community/components/tag/tag.d.ts +3 -0
- package/src/community/components/toggle-open/toggle-open.d.ts +3 -0
- package/src/community/components/tooltip/tooltip-trigger.d.ts +3 -0
- package/src/community/components/tooltip/tooltip.d.ts +3 -0
- package/src/community/index.d.ts +1 -0
- package/src/tedi/components/buttons/collapse-button/collapse-button.cjs.js +1 -1
- package/src/tedi/components/buttons/collapse-button/collapse-button.es.js +2 -1
- package/src/tedi/components/content/table/table.cjs.js +1 -1
- package/src/tedi/components/content/table/table.d.ts +8 -5
- package/src/tedi/components/content/table/table.es.js +308 -295
- package/src/tedi/components/form/file-dropzone/file-dropzone.cjs.js +1 -1
- package/src/tedi/components/form/file-dropzone/file-dropzone.es.js +90 -79
- package/src/tedi/components/form/file-upload/file-upload.cjs.js +1 -1
- package/src/tedi/components/form/file-upload/file-upload.d.ts +4 -1
- package/src/tedi/components/form/file-upload/file-upload.es.js +138 -119
- package/src/tedi/components/form/file-upload/file-upload.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/file-upload/file-upload.module.scss.es.js +1 -1
- package/src/tedi/components/form/search/search.cjs.js +1 -1
- package/src/tedi/components/form/search/search.es.js +60 -40
- package/src/tedi/components/form/search/search.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/search/search.module.scss.es.js +7 -3
- package/src/tedi/components/layout/header/components/header-language/header-language.cjs.js +1 -0
- package/src/tedi/components/layout/header/components/header-language/header-language.es.js +105 -0
- package/src/tedi/components/layout/header/components/header-language/header-language.module.scss.cjs.js +1 -0
- package/src/tedi/components/layout/header/components/header-language/header-language.module.scss.es.js +12 -0
- package/src/tedi/components/layout/header/components/header-login/header-login.cjs.js +1 -0
- package/src/tedi/components/layout/header/components/header-login/header-login.es.js +36 -0
- package/src/tedi/components/layout/header/components/header-login/header-login.module.scss.cjs.js +1 -0
- package/src/tedi/components/layout/header/components/header-login/header-login.module.scss.es.js +8 -0
- package/src/tedi/components/layout/header/components/header-logout/header-logout.cjs.js +1 -0
- package/src/tedi/components/layout/header/components/header-logout/header-logout.es.js +33 -0
- package/src/tedi/components/layout/header/components/header-logout/header-logout.module.scss.cjs.js +1 -0
- package/src/tedi/components/layout/header/components/header-logout/header-logout.module.scss.es.js +7 -0
- package/src/tedi/components/layout/header/components/header-mobile-button/header-mobile-button.cjs.js +1 -0
- package/src/tedi/components/layout/header/components/header-mobile-button/header-mobile-button.es.js +25 -0
- package/src/tedi/components/layout/header/components/header-mobile-button/header-mobile-button.module.scss.cjs.js +1 -0
- package/src/tedi/components/layout/header/components/header-mobile-button/header-mobile-button.module.scss.es.js +10 -0
- package/src/tedi/components/layout/header/components/header-profile/header-profile.cjs.js +1 -0
- package/src/tedi/components/layout/header/components/header-profile/header-profile.es.js +136 -0
- package/src/tedi/components/layout/header/components/header-profile/header-profile.module.scss.cjs.js +1 -0
- package/src/tedi/components/layout/header/components/header-profile/header-profile.module.scss.es.js +14 -0
- package/src/tedi/components/layout/header/components/header-role/header-role-representatives.cjs.js +1 -0
- package/src/tedi/components/layout/header/components/header-role/header-role-representatives.es.js +89 -0
- package/src/tedi/components/layout/header/components/header-role/header-role.cjs.js +1 -0
- package/src/tedi/components/layout/header/components/header-role/header-role.es.js +162 -0
- package/src/tedi/components/layout/header/components/header-role/header-role.module.scss.cjs.js +1 -0
- package/src/tedi/components/layout/header/components/header-role/header-role.module.scss.es.js +25 -0
- package/src/tedi/components/layout/header/components/header-search/header-search.cjs.js +1 -0
- package/src/tedi/components/layout/header/components/header-search/header-search.es.js +60 -0
- package/src/tedi/components/layout/header/components/header-search/header-search.module.scss.cjs.js +1 -0
- package/src/tedi/components/layout/header/components/header-search/header-search.module.scss.es.js +9 -0
- package/src/tedi/components/layout/header/header.cjs.js +1 -0
- package/src/tedi/components/layout/header/header.es.js +63 -0
- package/src/tedi/components/layout/header/header.module.scss.cjs.js +1 -0
- package/src/tedi/components/layout/header/header.module.scss.es.js +13 -0
- package/src/tedi/components/layout/hide-at/hide-at.cjs.js +1 -0
- package/src/tedi/components/layout/hide-at/hide-at.es.js +10 -0
- package/src/tedi/components/layout/show-at/show-at.cjs.js +1 -0
- package/src/tedi/components/layout/show-at/show-at.es.js +10 -0
- package/src/tedi/components/tags/tag/tag.cjs.js +1 -1
- package/src/tedi/components/tags/tag/tag.d.ts +9 -0
- package/src/tedi/components/tags/tag/tag.es.js +18 -17
- package/src/tedi/helpers/hooks/use-file-upload.cjs.js +1 -1
- package/src/tedi/helpers/hooks/use-file-upload.es.js +71 -66
- package/src/tedi/index.d.ts +3 -0
- package/src/tedi/providers/label-provider/label-provider.cjs.js +1 -1
- package/src/tedi/providers/label-provider/label-provider.d.ts +2 -2
- package/src/tedi/providers/label-provider/label-provider.es.js +2 -2
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +49 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +114 -65
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +303 -281
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),R=require("../../../../../external/classnames/index.cjs.js"),S=require("react"),P=require("../../../../../external/react-dropzone/dist/es/index.cjs.js"),T=require("../../../helpers/hooks/use-file-upload.cjs.js"),V=require("../../base/icon/icon.cjs.js"),A=require("../../buttons/button/button.cjs.js"),M=require("../../misc/attachment/attachment.cjs.js"),B=require("../feedback-text/feedback-text.cjs.js"),C=require("../form-label/form-label.cjs.js"),n=require("./file-dropzone.module.scss.cjs.js"),O=require("../../../providers/label-provider/use-labels.cjs.js"),b=require("../../content/list/list.cjs.js"),U=l=>{const{getLabel:r}=O.useLabels(),{label:h=r("file-dropzone.label"),className:v,disabled:o=!1,helper:g,id:j,attachmentProps:c,...y}=l,{innerFiles:p,uploadErrorHelper:s,onFileChange:q,onFileRemove:F,announcement:_}=T.useFileUpload(l),L=S.useId(),f=j??L,{getRootProps:N,getInputProps:$,isDragActive:I}=P.useDropzone({disabled:o,accept:l.accept?{"application/*":[l.accept]}:void 0,multiple:l.multiple,maxSize:l.maxSize?l.maxSize*1024**2:void 0,onDrop:(i,a=[])=>{if(o)return;const u=a.filter(m=>m.errors.some(z=>z.code==="file-too-large"||z.code==="file-invalid-type")).map(m=>m.file),d=[...i,...u];if(d.length===0)return;q({target:{files:d}})}}),t=(s==null?void 0:s.type)==="error"?s:g??s,x=t?t.id??`${f}-helper`:void 0,D=R.default(n.default["tedi-file-dropzone"],{[n.default["tedi-file-dropzone--disabled"]]:o},{[n.default["tedi-file-dropzone--invalid"]]:(t==null?void 0:t.type)==="error"},{[n.default["tedi-file-dropzone--valid"]]:(t==null?void 0:t.type)==="valid"},{[n.default["tedi-file-dropzone--drop-over"]]:I},v);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{...N({role:"button",tabIndex:o?-1:0,"aria-disabled":o,"aria-describedby":x}),className:D,children:[e.jsx("input",{...$(),disabled:o}),e.jsx("div",{className:n.default["tedi-file-dropzone__label-wrapper"],children:e.jsx(C.FormLabel,{...y,id:f,label:e.jsxs(e.Fragment,{children:[e.jsx(V.Icon,{color:o?"tertiary":"secondary",size:24,name:"attach_file",display:"inline",className:n.default["tedi-file-dropzone__label-icon"]}),h]}),className:n.default["tedi-file-dropzone__label"]})})]}),t&&e.jsx(B.FeedbackText,{...t,id:x}),!!p.length&&e.jsx(b.List,{className:n.default["tedi-file-dropzone__file-list"],style:"none","aria-label":r("file-dropzone.selected-files"),children:p.map(i=>{const a=typeof c=="function"?c(i):c,{actions:u,...d}=a??{};return e.jsxs(b.List.Item,{className:n.default["tedi-file-dropzone__file-list-item"],children:[e.jsx(M.Attachment,{...d,name:i.name??"",isValid:i.isValid??(a==null?void 0:a.isValid),isLoading:i.isLoading??(a==null?void 0:a.isLoading),actions:e.jsxs(e.Fragment,{children:[u,e.jsx(A.Button,{visualType:"neutral",icon:"delete",onClick:()=>F(i),children:`${r("remove")} ${i.name??""}`})]})}),i.isValid===!1&&e.jsx("span",{className:"sr-only",children:`${r("file-dropzone.failed")} ${i.name??""}`})]},i.id??`${i.name??"file"}-${i.size??""}-${i.lastModified??""}`)})}),e.jsx("div",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:_})]})};exports.FileDropzone=U;
|
|
@@ -1,114 +1,125 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { jsxs as s, Fragment as z, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import P from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import S from "react";
|
|
4
|
+
import { useDropzone as B } from "../../../../../external/react-dropzone/dist/es/index.es.js";
|
|
5
|
+
import { useFileUpload as C } from "../../../helpers/hooks/use-file-upload.es.js";
|
|
6
|
+
import { Icon as M } from "../../base/icon/icon.es.js";
|
|
7
|
+
import { Button as T } from "../../buttons/button/button.es.js";
|
|
8
|
+
import { Attachment as w } from "../../misc/attachment/attachment.es.js";
|
|
9
|
+
import { FeedbackText as O } from "../feedback-text/feedback-text.es.js";
|
|
10
|
+
import { FormLabel as U } from "../form-label/form-label.es.js";
|
|
11
|
+
import t from "./file-dropzone.module.scss.es.js";
|
|
12
|
+
import { useLabels as q } from "../../../providers/label-provider/use-labels.es.js";
|
|
13
|
+
import { List as g } from "../../content/list/list.es.js";
|
|
14
|
+
const te = (l) => {
|
|
15
|
+
const { getLabel: d } = q(), {
|
|
16
|
+
label: y = d("file-dropzone.label"),
|
|
17
|
+
className: _,
|
|
18
|
+
disabled: n = !1,
|
|
19
|
+
helper: N,
|
|
20
|
+
id: x,
|
|
20
21
|
attachmentProps: m,
|
|
21
|
-
...
|
|
22
|
-
} = l, { innerFiles:
|
|
23
|
-
disabled:
|
|
22
|
+
...F
|
|
23
|
+
} = l, { innerFiles: h, uploadErrorHelper: r, onFileChange: I, onFileRemove: $, announcement: L } = C(l), D = S.useId(), u = x ?? D, { getRootProps: R, getInputProps: V, isDragActive: j } = B({
|
|
24
|
+
disabled: n,
|
|
24
25
|
accept: l.accept ? { "application/*": [l.accept] } : void 0,
|
|
25
26
|
multiple: l.multiple,
|
|
26
27
|
maxSize: l.maxSize ? l.maxSize * 1024 ** 2 : void 0,
|
|
27
|
-
onDrop: (
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
onDrop: (e, a = []) => {
|
|
29
|
+
if (n) return;
|
|
30
|
+
const p = a.filter(
|
|
31
|
+
(f) => f.errors.some((b) => b.code === "file-too-large" || b.code === "file-invalid-type")
|
|
32
|
+
).map((f) => f.file), c = [...e, ...p];
|
|
33
|
+
if (c.length === 0) return;
|
|
34
|
+
I({
|
|
35
|
+
target: { files: c }
|
|
31
36
|
});
|
|
32
37
|
}
|
|
33
|
-
}),
|
|
34
|
-
|
|
35
|
-
{ [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
{ [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
}), i = (r == null ? void 0 : r.type) === "error" ? r : N ?? r, v = i ? i.id ?? `${u}-helper` : void 0, A = P(
|
|
39
|
+
t["tedi-file-dropzone"],
|
|
40
|
+
{ [t["tedi-file-dropzone--disabled"]]: n },
|
|
41
|
+
// Drive the visual state from the same `feedback` that is rendered, so the
|
|
42
|
+
// invalid/valid styling never diverges from the message shown.
|
|
43
|
+
{ [t["tedi-file-dropzone--invalid"]]: (i == null ? void 0 : i.type) === "error" },
|
|
44
|
+
{ [t["tedi-file-dropzone--valid"]]: (i == null ? void 0 : i.type) === "valid" },
|
|
45
|
+
{ [t["tedi-file-dropzone--drop-over"]]: j },
|
|
46
|
+
_
|
|
47
|
+
);
|
|
48
|
+
return /* @__PURE__ */ s(z, { children: [
|
|
49
|
+
/* @__PURE__ */ s(
|
|
43
50
|
"div",
|
|
44
51
|
{
|
|
45
|
-
...
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"aria-
|
|
52
|
+
...R({
|
|
53
|
+
role: "button",
|
|
54
|
+
tabIndex: n ? -1 : 0,
|
|
55
|
+
"aria-disabled": n,
|
|
56
|
+
"aria-describedby": v
|
|
49
57
|
}),
|
|
50
|
-
className:
|
|
58
|
+
className: A,
|
|
51
59
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
|
|
60
|
+
/* @__PURE__ */ o("input", { ...V(), disabled: n }),
|
|
61
|
+
/* @__PURE__ */ o("div", { className: t["tedi-file-dropzone__label-wrapper"], children: /* @__PURE__ */ o(
|
|
62
|
+
U,
|
|
55
63
|
{
|
|
56
|
-
...
|
|
57
|
-
id:
|
|
58
|
-
label: /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
64
|
+
...F,
|
|
65
|
+
id: u,
|
|
66
|
+
label: /* @__PURE__ */ s(z, { children: [
|
|
67
|
+
/* @__PURE__ */ o(
|
|
68
|
+
M,
|
|
61
69
|
{
|
|
62
|
-
color:
|
|
70
|
+
color: n ? "tertiary" : "secondary",
|
|
63
71
|
size: 24,
|
|
64
72
|
name: "attach_file",
|
|
65
73
|
display: "inline",
|
|
66
|
-
className:
|
|
74
|
+
className: t["tedi-file-dropzone__label-icon"]
|
|
67
75
|
}
|
|
68
76
|
),
|
|
69
|
-
|
|
77
|
+
y
|
|
70
78
|
] }),
|
|
71
|
-
className:
|
|
79
|
+
className: t["tedi-file-dropzone__label"]
|
|
72
80
|
}
|
|
73
81
|
) })
|
|
74
82
|
]
|
|
75
83
|
}
|
|
76
84
|
),
|
|
77
|
-
|
|
78
|
-
!!
|
|
79
|
-
|
|
85
|
+
i && /* @__PURE__ */ o(O, { ...i, id: v }),
|
|
86
|
+
!!h.length && /* @__PURE__ */ o(
|
|
87
|
+
g,
|
|
80
88
|
{
|
|
81
|
-
className:
|
|
89
|
+
className: t["tedi-file-dropzone__file-list"],
|
|
82
90
|
style: "none",
|
|
83
|
-
"aria-label":
|
|
84
|
-
children:
|
|
85
|
-
const
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
|
|
91
|
+
"aria-label": d("file-dropzone.selected-files"),
|
|
92
|
+
children: h.map((e) => {
|
|
93
|
+
const a = typeof m == "function" ? m(e) : m, { actions: p, ...c } = a ?? {};
|
|
94
|
+
return /* @__PURE__ */ s(
|
|
95
|
+
g.Item,
|
|
88
96
|
{
|
|
89
|
-
className:
|
|
90
|
-
children:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
className: t["tedi-file-dropzone__file-list-item"],
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ o(
|
|
100
|
+
w,
|
|
101
|
+
{
|
|
102
|
+
...c,
|
|
103
|
+
name: e.name ?? "",
|
|
104
|
+
isValid: e.isValid ?? (a == null ? void 0 : a.isValid),
|
|
105
|
+
isLoading: e.isLoading ?? (a == null ? void 0 : a.isLoading),
|
|
106
|
+
actions: /* @__PURE__ */ s(z, { children: [
|
|
107
|
+
p,
|
|
108
|
+
/* @__PURE__ */ o(T, { visualType: "neutral", icon: "delete", onClick: () => $(e), children: `${d("remove")} ${e.name ?? ""}` })
|
|
109
|
+
] })
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
e.isValid === !1 && /* @__PURE__ */ o("span", { className: "sr-only", children: `${d("file-dropzone.failed")} ${e.name ?? ""}` })
|
|
113
|
+
]
|
|
103
114
|
},
|
|
104
|
-
|
|
115
|
+
e.id ?? `${e.name ?? "file"}-${e.size ?? ""}-${e.lastModified ?? ""}`
|
|
105
116
|
);
|
|
106
117
|
})
|
|
107
118
|
}
|
|
108
119
|
),
|
|
109
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ o("div", { className: "sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", children: L })
|
|
110
121
|
] });
|
|
111
122
|
};
|
|
112
123
|
export {
|
|
113
|
-
|
|
124
|
+
te as FileDropzone
|
|
114
125
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("../../../../../external/classnames/index.cjs.js"),p=require("react"),de=require("../../../helpers/hooks/use-file-upload.cjs.js"),oe=require("../../base/typography/text/text.cjs.js"),S=require("../../buttons/button/button.cjs.js"),re=require("../../buttons/closing-button/closing-button.cjs.js"),ce=require("../form-label/form-label.cjs.js"),ue=require("../../misc/separator/separator.cjs.js"),fe=require("../../tags/tag/tag.cjs.js"),z=require("../feedback-text/feedback-text.cjs.js"),g=require("../input-group/input-group.cjs.js"),a=require("./file-upload.module.scss.cjs.js"),pe=require("../../../providers/label-provider/use-labels.cjs.js"),M=require("../../../helpers/hooks/use-breakpoint.cjs.js"),me=require("../../layout/grid/row.cjs.js"),O=require("../../layout/grid/col.cjs.js"),A=P=>{var U;const{getLabel:n}=pe.useLabels(),{id:V,name:$,label:v,accept:y,multiple:F,onChange:m,className:D,wrapperClassName:W,defaultFiles:H,onDelete:J,hasClearButton:K=!0,files:c,readOnly:x,disabled:s=!1,maxSize:Q,validateIndividually:X=!1,size:u="default",helper:i,...Y}=P,{innerFiles:_,uploadErrorHelper:t,onFileChange:Z,onFileRemove:E,handleClear:G,announcement:ee}=de.useFileUpload({accept:y,maxSize:Q,multiple:F,validateIndividually:X,defaultFiles:H,onChange:m,onDelete:J,files:c}),le=M.default(),ae=p.useId(),d=(U=g.useOptionalInputGroup)==null?void 0:U.call(g),te=d==null?void 0:d.hasExternalLabel,f=V??(d==null?void 0:d.inputId)??ae,q=p.useRef(null),N=p.useRef(null),ie=j.default(a.default["tedi-file-upload"],{[a.default["tedi-file-upload--disabled"]]:s},D),B=(t==null?void 0:t.type)==="error",h=i??(B?void 0:t),b=B?t:void 0,C=h?(i==null?void 0:i.id)??`${f}-helper`:void 0,L=b?`${f}-error`:void 0,k=[C,L].filter(Boolean).join(" ")||void 0,o=p.useMemo(()=>c&&m?c:_,[c,_,m]),R=()=>{var l;return(l=N.current)==null?void 0:l.focus()},se=l=>{E(l),R()},I=()=>{G(),R()},ne=(l,r)=>{const w=l.isValid===!1;return e.jsx("li",{children:e.jsxs(fe.Tag,{role:"presentation",color:w?"danger":"primary",onClose:!l.isLoading&&!s&&!x?()=>se(l):void 0,isLoading:l.isLoading,closeButtonProps:{title:`${n("remove")} ${l.name}`},children:[l.name,w&&e.jsxs("span",{className:"sr-only",children:[" (",n("file-upload.failed"),")"]})]})},l.id??r)},T=()=>{if(o.length>1)return e.jsx("ul",{className:a.default["tedi-file-upload__items"],children:o.map((l,r)=>ne(l,r))});if(o.length===1){const l=o[0],r=l.isValid===!1;return e.jsxs(oe.Text,{className:j.default(a.default["tedi-file-upload__items"],a.default["tedi-file-upload__items--truncate"]),children:[l.name,r&&e.jsxs("span",{className:"sr-only",children:[" (",n("file-upload.failed"),")"]})]})}return null};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a.default["tedi-file-upload__label-wrapper"],children:!te&&v&&e.jsx(ce.FormLabel,{id:f,label:v??"",...Y,renderWithoutLabel:x,className:a.default["tedi-file-upload__label"],size:u})}),e.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ee}),x?T():e.jsx("div",{className:j.default(a.default["tedi-file-upload__container"],{[a.default["tedi-file-upload--disabled"]]:s,[a.default["tedi-file-upload--error"]]:((t==null?void 0:t.type)||(i==null?void 0:i.type))==="error",[a.default["tedi-file-upload--valid"]]:((t==null?void 0:t.type)||(i==null?void 0:i.type))==="valid"},{[a.default[`tedi-file-upload__container--${u}`]]:u},W),children:e.jsx("div",{className:a.default["tedi-file-upload__content"],children:e.jsxs(me.Row,{children:[e.jsx(O.Col,{className:"display-flex",children:T()}),e.jsx(O.Col,{xs:12,md:"auto",children:e.jsxs("div",{className:ie,children:[e.jsx("input",{ref:q,id:f,type:"file",name:$,accept:y,onChange:Z,multiple:F,disabled:s,"aria-invalid":!!t&&t.type==="error","aria-describedby":k}),K&&o.length>0&&!s&&e.jsxs(e.Fragment,{children:[M.isBreakpointBelow(le,"md")?e.jsx(S.Button,{visualType:"neutral",iconLeft:"close",disabled:s,onClick:I,className:a.default["tedi-file-upload__button"],children:n("clear")}):e.jsx(re.ClosingButton,{onClick:I,iconSize:18,title:n("clear")}),e.jsx(ue.Separator,{axis:"vertical",height:1.5,spacing:.5,color:"primary"})]}),e.jsx(S.Button,{ref:N,visualType:"neutral",iconLeft:"file_upload",disabled:s,onClick:()=>{var l;return(l=q.current)==null?void 0:l.click()},className:a.default["tedi-file-upload__button"],size:u,"aria-describedby":k,children:n("file-upload.add")})]})})]})})}),h&&e.jsx(z.FeedbackText,{...h,id:C}),b&&e.jsx(z.FeedbackText,{...b,id:L})]})};A.displayName="FileUpload";exports.FileUpload=A;
|
|
@@ -84,5 +84,8 @@ export interface FileUploadProps extends Omit<FormLabelProps, 'id' | 'label'> {
|
|
|
84
84
|
*/
|
|
85
85
|
size?: 'small' | 'default';
|
|
86
86
|
}
|
|
87
|
-
export declare const FileUpload:
|
|
87
|
+
export declare const FileUpload: {
|
|
88
|
+
(props: FileUploadProps): JSX.Element;
|
|
89
|
+
displayName: string;
|
|
90
|
+
};
|
|
88
91
|
export default FileUpload;
|
|
@@ -1,159 +1,178 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useFileUpload as
|
|
5
|
-
import { Text as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { ClosingButton as
|
|
8
|
-
import { FormLabel as
|
|
9
|
-
import { Separator as
|
|
10
|
-
import { Tag as
|
|
11
|
-
import { FeedbackText as
|
|
12
|
-
import { useOptionalInputGroup as
|
|
13
|
-
import
|
|
14
|
-
import { useLabels as
|
|
15
|
-
import
|
|
16
|
-
import { Row as
|
|
17
|
-
import { Col as
|
|
18
|
-
const
|
|
19
|
-
var
|
|
20
|
-
const { getLabel:
|
|
21
|
-
id:
|
|
22
|
-
name:
|
|
23
|
-
label:
|
|
24
|
-
accept:
|
|
25
|
-
multiple:
|
|
26
|
-
onChange:
|
|
27
|
-
className:
|
|
28
|
-
wrapperClassName:
|
|
29
|
-
defaultFiles:
|
|
30
|
-
onDelete:
|
|
31
|
-
hasClearButton:
|
|
32
|
-
files:
|
|
33
|
-
readOnly:
|
|
34
|
-
disabled:
|
|
35
|
-
maxSize:
|
|
36
|
-
validateIndividually:
|
|
37
|
-
size:
|
|
38
|
-
helper:
|
|
39
|
-
...
|
|
40
|
-
} =
|
|
41
|
-
accept:
|
|
42
|
-
maxSize:
|
|
43
|
-
multiple:
|
|
44
|
-
validateIndividually:
|
|
45
|
-
defaultFiles:
|
|
46
|
-
onChange:
|
|
47
|
-
onDelete:
|
|
48
|
-
files:
|
|
49
|
-
}),
|
|
50
|
-
|
|
51
|
-
return
|
|
52
|
-
|
|
1
|
+
import { jsxs as t, Fragment as z, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import y from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import f from "react";
|
|
4
|
+
import { useFileUpload as ne } from "../../../helpers/hooks/use-file-upload.es.js";
|
|
5
|
+
import { Text as se } from "../../base/typography/text/text.es.js";
|
|
6
|
+
import { Button as S } from "../../buttons/button/button.es.js";
|
|
7
|
+
import { ClosingButton as re } from "../../buttons/closing-button/closing-button.es.js";
|
|
8
|
+
import { FormLabel as de } from "../form-label/form-label.es.js";
|
|
9
|
+
import { Separator as ce } from "../../misc/separator/separator.es.js";
|
|
10
|
+
import { Tag as me } from "../../tags/tag/tag.es.js";
|
|
11
|
+
import { FeedbackText as A } from "../feedback-text/feedback-text.es.js";
|
|
12
|
+
import { useOptionalInputGroup as pe } from "../input-group/input-group.es.js";
|
|
13
|
+
import l from "./file-upload.module.scss.es.js";
|
|
14
|
+
import { useLabels as ue } from "../../../providers/label-provider/use-labels.es.js";
|
|
15
|
+
import fe, { isBreakpointBelow as he } from "../../../helpers/hooks/use-breakpoint.es.js";
|
|
16
|
+
import { Row as ve } from "../../layout/grid/row.es.js";
|
|
17
|
+
import { Col as M } from "../../layout/grid/col.es.js";
|
|
18
|
+
const be = (O) => {
|
|
19
|
+
var $;
|
|
20
|
+
const { getLabel: s } = ue(), {
|
|
21
|
+
id: V,
|
|
22
|
+
name: D,
|
|
23
|
+
label: g,
|
|
24
|
+
accept: F,
|
|
25
|
+
multiple: N,
|
|
26
|
+
onChange: h,
|
|
27
|
+
className: P,
|
|
28
|
+
wrapperClassName: W,
|
|
29
|
+
defaultFiles: q,
|
|
30
|
+
onDelete: H,
|
|
31
|
+
hasClearButton: J = !0,
|
|
32
|
+
files: m,
|
|
33
|
+
readOnly: v,
|
|
34
|
+
disabled: n = !1,
|
|
35
|
+
maxSize: K,
|
|
36
|
+
validateIndividually: Q = !1,
|
|
37
|
+
size: p = "default",
|
|
38
|
+
helper: o,
|
|
39
|
+
...X
|
|
40
|
+
} = O, { innerFiles: B, uploadErrorHelper: a, onFileChange: Y, onFileRemove: Z, handleClear: E, announcement: G } = ne({
|
|
41
|
+
accept: F,
|
|
42
|
+
maxSize: K,
|
|
43
|
+
multiple: N,
|
|
44
|
+
validateIndividually: Q,
|
|
45
|
+
defaultFiles: q,
|
|
46
|
+
onChange: h,
|
|
47
|
+
onDelete: H,
|
|
48
|
+
files: m
|
|
49
|
+
}), ee = fe(), ie = f.useId(), r = ($ = pe) == null ? void 0 : $(), le = r == null ? void 0 : r.hasExternalLabel, u = V ?? (r == null ? void 0 : r.inputId) ?? ie, C = f.useRef(null), L = f.useRef(null), ae = y(l["tedi-file-upload"], { [l["tedi-file-upload--disabled"]]: n }, P), x = (a == null ? void 0 : a.type) === "error", b = o ?? (x ? void 0 : a), _ = x ? a : void 0, k = b ? (o == null ? void 0 : o.id) ?? `${u}-helper` : void 0, I = _ ? `${u}-error` : void 0, R = [k, I].filter(Boolean).join(" ") || void 0, d = f.useMemo(() => m && h ? m : B, [m, B, h]), w = () => {
|
|
50
|
+
var e;
|
|
51
|
+
return (e = L.current) == null ? void 0 : e.focus();
|
|
52
|
+
}, oe = (e) => {
|
|
53
|
+
Z(e), w();
|
|
54
|
+
}, T = () => {
|
|
55
|
+
E(), w();
|
|
56
|
+
}, te = (e, c) => {
|
|
57
|
+
const j = e.isValid === !1;
|
|
58
|
+
return /* @__PURE__ */ i("li", { children: /* @__PURE__ */ t(
|
|
59
|
+
me,
|
|
53
60
|
{
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
role: "presentation",
|
|
62
|
+
color: j ? "danger" : "primary",
|
|
63
|
+
onClose: !e.isLoading && !n && !v ? () => oe(e) : void 0,
|
|
56
64
|
isLoading: e.isLoading,
|
|
57
|
-
"
|
|
58
|
-
children:
|
|
65
|
+
closeButtonProps: { title: `${s("remove")} ${e.name}` },
|
|
66
|
+
children: [
|
|
67
|
+
e.name,
|
|
68
|
+
j && /* @__PURE__ */ t("span", { className: "sr-only", children: [
|
|
69
|
+
" (",
|
|
70
|
+
s("file-upload.failed"),
|
|
71
|
+
")"
|
|
72
|
+
] })
|
|
73
|
+
]
|
|
59
74
|
}
|
|
60
|
-
) },
|
|
61
|
-
},
|
|
62
|
-
if (
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
if (
|
|
65
|
-
const e =
|
|
66
|
-
return /* @__PURE__ */ l
|
|
67
|
-
|
|
68
|
-
{
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
);
|
|
75
|
+
) }, e.id ?? c);
|
|
76
|
+
}, U = () => {
|
|
77
|
+
if (d.length > 1)
|
|
78
|
+
return /* @__PURE__ */ i("ul", { className: l["tedi-file-upload__items"], children: d.map((e, c) => te(e, c)) });
|
|
79
|
+
if (d.length === 1) {
|
|
80
|
+
const e = d[0], c = e.isValid === !1;
|
|
81
|
+
return /* @__PURE__ */ t(se, { className: y(l["tedi-file-upload__items"], l["tedi-file-upload__items--truncate"]), children: [
|
|
82
|
+
e.name,
|
|
83
|
+
c && /* @__PURE__ */ t("span", { className: "sr-only", children: [
|
|
84
|
+
" (",
|
|
85
|
+
s("file-upload.failed"),
|
|
86
|
+
")"
|
|
87
|
+
] })
|
|
88
|
+
] });
|
|
74
89
|
}
|
|
75
90
|
return null;
|
|
76
91
|
};
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
92
|
+
return /* @__PURE__ */ t(z, { children: [
|
|
93
|
+
/* @__PURE__ */ i("div", { className: l["tedi-file-upload__label-wrapper"], children: !le && g && /* @__PURE__ */ i(
|
|
94
|
+
de,
|
|
80
95
|
{
|
|
81
|
-
id:
|
|
82
|
-
label:
|
|
83
|
-
...
|
|
84
|
-
renderWithoutLabel:
|
|
85
|
-
className:
|
|
86
|
-
size:
|
|
96
|
+
id: u,
|
|
97
|
+
label: g ?? "",
|
|
98
|
+
...X,
|
|
99
|
+
renderWithoutLabel: v,
|
|
100
|
+
className: l["tedi-file-upload__label"],
|
|
101
|
+
size: p
|
|
87
102
|
}
|
|
88
103
|
) }),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
104
|
+
/* @__PURE__ */ i("div", { role: "status", "aria-live": "polite", "aria-atomic": "true", className: "sr-only", children: G }),
|
|
105
|
+
v ? U() : /* @__PURE__ */ i(
|
|
91
106
|
"div",
|
|
92
107
|
{
|
|
93
|
-
className:
|
|
94
|
-
|
|
108
|
+
className: y(
|
|
109
|
+
l["tedi-file-upload__container"],
|
|
95
110
|
{
|
|
96
|
-
[
|
|
97
|
-
[
|
|
98
|
-
[
|
|
111
|
+
[l["tedi-file-upload--disabled"]]: n,
|
|
112
|
+
[l["tedi-file-upload--error"]]: ((a == null ? void 0 : a.type) || (o == null ? void 0 : o.type)) === "error",
|
|
113
|
+
[l["tedi-file-upload--valid"]]: ((a == null ? void 0 : a.type) || (o == null ? void 0 : o.type)) === "valid"
|
|
99
114
|
},
|
|
100
|
-
{ [
|
|
101
|
-
|
|
115
|
+
{ [l[`tedi-file-upload__container--${p}`]]: p },
|
|
116
|
+
W
|
|
102
117
|
),
|
|
103
|
-
children: /* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
118
|
+
children: /* @__PURE__ */ i("div", { className: l["tedi-file-upload__content"], children: /* @__PURE__ */ t(ve, { children: [
|
|
119
|
+
/* @__PURE__ */ i(M, { className: "display-flex", children: U() }),
|
|
120
|
+
/* @__PURE__ */ i(M, { xs: 12, md: "auto", children: /* @__PURE__ */ t("div", { className: ae, children: [
|
|
121
|
+
/* @__PURE__ */ i(
|
|
107
122
|
"input",
|
|
108
123
|
{
|
|
109
|
-
ref:
|
|
110
|
-
id:
|
|
124
|
+
ref: C,
|
|
125
|
+
id: u,
|
|
111
126
|
type: "file",
|
|
112
|
-
name:
|
|
113
|
-
accept:
|
|
114
|
-
onChange:
|
|
115
|
-
multiple:
|
|
116
|
-
disabled:
|
|
117
|
-
"aria-invalid": !!
|
|
118
|
-
"aria-describedby":
|
|
127
|
+
name: D,
|
|
128
|
+
accept: F,
|
|
129
|
+
onChange: Y,
|
|
130
|
+
multiple: N,
|
|
131
|
+
disabled: n,
|
|
132
|
+
"aria-invalid": !!a && a.type === "error",
|
|
133
|
+
"aria-describedby": R
|
|
119
134
|
}
|
|
120
135
|
),
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
136
|
+
J && d.length > 0 && !n && /* @__PURE__ */ t(z, { children: [
|
|
137
|
+
he(ee, "md") ? /* @__PURE__ */ i(
|
|
138
|
+
S,
|
|
124
139
|
{
|
|
125
140
|
visualType: "neutral",
|
|
126
141
|
iconLeft: "close",
|
|
127
|
-
disabled:
|
|
128
|
-
onClick:
|
|
129
|
-
className:
|
|
130
|
-
children:
|
|
142
|
+
disabled: n,
|
|
143
|
+
onClick: T,
|
|
144
|
+
className: l["tedi-file-upload__button"],
|
|
145
|
+
children: s("clear")
|
|
131
146
|
}
|
|
132
|
-
) : /* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
147
|
+
) : /* @__PURE__ */ i(re, { onClick: T, iconSize: 18, title: s("clear") }),
|
|
148
|
+
/* @__PURE__ */ i(ce, { axis: "vertical", height: 1.5, spacing: 0.5, color: "primary" })
|
|
134
149
|
] }),
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
|
|
150
|
+
/* @__PURE__ */ i(
|
|
151
|
+
S,
|
|
137
152
|
{
|
|
153
|
+
ref: L,
|
|
138
154
|
visualType: "neutral",
|
|
139
155
|
iconLeft: "file_upload",
|
|
140
|
-
disabled:
|
|
156
|
+
disabled: n,
|
|
141
157
|
onClick: () => {
|
|
142
158
|
var e;
|
|
143
|
-
return (e =
|
|
159
|
+
return (e = C.current) == null ? void 0 : e.click();
|
|
144
160
|
},
|
|
145
|
-
className:
|
|
146
|
-
size:
|
|
147
|
-
|
|
161
|
+
className: l["tedi-file-upload__button"],
|
|
162
|
+
size: p,
|
|
163
|
+
"aria-describedby": R,
|
|
164
|
+
children: s("file-upload.add")
|
|
148
165
|
}
|
|
149
166
|
)
|
|
150
167
|
] }) })
|
|
151
168
|
] }) })
|
|
152
169
|
}
|
|
153
170
|
),
|
|
154
|
-
|
|
171
|
+
b && /* @__PURE__ */ i(A, { ...b, id: k }),
|
|
172
|
+
_ && /* @__PURE__ */ i(A, { ..._, id: I })
|
|
155
173
|
] });
|
|
156
174
|
};
|
|
175
|
+
be.displayName = "FileUpload";
|
|
157
176
|
export {
|
|
158
|
-
|
|
177
|
+
be as FileUpload
|
|
159
178
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-file-upload":"tedi-file-upload-115f37c2","tedi-file-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-file-upload":"tedi-file-upload-115f37c2","tedi-file-upload__button":"tedi-file-upload__button-f37449e6","tedi-file-upload__items":"tedi-file-upload__items-c73c19e5","tedi-file-upload__container":"tedi-file-upload__container-6b0f28a8","tedi-file-upload__container--default":"tedi-file-upload__container--default-56af0d96","tedi-file-upload__container--small":"tedi-file-upload__container--small-4d5cd36e","tedi-file-upload--disabled":"tedi-file-upload--disabled-88f4fdcd","tedi-file-upload--error":"tedi-file-upload--error-388cda6f","tedi-file-upload--valid":"tedi-file-upload--valid-28d5eb71","tedi-file-upload__content":"tedi-file-upload__content-8b6bf324","tedi-file-upload__items--truncate":"tedi-file-upload__items--truncate-5c249a01","tedi-file-upload__tag--truncate":"tedi-file-upload__tag--truncate-4c99cb2b"};exports.default=e;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const e = {
|
|
2
2
|
"tedi-file-upload": "tedi-file-upload-115f37c2",
|
|
3
|
+
"tedi-file-upload__button": "tedi-file-upload__button-f37449e6",
|
|
3
4
|
"tedi-file-upload__items": "tedi-file-upload__items-c73c19e5",
|
|
4
5
|
"tedi-file-upload__container": "tedi-file-upload__container-6b0f28a8",
|
|
5
6
|
"tedi-file-upload__container--default": "tedi-file-upload__container--default-56af0d96",
|
|
6
|
-
"tedi-file-upload__button": "tedi-file-upload__button-f37449e6",
|
|
7
7
|
"tedi-file-upload__container--small": "tedi-file-upload__container--small-4d5cd36e",
|
|
8
8
|
"tedi-file-upload--disabled": "tedi-file-upload--disabled-88f4fdcd",
|
|
9
9
|
"tedi-file-upload--error": "tedi-file-upload--error-388cda6f",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),t=require("../../../../../external/classnames/index.cjs.js"),v=require("react"),w=require("../../buttons/button/button.cjs.js"),j=require("../textfield/textfield.cjs.js"),a=require("./search.module.scss.cjs.js"),L=require("../../../providers/label-provider/use-labels.cjs.js"),n=v.forwardRef(({placeholder:u,isClearable:o=!0,searchIcon:r="search",onSearch:s,onChange:f,button:e,ariaLabel:h,className:_,input:p,...l},m)=>{const{getLabel:i}=L.useLabels(),b=g=>{g.key==="Enter"&&(s==null||s(l.value))},x=()=>{s==null||s(l.value)},d=typeof r=="string"?{name:r}:r,y={color:"secondary",...d,className:t.default(d.className,l.disabled&&a.default["tedi-search__icon--disabled"])},q={...l,ref:m,inputClassName:t.default(a.default["tedi-search__input"],e&&a.default["tedi-search__input--has-button"],_),placeholder:u,isClearable:o,onKeyDown:b,onChange:f,input:{...p,role:"searchbox"},...e?{}:{icon:y}},N=h||i("search");return c.jsxs("div",{className:t.default(a.default["tedi-search__wrapper"],l.size==="small"&&a.default["tedi-search__wrapper--small"],l.size==="large"&&a.default["tedi-search__wrapper--large"]),role:"search","aria-label":N,children:[c.jsx(j.TextField,{...q}),e&&c.jsx(w.Button,{...e,onClick:x,className:t.default(a.default["tedi-search__button"],!e.children&&a.default["tedi-search__button--icon-only"],e.className),"aria-label":e.children?void 0:i("search"),children:e.children??i("search")})]})});n.displayName="Search";exports.Search=n;
|