@dotss/ui 0.0.12 → 1.0.1
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/Button/index.d.ts +1 -0
- package/DatePicker/DatePicker.cjs +40 -30
- package/DatePicker/DatePicker.d.ts +1 -0
- package/DatePicker/DatePicker.es.js +477 -301
- package/DatePicker/EventDotGroup/EventDotGroup.cjs +3 -3
- package/DatePicker/EventDotGroup/EventDotGroup.es.js +14 -14
- package/FormControlText/FormControlText.cjs +2 -2
- package/FormControlText/FormControlText.es.js +14 -14
- package/Icon/Icon.cjs +1 -1
- package/Icon/Icon.es.js +1 -1
- package/Menu/Menu.cjs +6 -6
- package/Menu/Menu.es.js +83 -79
- package/Menu/MenuBlock/MenuBlock.cjs +5 -11
- package/Menu/MenuBlock/MenuBlock.es.js +19 -29
- package/Menu/MenuButton/MenuButton.cjs +1 -1
- package/Menu/MenuButton/MenuButton.d.ts +1 -1
- package/Menu/MenuButton/MenuButton.es.js +38 -29
- package/Tooltip/Tooltip.cjs +5 -5
- package/Tooltip/Tooltip.d.ts +2 -0
- package/Tooltip/Tooltip.es.js +84 -84
- package/package.json +1 -1
- package/resources/tictoccroc/icons/fill/alphabet-fill.svg-CvfRsdBW.js +5 -0
- package/resources/tictoccroc/icons/fill/alphabet-fill.svg-HBXWjzrC.cjs +1 -0
- package/resources/tictoccroc/icons/fill/{certified-fill.svg-B_RVx6K_.cjs → certified-fill.svg-DA375i9-.cjs} +1 -1
- package/resources/tictoccroc/icons/fill/{certified-fill.svg-CK7UqYft.js → certified-fill.svg-DBC-EEKD.js} +1 -1
- package/resources/tictoccroc/icons/fill/check-fill.svg-0_5PrDLC.js +5 -0
- package/resources/tictoccroc/icons/fill/check-fill.svg-BKKTgIa3.cjs +1 -0
- package/resources/tictoccroc/icons/fill/index.d.ts +4 -0
- package/resources/tictoccroc/icons/fill/search-fill.svg-BvLNCg-N.cjs +1 -0
- package/resources/tictoccroc/icons/fill/search-fill.svg-DnxhncI6.js +5 -0
- package/resources/tictoccroc/icons/fill/time-fill.svg-CbMJxmhK.js +5 -0
- package/resources/tictoccroc/icons/fill/time-fill.svg-DcMfM75a.cjs +1 -0
- package/resources/tictoccroc/icons/index.ts-DI_CztBn.cjs +1 -0
- package/resources/tictoccroc/icons/index.ts-Dt89JG4Z.js +236 -0
- package/themes/tictoccroc/colors/background.d.ts +2 -2
- package/themes/tictoccroc/colors/blue.d.ts +1 -1
- package/themes/tictoccroc/colors/classType.d.ts +1 -1
- package/themes/tictoccroc/colors/etc.d.ts +2 -2
- package/themes/tictoccroc/colors/green.d.ts +1 -1
- package/themes/tictoccroc/colors/grey.d.ts +1 -1
- package/themes/tictoccroc/colors/pink.d.ts +1 -1
- package/themes/tictoccroc/colors/yellow.d.ts +1 -1
- package/themes/tictoccroc/parentLight.d.ts +1 -1
- package/themes/tictoccroc/teacherLight.d.ts +1 -1
- package/themes/tictoccroc/typography/body.d.ts +1 -1
- package/themes/tictoccroc/typography/caption.d.ts +1 -1
- package/themes/tictoccroc/typography/display.d.ts +1 -1
- package/themes/tictoccroc/typography/headline.d.ts +1 -1
- package/utils/getIconLabel/getIconLabel.cjs +1 -1
- package/utils/getIconLabel/getIconLabel.d.ts +1 -1
- package/utils/getIconLabel/getIconLabel.es.js +5 -1
- package/utils/getPaletteColor/getPaletteColor.d.ts +1 -1
- package/resources/tictoccroc/icons/index.ts-BmqvB_n6.cjs +0 -1
- package/resources/tictoccroc/icons/index.ts-CzTh-XsD.js +0 -228
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("@emotion/react/jsx-runtime"),i=require("react"),c=require("@emotion/styled"),d=require("../EventDot/EventDot.cjs"),f=e=>e&&e.__esModule?e:{default:e},u=f(c),h=u.default.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
gap: ${({theme:{spacing:e}})=>e.content(.5)}px;
|
|
5
5
|
max-height: 6px;
|
|
6
6
|
`,p=u.default.span`
|
|
7
|
-
${({theme:{palette:{grey:e},typography:t}})=>{const{size:
|
|
8
|
-
`;function g({children:e,limit:t=4,...
|
|
7
|
+
${({theme:{palette:{grey:e},typography:t}})=>{const{size:l,weight:r,lineHeight:n,letterSpacing:o}=t.c5R;return{fontSize:l,fontWeight:r,lineHeight:n,letterSpacing:o,color:e[50]}}};
|
|
8
|
+
`;function g({children:e,limit:t=4,...l}){const r=i.Children.toArray(e).filter(i.isValidElement).filter(a=>a.type===d.default),n=r.length,o=n>t;return s.jsxs(h,{"aria-label":`${n}건의 이벤트`,...l,children:[i.Children.toArray(r).slice(0,t),o&&s.jsxs(p,{children:["+",n-t]})]})}exports.default=g;
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Children as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as l } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { Children as s, isValidElement as p } from "react";
|
|
3
|
+
import a from "@emotion/styled";
|
|
4
4
|
import m from "../EventDot/EventDot.es.js";
|
|
5
|
-
const f =
|
|
5
|
+
const f = a.div`
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
8
|
gap: ${({ theme: { spacing: t } }) => t.content(0.5)}px;
|
|
9
9
|
max-height: 6px;
|
|
10
|
-
`, h =
|
|
10
|
+
`, h = a.span`
|
|
11
11
|
${({
|
|
12
12
|
theme: {
|
|
13
13
|
palette: { grey: t },
|
|
14
14
|
typography: e
|
|
15
15
|
}
|
|
16
16
|
}) => {
|
|
17
|
-
const { size:
|
|
17
|
+
const { size: o, weight: n, lineHeight: r, letterSpacing: i } = e.c5R;
|
|
18
18
|
return {
|
|
19
|
-
fontSize:
|
|
19
|
+
fontSize: o,
|
|
20
20
|
fontWeight: n,
|
|
21
|
-
lineHeight:
|
|
21
|
+
lineHeight: r,
|
|
22
22
|
letterSpacing: i,
|
|
23
23
|
color: t[50]
|
|
24
24
|
};
|
|
25
25
|
}};
|
|
26
26
|
`;
|
|
27
|
-
function y({ children: t, limit: e = 4, ...
|
|
28
|
-
const n =
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
|
|
31
|
-
i && /* @__PURE__ */
|
|
27
|
+
function y({ children: t, limit: e = 4, ...o }) {
|
|
28
|
+
const n = s.toArray(t).filter(p).filter((c) => c.type === m), r = n.length, i = r > e;
|
|
29
|
+
return /* @__PURE__ */ l(f, { "aria-label": `${r}건의 이벤트`, ...o, children: [
|
|
30
|
+
s.toArray(n).slice(0, e),
|
|
31
|
+
i && /* @__PURE__ */ l(h, { children: [
|
|
32
32
|
"+",
|
|
33
|
-
|
|
33
|
+
r - e
|
|
34
34
|
] })
|
|
35
35
|
] });
|
|
36
36
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
gap: ${({theme:{spacing:e}})=>e.content(2)}px;
|
|
6
|
-
cursor: ${({disabled:e})=>e?"not-allowed":"
|
|
6
|
+
cursor: ${({disabled:e})=>e?"not-allowed":"unset"};
|
|
7
7
|
flex-direction: ${({placement:e})=>e==="left"?"row-reverse":"row"};
|
|
8
8
|
`,v=d.default.div`
|
|
9
9
|
display: inline-flex;
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
cursor: pointer;
|
|
12
12
|
|
|
13
13
|
${({theme:{palette:{grey:e},typography:{h0R:n,b2R:o}},size:u,disabled:c})=>{let i={fontSize:o.size,fontWeight:o.weight,lineHeight:o.lineHeight,letterSpacing:o.letterSpacing};return u==="2xLarge"&&(i={fontSize:n.size,fontWeight:n.weight,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing}),c&&(i.color=e[30],i.cursor="not-allowed"),i}}
|
|
14
|
-
`,F=l.forwardRef(function({control:n,text:o,placement:u,size:c,onClick:i,disabled:a,inlineCSS:h,controlWrapperProps:
|
|
14
|
+
`,F=l.forwardRef(function({control:n,text:o,placement:u,size:c,onClick:i,disabled:a,inlineCSS:h,controlWrapperProps:x,textProps:p,...s},y){const C=l.useRef(null),m=l.useId(),g=(s==null?void 0:s.id)||m,S=t=>r=>{r.stopPropagation(),typeof t=="function"&&t(r)};return f.jsxs(_,{ref:y,placement:u,disabled:a,...s,css:h,children:[f.jsx(v,{ref:C,...x,children:l.Children.map(n,t=>{var r;return l.isValidElement(t)?l.cloneElement(t,{size:c,disabled:a,onClick:S((r=t.props)==null?void 0:r.onClick),id:g,...t.props}):null})}),f.jsx(T,{size:c,disabled:a,htmlFor:g,...p,children:o})]})});exports.default=F;
|
|
@@ -6,7 +6,7 @@ const k = a.div`
|
|
|
6
6
|
align-items: center;
|
|
7
7
|
justify-content: center;
|
|
8
8
|
gap: ${({ theme: { spacing: t } }) => t.content(2)}px;
|
|
9
|
-
cursor: ${({ disabled: t }) => t ? "not-allowed" : "
|
|
9
|
+
cursor: ${({ disabled: t }) => t ? "not-allowed" : "unset"};
|
|
10
10
|
flex-direction: ${({ placement: t }) => t === "left" ? "row-reverse" : "row"};
|
|
11
11
|
`, v = a.div`
|
|
12
12
|
display: inline-flex;
|
|
@@ -16,34 +16,34 @@ const k = a.div`
|
|
|
16
16
|
${({
|
|
17
17
|
theme: {
|
|
18
18
|
palette: { grey: t },
|
|
19
|
-
typography: { h0R:
|
|
19
|
+
typography: { h0R: n, b2R: o }
|
|
20
20
|
},
|
|
21
21
|
size: f,
|
|
22
22
|
disabled: l
|
|
23
23
|
}) => {
|
|
24
24
|
let i = {
|
|
25
|
-
fontSize: n.size,
|
|
26
|
-
fontWeight: n.weight,
|
|
27
|
-
lineHeight: n.lineHeight,
|
|
28
|
-
letterSpacing: n.letterSpacing
|
|
29
|
-
};
|
|
30
|
-
return f === "2xLarge" && (i = {
|
|
31
25
|
fontSize: o.size,
|
|
32
26
|
fontWeight: o.weight,
|
|
33
27
|
lineHeight: o.lineHeight,
|
|
34
28
|
letterSpacing: o.letterSpacing
|
|
29
|
+
};
|
|
30
|
+
return f === "2xLarge" && (i = {
|
|
31
|
+
fontSize: n.size,
|
|
32
|
+
fontWeight: n.weight,
|
|
33
|
+
lineHeight: n.lineHeight,
|
|
34
|
+
letterSpacing: n.letterSpacing
|
|
35
35
|
}), l && (i.color = t[30], i.cursor = "not-allowed"), i;
|
|
36
36
|
}}
|
|
37
37
|
`, L = S(function({
|
|
38
|
-
control:
|
|
39
|
-
text:
|
|
38
|
+
control: n,
|
|
39
|
+
text: o,
|
|
40
40
|
placement: f,
|
|
41
41
|
size: l,
|
|
42
42
|
onClick: i,
|
|
43
43
|
disabled: s,
|
|
44
44
|
inlineCSS: u,
|
|
45
|
-
controlWrapperProps:
|
|
46
|
-
textProps:
|
|
45
|
+
controlWrapperProps: h,
|
|
46
|
+
textProps: p,
|
|
47
47
|
...c
|
|
48
48
|
}, m) {
|
|
49
49
|
const x = j(null), C = F(), d = (c == null ? void 0 : c.id) || C, y = (e) => (r) => {
|
|
@@ -58,7 +58,7 @@ const k = a.div`
|
|
|
58
58
|
...c,
|
|
59
59
|
css: u,
|
|
60
60
|
children: [
|
|
61
|
-
/* @__PURE__ */ g(v, { ref: x, ...
|
|
61
|
+
/* @__PURE__ */ g(v, { ref: x, ...h, children: H.map(n, (e) => {
|
|
62
62
|
var r;
|
|
63
63
|
return T(e) ? $(e, {
|
|
64
64
|
size: l,
|
|
@@ -68,7 +68,7 @@ const k = a.div`
|
|
|
68
68
|
...e.props
|
|
69
69
|
}) : null;
|
|
70
70
|
}) }),
|
|
71
|
-
/* @__PURE__ */ g(z, { size: l, disabled: s, htmlFor: d, ...
|
|
71
|
+
/* @__PURE__ */ g(z, { size: l, disabled: s, htmlFor: d, ...p, children: o })
|
|
72
72
|
]
|
|
73
73
|
}
|
|
74
74
|
);
|
package/Icon/Icon.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("@emotion/react/jsx-runtime"),t=require("react"),S=require("../resources/tictoccroc/icons/index.ts-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("@emotion/react/jsx-runtime"),t=require("react"),S=require("../resources/tictoccroc/icons/index.ts-DI_CztBn.cjs"),b=require("@emotion/styled"),h=require("../utils/getPaletteColor/getPaletteColor.cjs"),I=r=>r&&r.__esModule?r:{default:r},w=I(b),$=r=>w.default(r)`
|
|
2
2
|
${({size:o,width:s,height:a})=>{let n={width:s,height:a};switch(o){case"large":n={width:32,height:32};break;case"medium":n={width:24,height:24};break;case"small":n={width:20,height:20};break;case"xSmall":n={width:16,height:16};break}return n}};
|
|
3
3
|
|
|
4
4
|
color: ${({theme:o,color:s="grey.100"})=>h.default(s,{theme:o})};
|
package/Icon/Icon.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as w } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { forwardRef as y, Children as f, isValidElement as i, cloneElement as s } from "react";
|
|
3
|
-
import { S as $ } from "../resources/tictoccroc/icons/index.ts-
|
|
3
|
+
import { S as $ } from "../resources/tictoccroc/icons/index.ts-Dt89JG4Z.js";
|
|
4
4
|
import b from "@emotion/styled";
|
|
5
5
|
import x from "../utils/getPaletteColor/getPaletteColor.es.js";
|
|
6
6
|
const g = (p) => b(p)`
|
package/Menu/Menu.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("@emotion/react/jsx-runtime"),o=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("@emotion/react/jsx-runtime"),o=require("react"),st=require("react-dom"),it=require("../hooks/useCheckKeyboardMode/useCheckKeyboardMode.cjs"),z=require("../utils/getSibling/getSibling.cjs"),ut=require("@emotion/styled"),rt=e=>e&&e.__esModule?e:{default:e},$=rt(ut),nt=$.default.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
${({disableClickOutside:e})=>e?null:{pointerEvents:"none","& *":{pointerEvents:"auto"}}}}
|
|
10
10
|
|
|
11
|
-
`,
|
|
11
|
+
`,dt=$.default.div`
|
|
12
12
|
position: fixed;
|
|
13
13
|
max-width: calc(100% - ${({theme:{spacing:e}})=>e.layout(4)}px);
|
|
14
14
|
border-radius: 10px;
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
transform: scale(${({open:e})=>e?1:.97});
|
|
22
22
|
opacity: ${({open:e})=>e?1:0};
|
|
23
23
|
z-index: 100003;
|
|
24
|
-
`,
|
|
24
|
+
`,ct=$.default.ul`
|
|
25
25
|
display: flex;
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
max-height: ${({maxHeight:e})=>e}px;
|
|
28
28
|
overflow-y: auto;
|
|
29
29
|
|
|
30
|
-
${({theme:{spacing:e},disablePadding:
|
|
31
|
-
`,
|
|
30
|
+
${({theme:{spacing:e},disablePadding:a})=>a?null:{padding:`${e.content(1)}px 0`}}}
|
|
31
|
+
`,ft=$.default.div`
|
|
32
32
|
width: 100%;
|
|
33
33
|
height: 1px;
|
|
34
34
|
background-color: ${({theme:{palette:{grey:e}}})=>e[20]};
|
|
35
|
-
`,k=24,
|
|
35
|
+
`,k=24,lt=o.forwardRef(function({children:a,anchorRef:r,open:w,onClose:f,spacing:b=4,transitionDuration:M=200,onChange:m,value:H,showDivider:K,placement:D="bottom-center",disablePadding:C,disableClickOutside:F=!0,width:T,fitToAnchorWidth:q=!0,maxHeight:N=476,style:A,inlineCSS:B,menuProps:G,...U},V){const[g,O]=o.useState(0),[I,_]=o.useState(0),[h,J]=o.useState(0),[j,W]=o.useState(!1),[Q,X]=o.useState(!1),[Y,L]=o.useState(!0),[Z,p]=o.useState(null),v=o.useRef(),x=o.useRef(),E=o.useRef(null),{isKeyboardMode:R}=it.default(),tt=(t,s)=>n=>{n.stopPropagation(),typeof f=="function"&&f(),typeof m=="function"&&m(t,n),typeof s=="function"&&s(n)},et=t=>s=>{var u,c,d,l;if(s.key==="Tab"&&typeof f=="function"&&(f(),p(0)),(s.key==="Enter"||s.key===" ")&&typeof f=="function"&&typeof m=="function"&&(f(),m(t,s),r!=null&&r.current)){const i=r.current.querySelector("button");i&&R&&i.focus()}const n=document.activeElement;if(n){if(s.code==="ArrowDown"){const i=z.default(n,"next",{skipDisabled:!0});i&&i.dataset.index?(p(Number(i.dataset.index)),i.focus()):(p(0),(c=(u=E.current)==null?void 0:u.querySelector('[role="menuitem"]'))==null||c.focus())}if(s.code==="ArrowUp"){const i=z.default(n,"prev",{skipDisabled:!0});i&&i.dataset.index?(p(Number(i.dataset.index)),i.focus()):(p(o.Children.count(a)-1),(l=(d=E.current)==null?void 0:d.querySelector('[role="menuitem"]:last-child'))==null||l.focus())}}};return o.useEffect(()=>{w&&(x.current&&clearTimeout(x.current),document.body.style.overflow="hidden",L(!1),v.current=setTimeout(()=>{W(!0)},100))},[w]),o.useEffect(()=>{w||(v.current&&clearTimeout(v.current),W(!1),document.body.removeAttribute("style"),x.current=setTimeout(()=>{L(!0),p(0)},M))},[w,M]),o.useEffect(()=>{const t=()=>{var P;const{offsetWidth:s=0,offsetHeight:n=0}=(r==null?void 0:r.current)||{},u=((P=r==null?void 0:r.current)==null?void 0:P.getBoundingClientRect())||{top:0,left:0,bottom:0},{offsetWidth:c=0,offsetHeight:d=0}=E.current||{},[l,i]=D.split("-");J(T||s);const S=(u.top||0)-d-b-k<k,ot=(u.bottom||0)+d+b+k>window.innerHeight;switch(l){case"top":O(S?k:u.top-d-b);break;default:O(ot?"auto":u.top+n+b);break}switch(i){case"left":_(u.left);break;case"right":_(u.left-Math.abs(s-c));break;default:_(u.left+s/2-c/2);break}};return t(),window.addEventListener("scroll",t),window.addEventListener("resize",t),()=>{window.removeEventListener("scroll",t),window.removeEventListener("resize",t)}},[r,b,D,j,a,T]),o.useEffect(()=>{X(j&&!!g&&!!I&&!!h)},[j,g,I,h]),o.useEffect(()=>()=>{v.current&&clearTimeout(v.current),x.current&&clearTimeout(x.current)},[]),Y?null:st.createPortal(y.jsx(nt,{onClick:f,disableClickOutside:F,children:y.jsx(dt,{ref:V,open:Q,transitionDuration:M,...U,css:B,style:{...A,top:g,left:I,bottom:g==="auto"?24:void 0,width:q?h:void 0},children:y.jsx(ct,{role:"menu",ref:E,disablePadding:C,maxHeight:N,...G,children:o.Children.map(a,(t,s)=>{var u,c,d,l,i,S;if(!o.isValidElement(t))return null;const n=Z===s;return y.jsxs(y.Fragment,{children:[o.cloneElement(t,{...t.props,"data-index":s,selected:!!((u=t==null?void 0:t.props)!=null&&u.value)&&((c=t==null?void 0:t.props)==null?void 0:c.value)===H,onClick:tt((d=t==null?void 0:t.props)==null?void 0:d.value,(l=t==null?void 0:t.props)==null?void 0:l.onClick),onKeyDown:et((i=t==null?void 0:t.props)==null?void 0:i.value),tabIndex:n?0:-1,style:{...(S=t==null?void 0:t.props)==null?void 0:S.style,[T?"width":"minWidth"]:q?void 0:h,maxWidth:q?void 0:"100%"}}),K&&o.Children.count(a)!==s+1&&y.jsx(ft,{})]})})})})}),document.body)});exports.default=lt;
|
package/Menu/Menu.es.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as $, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { jsx as $, jsxs as nt, Fragment as ut } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as dt, useState as l, useRef as z, useEffect as v, Children as H, isValidElement as ct, cloneElement as ft } from "react";
|
|
3
|
+
import { createPortal as lt } from "react-dom";
|
|
4
|
+
import pt from "../hooks/useCheckKeyboardMode/useCheckKeyboardMode.es.js";
|
|
5
|
+
import j from "../utils/getSibling/getSibling.es.js";
|
|
6
|
+
import T from "@emotion/styled";
|
|
7
|
+
const at = T.div`
|
|
7
8
|
position: fixed;
|
|
8
9
|
top: 0;
|
|
9
10
|
left: 0;
|
|
@@ -18,7 +19,7 @@ const at = I.div`
|
|
|
18
19
|
}
|
|
19
20
|
}}}
|
|
20
21
|
|
|
21
|
-
`,
|
|
22
|
+
`, yt = T.div`
|
|
22
23
|
position: fixed;
|
|
23
24
|
max-width: calc(100% - ${({ theme: { spacing: o } }) => o.layout(4)}px);
|
|
24
25
|
border-radius: 10px;
|
|
@@ -35,16 +36,16 @@ const at = I.div`
|
|
|
35
36
|
transform: scale(${({ open: o }) => o ? 1 : 0.97});
|
|
36
37
|
opacity: ${({ open: o }) => o ? 1 : 0};
|
|
37
38
|
z-index: 100003;
|
|
38
|
-
`,
|
|
39
|
+
`, bt = T.ul`
|
|
39
40
|
display: flex;
|
|
40
41
|
flex-direction: column;
|
|
41
42
|
max-height: ${({ maxHeight: o }) => o}px;
|
|
42
43
|
overflow-y: auto;
|
|
43
44
|
|
|
44
|
-
${({ theme: { spacing: o }, disablePadding:
|
|
45
|
+
${({ theme: { spacing: o }, disablePadding: p }) => p ? null : {
|
|
45
46
|
padding: `${o.content(1)}px 0`
|
|
46
47
|
}}}
|
|
47
|
-
`,
|
|
48
|
+
`, mt = T.div`
|
|
48
49
|
width: 100%;
|
|
49
50
|
height: 1px;
|
|
50
51
|
background-color: ${({
|
|
@@ -52,70 +53,73 @@ const at = I.div`
|
|
|
52
53
|
palette: { grey: o }
|
|
53
54
|
}
|
|
54
55
|
}) => o[20]};
|
|
55
|
-
`,
|
|
56
|
-
children:
|
|
57
|
-
anchorRef:
|
|
56
|
+
`, S = 24, Et = dt(function({
|
|
57
|
+
children: p,
|
|
58
|
+
anchorRef: s,
|
|
58
59
|
open: w,
|
|
59
|
-
onClose:
|
|
60
|
+
onClose: c,
|
|
60
61
|
spacing: y = 4,
|
|
61
|
-
transitionDuration:
|
|
62
|
+
transitionDuration: I = 200,
|
|
62
63
|
onChange: x,
|
|
63
|
-
value:
|
|
64
|
-
showDivider:
|
|
65
|
-
placement:
|
|
66
|
-
disablePadding:
|
|
67
|
-
disableClickOutside:
|
|
64
|
+
value: A,
|
|
65
|
+
showDivider: B,
|
|
66
|
+
placement: K = "bottom-center",
|
|
67
|
+
disablePadding: G,
|
|
68
|
+
disableClickOutside: C = !0,
|
|
68
69
|
width: M,
|
|
69
70
|
fitToAnchorWidth: W = !0,
|
|
70
|
-
maxHeight:
|
|
71
|
-
style:
|
|
72
|
-
inlineCSS:
|
|
71
|
+
maxHeight: U = 476,
|
|
72
|
+
style: V,
|
|
73
|
+
inlineCSS: _,
|
|
73
74
|
menuProps: J,
|
|
74
75
|
...Q
|
|
75
76
|
}, X) {
|
|
76
|
-
const [
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
var r,
|
|
80
|
-
e.key === "Tab" && typeof
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
const [g, P] = l(0), [D, L] = l(0), [h, Y] = l(0), [O, q] = l(!1), [Z, R] = l(!1), [tt, F] = l(!0), [ot, a] = l(null), b = z(), m = z(), k = z(null), { isKeyboardMode: et } = pt(), it = (t, e) => (n) => {
|
|
78
|
+
n.stopPropagation(), typeof c == "function" && c(), typeof x == "function" && x(t, n), typeof e == "function" && e(n);
|
|
79
|
+
}, rt = (t) => (e) => {
|
|
80
|
+
var r, d, u, f;
|
|
81
|
+
if (e.key === "Tab" && typeof c == "function" && (c(), a(0)), (e.key === "Enter" || e.key === " ") && typeof c == "function" && typeof x == "function" && (c(), x(t, e), s != null && s.current)) {
|
|
82
|
+
const i = s.current.querySelector("button");
|
|
83
|
+
i && et && i.focus();
|
|
84
|
+
}
|
|
85
|
+
const n = document.activeElement;
|
|
86
|
+
if (n) {
|
|
83
87
|
if (e.code === "ArrowDown") {
|
|
84
|
-
const i =
|
|
85
|
-
i && i.dataset.index ? (
|
|
88
|
+
const i = j(n, "next", { skipDisabled: !0 });
|
|
89
|
+
i && i.dataset.index ? (a(Number(i.dataset.index)), i.focus()) : (a(0), (d = (r = k.current) == null ? void 0 : r.querySelector('[role="menuitem"]')) == null || d.focus());
|
|
86
90
|
}
|
|
87
91
|
if (e.code === "ArrowUp") {
|
|
88
|
-
const i =
|
|
89
|
-
i && i.dataset.index ? (
|
|
92
|
+
const i = j(n, "prev", { skipDisabled: !0 });
|
|
93
|
+
i && i.dataset.index ? (a(Number(i.dataset.index)), i.focus()) : (a(H.count(p) - 1), (f = (u = k.current) == null ? void 0 : u.querySelector('[role="menuitem"]:last-child')) == null || f.focus());
|
|
90
94
|
}
|
|
91
95
|
}
|
|
92
96
|
};
|
|
93
|
-
return
|
|
94
|
-
w && (
|
|
95
|
-
|
|
97
|
+
return v(() => {
|
|
98
|
+
w && (m.current && clearTimeout(m.current), document.body.style.overflow = "hidden", F(!1), b.current = setTimeout(() => {
|
|
99
|
+
q(!0);
|
|
96
100
|
}, 100));
|
|
97
|
-
}, [w]),
|
|
98
|
-
w || (
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
}, [w,
|
|
101
|
+
}, [w]), v(() => {
|
|
102
|
+
w || (b.current && clearTimeout(b.current), q(!1), document.body.removeAttribute("style"), m.current = setTimeout(() => {
|
|
103
|
+
F(!0), a(0);
|
|
104
|
+
}, I));
|
|
105
|
+
}, [w, I]), v(() => {
|
|
102
106
|
const t = () => {
|
|
103
|
-
var
|
|
104
|
-
const { offsetWidth: e = 0, offsetHeight:
|
|
107
|
+
var N;
|
|
108
|
+
const { offsetWidth: e = 0, offsetHeight: n = 0 } = (s == null ? void 0 : s.current) || {}, r = ((N = s == null ? void 0 : s.current) == null ? void 0 : N.getBoundingClientRect()) || {
|
|
105
109
|
top: 0,
|
|
106
110
|
left: 0,
|
|
107
111
|
bottom: 0
|
|
108
|
-
}, { offsetWidth:
|
|
112
|
+
}, { offsetWidth: d = 0, offsetHeight: u = 0 } = k.current || {}, [f, i] = K.split("-");
|
|
109
113
|
Y(M || e);
|
|
110
|
-
const E = (r.top || 0) -
|
|
114
|
+
const E = (r.top || 0) - u - y - S < S, st = (r.bottom || 0) + u + y + S > window.innerHeight;
|
|
111
115
|
switch (f) {
|
|
112
116
|
case "top":
|
|
113
|
-
|
|
114
|
-
E ?
|
|
117
|
+
P(
|
|
118
|
+
E ? S : r.top - u - y
|
|
115
119
|
);
|
|
116
120
|
break;
|
|
117
121
|
default:
|
|
118
|
-
|
|
122
|
+
P(st ? "auto" : r.top + n + y);
|
|
119
123
|
break;
|
|
120
124
|
}
|
|
121
125
|
switch (i) {
|
|
@@ -123,66 +127,66 @@ const at = I.div`
|
|
|
123
127
|
L(r.left);
|
|
124
128
|
break;
|
|
125
129
|
case "right":
|
|
126
|
-
L(r.left - Math.abs(e -
|
|
130
|
+
L(r.left - Math.abs(e - d));
|
|
127
131
|
break;
|
|
128
132
|
default:
|
|
129
|
-
L(r.left + e / 2 -
|
|
133
|
+
L(r.left + e / 2 - d / 2);
|
|
130
134
|
break;
|
|
131
135
|
}
|
|
132
136
|
};
|
|
133
137
|
return t(), window.addEventListener("scroll", t), window.addEventListener("resize", t), () => {
|
|
134
138
|
window.removeEventListener("scroll", t), window.removeEventListener("resize", t);
|
|
135
139
|
};
|
|
136
|
-
}, [
|
|
137
|
-
R(O && !!
|
|
138
|
-
}, [O,
|
|
139
|
-
|
|
140
|
-
}, []), tt ? null :
|
|
141
|
-
/* @__PURE__ */ $(at, { onClick:
|
|
142
|
-
|
|
140
|
+
}, [s, y, K, O, p, M]), v(() => {
|
|
141
|
+
R(O && !!g && !!D && !!h);
|
|
142
|
+
}, [O, g, D, h]), v(() => () => {
|
|
143
|
+
b.current && clearTimeout(b.current), m.current && clearTimeout(m.current);
|
|
144
|
+
}, []), tt ? null : lt(
|
|
145
|
+
/* @__PURE__ */ $(at, { onClick: c, disableClickOutside: C, children: /* @__PURE__ */ $(
|
|
146
|
+
yt,
|
|
143
147
|
{
|
|
144
148
|
ref: X,
|
|
145
149
|
open: Z,
|
|
146
|
-
transitionDuration:
|
|
150
|
+
transitionDuration: I,
|
|
147
151
|
...Q,
|
|
148
|
-
css:
|
|
152
|
+
css: _,
|
|
149
153
|
style: {
|
|
150
|
-
...
|
|
151
|
-
top:
|
|
154
|
+
...V,
|
|
155
|
+
top: g,
|
|
152
156
|
left: D,
|
|
153
|
-
bottom:
|
|
154
|
-
width: W ?
|
|
157
|
+
bottom: g === "auto" ? 24 : void 0,
|
|
158
|
+
width: W ? h : void 0
|
|
155
159
|
},
|
|
156
160
|
children: /* @__PURE__ */ $(
|
|
157
|
-
|
|
161
|
+
bt,
|
|
158
162
|
{
|
|
159
163
|
role: "menu",
|
|
160
164
|
ref: k,
|
|
161
|
-
disablePadding:
|
|
162
|
-
maxHeight:
|
|
165
|
+
disablePadding: G,
|
|
166
|
+
maxHeight: U,
|
|
163
167
|
...J,
|
|
164
|
-
children: H.map(
|
|
165
|
-
var r,
|
|
168
|
+
children: H.map(p, (t, e) => {
|
|
169
|
+
var r, d, u, f, i, E;
|
|
166
170
|
if (!ct(t))
|
|
167
171
|
return null;
|
|
168
|
-
const
|
|
169
|
-
return /* @__PURE__ */
|
|
170
|
-
|
|
172
|
+
const n = ot === e;
|
|
173
|
+
return /* @__PURE__ */ nt(ut, { children: [
|
|
174
|
+
ft(t, {
|
|
171
175
|
...t.props,
|
|
172
176
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
173
177
|
// @ts-expect-error
|
|
174
178
|
"data-index": e,
|
|
175
|
-
selected: !!((r = t == null ? void 0 : t.props) != null && r.value) && ((
|
|
176
|
-
onClick:
|
|
177
|
-
onKeyDown:
|
|
178
|
-
tabIndex:
|
|
179
|
+
selected: !!((r = t == null ? void 0 : t.props) != null && r.value) && ((d = t == null ? void 0 : t.props) == null ? void 0 : d.value) === A,
|
|
180
|
+
onClick: it((u = t == null ? void 0 : t.props) == null ? void 0 : u.value, (f = t == null ? void 0 : t.props) == null ? void 0 : f.onClick),
|
|
181
|
+
onKeyDown: rt((i = t == null ? void 0 : t.props) == null ? void 0 : i.value),
|
|
182
|
+
tabIndex: n ? 0 : -1,
|
|
179
183
|
style: {
|
|
180
184
|
...(E = t == null ? void 0 : t.props) == null ? void 0 : E.style,
|
|
181
|
-
[M ? "width" : "minWidth"]: W ? void 0 :
|
|
185
|
+
[M ? "width" : "minWidth"]: W ? void 0 : h,
|
|
182
186
|
maxWidth: W ? void 0 : "100%"
|
|
183
187
|
}
|
|
184
188
|
}),
|
|
185
|
-
|
|
189
|
+
B && H.count(p) !== e + 1 && /* @__PURE__ */ $(mt, {})
|
|
186
190
|
] });
|
|
187
191
|
})
|
|
188
192
|
}
|
|
@@ -193,5 +197,5 @@ const at = I.div`
|
|
|
193
197
|
);
|
|
194
198
|
});
|
|
195
199
|
export {
|
|
196
|
-
|
|
200
|
+
Et as default
|
|
197
201
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("@emotion/react/jsx-runtime"),w=require("react"),y=require("../../Icon/Icon.cjs"),v=require("../../hooks/useCheckHoverPossible/useCheckHoverPossible.cjs"),S=require("@emotion/styled")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("@emotion/react/jsx-runtime"),w=require("react"),y=require("../../Icon/Icon.cjs"),v=require("../../hooks/useCheckHoverPossible/useCheckHoverPossible.cjs"),S=require("@emotion/styled"),j=e=>e&&e.__esModule?e:{default:e},u=j(S),$=u.default.li`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
gap: ${({theme:{spacing:e}})=>e.content(2)}px;
|
|
@@ -15,19 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
${({ellipsis:e})=>e?{maxHeight:"40px"}:{}};
|
|
17
17
|
|
|
18
|
-
${({theme:{palette:{brand:e,grey:n}},selected:t,isHoverPossible:r})=>r?{"&:hover:not([disabled])":{backgroundColor:t?e.primary.bg:n[10]}}:{}}
|
|
19
|
-
|
|
20
|
-
&:focus {
|
|
21
|
-
outline: none;
|
|
22
|
-
border: 2px solid
|
|
23
|
-
${({theme:{palette:{grey:e}}})=>e[100]};
|
|
24
|
-
}
|
|
25
|
-
`,k=c.default.div`
|
|
18
|
+
${({theme:{palette:{brand:e,grey:n}},selected:t,isHoverPossible:r})=>r?{"&:hover:not([disabled]), &:focus:not([disabled])":{backgroundColor:t?e.primary.bg:n[10]}}:{}}
|
|
19
|
+
`,k=u.default.div`
|
|
26
20
|
flex-grow: 1;
|
|
27
21
|
|
|
28
22
|
${({ellipsis:e})=>e?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:{}};
|
|
29
23
|
|
|
30
24
|
${({theme:{palette:{brand:e,grey:n},typography:{h5B:t,b4R:r}},selected:a,disabled:o})=>{let i={fontSize:r.size,fontWeight:r.weight,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight};return a&&(i={fontSize:t.size,fontWeight:t.weight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,color:e.primary.text}),o&&(i.color=n[30]),i}}}
|
|
31
|
-
`,u
|
|
25
|
+
`,c=u.default.div`
|
|
32
26
|
white-space: nowrap;
|
|
33
|
-
`,H=w.forwardRef(function({children:n,startAdornment:t,endAdornment:r,inlineCSS:a,selected:o,disabled:i,value:d,onClick:s,ellipsis:p=!0,...h},g){const{isHoverPossible:x}=v.default(),m=f=>{f.stopPropagation(),!i&&typeof s=="function"&&s(f)};return l.jsxs(
|
|
27
|
+
`,H=w.forwardRef(function({children:n,startAdornment:t,endAdornment:r,inlineCSS:a,selected:o,disabled:i,value:d,onClick:s,ellipsis:p=!0,...h},g){const{isHoverPossible:x}=v.default(),m=f=>{f.stopPropagation(),!i&&typeof s=="function"&&s(f)};return l.jsxs($,{ref:g,selected:o,disabled:i,"data-value":d,isHoverPossible:x,onClick:m,ellipsis:p,role:"menuitem",...h,css:a,children:[t&&l.jsx(c,{children:t}),l.jsx(k,{selected:o,disabled:i,ellipsis:p,children:n}),!o&&r&&l.jsx(c,{children:r}),o&&l.jsx(c,{children:l.jsx(y.default,{name:"CheckLine",color:"primary"})})]})});exports.default=H;
|