@xinghunm/compass-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +130 -0
- package/dist/index.d.mts +1154 -0
- package/dist/index.d.ts +1154 -0
- package/dist/index.js +1468 -0
- package/dist/index.mjs +1468 -0
- package/package.json +81 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1468 @@
|
|
|
1
|
+
"use strict";var cs=Object.create;var to=Object.defineProperty;var ps=Object.getOwnPropertyDescriptor;var ds=Object.getOwnPropertyNames;var us=Object.getPrototypeOf,ms=Object.prototype.hasOwnProperty;var fs=(e,t)=>{for(var o in t)to(e,o,{get:t[o],enumerable:!0})},Sr=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of ds(t))!ms.call(e,a)&&a!==o&&to(e,a,{get:()=>t[a],enumerable:!(n=ps(t,a))||n.enumerable});return e};var L=(e,t,o)=>(o=e!=null?cs(us(e)):{},Sr(t||!e||!e.__esModule?to(o,"default",{value:e,enumerable:!0}):o,e)),gs=e=>Sr(to({},"__esModule",{value:!0}),e);var ni={};fs(ni,{Button:()=>Se,ConfigProvider:()=>ea,DatePicker:()=>is,Dropdown:()=>Rn,InputField:()=>mo,InputNumber:()=>Xt,Menu:()=>po,Message:()=>Yn,Modal:()=>ca,Pagination:()=>_a,Progress:()=>Ca,Select:()=>Ut,Steps:()=>rn,Tree:()=>hn});module.exports=gs(ni);var Br=L(require("react"));var Nt=L(require("@emotion/styled"));var Mr=L(require("react")),Tr=require("react"),Rr=L(require("@emotion/styled"));var _e=require("react"),$r=L(require("@emotion/styled")),Pr=require("react-transition-group");var Bt=require("react"),Vo=L(require("@emotion/styled")),mt=require("@emotion/react"),Cr=require("react-transition-group"),oo=require("react/jsx-runtime"),xs=e=>mt.keyframes`
|
|
2
|
+
0% {
|
|
3
|
+
transform: scale(0);
|
|
4
|
+
opacity: 0.1;
|
|
5
|
+
}
|
|
6
|
+
100% {
|
|
7
|
+
transform: scale(1);
|
|
8
|
+
opacity: ${e};
|
|
9
|
+
}
|
|
10
|
+
`,ys=mt.keyframes`
|
|
11
|
+
0% {
|
|
12
|
+
opacity: 1;
|
|
13
|
+
}
|
|
14
|
+
100% {
|
|
15
|
+
opacity: 0;
|
|
16
|
+
}
|
|
17
|
+
`,hs=(e,t)=>{let o=t||.3;return mt.css`
|
|
18
|
+
opacity: ${o};
|
|
19
|
+
transform: scale(1);
|
|
20
|
+
animation: ${xs(o)} ${e}ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
21
|
+
`},bs=e=>mt.css`
|
|
22
|
+
opacity: 0;
|
|
23
|
+
animation: ${ys} ${e}ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
24
|
+
`,vs=Vo.default.span`
|
|
25
|
+
width: 50;
|
|
26
|
+
height: 50;
|
|
27
|
+
left: 0;
|
|
28
|
+
top: 0;
|
|
29
|
+
opacity: 0;
|
|
30
|
+
position: absolute;
|
|
31
|
+
${e=>e.$visible&&hs(e.$duration,e.$opacity)};
|
|
32
|
+
`,Ss=Vo.default.span`
|
|
33
|
+
opacity: 1;
|
|
34
|
+
display: block;
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 100%;
|
|
37
|
+
border-radius: 50%;
|
|
38
|
+
background-color: ${e=>e.$bgColor||"currentColor"};
|
|
39
|
+
${e=>e.$leaving&&bs(e.$duration)};
|
|
40
|
+
`,kr=e=>{let{rippleX:t,rippleY:o,rippleSize:n,bgColor:a,opacity:r,...s}=e,[c,d]=(0,Bt.useState)(!1),[p,u]=(0,Bt.useState)(!1),f=(0,Bt.useRef)(null),b=()=>{d(!0)},g=()=>{u(!0)},l={width:n,height:n,top:-(n/2)+o,left:-(n/2)+t};return(0,oo.jsx)(Cr.Transition,{...s,nodeRef:f,onEnter:b,onExit:g,children:(0,oo.jsx)(vs,{ref:f,$visible:c,$opacity:r,style:l,$duration:s.timeout.enter,children:(0,oo.jsx)(Ss,{$bgColor:a,$leaving:p,$duration:s.timeout.exit})})})};var ro=require("react/jsx-runtime"),Cs=$r.default.div`
|
|
41
|
+
display: block;
|
|
42
|
+
position: absolute;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
border-radius: inherit;
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
left: 0;
|
|
48
|
+
top: 0;
|
|
49
|
+
pointer-events: none;
|
|
50
|
+
z-index: 0;
|
|
51
|
+
`,wr=500,Yo=(0,_e.forwardRef)((e,t)=>{let o=(0,_e.useRef)(0),[n,a]=(0,_e.useState)([]),r=(0,_e.useRef)(null),s=p=>{let{rippleX:u,rippleY:f,rippleSize:b}=p;a([...n,{num:++o.current,timeout:{exit:wr,enter:wr},rippleX:u,rippleY:f,rippleSize:b}])},c=p=>{let u=r.current;if(!u)return;let f=u.getBoundingClientRect(),b=p.clientX,g=p.clientY,l=Math.round(b-f.left),i=Math.round(g-f.top),k=Math.max(Math.abs(u.clientWidth-l),l)*2+2,v=Math.max(Math.abs(u.clientHeight-i),i)*2+2,C=Math.sqrt(k**2+v**2);s({rippleX:l,rippleY:i,rippleSize:C})},d=()=>{n.length&&a(p=>p.slice(1))};return(0,_e.useImperativeHandle)(t,()=>({start:c,stop:d})),(0,ro.jsx)(Cs,{ref:r,children:(0,ro.jsx)(Pr.TransitionGroup,{component:"span",children:n.map(({num:p,...u})=>(0,ro.jsx)(kr,{...u,...e},p))})})});Yo.displayName="TouchRipple";var no=require("react/jsx-runtime"),ks=Rr.default.button`
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
position: relative;
|
|
56
|
+
outline: none;
|
|
57
|
+
border: 0;
|
|
58
|
+
margin: 0;
|
|
59
|
+
padding: 0;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
background: transparent;
|
|
62
|
+
`,Ko=Mr.default.forwardRef((e,t)=>{let{hasRipple:o=!0,className:n,rippleBgColor:a,rippleOpacity:r,children:s,...c}=e,d=(0,Tr.useRef)(),p=f=>{o&&d.current&&d.current.start(f)},u=f=>{o&&d.current&&d.current.stop(f)};return(0,no.jsxs)(ks,{ref:t,...c,className:n,onMouseLeave:u,onMouseUp:u,onMouseDown:p,children:[s,(0,no.jsx)(Yo,{ref:d,bgColor:a,opacity:r})]})});Ko.displayName="ButtonBase";var Dr=(0,Nt.default)(Ko)`
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
border: 1px solid transparent;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
user-select: none;
|
|
69
|
+
outline: none;
|
|
70
|
+
font-family: inherit;
|
|
71
|
+
text-decoration: none;
|
|
72
|
+
box-sizing: border-box;
|
|
73
|
+
position: relative;
|
|
74
|
+
white-space: nowrap;
|
|
75
|
+
font-weight: ${({theme:e})=>e?.fontWeight?.normal||"400"};
|
|
76
|
+
transition: ${({theme:e})=>e?.transitions?.normal||"all 0.3s"};
|
|
77
|
+
|
|
78
|
+
&:focus {
|
|
79
|
+
outline: 2px solid ${({theme:e})=>e?.colors?.primary||"#007bff"};
|
|
80
|
+
outline-offset: 2px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&:disabled {
|
|
84
|
+
cursor: not-allowed;
|
|
85
|
+
opacity: 0.6;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
${({$size:e,$shape:t,theme:o})=>{let n=t==="circle";switch(e){case"small":return`
|
|
89
|
+
height: 24px;
|
|
90
|
+
padding: ${n?"0":o?.components?.button?.padding?.sm||`0 ${o?.spacing?.sm||8}px`};
|
|
91
|
+
font-size: ${o?.components?.button?.fontSize?.sm||`${o?.fontSize?.xs||12}px`};
|
|
92
|
+
border-radius: ${t==="round"?"999px":n?"50%":o?.components?.button?.borderRadius?.sm||`${o?.borderRadius?.sm||4}px`};
|
|
93
|
+
${n?"width: 24px; min-width: 24px;":""}
|
|
94
|
+
`;case"large":return`
|
|
95
|
+
height: 40px;
|
|
96
|
+
padding: ${n?"0":o?.components?.button?.padding?.md||`0 ${o?.spacing?.md||16}px`};
|
|
97
|
+
font-size: ${o?.components?.button?.fontSize?.lg||`${o?.fontSize?.md||16}px`};
|
|
98
|
+
border-radius: ${t==="round"?"999px":n?"50%":o?.components?.button?.borderRadius?.lg||`${o?.borderRadius?.lg||8}px`};
|
|
99
|
+
${n?"width: 40px; min-width: 40px;":""}
|
|
100
|
+
`;default:return`
|
|
101
|
+
height: 32px;
|
|
102
|
+
padding: ${n?"0":o?.components?.button?.padding?.md||`0 ${o?.spacing?.md||16}px`};
|
|
103
|
+
font-size: ${o?.components?.button?.fontSize?.md||`${o?.fontSize?.sm||14}px`};
|
|
104
|
+
border-radius: ${t==="round"?"999px":n?"50%":o?.components?.button?.borderRadius?.md||`${o?.borderRadius?.md||6}px`};
|
|
105
|
+
${n?"width: 32px; min-width: 32px;":""}
|
|
106
|
+
`}}}
|
|
107
|
+
|
|
108
|
+
${({$variant:e,theme:t})=>{switch(e){case"primary":return`
|
|
109
|
+
background-color: ${t?.colors?.primary||"#007bff"};
|
|
110
|
+
border-color: ${t?.colors?.primary||"#007bff"};
|
|
111
|
+
color: #fff;
|
|
112
|
+
|
|
113
|
+
&:hover:not(:disabled) {
|
|
114
|
+
background-color: ${t?.colors?.primaryHover||"#0056b3"};
|
|
115
|
+
border-color: ${t?.colors?.primaryHover||"#0056b3"};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&:active:not(:disabled) {
|
|
119
|
+
background-color: ${t?.colors?.primaryActive||"#004085"};
|
|
120
|
+
border-color: ${t?.colors?.primaryActive||"#004085"};
|
|
121
|
+
}
|
|
122
|
+
`;case"dashed":return`
|
|
123
|
+
background-color: ${t?.colors?.background||"#fff"};
|
|
124
|
+
border-color: ${t?.colors?.border||"#d9d9d9"};
|
|
125
|
+
border-style: dashed;
|
|
126
|
+
color: ${t?.colors?.text||"#000"};
|
|
127
|
+
|
|
128
|
+
&:hover:not(:disabled) {
|
|
129
|
+
border-color: ${t?.colors?.borderHover||"#40a9ff"};
|
|
130
|
+
color: ${t?.colors?.borderHover||"#40a9ff"};
|
|
131
|
+
}
|
|
132
|
+
`;case"text":return`
|
|
133
|
+
background-color: transparent;
|
|
134
|
+
border-color: transparent;
|
|
135
|
+
color: ${t?.colors?.text||"#000"};
|
|
136
|
+
|
|
137
|
+
&:hover:not(:disabled) {
|
|
138
|
+
background-color: ${t?.colors?.backgroundTertiary||"rgba(0, 0, 0, 0.018)"};
|
|
139
|
+
}
|
|
140
|
+
`;case"link":return`
|
|
141
|
+
background-color: transparent;
|
|
142
|
+
border-color: transparent;
|
|
143
|
+
color: ${t?.colors?.primary||"#007bff"};
|
|
144
|
+
|
|
145
|
+
&:hover:not(:disabled) {
|
|
146
|
+
color: ${t?.colors?.primaryHover||"#0056b3"};
|
|
147
|
+
}
|
|
148
|
+
`;default:return`
|
|
149
|
+
background-color: ${t?.colors?.background||"#fff"};
|
|
150
|
+
border-color: ${t?.colors?.border||"#d9d9d9"};
|
|
151
|
+
color: ${t?.colors?.text||"#000"};
|
|
152
|
+
|
|
153
|
+
&:hover:not(:disabled) {
|
|
154
|
+
border-color: ${t?.colors?.borderHover||"#40a9ff"};
|
|
155
|
+
color: ${t?.colors?.borderHover||"#40a9ff"};
|
|
156
|
+
}
|
|
157
|
+
`}}}
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
${({$danger:e,$variant:t,theme:o})=>e&&`
|
|
161
|
+
${t==="primary"?`
|
|
162
|
+
background-color: ${o?.colors?.error||"#ff4d4f"};
|
|
163
|
+
border-color: ${o?.colors?.error||"#ff4d4f"};
|
|
164
|
+
|
|
165
|
+
&:hover:not(:disabled) {
|
|
166
|
+
background-color: #ff7875;
|
|
167
|
+
border-color: #ff7875;
|
|
168
|
+
}
|
|
169
|
+
`:`
|
|
170
|
+
border-color: ${o?.colors?.error||"#ff4d4f"};
|
|
171
|
+
color: ${o?.colors?.error||"#ff4d4f"};
|
|
172
|
+
|
|
173
|
+
&:hover:not(:disabled) {
|
|
174
|
+
${t==="text"?`
|
|
175
|
+
background-color: #fff2f0;
|
|
176
|
+
`:`
|
|
177
|
+
background-color: #fff2f0;
|
|
178
|
+
border-color: #ff7875;
|
|
179
|
+
`}
|
|
180
|
+
color: #ff7875;
|
|
181
|
+
}
|
|
182
|
+
`}
|
|
183
|
+
`}
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
${({$loading:e})=>e&&`
|
|
187
|
+
pointer-events: none;
|
|
188
|
+
`}
|
|
189
|
+
|
|
190
|
+
${({$block:e})=>e&&"width: 100%;"}
|
|
191
|
+
`,Ir=Nt.default.span`
|
|
192
|
+
display: inline-flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
|
|
195
|
+
${({$hasText:e})=>e&&"margin-right: 4px;"}
|
|
196
|
+
`,zr=Nt.default.span`
|
|
197
|
+
display: inline-flex;
|
|
198
|
+
align-items: center;
|
|
199
|
+
line-height: 1;
|
|
200
|
+
`,Hr=Nt.default.span`
|
|
201
|
+
display: inline-block;
|
|
202
|
+
width: 14px;
|
|
203
|
+
height: 14px;
|
|
204
|
+
border: 2px solid transparent;
|
|
205
|
+
border-top-color: currentColor;
|
|
206
|
+
border-radius: 50%;
|
|
207
|
+
animation: spin 1s linear infinite;
|
|
208
|
+
|
|
209
|
+
@keyframes spin {
|
|
210
|
+
0% {
|
|
211
|
+
transform: rotate(0deg);
|
|
212
|
+
}
|
|
213
|
+
100% {
|
|
214
|
+
transform: rotate(360deg);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
`;var ft=require("react/jsx-runtime"),Nr=Br.default.forwardRef(({children:e,variant:t="default",size:o="default",shape:n="default",disabled:a=!1,loading:r=!1,danger:s=!1,block:c=!1,icon:d,onClick:p,className:u,style:f,...b},g)=>{let l=i=>{r||a||p?.(i)};return(0,ft.jsx)(Dr,{ref:g,className:`compass-button compass-button--${t} ${u||""}`,style:f,$variant:t,$size:o,$shape:n,$danger:s,$loading:r,$block:c,disabled:a||r,onClick:l,...b,children:(0,ft.jsxs)(zr,{$loading:r,children:[(r||d)&&(0,ft.jsx)(Ir,{$hasText:!!e,children:r?(0,ft.jsx)(Hr,{"aria-hidden":!0}):d}),e]})})});Nr.displayName="Button";var Fr=Nr;var Se=Fr;var _o=L(require("react"));var qe=L(require("@emotion/styled"));var ue={colors:{primary:"#1890ff",primaryHover:"#40a9ff",primaryActive:"#096dd9",success:"#52c41a",warning:"#faad14",error:"#ff4d4f",info:"#1890ff",text:"rgba(0, 0, 0, 0.88)",textSecondary:"rgba(0, 0, 0, 0.65)",textTertiary:"rgba(0, 0, 0, 0.45)",textDisabled:"rgba(0, 0, 0, 0.25)",background:"#ffffff",backgroundSecondary:"#fafafa",backgroundTertiary:"#f5f5f5",border:"#d9d9d9",borderSecondary:"#f0f0f0",borderHover:"#4096ff"},spacing:{xs:4,sm:8,md:16,lg:24,xl:32,xxl:48},borderRadius:{xs:2,sm:4,md:6,lg:8,xl:12},fontSize:{xs:12,sm:14,md:16,lg:18,xl:20,xxl:24},fontWeight:{light:300,normal:400,medium:500,semibold:600,bold:700},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75},shadows:{sm:"0 1px 2px rgba(0, 0, 0, 0.03)",md:"0 1px 6px rgba(0, 0, 0, 0.03)",lg:"0 4px 12px rgba(0, 0, 0, 0.15)",xl:"0 8px 24px rgba(0, 0, 0, 0.15)"},transitions:{fast:"all 0.1s ease-in-out",normal:"all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)",slow:"all 0.3s ease-in-out"},breakpoints:{xs:"480px",sm:"576px",md:"768px",lg:"992px",xl:"1200px"},components:{pagination:{itemSize:"32px",itemBg:"#ffffff",itemActiveBg:"#ffffff",itemBorderRadius:"4px",itemColor:"rgba(0, 0, 0, 0.88)",itemActiveColor:"#1890ff",itemHoverBg:"#ffffff",itemHoverColor:"#1890ff",fontSize:"14px"},button:{padding:{sm:"0 8px",md:"0 16px"},fontSize:{sm:"12px",md:"14px",lg:"16px"},borderRadius:{sm:"4px",md:"6px",lg:"8px"}},message:{contentPadding:"8px 16px",borderRadius:"8px",boxShadow:"0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05)",zIndex:1010},modal:{maskColor:"rgba(0, 0, 0, 0.45)",contentBg:"#ffffff",borderRadius:"8px",boxShadow:"0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05)",headerPadding:"16px 24px",bodyPadding:"24px",footerPadding:"10px 16px",zIndex:1e3},progress:{trackColor:"#f5f5f5",successColor:"#52c41a",errorColor:"#ff4d4f",warningColor:"#faad14",infoColor:"#1890ff",fontSize:"14px"},steps:{descriptionColor:"rgba(0, 0, 0, 0.45)",titleColor:"rgba(0, 0, 0, 0.65)",subTitleColor:"rgba(0, 0, 0, 0.45)",waitIconColor:"rgba(0, 0, 0, 0.25)",processIconColor:"#1890ff",finishIconColor:"#1890ff",errorIconColor:"#ff4d4f",waitTitleColor:"rgba(0, 0, 0, 0.45)",processTitleColor:"rgba(0, 0, 0, 0.85)",finishTitleColor:"rgba(0, 0, 0, 0.65)",errorTitleColor:"#ff4d4f",waitDescriptionColor:"rgba(0, 0, 0, 0.45)",processDescriptionColor:"rgba(0, 0, 0, 0.65)",finishDescriptionColor:"rgba(0, 0, 0, 0.45)",errorDescriptionColor:"#ff4d4f",iconSize:"32px",dotSize:"8px",titleFontSize:"16px",descriptionFontSize:"14px"},input:{padding:{sm:"4px 8px",md:"6px 12px",lg:"8px 16px"},fontSize:{sm:"12px",md:"14px",lg:"16px"},borderRadius:"4px",activeBorderColor:"#40a9ff",hoverBorderColor:"#4096ff"},dropdown:{zIndex:1050,backgroundColor:"#ffffff",boxShadow:"0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05)",borderRadius:"4px",padding:"4px 0"},menu:{itemHoverBg:"#f5f5f5",itemColor:"rgba(0, 0, 0, 0.88)",itemHeight:"32px",itemPadding:"0 12px",fontSize:"14px",borderRadius:"4px"},datePicker:{cellWidth:"32px",cellHeight:"32px",cellPadding:"0",cellMargin:"2px",cellFontSize:"14px",cellBorderRadius:"4px",headerPadding:"12px 16px",headerHeight:"40px",headerFontSize:"14px",weekDayFontSize:"12px",cellActiveBg:"#1890ff",cellHoverBg:"#40a9ff",cellColor:"rgba(0, 0, 0, 0.88)",cellActiveColor:"#ffffff",cellDisabledColor:"rgba(0, 0, 0, 0.25)",borderColor:"rgba(0, 0, 0, 0.06)",boxShadow:"0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05)",zIndex:1e3},tree:{nodeSelectedBg:"#e6f7ff",nodeHoverBg:"#f5f5f5",nodeColor:"rgba(0, 0, 0, 0.88)",nodeSelectedColor:"rgba(0, 0, 0, 0.88)",switcherColor:"rgba(0, 0, 0, 0.45)",switcherHoverColor:"#1890ff",fontSize:"14px",borderRadius:"4px",indentSize:"24px"},select:{borderRadius:"4px",backgroundColor:"#ffffff",borderColor:"#d9d9d9",hoverBorderColor:"#4096ff",activeBorderColor:"#1890ff",placeholderColor:"rgba(0, 0, 0, 0.25)",optionSelectedBg:"#e6f7ff",optionHoverBg:"#f5f5f5",optionColor:"rgba(0, 0, 0, 0.88)",optionSelectedColor:"rgba(0, 0, 0, 0.88)",tagBg:"#f5f5f5",tagColor:"rgba(0, 0, 0, 0.88)",tagBorderColor:"#f0f0f0",padding:{sm:"0 8px",md:"0 11px",lg:"0 11px"},fontSize:{sm:"12px",md:"14px",lg:"16px"}}}};var m=(e,t)=>e?.components?.[t]||ue.components[t],y=(e,t)=>e?.[t]||ue[t];var Er=qe.default.div`
|
|
218
|
+
display: flex;
|
|
219
|
+
width: 100%;
|
|
220
|
+
height: ${e=>e.direction==="vertical"?"100%":"auto"};
|
|
221
|
+
font-size: 0;
|
|
222
|
+
text-align: initial;
|
|
223
|
+
flex-direction: ${e=>e.direction==="vertical"?"column":"row"};
|
|
224
|
+
`,Lr=qe.default.div`
|
|
225
|
+
position: relative;
|
|
226
|
+
display: inline-block;
|
|
227
|
+
flex: 1;
|
|
228
|
+
overflow: hidden;
|
|
229
|
+
vertical-align: top;
|
|
230
|
+
margin-right: 16px;
|
|
231
|
+
white-space: nowrap;
|
|
232
|
+
cursor: ${e=>e.clickable&&!e.disabled?"pointer":"default"};
|
|
233
|
+
opacity: ${e=>e.disabled?.5:1};
|
|
234
|
+
|
|
235
|
+
&:last-child {
|
|
236
|
+
flex: none;
|
|
237
|
+
margin-right: 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
${e=>{let t=m(e.theme,"steps"),o=y(e.theme,"colors"),n=t.iconSize,a=t.dotSize;return e.direction==="horizontal"&&e.labelPlacement==="vertical"&&`
|
|
241
|
+
text-align: center;
|
|
242
|
+
overflow: visible;
|
|
243
|
+
margin-right: 0;
|
|
244
|
+
|
|
245
|
+
&:last-child {
|
|
246
|
+
flex: 1;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
& .compass-steps-icon {
|
|
250
|
+
margin-left: 0;
|
|
251
|
+
margin-right: 0;
|
|
252
|
+
display: inline-flex;
|
|
253
|
+
position: relative;
|
|
254
|
+
z-index: 1;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
& .compass-steps-content {
|
|
258
|
+
display: block;
|
|
259
|
+
margin-top: 4px;
|
|
260
|
+
text-align: center;
|
|
261
|
+
width: 100%;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
& .compass-steps-title {
|
|
265
|
+
padding-right: 0;
|
|
266
|
+
display: block;
|
|
267
|
+
text-align: center;
|
|
268
|
+
|
|
269
|
+
&::after {
|
|
270
|
+
display: none;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
&::after {
|
|
275
|
+
position: absolute;
|
|
276
|
+
top: 16px;
|
|
277
|
+
left: 50%;
|
|
278
|
+
display: block;
|
|
279
|
+
width: calc(100% - ${e.variant==="dot"?a:n} - 16px);
|
|
280
|
+
height: 1px;
|
|
281
|
+
background: ${o.border};
|
|
282
|
+
content: '';
|
|
283
|
+
margin-left: calc(${e.variant==="dot"?a:n} / 2 + 8px);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
&:last-child::after {
|
|
287
|
+
display: none;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
& .compass-steps-subtitle {
|
|
291
|
+
display: block;
|
|
292
|
+
margin-left: 0;
|
|
293
|
+
margin-top: 2px;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
& .compass-steps-description {
|
|
297
|
+
margin: 2px auto 0;
|
|
298
|
+
}
|
|
299
|
+
`}}
|
|
300
|
+
${e=>e.direction==="vertical"&&`
|
|
301
|
+
display: block;
|
|
302
|
+
flex: 1;
|
|
303
|
+
overflow: visible;
|
|
304
|
+
margin-right: 0;
|
|
305
|
+
padding-bottom: 0;
|
|
306
|
+
`}
|
|
307
|
+
`,Or=qe.default.div`
|
|
308
|
+
position: relative;
|
|
309
|
+
z-index: 1;
|
|
310
|
+
box-sizing: border-box;
|
|
311
|
+
display: inline-flex;
|
|
312
|
+
align-items: center;
|
|
313
|
+
justify-content: center;
|
|
314
|
+
width: ${e=>{let t=m(e.theme,"steps");return e.variant==="dot"?t.dotSize:t.iconSize}};
|
|
315
|
+
height: ${e=>{let t=m(e.theme,"steps");return e.variant==="dot"?t.dotSize:t.iconSize}};
|
|
316
|
+
margin-right: 8px;
|
|
317
|
+
margin-top: ${e=>{let t=m(e.theme,"steps");return`calc((32px - ${e.variant==="dot"?t.dotSize:t.iconSize}) / 2)`}};
|
|
318
|
+
font-size: ${e=>m(e.theme,"steps").titleFontSize};
|
|
319
|
+
line-height: 1;
|
|
320
|
+
text-align: center;
|
|
321
|
+
border: 1px solid;
|
|
322
|
+
border-radius: ${e=>{let t=m(e.theme,"steps");return e.variant==="dot"?t.dotSize:t.iconSize}};
|
|
323
|
+
transition:
|
|
324
|
+
background-color 0.3s,
|
|
325
|
+
border-color 0.3s;
|
|
326
|
+
|
|
327
|
+
& > span {
|
|
328
|
+
display: flex;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
${e=>{let t=m(e.theme,"steps"),o=y(e.theme,"colors");switch(e.status){case"process":return`
|
|
332
|
+
background-color: ${t.processIconColor};
|
|
333
|
+
border-color: ${t.processIconColor};
|
|
334
|
+
color: #fff;
|
|
335
|
+
`;case"wait":return`
|
|
336
|
+
background-color: ${o.background};
|
|
337
|
+
border-color: ${t.waitIconColor};
|
|
338
|
+
color: ${t.waitIconColor};
|
|
339
|
+
`;case"finish":return`
|
|
340
|
+
background-color: ${o.background};
|
|
341
|
+
border-color: ${t.finishIconColor};
|
|
342
|
+
color: ${t.finishIconColor};
|
|
343
|
+
`;case"error":return`
|
|
344
|
+
background-color: ${o.background};
|
|
345
|
+
border-color: ${t.errorIconColor};
|
|
346
|
+
color: ${t.errorIconColor};
|
|
347
|
+
`;default:return""}}}
|
|
348
|
+
`,Wr=qe.default.div`
|
|
349
|
+
display: inline-block;
|
|
350
|
+
vertical-align: top;
|
|
351
|
+
`,Ar=qe.default.div`
|
|
352
|
+
position: relative;
|
|
353
|
+
display: inline-block;
|
|
354
|
+
padding-right: 16px;
|
|
355
|
+
color: ${e=>{let t=m(e.theme,"steps");switch(e.status){case"process":return t.processTitleColor;case"wait":return t.waitTitleColor;case"finish":return t.finishTitleColor;case"error":return t.errorTitleColor;default:return t.titleColor}}};
|
|
356
|
+
font-size: ${e=>m(e.theme,"steps").titleFontSize};
|
|
357
|
+
line-height: 32px;
|
|
358
|
+
|
|
359
|
+
&::after {
|
|
360
|
+
position: absolute;
|
|
361
|
+
top: 16px;
|
|
362
|
+
left: 100%;
|
|
363
|
+
display: ${e=>e.isLast||e.direction==="vertical"?"none":"block"};
|
|
364
|
+
width: 9999px;
|
|
365
|
+
height: 1px;
|
|
366
|
+
background: ${e=>y(e.theme,"colors").borderSecondary};
|
|
367
|
+
content: '';
|
|
368
|
+
}
|
|
369
|
+
`,Vr=qe.default.div`
|
|
370
|
+
display: inline;
|
|
371
|
+
margin-left: 8px;
|
|
372
|
+
color: ${e=>m(e.theme,"steps").subTitleColor};
|
|
373
|
+
font-weight: normal;
|
|
374
|
+
font-size: 14px;
|
|
375
|
+
`,Yr=qe.default.div`
|
|
376
|
+
color: ${e=>{let t=m(e.theme,"steps");switch(e.status){case"process":return t.processDescriptionColor;case"wait":return t.waitDescriptionColor;case"finish":return t.finishDescriptionColor;case"error":return t.errorDescriptionColor;default:return t.descriptionColor}}};
|
|
377
|
+
font-size: ${e=>m(e.theme,"steps").descriptionFontSize};
|
|
378
|
+
`,Kr=qe.default.div`
|
|
379
|
+
display: ${e=>e.direction==="vertical"&&!e.isLast?"block":"none"};
|
|
380
|
+
position: absolute;
|
|
381
|
+
top: ${e=>{let t=m(e.theme,"steps");return`calc((32px + ${e.variant==="dot"?t.dotSize:t.iconSize}) / 2 + 6px)`}};
|
|
382
|
+
bottom: 6px;
|
|
383
|
+
left: ${e=>{let t=m(e.theme,"steps");return`calc(${e.variant==="dot"?t.dotSize:t.iconSize} / 2)`}};
|
|
384
|
+
width: 1px;
|
|
385
|
+
padding: 0;
|
|
386
|
+
margin-left: 0;
|
|
387
|
+
transform: translateX(-50%);
|
|
388
|
+
|
|
389
|
+
&::after {
|
|
390
|
+
display: inline-block;
|
|
391
|
+
width: 1px;
|
|
392
|
+
height: 100%;
|
|
393
|
+
background: ${e=>y(e.theme,"colors").borderSecondary};
|
|
394
|
+
border-radius: 1px;
|
|
395
|
+
transition: background 0.3s;
|
|
396
|
+
content: '';
|
|
397
|
+
}
|
|
398
|
+
`;var h=require("react/jsx-runtime"),_r=()=>(0,h.jsx)("span",{role:"img","aria-label":"caret-right",className:"compass-icon compass-icon-caret-right",children:(0,h.jsx)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-right",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M715.8 493.5L335 865c-12.3 12-32.8 3.3-32.8-13.7V172.7c0-17 20.5-25.7 32.8-13.7l380.8 371.5c7.5 7.3 7.5 19.4 0 26.7z"})})}),Xe=()=>(0,h.jsx)("span",{role:"img","aria-label":"info",className:"compass-icon compass-icon-info-circle",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"info-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"})})}),gt=()=>(0,h.jsx)("span",{role:"img","aria-label":"success",className:"compass-icon compass-icon-check-circle",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"check-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})})}),xt=()=>(0,h.jsx)("span",{role:"img","aria-label":"error",className:"compass-icon compass-icon-close-circle",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"close-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"})})}),yt=()=>(0,h.jsx)("span",{role:"img","aria-label":"warning",className:"compass-icon compass-icon-exclamation-circle",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"exclamation-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"})})}),ao=()=>(0,h.jsx)("span",{role:"img","aria-label":"loading",className:"compass-icon compass-icon-loading",children:(0,h.jsx)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"loading",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})})}),ht=()=>(0,h.jsx)("span",{role:"img","aria-label":"close",className:"compass-icon compass-icon-close",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"close",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"})})});var qr=()=>(0,h.jsx)("span",{role:"img","aria-label":"eye",className:"compass-icon compass-icon-eye",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"eye",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"})})}),jr=()=>(0,h.jsx)("span",{role:"img","aria-label":"eye-invisible",className:"compass-icon compass-icon-eye-invisible",children:(0,h.jsxs)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"eye-invisible",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:[(0,h.jsx)("path",{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}),(0,h.jsx)("path",{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"})]})}),Gr=()=>(0,h.jsx)("span",{role:"img","aria-label":"search",className:"compass-icon compass-icon-search",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"search",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"})})}),Je=()=>(0,h.jsx)("span",{role:"img","aria-label":"close-circle",className:"compass-icon compass-icon-close-circle",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"close-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"})})}),so=()=>(0,h.jsx)("span",{role:"img","aria-label":"check",className:"compass-icon compass-icon-check",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"check",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"})})}),nt=()=>(0,h.jsx)("span",{role:"img","aria-label":"left",className:"compass-icon compass-icon-left",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"left",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"})})}),at=()=>(0,h.jsx)("span",{role:"img","aria-label":"right",className:"compass-icon compass-icon-right",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"right",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.8 31.8 0 000-50.4z"})})}),Ze=()=>(0,h.jsx)("span",{role:"img","aria-label":"double-left",className:"compass-icon compass-icon-double-left",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"double-left",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"})})}),et=()=>(0,h.jsx)("span",{role:"img","aria-label":"double-right",className:"compass-icon compass-icon-double-right",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"double-right",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"})})}),io=()=>(0,h.jsx)("span",{role:"img","aria-label":"calendar",className:"compass-icon compass-icon-calendar",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"calendar",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"})})}),Qr=()=>(0,h.jsx)("span",{role:"img","aria-label":"down",className:"compass-icon compass-icon-down",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"})})});var Ur=()=>(0,h.jsx)("span",{role:"img","aria-label":"ellipsis",className:"compass-icon compass-icon-ellipsis",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"ellipsis",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M176 512a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"})})}),Xr=()=>(0,h.jsx)("span",{role:"img","aria-label":"plus-square",className:"compass-icon compass-icon-plus-square",children:(0,h.jsxs)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"plus-square",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:[(0,h.jsx)("path",{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}),(0,h.jsx)("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"})]})}),Jr=()=>(0,h.jsx)("span",{role:"img","aria-label":"minus-square",className:"compass-icon compass-icon-minus-square",children:(0,h.jsxs)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"minus-square",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:[(0,h.jsx)("path",{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}),(0,h.jsx)("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"})]})}),Zr=()=>(0,h.jsx)("span",{role:"img","aria-label":"file",className:"compass-icon compass-icon-file",children:(0,h.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"file",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.6-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"})})});var Ie=require("react/jsx-runtime"),en=()=>null,tn=({current:e=0,status:t="process",direction:o="horizontal",labelPlacement:n="horizontal",variant:a="default",items:r,children:s,onChange:c,className:d,style:p})=>{let u=(l,i,k)=>l<i?"finish":l===i?k:"wait",f=(l,i,k)=>k||(i==="finish"?(0,Ie.jsx)(so,{}):i==="error"?(0,Ie.jsx)(ht,{}):l+1),b=(l,i)=>{c&&!i&&l!==e&&c(l)},g=[];return r?g=r:s&&_o.default.Children.forEach(s,l=>{_o.default.isValidElement(l)&&l.type===en&&g.push(l.props)}),(0,Ie.jsx)(Er,{direction:o,labelPlacement:n,className:`compass-steps compass-steps--${o} compass-steps--label-${n} compass-steps--${a} ${d||""}`,style:p,role:"list",children:g.map((l,i)=>{let k=l.status||u(i,e,t),v=!!c&&!l.disabled;return(0,Ie.jsxs)(Lr,{status:k,active:i===e,disabled:l.disabled,direction:o,labelPlacement:n,variant:a,clickable:v,onClick:()=>b(i,l.disabled),className:`compass-steps-item compass-steps-item--${k} ${i===e?"compass-steps-item--active":""} ${l.disabled?"compass-steps-item--disabled":""} ${l.className||""}`,style:l.style,role:"listitem",children:[(0,Ie.jsx)(Kr,{direction:o,isLast:i===g.length-1,variant:a}),(0,Ie.jsx)(Or,{status:k,active:i===e,variant:a,className:`compass-steps-icon ${a==="dot"?"compass-steps-icon--dot":""}`,children:a!=="dot"&&f(i,k,l.icon)}),(0,Ie.jsxs)(Wr,{className:"compass-steps-content",children:[(0,Ie.jsxs)(Ar,{status:k,className:"compass-steps-title",isLast:i===g.length-1,direction:o,children:[l.title,l.subTitle&&(0,Ie.jsx)(Vr,{className:"compass-steps-subtitle",children:l.subTitle})]}),l.description&&(0,Ie.jsx)(Yr,{status:k,className:"compass-steps-description",children:l.description})]})]},i)})})};tn.Step=en;var on=tn;var rn=on;var st=require("react"),xn=require("react-window");var je=L(require("@emotion/styled")),qo=require("@emotion/react");var nn=je.default.div`
|
|
399
|
+
position: relative;
|
|
400
|
+
font-size: ${({theme:e})=>m(e,"tree").fontSize};
|
|
401
|
+
line-height: 1.5;
|
|
402
|
+
color: ${({theme:e})=>m(e,"tree").nodeColor};
|
|
403
|
+
`,an=je.default.div`
|
|
404
|
+
display: flex;
|
|
405
|
+
align-items: center;
|
|
406
|
+
padding: 0 4px;
|
|
407
|
+
padding-left: ${({level:e,theme:t})=>`calc(${e} * ${m(t,"tree").indentSize} + 4px)`};
|
|
408
|
+
cursor: pointer;
|
|
409
|
+
transition: all 0.2s;
|
|
410
|
+
position: relative;
|
|
411
|
+
background-color: ${({selected:e,theme:t})=>e?m(t,"tree").nodeSelectedBg:"transparent"};
|
|
412
|
+
border-radius: ${({theme:e})=>m(e,"tree").borderRadius};
|
|
413
|
+
color: ${({selected:e,theme:t})=>e?m(t,"tree").nodeSelectedColor:"inherit"};
|
|
414
|
+
|
|
415
|
+
&:hover {
|
|
416
|
+
background-color: ${({selected:e,theme:t})=>e?m(t,"tree").nodeSelectedBg:m(t,"tree").nodeHoverBg};
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
${({disabled:e})=>e&&qo.css`
|
|
420
|
+
cursor: not-allowed;
|
|
421
|
+
opacity: 0.5;
|
|
422
|
+
&:hover {
|
|
423
|
+
background-color: transparent;
|
|
424
|
+
}
|
|
425
|
+
`}
|
|
426
|
+
`,lo=je.default.span`
|
|
427
|
+
font-size: 12px;
|
|
428
|
+
display: flex;
|
|
429
|
+
align-items: center;
|
|
430
|
+
justify-content: center;
|
|
431
|
+
flex-shrink: 0;
|
|
432
|
+
user-select: none;
|
|
433
|
+
line-height: 0;
|
|
434
|
+
width: 24px;
|
|
435
|
+
height: 24px;
|
|
436
|
+
margin-right: 4px;
|
|
437
|
+
cursor: pointer;
|
|
438
|
+
position: relative;
|
|
439
|
+
transform: rotate(
|
|
440
|
+
${({expanded:e,showLine:t})=>t?"0deg":e?"90deg":"0deg"}
|
|
441
|
+
);
|
|
442
|
+
transition: transform 0.2s;
|
|
443
|
+
z-index: 1;
|
|
444
|
+
background: ${({showLine:e})=>e?"#fff":"transparent"};
|
|
445
|
+
color: ${({theme:e})=>m(e,"tree").switcherColor};
|
|
446
|
+
|
|
447
|
+
&:hover {
|
|
448
|
+
color: ${({theme:e})=>m(e,"tree").switcherHoverColor};
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
&.is-noop {
|
|
452
|
+
cursor: default;
|
|
453
|
+
transform: none;
|
|
454
|
+
&:hover {
|
|
455
|
+
color: inherit;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
`,sn=je.default.span`
|
|
459
|
+
align-self: stretch;
|
|
460
|
+
width: ${({theme:e})=>m(e,"tree").indentSize};
|
|
461
|
+
display: inline-block;
|
|
462
|
+
flex-shrink: 0;
|
|
463
|
+
position: relative;
|
|
464
|
+
|
|
465
|
+
${({active:e})=>e&&qo.css`
|
|
466
|
+
&::before {
|
|
467
|
+
content: '';
|
|
468
|
+
position: absolute;
|
|
469
|
+
top: 0;
|
|
470
|
+
bottom: 0;
|
|
471
|
+
left: 50%;
|
|
472
|
+
border-left: 1px solid #d9d9d9;
|
|
473
|
+
transform: translateX(-50%);
|
|
474
|
+
}
|
|
475
|
+
`}
|
|
476
|
+
`,ln=je.default.span`
|
|
477
|
+
margin-right: 8px;
|
|
478
|
+
display: flex;
|
|
479
|
+
align-items: center;
|
|
480
|
+
`,cn=je.default.div`
|
|
481
|
+
display: flex;
|
|
482
|
+
align-items: center;
|
|
483
|
+
flex: 1;
|
|
484
|
+
min-width: 0;
|
|
485
|
+
`,pn=je.default.div`
|
|
486
|
+
flex: 1;
|
|
487
|
+
min-width: 0;
|
|
488
|
+
margin-left: 4px;
|
|
489
|
+
white-space: nowrap;
|
|
490
|
+
overflow: hidden;
|
|
491
|
+
text-overflow: ellipsis;
|
|
492
|
+
`,dn=je.default.span`
|
|
493
|
+
display: inline-flex;
|
|
494
|
+
align-items: center;
|
|
495
|
+
justify-content: center;
|
|
496
|
+
width: 16px;
|
|
497
|
+
height: 16px;
|
|
498
|
+
margin-right: 4px;
|
|
499
|
+
`;var xe=require("react/jsx-runtime"),jo=({level:e=0,expanded:t,selected:o,checked:n,halfChecked:a,disabled:r,title:s,icon:c,isLeaf:d,checkable:p,selectable:u,onExpand:f,onSelect:b,onCheck:g,className:l,style:i,switcherIcon:k,showLine:v,showIcon:C,indentLines:w=[]})=>{let T=S=>{S.stopPropagation(),!d&&f&&f(S)},B=S=>{S.stopPropagation(),!r&&u!==!1&&b&&b(S)},_=S=>{S.stopPropagation(),!r&&p!==!1&&g&&g(S)},A=()=>typeof k=="function"?k({expanded:!!t}):v?d?(0,xe.jsx)(Zr,{}):t?(0,xe.jsx)(Jr,{}):(0,xe.jsx)(Xr,{}):k||(0,xe.jsx)(_r,{}),I=typeof k!="function";return(0,xe.jsxs)(an,{level:v?0:e,selected:o,disabled:r,className:`compass-tree-node ${o?"compass-tree-node--selected":""} ${r?"compass-tree-node--disabled":""} ${l||""}`,style:i,onClick:B,showLine:v,children:[v&&w.map((S,q)=>(0,xe.jsx)(sn,{active:S,className:"compass-tree-indent"},q)),d?v?(0,xe.jsx)(lo,{className:"compass-tree-switcher compass-tree-switcher--leaf",showLine:v,children:A()}):(0,xe.jsx)(lo,{className:"compass-tree-switcher compass-tree-switcher--noop",showLine:v,children:(0,xe.jsx)("span",{style:{width:"16px",display:"inline-block"}})}):(0,xe.jsx)(lo,{expanded:I?t:void 0,onClick:T,className:"compass-tree-switcher",showLine:v,children:A()}),p&&(0,xe.jsx)(ln,{onClick:_,className:"compass-tree-checkbox",children:(0,xe.jsx)("input",{type:"checkbox",checked:n,disabled:r,ref:S=>{S&&(S.indeterminate=!!a)},readOnly:!0})}),(0,xe.jsxs)(cn,{className:"compass-tree-content",children:[C&&c&&(0,xe.jsx)(dn,{className:"compass-tree-icon",children:c}),(0,xe.jsx)(pn,{className:"compass-tree-title",children:s})]})]})};function un(e=[],t=[]){let o=new Set(t),n=[];function a(r,s=null,c=0,d="0"){return r.map((p,u)=>{let f=`${d}-${u}`,b={...p,parent:s,children:[],pos:f,data:p,level:c,key:p.key,title:p.title};return n.push(b),o.has(p.key)?b.children=a(p.children||[],b,c+1,f):b.children=[],b})}return a(e),n}function mn(e,t,o){let n=[];return e.forEach((a,r)=>{let{key:s,children:c}=a,d=t?`${t.pos}-${r}`:`${r}`,p={node:a,index:r,key:s,pos:d,parent:t||void 0};o.keyEntities[s]=p,n.push(p),c&&(p.children=mn(c,p,o))}),n}function fn(e){let t={};return mn(e,null,{keyEntities:t}),{keyEntities:t}}function gn(e,t,o,n){let a=new Set(o),r=n[e];if(!r)return{checkedKeys:Array.from(a)};function s(d){t?a.add(d.key):a.delete(d.key),d.children&&d.children.forEach(p=>s(p))}s(r);let c=r.parent;for(;c;)c.children&&(c.children.every(p=>a.has(p.key))?a.add(c.key):a.delete(c.key)),c=c.parent;return{checkedKeys:Array.from(a)}}var bt=require("react/jsx-runtime"),ws=({treeData:e=[],checkable:t=!1,selectable:o=!0,showLine:n=!1,showIcon:a=!1,defaultExpandedKeys:r=[],expandedKeys:s,onExpand:c,defaultSelectedKeys:d=[],selectedKeys:p,onSelect:u,defaultCheckedKeys:f=[],checkedKeys:b,onCheck:g,height:l,itemHeight:i=28,virtual:k=!1,switcherIcon:v,titleRender:C,className:w,style:T})=>{let[B,_]=(0,st.useState)(s||r),[A,I]=(0,st.useState)(p||d),[S,q]=(0,st.useState)(b||f),M=s||B,D=p||A,re=b||S,{keyEntities:Z}=(0,st.useMemo)(()=>fn(e),[e]),Y=(0,st.useMemo)(()=>un(e,M),[e,M]),j=(x,ee)=>{let R=M.includes(x)?M.filter(O=>O!==x):[...M,x];s||_(R),c&&c(R,{node:ee,expanded:!M.includes(x)})},ge=(x,ee,R)=>{let O=[x];p||I(O),u&&u(O,{node:ee,selected:!0,event:R})},se=(x,ee,R)=>{let O=!re.includes(x),{checkedKeys:ae}=gn(x,O,re,Z);b||q(ae),g&&g(ae,{node:ee,checked:O,event:R})},he=x=>{if(!x.parent){let R=e;return R[R.length-1].key===x.key}let ee=x.parent.children;return ee[ee.length-1].key===x.key},P=({index:x,style:ee})=>{let R=Y[x];if(!R)return(0,bt.jsx)("div",{style:ee});let O=[],ae=R.parent;for(;ae;)O.unshift(!he(ae)),ae=ae.parent;return(0,bt.jsx)(jo,{eventKey:R.key,title:C?C(R.data):R.title,level:R.level,expanded:M.includes(R.key),selected:D.includes(R.key),checked:re.includes(R.key),isLeaf:R.isLeaf||!R.children&&!R.data.children,checkable:t,selectable:o,disabled:R.disabled,icon:R.icon,style:ee,onExpand:()=>j(R.key,R.data),onSelect:Re=>ge(R.key,R.data,Re),onCheck:Re=>se(R.key,R.data,Re),switcherIcon:v,showLine:n,showIcon:a,indentLines:O},R.key)},N=()=>k&&l?(0,bt.jsx)(xn.List,{defaultHeight:l,rowCount:Y.length,rowHeight:i,rowComponent:P,rowProps:{},style:{width:"100%"}}):Y.map(x=>{let ee=[],R=x.parent;for(;R;)ee.unshift(!he(R)),R=R.parent;return(0,bt.jsx)(jo,{eventKey:x.key,title:C?C(x.data):x.title,level:x.level,expanded:M.includes(x.key),selected:D.includes(x.key),checked:re.includes(x.key),isLeaf:x.isLeaf||!x.children&&!x.data.children,checkable:t,selectable:o,disabled:x.disabled,icon:x.icon,onExpand:()=>j(x.key,x.data),onSelect:O=>ge(x.key,x.data,O),onCheck:O=>se(x.key,x.data,O),switcherIcon:v,showLine:n,showIcon:a,indentLines:ee},x.key)});return(0,bt.jsx)(nn,{className:`compass-tree ${w||""}`,style:T,children:N()})},yn=ws;var hn=yn;var Ft=L(require("react")),oe=require("@floating-ui/react");var bn=L(require("@emotion/styled")),vn=bn.default.div`
|
|
500
|
+
z-index: ${({theme:e})=>e?.components?.dropdown?.zIndex??1050};
|
|
501
|
+
background-color: ${({theme:e})=>e?.components?.dropdown?.backgroundColor||"#ffffff"};
|
|
502
|
+
box-shadow: ${({theme:e})=>e?.components?.dropdown?.boxShadow||"0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05)"};
|
|
503
|
+
border-radius: ${({theme:e})=>e?.components?.dropdown?.borderRadius||"4px"};
|
|
504
|
+
padding: ${({theme:e})=>e?.components?.dropdown?.padding||"4px 0"};
|
|
505
|
+
outline: 0;
|
|
506
|
+
`;var co=L(require("@emotion/styled")),Sn=co.default.div`
|
|
507
|
+
margin: 0;
|
|
508
|
+
padding: 0;
|
|
509
|
+
list-style: none;
|
|
510
|
+
`,Cn=co.default.div`
|
|
511
|
+
display: flex;
|
|
512
|
+
align-items: center;
|
|
513
|
+
margin: 0;
|
|
514
|
+
padding: ${({theme:e})=>e?.components?.menu?.itemPadding||"0 12px"};
|
|
515
|
+
height: ${({theme:e})=>e?.components?.menu?.itemHeight||"32px"};
|
|
516
|
+
color: ${({theme:e,$danger:t})=>t?e?.colors?.error||"#ff4d4f":e?.components?.menu?.itemColor||"rgba(0, 0, 0, 0.88)"};
|
|
517
|
+
font-size: ${({theme:e})=>e?.components?.menu?.fontSize||"14px"};
|
|
518
|
+
cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
|
|
519
|
+
transition: all 0.3s;
|
|
520
|
+
border-radius: ${({theme:e})=>e?.components?.menu?.borderRadius||"4px"};
|
|
521
|
+
opacity: ${({$disabled:e})=>e?.5:1};
|
|
522
|
+
|
|
523
|
+
&:hover {
|
|
524
|
+
background-color: ${({theme:e,$disabled:t,$danger:o})=>t?"transparent":o?"#fff2f0":e?.components?.menu?.itemHoverBg||"#f5f5f5"};
|
|
525
|
+
}
|
|
526
|
+
`,kn=co.default.span`
|
|
527
|
+
margin-right: 8px;
|
|
528
|
+
display: inline-flex;
|
|
529
|
+
align-items: center;
|
|
530
|
+
`;var it=require("react/jsx-runtime"),wn=({children:e,onClick:t,disabled:o,icon:n,danger:a,className:r,style:s})=>{let c=d=>{o||t?.(d)};return(0,it.jsxs)(Cn,{className:`compass-menu-item ${o?"compass-menu-item--disabled":""} ${a?"compass-menu-item--danger":""} ${r||""}`,style:s,onClick:c,$disabled:o,$danger:a,children:[n&&(0,it.jsx)(kn,{className:"compass-menu-item-icon",children:n}),(0,it.jsx)("span",{className:"compass-menu-item-content",children:e})]})},$n=({children:e,items:t,className:o,style:n,onClick:a})=>(0,it.jsx)(Sn,{className:`compass-menu ${o||""}`,style:n,children:t?t.map(r=>(0,it.jsx)(wn,{onClick:s=>{r.onClick?.(s),a?.(s,r.key)},disabled:r.disabled,danger:r.danger,icon:r.icon,className:r.className,style:r.style,children:r.label},r.key)):e});$n.Item=wn;var Pn=$n;var po=Pn;var Ve=require("react/jsx-runtime"),Mn=({children:e,overlay:t,menu:o,trigger:n="hover",placement:a="bottom-start",visible:r,onVisibleChange:s,disabled:c,className:d,style:p})=>{let[u,f]=(0,Ft.useState)(!1),b=r!==void 0,g=b?r:u,l=D=>{c||(b||f(D),s?.(D))},{refs:i,floatingStyles:k,context:v}=(0,oe.useFloating)({open:g,onOpenChange:l,placement:a,middleware:[(0,oe.offset)(4),(0,oe.flip)(),(0,oe.shift)()],whileElementsMounted:oe.autoUpdate}),C=(0,oe.useHover)(v,{enabled:n==="hover",delay:{open:0,close:100}}),w=(0,oe.useClick)(v,{enabled:n==="click"}),T=(0,oe.useDismiss)(v),B=(0,oe.useRole)(v),{getReferenceProps:_,getFloatingProps:A}=(0,oe.useInteractions)([C,w,T,B]),I=Ft.default.Children.only(e),S=I.ref,q=(0,oe.useMergeRefs)([i.setReference,S]),M=t||(o?(0,Ve.jsx)(po,{...o}):null);return M?(0,Ve.jsxs)(Ve.Fragment,{children:[Ft.default.cloneElement(I,{ref:q,..._({className:`compass-dropdown-trigger ${d||""}`,style:p,...I.props})}),g&&(0,Ve.jsx)(oe.FloatingPortal,{children:(0,Ve.jsx)(vn,{ref:i.setFloating,style:k,className:`compass-dropdown ${d||""}`,...A(),children:M})})]}):(0,Ve.jsx)(Ve.Fragment,{children:e})};Mn.displayName="Dropdown";var Tn=Mn;var Rn=Tn;var Ge=L(require("react"));var tt=L(require("@emotion/styled"));var Et=tt.default.div`
|
|
531
|
+
display: inline-flex;
|
|
532
|
+
flex-direction: column;
|
|
533
|
+
width: ${({fullWidth:e})=>e?"100%":"320px"};
|
|
534
|
+
`,Lt=tt.default.label`
|
|
535
|
+
font-size: 14px;
|
|
536
|
+
margin-bottom: 4px;
|
|
537
|
+
color: ${({theme:e})=>y(e,"colors").text};
|
|
538
|
+
`,Ot=tt.default.div`
|
|
539
|
+
font-size: 12px;
|
|
540
|
+
margin-top: 4px;
|
|
541
|
+
color: ${({theme:e,error:t})=>t?y(e,"colors").error:y(e,"colors").textSecondary};
|
|
542
|
+
`,lt=tt.default.span`
|
|
543
|
+
display: flex;
|
|
544
|
+
align-items: center;
|
|
545
|
+
justify-content: center;
|
|
546
|
+
color: ${({theme:e})=>y(e,"colors").textSecondary};
|
|
547
|
+
flex-shrink: 0;
|
|
548
|
+
line-height: 0;
|
|
549
|
+
margin-right: ${({$position:e})=>e==="start"?"8px":"0"};
|
|
550
|
+
margin-left: ${({$position:e})=>e==="end"?"8px":"0"};
|
|
551
|
+
`,Go=tt.default.button`
|
|
552
|
+
background: none;
|
|
553
|
+
border: none;
|
|
554
|
+
padding: 0;
|
|
555
|
+
margin: 0 4px 0 8px;
|
|
556
|
+
cursor: pointer;
|
|
557
|
+
color: ${({theme:e})=>y(e,"colors").textTertiary};
|
|
558
|
+
display: flex;
|
|
559
|
+
align-items: center;
|
|
560
|
+
justify-content: center;
|
|
561
|
+
font-size: 14px;
|
|
562
|
+
line-height: 0;
|
|
563
|
+
transition:
|
|
564
|
+
color 0.2s,
|
|
565
|
+
opacity 0.2s;
|
|
566
|
+
visibility: ${({visible:e})=>e?"visible":"hidden"};
|
|
567
|
+
opacity: ${({visible:e,$isHoverShow:t})=>!e||t?0:1};
|
|
568
|
+
pointer-events: ${({visible:e,$isHoverShow:t})=>!e||t?"none":"auto"};
|
|
569
|
+
|
|
570
|
+
&:hover {
|
|
571
|
+
color: ${({theme:e})=>y(e,"colors").textSecondary};
|
|
572
|
+
}
|
|
573
|
+
`,Wt=tt.default.input`
|
|
574
|
+
flex: 1;
|
|
575
|
+
border: none;
|
|
576
|
+
outline: none;
|
|
577
|
+
background: transparent;
|
|
578
|
+
padding: 0;
|
|
579
|
+
margin: 0;
|
|
580
|
+
color: ${({theme:e})=>y(e,"colors").text};
|
|
581
|
+
font-size: ${({theme:e,$size:t})=>{let o={small:"sm",medium:"md",large:"lg"};return m(e,"input").fontSize[o[t||"medium"]]}};
|
|
582
|
+
width: 100%;
|
|
583
|
+
|
|
584
|
+
&::placeholder {
|
|
585
|
+
color: ${({theme:e})=>y(e,"colors").textDisabled};
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
&:disabled {
|
|
589
|
+
cursor: not-allowed;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
&::-webkit-search-decoration,
|
|
593
|
+
&::-webkit-search-cancel-button,
|
|
594
|
+
&::-webkit-search-results-button,
|
|
595
|
+
&::-webkit-search-results-decoration {
|
|
596
|
+
-webkit-appearance: none;
|
|
597
|
+
appearance: none;
|
|
598
|
+
display: none;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
&::-ms-reveal,
|
|
602
|
+
&::-ms-clear {
|
|
603
|
+
display: none;
|
|
604
|
+
width: 0;
|
|
605
|
+
height: 0;
|
|
606
|
+
}
|
|
607
|
+
`,uo=tt.default.div`
|
|
608
|
+
display: flex;
|
|
609
|
+
align-items: center;
|
|
610
|
+
position: relative;
|
|
611
|
+
box-sizing: border-box;
|
|
612
|
+
width: 100%;
|
|
613
|
+
background-color: ${({theme:e})=>y(e,"colors").background};
|
|
614
|
+
border: 1px solid
|
|
615
|
+
${({theme:e,error:t,focused:o})=>{let n=y(e,"colors"),a=m(e,"input");return t?n.error:o?a.activeBorderColor:n.border}};
|
|
616
|
+
border-radius: ${({theme:e})=>m(e,"input").borderRadius};
|
|
617
|
+
padding: ${({theme:e,size:t})=>{let o={small:"sm",medium:"md",large:"lg"};return m(e,"input").padding[o[t||"medium"]]}};
|
|
618
|
+
transition: all 0.2s;
|
|
619
|
+
|
|
620
|
+
&:hover {
|
|
621
|
+
border-color: ${({theme:e,error:t,focused:o,disabled:n})=>{let a=y(e,"colors"),r=m(e,"input");return n?a.border:t?a.error:o?r.activeBorderColor:r.hoverBorderColor}};
|
|
622
|
+
|
|
623
|
+
.compass-input-clear-button[data-visible='true'] {
|
|
624
|
+
opacity: 1;
|
|
625
|
+
pointer-events: auto;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
${({disabled:e,theme:t})=>e&&`
|
|
630
|
+
background-color: ${y(t,"colors").backgroundSecondary};
|
|
631
|
+
cursor: not-allowed;
|
|
632
|
+
opacity: 0.6;
|
|
633
|
+
`}
|
|
634
|
+
`;var Ce=require("react/jsx-runtime"),Dn=Ge.default.forwardRef((e,t)=>{let{label:o,error:n,helperText:a,type:r="text",fullWidth:s=!1,prefix:c,suffix:d,size:p="medium",allowClear:u,className:f,style:b,disabled:g,value:l,defaultValue:i,onChange:k,onFocus:v,onBlur:C,onPressEnter:w,onKeyDown:T,...B}=e,_=(0,Ge.useRef)(null);Ge.default.useImperativeHandle(t,()=>_.current);let[A,I]=(0,Ge.useState)(!1),[S,q]=(0,Ge.useState)(!1),[M,D]=(0,Ge.useState)(i||""),re=l!==void 0,Z=re?l:M,Y=O=>{I(!0),v?.(O)},j=O=>{I(!1),C?.(O)},ge=O=>{re||D(O.target.value),k?.(O)},se=O=>{O.key==="Enter"&&w?.(O),T?.(O)},he=O=>{O.preventDefault(),O.stopPropagation();let ae={target:{value:""},currentTarget:{value:""}};re||D(""),k?.(ae),_.current?.focus()},P=O=>{O.preventDefault(),O.stopPropagation(),q(!S),_.current?.focus()},N=u&&!g&&Z&&String(Z).length>0,x=r==="password"&&S?"text":r,ee=c,R=d;return r==="password"?R=(0,Ce.jsx)(Go,{type:"button",visible:!0,onClick:P,tabIndex:-1,style:{marginLeft:8},children:S?(0,Ce.jsx)(qr,{}):(0,Ce.jsx)(jr,{})}):r==="search"&&!d&&(R=(0,Ce.jsx)(Gr,{})),(0,Ce.jsxs)(Et,{fullWidth:s,className:f,style:b,children:[o&&(0,Ce.jsx)(Lt,{children:o}),(0,Ce.jsxs)(uo,{error:!!n,disabled:g,focused:A,size:p,className:`compass-input-field compass-input-field--${p}`,children:[ee&&(0,Ce.jsx)(lt,{$position:"start",children:ee}),(0,Ce.jsx)(Wt,{ref:_,type:x,disabled:g,value:Z,onChange:ge,onFocus:Y,onBlur:j,onKeyDown:se,$size:p,...B}),u&&!g&&(0,Ce.jsx)(Go,{type:"button",className:"compass-input-clear-button",visible:!!N,$isHoverShow:!0,"data-visible":!!N,onClick:he,tabIndex:-1,children:(0,Ce.jsx)(Je,{})}),R&&(0,Ce.jsx)(lt,{$position:"end",children:R})]}),(a||n)&&(0,Ce.jsx)(Ot,{error:!!n,children:n&&typeof n!="boolean"?n:a})]})});Dn.displayName="InputField";var In=Dn;var mo=In;var ke=L(require("react")),Fn=require("react-dom"),En=require("react-dom/client"),fo=require("react-transition-group");var Vt=L(require("@emotion/styled")),At=require("@emotion/react"),$s=At.keyframes`
|
|
635
|
+
from {
|
|
636
|
+
transform: rotate(0deg);
|
|
637
|
+
}
|
|
638
|
+
to {
|
|
639
|
+
transform: rotate(360deg);
|
|
640
|
+
}
|
|
641
|
+
`,zn=Vt.default.div`
|
|
642
|
+
position: fixed;
|
|
643
|
+
top: ${({theme:e})=>e.spacing?.md||16}px;
|
|
644
|
+
left: 0;
|
|
645
|
+
width: 100%;
|
|
646
|
+
pointer-events: none;
|
|
647
|
+
z-index: ${({theme:e})=>e?.components?.message?.zIndex||1010};
|
|
648
|
+
display: flex;
|
|
649
|
+
flex-direction: column;
|
|
650
|
+
align-items: center;
|
|
651
|
+
`,Hn=Vt.default.div`
|
|
652
|
+
padding: ${({theme:e})=>e.spacing?.sm||8}px;
|
|
653
|
+
text-align: center;
|
|
654
|
+
pointer-events: all;
|
|
655
|
+
|
|
656
|
+
&.compass-message-enter {
|
|
657
|
+
opacity: 0;
|
|
658
|
+
transform: translateY(-100%);
|
|
659
|
+
}
|
|
660
|
+
&.compass-message-enter-active {
|
|
661
|
+
opacity: 1;
|
|
662
|
+
transform: translateY(0);
|
|
663
|
+
transition: ${({theme:e})=>e.transitions?.slow||"all 0.3s ease-in-out"};
|
|
664
|
+
}
|
|
665
|
+
&.compass-message-exit {
|
|
666
|
+
opacity: 1;
|
|
667
|
+
transform: translateY(0);
|
|
668
|
+
}
|
|
669
|
+
&.compass-message-exit-active {
|
|
670
|
+
opacity: 0;
|
|
671
|
+
transform: translateY(-100%);
|
|
672
|
+
transition: ${({theme:e})=>e.transitions?.slow||"all 0.3s ease-in-out"};
|
|
673
|
+
}
|
|
674
|
+
`,Bn=Vt.default.div`
|
|
675
|
+
display: inline-flex;
|
|
676
|
+
align-items: center;
|
|
677
|
+
padding: ${({theme:e})=>e?.components?.message?.contentPadding||`${e.spacing?.sm||8}px ${e.spacing?.md||16}px`};
|
|
678
|
+
background: ${({theme:e})=>e.colors?.background||"#fff"};
|
|
679
|
+
border-radius: ${({theme:e})=>e?.components?.message?.borderRadius||`${e.borderRadius?.lg||8}px`};
|
|
680
|
+
box-shadow: ${({theme:e})=>e?.components?.message?.boxShadow||e.shadows?.lg||"0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05)"};
|
|
681
|
+
font-size: ${({theme:e})=>e.fontSize?.sm||14}px;
|
|
682
|
+
line-height: ${({theme:e})=>e.lineHeight?.normal||1.5715};
|
|
683
|
+
color: ${({theme:e})=>e.colors?.text||"rgba(0, 0, 0, 0.88)"};
|
|
684
|
+
`,Nn=Vt.default.span`
|
|
685
|
+
margin-right: ${({theme:e})=>e.spacing?.sm||8}px;
|
|
686
|
+
display: inline-flex;
|
|
687
|
+
align-items: center;
|
|
688
|
+
font-size: ${({theme:e})=>e.fontSize?.md||16}px;
|
|
689
|
+
line-height: 1;
|
|
690
|
+
|
|
691
|
+
${({$type:e,theme:t})=>{let o=t?.colors?.primary||"#1890ff";switch(e){case"success":o=t?.colors?.success||"#52c41a";break;case"error":o=t?.colors?.error||"#ff4d4f";break;case"warning":o=t?.colors?.warning||"#faad14";break}return e==="loading"?At.css`
|
|
692
|
+
color: ${o};
|
|
693
|
+
.anticon {
|
|
694
|
+
display: inline-block;
|
|
695
|
+
animation: ${$s} 1s linear infinite;
|
|
696
|
+
}
|
|
697
|
+
`:At.css`
|
|
698
|
+
color: ${o};
|
|
699
|
+
`}}
|
|
700
|
+
`;var be=require("react/jsx-runtime"),Ps={info:(0,be.jsx)(Xe,{}),success:(0,be.jsx)(gt,{}),error:(0,be.jsx)(xt,{}),warning:(0,be.jsx)(yt,{}),loading:(0,be.jsx)(ao,{})},Ln=(0,ke.forwardRef)(({content:e,type:t="info",icon:o,className:n,style:a,duration:r=3,onClose:s},c)=>{let[d,p]=(0,ke.useState)(!1);return(0,ke.useEffect)(()=>{if(r<=0||d)return;let u=setTimeout(()=>{s?.()},r*1e3);return()=>clearTimeout(u)},[r,d,s]),(0,be.jsx)(Hn,{ref:c,className:`compass-message compass-message--${t} ${n||""}`,style:a,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:(0,be.jsxs)(Bn,{className:"compass-message-content",children:[(0,be.jsx)(Nn,{$type:t,children:o||Ps[t]}),e]})})});Ln.displayName="Message";var go=(0,ke.forwardRef)((e,t)=>{let[o,n]=(0,ke.useState)([]),[a]=(0,ke.useState)(()=>new Map),[r]=(0,ke.useState)(()=>typeof window<"u"?document.body:null);return(0,ke.useImperativeHandle)(t,()=>({add:s=>{s.key&&!a.has(s.key)&&a.set(s.key,ke.default.createRef()),n(c=>[...c,s])},remove:s=>{n(c=>c.filter(d=>d.key!==s)),a.delete(s)}})),r?(0,Fn.createPortal)((0,be.jsx)(zn,{children:(0,be.jsx)(fo.TransitionGroup,{component:null,children:o.map(s=>{let c=a.get(s.key);return(0,be.jsx)(fo.CSSTransition,{timeout:300,classNames:"compass-message",nodeRef:c,children:(0,be.jsx)(Ln,{ref:c,...s})},s.key)})})}),r):null});go.displayName="MessageContainerWrapper";var vt=null,Kt=null,Yt=null,Ms=()=>vt?Promise.resolve(vt):Yt||(Yt=new Promise(e=>{let t=document.createElement("div");document.body.appendChild(t),Kt=(0,En.createRoot)(t);let o=()=>(0,be.jsx)(go,{ref:n=>{n&&(vt=n,e(n))}});Kt.render((0,be.jsx)(o,{}))}),Yt),Ts=0,Rs=Date.now(),Ds=()=>`compass-message-${Rs}-${Ts++}`,Ee=e=>{let{content:t,duration:o=3,type:n="info",onClose:a,key:r=Ds(),...s}=e,c=()=>{vt&&vt.remove(r),a?.()};Ms().then(d=>{d.add({...s,key:r,content:t,duration:o,type:n,onClose:c})})},On={info:(e,t,o)=>typeof e=="object"&&e!==null&&"content"in e?Ee({...e,type:"info"}):Ee({content:e,duration:t,type:"info",onClose:o}),success:(e,t,o)=>typeof e=="object"&&e!==null&&"content"in e?Ee({...e,type:"success"}):Ee({content:e,duration:t,type:"success",onClose:o}),error:(e,t,o)=>typeof e=="object"&&e!==null&&"content"in e?Ee({...e,type:"error"}):Ee({content:e,duration:t,type:"error",onClose:o}),warning:(e,t,o)=>typeof e=="object"&&e!==null&&"content"in e?Ee({...e,type:"warning"}):Ee({content:e,duration:t,type:"warning",onClose:o}),loading:(e,t,o)=>typeof e=="object"&&e!==null&&"content"in e?Ee({...e,type:"loading"}):Ee({content:e,duration:t,type:"loading",onClose:o}),open:Ee,destroy:()=>{Kt&&(Kt.unmount(),Kt=null),vt=null,Yt=null}};var Wn=require("react");var An=require("react/jsx-runtime"),Is=0,zs=Date.now(),Hs=()=>`compass-message-hook-${zs}-${Is++}`;function Qo(){let e=(0,Wn.useRef)(null),t=a=>{if(!e.current)return;let{content:r,duration:s=3,type:c="info",onClose:d,key:p=Hs(),...u}=a,f=()=>{e.current?.remove(p),d?.()};e.current.add({...u,key:p,content:r,duration:s,type:c,onClose:f})};return[{info:(a,r,s)=>typeof a=="object"&&a!==null&&"content"in a?t({...a,type:"info"}):t({content:a,duration:r,type:"info",onClose:s}),success:(a,r,s)=>typeof a=="object"&&a!==null&&"content"in a?t({...a,type:"success"}):t({content:a,duration:r,type:"success",onClose:s}),error:(a,r,s)=>typeof a=="object"&&a!==null&&"content"in a?t({...a,type:"error"}):t({content:a,duration:r,type:"error",onClose:s}),warning:(a,r,s)=>typeof a=="object"&&a!==null&&"content"in a?t({...a,type:"warning"}):t({content:a,duration:r,type:"warning",onClose:s}),loading:(a,r,s)=>typeof a=="object"&&a!==null&&"content"in a?t({...a,type:"loading"}):t({content:a,duration:r,type:"loading",onClose:s}),open:t,destroy:a=>{a&&e.current?.remove(a)}},(0,An.jsx)(go,{ref:e},"message-holder")]}var Vn=On;Vn.useMessage=Qo;var Yn=Vn;var Zo=L(require("react")),ta=L(require("react-dom"));var Qe=L(require("@emotion/styled"));var _t=500,Kn=Qe.default.div`
|
|
701
|
+
position: fixed;
|
|
702
|
+
inset: 0;
|
|
703
|
+
z-index: ${e=>m(e.theme,"modal").zIndex||1e3};
|
|
704
|
+
pointer-events: ${e=>e.$visible?"auto":"none"};
|
|
705
|
+
`,_n=Qe.default.div`
|
|
706
|
+
position: fixed;
|
|
707
|
+
inset: 0;
|
|
708
|
+
background-color: ${e=>m(e.theme,"modal").maskColor||"rgba(0, 0, 0, 0.3)"};
|
|
709
|
+
backdrop-filter: blur(4px);
|
|
710
|
+
opacity: ${e=>e.$visible?1:0};
|
|
711
|
+
transition: opacity ${_t}ms;
|
|
712
|
+
`,qn=Qe.default.div`
|
|
713
|
+
background: ${e=>m(e.theme,"modal").contentBg||y(e.theme,"colors").background};
|
|
714
|
+
padding: ${e=>m(e.theme,"modal").bodyPadding||`${y(e.theme,"spacing").lg}px`};
|
|
715
|
+
border-radius: ${e=>m(e.theme,"modal").borderRadius||`${y(e.theme,"borderRadius").md}px`};
|
|
716
|
+
box-shadow: ${e=>m(e.theme,"modal").boxShadow||y(e.theme,"shadows").lg};
|
|
717
|
+
width: ${e=>e.$width?typeof e.$width=="number"?`${e.$width}px`:e.$width:"100%"};
|
|
718
|
+
max-width: ${e=>e.$width?"100%":"500px"};
|
|
719
|
+
margin: auto;
|
|
720
|
+
position: relative;
|
|
721
|
+
top: 120px;
|
|
722
|
+
opacity: ${e=>e.$visible?1:0};
|
|
723
|
+
transition:
|
|
724
|
+
transform ${_t}ms,
|
|
725
|
+
opacity ${_t}ms;
|
|
726
|
+
${e=>e.$visible?"transform: translateY(0)":"transform: translateY(-20px)"}
|
|
727
|
+
`,jn=Qe.default.div`
|
|
728
|
+
display: flex;
|
|
729
|
+
align-items: center;
|
|
730
|
+
justify-content: space-between;
|
|
731
|
+
margin-bottom: ${e=>y(e.theme,"spacing").md}px;
|
|
732
|
+
`,Gn=Qe.default.div`
|
|
733
|
+
font-size: ${e=>y(e.theme,"fontSize").lg}px;
|
|
734
|
+
font-weight: ${e=>y(e.theme,"fontWeight").bold};
|
|
735
|
+
color: ${e=>y(e.theme,"colors").text};
|
|
736
|
+
line-height: 1.5;
|
|
737
|
+
`,Qn=(0,Qe.default)(Se)``,Un=Qe.default.div`
|
|
738
|
+
display: flex;
|
|
739
|
+
width: 100%;
|
|
740
|
+
justify-content: flex-end;
|
|
741
|
+
margin-top: ${e=>y(e.theme,"spacing").md}px;
|
|
742
|
+
`,Uo=(0,Qe.default)(Se)`
|
|
743
|
+
padding: 4px 18px;
|
|
744
|
+
margin: 0;
|
|
745
|
+
`;var Xn={...ue,colors:{...ue.colors,primary:"#177ddc",primaryHover:"#1765ad",primaryActive:"#165996",text:"rgba(255, 255, 255, 0.85)",textSecondary:"rgba(255, 255, 255, 0.45)",textTertiary:"rgba(255, 255, 255, 0.25)",textDisabled:"rgba(255, 255, 255, 0.15)",background:"#141414",backgroundSecondary:"#1f1f1f",backgroundTertiary:"#2f2f2f",border:"#434343",borderSecondary:"#303030",borderHover:"#177ddc",success:"#49aa19",warning:"#d89614",error:"#a61d24",info:"#177ddc"},shadows:{...ue.shadows,sm:"0 1px 2px rgba(0, 0, 0, 0.3)",md:"0 1px 6px rgba(0, 0, 0, 0.3)",lg:"0 4px 12px rgba(0, 0, 0, 0.4)",xl:"0 8px 24px rgba(0, 0, 0, 0.4)"},components:{...ue.components,modal:{...ue.components.modal,contentBg:"#1f1f1f",boxShadow:"0 3px 6px -4px rgba(0, 0, 0, 0.48), 0 6px 16px 0 rgba(0, 0, 0, 0.32), 0 9px 28px 8px rgba(0, 0, 0, 0.2)"},message:{...ue.components.message,boxShadow:"0 3px 6px -4px rgba(0, 0, 0, 0.48), 0 6px 16px 0 rgba(0, 0, 0, 0.32), 0 9px 28px 8px rgba(0, 0, 0, 0.2)"},progress:{...ue.components.progress,trackColor:"#303030"},steps:{...ue.components.steps,descriptionColor:"rgba(255, 255, 255, 0.45)",titleColor:"rgba(255, 255, 255, 0.65)",subTitleColor:"rgba(255, 255, 255, 0.45)",waitIconColor:"rgba(255, 255, 255, 0.25)",processIconColor:"#177ddc",finishIconColor:"#177ddc",errorIconColor:"#a61d24",waitTitleColor:"rgba(255, 255, 255, 0.45)",processTitleColor:"rgba(255, 255, 255, 0.85)",finishTitleColor:"rgba(255, 255, 255, 0.65)",errorTitleColor:"#a61d24",waitDescriptionColor:"rgba(255, 255, 255, 0.45)",processDescriptionColor:"rgba(255, 255, 255, 0.65)",finishDescriptionColor:"rgba(255, 255, 255, 0.45)",errorDescriptionColor:"#a61d24"},input:{...ue.components.input,activeBorderColor:"#177ddc",hoverBorderColor:"#177ddc"}}};var Ye=require("react"),Jn=require("@emotion/react");var Xo=require("react/jsx-runtime"),Bs=(0,Ye.createContext)(void 0),Ns=({children:e,theme:t,lightTheme:o,darkTheme:n,defaultMode:a="light"})=>{let[r,s]=(0,Ye.useState)(a);(0,Ye.useEffect)(()=>{s(a)},[a]);let c=(0,Ye.useMemo)(()=>{let u=r==="dark"?Xn:ue;return((...g)=>{let l={...u};return g.forEach(i=>{i&&(i.colors&&(l.colors={...l.colors,...i.colors}),i.spacing&&(l.spacing={...l.spacing,...i.spacing}),i.borderRadius&&(l.borderRadius={...l.borderRadius,...i.borderRadius}),i.fontSize&&(l.fontSize={...l.fontSize,...i.fontSize}),i.fontWeight&&(l.fontWeight={...l.fontWeight,...i.fontWeight}),i.lineHeight&&(l.lineHeight={...l.lineHeight,...i.lineHeight}),i.shadows&&(l.shadows={...l.shadows,...i.shadows}),i.transitions&&(l.transitions={...l.transitions,...i.transitions}),i.breakpoints&&(l.breakpoints={...l.breakpoints,...i.breakpoints}),i.components&&(l.components={...l.components,button:i.components.button?{...l.components.button,padding:{...l.components.button.padding,...i.components.button.padding},fontSize:{...l.components.button.fontSize,...i.components.button.fontSize},borderRadius:{...l.components.button.borderRadius,...i.components.button.borderRadius}}:l.components.button,message:{...l.components.message,...i.components.message},modal:{...l.components.modal,...i.components.modal},progress:{...l.components.progress,...i.components.progress},steps:{...l.components.steps,...i.components.steps},input:i.components.input?{...l.components.input,...i.components.input,padding:{...l.components.input.padding,...i.components.input.padding},fontSize:{...l.components.input.fontSize,...i.components.input.fontSize}}:l.components.input}),i.components?.dropdown&&(l.components.dropdown={...l.components.dropdown,...i.components.dropdown}),i.components?.menu&&(l.components.menu={...l.components.menu,...i.components.menu}),i.components?.datePicker&&(l.components.datePicker={...l.components.datePicker,...i.components.datePicker}),i.components?.select&&(l.components.select={...l.components.select,...i.components.select,padding:{...l.components.select.padding,...i.components.select?.padding},fontSize:{...l.components.select.fontSize,...i.components.select?.fontSize}}),i.components?.pagination&&(l.components.pagination={...l.components.pagination,...i.components.pagination}),i.components?.tree&&(l.components.tree={...l.components.tree,...i.components.tree}))}),l})(t,r==="dark"?n:o)},[r,t,o,n]),d=()=>{s(u=>u==="light"?"dark":"light")},p=(0,Ye.useMemo)(()=>({mode:r,setMode:s,toggleTheme:d,theme:c}),[r,c]);return(0,Xo.jsx)(Bs.Provider,{value:p,children:(0,Xo.jsx)(Jn.ThemeProvider,{theme:c,children:e})})};var qt=Ns;var xo=require("react"),yo=(0,xo.createContext)({locale:void 0}),Me=()=>(0,xo.useContext)(yo);var Jo=require("react/jsx-runtime"),Fs=e=>{let{children:t,locale:o,theme:n}=e;return(0,Jo.jsx)(yo.Provider,{value:{locale:o},children:(0,Jo.jsx)(qt,{theme:n?.token,lightTheme:n?.light,darkTheme:n?.dark,defaultMode:n?.defaultMode,children:t})})},Zn=Fs;var ea=Zn;var Es={locale:"zh-CN",Modal:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",justOkText:"\u77E5\u9053\u4E86"},DatePicker:{monthBeforeYear:!1,yearFormat:"yyyy\u5E74",monthFormat:"M\u6708",quarterFormat:"yyyy\u5E74\u7B2CQ\u5B63\u5EA6",weekFormat:"yyyy\u5E74\u7B2Cw\u5468",today:"\u4ECA\u5929",now:"\u6B64\u523B",backToToday:"\u8FD4\u56DE\u4ECA\u5929",ok:"\u786E\u5B9A",timeSelect:"\u9009\u62E9\u65F6\u95F4",dateSelect:"\u9009\u62E9\u65E5\u671F",weekSelect:"\u9009\u62E9\u5468",clear:"\u6E05\u9664",month:"\u6708",year:"\u5E74",previousMonth:"\u4E0A\u4E2A\u6708",nextMonth:"\u4E0B\u4E2A\u6708",monthSelect:"\u9009\u62E9\u6708\u4EFD",yearSelect:"\u9009\u62E9\u5E74\u4EFD",decadeSelect:"\u9009\u62E9\u5E74\u4EE3",dayFormat:"d",dateFormat:"yyyy\u5E74M\u6708d\u65E5",dateTimeFormat:"yyyy\u5E74M\u6708d\u65E5 HH:mm:ss",previousYear:"\u4E0A\u4E00\u5E74",nextYear:"\u4E0B\u4E00\u5E74",previousDecade:"\u4E0A\u4E00\u5E74\u4EE3",nextDecade:"\u4E0B\u4E00\u5E74\u4EE3",previousCentury:"\u4E0A\u4E00\u4E16\u7EAA",nextCentury:"\u4E0B\u4E00\u4E16\u7EAA",shortWeekDays:["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u65E5"],weekDays:["\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D","\u661F\u671F\u65E5"],months:["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"],shortMonths:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],hour:"\u65F6",minute:"\u5206",second:"\u79D2",startDate:"\u5F00\u59CB\u65E5\u671F",endDate:"\u7ED3\u675F\u65E5\u671F"},Pagination:{items_per_page:"\u6761/\u9875",jump_to:"\u8DF3\u81F3",jump_to_confirm:"\u786E\u5B9A",page:"\u9875",prev_page:"\u4E0A\u4E00\u9875",next_page:"\u4E0B\u4E00\u9875",prev_5:"\u5411\u524D 5 \u9875",next_5:"\u5411\u540E 5 \u9875",prev_3:"\u5411\u524D 3 \u9875",next_3:"\u5411\u540E 3 \u9875"}},Le=Es;var we=require("react/jsx-runtime"),Ls=e=>{let{isOpen:t,maskVisible:o=!0,footer:n,onCancel:a,children:r,className:s,style:c,title:d,closable:p=!0,onOk:u,okText:f="\u786E\u5B9A",cancelText:b="\u53D6\u6D88",confirmLoading:g,afterClose:l,...i}=e,{locale:k}=Me(),v=k?.Modal||Le.Modal,C=f==="\u786E\u5B9A"?v.okText:f,w=b==="\u53D6\u6D88"?v.cancelText:b,[T,B]=Zo.default.useState(!1);Zo.default.useEffect(()=>{t||B(!1)},[t]);let _=async I=>{if(!u)return;let S=u(I);if(S&&typeof S.then=="function"){B(!0);try{await S,B(!1),a&&a(I)}catch(q){throw B(!1),console.error(q),q}}else a&&a(I)},A=I=>{!t&&I.target===I.currentTarget&&l?.()};return(0,we.jsxs)(Kn,{className:`compass-modal ${s||""}`,$visible:t,style:c,role:"dialog","aria-modal":"true",...i,children:[o&&(0,we.jsx)(_n,{className:"compass-modal-mask",onClick:a,"aria-hidden":"true",$visible:t}),(0,we.jsxs)(qn,{className:"compass-modal-content",$visible:t,$width:e.width,onTransitionEnd:A,children:[(d||p)&&(0,we.jsxs)(jn,{className:"compass-modal-header",children:[(0,we.jsx)(Gn,{className:"compass-modal-title",children:d}),p&&(0,we.jsx)(Qn,{className:"compass-modal-close",onClick:a,"aria-label":"Close",variant:"text",shape:"circle",icon:(0,we.jsx)(ht,{})})]}),(0,we.jsx)("div",{className:"compass-modal-body",children:r}),n===void 0?(0,we.jsxs)(Un,{className:"compass-modal-footer",children:[(0,we.jsx)(Uo,{onClick:a,"aria-label":"Close modal",children:w}),(0,we.jsx)(Uo,{onClick:_,style:{marginLeft:12},variant:"primary",loading:g||T,children:C})]}):n]})]})},Os=e=>{let{children:t,...o}=e;return ta.default.createPortal((0,we.jsx)(Ls,{...o,children:t}),document.body)},St=Os;var oa=require("react-dom/client");var ct=L(require("@emotion/styled")),ho=ct.default.div`
|
|
746
|
+
display: flex;
|
|
747
|
+
align-items: flex-start;
|
|
748
|
+
`,bo=ct.default.div`
|
|
749
|
+
margin-right: 12px;
|
|
750
|
+
font-size: 22px;
|
|
751
|
+
line-height: 1;
|
|
752
|
+
color: ${e=>{switch(e.$type){case"info":case"confirm":return"#1677ff";case"success":return"#52c41a";case"error":return"#ff4d4f";case"warning":return"#faad14";default:return"#1677ff"}}};
|
|
753
|
+
`,vo=ct.default.div`
|
|
754
|
+
flex: 1;
|
|
755
|
+
`,So=ct.default.div`
|
|
756
|
+
color: rgba(0, 0, 0, 0.88);
|
|
757
|
+
font-weight: 600;
|
|
758
|
+
font-size: 16px;
|
|
759
|
+
line-height: 1.5;
|
|
760
|
+
margin-bottom: 8px;
|
|
761
|
+
`,Co=ct.default.div`
|
|
762
|
+
color: rgba(0, 0, 0, 0.88);
|
|
763
|
+
font-size: 14px;
|
|
764
|
+
line-height: 1.5;
|
|
765
|
+
`,ko=ct.default.div`
|
|
766
|
+
display: flex;
|
|
767
|
+
justify-content: flex-end;
|
|
768
|
+
gap: 8px;
|
|
769
|
+
margin-top: 24px;
|
|
770
|
+
`;var ye=require("react/jsx-runtime"),jt=e=>{let t=document.createElement("div");document.body.appendChild(t);let o=(0,oa.createRoot)(t),n={...e,isOpen:!1,confirmLoading:!1},a=()=>{o.unmount(),t.parentNode&&t.parentNode.removeChild(t)},r=s=>{let{onOk:c,onCancel:d,title:p,content:u,icon:f,type:b="confirm",okText:g=Le.Modal.okText,cancelText:l=Le.Modal.cancelText,closable:i=!1,confirmLoading:k,...v}=s,C=async()=>{if(c){let A=c();if(A&&typeof A.then=="function"){n={...n,confirmLoading:!0},r(n);try{await A,T()}catch(I){throw n={...n,confirmLoading:!1},r(n),console.error("Modal confirm error",I),I}}else T()}else T()},w=async()=>{d&&await d(),T()},T=()=>{n={...n,isOpen:!1,confirmLoading:!1},r(n),setTimeout(()=>{a()},_t)},_={info:(0,ye.jsx)(Xe,{}),success:(0,ye.jsx)(gt,{}),error:(0,ye.jsx)(xt,{}),warning:(0,ye.jsx)(yt,{})}[b]||(0,ye.jsx)(Xe,{});o.render((0,ye.jsx)(qt,{theme:ue,children:(0,ye.jsx)(St,{...v,width:416,closable:i,onCancel:w,footer:(0,ye.jsxs)(ko,{children:[b==="confirm"?(0,ye.jsx)(Se,{onClick:w,children:l}):null,(0,ye.jsx)(Se,{variant:"primary",onClick:C,loading:k,children:g})]}),children:(0,ye.jsxs)(ho,{children:[(0,ye.jsx)(bo,{$type:b,children:f||_}),(0,ye.jsxs)(vo,{children:[p&&(0,ye.jsx)(So,{children:p}),u&&(0,ye.jsx)(Co,{children:u})]})]})})}))};return r(n),setTimeout(()=>{n={...n,isOpen:!0},r(n)},10),{destroy:close,update:s=>{n={...n,...s},r(n)}}},ra=e=>jt({...e,type:"info"}),na=e=>jt({...e,type:"success"}),aa=e=>jt({...e,type:"error"}),sa=e=>jt({...e,type:"warning"}),Ws=e=>jt({...e,type:"confirm"}),ia=Ws;var Ke=L(require("react"));var ie=require("react/jsx-runtime"),As=({afterClose:e,closeModal:t,onOk:o,onCancel:n,title:a,content:r,icon:s,type:c="info",okText:d="OK",cancelText:p="Cancel",isOpen:u,confirmLoading:f,...b})=>{let[g,l]=(0,Ke.useState)(!1),{locale:i}=Me(),k=i?.Modal||Le.Modal,v=d==="OK"?k.okText:d,C=p==="Cancel"?k.cancelText:p,w=async()=>{if(o){let A=o();if(A&&typeof A.then=="function"){l(!0);try{await A,l(!1),t()}catch(I){throw l(!1),console.error(I),I}}else t()}else t()},T=async()=>{n&&await n(),t()},_={info:(0,ie.jsx)(Xe,{}),success:(0,ie.jsx)(gt,{}),error:(0,ie.jsx)(xt,{}),warning:(0,ie.jsx)(yt,{})}[c]||(0,ie.jsx)(Xe,{});return(0,ie.jsx)(St,{...b,afterClose:e,closable:b.closable??!1,width:416,isOpen:!!u,onCancel:T,footer:(0,ie.jsxs)(ko,{children:[c==="confirm"?(0,ie.jsx)(Se,{onClick:T,children:C}):null,(0,ie.jsx)(Se,{variant:"primary",onClick:w,loading:f||g,children:v})]}),children:(0,ie.jsxs)(ho,{children:[(0,ie.jsx)(bo,{$type:c,children:s||_}),(0,ie.jsxs)(vo,{children:[a&&(0,ie.jsx)(So,{children:a}),r&&(0,ie.jsx)(Co,{children:r})]})]})})},la=Ke.default.forwardRef((e,t)=>{let[o,n]=(0,Ke.useState)(new Map);return(0,Ke.useImperativeHandle)(t,()=>({patchElement:(a,r)=>{n(s=>{let c=new Map(s);return c.set(a,r),c})},removeElement:a=>{n(r=>{let s=new Map(r);return s.delete(a),s})}})),(0,ie.jsx)(ie.Fragment,{children:Array.from(o.values())})});la.displayName="ElementsHolder";function er(){let e=(0,Ke.useRef)(null),[t,o]=(0,Ke.useState)(null);t||o((0,ie.jsx)(la,{ref:e}));let n=r=>s=>{let c=Math.random().toString(36).substring(2),p={...r(s),isOpen:!1},u=()=>{p={...p,isOpen:!1},f(p)},f=b=>{e.current&&e.current.patchElement(c,(0,ie.jsx)(As,{...b,type:b.type||"info",isOpen:!!b.isOpen,closeModal:u,afterClose:()=>{e.current&&e.current.removeElement(c)}},c))};return f(p),setTimeout(()=>{p={...p,isOpen:!0},f(p)},10),{destroy:u,update:b=>{p={...p,...b},f(p)}}};return[{info:n(r=>({...r,type:"info"})),success:n(r=>({...r,type:"success"})),error:n(r=>({...r,type:"error"})),warning:n(r=>({...r,type:"warning"})),confirm:n(r=>({...r,type:"confirm"}))},t]}var pt=St;pt.info=ra;pt.success=na;pt.error=aa;pt.warning=sa;pt.confirm=ia;pt.useModal=er;var ca=pt;var Sa=L(require("react"));var va=L(require("react"));var Oe=L(require("@emotion/styled")),pa=Oe.default.div`
|
|
771
|
+
display: flex;
|
|
772
|
+
align-items: center;
|
|
773
|
+
gap: ${({theme:e})=>e?.spacing?.sm||8}px;
|
|
774
|
+
${({size:e})=>typeof e=="object"&&"width"in e?`width: ${e.width}px;`:""}
|
|
775
|
+
`,da=Oe.default.div`
|
|
776
|
+
flex: 1;
|
|
777
|
+
background-color: ${({theme:e})=>e?.components?.progress?.trackColor||e?.colors?.backgroundSecondary||"#fafafa"};
|
|
778
|
+
border-radius: ${({theme:e})=>e?.borderRadius?.xl||12}px;
|
|
779
|
+
overflow: hidden;
|
|
780
|
+
height: ${({size:e})=>{if(typeof e=="number")return`${e}px`;if(typeof e=="object"&&"height"in e)return`${e.height}px`;switch(e){case"small":return"4px";case"large":return"12px";case"medium":default:return"8px"}}};
|
|
781
|
+
${({size:e})=>typeof e=="object"&&"width"in e?`width: ${e.width}px; flex: none;`:""}
|
|
782
|
+
`,ua=Oe.default.div`
|
|
783
|
+
height: 100%;
|
|
784
|
+
border-radius: inherit;
|
|
785
|
+
transition: ${({theme:e})=>e?.transitions?.normal||"all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)"};
|
|
786
|
+
width: ${({percent:e})=>Math.min(Math.max(e,0),100)}%;
|
|
787
|
+
background: ${({strokeColor:e,status:t,theme:o})=>{if(e)return e;switch(t){case"success":return o?.components?.progress?.successColor||o?.colors?.success||"#52c41a";case"error":return o?.components?.progress?.errorColor||o?.colors?.error||"#ff4d4f";case"warning":return o?.components?.progress?.warningColor||o?.colors?.warning||"#faad14";default:return o?.components?.progress?.infoColor||o?.colors?.primary||"#1890ff"}}};
|
|
788
|
+
`,ma=Oe.default.span`
|
|
789
|
+
font-size: ${({size:e,theme:t})=>{switch(e){case"small":return t?.fontSize?.xs||12;case"large":return t?.fontSize?.md||16;case"medium":default:return t?.fontSize?.sm||14}}}px;
|
|
790
|
+
color: ${({theme:e})=>e?.colors?.text||"rgba(0, 0, 0, 0.88)"};
|
|
791
|
+
white-space: nowrap;
|
|
792
|
+
min-width: ${({size:e})=>{switch(e){case"small":return"28px";case"large":return"36px";case"medium":default:return"32px"}}};
|
|
793
|
+
text-align: right;
|
|
794
|
+
`,fa=Oe.default.div`
|
|
795
|
+
display: inline-block;
|
|
796
|
+
width: ${({width:e})=>e}px;
|
|
797
|
+
height: ${({width:e})=>e}px;
|
|
798
|
+
`,ga=Oe.default.svg`
|
|
799
|
+
transform: rotate(-90deg);
|
|
800
|
+
width: 100%;
|
|
801
|
+
height: 100%;
|
|
802
|
+
`,xa=Oe.default.circle`
|
|
803
|
+
fill: none;
|
|
804
|
+
stroke: ${({theme:e})=>e?.components?.progress?.trackColor||e?.colors?.backgroundSecondary||"#fafafa"};
|
|
805
|
+
`,ya=Oe.default.circle`
|
|
806
|
+
fill: none;
|
|
807
|
+
transition: ${({theme:e})=>e?.transitions?.normal||"all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)"};
|
|
808
|
+
stroke: ${({strokeColor:e,status:t,theme:o})=>{if(e)return e;switch(t){case"success":return o?.components?.progress?.successColor||o?.colors?.success||"#52c41a";case"error":return o?.components?.progress?.errorColor||o?.colors?.error||"#ff4d4f";case"warning":return o?.components?.progress?.warningColor||o?.colors?.warning||"#faad14";default:return o?.components?.progress?.infoColor||o?.colors?.primary||"#1890ff"}}};
|
|
809
|
+
stroke-linecap: round;
|
|
810
|
+
`,ha=Oe.default.div`
|
|
811
|
+
position: absolute;
|
|
812
|
+
top: 50%;
|
|
813
|
+
left: 50%;
|
|
814
|
+
transform: translate(-50%, -50%);
|
|
815
|
+
text-align: center;
|
|
816
|
+
font-size: ${({size:e,theme:t,width:o})=>e==="small"||o<60?t?.fontSize?.xs||12:e==="large"||o>120?t?.fontSize?.md||16:t?.fontSize?.sm||14}px;
|
|
817
|
+
color: ${({theme:e})=>e?.colors?.text||"rgba(0, 0, 0, 0.88)"};
|
|
818
|
+
white-space: nowrap;
|
|
819
|
+
`,ba=Oe.default.div`
|
|
820
|
+
position: relative;
|
|
821
|
+
display: inline-block;
|
|
822
|
+
`;var tr=require("react"),wo=e=>Math.min(Math.max(e,0),100),$o=(e,t)=>(0,tr.useMemo)(()=>e!=="normal"?e:t===100?"success":"normal",[e,t]),Po=(e,t,o,n)=>(0,tr.useMemo)(()=>o?o(e):t==="success"&&n&&e===100?n:`${Math.round(e)}%`,[o,e,t,n]);var Ct=require("react/jsx-runtime"),or=va.default.forwardRef(({percent:e=0,size:t="medium",status:o="normal",showInfo:n=!0,format:a,strokeColor:r,trailColor:s,success:c,className:d,style:p,...u},f)=>{let b=wo(e),g=$o(o,b),l=Po(b,g,a,c);return(0,Ct.jsxs)(pa,{ref:f,className:`compass-progress compass-progress--line ${d||""}`,style:p,size:t,status:g,role:"progressbar","aria-valuenow":b,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Progress ${b}%`,...u,children:[(0,Ct.jsx)(da,{size:t,status:g,style:{...s?{backgroundColor:s}:{}},children:(0,Ct.jsx)(ua,{percent:b,size:t,status:g,strokeColor:typeof r=="string"?r:void 0,style:{background:typeof r=="object"?`linear-gradient(${r.direction||"to right"}, ${r.from}, ${r.to})`:void 0}})}),n&&(0,Ct.jsx)(ma,{size:t,status:g,children:l})]})});or.displayName="LinearProgress";var kt=L(require("react"));var ze=require("react/jsx-runtime"),rr=kt.default.forwardRef(({percent:e=0,size:t="medium",status:o="normal",showInfo:n=!0,format:a,strokeWidth:r,strokeColor:s,trailColor:c,success:d,gapDegree:p,gapPosition:u="top",className:f,style:b,...g},l)=>{let i=wo(e),k=$o(o,i),v=Po(i,k,a,d),C=(0,kt.useMemo)(()=>{if(typeof t=="number")return t;switch(t){case"small":return 80;case"medium":return 120;case"large":return 160;default:return 120}},[t]),w=r??(t==="small"?4:t==="large"?8:6),T=(C-w)/2,B=2*Math.PI*T,_=B,A=B-i/100*B,I=(0,kt.useId)(),S=typeof s=="object",q=Math.max(0,Math.min(295,p||0)),M=B*((360-q)/360),D=`${M} ${B}`,re=0,Z=M*(1-i/100),Y=()=>`rotate(${(u==="bottom"?90:u==="left"?180:u==="right"?0:-90)+q/2}deg)`;return(0,ze.jsxs)(ba,{ref:l,className:`compass-progress compass-progress--circle ${f||""}`,style:b,role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Progress ${i}%`,...g,children:[(0,ze.jsx)(fa,{width:C,children:(0,ze.jsxs)(ga,{style:p?{transform:Y()}:void 0,children:[(0,ze.jsx)(xa,{cx:C/2,cy:C/2,r:T,strokeWidth:w,strokeDasharray:p?D:void 0,strokeDashoffset:p?re:void 0,style:{stroke:c}}),(0,ze.jsx)(ya,{cx:C/2,cy:C/2,r:T,strokeWidth:w,strokeDasharray:p?D:_,strokeDashoffset:p?Z:A,status:k,strokeColor:typeof s=="string"?s:void 0,style:{stroke:S?`url(#${I})`:void 0,transition:"stroke-dashoffset 0.3s ease 0s, stroke-dasharray 0.3s ease 0s, stroke 0.3s"}}),typeof s=="object"&&(0,ze.jsx)("defs",{children:(0,ze.jsxs)("linearGradient",{id:I,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,ze.jsx)("stop",{offset:"0%",stopColor:s.from}),(0,ze.jsx)("stop",{offset:"100%",stopColor:s.to})]})})]})}),n&&(0,ze.jsx)(ha,{width:C,size:t,children:v})]})});rr.displayName="CircleProgress";var nr=require("react/jsx-runtime"),ar=Sa.default.forwardRef(({type:e="line",...t},o)=>e==="circle"?(0,nr.jsx)(rr,{ref:o,...t}):(0,nr.jsx)(or,{ref:o,...t}));ar.displayName="Progress";var Ca=ar;var He=L(require("react")),J=require("@floating-ui/react");var sr=L(require("react")),ir=sr.default.createContext(null),ka=()=>{let e=sr.default.useContext(ir);if(!e)throw new Error("Select compounds must be used within a Select component");return e};var Na=require("react");var Te=L(require("@emotion/styled")),wa=require("@emotion/react"),Vs=wa.keyframes`
|
|
823
|
+
from {
|
|
824
|
+
transform: rotate(0deg);
|
|
825
|
+
}
|
|
826
|
+
to {
|
|
827
|
+
transform: rotate(360deg);
|
|
828
|
+
}
|
|
829
|
+
`,$a=Te.default.span`
|
|
830
|
+
display: inline-flex;
|
|
831
|
+
animation: ${Vs} 1s linear infinite;
|
|
832
|
+
`,Pa=Te.default.div`
|
|
833
|
+
position: relative;
|
|
834
|
+
display: inline-flex;
|
|
835
|
+
width: ${({fullWidth:e})=>e?"100%":"auto"};
|
|
836
|
+
min-width: 120px;
|
|
837
|
+
opacity: ${({disabled:e})=>e?.5:1};
|
|
838
|
+
pointer-events: ${({disabled:e})=>e?"none":"auto"};
|
|
839
|
+
cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
|
|
840
|
+
`,Ma=Te.default.div`
|
|
841
|
+
display: flex;
|
|
842
|
+
align-items: center;
|
|
843
|
+
justify-content: space-between;
|
|
844
|
+
width: 100%;
|
|
845
|
+
padding: ${({size:e,theme:t})=>{let o=t.components?.select?.padding;switch(e){case"small":return o?.sm||"1px 8px";case"large":return o?.lg||"6px 16px";default:return o?.md||"3px 12px"}}};
|
|
846
|
+
font-size: ${({size:e,theme:t})=>{let o=t.components?.select?.fontSize;return e==="small"?o?.sm||"12px":o?.md||"14px"}};
|
|
847
|
+
line-height: 1.5;
|
|
848
|
+
background-color: ${({theme:e})=>e.components?.select?.backgroundColor||e.colors?.background||"#fff"};
|
|
849
|
+
border: 1px solid
|
|
850
|
+
${({theme:e,active:t,status:o})=>o==="error"?e.colors?.error||"#f5222d":o==="warning"?e.colors?.warning||"#faad14":t?e.components?.select?.activeBorderColor||e.colors?.primary||"#1890ff":e.components?.select?.borderColor||e.colors?.border||"#d9d9d9"};
|
|
851
|
+
border-radius: ${({theme:e})=>e.components?.select?.borderRadius||(e.borderRadius?.md?`${e.borderRadius.md}px`:"4px")};
|
|
852
|
+
transition: all 0.3s;
|
|
853
|
+
box-shadow: ${({active:e,theme:t})=>e?`0 0 0 2px ${t.colors?.primary||"#1890ff"}20`:"none"};
|
|
854
|
+
|
|
855
|
+
&:hover {
|
|
856
|
+
border-color: ${({theme:e,status:t})=>{if(!t)return e.components?.select?.hoverBorderColor||e.colors?.primary||"#1890ff"}};
|
|
857
|
+
}
|
|
858
|
+
`,Ta=Te.default.div`
|
|
859
|
+
position: relative;
|
|
860
|
+
flex: 1;
|
|
861
|
+
overflow: hidden;
|
|
862
|
+
text-overflow: ellipsis;
|
|
863
|
+
white-space: nowrap;
|
|
864
|
+
margin-right: 8px;
|
|
865
|
+
display: flex;
|
|
866
|
+
flex-wrap: wrap;
|
|
867
|
+
align-items: center;
|
|
868
|
+
gap: 4px;
|
|
869
|
+
min-height: ${({size:e})=>e==="small"?"20px":e==="large"?"26px":"24px"};
|
|
870
|
+
`,Gt=Te.default.span`
|
|
871
|
+
color: ${({theme:e})=>e.components?.select?.placeholderColor||e.colors?.textSecondary||"#bfbfbf"};
|
|
872
|
+
`,Ra=Te.default.div`
|
|
873
|
+
padding: 4px 0;
|
|
874
|
+
background-color: ${({theme:e})=>e.colors?.background||"#fff"};
|
|
875
|
+
border-radius: ${({theme:e})=>e.borderRadius?.md?`${e.borderRadius.md}px`:"4px"};
|
|
876
|
+
box-shadow:
|
|
877
|
+
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
878
|
+
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
879
|
+
0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
880
|
+
z-index: 1050;
|
|
881
|
+
max-height: 256px;
|
|
882
|
+
overflow-y: auto;
|
|
883
|
+
`,Da=Te.default.div`
|
|
884
|
+
padding: 0 12px;
|
|
885
|
+
min-height: 32px;
|
|
886
|
+
cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
|
|
887
|
+
transition: all 0.3s;
|
|
888
|
+
background-color: ${({selected:e,active:t,theme:o})=>e?o.components?.select?.optionSelectedBg||"#e6f7ff":t?o.components?.select?.optionHoverBg||"#e6e6e6":"transparent"};
|
|
889
|
+
color: ${({selected:e,disabled:t,theme:o})=>t?o.colors?.textDisabled||"#00000040":e?o.components?.select?.optionSelectedColor||o.colors?.text||"rgba(0, 0, 0, 0.88)":o.components?.select?.optionColor||o.colors?.text||"rgba(0, 0, 0, 0.88)"};
|
|
890
|
+
|
|
891
|
+
.compass-icon-check {
|
|
892
|
+
color: ${({theme:e,selected:t})=>t?e.colors?.primary||"#1890ff":"inherit"};
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
font-weight: 400;
|
|
896
|
+
display: flex;
|
|
897
|
+
align-items: center;
|
|
898
|
+
justify-content: space-between;
|
|
899
|
+
|
|
900
|
+
&:hover {
|
|
901
|
+
background-color: ${({disabled:e,selected:t,theme:o})=>e?"transparent":t?o.components?.select?.optionSelectedBg||"#e6f7ff":o.components?.select?.optionHoverBg||"#e6e6e6"};
|
|
902
|
+
}
|
|
903
|
+
`,Ia=Te.default.span`
|
|
904
|
+
display: inline-flex;
|
|
905
|
+
align-items: center;
|
|
906
|
+
height: 24px;
|
|
907
|
+
padding: 0 8px;
|
|
908
|
+
font-size: 12px;
|
|
909
|
+
line-height: normal;
|
|
910
|
+
background: ${({theme:e})=>e.components?.select?.tagBg||e.colors?.backgroundSecondary||"#f5f5f5"};
|
|
911
|
+
color: ${({theme:e})=>e.components?.select?.tagColor||"inherit"};
|
|
912
|
+
border: ${({theme:e})=>e.components?.select?.tagBorderColor?`1px solid ${e.components.select.tagBorderColor}`:"none"};
|
|
913
|
+
border-radius: 4px;
|
|
914
|
+
margin-right: 4px;
|
|
915
|
+
margin-top: 1px;
|
|
916
|
+
margin-bottom: 1px;
|
|
917
|
+
|
|
918
|
+
/* Select text span inside */
|
|
919
|
+
& > span {
|
|
920
|
+
display: flex;
|
|
921
|
+
align-items: center;
|
|
922
|
+
height: 100%;
|
|
923
|
+
}
|
|
924
|
+
`,za=Te.default.span`
|
|
925
|
+
margin-left: 4px;
|
|
926
|
+
cursor: pointer;
|
|
927
|
+
font-size: 12px;
|
|
928
|
+
width: 16px;
|
|
929
|
+
height: 16px;
|
|
930
|
+
display: flex;
|
|
931
|
+
align-items: center;
|
|
932
|
+
justify-content: center;
|
|
933
|
+
border-radius: 50%;
|
|
934
|
+
color: ${({theme:e})=>e.colors?.textSecondary||"rgba(0, 0, 0, 0.45)"};
|
|
935
|
+
line-height: 0;
|
|
936
|
+
transform: scale(0.8);
|
|
937
|
+
|
|
938
|
+
&:hover {
|
|
939
|
+
color: ${({theme:e})=>e.colors?.text||"rgba(0, 0, 0, 0.88)"};
|
|
940
|
+
}
|
|
941
|
+
`,Ha=Te.default.span`
|
|
942
|
+
display: flex;
|
|
943
|
+
align-items: center;
|
|
944
|
+
color: ${({theme:e})=>e.colors?.textSecondary||"rgba(0, 0, 0, 0.25)"};
|
|
945
|
+
font-size: 12px;
|
|
946
|
+
line-height: 0;
|
|
947
|
+
`,lr=Te.default.input`
|
|
948
|
+
margin: 0;
|
|
949
|
+
padding: 0;
|
|
950
|
+
background: transparent;
|
|
951
|
+
border: none;
|
|
952
|
+
outline: none;
|
|
953
|
+
appearance: none;
|
|
954
|
+
font-family: inherit;
|
|
955
|
+
font-size: inherit;
|
|
956
|
+
width: 100%;
|
|
957
|
+
height: 24px;
|
|
958
|
+
margin-top: 1px;
|
|
959
|
+
margin-bottom: 1px;
|
|
960
|
+
min-width: 4px;
|
|
961
|
+
`,Ba=Te.default.div`
|
|
962
|
+
display: inline-block;
|
|
963
|
+
max-width: 100%;
|
|
964
|
+
`;var Qt=require("react/jsx-runtime"),Ys=({value:e,children:t,disabled:o,className:n,style:a,label:r})=>{let{value:s,onSelect:c,multiple:d}=ka(),p=(0,Na.useMemo)(()=>d&&Array.isArray(s)?s.includes(e):s===e,[s,e,d]),u=f=>{if(o)return;f.preventDefault(),f.stopPropagation(),c(e,{value:e,label:r||t,disabled:o})};return(0,Qt.jsxs)(Da,{className:`compass-select-option ${p?"compass-select-option-selected":""} ${n||""}`,style:a,onClick:u,selected:p,disabled:o,role:"option","aria-selected":p,children:[(0,Qt.jsx)("span",{className:"compass-select-option-content",children:t}),p&&(0,Qt.jsx)(so,{})]})},Mo=Ys;var K=require("react/jsx-runtime"),cr=e=>{let{children:t,options:o,value:n,defaultValue:a,onChange:r,disabled:s,loading:c,allowClear:d,placeholder:p,className:u,style:f,multiple:b=!1,mode:g,size:l="medium",status:i,dropdownStyle:k,dropdownClassName:v,trigger:C="click",showSearch:w}=e,T=b||g==="multiple"||g==="tags",B=g==="tags",[_,A]=(0,He.useState)(a||(T?[]:"")),I=n!==void 0,S=I?n:_,[q,M]=(0,He.useState)(!1),[D,re]=(0,He.useState)(""),Z=(0,He.useRef)(null),Y=(0,He.useMemo)(()=>{let E=[];return o?E=o:He.default.Children.forEach(t,G=>{if(He.default.isValidElement(G)&&(G.type===Mo||typeof G.type=="function"&&G.type.name==="Option")){let{value:le,children:Fe,disabled:Ue,...Ae}=G.props;E.push({value:le,label:Fe,disabled:Ue,...Ae})}}),E},[t,o]),j=(0,He.useMemo)(()=>D?Y.filter(E=>String(E.label).toLowerCase().includes(D.toLowerCase())):Y,[Y,D]),ge=E=>{s||(M(E),E?setTimeout(()=>{w&&Z.current?.focus()},0):re(""))},{x:se,y:he,refs:P,floatingStyles:N,context:x}=(0,J.useFloating)({open:q,onOpenChange:ge,placement:"bottom-start",middleware:[(0,J.offset)(4),(0,J.flip)(),(0,J.shift)(),(0,J.size)({apply({rects:E,elements:G}){Object.assign(G.floating.style,{minWidth:`${E.reference.width}px`})}})],whileElementsMounted:J.autoUpdate}),ee=(0,J.useClick)(x,{enabled:C==="click"}),R=(0,J.useHover)(x,{enabled:C==="hover",handleClose:(0,J.safePolygon)()}),O=(0,J.useDismiss)(x),ae=(0,J.useRole)(x,{role:"listbox"}),{getReferenceProps:Re,getFloatingProps:V}=(0,J.useInteractions)([ee,R,O,ae]),H=E=>{let G=Y.find(le=>le.value===E);return G?G.label:E},De=(E,G)=>{I||A(E),r?.(E,G)},te=(E,G)=>{if(T){let le=Array.isArray(S)?S:[],Fe=le.indexOf(E),Ue,Ae=[];Fe===-1?Ue=[...le,E]:Ue=le.filter(rt=>rt!==E),Ae=Ue.map(rt=>Y.find(ls=>ls.value===rt)||{value:rt,label:rt}),De(Ue,Ae),re(""),w&&Z.current?.focus()}else De(E,G),M(!1),re("")},Dt=E=>{E.stopPropagation(),De(T?[]:"",T?[]:{})},F=(E,G)=>{G.stopPropagation();let Fe=(Array.isArray(S)?S:[]).filter(Ae=>Ae!==E),Ue=Fe.map(Ae=>Y.find(rt=>rt.value===Ae)||{value:Ae,label:Ae});De(Fe,Ue)},U=E=>{re(E.target.value),q||M(!0)},z=E=>{if(E.key==="Enter"&&B&&D){let G=Y.find(le=>le.value===D);if(G)te(G.value,G);else{let le=D;te(le,{value:le,label:le})}E.preventDefault()}},X=()=>{if(T){let E=Array.isArray(S)?S:[];return(0,K.jsxs)(K.Fragment,{children:[E.map(G=>(0,K.jsxs)(Ia,{children:[(0,K.jsx)("span",{children:H(G)}),(0,K.jsx)(za,{onClick:le=>F(G,le),children:(0,K.jsx)(ht,{})})]},G)),(w||B)&&(0,K.jsx)(Ba,{style:{width:D?"auto":"4px",minWidth:"50px",flex:1},children:(0,K.jsx)(lr,{ref:Z,value:D,onChange:U,onKeyDown:z,disabled:s,style:{width:"100%"}})}),!D&&E.length===0&&!w&&!B&&(0,K.jsx)(Gt,{children:p}),E.length===0&&!D&&(w||B)&&(0,K.jsx)(Gt,{style:{position:"absolute",left:0,pointerEvents:"none"},children:p})]})}return w?(0,K.jsxs)(K.Fragment,{children:[!D&&(S!==void 0&&S!==""?(0,K.jsx)("span",{style:{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",width:"100%",overflow:"hidden",textOverflow:"ellipsis"},children:H(S)}):(0,K.jsx)(Gt,{style:{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",width:"100%",overflow:"hidden",textOverflow:"ellipsis"},children:p})),(0,K.jsx)(lr,{ref:Z,value:D,onChange:U,onKeyDown:z,disabled:s,style:{opacity:q||D?1:0}})]}):!S&&S!==0?(0,K.jsx)(Gt,{children:p}):H(S)},It=d&&!s&&(T?Array.isArray(S)&&S.length>0:S!==""&&S!==void 0&&S!==null),zt={value:S,onSelect:te,multiple:T,searchValue:D,activeValue:null,setActiveValue:()=>{}},Ht=P.setReference;return(0,K.jsx)(ir.Provider,{value:zt,children:(0,K.jsxs)(Pa,{ref:Ht,className:`compass-select ${u||""} ${q?"compass-select-open":""} ${s?"compass-select-disabled":""}`,style:f,disabled:s,fullWidth:!0,...Re({onClick:()=>{(w||B)&&Z.current?.focus()}}),children:[(0,K.jsxs)(Ma,{size:l,active:q,status:i,className:"compass-select-selector",children:[(0,K.jsx)(Ta,{size:l,children:X()}),(0,K.jsx)(Ha,{children:c?(0,K.jsx)($a,{children:(0,K.jsx)(ao,{})}):It?(0,K.jsx)("span",{onClick:Dt,style:{cursor:"pointer"},children:(0,K.jsx)(Je,{})}):(0,K.jsx)(Qr,{})})]}),q&&(0,K.jsx)(J.FloatingPortal,{children:(0,K.jsx)(Ra,{ref:P.setFloating,style:{...k,...N,opacity:se===null||he===null?0:1,visibility:se===null||he===null?"hidden":"visible"},className:`compass-select-dropdown ${v||""}`,...V(),children:j.length>0?j.map(E=>(0,K.jsx)(Mo,{...E,children:E.label},E.value)):(0,K.jsx)("div",{style:{padding:"8px 12px",color:"#999",textAlign:"center"},children:"No Data"})})})]})})};cr.Option=Mo;cr.displayName="Select";var Fa=cr;var Ut=Fa;var ot=require("react");var To=L(require("@emotion/styled")),pr=To.default.ul`
|
|
965
|
+
display: flex;
|
|
966
|
+
align-items: center;
|
|
967
|
+
list-style: none;
|
|
968
|
+
padding: 0;
|
|
969
|
+
margin: 0;
|
|
970
|
+
font-size: ${({theme:e})=>e.components?.pagination?.fontSize||"14px"};
|
|
971
|
+
color: ${({theme:e})=>e.components?.pagination?.itemColor||"rgba(0, 0, 0, 0.88)"};
|
|
972
|
+
opacity: ${({disabled:e})=>e?.5:1};
|
|
973
|
+
cursor: ${({disabled:e})=>e?"not-allowed":"default"};
|
|
974
|
+
|
|
975
|
+
.compass-pagination-simple-input {
|
|
976
|
+
width: ${({size:e})=>e==="small"?"40px":"50px"};
|
|
977
|
+
height: ${({size:e})=>e==="small"?"24px":"32px"};
|
|
978
|
+
margin: 0 8px;
|
|
979
|
+
|
|
980
|
+
.compass-input-field {
|
|
981
|
+
height: 100%;
|
|
982
|
+
padding: 0 6px;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
input {
|
|
986
|
+
text-align: center;
|
|
987
|
+
height: 100%;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
/* Hide spin buttons for input type number in Pagination */
|
|
992
|
+
input[type='number']::-webkit-inner-spin-button,
|
|
993
|
+
input[type='number']::-webkit-outer-spin-button {
|
|
994
|
+
-webkit-appearance: none;
|
|
995
|
+
margin: 0;
|
|
996
|
+
}
|
|
997
|
+
input[type='number'] {
|
|
998
|
+
-moz-appearance: textfield;
|
|
999
|
+
}
|
|
1000
|
+
`,dt=To.default.li`
|
|
1001
|
+
display: inline-flex;
|
|
1002
|
+
justify-content: center;
|
|
1003
|
+
align-items: center;
|
|
1004
|
+
min-width: ${({theme:e,size:t})=>t==="small"?"24px":e.components?.pagination?.itemSize||"32px"};
|
|
1005
|
+
height: ${({theme:e,size:t})=>t==="small"?"24px":e.components?.pagination?.itemSize||"32px"};
|
|
1006
|
+
margin-right: 8px;
|
|
1007
|
+
border-radius: ${({theme:e})=>e.components?.pagination?.itemBorderRadius||"4px"};
|
|
1008
|
+
background-color: ${({theme:e,active:t})=>t?e.components?.pagination?.itemActiveBg||"#ffffff":e.components?.pagination?.itemBg||"#ffffff"};
|
|
1009
|
+
border: 1px solid
|
|
1010
|
+
${({theme:e,active:t})=>t?e.colors?.primary||"#1890ff":e.colors?.border||"#d9d9d9"};
|
|
1011
|
+
color: ${({theme:e,active:t})=>t?e.components?.pagination?.itemActiveColor||"#1890ff":e.components?.pagination?.itemColor||"rgba(0, 0, 0, 0.88)"};
|
|
1012
|
+
cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
|
|
1013
|
+
user-select: none;
|
|
1014
|
+
transition: all 0.2s;
|
|
1015
|
+
font-weight: ${({active:e})=>e?600:400};
|
|
1016
|
+
|
|
1017
|
+
&:hover {
|
|
1018
|
+
border-color: ${({theme:e,active:t,disabled:o})=>o?t?e.colors?.primary||"#1890ff":e.colors?.border||"#d9d9d9":t?e.colors?.primary||"#1890ff":e.colors?.primaryHover||"#40a9ff"};
|
|
1019
|
+
color: ${({theme:e,active:t,disabled:o})=>o?t?e.components?.pagination?.itemActiveColor||"#1890ff":e.components?.pagination?.itemColor||"rgba(0, 0, 0, 0.88)":t?e.components?.pagination?.itemActiveColor||"#1890ff":e.components?.pagination?.itemHoverColor||"#40a9ff"};
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
a {
|
|
1023
|
+
color: inherit;
|
|
1024
|
+
text-decoration: none;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
.compass-icon {
|
|
1028
|
+
display: flex;
|
|
1029
|
+
align-items: center;
|
|
1030
|
+
justify-content: center;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/* Jump Item specific styles */
|
|
1034
|
+
&.compass-pagination-jump-placeholder {
|
|
1035
|
+
position: relative;
|
|
1036
|
+
border: none;
|
|
1037
|
+
background: transparent;
|
|
1038
|
+
|
|
1039
|
+
&:hover {
|
|
1040
|
+
color: ${({theme:e,disabled:t})=>t?e.components?.pagination?.itemColor||"rgba(0, 0, 0, 0.88)":e.colors?.primary||"#1890ff"};
|
|
1041
|
+
|
|
1042
|
+
.compass-pagination-item-ellipsis {
|
|
1043
|
+
opacity: ${({disabled:e})=>e?1:0};
|
|
1044
|
+
pointer-events: none;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
.compass-pagination-item-link-icon {
|
|
1048
|
+
opacity: ${({disabled:e})=>e?0:1};
|
|
1049
|
+
pointer-events: ${({disabled:e})=>e?"none":"auto"};
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
.compass-pagination-item-ellipsis,
|
|
1055
|
+
.compass-pagination-item-link-icon {
|
|
1056
|
+
position: absolute;
|
|
1057
|
+
top: 50%;
|
|
1058
|
+
left: 50%;
|
|
1059
|
+
transform: translate(-50%, -50%);
|
|
1060
|
+
transition: all 0.2s;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
.compass-pagination-item-ellipsis {
|
|
1064
|
+
opacity: 1;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
.compass-pagination-item-link-icon {
|
|
1068
|
+
opacity: 0;
|
|
1069
|
+
font-size: 12px;
|
|
1070
|
+
}
|
|
1071
|
+
`,Kc=To.default.li`
|
|
1072
|
+
display: inline-flex;
|
|
1073
|
+
justify-content: center;
|
|
1074
|
+
align-items: center;
|
|
1075
|
+
width: 32px;
|
|
1076
|
+
height: 32px;
|
|
1077
|
+
margin-right: 8px;
|
|
1078
|
+
color: ${({theme:e})=>e.components?.pagination?.itemColor||"rgba(0, 0, 0, 0.25)"};
|
|
1079
|
+
cursor: pointer;
|
|
1080
|
+
`;var We=L(require("react"));var Ro=L(require("@emotion/styled"));var Ea=(0,Ro.default)(uo)`
|
|
1081
|
+
padding-right: ${({size:e,controls:t})=>t?{small:"30px",medium:"34px",large:"38px"}[e||"medium"]:void 0};
|
|
1082
|
+
`,La=Ro.default.div`
|
|
1083
|
+
display: flex;
|
|
1084
|
+
flex-direction: column;
|
|
1085
|
+
position: absolute;
|
|
1086
|
+
right: 0;
|
|
1087
|
+
top: 0;
|
|
1088
|
+
height: 100%;
|
|
1089
|
+
width: 22px;
|
|
1090
|
+
border-left: 1px solid ${({theme:e})=>e.colors?.border||"#d9d9d9"};
|
|
1091
|
+
border-radius: 0 ${({theme:e})=>e.components?.input?.borderRadius||"4px"}
|
|
1092
|
+
${({theme:e})=>e.components?.input?.borderRadius||"4px"} 0;
|
|
1093
|
+
overflow: hidden;
|
|
1094
|
+
opacity: 0;
|
|
1095
|
+
transition: opacity 0.2s;
|
|
1096
|
+
pointer-events: none;
|
|
1097
|
+
z-index: 1; // Ensure it sits above input content area if needed
|
|
1098
|
+
|
|
1099
|
+
// Show when InputWrapper (parent) is hovered or focused within
|
|
1100
|
+
.compass-input-number:hover &,
|
|
1101
|
+
.compass-input-number:focus-within & {
|
|
1102
|
+
opacity: 1;
|
|
1103
|
+
pointer-events: auto;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
// Sync border color with parent hover state
|
|
1107
|
+
.compass-input-number:hover & {
|
|
1108
|
+
border-left-color: ${({theme:e})=>e.components?.input?.hoverBorderColor||"#4096ff"};
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
// Sync border color with parent focus state
|
|
1112
|
+
.compass-input-number:focus-within & {
|
|
1113
|
+
border-left-color: ${({theme:e})=>e.components?.input?.activeBorderColor||"#40a9ff"};
|
|
1114
|
+
}
|
|
1115
|
+
`,dr=Ro.default.button`
|
|
1116
|
+
display: flex;
|
|
1117
|
+
align-items: center;
|
|
1118
|
+
justify-content: center;
|
|
1119
|
+
flex: 1;
|
|
1120
|
+
width: 22px;
|
|
1121
|
+
padding: 0;
|
|
1122
|
+
border: none;
|
|
1123
|
+
border-bottom: 1px solid ${({theme:e})=>e.colors?.border||"#d9d9d9"};
|
|
1124
|
+
background: transparent;
|
|
1125
|
+
cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
|
|
1126
|
+
color: ${({theme:e,disabled:t})=>t?e.colors?.textTertiary||"#bfbfbf":e.colors?.textSecondary||"#595959"};
|
|
1127
|
+
transition: all 0.2s;
|
|
1128
|
+
|
|
1129
|
+
// Sync separator border color
|
|
1130
|
+
.compass-input-number:hover & {
|
|
1131
|
+
border-bottom-color: ${({theme:e})=>e.components?.input?.hoverBorderColor||"#4096ff"};
|
|
1132
|
+
}
|
|
1133
|
+
.compass-input-number:focus-within & {
|
|
1134
|
+
border-bottom-color: ${({theme:e})=>e.components?.input?.activeBorderColor||"#40a9ff"};
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
&:last-of-type {
|
|
1138
|
+
border-bottom: none;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
&:hover:not(:disabled) {
|
|
1142
|
+
flex: 1.4; // Expand height on hover (60/40 ratio)
|
|
1143
|
+
background: ${({theme:e})=>e.colors?.backgroundSecondary||"#f5f5f5"};
|
|
1144
|
+
color: ${({theme:e})=>e.colors?.text||"#000"};
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
&:active:not(:disabled) {
|
|
1148
|
+
background: ${({theme:e})=>e.colors?.backgroundTertiary||"#e6e6e6"};
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
svg {
|
|
1152
|
+
width: ${({$size:e})=>e==="small"?"9px":"12px"};
|
|
1153
|
+
height: ${({$size:e})=>e==="small"?"9px":"12px"};
|
|
1154
|
+
}
|
|
1155
|
+
`;var ve=require("react/jsx-runtime"),Oa=We.default.forwardRef((e,t)=>{let{value:o,defaultValue:n,onChange:a,min:r,max:s,step:c=1,precision:d,controls:p=!0,keyboard:u=!0,disabled:f,onBlur:b,onPressEnter:g,onFocus:l,label:i,error:k,helperText:v,prefix:C,suffix:w,size:T="medium",fullWidth:B=!1,className:_,style:A,...I}=e,S=(0,We.useRef)(null);We.default.useImperativeHandle(t,()=>S.current);let[q,M]=(0,We.useState)(!1),D=o!==void 0,[re,Z]=(0,We.useState)(n??null),Y=D?o===void 0?null:o:re,j=We.default.useCallback(V=>V===null?"":d!==void 0?V.toFixed(d):String(V),[d]),[ge,se]=(0,We.useState)(()=>j(Y)),[he,P]=(0,We.useState)(Y);Y!==he&&!q&&(se(j(Y)),P(Y));let N=V=>{if(!V.trim())return null;let H=parseFloat(V);return isNaN(H)?null:H},x=V=>{let H=V;return r!==void 0&&H<r&&(H=r),s!==void 0&&H>s&&(H=s),H},ee=V=>{M(!0),l?.(V)},R=V=>{let H=N(ge);H!==null&&(H=x(H)),D||Z(H),a?.(H);let De=j(H);se(De),P(H),b?.(V),M(!1)},O=V=>{let H=V.target.value.trim();if(/^-?(\d+(\.\d*)?)?$/.test(H)||H===""||H==="-"){if(H==="-"&&r!==void 0&&r>=0)return;let te=N(H);if(te!==null&&s!==void 0&&te>s)return;se(H),D||Z(te),a?.(te)}},ae=V=>{let H=Y??0,De=V==="up"?c:-c,te=H+De;d!==void 0?te=parseFloat(te.toFixed(d)):te=parseFloat(te.toFixed(10)),te=x(te),D||Z(te),a?.(te),se(j(te)),P(te)},Re=V=>{if(V.key==="Enter"){let H=N(ge);H!==null&&(H=x(H)),D||Z(H),a?.(H),se(j(H)),P(H),g?.(V)}u&&!f&&(V.key==="ArrowUp"?(V.preventDefault(),ae("up")):V.key==="ArrowDown"&&(V.preventDefault(),ae("down")))};return(0,ve.jsxs)(Et,{fullWidth:B,className:_,style:A,children:[i&&(0,ve.jsx)(Lt,{children:i}),(0,ve.jsxs)(Ea,{error:!!k,disabled:f,focused:q,size:T,controls:p,className:`compass-input-number compass-input-number--${T}`,children:[C&&(0,ve.jsx)(lt,{$position:"start",children:C}),(0,ve.jsx)(Wt,{ref:S,type:"text",role:"spinbutton","aria-valuenow":Y??void 0,"aria-valuemin":r,"aria-valuemax":s,inputMode:"decimal",value:ge,onChange:O,onBlur:R,onFocus:ee,onKeyDown:Re,disabled:f,$size:T,...I}),w&&(0,ve.jsx)(lt,{$position:"end",children:w}),p&&!f&&(0,ve.jsxs)(La,{size:T,children:[(0,ve.jsx)(dr,{type:"button",disabled:s!==void 0&&Y!==null&&Y>=s,onClick:()=>ae("up"),onMouseDown:V=>V.preventDefault(),$size:T,children:(0,ve.jsx)("svg",{viewBox:"0 0 12 12",fill:"currentColor",children:(0,ve.jsx)("path",{d:"M6 3l4 4H2z"})})}),(0,ve.jsx)(dr,{type:"button",disabled:r!==void 0&&Y!==null&&Y<=r,onClick:()=>ae("down"),onMouseDown:V=>V.preventDefault(),$size:T,children:(0,ve.jsx)("svg",{viewBox:"0 0 12 12",fill:"currentColor",children:(0,ve.jsx)("path",{d:"M6 9l4-4H2z"})})})]})]}),(v||k)&&(0,ve.jsx)(Ot,{error:!!k,children:k&&typeof k!="boolean"?k:v})]})});Oa.displayName="InputNumber";var Wa=Oa;var Xt=Wa;var Aa=require("react"),wt="...",Do=(e,t)=>{let o=t-e+1;return Array.from({length:o},(n,a)=>a+e)},Va=({total:e,pageSize:t,siblingCount:o=1,current:n})=>(0,Aa.useMemo)(()=>{let r=Math.ceil(e/t),s=o+5;if(r<=s)return Do(1,r);let c=Math.max(n-o,1),d=Math.min(n+o,r),p=c>2,u=d<r-2,f=1,b=r;if(!p&&u){let g=3+2*o;return[...Do(1,g),wt,r]}if(p&&!u){let g=3+2*o,l=Do(r-g+1,r);return[f,wt,...l]}if(p&&u){let g=Do(c,d);return[f,wt,...g,wt,b]}return[]},[e,t,o,n])||[];var Ks={locale:"en-US",Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},DatePicker:{monthBeforeYear:!0,yearFormat:"yyyy",monthFormat:"MMM",quarterFormat:"yyyy-KQ",weekFormat:"yyyy-wo",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",timeSelect:"Select time",dateSelect:"Select date",weekSelect:"Select week",clear:"Clear",month:"Month",year:"Year",previousMonth:"Previous month",nextMonth:"Next month",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",dayFormat:"d",dateFormat:"M/d/yyyy",dateTimeFormat:"M/d/yyyy HH:mm:ss",previousYear:"Last year",nextYear:"Next year",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century",shortWeekDays:["Mo","Tu","We","Th","Fr","Sa","Su"],weekDays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],hour:"Hour",minute:"Minute",second:"Second",startDate:"Start date",endDate:"End date"},Pagination:{items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages"}},Ya=Ks;var Q=require("react/jsx-runtime"),_s=({current:e,defaultCurrent:t=1,total:o=0,pageSize:n,defaultPageSize:a=10,onChange:r,disabled:s,size:c="default",className:d,style:p,showSizeChanger:u,pageSizeOptions:f=[10,20,50,100],showQuickJumper:b,showTotal:g,simple:l,totalAlign:i="left",...k})=>{let{locale:v}=Me(),C=v?.Pagination||Ya.Pagination,[w,T]=(0,ot.useState)(e||t),[B,_]=(0,ot.useState)(n||a),[A,I]=(0,ot.useState)(String(w));(0,ot.useEffect)(()=>{e!==void 0&&(T(e),I(String(e)))},[e]),(0,ot.useEffect)(()=>{I(String(w))},[w]),(0,ot.useEffect)(()=>{n!==void 0&&_(n)},[n]);let S=Math.ceil(o/B),q=Va({current:w,total:o,pageSize:B,siblingCount:1}),M=P=>{if(s)return;let N=P;N<1&&(N=1),N>S&&(N=S),N!==w&&(e===void 0&&T(N),r?.(N,B))},D=P=>{let N=Number(P);_(N);let x=1;e===void 0&&T(x),r?.(x,N)},re=()=>{M(w-5)},Z=()=>{M(w+5)},Y=P=>{I(P===null?"":String(P))},j=()=>{let P=parseInt(A,10);isNaN(P)?P=w:(P<1&&(P=1),P>S&&(P=S)),M(P),I(String(P))},ge=P=>{let N=P.target,x=parseInt(N.value,10);isNaN(x)?x=w:(x<1&&(x=1),x>S&&(x=S)),M(x),I(String(x)),N.blur()};if(o===0)return null;if(l)return(0,Q.jsxs)(pr,{className:`compass-pagination compass-pagination-simple ${d||""}`,style:p,disabled:s,size:c,...k,"aria-label":"pagination",children:[(0,Q.jsx)(dt,{disabled:w===1||s,onClick:()=>M(w-1),size:c,className:"compass-pagination-prev",title:C.prev_page,children:(0,Q.jsx)(nt,{})}),(0,Q.jsxs)("li",{style:{margin:"0 8px",display:"flex",alignItems:"center"},children:[(0,Q.jsx)(Xt,{value:A?parseInt(A,10):null,onChange:Y,onBlur:j,onPressEnter:ge,size:c==="small"?"small":"medium",disabled:s,className:"compass-pagination-simple-input",min:1,max:S}),(0,Q.jsx)("span",{style:{margin:"0 8px"},children:"/"}),S]}),(0,Q.jsx)(dt,{disabled:w===S||s,onClick:()=>M(w+1),size:c,className:"compass-pagination-next",title:C.next_page,children:(0,Q.jsx)(at,{})})]});let se=q.map((P,N)=>{if(P===wt){let x=N===1;return(0,Q.jsxs)(dt,{className:"compass-pagination-jump-placeholder",size:c,disabled:s,title:x?C.prev_5:C.next_5,onClick:x?re:Z,children:[(0,Q.jsx)("div",{className:"compass-pagination-item-ellipsis",children:(0,Q.jsx)(Ur,{})}),(0,Q.jsx)("div",{className:"compass-pagination-item-link-icon",children:x?(0,Q.jsx)(Ze,{}):(0,Q.jsx)(et,{})})]},`dots-${N}`)}return(0,Q.jsx)(dt,{active:w===P,disabled:s,size:c,onClick:()=>M(Number(P)),className:`compass-pagination-item compass-pagination-item-${P} ${w===P?"compass-pagination-item-active":""}`,children:P},P)}),he=()=>{if(!g)return null;let P=(w-1)*B+1,N=Math.min(w*B,o);return(0,Q.jsx)("li",{className:"compass-pagination-total-text",style:{marginRight:i==="left"?8:0,marginLeft:i==="right"?8:0},children:g(o,[P,N])})};return(0,Q.jsxs)(pr,{className:`compass-pagination ${d||""}`,style:p,disabled:s,size:c,...k,"aria-label":"pagination",children:[i==="left"&&he(),(0,Q.jsx)(dt,{disabled:w===1||s,onClick:()=>M(w-1),size:c,className:"compass-pagination-prev",title:C.prev_page,children:(0,Q.jsx)(nt,{})}),se,(0,Q.jsx)(dt,{disabled:w===S||s,onClick:()=>M(w+1),size:c,className:"compass-pagination-next",title:C.next_page,children:(0,Q.jsx)(at,{})}),u&&(0,Q.jsx)("li",{className:"compass-pagination-options",style:{marginLeft:16},children:(0,Q.jsx)(Ut,{size:c==="small"?"small":"medium",value:String(B),onChange:D,disabled:s,style:{width:c==="small"?90:110},children:f.map(P=>(0,Q.jsxs)(Ut.Option,{value:String(P),children:[P," ",C.items_per_page]},P))})}),i==="right"&&he(),b&&(0,Q.jsxs)("li",{className:"compass-pagination-options compass-pagination-quick-jumper",style:{marginLeft:16,display:"flex",alignItems:"center"},children:[C.jump_to,(0,Q.jsx)(Xt,{size:c==="small"?"small":"medium",disabled:s,style:{width:50,margin:"0 8px"},min:1,max:S,onBlur:P=>{let N=parseInt(P.target.value,10);isNaN(N)||M(N),P.target.value=""},onPressEnter:P=>{let N=P.currentTarget,x=parseInt(N.value,10);isNaN(x)||(M(x),N.value="",N.blur())}})]})]})},Ka=_s;var _a=Ka;var Be=L(require("react")),me=require("@floating-ui/react"),ce=require("date-fns"),es=L(require("@emotion/styled"));var Jt=require("react"),ne=require("date-fns"),Io=({value:e,defaultValue:t})=>{let[o,n]=(0,Jt.useState)(e||t||new Date),[a,r]=(0,Jt.useState)(e);e&&e!==a&&!(0,ne.isSameDay)(o,e)&&(n(e),r(e));let s=(0,Jt.useMemo)(()=>{let g=(0,ne.startOfMonth)(o),l=(0,ne.endOfMonth)(g),i=(0,ne.startOfWeek)(g,{weekStartsOn:1}),k=(0,ne.endOfWeek)(l,{weekStartsOn:1});return(0,ne.eachDayOfInterval)({start:i,end:k}).map(C=>({date:C,isCurrentMonth:(0,ne.isSameMonth)(C,g),isToday:(0,ne.isToday)(C),isSelected:e?(0,ne.isSameDay)(C,e):!1}))},[o,e]);return{viewDate:o,days:s,nextMonth:()=>n((0,ne.addMonths)(o,1)),prevMonth:()=>n((0,ne.subMonths)(o,1)),nextYear:()=>n((0,ne.addMonths)(o,12)),prevYear:()=>n((0,ne.subMonths)(o,12)),setMonth:g=>{let l=new Date(o);l.setMonth(g),n(l)},setYear:g=>{let l=new Date(o);l.setFullYear(g),n(l)},setViewDate:n}};var mr=L(require("@emotion/styled")),Zt=require("date-fns");var ur=require("react/jsx-runtime"),qs=mr.default.div`
|
|
1156
|
+
display: grid;
|
|
1157
|
+
grid-template-columns: repeat(3, 1fr);
|
|
1158
|
+
gap: 12px;
|
|
1159
|
+
padding: 8px 16px;
|
|
1160
|
+
`,js=mr.default.div`
|
|
1161
|
+
padding: 8px 12px;
|
|
1162
|
+
text-align: center;
|
|
1163
|
+
cursor: pointer;
|
|
1164
|
+
border-radius: 4px;
|
|
1165
|
+
font-size: 14px;
|
|
1166
|
+
background: ${({theme:e,isSelected:t})=>t?y(e,"colors").primary:"transparent"};
|
|
1167
|
+
color: ${({theme:e,isSelected:t})=>t?"#fff":y(e,"colors").text};
|
|
1168
|
+
|
|
1169
|
+
&:hover {
|
|
1170
|
+
background: ${({theme:e,isSelected:t})=>t?y(e,"colors").primary:"rgba(0, 0, 0, 0.08)"};
|
|
1171
|
+
}
|
|
1172
|
+
`,qa=({viewDate:e,onSelect:t,selectedDate:o})=>{let n=Array.from({length:12},(r,s)=>s),a=r=>{let s=(0,Zt.setMonth)(e,r);t(s)};return(0,ur.jsx)(qs,{children:n.map(r=>{let s=(0,Zt.setMonth)(e,r),c=o?o.getMonth()===r&&o.getFullYear()===e.getFullYear():!1;return(0,ur.jsx)(js,{isSelected:c,onClick:()=>a(r),children:(0,Zt.format)(s,"MMM")},r)})})};var gr=L(require("@emotion/styled")),ja=require("date-fns");var fr=require("react/jsx-runtime"),Gs=gr.default.div`
|
|
1173
|
+
display: grid;
|
|
1174
|
+
grid-template-columns: repeat(3, 1fr);
|
|
1175
|
+
gap: 12px;
|
|
1176
|
+
padding: 8px 16px;
|
|
1177
|
+
`,Qs=gr.default.div`
|
|
1178
|
+
padding: 8px 12px;
|
|
1179
|
+
text-align: center;
|
|
1180
|
+
cursor: pointer;
|
|
1181
|
+
border-radius: 4px;
|
|
1182
|
+
font-size: 14px;
|
|
1183
|
+
background: ${({theme:e,isSelected:t})=>t?y(e,"colors").primary:"transparent"};
|
|
1184
|
+
color: ${({theme:e,isSelected:t,isCurrent:o})=>t?"#fff":o?y(e,"colors").text:y(e,"colors").textDisabled};
|
|
1185
|
+
|
|
1186
|
+
&:hover {
|
|
1187
|
+
background: ${({theme:e,isSelected:t})=>t?y(e,"colors").primary:"rgba(0, 0, 0, 0.08)"};
|
|
1188
|
+
}
|
|
1189
|
+
`,Ga=({viewDate:e,onSelect:t,selectedDate:o})=>{let n=e.getFullYear(),a=Math.floor(n/10)*10,r=Array.from({length:12},(c,d)=>a-1+d),s=c=>{let d=(0,ja.setYear)(e,c);t(d)};return(0,fr.jsx)(Gs,{children:r.map(c=>{let d=o?o.getFullYear()===c:!1,p=c>=a&&c<=a+9;return(0,fr.jsx)(Qs,{isSelected:d,isCurrent:p,onClick:()=>s(c),children:c},c)})})};var xr=L(require("@emotion/styled")),zo=require("date-fns");var Ho=require("react/jsx-runtime"),Us=xr.default.div`
|
|
1190
|
+
display: grid;
|
|
1191
|
+
grid-template-columns: repeat(4, 1fr);
|
|
1192
|
+
gap: 12px;
|
|
1193
|
+
padding: 24px 16px;
|
|
1194
|
+
`,Xs=xr.default.div`
|
|
1195
|
+
padding: 16px 12px;
|
|
1196
|
+
text-align: center;
|
|
1197
|
+
cursor: pointer;
|
|
1198
|
+
border-radius: 4px;
|
|
1199
|
+
font-size: 14px;
|
|
1200
|
+
background: ${({theme:e,isSelected:t})=>t?y(e,"colors").primary:"transparent"};
|
|
1201
|
+
color: ${({theme:e,isSelected:t})=>t?"#fff":y(e,"colors").text};
|
|
1202
|
+
|
|
1203
|
+
&:hover {
|
|
1204
|
+
background: ${({theme:e,isSelected:t})=>t?y(e,"colors").primary:"rgba(0, 0, 0, 0.08)"};
|
|
1205
|
+
}
|
|
1206
|
+
`,Qa=({viewDate:e,onSelect:t,selectedDate:o})=>{let n=[1,2,3,4],a=r=>{let s=(0,zo.setMonth)(e,(r-1)*3);t(s)};return(0,Ho.jsx)(Us,{children:n.map(r=>{let s=o?(0,zo.getQuarter)(o)===r&&o.getFullYear()===e.getFullYear():!1;return(0,Ho.jsxs)(Xs,{isSelected:s,onClick:()=>a(r),children:["Q",r]},r)})})};var ut=L(require("@emotion/styled")),$t=require("date-fns");var $e=require("react/jsx-runtime"),Js=ut.default.div`
|
|
1207
|
+
display: flex;
|
|
1208
|
+
flex-direction: column;
|
|
1209
|
+
border-left: 1px solid rgba(0, 0, 0, 0.06);
|
|
1210
|
+
height: 320px; // Fixed height to match date panel
|
|
1211
|
+
width: 160px;
|
|
1212
|
+
`,yr=ut.default.div`
|
|
1213
|
+
flex: 1;
|
|
1214
|
+
overflow-y: auto;
|
|
1215
|
+
padding: 4px 0;
|
|
1216
|
+
|
|
1217
|
+
&:not(:last-child) {
|
|
1218
|
+
border-right: 1px solid rgba(0, 0, 0, 0.06);
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
/* Custom scrollbar */
|
|
1222
|
+
&::-webkit-scrollbar {
|
|
1223
|
+
width: 6px;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
&::-webkit-scrollbar-track {
|
|
1227
|
+
background: transparent;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
&::-webkit-scrollbar-thumb {
|
|
1231
|
+
background: ${({theme:e})=>y(e,"colors").border};
|
|
1232
|
+
border-radius: 3px;
|
|
1233
|
+
|
|
1234
|
+
&:hover {
|
|
1235
|
+
background: ${({theme:e})=>y(e,"colors").textSecondary};
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
`,hr=ut.default.div`
|
|
1239
|
+
padding: 6px 0;
|
|
1240
|
+
text-align: center;
|
|
1241
|
+
cursor: pointer;
|
|
1242
|
+
font-size: 14px;
|
|
1243
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
1244
|
+
background: ${({theme:e,isSelected:t})=>t?y(e,"colors").primary:"transparent"};
|
|
1245
|
+
color: ${({theme:e,isSelected:t})=>t?"#fff":y(e,"colors").text};
|
|
1246
|
+
margin: 0 4px;
|
|
1247
|
+
border-radius: 4px;
|
|
1248
|
+
|
|
1249
|
+
&:hover {
|
|
1250
|
+
background: ${({theme:e,isSelected:t})=>t?y(e,"colors").primaryHover||y(e,"colors").primary:y(e,"colors").backgroundSecondary};
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
&:active {
|
|
1254
|
+
transform: scale(0.95);
|
|
1255
|
+
}
|
|
1256
|
+
`,Zs=ut.default.div`
|
|
1257
|
+
height: 41px;
|
|
1258
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
|
1259
|
+
box-sizing: border-box;
|
|
1260
|
+
display: flex;
|
|
1261
|
+
align-items: center;
|
|
1262
|
+
`,br=ut.default.div`
|
|
1263
|
+
flex: 1;
|
|
1264
|
+
text-align: center;
|
|
1265
|
+
font-size: 12px;
|
|
1266
|
+
color: ${({theme:e})=>y(e,"colors").textSecondary};
|
|
1267
|
+
font-weight: 400;
|
|
1268
|
+
line-height: 40px;
|
|
1269
|
+
`,ei=ut.default.div`
|
|
1270
|
+
display: flex;
|
|
1271
|
+
flex: 1;
|
|
1272
|
+
overflow: hidden;
|
|
1273
|
+
`,Bo=({value:e,onChange:t})=>{let{locale:o}=Me(),n=Array.from({length:24},(u,f)=>f),a=Array.from({length:60},(u,f)=>f),r=Array.from({length:60},(u,f)=>f),s=e||new Date,c=u=>{t((0,$t.setHours)(s,u))},d=u=>{t((0,$t.setMinutes)(s,u))},p=u=>{t((0,$t.setSeconds)(s,u))};return(0,$e.jsxs)(Js,{children:[(0,$e.jsxs)(Zs,{children:[(0,$e.jsx)(br,{children:o?.DatePicker.hour||"\u65F6"}),(0,$e.jsx)(br,{children:o?.DatePicker.minute||"\u5206"}),(0,$e.jsx)(br,{children:o?.DatePicker.second||"\u79D2"})]}),(0,$e.jsxs)(ei,{children:[(0,$e.jsx)(yr,{children:n.map(u=>(0,$e.jsx)(hr,{isSelected:s.getHours()===u,onClick:()=>c(u),children:u.toString().padStart(2,"0")},u))}),(0,$e.jsx)(yr,{children:a.map(u=>(0,$e.jsx)(hr,{isSelected:s.getMinutes()===u,onClick:()=>d(u),children:u.toString().padStart(2,"0")},u))}),(0,$e.jsx)(yr,{children:r.map(u=>(0,$e.jsx)(hr,{isSelected:s.getSeconds()===u,onClick:()=>p(u),children:u.toString().padStart(2,"0")},u))})]})]})};var de=L(require("@emotion/styled"));var No=de.default.div`
|
|
1274
|
+
position: relative;
|
|
1275
|
+
display: inline-block;
|
|
1276
|
+
width: ${({fullWidth:e})=>e?"100%":"auto"};
|
|
1277
|
+
`,Fo=de.default.div`
|
|
1278
|
+
background: ${({theme:e})=>y(e,"colors").background};
|
|
1279
|
+
border: 1px solid ${({theme:e})=>m(e,"datePicker").borderColor};
|
|
1280
|
+
border-radius: 8px;
|
|
1281
|
+
box-shadow: ${({theme:e})=>m(e,"datePicker").boxShadow};
|
|
1282
|
+
width: auto;
|
|
1283
|
+
user-select: none;
|
|
1284
|
+
overflow: hidden;
|
|
1285
|
+
`,Eo=de.default.div`
|
|
1286
|
+
display: flex;
|
|
1287
|
+
border-top: 1px solid ${({theme:e})=>m(e,"datePicker").borderColor};
|
|
1288
|
+
`,Lo=de.default.div`
|
|
1289
|
+
width: 280px;
|
|
1290
|
+
`,Pt=de.default.div`
|
|
1291
|
+
display: flex;
|
|
1292
|
+
justify-content: space-between;
|
|
1293
|
+
align-items: center;
|
|
1294
|
+
padding: ${({theme:e})=>m(e,"datePicker").headerPadding};
|
|
1295
|
+
`,Mt=de.default.div`
|
|
1296
|
+
display: flex;
|
|
1297
|
+
align-items: center;
|
|
1298
|
+
gap: 4px;
|
|
1299
|
+
`,Pe=de.default.button`
|
|
1300
|
+
background: none;
|
|
1301
|
+
border: none;
|
|
1302
|
+
cursor: pointer;
|
|
1303
|
+
padding: 4px 8px;
|
|
1304
|
+
border-radius: 4px;
|
|
1305
|
+
color: ${({theme:e})=>y(e,"colors").textSecondary};
|
|
1306
|
+
font-size: 14px;
|
|
1307
|
+
line-height: 1;
|
|
1308
|
+
transition: all 0.2s;
|
|
1309
|
+
min-width: 24px;
|
|
1310
|
+
display: flex;
|
|
1311
|
+
align-items: center;
|
|
1312
|
+
justify-content: center;
|
|
1313
|
+
|
|
1314
|
+
&:hover {
|
|
1315
|
+
color: ${({theme:e})=>y(e,"colors").text};
|
|
1316
|
+
background: ${({theme:e})=>y(e,"colors").backgroundSecondary};
|
|
1317
|
+
}
|
|
1318
|
+
`,Tt=de.default.div`
|
|
1319
|
+
font-weight: 500;
|
|
1320
|
+
cursor: pointer;
|
|
1321
|
+
font-size: ${({theme:e})=>m(e,"datePicker").headerFontSize};
|
|
1322
|
+
transition: color 0.2s;
|
|
1323
|
+
|
|
1324
|
+
&:hover {
|
|
1325
|
+
color: ${({theme:e})=>y(e,"colors").primary};
|
|
1326
|
+
}
|
|
1327
|
+
`,Oo=de.default.div`
|
|
1328
|
+
display: grid;
|
|
1329
|
+
grid-template-columns: ${({showWeekNumber:e})=>e?"40px repeat(7, 1fr)":"repeat(7, 1fr)"};
|
|
1330
|
+
padding: 8px 12px 4px;
|
|
1331
|
+
text-align: center;
|
|
1332
|
+
`,eo=de.default.div`
|
|
1333
|
+
color: ${({theme:e})=>y(e,"colors").textSecondary};
|
|
1334
|
+
font-size: ${({theme:e})=>m(e,"datePicker").weekDayFontSize};
|
|
1335
|
+
padding: 4px 0;
|
|
1336
|
+
font-weight: 400;
|
|
1337
|
+
`,Wo=de.default.div`
|
|
1338
|
+
display: grid;
|
|
1339
|
+
grid-template-columns: ${({showWeekNumber:e})=>e?"40px repeat(7, 1fr)":"repeat(7, 1fr)"};
|
|
1340
|
+
gap: 0;
|
|
1341
|
+
padding: 4px 12px 8px;
|
|
1342
|
+
`,Ua=de.default.div`
|
|
1343
|
+
height: ${({theme:e})=>m(e,"datePicker").cellHeight};
|
|
1344
|
+
width: 100%;
|
|
1345
|
+
margin: ${({theme:e})=>m(e,"datePicker").cellMargin} 0;
|
|
1346
|
+
display: flex;
|
|
1347
|
+
align-items: center;
|
|
1348
|
+
justify-content: center;
|
|
1349
|
+
font-size: ${({theme:e})=>m(e,"datePicker").weekDayFontSize};
|
|
1350
|
+
box-sizing: border-box;
|
|
1351
|
+
color: ${({theme:e,isSelected:t,isHovered:o})=>t||o?m(e,"datePicker").cellActiveColor:y(e,"colors").textSecondary};
|
|
1352
|
+
background: ${({theme:e,isSelected:t,isHovered:o})=>t?m(e,"datePicker").cellActiveBg:o?m(e,"datePicker").cellHoverBg:"transparent"};
|
|
1353
|
+
border-radius: ${({theme:e})=>m(e,"datePicker").cellBorderRadius} 0 0
|
|
1354
|
+
${({theme:e})=>m(e,"datePicker").cellBorderRadius};
|
|
1355
|
+
cursor: pointer;
|
|
1356
|
+
transition: all 0.2s;
|
|
1357
|
+
|
|
1358
|
+
&:hover {
|
|
1359
|
+
background: ${({theme:e,isSelected:t})=>t?m(e,"datePicker").cellActiveBg:m(e,"datePicker").cellHoverBg};
|
|
1360
|
+
color: ${({theme:e,isSelected:t})=>t?m(e,"datePicker").cellActiveColor:m(e,"datePicker").cellActiveColor};
|
|
1361
|
+
}
|
|
1362
|
+
`,ti=(e,t)=>{if(!e||!e.startsWith("#"))return e;let o=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),a=parseInt(e.slice(5,7),16);return`rgba(${o}, ${n}, ${a}, ${t})`},Ao=de.default.div`
|
|
1363
|
+
height: ${({theme:e})=>m(e,"datePicker").cellHeight};
|
|
1364
|
+
width: ${({isWeekMode:e,theme:t})=>e?"100%":m(t,"datePicker").cellWidth};
|
|
1365
|
+
margin: ${({isWeekMode:e,theme:t})=>e?`${m(t,"datePicker").cellMargin} 0`:`${m(t,"datePicker").cellMargin} auto`};
|
|
1366
|
+
display: flex;
|
|
1367
|
+
align-items: center;
|
|
1368
|
+
justify-content: center;
|
|
1369
|
+
cursor: pointer;
|
|
1370
|
+
box-sizing: border-box;
|
|
1371
|
+
font-size: ${({theme:e})=>m(e,"datePicker").cellFontSize};
|
|
1372
|
+
color: ${({theme:e,isCurrentMonth:t,isSelected:o,isHovered:n})=>o||n?m(e,"datePicker").cellActiveColor:t?m(e,"datePicker").cellColor:m(e,"datePicker").cellDisabledColor};
|
|
1373
|
+
background: ${({theme:e,isSelected:t,isHovered:o,isInRange:n})=>t?m(e,"datePicker").cellActiveBg:o?m(e,"datePicker").cellHoverBg:n?ti(y(e,"colors").primary,.2):"transparent"};
|
|
1374
|
+
border-radius: ${({isWeekMode:e,isWeekEnd:t,theme:o})=>e?t?`0 ${m(o,"datePicker").cellBorderRadius} ${m(o,"datePicker").cellBorderRadius} 0`:"0":m(o,"datePicker").cellBorderRadius};
|
|
1375
|
+
border: ${({theme:e,isToday:t,isSelected:o,isWeekMode:n,isHovered:a})=>n&&a?"1px solid transparent":!o&&t?`1px solid ${m(e,"datePicker").cellActiveBg}`:"1px solid transparent"};
|
|
1376
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
1377
|
+
|
|
1378
|
+
&:hover {
|
|
1379
|
+
background: ${({theme:e,isSelected:t})=>t?m(e,"datePicker").cellActiveBg:m(e,"datePicker").cellHoverBg};
|
|
1380
|
+
color: ${({theme:e,isSelected:t})=>t?m(e,"datePicker").cellActiveColor:m(e,"datePicker").cellActiveColor};
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
&:active {
|
|
1384
|
+
transform: ${({isWeekMode:e})=>e?"none":"scale(0.95)"};
|
|
1385
|
+
}
|
|
1386
|
+
`,Xa=de.default.div`
|
|
1387
|
+
display: flex;
|
|
1388
|
+
align-items: center;
|
|
1389
|
+
position: relative;
|
|
1390
|
+
box-sizing: border-box;
|
|
1391
|
+
width: 100%;
|
|
1392
|
+
min-width: 320px;
|
|
1393
|
+
background-color: ${({theme:e})=>y(e,"colors").background};
|
|
1394
|
+
border: 1px solid
|
|
1395
|
+
${({theme:e,error:t,focused:o})=>t?y(e,"colors").error:o?m(e,"input").activeBorderColor:y(e,"colors").border};
|
|
1396
|
+
border-radius: ${({theme:e})=>m(e,"input").borderRadius};
|
|
1397
|
+
padding: 4px 11px;
|
|
1398
|
+
transition: all 0.2s;
|
|
1399
|
+
|
|
1400
|
+
&:hover {
|
|
1401
|
+
border-color: ${({theme:e,error:t,focused:o,disabled:n})=>n?y(e,"colors").border:t?y(e,"colors").error:o?m(e,"input").activeBorderColor:m(e,"input").hoverBorderColor};
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
${({disabled:e,theme:t})=>e&&`
|
|
1405
|
+
background-color: ${y(t,"colors").backgroundSecondary};
|
|
1406
|
+
cursor: not-allowed;
|
|
1407
|
+
opacity: 0.6;
|
|
1408
|
+
`}
|
|
1409
|
+
`,vr=de.default.input`
|
|
1410
|
+
flex: 1;
|
|
1411
|
+
border: none;
|
|
1412
|
+
outline: none;
|
|
1413
|
+
background: transparent;
|
|
1414
|
+
padding: 0;
|
|
1415
|
+
margin: 0;
|
|
1416
|
+
color: ${({theme:e})=>y(e,"colors").text};
|
|
1417
|
+
font-size: 14px;
|
|
1418
|
+
width: 100%;
|
|
1419
|
+
text-align: center;
|
|
1420
|
+
|
|
1421
|
+
&::placeholder {
|
|
1422
|
+
color: ${({theme:e})=>y(e,"colors").textDisabled};
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
&:disabled {
|
|
1426
|
+
cursor: not-allowed;
|
|
1427
|
+
}
|
|
1428
|
+
`,Ja=de.default.span`
|
|
1429
|
+
color: ${({theme:e})=>y(e,"colors").textSecondary};
|
|
1430
|
+
margin: 0 8px;
|
|
1431
|
+
flex-shrink: 0;
|
|
1432
|
+
`,Za=de.default.div`
|
|
1433
|
+
position: absolute;
|
|
1434
|
+
bottom: -1px;
|
|
1435
|
+
height: 2px;
|
|
1436
|
+
background-color: ${({theme:e})=>y(e,"colors").primary};
|
|
1437
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
1438
|
+
left: ${({position:e})=>e==="left"?"0":"50%"};
|
|
1439
|
+
width: 50%;
|
|
1440
|
+
pointer-events: none;
|
|
1441
|
+
opacity: 1;
|
|
1442
|
+
z-index: 1;
|
|
1443
|
+
`,Rt=de.default.span`
|
|
1444
|
+
display: flex;
|
|
1445
|
+
align-items: center;
|
|
1446
|
+
color: ${({theme:e})=>y(e,"colors").textSecondary};
|
|
1447
|
+
margin-left: 8px;
|
|
1448
|
+
width: 16px;
|
|
1449
|
+
justify-content: center;
|
|
1450
|
+
font-size: 14px;
|
|
1451
|
+
transition: color 0.2s;
|
|
1452
|
+
|
|
1453
|
+
&:hover {
|
|
1454
|
+
color: ${({theme:e})=>y(e,"colors").text};
|
|
1455
|
+
}
|
|
1456
|
+
`;var $=require("react/jsx-runtime"),oi=es.default.div`
|
|
1457
|
+
border-top: 1px solid rgba(0, 0, 0, 0.06);
|
|
1458
|
+
padding: 8px 16px;
|
|
1459
|
+
display: flex;
|
|
1460
|
+
justify-content: flex-end;
|
|
1461
|
+
align-items: center;
|
|
1462
|
+
`,ts=Be.default.forwardRef((e,t)=>{let{value:o,defaultValue:n,onChange:a,picker:r="date",showTime:s=!1,format:c,disabled:d=!1,placeholder:p,clearable:u=!1,className:f,style:b,fullWidth:g=!1,...l}=e,[i,k]=(0,Be.useState)(!1),[v,C]=(0,Be.useState)(o||n||null),[w,T]=(0,Be.useState)(r==="week"?"date":r),[B,_]=(0,Be.useState)(null),[A,I]=(0,Be.useState)(!1),S=z=>{z.stopPropagation(),C(null),a?.(null)},{locale:q}=Me(),M=q?.DatePicker||Le.DatePicker;(0,Be.useEffect)(()=>{o!==void 0&&C(o)},[o]),(0,Be.useEffect)(()=>{i&&T(r==="week"?"date":r)},[i,r]);let{viewDate:D,days:re,nextMonth:Z,prevMonth:Y,nextYear:j,prevYear:ge,setYear:se,setViewDate:he}=Io({value:v}),{refs:P,floatingStyles:N,context:x}=(0,me.useFloating)({open:i,onOpenChange:k,middleware:[(0,me.offset)(4),(0,me.flip)(),(0,me.shift)()],whileElementsMounted:me.autoUpdate,placement:"bottom-start"}),ee=(0,me.useDismiss)(x),{getReferenceProps:R,getFloatingProps:O}=(0,me.useInteractions)([ee]),ae=z=>{if(v&&w==="date"&&(z.setHours(v.getHours()),z.setMinutes(v.getMinutes()),z.setSeconds(v.getSeconds())),r==="week"){let X=(0,ce.startOfWeek)(z,{weekStartsOn:1});C(X),a?.(X),k(!1)}else C(z),s&&r==="date"||(a?.(z),k(!1))},Re=z=>{C(z)},V=(z,X)=>{he(z),r===X?ae(z):X==="year"?T(r==="quarter"?"quarter":"month"):X==="month"&&T("date")},H=()=>{a?.(v),k(!1)},te=v?(0,ce.format)(v,c||(s&&r==="date"?M.dateTimeFormat||"yyyy-MM-dd HH:mm:ss":r==="year"?M.yearFormat||"yyyy":r==="month"?"yyyy-MM":r==="quarter"?M.quarterFormat||"yyyy-QQQ":r==="week"?M.weekFormat||"yyyy-wo":M.dateFormat||"yyyy-MM-dd")):"",Dt=M.shortWeekDays,F=()=>{switch(w){case"year":{let z=Math.floor(D.getFullYear()/10)*10;return(0,$.jsxs)(Pt,{children:[(0,$.jsx)(Pe,{onClick:()=>se(D.getFullYear()-10),children:(0,$.jsx)(Ze,{})}),(0,$.jsx)(Tt,{children:`${z}-${z+9}`}),(0,$.jsx)(Pe,{onClick:()=>se(D.getFullYear()+10),children:(0,$.jsx)(et,{})})]})}case"month":case"quarter":return(0,$.jsxs)(Pt,{children:[(0,$.jsx)(Pe,{onClick:ge,children:(0,$.jsx)(Ze,{})}),(0,$.jsx)(Tt,{onClick:()=>T("year"),children:(0,ce.format)(D,M.yearFormat)}),(0,$.jsx)(Pe,{onClick:j,children:(0,$.jsx)(et,{})})]});default:return(0,$.jsxs)(Pt,{children:[(0,$.jsxs)(Mt,{children:[(0,$.jsx)(Pe,{onClick:ge,children:(0,$.jsx)(Ze,{})}),(0,$.jsx)(Pe,{onClick:Y,children:(0,$.jsx)(nt,{})})]}),(0,$.jsx)(Tt,{onClick:()=>T("month"),children:M.monthBeforeYear?`${(0,ce.format)(D,M.monthFormat)} ${(0,ce.format)(D,M.yearFormat)}`:`${(0,ce.format)(D,M.yearFormat)} ${(0,ce.format)(D,M.monthFormat)}`}),(0,$.jsxs)(Mt,{children:[(0,$.jsx)(Pe,{onClick:Z,children:(0,$.jsx)(at,{})}),(0,$.jsx)(Pe,{onClick:j,children:(0,$.jsx)(et,{})})]})]})}},U=()=>{switch(w){case"year":return(0,$.jsx)(Ga,{viewDate:D,selectedDate:v,onSelect:z=>V(z,"year")});case"month":return(0,$.jsx)(qa,{viewDate:D,selectedDate:v,onSelect:z=>V(z,"month")});case"quarter":return(0,$.jsx)(Qa,{viewDate:D,selectedDate:v,onSelect:z=>V(z,"quarter")});default:{let z=r==="week";return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Oo,{showWeekNumber:z,children:[z&&(0,$.jsx)(eo,{}),Dt.map(X=>(0,$.jsx)(eo,{children:X},X))]}),(0,$.jsx)(Wo,{showWeekNumber:z,onMouseLeave:()=>_(null),children:re.map((X,It)=>{let zt=X.isSelected;if(r==="week"&&v){let le=(0,ce.startOfWeek)(v,{weekStartsOn:1}),Fe=(0,ce.endOfWeek)(v,{weekStartsOn:1});zt=(0,ce.isWithinInterval)(X.date,{start:le,end:Fe})}let Ht=!1;if(r==="week"&&B){let le=(0,ce.startOfWeek)(B,{weekStartsOn:1}),Fe=(0,ce.endOfWeek)(B,{weekStartsOn:1});Ht=(0,ce.isWithinInterval)(X.date,{start:le,end:Fe})}let E=It%7===0,G=It%7===6;return(0,$.jsxs)(Be.default.Fragment,{children:[z&&E&&(0,$.jsx)(Ua,{isSelected:zt,isHovered:Ht,onClick:()=>ae(X.date),onMouseEnter:()=>_(X.date),children:(0,ce.getISOWeek)(X.date)}),(0,$.jsx)(Ao,{isCurrentMonth:X.isCurrentMonth,isToday:X.isToday,isSelected:zt,isWeekMode:z,isWeekEnd:G,isHovered:Ht,onClick:()=>ae(X.date),onMouseEnter:()=>_(X.date),children:(0,ce.format)(X.date,"d")})]},It)})})]})}}};return(0,$.jsxs)(No,{ref:t,className:`compass-date-picker ${f||""}`,style:b,fullWidth:g,children:[(0,$.jsx)("div",{ref:P.setReference,...R(),onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),children:(0,$.jsx)(mo,{...l,fullWidth:g,placeholder:p||M.dateSelect,value:te,readOnly:!0,disabled:d,onClick:()=>!d&&k(!i),onChange:z=>{z.target.value||(C(null),a?.(null))},suffix:u&&A&&te?(0,$.jsx)(Rt,{onClick:S,style:{cursor:"pointer"},onMouseDown:z=>{z.preventDefault()},children:(0,$.jsx)(Je,{})}):(0,$.jsx)(Rt,{children:(0,$.jsx)(io,{})})})}),i&&(0,$.jsx)(me.FloatingPortal,{children:(0,$.jsx)(me.FloatingFocusManager,{context:x,modal:!1,children:(0,$.jsx)("div",{ref:P.setFloating,style:{...N,zIndex:1e3},...O(),children:(0,$.jsxs)(Fo,{children:[F(),(0,$.jsxs)(Eo,{children:[(0,$.jsx)(Lo,{children:U()}),s&&r==="date"&&w==="date"&&(0,$.jsx)(Bo,{value:v,onChange:Re})]}),s&&r==="date"&&(0,$.jsxs)(oi,{children:[(0,$.jsx)("div",{})," ",(0,$.jsx)(Se,{size:"small",variant:"primary",onClick:H,children:M.ok})]})]})})})})]})}),os=ts;ts.displayName="DatePicker";var Ne=L(require("react")),fe=require("@floating-ui/react"),pe=require("date-fns"),rs=L(require("@emotion/styled"));var W=require("react/jsx-runtime"),ri=rs.default.div`
|
|
1463
|
+
border-top: 1px solid rgba(0, 0, 0, 0.06);
|
|
1464
|
+
padding: 8px 16px;
|
|
1465
|
+
display: flex;
|
|
1466
|
+
justify-content: flex-end;
|
|
1467
|
+
align-items: center;
|
|
1468
|
+
`,ns=Ne.default.forwardRef((e,t)=>{let{value:o,defaultValue:n,onChange:a,showTime:r=!1,format:s,disabled:c=!1,placeholder:d,clearable:p=!1,className:u,style:f,fullWidth:b=!1}=e,[g,l]=(0,Ne.useState)(!1),[i,k]=(0,Ne.useState)(o||n||[null,null]),[v,C]=(0,Ne.useState)(null),[w,T]=(0,Ne.useState)(null),[B,_]=(0,Ne.useState)(!1),A=(0,Ne.useRef)(!1);(0,Ne.useEffect)(()=>{o!==void 0&&k(o)},[o]);let{viewDate:I,days:S,nextMonth:q,prevMonth:M,nextYear:D,prevYear:re,setViewDate:Z}=Io({value:i[0]||new Date}),{locale:Y}=Me(),j=Y?.DatePicker||Le.DatePicker,ge=F=>{!F&&(!i[0]||!i[1])&&(k([null,null]),C(null)),l(F)},{refs:se,floatingStyles:he,context:P}=(0,fe.useFloating)({open:g,onOpenChange:ge,middleware:[(0,fe.offset)(4),(0,fe.flip)(),(0,fe.shift)()],whileElementsMounted:fe.autoUpdate,placement:"bottom-start"}),N=(0,fe.useDismiss)(P),{getReferenceProps:x,getFloatingProps:ee}=(0,fe.useInteractions)([N]),R=F=>{if(v==="start"){let U=[F,i[1]];U[1]&&(0,pe.isAfter)(F,U[1])&&(U[1]=null),k(U),r||(A.current&&U[0]&&U[1]?(a?.(U),l(!1),C(null)):(A.current=!0,C("end")))}else if(v==="end"){let U=[i[0],F];U[0]&&(0,pe.isBefore)(F,U[0])&&(U[0]=F,U[1]=i[0]),k(U),r||(A.current&&U[0]&&U[1]?(a?.(U),l(!1),C(null)):(A.current=!0,C("start")))}},O=(F,U)=>{let z=[...i];U==="start"?z[0]=F:z[1]=F,k(z)},ae=()=>{if(!i[0]){C("start");return}if(!i[1]){C("end");return}a?.(i),l(!1),C(null)},Re=F=>{c||(l(!0),A.current=!1,C(F),F==="start"&&i[0]?Z(i[0]):F==="end"&&i[1]&&Z(i[1]))},V=F=>{F.stopPropagation(),k([null,null]),a?.([null,null]),C(null)},H=()=>s||(r?"yyyy-MM-dd HH:mm:ss":"yyyy-MM-dd"),De=F=>{if(i[0]&&i[1])return(0,pe.isWithinInterval)(F,{start:i[0],end:i[1]});if(v==="end"&&i[0]&&w){let U=(0,pe.isBefore)(i[0],w)?i[0]:w,z=(0,pe.isBefore)(i[0],w)?w:i[0];return(0,pe.isWithinInterval)(F,{start:U,end:z})}return!1},te=F=>i[0]&&(0,pe.isSameDay)(F,i[0])||i[1]&&(0,pe.isSameDay)(F,i[1]),Dt=j.shortWeekDays;return(0,W.jsxs)(No,{ref:t,className:`compass-date-range-picker ${u||""}`,style:f,fullWidth:b,children:[(0,W.jsx)("div",{ref:se.setReference,...x(),children:(0,W.jsxs)(Xa,{focused:g,disabled:c,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:[(0,W.jsx)(vr,{placeholder:d?.[0]||j.startDate,value:i[0]?(0,pe.format)(i[0],H()):"",readOnly:!0,disabled:c,onClick:()=>Re("start")}),(0,W.jsx)(Ja,{children:"\u2192"}),(0,W.jsx)(vr,{placeholder:d?.[1]||j.endDate,value:i[1]?(0,pe.format)(i[1],H()):"",readOnly:!0,disabled:c,onClick:()=>Re("end")}),p&&B&&(i[0]||i[1])?(0,W.jsx)(Rt,{onClick:V,style:{cursor:"pointer"},role:"button","aria-label":"clear",children:(0,W.jsx)(Je,{})}):(0,W.jsx)(Rt,{children:(0,W.jsx)(io,{})}),g&&v&&(0,W.jsx)(Za,{position:v==="start"?"left":"right"})]})}),g&&(0,W.jsx)(fe.FloatingPortal,{children:(0,W.jsx)(fe.FloatingFocusManager,{context:P,modal:!1,children:(0,W.jsx)("div",{ref:se.setFloating,style:{...he,zIndex:1e3},...ee(),children:(0,W.jsxs)(Fo,{children:[(0,W.jsxs)(Pt,{children:[(0,W.jsxs)(Mt,{children:[(0,W.jsx)(Pe,{onClick:re,children:(0,W.jsx)(Ze,{})}),(0,W.jsx)(Pe,{onClick:M,children:(0,W.jsx)(nt,{})})]}),(0,W.jsx)(Tt,{children:j.monthBeforeYear?`${(0,pe.format)(I,j.monthFormat)} ${(0,pe.format)(I,j.yearFormat)}`:`${(0,pe.format)(I,j.yearFormat)} ${(0,pe.format)(I,j.monthFormat)}`}),(0,W.jsxs)(Mt,{children:[(0,W.jsx)(Pe,{onClick:q,children:(0,W.jsx)(at,{})}),(0,W.jsx)(Pe,{onClick:D,children:(0,W.jsx)(et,{})})]})]}),(0,W.jsxs)(Eo,{children:[(0,W.jsxs)(Lo,{children:[(0,W.jsx)(Oo,{children:Dt.map(F=>(0,W.jsx)(eo,{children:F},F))}),(0,W.jsx)(Wo,{children:S.map((F,U)=>{let z=De(F.date),X=te(F.date);return(0,W.jsx)(Ao,{isCurrentMonth:F.isCurrentMonth,isToday:F.isToday,isSelected:!!X,isInRange:z&&!X,onClick:()=>R(F.date),onMouseEnter:()=>T(F.date),onMouseLeave:()=>T(null),children:(0,pe.format)(F.date,"d")},U)})})]}),r&&v&&(0,W.jsx)(Bo,{value:v==="start"?i[0]:i[1],onChange:F=>O(F,v)})]}),r&&(0,W.jsx)(ri,{children:(0,W.jsx)(Se,{size:"small",variant:"primary",onClick:ae,disabled:v==="start"?!i[0]:!i[1],children:j.ok})})]})})})})]})}),as=ns;ns.displayName="DateRangePicker";var ss=os;ss.RangePicker=as;var is=ss;0&&(module.exports={Button,ConfigProvider,DatePicker,Dropdown,InputField,InputNumber,Menu,Message,Modal,Pagination,Progress,Select,Steps,Tree});
|