@tedi-design-system/react 19.1.0-rc.3 → 19.1.0-rc.5
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/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/package.json +1 -1
- package/src/tedi/components/form/time-field/time-field.cjs.js +1 -1
- package/src/tedi/components/form/time-field/time-field.es.js +126 -124
- package/src/tedi/components/overlays/overlay/overlay-trigger.cjs.js +1 -1
- package/src/tedi/components/overlays/overlay/overlay-trigger.es.js +22 -21
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +7 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +7 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.cjs.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.cjs.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.cjs3.js"),r=require("./cjs/react-is.production.min.cjs.js"),o=require("./cjs/react-is.development.cjs.js");process.env.NODE_ENV==="production"?e.__module.exports=r.__require():e.__module.exports=o.__require();var t=e.__module.exports;exports.reactIsExports=t;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as r } from "../../../../_virtual/index.
|
|
1
|
+
import { __module as r } from "../../../../_virtual/index.es3.js";
|
|
2
2
|
import { __require as e } from "./cjs/react-is.production.min.es.js";
|
|
3
3
|
import { __require as o } from "./cjs/react-is.development.es.js";
|
|
4
4
|
process.env.NODE_ENV === "production" ? r.exports = e() : r.exports = o();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.cjs2.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.cjs2.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.cjs4.js"),t=require("./cjs/react-is.production.min.cjs.js"),o=require("./cjs/react-is.development.cjs.js");var r;function u(){return r||(r=1,process.env.NODE_ENV==="production"?e.__module.exports=t.__require():e.__module.exports=o.__require()),e.__module.exports}exports.__require=u;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as e } from "../../../../_virtual/index.
|
|
1
|
+
import { __module as e } from "../../../../_virtual/index.es4.js";
|
|
2
2
|
import { __require as o } from "./cjs/react-is.production.min.es.js";
|
|
3
3
|
import { __require as t } from "./cjs/react-is.development.es.js";
|
|
4
4
|
var r;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tedi-design-system/react",
|
|
3
|
-
"version": "19.1.0-rc.
|
|
3
|
+
"version": "19.1.0-rc.5",
|
|
4
4
|
"description": "TEDI Design System React component library — accessible, reusable UI components. Docs & live examples: https://storybook.tedi.ee/react/rc/",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),M=require("../../../../../external/classnames/index.cjs.js"),m=require("react"),J=require("../textfield/textfield.cjs.js"),Pe=require("../time-picker/time-picker.cjs.js"),c=require("./time-field.module.scss.cjs.js"),Q=require("./time-field-helpers.cjs.js"),Ce=require("./time-picker-modal/time-picker-modal.cjs.js"),_e=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),Te=require("../../../providers/label-provider/use-labels.cjs.js"),W=require("../../../helpers/hooks/use-breakpoint.cjs.js"),P=require("../../overlays/dropdown/dropdown.cjs.js"),je=require("../../../../../external/@floating-ui/dom/dist/floating-ui.dom.cjs.js"),N=require("../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js"),X=C=>{const{getCurrentBreakpointProps:Y}=_e.useBreakpointProps(C.defaultServerBreakpoint),{getLabel:Z}=Te.useLabels(),{id:$,label:ee,value:f,defaultValue:te,onChange:_,readOnly:h=!1,disabled:a=!1,required:ie,placeholder:ne,inputProps:t,stepMinutes:R=1,className:D,availableTimes:l,modal:T=!1,modalProps:oe}=C,{useNativePicker:re=!1,timePickerTrigger:j="button",showPicker:o=!0,availableTimesVariant:q="grid-buttons",clearable:se=!0}=Y(C),E=f!==void 0,[ae,S]=m.useState(f??te??""),g=E?f:ae,[w,I]=m.useState(!1),[U,V]=m.useState(!1),p=j==="input",n=re,le=W.default(),d=!n&&o&&!h&&!a&&(T===!0||typeof T=="string"&&W.isBreakpointBelow(le,T)),de=u.useFloating({open:w,onOpenChange:I,placement:p?"bottom-start":"bottom-end",middleware:[N.offset(Q.TIMEPICKER_OFFSET),N.flip(),N.shift()],whileElementsMounted:je.autoUpdate}),{refs:B,context:v,x:ce,y:ue,strategy:fe}=de,pe=u.useClick(v),me=u.useDismiss(v),ge=u.useRole(v,{role:"listbox"}),L=o&&p&&!h&&!a&&!n&&!d,z=u.useInteractions([...L?[pe]:[],me,ge]),x=e=>{const r=e.trim();E||S(r),_==null||_(r)},xe=e=>{var F;const r=e.target.value??"";(F=t==null?void 0:t.onBlur)==null||F.call(t,e);const s=Q.normalizeTime(r);s!==null&&s!==r&&x(s)};m.useEffect(()=>{f!==void 0&&S(f)},[f]);const k=m.useRef(null);m.useEffect(()=>{var e;(e=k.current)!=null&&e.inner&&B.setReference(k.current.inner)},[B]);const ke=()=>{var r;const e=(r=k.current)==null?void 0:r.input;if(e){if(typeof e.showPicker=="function"){e.showPicker();return}e.focus()}},be=()=>I(e=>!e),A=()=>V(!0),he=()=>{!o||a||(n?ke():d?A():j==="button"&&be())},H=d&&p&&!h?()=>{A()}:void 0,y=!n&&o&&!a&&q==="dropdown"&&!!(l!=null&&l.length),K=d?"dialog":"listbox",G=d?U:w,ve=o&&!n&&!y&&(j==="button"||d),Fe=o&&p&&!n&&!y,O={...t,id:$,label:ee,value:g,placeholder:ne,readOnly:h||!n&&p,disabled:a||(t==null?void 0:t.disabled),icon:o?"schedule":{name:"schedule",color:"inherit"},isClearable:se,required:ie,onIconClick:o?he:void 0,iconButtonProps:{"aria-label":Z("time-field.open-picker"),...ve&&{"aria-haspopup":K,"aria-expanded":G},...t==null?void 0:t.iconButtonProps},onChange:x,onBlur:xe,className:M.default(c.default["tedi-time-field__textfield"],{[c.default["tedi-time-field__icon--disabled"]]:!o||a},{[c.default["tedi-time-field__textfield--disabled"]]:a||(t==null?void 0:t.disabled)},{[c.default["tedi-time-field--native"]]:n}),input:{...t==null?void 0:t.input,...n&&{type:"time"},...H&&{onClick:H},...Fe&&{role:"combobox","aria-haspopup":K,"aria-expanded":G}}};if(y){const e=l.indexOf(g),r=e>=0?e:0;return i.jsxs(P.Dropdown,{width:"trigger",defaultActiveIndex:r,children:[i.jsx(P.Dropdown.Trigger,{children:i.jsx("div",{role:"combobox",className:M.default(c.default["tedi-time-field__container"],D,{[c.default["tedi-time-field__container--native"]]:n}),children:i.jsx(J.TextField,{ref:k,...O,input:{...O.input,...!p&&{onClick:s=>s.stopPropagation()}}})})}),i.jsx(P.Dropdown.Content,{children:l.map((s,F)=>i.jsx(P.Dropdown.Item,{index:F,active:s===g,onClick:()=>x(s),children:s},s))})]})}const b={...L?z.getReferenceProps():{}};return delete b.role,delete b["aria-haspopup"],delete b["aria-expanded"],delete b["aria-controls"],i.jsxs(i.Fragment,{children:[i.jsx("div",{className:M.default(c.default["tedi-time-field__container"],D),...b,tabIndex:-1,children:i.jsx(J.TextField,{ref:k,...O})}),d&&i.jsx(Ce.TimePickerModal,{open:U,onOpenChange:V,value:g,onConfirm:x,stepMinutes:R,availableTimes:l,gridVariant:q==="grid-radio"?"radio":"button",modalProps:oe}),!n&&o&&!a&&!d&&i.jsx(u.FloatingPortal,{children:w&&i.jsx(u.FloatingFocusManager,{context:v,modal:!1,initialFocus:-1,children:i.jsx("div",{ref:B.setFloating,...z.getFloatingProps({style:{position:fe,top:ue??0,left:ce??0}}),children:i.jsx(Pe.TimePicker,{value:g,stepMinutes:R,availableTimes:l,onChange:e=>{x(e),l&&I(!1)},gridVariant:q==="grid-radio"?"radio":"button",className:c.default["tedi-time-field__picker-wrapper"]})})})})]})};X.displayName="TimeField";exports.TimeField=X;
|
|
@@ -1,67 +1,68 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useFloating as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { TextField as
|
|
6
|
-
import { TimePicker as
|
|
1
|
+
import { jsxs as G, jsx as i, Fragment as xe } from "react/jsx-runtime";
|
|
2
|
+
import { useFloating as ve, useClick as Ce, useDismiss as _e, useRole as Fe, useInteractions as Pe, FloatingPortal as Ie, FloatingFocusManager as Te } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
3
|
+
import O from "../../../../../external/classnames/index.es.js";
|
|
4
|
+
import we, { useState as M, useEffect as H } from "react";
|
|
5
|
+
import { TextField as J } from "../textfield/textfield.es.js";
|
|
6
|
+
import { TimePicker as Be } from "../time-picker/time-picker.es.js";
|
|
7
7
|
import d from "./time-field.module.scss.es.js";
|
|
8
|
-
import { normalizeTime as
|
|
9
|
-
import { TimePickerModal as
|
|
10
|
-
import { useBreakpointProps as
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
import { normalizeTime as ye, TIMEPICKER_OFFSET as Ne } from "./time-field-helpers.es.js";
|
|
9
|
+
import { TimePickerModal as Oe } from "./time-picker-modal/time-picker-modal.es.js";
|
|
10
|
+
import { useBreakpointProps as Me } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
11
|
+
import { useLabels as Re } from "../../../providers/label-provider/use-labels.es.js";
|
|
12
|
+
import Ve, { isBreakpointBelow as Ee } from "../../../helpers/hooks/use-breakpoint.es.js";
|
|
13
|
+
import { Dropdown as v } from "../../overlays/dropdown/dropdown.es.js";
|
|
14
|
+
import { autoUpdate as Ue } from "../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
|
|
15
|
+
import { offset as De, flip as Se, shift as je } from "../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
|
|
16
|
+
const Le = (C) => {
|
|
17
|
+
const { getCurrentBreakpointProps: Q } = Me(C.defaultServerBreakpoint), { getLabel: W } = Re(), {
|
|
18
|
+
id: X,
|
|
19
|
+
label: Y,
|
|
20
|
+
value: m,
|
|
21
|
+
defaultValue: Z,
|
|
22
|
+
onChange: _,
|
|
23
|
+
readOnly: k = !1,
|
|
24
|
+
disabled: l = !1,
|
|
25
|
+
required: $,
|
|
26
|
+
placeholder: ee,
|
|
26
27
|
inputProps: t,
|
|
27
|
-
stepMinutes:
|
|
28
|
-
className:
|
|
29
|
-
availableTimes:
|
|
30
|
-
modal:
|
|
31
|
-
modalProps:
|
|
28
|
+
stepMinutes: R = 1,
|
|
29
|
+
className: V,
|
|
30
|
+
availableTimes: s,
|
|
31
|
+
modal: F = !1,
|
|
32
|
+
modalProps: te
|
|
32
33
|
} = C, {
|
|
33
|
-
useNativePicker:
|
|
34
|
-
timePickerTrigger:
|
|
35
|
-
showPicker:
|
|
36
|
-
availableTimesVariant:
|
|
37
|
-
clearable:
|
|
38
|
-
} =
|
|
39
|
-
open:
|
|
40
|
-
onOpenChange:
|
|
41
|
-
placement:
|
|
42
|
-
middleware: [Ne
|
|
43
|
-
whileElementsMounted:
|
|
44
|
-
}), { refs:
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
var
|
|
49
|
-
const
|
|
50
|
-
(
|
|
51
|
-
const
|
|
52
|
-
|
|
34
|
+
useNativePicker: ie = !1,
|
|
35
|
+
timePickerTrigger: P = "button",
|
|
36
|
+
showPicker: n = !0,
|
|
37
|
+
availableTimesVariant: I = "grid-buttons",
|
|
38
|
+
clearable: oe = !0
|
|
39
|
+
} = Q(C), E = m !== void 0, [ne, U] = M(m ?? Z ?? ""), f = E ? m : ne, [T, w] = M(!1), [D, S] = M(!1), u = P === "input", o = ie, re = Ve(), c = !o && n && !k && !l && (F === !0 || typeof F == "string" && Ee(re, F)), ae = ve({
|
|
40
|
+
open: T,
|
|
41
|
+
onOpenChange: w,
|
|
42
|
+
placement: u ? "bottom-start" : "bottom-end",
|
|
43
|
+
middleware: [De(Ne), Se(), je()],
|
|
44
|
+
whileElementsMounted: Ue
|
|
45
|
+
}), { refs: B, context: b, x: le, y: se, strategy: ce } = ae, de = Ce(b), me = _e(b), ue = Fe(b, { role: "listbox" }), j = n && u && !k && !l && !o && !c, L = Pe([...j ? [de] : [], me, ue]), p = (e) => {
|
|
46
|
+
const r = e.trim();
|
|
47
|
+
E || U(r), _ == null || _(r);
|
|
48
|
+
}, fe = (e) => {
|
|
49
|
+
var x;
|
|
50
|
+
const r = e.target.value ?? "";
|
|
51
|
+
(x = t == null ? void 0 : t.onBlur) == null || x.call(t, e);
|
|
52
|
+
const a = ye(r);
|
|
53
|
+
a !== null && a !== r && p(a);
|
|
53
54
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, [
|
|
57
|
-
const g =
|
|
58
|
-
|
|
55
|
+
H(() => {
|
|
56
|
+
m !== void 0 && U(m);
|
|
57
|
+
}, [m]);
|
|
58
|
+
const g = we.useRef(null);
|
|
59
|
+
H(() => {
|
|
59
60
|
var e;
|
|
60
|
-
(e = g.current) != null && e.inner &&
|
|
61
|
-
}, [
|
|
62
|
-
const
|
|
63
|
-
var
|
|
64
|
-
const e = (
|
|
61
|
+
(e = g.current) != null && e.inner && B.setReference(g.current.inner);
|
|
62
|
+
}, [B]);
|
|
63
|
+
const pe = () => {
|
|
64
|
+
var r;
|
|
65
|
+
const e = (r = g.current) == null ? void 0 : r.input;
|
|
65
66
|
if (e) {
|
|
66
67
|
if (typeof e.showPicker == "function") {
|
|
67
68
|
e.showPicker();
|
|
@@ -69,108 +70,109 @@ const Me = (C) => {
|
|
|
69
70
|
}
|
|
70
71
|
e.focus();
|
|
71
72
|
}
|
|
72
|
-
},
|
|
73
|
-
!
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
} : void 0, I = {
|
|
73
|
+
}, ge = () => w((e) => !e), q = () => S(!0), he = () => {
|
|
74
|
+
!n || l || (o ? pe() : c ? q() : P === "button" && ge());
|
|
75
|
+
}, z = c && u && !k ? () => {
|
|
76
|
+
q();
|
|
77
|
+
} : void 0, y = !o && n && !l && I === "dropdown" && !!(s != null && s.length), A = c ? "dialog" : "listbox", K = c ? D : T, ke = n && !o && !y && (P === "button" || c), be = n && u && !o && !y, N = {
|
|
77
78
|
...t,
|
|
78
|
-
id:
|
|
79
|
-
label:
|
|
79
|
+
id: X,
|
|
80
|
+
label: Y,
|
|
80
81
|
value: f,
|
|
81
|
-
placeholder:
|
|
82
|
-
readOnly:
|
|
83
|
-
disabled:
|
|
84
|
-
icon:
|
|
85
|
-
isClearable:
|
|
86
|
-
required:
|
|
87
|
-
onIconClick:
|
|
82
|
+
placeholder: ee,
|
|
83
|
+
readOnly: k || !o && u,
|
|
84
|
+
disabled: l || (t == null ? void 0 : t.disabled),
|
|
85
|
+
icon: n ? "schedule" : { name: "schedule", color: "inherit" },
|
|
86
|
+
isClearable: oe,
|
|
87
|
+
required: $,
|
|
88
|
+
onIconClick: n ? he : void 0,
|
|
89
|
+
iconButtonProps: {
|
|
90
|
+
"aria-label": W("time-field.open-picker"),
|
|
91
|
+
...ke && { "aria-haspopup": A, "aria-expanded": K },
|
|
92
|
+
...t == null ? void 0 : t.iconButtonProps
|
|
93
|
+
},
|
|
88
94
|
onChange: p,
|
|
89
|
-
onBlur:
|
|
90
|
-
className:
|
|
95
|
+
onBlur: fe,
|
|
96
|
+
className: O(
|
|
91
97
|
d["tedi-time-field__textfield"],
|
|
92
|
-
{ [d["tedi-time-field__icon--disabled"]]: !
|
|
93
|
-
{ [d["tedi-time-field__textfield--disabled"]]:
|
|
94
|
-
{ [d["tedi-time-field--native"]]:
|
|
98
|
+
{ [d["tedi-time-field__icon--disabled"]]: !n || l },
|
|
99
|
+
{ [d["tedi-time-field__textfield--disabled"]]: l || (t == null ? void 0 : t.disabled) },
|
|
100
|
+
{ [d["tedi-time-field--native"]]: o }
|
|
95
101
|
),
|
|
96
102
|
input: {
|
|
97
103
|
...t == null ? void 0 : t.input,
|
|
98
|
-
...
|
|
99
|
-
...
|
|
104
|
+
...o && { type: "time" },
|
|
105
|
+
...z && { onClick: z },
|
|
106
|
+
...be && { role: "combobox", "aria-haspopup": A, "aria-expanded": K }
|
|
100
107
|
}
|
|
101
108
|
};
|
|
102
|
-
if (
|
|
103
|
-
const e =
|
|
104
|
-
return /* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */ i(
|
|
109
|
+
if (y) {
|
|
110
|
+
const e = s.indexOf(f), r = e >= 0 ? e : 0;
|
|
111
|
+
return /* @__PURE__ */ G(v, { width: "trigger", defaultActiveIndex: r, children: [
|
|
112
|
+
/* @__PURE__ */ i(v.Trigger, { children: /* @__PURE__ */ i(
|
|
106
113
|
"div",
|
|
107
114
|
{
|
|
108
|
-
|
|
109
|
-
|
|
115
|
+
role: "combobox",
|
|
116
|
+
className: O(d["tedi-time-field__container"], V, {
|
|
117
|
+
[d["tedi-time-field__container--native"]]: o
|
|
110
118
|
}),
|
|
111
119
|
children: /* @__PURE__ */ i(
|
|
112
|
-
|
|
120
|
+
J,
|
|
113
121
|
{
|
|
114
122
|
ref: g,
|
|
115
|
-
...
|
|
123
|
+
...N,
|
|
116
124
|
input: {
|
|
117
|
-
...
|
|
118
|
-
...!
|
|
119
|
-
onClick: (
|
|
125
|
+
...N.input,
|
|
126
|
+
...!u && {
|
|
127
|
+
onClick: (a) => a.stopPropagation()
|
|
120
128
|
}
|
|
121
129
|
}
|
|
122
130
|
}
|
|
123
131
|
)
|
|
124
132
|
}
|
|
125
133
|
) }),
|
|
126
|
-
/* @__PURE__ */ i(
|
|
134
|
+
/* @__PURE__ */ i(v.Content, { children: s.map((a, x) => /* @__PURE__ */ i(v.Item, { index: x, active: a === f, onClick: () => p(a), children: a }, a)) })
|
|
127
135
|
] });
|
|
128
136
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
tabIndex: -1,
|
|
137
|
-
children: /* @__PURE__ */ i(A, { ref: g, "aria-expanded": o ? P : void 0, ...I })
|
|
138
|
-
}
|
|
139
|
-
),
|
|
140
|
-
u && /* @__PURE__ */ i(
|
|
141
|
-
Pe,
|
|
137
|
+
const h = {
|
|
138
|
+
...j ? L.getReferenceProps() : {}
|
|
139
|
+
};
|
|
140
|
+
return delete h.role, delete h["aria-haspopup"], delete h["aria-expanded"], delete h["aria-controls"], /* @__PURE__ */ G(xe, { children: [
|
|
141
|
+
/* @__PURE__ */ i("div", { className: O(d["tedi-time-field__container"], V), ...h, tabIndex: -1, children: /* @__PURE__ */ i(J, { ref: g, ...N }) }),
|
|
142
|
+
c && /* @__PURE__ */ i(
|
|
143
|
+
Oe,
|
|
142
144
|
{
|
|
143
|
-
open:
|
|
144
|
-
onOpenChange:
|
|
145
|
+
open: D,
|
|
146
|
+
onOpenChange: S,
|
|
145
147
|
value: f,
|
|
146
148
|
onConfirm: p,
|
|
147
|
-
stepMinutes:
|
|
148
|
-
availableTimes:
|
|
149
|
-
gridVariant:
|
|
150
|
-
modalProps:
|
|
149
|
+
stepMinutes: R,
|
|
150
|
+
availableTimes: s,
|
|
151
|
+
gridVariant: I === "grid-radio" ? "radio" : "button",
|
|
152
|
+
modalProps: te
|
|
151
153
|
}
|
|
152
154
|
),
|
|
153
|
-
!
|
|
155
|
+
!o && n && !l && !c && /* @__PURE__ */ i(Ie, { children: T && /* @__PURE__ */ i(Te, { context: b, modal: !1, initialFocus: -1, children: /* @__PURE__ */ i(
|
|
154
156
|
"div",
|
|
155
157
|
{
|
|
156
|
-
ref:
|
|
157
|
-
...
|
|
158
|
+
ref: B.setFloating,
|
|
159
|
+
...L.getFloatingProps({
|
|
158
160
|
style: {
|
|
159
|
-
position:
|
|
160
|
-
top:
|
|
161
|
-
left:
|
|
161
|
+
position: ce,
|
|
162
|
+
top: se ?? 0,
|
|
163
|
+
left: le ?? 0
|
|
162
164
|
}
|
|
163
165
|
}),
|
|
164
166
|
children: /* @__PURE__ */ i(
|
|
165
|
-
|
|
167
|
+
Be,
|
|
166
168
|
{
|
|
167
169
|
value: f,
|
|
168
|
-
stepMinutes:
|
|
169
|
-
availableTimes:
|
|
170
|
+
stepMinutes: R,
|
|
171
|
+
availableTimes: s,
|
|
170
172
|
onChange: (e) => {
|
|
171
|
-
p(e),
|
|
173
|
+
p(e), s && w(!1);
|
|
172
174
|
},
|
|
173
|
-
gridVariant:
|
|
175
|
+
gridVariant: I === "grid-radio" ? "radio" : "button",
|
|
174
176
|
className: d["tedi-time-field__picker-wrapper"]
|
|
175
177
|
}
|
|
176
178
|
)
|
|
@@ -178,7 +180,7 @@ const Me = (C) => {
|
|
|
178
180
|
) }) })
|
|
179
181
|
] });
|
|
180
182
|
};
|
|
181
|
-
|
|
183
|
+
Le.displayName = "TimeField";
|
|
182
184
|
export {
|
|
183
|
-
|
|
185
|
+
Le as TimeField
|
|
184
186
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),m=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),q=require("../../../../../external/classnames/index.cjs.js"),t=require("react"),x=require("../../../helpers/get-element-ref.cjs.js"),_=require("../../base/icon/icon.cjs.js"),R=require("./overlay.cjs.js"),o=require("./overlay.module.scss.cjs.js"),E=require("../../../providers/label-provider/use-labels.cjs.js"),I=c=>{const{children:e,className:a}=c,{getLabel:d}=E.useLabels(),{getReferenceProps:i,reference:u,openWith:g,open:f,role:r,ariaHidden:n,contentId:v}=t.useContext(R.OverlayContext),p=t.isValidElement(e)?x.getElementRef(e):void 0,l=m.useMergeRefs([u,p]),b=r!=="tooltip"&&r!=="label"&&!n,s=r==="tooltip"&&!n?{"aria-describedby":f?v:void 0}:{};return t.isValidElement(e)?t.cloneElement(e,i({tabIndex:0,...s,label:e.type===_.Icon?d("tooltip.icon-trigger"):void 0,...e.props,ref:l})):y.jsx("div",{...i({ref:l,tabIndex:0,role:b?"button":void 0,className:q.default(o.default["tedi-overlay__trigger"],o.default["tedi-overlay__trigger--text"],{[o.default["tedi-overlay__trigger--click"]]:g==="click"},a),...s}),children:e})};exports.OverlayTrigger=I;
|
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
import { jsx as x } from "react/jsx-runtime";
|
|
2
2
|
import { useMergeRefs as y } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
3
|
-
import
|
|
4
|
-
import { useContext as _, isValidElement as
|
|
5
|
-
import { getElementRef as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { OverlayContext as
|
|
3
|
+
import u from "../../../../../external/classnames/index.es.js";
|
|
4
|
+
import { useContext as _, isValidElement as l, cloneElement as I } from "react";
|
|
5
|
+
import { getElementRef as R } from "../../../helpers/get-element-ref.es.js";
|
|
6
|
+
import { Icon as h } from "../../base/icon/icon.es.js";
|
|
7
|
+
import { OverlayContext as E } from "./overlay.es.js";
|
|
8
8
|
import r from "./overlay.module.scss.es.js";
|
|
9
|
-
import { useLabels as
|
|
10
|
-
const
|
|
11
|
-
const { children: e, className:
|
|
12
|
-
"aria-describedby":
|
|
9
|
+
import { useLabels as N } from "../../../providers/label-provider/use-labels.es.js";
|
|
10
|
+
const V = (c) => {
|
|
11
|
+
const { children: e, className: a } = c, { getLabel: m } = N(), { getReferenceProps: o, reference: p, openWith: d, open: f, role: t, ariaHidden: i, contentId: g } = _(E), v = l(e) ? R(e) : void 0, n = y([p, v]), b = t !== "tooltip" && t !== "label" && !i, s = t === "tooltip" && !i ? {
|
|
12
|
+
"aria-describedby": f ? g : void 0
|
|
13
13
|
} : {};
|
|
14
|
-
return
|
|
14
|
+
return l(e) ? I(
|
|
15
15
|
e,
|
|
16
|
-
|
|
16
|
+
o({
|
|
17
17
|
tabIndex: 0,
|
|
18
|
-
...
|
|
19
|
-
label: e.type ===
|
|
18
|
+
...s,
|
|
19
|
+
label: e.type === h ? m("tooltip.icon-trigger") : void 0,
|
|
20
20
|
...e.props,
|
|
21
|
-
ref:
|
|
21
|
+
ref: n
|
|
22
22
|
})
|
|
23
23
|
) : /* @__PURE__ */ x(
|
|
24
24
|
"div",
|
|
25
25
|
{
|
|
26
|
-
...
|
|
27
|
-
ref:
|
|
26
|
+
...o({
|
|
27
|
+
ref: n,
|
|
28
28
|
tabIndex: 0,
|
|
29
|
-
|
|
29
|
+
role: b ? "button" : void 0,
|
|
30
|
+
className: u(
|
|
30
31
|
r["tedi-overlay__trigger"],
|
|
31
32
|
r["tedi-overlay__trigger--text"],
|
|
32
33
|
{
|
|
33
|
-
[r["tedi-overlay__trigger--click"]]:
|
|
34
|
+
[r["tedi-overlay__trigger--click"]]: d === "click"
|
|
34
35
|
},
|
|
35
|
-
|
|
36
|
+
a
|
|
36
37
|
),
|
|
37
|
-
...
|
|
38
|
+
...s
|
|
38
39
|
}),
|
|
39
40
|
children: e
|
|
40
41
|
}
|
|
41
42
|
);
|
|
42
43
|
};
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
+
V as OverlayTrigger
|
|
45
46
|
};
|