@mw-kit/mw-ui 1.8.21 → 1.9.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/dist/components/Input/components/Select/hooks/Select/interfaces.d.ts +1 -0
- package/dist/components/Input/components/Select/hooks/SelectMultiple/interfaces.d.ts +1 -0
- package/dist/components/Popup/hooks/fallbackPlacements/index.d.ts +3 -0
- package/dist/components/Popup/hooks/index.d.ts +2 -0
- package/dist/components/Popup/hooks/open/index.d.ts +3 -0
- package/dist/components/Popup/index.d.ts +6 -0
- package/dist/components/Popup/styles.d.ts +9 -0
- package/dist/components/Popup/types.d.ts +17 -0
- package/dist/components/Select/components/Apply/index.d.ts +7 -0
- package/dist/components/Select/components/Apply/styles.d.ts +1 -0
- package/dist/components/Select/components/Scroll/index.d.ts +20 -0
- package/dist/components/Select/components/Scroll/styles.d.ts +9 -0
- package/dist/components/Select/components/Search/index.d.ts +7 -0
- package/dist/components/Select/components/Search/styles.d.ts +1 -0
- package/dist/components/Select/constants.d.ts +2 -0
- package/dist/components/Select/hooks/index.d.ts +5 -0
- package/dist/components/Select/hooks/useAsyncOptions/index.d.ts +8 -0
- package/dist/components/Select/hooks/useFloatingMenu/index.d.ts +50 -0
- package/dist/components/Select/hooks/useListNavigation/index.d.ts +13 -0
- package/dist/components/Select/hooks/useRuleIndex/index.d.ts +11 -0
- package/dist/components/Select/hooks/useVirtualizedOptions/index.d.ts +13 -0
- package/dist/components/Select/index.d.ts +6 -0
- package/dist/components/Select/instances/index.d.ts +3 -0
- package/dist/components/Select/instances/multi/index.d.ts +3 -0
- package/dist/components/Select/instances/single/index.d.ts +3 -0
- package/dist/components/Select/instances/styles.d.ts +3 -0
- package/dist/components/Select/instances/types.d.ts +12 -0
- package/dist/components/Select/styles.d.ts +14 -0
- package/dist/components/Select/types.d.ts +75 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/useDebouncedCallback/index.d.ts +8 -0
- package/dist/hooks/useDebouncedState/index.d.ts +5 -0
- package/dist/index.d.mts +85 -3
- package/dist/index.js +2399 -517
- package/dist/index.mjs +2399 -497
- package/dist/interfaces.d.ts +2 -1
- package/package.json +5 -1
- /package/dist/hooks/{onClickOut.d.ts → useOnClickOut/index.d.ts} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -640,36 +640,36 @@ var positions = {
|
|
|
640
640
|
`
|
|
641
641
|
};
|
|
642
642
|
var pointerPositions = {
|
|
643
|
-
"top right": (distance,
|
|
643
|
+
"top right": (distance, size4) => css2`
|
|
644
644
|
top: ${distance};
|
|
645
|
-
left: calc(${
|
|
645
|
+
left: calc(${size4} / 2 * -1);
|
|
646
646
|
`,
|
|
647
|
-
"top left": (distance,
|
|
647
|
+
"top left": (distance, size4) => css2`
|
|
648
648
|
top: ${distance};
|
|
649
|
-
right: calc(${
|
|
649
|
+
right: calc(${size4} / 2 * -1);
|
|
650
650
|
`,
|
|
651
|
-
"bottom right": (distance,
|
|
651
|
+
"bottom right": (distance, size4) => css2`
|
|
652
652
|
bottom: ${distance};
|
|
653
|
-
left: calc(${
|
|
653
|
+
left: calc(${size4} / 2 * -1);
|
|
654
654
|
`,
|
|
655
|
-
"bottom left": (distance,
|
|
655
|
+
"bottom left": (distance, size4) => css2`
|
|
656
656
|
bottom: ${distance};
|
|
657
|
-
right: calc(${
|
|
657
|
+
right: calc(${size4} / 2 * -1);
|
|
658
658
|
`,
|
|
659
|
-
"right top": (distance,
|
|
660
|
-
bottom: calc(${
|
|
659
|
+
"right top": (distance, size4) => css2`
|
|
660
|
+
bottom: calc(${size4} / 2 * -1);
|
|
661
661
|
right: ${distance};
|
|
662
662
|
`,
|
|
663
|
-
"right bottom": (distance,
|
|
664
|
-
top: calc(${
|
|
663
|
+
"right bottom": (distance, size4) => css2`
|
|
664
|
+
top: calc(${size4} / 2 * -1);
|
|
665
665
|
right: ${distance};
|
|
666
666
|
`,
|
|
667
|
-
"left top": (distance,
|
|
668
|
-
bottom: calc(${
|
|
667
|
+
"left top": (distance, size4) => css2`
|
|
668
|
+
bottom: calc(${size4} / 2 * -1);
|
|
669
669
|
left: ${distance};
|
|
670
670
|
`,
|
|
671
|
-
"left bottom": (distance,
|
|
672
|
-
top: calc(${
|
|
671
|
+
"left bottom": (distance, size4) => css2`
|
|
672
|
+
top: calc(${size4} / 2 * -1);
|
|
673
673
|
left: ${distance};
|
|
674
674
|
`
|
|
675
675
|
};
|
|
@@ -759,7 +759,7 @@ var Container = styled.div`
|
|
|
759
759
|
distance: "s1",
|
|
760
760
|
...pointer === true ? {} : pointer
|
|
761
761
|
};
|
|
762
|
-
const
|
|
762
|
+
const size4 = typeof config.size === "function" ? config.size(theme4) : isKeyOf(theme4.spacings, config.size) ? theme4.spacings[config.size] : config.size;
|
|
763
763
|
const distance = typeof config.distance === "function" ? config.distance(theme4) : isKeyOf(theme4.spacings, config.distance) ? theme4.spacings[config.distance] : config.distance;
|
|
764
764
|
const color = typeof config.color === "function" ? config.color(theme4) : isKeyOf(theme4.colors, config.color) ? theme4.colors[config.color] : config.color;
|
|
765
765
|
return css2`
|
|
@@ -768,10 +768,10 @@ var Container = styled.div`
|
|
|
768
768
|
|
|
769
769
|
position: absolute;
|
|
770
770
|
|
|
771
|
-
${pointerPositions[position](distance,
|
|
771
|
+
${pointerPositions[position](distance, size4)}
|
|
772
772
|
|
|
773
|
-
width: ${
|
|
774
|
-
height: ${
|
|
773
|
+
width: ${size4};
|
|
774
|
+
height: ${size4};
|
|
775
775
|
|
|
776
776
|
transform: rotate(45deg);
|
|
777
777
|
|
|
@@ -912,7 +912,7 @@ var loader = keyframes`
|
|
|
912
912
|
`;
|
|
913
913
|
var Container2 = styled2.div`
|
|
914
914
|
${({
|
|
915
|
-
$size:
|
|
915
|
+
$size: size4,
|
|
916
916
|
$borderSize: borderSize,
|
|
917
917
|
$bgColor: bgColor,
|
|
918
918
|
$color: color,
|
|
@@ -920,9 +920,9 @@ var Container2 = styled2.div`
|
|
|
920
920
|
$filled: filled,
|
|
921
921
|
$zIndex: zIndex
|
|
922
922
|
}) => {
|
|
923
|
-
const s = borderSize ||
|
|
923
|
+
const s = borderSize || size4;
|
|
924
924
|
borderSize = s ? `calc(${s} * 0.0757)` : "5px";
|
|
925
|
-
|
|
925
|
+
size4 = size4 || "48px";
|
|
926
926
|
color = color || "blue";
|
|
927
927
|
bgColor = bgColor || color;
|
|
928
928
|
const beforeColor = isKeyOf(theme4.colors, bgColor) ? theme4.getColor(bgColor, 25) : color;
|
|
@@ -950,10 +950,10 @@ var Container2 = styled2.div`
|
|
|
950
950
|
position: absolute;
|
|
951
951
|
content: '';
|
|
952
952
|
|
|
953
|
-
top: calc(50% - ${
|
|
954
|
-
left: calc(50% - ${
|
|
955
|
-
width: ${
|
|
956
|
-
height: ${
|
|
953
|
+
top: calc(50% - ${size4} / 2);
|
|
954
|
+
left: calc(50% - ${size4} / 2);
|
|
955
|
+
width: ${size4};
|
|
956
|
+
height: ${size4};
|
|
957
957
|
border-radius: 50%;
|
|
958
958
|
border-width: ${borderSize};
|
|
959
959
|
border-style: solid;
|
|
@@ -974,7 +974,7 @@ var Container2 = styled2.div`
|
|
|
974
974
|
var Loader = ({
|
|
975
975
|
color,
|
|
976
976
|
bgColor,
|
|
977
|
-
size:
|
|
977
|
+
size: size4,
|
|
978
978
|
borderSize,
|
|
979
979
|
filled,
|
|
980
980
|
zIndex,
|
|
@@ -986,7 +986,7 @@ var Loader = ({
|
|
|
986
986
|
...props,
|
|
987
987
|
$color: color,
|
|
988
988
|
$bgColor: bgColor,
|
|
989
|
-
$size:
|
|
989
|
+
$size: size4,
|
|
990
990
|
$borderSize: borderSize,
|
|
991
991
|
$filled: filled,
|
|
992
992
|
$zIndex: zIndex
|
|
@@ -1040,13 +1040,13 @@ var Button = styled3.button`
|
|
|
1040
1040
|
position: relative;
|
|
1041
1041
|
user-select: none;
|
|
1042
1042
|
|
|
1043
|
-
${({ $size:
|
|
1043
|
+
${({ $size: size4, theme: theme4 }) => {
|
|
1044
1044
|
const { sizes: sizes3 } = theme4.components.button;
|
|
1045
1045
|
return css4`
|
|
1046
|
-
font-size: ${sizes3[
|
|
1047
|
-
line-height: ${sizes3[
|
|
1048
|
-
min-width: ${sizes3[
|
|
1049
|
-
min-height: ${sizes3[
|
|
1046
|
+
font-size: ${sizes3[size4].fontSize};
|
|
1047
|
+
line-height: ${sizes3[size4].lineHeight};
|
|
1048
|
+
min-width: ${sizes3[size4].minWidth};
|
|
1049
|
+
min-height: ${sizes3[size4].minHeight};
|
|
1050
1050
|
`;
|
|
1051
1051
|
}};
|
|
1052
1052
|
|
|
@@ -1130,13 +1130,13 @@ var Button = styled3.button`
|
|
|
1130
1130
|
// src/components/Button/index.tsx
|
|
1131
1131
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
1132
1132
|
var Button2 = (props) => {
|
|
1133
|
-
const { children, content, ...
|
|
1133
|
+
const { children, content, ...styled85 } = props;
|
|
1134
1134
|
const defaultValues = {
|
|
1135
|
-
$appearance:
|
|
1136
|
-
$color:
|
|
1137
|
-
$loading:
|
|
1138
|
-
$size:
|
|
1139
|
-
type:
|
|
1135
|
+
$appearance: styled85.appearance || "solid",
|
|
1136
|
+
$color: styled85.color,
|
|
1137
|
+
$loading: styled85.loading ? +styled85.loading : 0,
|
|
1138
|
+
$size: styled85.size || "small",
|
|
1139
|
+
type: styled85.type || "button"
|
|
1140
1140
|
};
|
|
1141
1141
|
const htmlProps = filterObject(props, ["size", "appearance", "color", "loading", "content"]);
|
|
1142
1142
|
const loaderSize = sizes[defaultValues.$size].lineHeight;
|
|
@@ -1190,13 +1190,86 @@ var inputTimeWidth = {
|
|
|
1190
1190
|
};
|
|
1191
1191
|
|
|
1192
1192
|
// src/components/Calendar/components/Basic/components/Main/index.tsx
|
|
1193
|
-
import React6, { useEffect as
|
|
1193
|
+
import React6, { useEffect as useEffect7, useState as useState8 } from "react";
|
|
1194
|
+
|
|
1195
|
+
// src/hooks/useDebouncedCallback/index.ts
|
|
1196
|
+
import { useEffect as useEffect3, useMemo } from "react";
|
|
1197
|
+
var debounce = (fn, delay) => {
|
|
1198
|
+
let timeout = null;
|
|
1199
|
+
let lastArgs = null;
|
|
1200
|
+
const debounced = (...args) => {
|
|
1201
|
+
lastArgs = args;
|
|
1202
|
+
if (timeout !== null) {
|
|
1203
|
+
clearTimeout(timeout);
|
|
1204
|
+
}
|
|
1205
|
+
timeout = setTimeout(() => {
|
|
1206
|
+
if (lastArgs !== null) {
|
|
1207
|
+
fn(...lastArgs);
|
|
1208
|
+
lastArgs = null;
|
|
1209
|
+
}
|
|
1210
|
+
timeout = null;
|
|
1211
|
+
}, delay);
|
|
1212
|
+
};
|
|
1213
|
+
debounced.cancel = () => {
|
|
1214
|
+
if (timeout !== null) {
|
|
1215
|
+
clearTimeout(timeout);
|
|
1216
|
+
timeout = null;
|
|
1217
|
+
}
|
|
1218
|
+
lastArgs = null;
|
|
1219
|
+
};
|
|
1220
|
+
debounced.flush = () => {
|
|
1221
|
+
if (timeout !== null) {
|
|
1222
|
+
clearTimeout(timeout);
|
|
1223
|
+
timeout = null;
|
|
1224
|
+
}
|
|
1225
|
+
if (lastArgs !== null) {
|
|
1226
|
+
fn(...lastArgs);
|
|
1227
|
+
lastArgs = null;
|
|
1228
|
+
}
|
|
1229
|
+
};
|
|
1230
|
+
return debounced;
|
|
1231
|
+
};
|
|
1232
|
+
var useDebouncedCallback = (callback, delay) => {
|
|
1233
|
+
const debounced = useMemo(() => debounce(callback, delay), [callback, delay]);
|
|
1234
|
+
useEffect3(() => {
|
|
1235
|
+
return () => {
|
|
1236
|
+
debounced.cancel();
|
|
1237
|
+
};
|
|
1238
|
+
}, [debounced]);
|
|
1239
|
+
return debounced;
|
|
1240
|
+
};
|
|
1241
|
+
var useDebouncedCallback_default = useDebouncedCallback;
|
|
1242
|
+
|
|
1243
|
+
// src/hooks/useDebouncedState/index.ts
|
|
1244
|
+
import { useCallback as useCallback2, useState as useState3 } from "react";
|
|
1245
|
+
var useDebouncedState = (initial, onUpdate, ms) => {
|
|
1246
|
+
const [state, setState] = useState3({ current: initial, debounced: initial });
|
|
1247
|
+
const onUpdateSearch = useDebouncedCallback_default(
|
|
1248
|
+
useCallback2((search) => {
|
|
1249
|
+
onUpdate();
|
|
1250
|
+
setState((prev) => ({ ...prev, debounced: search }));
|
|
1251
|
+
}, []),
|
|
1252
|
+
ms
|
|
1253
|
+
);
|
|
1254
|
+
const setCurrent = (input) => {
|
|
1255
|
+
setState((prev) => ({ ...prev, current: input }));
|
|
1256
|
+
onUpdateSearch(input);
|
|
1257
|
+
};
|
|
1258
|
+
const setDebounced = (value) => {
|
|
1259
|
+
setState({ current: value, debounced: value });
|
|
1260
|
+
};
|
|
1261
|
+
return {
|
|
1262
|
+
current: [state.current, setCurrent],
|
|
1263
|
+
debounced: [state.debounced, setDebounced]
|
|
1264
|
+
};
|
|
1265
|
+
};
|
|
1266
|
+
var useDebouncedState_default = useDebouncedState;
|
|
1194
1267
|
|
|
1195
|
-
// src/hooks/
|
|
1196
|
-
import { useEffect as
|
|
1268
|
+
// src/hooks/useOnClickOut/index.ts
|
|
1269
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
1197
1270
|
var useOnClickOut = (callback) => {
|
|
1198
|
-
const [ref, setRef] =
|
|
1199
|
-
|
|
1271
|
+
const [ref, setRef] = useState4(null);
|
|
1272
|
+
useEffect4(() => {
|
|
1200
1273
|
const listener = (event) => {
|
|
1201
1274
|
if (!ref || ref.contains(event.target)) {
|
|
1202
1275
|
return;
|
|
@@ -1212,10 +1285,10 @@ var useOnClickOut = (callback) => {
|
|
|
1212
1285
|
}, [ref, callback]);
|
|
1213
1286
|
return setRef;
|
|
1214
1287
|
};
|
|
1215
|
-
var
|
|
1288
|
+
var useOnClickOut_default = useOnClickOut;
|
|
1216
1289
|
|
|
1217
1290
|
// src/theme/index.tsx
|
|
1218
|
-
import { useMemo } from "react";
|
|
1291
|
+
import { useMemo as useMemo2 } from "react";
|
|
1219
1292
|
import { ThemeProvider as Provider, css as css5 } from "styled-components";
|
|
1220
1293
|
|
|
1221
1294
|
// src/assets/helpers.ts
|
|
@@ -1663,7 +1736,7 @@ var theme3 = {
|
|
|
1663
1736
|
components: theme_default2
|
|
1664
1737
|
};
|
|
1665
1738
|
var ThemeProvider = (props) => {
|
|
1666
|
-
const value =
|
|
1739
|
+
const value = useMemo2(() => {
|
|
1667
1740
|
return {
|
|
1668
1741
|
...theme3,
|
|
1669
1742
|
assetUrl: (asset) => assetUrl(asset, props.assetBaseUrl)
|
|
@@ -8690,14 +8763,14 @@ var getInitialCalendar = (date, min, max) => {
|
|
|
8690
8763
|
};
|
|
8691
8764
|
|
|
8692
8765
|
// src/components/Calendar/components/Basic/components/MonthPicker/index.tsx
|
|
8693
|
-
import { useEffect as
|
|
8766
|
+
import { useEffect as useEffect6, useState as useState7 } from "react";
|
|
8694
8767
|
|
|
8695
8768
|
// src/components/Menu/index.tsx
|
|
8696
|
-
import React4, { useEffect as
|
|
8769
|
+
import React4, { useEffect as useEffect5, useState as useState6 } from "react";
|
|
8697
8770
|
import { Popup } from "semantic-ui-react";
|
|
8698
8771
|
|
|
8699
8772
|
// src/components/ScrollContainer/index.tsx
|
|
8700
|
-
import React3, { useState as
|
|
8773
|
+
import React3, { useState as useState5 } from "react";
|
|
8701
8774
|
|
|
8702
8775
|
// src/components/ScrollContainer/styles/BeforeAfterContainer/index.ts
|
|
8703
8776
|
import styled5, { css as css7 } from "styled-components";
|
|
@@ -8841,7 +8914,7 @@ var ScrollContainer = React3.forwardRef(
|
|
|
8841
8914
|
const { loading } = props;
|
|
8842
8915
|
const onScrollEnd = props.onScrollEnd || (() => {
|
|
8843
8916
|
});
|
|
8844
|
-
const [, setLastPagination] =
|
|
8917
|
+
const [, setLastPagination] = useState5(/* @__PURE__ */ new Date());
|
|
8845
8918
|
const onScroll = (event) => {
|
|
8846
8919
|
if (event.target !== event.currentTarget) return;
|
|
8847
8920
|
const target = event.nativeEvent.target;
|
|
@@ -9033,8 +9106,8 @@ var isVisible = (elem, bound) => {
|
|
|
9033
9106
|
};
|
|
9034
9107
|
var MenuComponent = (props, ref) => {
|
|
9035
9108
|
const { close, options, children, highlight } = { ...props };
|
|
9036
|
-
const [scrollRef, setScrollRef] =
|
|
9037
|
-
|
|
9109
|
+
const [scrollRef, setScrollRef] = useState6(null);
|
|
9110
|
+
useEffect5(() => {
|
|
9038
9111
|
if (!scrollRef || highlight === void 0) return;
|
|
9039
9112
|
const element = scrollRef.children[highlight];
|
|
9040
9113
|
if (!element) return;
|
|
@@ -9254,8 +9327,8 @@ var NavBtn = styled10.button`
|
|
|
9254
9327
|
import { jsx as jsx296, jsxs as jsxs145 } from "react/jsx-runtime";
|
|
9255
9328
|
var MonthPicker = (props) => {
|
|
9256
9329
|
const { setValue, close, min, max, year: initialYear, ...menuProps } = props;
|
|
9257
|
-
const [year, setYear] =
|
|
9258
|
-
|
|
9330
|
+
const [year, setYear] = useState7(initialYear);
|
|
9331
|
+
useEffect6(() => {
|
|
9259
9332
|
setYear(initialYear);
|
|
9260
9333
|
}, [props.open, initialYear]);
|
|
9261
9334
|
return /* @__PURE__ */ jsx296(
|
|
@@ -9357,9 +9430,9 @@ var Container6 = styled11.div`
|
|
|
9357
9430
|
display: block;
|
|
9358
9431
|
border-radius: 100%;
|
|
9359
9432
|
|
|
9360
|
-
${({ $size:
|
|
9361
|
-
width: ${sizes2[
|
|
9362
|
-
height: ${sizes2[
|
|
9433
|
+
${({ $size: size4 }) => css11`
|
|
9434
|
+
width: ${sizes2[size4]};
|
|
9435
|
+
height: ${sizes2[size4]};
|
|
9363
9436
|
`};
|
|
9364
9437
|
|
|
9365
9438
|
background-color: ${({ theme: { colors: colors2 }, $type: type }) => colors2[types[type]]};
|
|
@@ -9369,7 +9442,7 @@ var Container6 = styled11.div`
|
|
|
9369
9442
|
// src/components/Indicator/index.tsx
|
|
9370
9443
|
import { jsx as jsx297 } from "react/jsx-runtime";
|
|
9371
9444
|
var Indicator = ({
|
|
9372
|
-
size:
|
|
9445
|
+
size: size4,
|
|
9373
9446
|
type,
|
|
9374
9447
|
labelColor,
|
|
9375
9448
|
...props
|
|
@@ -9378,7 +9451,7 @@ var Indicator = ({
|
|
|
9378
9451
|
Container6,
|
|
9379
9452
|
{
|
|
9380
9453
|
...{
|
|
9381
|
-
$size:
|
|
9454
|
+
$size: size4 || "small",
|
|
9382
9455
|
$type: type || "default",
|
|
9383
9456
|
$labelColor: labelColor || "darkBlue",
|
|
9384
9457
|
...props
|
|
@@ -9524,8 +9597,8 @@ import { jsx as jsx298, jsxs as jsxs146 } from "react/jsx-runtime";
|
|
|
9524
9597
|
var Main = React6.forwardRef(
|
|
9525
9598
|
(props, ref) => {
|
|
9526
9599
|
const { getDay, initialMonth } = props;
|
|
9527
|
-
const [selectOpen, setSelectOpen] =
|
|
9528
|
-
const [loading, setLoading] =
|
|
9600
|
+
const [selectOpen, setSelectOpen] = useState8(false);
|
|
9601
|
+
const [loading, setLoading] = useState8(false);
|
|
9529
9602
|
const onChangeMonth = (() => {
|
|
9530
9603
|
const { onChangeMonth: onChangeMonth2 } = props;
|
|
9531
9604
|
if (!onChangeMonth2) return async () => {
|
|
@@ -9546,7 +9619,7 @@ var Main = React6.forwardRef(
|
|
|
9546
9619
|
date.setHours(0, 0, 0, 0);
|
|
9547
9620
|
return date;
|
|
9548
9621
|
})() : void 0;
|
|
9549
|
-
const [calendar, _setCalendar] = props.calendar ||
|
|
9622
|
+
const [calendar, _setCalendar] = props.calendar || useState8(getInitialCalendar(initialMonth, min, max));
|
|
9550
9623
|
const setCalendar = (value) => {
|
|
9551
9624
|
_setCalendar((prev) => {
|
|
9552
9625
|
const newv = typeof value === "function" ? value(prev) : value;
|
|
@@ -9554,7 +9627,7 @@ var Main = React6.forwardRef(
|
|
|
9554
9627
|
});
|
|
9555
9628
|
};
|
|
9556
9629
|
const isControlled = props.calendar !== void 0;
|
|
9557
|
-
|
|
9630
|
+
useEffect7(() => {
|
|
9558
9631
|
if (isControlled) return;
|
|
9559
9632
|
setCalendar(getInitialCalendar(initialMonth, min, max));
|
|
9560
9633
|
}, [
|
|
@@ -9563,7 +9636,7 @@ var Main = React6.forwardRef(
|
|
|
9563
9636
|
min?.toISOString(),
|
|
9564
9637
|
max?.toISOString()
|
|
9565
9638
|
]);
|
|
9566
|
-
|
|
9639
|
+
useEffect7(() => {
|
|
9567
9640
|
const [first, last] = [
|
|
9568
9641
|
calendar.weeks[0],
|
|
9569
9642
|
calendar.weeks[calendar.weeks.length - 1]
|
|
@@ -9613,7 +9686,7 @@ var Main = React6.forwardRef(
|
|
|
9613
9686
|
/* @__PURE__ */ jsxs146(Header, { children: [
|
|
9614
9687
|
/* @__PURE__ */ jsxs146(MonthContainer, { children: [
|
|
9615
9688
|
getPrev(),
|
|
9616
|
-
/* @__PURE__ */ jsxs146("div", { ref:
|
|
9689
|
+
/* @__PURE__ */ jsxs146("div", { ref: useOnClickOut_default(() => setSelectOpen(false)), children: [
|
|
9617
9690
|
(() => {
|
|
9618
9691
|
if (min !== void 0 && max !== void 0 && min.getFullYear() === max.getFullYear() && min.getMonth() === max.getMonth()) {
|
|
9619
9692
|
return /* @__PURE__ */ jsxs146(MonthName, { children: [
|
|
@@ -9755,13 +9828,13 @@ var Basic_default = BasicCalendar;
|
|
|
9755
9828
|
import React13 from "react";
|
|
9756
9829
|
|
|
9757
9830
|
// src/components/Calendar/components/Interval/components/Main/index.tsx
|
|
9758
|
-
import React12, { useEffect as
|
|
9831
|
+
import React12, { useEffect as useEffect9, useState as useState9 } from "react";
|
|
9759
9832
|
|
|
9760
9833
|
// src/components/Input/components/Time/index.tsx
|
|
9761
9834
|
import React11 from "react";
|
|
9762
9835
|
|
|
9763
9836
|
// src/components/Input/components/Input/index.tsx
|
|
9764
|
-
import React10, { useEffect as
|
|
9837
|
+
import React10, { useEffect as useEffect8, useMemo as useMemo3, useRef } from "react";
|
|
9765
9838
|
|
|
9766
9839
|
// src/components/Form/index.tsx
|
|
9767
9840
|
import React9 from "react";
|
|
@@ -10188,8 +10261,8 @@ var Input2 = React10.forwardRef(
|
|
|
10188
10261
|
props.name
|
|
10189
10262
|
);
|
|
10190
10263
|
const isComposing = useRef(false);
|
|
10191
|
-
const maskFn =
|
|
10192
|
-
|
|
10264
|
+
const maskFn = useMemo3(() => getMask(props.mask), [props.mask]);
|
|
10265
|
+
useEffect8(() => {
|
|
10193
10266
|
if (isComposing.current) return;
|
|
10194
10267
|
if (!isString(props.value)) return;
|
|
10195
10268
|
const masked = maskFn(props.value);
|
|
@@ -10563,12 +10636,12 @@ import { jsx as jsx305, jsxs as jsxs148 } from "react/jsx-runtime";
|
|
|
10563
10636
|
var Main2 = React12.forwardRef(
|
|
10564
10637
|
(props, ref) => {
|
|
10565
10638
|
const { initialMonth, initialValue, min, max } = props;
|
|
10566
|
-
const [value, setValue] = props.value ||
|
|
10567
|
-
const [invalid, setInvalid] = props.invalid ||
|
|
10568
|
-
const [time, setTime] =
|
|
10639
|
+
const [value, setValue] = props.value || useState9(getValue(initialValue || [], min, max));
|
|
10640
|
+
const [invalid, setInvalid] = props.invalid || useState9([false, false]);
|
|
10641
|
+
const [time, setTime] = useState9(() => {
|
|
10569
10642
|
return value.map(getTimeFromDate);
|
|
10570
10643
|
});
|
|
10571
|
-
const [calendar1, _setCalendar1] =
|
|
10644
|
+
const [calendar1, _setCalendar1] = useState9(() => {
|
|
10572
10645
|
const calendar12 = getInitialCalendar(value[0] || initialMonth, min, max);
|
|
10573
10646
|
return calendar12;
|
|
10574
10647
|
});
|
|
@@ -10578,7 +10651,7 @@ var Main2 = React12.forwardRef(
|
|
|
10578
10651
|
return newv.month === prev.month && newv.year === prev.year ? prev : newv;
|
|
10579
10652
|
});
|
|
10580
10653
|
};
|
|
10581
|
-
const [calendar2, _setCalendar2] =
|
|
10654
|
+
const [calendar2, _setCalendar2] = useState9(() => {
|
|
10582
10655
|
const calendar22 = getCalendar2(calendar1);
|
|
10583
10656
|
return calendar22;
|
|
10584
10657
|
});
|
|
@@ -10588,14 +10661,14 @@ var Main2 = React12.forwardRef(
|
|
|
10588
10661
|
return newv.month === prev.month && newv.year === prev.year ? prev : newv;
|
|
10589
10662
|
});
|
|
10590
10663
|
};
|
|
10591
|
-
const [hoverDay, setHoverDay] =
|
|
10592
|
-
|
|
10664
|
+
const [hoverDay, setHoverDay] = useState9(null);
|
|
10665
|
+
useEffect9(() => {
|
|
10593
10666
|
const calendar12 = getInitialCalendar(value[0] || initialMonth, min, max);
|
|
10594
10667
|
const calendar22 = getCalendar2(calendar12);
|
|
10595
10668
|
setCalendar1(calendar12);
|
|
10596
10669
|
setCalendar2(calendar22);
|
|
10597
10670
|
}, [initialMonth?.toISOString(), min?.toISOString(), max?.toISOString()]);
|
|
10598
|
-
|
|
10671
|
+
useEffect9(() => {
|
|
10599
10672
|
const timeProps = getTimeProps(props.time, value);
|
|
10600
10673
|
setHoverDay(null);
|
|
10601
10674
|
if (value[0]) {
|
|
@@ -10826,12 +10899,12 @@ var Interval_default = CalendarInterval;
|
|
|
10826
10899
|
import React15 from "react";
|
|
10827
10900
|
|
|
10828
10901
|
// src/components/Calendar/components/Single/components/Main/index.tsx
|
|
10829
|
-
import React14, { useEffect as
|
|
10902
|
+
import React14, { useEffect as useEffect10, useState as useState10 } from "react";
|
|
10830
10903
|
import { jsx as jsx307, jsxs as jsxs149 } from "react/jsx-runtime";
|
|
10831
10904
|
var SingleCalendar = React14.forwardRef(
|
|
10832
10905
|
(props, ref) => {
|
|
10833
10906
|
const { initialValue, min, max } = props;
|
|
10834
|
-
const [value, setValue] = props.value ||
|
|
10907
|
+
const [value, setValue] = props.value || useState10(
|
|
10835
10908
|
initialValue && !isNaN(initialValue.getTime()) && isDateBetween(initialValue, min, max) ? initialValue : null
|
|
10836
10909
|
);
|
|
10837
10910
|
const timeProps = (() => {
|
|
@@ -10839,9 +10912,9 @@ var SingleCalendar = React14.forwardRef(
|
|
|
10839
10912
|
if (typeof props.time === "function") return props.time(value);
|
|
10840
10913
|
return props.time;
|
|
10841
10914
|
})();
|
|
10842
|
-
const [invalid, setInvalid] = props.invalid ||
|
|
10843
|
-
const [time, setTime] =
|
|
10844
|
-
|
|
10915
|
+
const [invalid, setInvalid] = props.invalid || useState10(false);
|
|
10916
|
+
const [time, setTime] = useState10(getTimeFromDate(value));
|
|
10917
|
+
useEffect10(() => {
|
|
10845
10918
|
setInvalid(isInvalid(value, time, timeProps, min, max));
|
|
10846
10919
|
}, [value, time, timeProps]);
|
|
10847
10920
|
const _getDay = props.getDay || (() => ({}));
|
|
@@ -10977,21 +11050,21 @@ var Container7 = styled17.div`
|
|
|
10977
11050
|
border-left-width: 5px;
|
|
10978
11051
|
padding: 14px;
|
|
10979
11052
|
|
|
10980
|
-
${({ $size:
|
|
11053
|
+
${({ $size: size4 }) => size4 === "mini" && css15`
|
|
10981
11054
|
width: 394px;
|
|
10982
11055
|
height: 99px;
|
|
10983
11056
|
`}
|
|
10984
11057
|
|
|
10985
|
-
${({ $size:
|
|
11058
|
+
${({ $size: size4 }) => size4 === "small" && css15`
|
|
10986
11059
|
width: 394px;
|
|
10987
11060
|
height: 131px;
|
|
10988
11061
|
`}
|
|
10989
11062
|
|
|
10990
|
-
${({ $size:
|
|
11063
|
+
${({ $size: size4 }) => size4 === "medium" && css15`
|
|
10991
11064
|
width: 394px;
|
|
10992
11065
|
`}
|
|
10993
11066
|
|
|
10994
|
-
${({ $size:
|
|
11067
|
+
${({ $size: size4 }) => size4 === "big" && css15`
|
|
10995
11068
|
width: 414px;
|
|
10996
11069
|
height: 324px;
|
|
10997
11070
|
`}
|
|
@@ -11019,13 +11092,13 @@ var Container7 = styled17.div`
|
|
|
11019
11092
|
|
|
11020
11093
|
// src/components/Card/index.tsx
|
|
11021
11094
|
import { jsx as jsx310 } from "react/jsx-runtime";
|
|
11022
|
-
var Card = ({ borderType, size:
|
|
11023
|
-
return /* @__PURE__ */ jsx310(Container7, { $borderType: borderType, $size:
|
|
11095
|
+
var Card = ({ borderType, size: size4, ...rest }) => {
|
|
11096
|
+
return /* @__PURE__ */ jsx310(Container7, { $borderType: borderType, $size: size4, ...rest });
|
|
11024
11097
|
};
|
|
11025
11098
|
var Card_default = Card;
|
|
11026
11099
|
|
|
11027
11100
|
// src/components/Filters/Button/index.tsx
|
|
11028
|
-
import { useState as
|
|
11101
|
+
import { useState as useState11 } from "react";
|
|
11029
11102
|
|
|
11030
11103
|
// src/components/Filters/Button/styles.ts
|
|
11031
11104
|
import styled18, { css as css16 } from "styled-components";
|
|
@@ -11052,11 +11125,11 @@ var Container8 = styled18.div`
|
|
|
11052
11125
|
import { jsx as jsx311, jsxs as jsxs150 } from "react/jsx-runtime";
|
|
11053
11126
|
var Button3 = (props) => {
|
|
11054
11127
|
const { getContent } = props;
|
|
11055
|
-
const [open, setOpen] =
|
|
11128
|
+
const [open, setOpen] = useState11(false);
|
|
11056
11129
|
const close = () => setOpen(false);
|
|
11057
11130
|
const onClick = props.disabled ? void 0 : () => setOpen((prev) => !prev);
|
|
11058
11131
|
const buttonProps = filterObject(props, ["getContent", "gap"]);
|
|
11059
|
-
return /* @__PURE__ */ jsxs150("div", { ref:
|
|
11132
|
+
return /* @__PURE__ */ jsxs150("div", { ref: useOnClickOut_default(close), children: [
|
|
11060
11133
|
/* @__PURE__ */ jsxs150(Container8, { ...buttonProps, ...{ onClick }, $gap: props.gap, children: [
|
|
11061
11134
|
props.children,
|
|
11062
11135
|
/* @__PURE__ */ jsx311(
|
|
@@ -11074,13 +11147,13 @@ var Button3 = (props) => {
|
|
|
11074
11147
|
var Button_default2 = Button3;
|
|
11075
11148
|
|
|
11076
11149
|
// src/components/Filters/AppliedFilters/components/Menu/index.tsx
|
|
11077
|
-
import { useEffect as
|
|
11150
|
+
import { useEffect as useEffect16, useState as useState21 } from "react";
|
|
11078
11151
|
|
|
11079
11152
|
// src/components/Input/index.tsx
|
|
11080
|
-
import
|
|
11153
|
+
import React36 from "react";
|
|
11081
11154
|
|
|
11082
11155
|
// src/components/Input/components/Checkbox/index.tsx
|
|
11083
|
-
import
|
|
11156
|
+
import React17 from "react";
|
|
11084
11157
|
|
|
11085
11158
|
// src/components/Input/components/Checkbox/styles.ts
|
|
11086
11159
|
import styled19, { css as css17 } from "styled-components";
|
|
@@ -11281,7 +11354,7 @@ var DefaultLabel = (props) => {
|
|
|
11281
11354
|
}
|
|
11282
11355
|
);
|
|
11283
11356
|
};
|
|
11284
|
-
var Checkbox =
|
|
11357
|
+
var Checkbox = React17.forwardRef(
|
|
11285
11358
|
(props, ref) => {
|
|
11286
11359
|
const { padding, bordered } = props;
|
|
11287
11360
|
const { isRequired, isInvalid: isInvalid2, isViewMode, isDisabled } = Form_default.useContext(
|
|
@@ -11343,7 +11416,7 @@ Checkbox.displayName = "Checkbox";
|
|
|
11343
11416
|
var Checkbox_default = Checkbox;
|
|
11344
11417
|
|
|
11345
11418
|
// src/components/Input/components/Date/index.tsx
|
|
11346
|
-
import
|
|
11419
|
+
import React18, { useState as useState12 } from "react";
|
|
11347
11420
|
|
|
11348
11421
|
// src/components/Input/components/Date/functions.ts
|
|
11349
11422
|
var JSDate = Date;
|
|
@@ -11405,12 +11478,12 @@ var mask2 = (v) => {
|
|
|
11405
11478
|
else if (v.length < 5) return v.substring(0, 2) + "/" + v.substring(2);
|
|
11406
11479
|
else return v.substring(0, 2) + "/" + v.substring(2, 4) + "/" + v.substring(4);
|
|
11407
11480
|
};
|
|
11408
|
-
var Date2 =
|
|
11481
|
+
var Date2 = React18.forwardRef(
|
|
11409
11482
|
(props, ref) => {
|
|
11410
11483
|
const { picker, value, min, max } = props;
|
|
11411
11484
|
const setValue = props.setValue || (() => {
|
|
11412
11485
|
});
|
|
11413
|
-
const [open, setOpen] =
|
|
11486
|
+
const [open, setOpen] = useState12(false);
|
|
11414
11487
|
const _onKeyDown = props.onKeyDown || (() => {
|
|
11415
11488
|
});
|
|
11416
11489
|
const onKeyDown = (event) => {
|
|
@@ -11455,7 +11528,7 @@ var Date2 = React19.forwardRef(
|
|
|
11455
11528
|
"min",
|
|
11456
11529
|
"max"
|
|
11457
11530
|
]);
|
|
11458
|
-
return /* @__PURE__ */ jsxs152(RelativeContainer2, { ref:
|
|
11531
|
+
return /* @__PURE__ */ jsxs152(RelativeContainer2, { ref: useOnClickOut_default(() => setOpen(false)), children: [
|
|
11459
11532
|
/* @__PURE__ */ jsx313(
|
|
11460
11533
|
Input_default,
|
|
11461
11534
|
{
|
|
@@ -11496,7 +11569,7 @@ Date2.displayName = "Date";
|
|
|
11496
11569
|
var Date_default = Date2;
|
|
11497
11570
|
|
|
11498
11571
|
// src/components/Input/components/DateIntervalPicker/index.tsx
|
|
11499
|
-
import
|
|
11572
|
+
import React19, { useEffect as useEffect11, useState as useState13 } from "react";
|
|
11500
11573
|
|
|
11501
11574
|
// src/components/Input/components/DateIntervalPicker/functions.ts
|
|
11502
11575
|
var validate = ([start, end], min, max) => {
|
|
@@ -11783,12 +11856,12 @@ var LabelText2 = styled21.label`
|
|
|
11783
11856
|
|
|
11784
11857
|
// src/components/Input/components/DateIntervalPicker/index.tsx
|
|
11785
11858
|
import { jsx as jsx314, jsxs as jsxs153 } from "react/jsx-runtime";
|
|
11786
|
-
var Component =
|
|
11859
|
+
var Component = React19.forwardRef(
|
|
11787
11860
|
(props, ref) => {
|
|
11788
11861
|
const center = props.center || { x: 50, y: 50 };
|
|
11789
11862
|
const value = parse(props.value);
|
|
11790
|
-
const [open, setOpen] =
|
|
11791
|
-
const [intervalType, setIntervalType] =
|
|
11863
|
+
const [open, setOpen] = useState13(null);
|
|
11864
|
+
const [intervalType, setIntervalType] = useState13(
|
|
11792
11865
|
props.only || "day"
|
|
11793
11866
|
);
|
|
11794
11867
|
const config = intervalTypes[intervalType];
|
|
@@ -11799,7 +11872,7 @@ var Component = React20.forwardRef(
|
|
|
11799
11872
|
);
|
|
11800
11873
|
props.setValue(parsed);
|
|
11801
11874
|
};
|
|
11802
|
-
|
|
11875
|
+
useEffect11(() => {
|
|
11803
11876
|
if (props.min && props.max && props.min > props.max) {
|
|
11804
11877
|
throw Error("Min prop must be less than Max");
|
|
11805
11878
|
}
|
|
@@ -11864,7 +11937,7 @@ var Component = React20.forwardRef(
|
|
|
11864
11937
|
return /* @__PURE__ */ jsxs153(
|
|
11865
11938
|
RelativeContainer3,
|
|
11866
11939
|
{
|
|
11867
|
-
ref:
|
|
11940
|
+
ref: useOnClickOut_default(() => setOpen(null)),
|
|
11868
11941
|
$invalid: invalid,
|
|
11869
11942
|
children: [
|
|
11870
11943
|
props.label ? /* @__PURE__ */ jsxs153(LabelText2, { $required: props.required, children: [
|
|
@@ -11884,7 +11957,7 @@ var Component = React20.forwardRef(
|
|
|
11884
11957
|
if (intervalType === "custom") return label;
|
|
11885
11958
|
const incrementProps = getArrowProps("increment");
|
|
11886
11959
|
const decrementProps = getArrowProps("decrement");
|
|
11887
|
-
return /* @__PURE__ */ jsxs153(
|
|
11960
|
+
return /* @__PURE__ */ jsxs153(React19.Fragment, { children: [
|
|
11888
11961
|
/* @__PURE__ */ jsx314(
|
|
11889
11962
|
Button4,
|
|
11890
11963
|
{
|
|
@@ -12013,7 +12086,7 @@ var DatePicker = Object.assign(Component, {
|
|
|
12013
12086
|
var DateIntervalPicker_default = DatePicker;
|
|
12014
12087
|
|
|
12015
12088
|
// src/components/Input/components/DatePicker/index.tsx
|
|
12016
|
-
import
|
|
12089
|
+
import React20, { useEffect as useEffect12, useState as useState14 } from "react";
|
|
12017
12090
|
|
|
12018
12091
|
// src/components/Input/components/DatePicker/styles.ts
|
|
12019
12092
|
import styled22, { css as css19 } from "styled-components";
|
|
@@ -12090,13 +12163,13 @@ var Button5 = styled22.button`
|
|
|
12090
12163
|
|
|
12091
12164
|
// src/components/Input/components/DatePicker/index.tsx
|
|
12092
12165
|
import { jsx as jsx315, jsxs as jsxs154 } from "react/jsx-runtime";
|
|
12093
|
-
var DatePicker2 =
|
|
12166
|
+
var DatePicker2 = React20.forwardRef(
|
|
12094
12167
|
(props, ref) => {
|
|
12095
12168
|
const { picker, value, setValue, min, max } = props;
|
|
12096
12169
|
const disabled = props.disabled || props.loading;
|
|
12097
12170
|
const today = dateToIsoString(/* @__PURE__ */ new Date());
|
|
12098
|
-
const [open, setOpen] =
|
|
12099
|
-
|
|
12171
|
+
const [open, setOpen] = useState14(false);
|
|
12172
|
+
useEffect12(() => {
|
|
12100
12173
|
const date = isoStringToDate(value);
|
|
12101
12174
|
if (!date) {
|
|
12102
12175
|
setValue(dateToIsoString(getMiddle(min, max)));
|
|
@@ -12128,7 +12201,7 @@ var DatePicker2 = React21.forwardRef(
|
|
|
12128
12201
|
"min",
|
|
12129
12202
|
"max"
|
|
12130
12203
|
]);
|
|
12131
|
-
return /* @__PURE__ */ jsxs154(RelativeContainer4, { ref:
|
|
12204
|
+
return /* @__PURE__ */ jsxs154(RelativeContainer4, { ref: useOnClickOut_default(() => setOpen(false)), children: [
|
|
12132
12205
|
/* @__PURE__ */ jsx315(Input_default, { ...inputProps, type: "text", icon, ref, htmlDisabled: true }),
|
|
12133
12206
|
/* @__PURE__ */ jsxs154(
|
|
12134
12207
|
Container10,
|
|
@@ -12215,7 +12288,7 @@ DatePicker2.displayName = "DatePicker";
|
|
|
12215
12288
|
var DatePicker_default = DatePicker2;
|
|
12216
12289
|
|
|
12217
12290
|
// src/components/Input/components/DateTime/index.tsx
|
|
12218
|
-
import
|
|
12291
|
+
import React21, { useState as useState15 } from "react";
|
|
12219
12292
|
|
|
12220
12293
|
// src/components/Input/components/DateTime/styles.ts
|
|
12221
12294
|
import styled23 from "styled-components";
|
|
@@ -12376,13 +12449,13 @@ var steps = {
|
|
|
12376
12449
|
}
|
|
12377
12450
|
}
|
|
12378
12451
|
};
|
|
12379
|
-
var DateTime =
|
|
12452
|
+
var DateTime = React21.forwardRef(
|
|
12380
12453
|
(props, ref) => {
|
|
12381
12454
|
const { picker, value, min, max } = props;
|
|
12382
12455
|
const step = steps[props.step || "day"];
|
|
12383
12456
|
const setValue = props.setValue || (() => {
|
|
12384
12457
|
});
|
|
12385
|
-
const [open, setOpen] =
|
|
12458
|
+
const [open, setOpen] = useState15(false);
|
|
12386
12459
|
const _onKeyDown = props.onKeyDown || (() => {
|
|
12387
12460
|
});
|
|
12388
12461
|
const onKeyDown = (event) => {
|
|
@@ -12460,7 +12533,7 @@ var DateTime = React22.forwardRef(
|
|
|
12460
12533
|
"min",
|
|
12461
12534
|
"max"
|
|
12462
12535
|
]);
|
|
12463
|
-
return /* @__PURE__ */ jsxs155(RelativeContainer5, { ref:
|
|
12536
|
+
return /* @__PURE__ */ jsxs155(RelativeContainer5, { ref: useOnClickOut_default(() => setOpen(false)), children: [
|
|
12464
12537
|
/* @__PURE__ */ jsx316(
|
|
12465
12538
|
Input_default,
|
|
12466
12539
|
{
|
|
@@ -12503,11 +12576,11 @@ DateTime.displayName = "DateTime";
|
|
|
12503
12576
|
var DateTime_default = DateTime;
|
|
12504
12577
|
|
|
12505
12578
|
// src/components/Input/components/Password/index.tsx
|
|
12506
|
-
import
|
|
12579
|
+
import React22, { useState as useState16 } from "react";
|
|
12507
12580
|
import { jsx as jsx317 } from "react/jsx-runtime";
|
|
12508
|
-
var Password =
|
|
12581
|
+
var Password = React22.forwardRef(
|
|
12509
12582
|
(props, ref) => {
|
|
12510
|
-
const [visibility, setVisibility] =
|
|
12583
|
+
const [visibility, setVisibility] = useState16("hidden");
|
|
12511
12584
|
const icons2 = {
|
|
12512
12585
|
visible: {
|
|
12513
12586
|
icon: "eye_off",
|
|
@@ -12542,7 +12615,7 @@ Password.displayName = "Password";
|
|
|
12542
12615
|
var Password_default = Password;
|
|
12543
12616
|
|
|
12544
12617
|
// src/components/Input/components/Phone/index.tsx
|
|
12545
|
-
import
|
|
12618
|
+
import React23, { useEffect as useEffect13, useState as useState17 } from "react";
|
|
12546
12619
|
|
|
12547
12620
|
// src/assets/icons/flags/index.ts
|
|
12548
12621
|
import styled24, { css as css20 } from "styled-components";
|
|
@@ -12827,17 +12900,17 @@ var Button6 = (props) => {
|
|
|
12827
12900
|
}
|
|
12828
12901
|
);
|
|
12829
12902
|
};
|
|
12830
|
-
var Component2 =
|
|
12903
|
+
var Component2 = React23.forwardRef(
|
|
12831
12904
|
(props, ref) => {
|
|
12832
12905
|
const { value, setValue } = props;
|
|
12833
|
-
const [inputValue, setInputValue] =
|
|
12906
|
+
const [inputValue, setInputValue] = useState17(
|
|
12834
12907
|
!value ? "" : () => {
|
|
12835
12908
|
const details = getPhoneDetails(value);
|
|
12836
12909
|
return details ? details.masked : value;
|
|
12837
12910
|
}
|
|
12838
12911
|
);
|
|
12839
|
-
const [country, setCountry] =
|
|
12840
|
-
const [open, setOpen] =
|
|
12912
|
+
const [country, setCountry] = useState17(countries_default.br);
|
|
12913
|
+
const [open, setOpen] = useState17(false);
|
|
12841
12914
|
const options = Object.keys(countries_default).map((iso) => ({
|
|
12842
12915
|
label: (option) => {
|
|
12843
12916
|
const country2 = option.data;
|
|
@@ -12861,7 +12934,7 @@ var Component2 = React24.forwardRef(
|
|
|
12861
12934
|
if (country.mask) value2 = country.mask(value2);
|
|
12862
12935
|
return value2;
|
|
12863
12936
|
};
|
|
12864
|
-
|
|
12937
|
+
useEffect13(() => {
|
|
12865
12938
|
if (!value) {
|
|
12866
12939
|
setInputValue("");
|
|
12867
12940
|
return;
|
|
@@ -12875,10 +12948,10 @@ var Component2 = React24.forwardRef(
|
|
|
12875
12948
|
setInputValue(value);
|
|
12876
12949
|
}
|
|
12877
12950
|
}, [value]);
|
|
12878
|
-
|
|
12951
|
+
useEffect13(() => {
|
|
12879
12952
|
setInputValue((prev) => mask4(prev));
|
|
12880
12953
|
}, [country]);
|
|
12881
|
-
|
|
12954
|
+
useEffect13(() => {
|
|
12882
12955
|
const v = inputValue.replace(/\D+/g, "").substring(0, country.charLimit);
|
|
12883
12956
|
setValue(v ? `${country.ddi} ${v}` : v);
|
|
12884
12957
|
}, [inputValue]);
|
|
@@ -12886,7 +12959,7 @@ var Component2 = React24.forwardRef(
|
|
|
12886
12959
|
return /* @__PURE__ */ jsxs156(
|
|
12887
12960
|
RelativeContainer6,
|
|
12888
12961
|
{
|
|
12889
|
-
ref:
|
|
12962
|
+
ref: useOnClickOut_default(() => setOpen(false)),
|
|
12890
12963
|
children: [
|
|
12891
12964
|
/* @__PURE__ */ jsx318(
|
|
12892
12965
|
Input_default,
|
|
@@ -12950,6 +13023,8 @@ var LabelContainer5 = styled26.div`
|
|
|
12950
13023
|
`;
|
|
12951
13024
|
var Label4 = styled26.label`
|
|
12952
13025
|
display: flex;
|
|
13026
|
+
align-items: center;
|
|
13027
|
+
|
|
12953
13028
|
gap: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
12954
13029
|
|
|
12955
13030
|
min-height: ${size2};
|
|
@@ -13008,18 +13083,19 @@ var Label4 = styled26.label`
|
|
|
13008
13083
|
|
|
13009
13084
|
> input {
|
|
13010
13085
|
position: absolute;
|
|
13011
|
-
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
/*
|
|
13086
|
+
height: 1px;
|
|
13087
|
+
width: 1px;
|
|
13088
|
+
opacity: 0;
|
|
13089
|
+
|
|
13090
|
+
/* Appearance (General) */
|
|
13091
|
+
appearance: none;
|
|
13092
|
+
/* Appearance (Chrome, Safari, Edge, Opera) */
|
|
13016
13093
|
&:-webkit-outer-spin-button,
|
|
13017
13094
|
&:-webkit-inner-spin-button {
|
|
13018
13095
|
-webkit-appearance: none;
|
|
13019
13096
|
margin: 0;
|
|
13020
13097
|
}
|
|
13021
|
-
|
|
13022
|
-
/* Firefox */
|
|
13098
|
+
/* Appearance (Firefox) */
|
|
13023
13099
|
-moz-appearance: none;
|
|
13024
13100
|
}
|
|
13025
13101
|
|
|
@@ -13076,7 +13152,7 @@ var RadioButton = (props) => {
|
|
|
13076
13152
|
var RadioButton_default = RadioButton;
|
|
13077
13153
|
|
|
13078
13154
|
// src/components/Input/components/Range/index.tsx
|
|
13079
|
-
import
|
|
13155
|
+
import React24 from "react";
|
|
13080
13156
|
|
|
13081
13157
|
// src/components/Input/components/Range/styles/Input/index.ts
|
|
13082
13158
|
import styled27, { css as css22 } from "styled-components";
|
|
@@ -13511,18 +13587,18 @@ var getMarkerLeft = (markers, range, index, value, min, strict) => {
|
|
|
13511
13587
|
const left = `calc(${p}% - 10px - ${x}px)`;
|
|
13512
13588
|
return left;
|
|
13513
13589
|
};
|
|
13514
|
-
var getLeftCalc = (
|
|
13590
|
+
var getLeftCalc = (size4, bullet2, value, min, max) => {
|
|
13515
13591
|
const percent = (value - min) * 100 / (max - min);
|
|
13516
|
-
const calc = `calc(${percent}% - ${bullet2 * percent / 100}px + ${(bullet2 -
|
|
13592
|
+
const calc = `calc(${percent}% - ${bullet2 * percent / 100}px + ${(bullet2 - size4) / 2}px)`;
|
|
13517
13593
|
return calc;
|
|
13518
13594
|
};
|
|
13519
|
-
var getBarLeft = (
|
|
13520
|
-
return `min(max(${calc}, 0%), calc(100% - ${
|
|
13595
|
+
var getBarLeft = (size4, calc) => {
|
|
13596
|
+
return `min(max(${calc}, 0%), calc(100% - ${size4}px))`;
|
|
13521
13597
|
};
|
|
13522
|
-
var getIndicatorLeft = (
|
|
13523
|
-
return `min(max(${calc}, calc(0% - ${
|
|
13598
|
+
var getIndicatorLeft = (size4, calc) => {
|
|
13599
|
+
return `min(max(${calc}, calc(0% - ${size4}px)), calc(100% - ${size4}px))`;
|
|
13524
13600
|
};
|
|
13525
|
-
var Range =
|
|
13601
|
+
var Range = React24.forwardRef(
|
|
13526
13602
|
(props, ref) => {
|
|
13527
13603
|
const { label, minLabel, maxLabel, width, setValue, hideNavbar } = props;
|
|
13528
13604
|
const { isRequired, isInvalid: isInvalid2, isViewMode, isDisabled } = Form_default.useContext(
|
|
@@ -13732,10 +13808,10 @@ Range.displayName = "input";
|
|
|
13732
13808
|
var Range_default = Range;
|
|
13733
13809
|
|
|
13734
13810
|
// src/components/Input/components/Select/index.tsx
|
|
13735
|
-
import
|
|
13811
|
+
import React32, { useCallback as useCallback4, useEffect as useEffect15, useState as useState19 } from "react";
|
|
13736
13812
|
|
|
13737
13813
|
// src/components/Input/components/Select/hooks/Select/index.tsx
|
|
13738
|
-
import
|
|
13814
|
+
import React27 from "react";
|
|
13739
13815
|
|
|
13740
13816
|
// src/components/Input/components/Select/styles.ts
|
|
13741
13817
|
import styled38, { css as css28 } from "styled-components";
|
|
@@ -13763,7 +13839,7 @@ var HiddenInput = styled38.input`
|
|
|
13763
13839
|
`;
|
|
13764
13840
|
|
|
13765
13841
|
// src/components/Input/components/Select/hooks/Navigation/index.ts
|
|
13766
|
-
import { useCallback as
|
|
13842
|
+
import { useCallback as useCallback3 } from "react";
|
|
13767
13843
|
var isAvailable = (index, option) => {
|
|
13768
13844
|
return !option.disabled && !(option.rules || []).some((rule) => rule(index, option.data) !== true);
|
|
13769
13845
|
};
|
|
@@ -13773,7 +13849,7 @@ var useNavigation = (props) => {
|
|
|
13773
13849
|
options,
|
|
13774
13850
|
onSelectHighlight
|
|
13775
13851
|
} = props;
|
|
13776
|
-
const onKeyDown =
|
|
13852
|
+
const onKeyDown = useCallback3(
|
|
13777
13853
|
(e) => {
|
|
13778
13854
|
if (e.key === "ArrowDown") {
|
|
13779
13855
|
e.preventDefault();
|
|
@@ -13822,12 +13898,12 @@ var useNavigation = (props) => {
|
|
|
13822
13898
|
var Navigation_default2 = useNavigation;
|
|
13823
13899
|
|
|
13824
13900
|
// src/components/Input/components/Select/hooks/Select/components/Header/index.tsx
|
|
13825
|
-
import
|
|
13901
|
+
import React26 from "react";
|
|
13826
13902
|
|
|
13827
13903
|
// src/components/Input/components/Select/hooks/Select/context.ts
|
|
13828
|
-
import
|
|
13829
|
-
var Provider3 =
|
|
13830
|
-
var useContext2 = () =>
|
|
13904
|
+
import React25 from "react";
|
|
13905
|
+
var Provider3 = React25.createContext({});
|
|
13906
|
+
var useContext2 = () => React25.useContext(Provider3);
|
|
13831
13907
|
var context_default2 = Provider3;
|
|
13832
13908
|
|
|
13833
13909
|
// src/components/Input/components/Select/hooks/Select/components/Header/styles.ts
|
|
@@ -13843,7 +13919,7 @@ import { jsx as jsx321 } from "react/jsx-runtime";
|
|
|
13843
13919
|
var Header2 = () => {
|
|
13844
13920
|
const context = useContext2();
|
|
13845
13921
|
if (!context.props.search) {
|
|
13846
|
-
return /* @__PURE__ */ jsx321(
|
|
13922
|
+
return /* @__PURE__ */ jsx321(React26.Fragment, {});
|
|
13847
13923
|
}
|
|
13848
13924
|
const {
|
|
13849
13925
|
searchInput: [searchInput, setSearchInput]
|
|
@@ -13936,7 +14012,7 @@ var useSelect = (props, [highlight, setHighlight], [options, setOptions], setOpe
|
|
|
13936
14012
|
onReset,
|
|
13937
14013
|
menu: {
|
|
13938
14014
|
itemSpacing: "s3",
|
|
13939
|
-
before: /* @__PURE__ */ jsxs159(
|
|
14015
|
+
before: /* @__PURE__ */ jsxs159(React27.Fragment, { children: [
|
|
13940
14016
|
/* @__PURE__ */ jsx322(Header_default, {}),
|
|
13941
14017
|
/* @__PURE__ */ jsx322(
|
|
13942
14018
|
HiddenInput,
|
|
@@ -13967,15 +14043,15 @@ var useSelect = (props, [highlight, setHighlight], [options, setOptions], setOpe
|
|
|
13967
14043
|
var Select_default = useSelect;
|
|
13968
14044
|
|
|
13969
14045
|
// src/components/Input/components/Select/hooks/SelectMultiple/index.tsx
|
|
13970
|
-
import
|
|
14046
|
+
import React31, { useEffect as useEffect14, useState as useState18 } from "react";
|
|
13971
14047
|
|
|
13972
14048
|
// src/components/Input/components/Select/hooks/SelectMultiple/components/Footer/index.tsx
|
|
13973
|
-
import
|
|
14049
|
+
import React29 from "react";
|
|
13974
14050
|
|
|
13975
14051
|
// src/components/Input/components/Select/hooks/SelectMultiple/context.ts
|
|
13976
|
-
import
|
|
13977
|
-
var Provider4 =
|
|
13978
|
-
var useContext3 = () =>
|
|
14052
|
+
import React28 from "react";
|
|
14053
|
+
var Provider4 = React28.createContext({});
|
|
14054
|
+
var useContext3 = () => React28.useContext(Provider4);
|
|
13979
14055
|
var context_default3 = Provider4;
|
|
13980
14056
|
|
|
13981
14057
|
// src/components/Input/components/Select/hooks/SelectMultiple/components/Footer/index.tsx
|
|
@@ -14005,7 +14081,7 @@ var Footer2 = () => {
|
|
|
14005
14081
|
setValue(value2, data);
|
|
14006
14082
|
setOpen(false);
|
|
14007
14083
|
};
|
|
14008
|
-
return /* @__PURE__ */ jsxs160(
|
|
14084
|
+
return /* @__PURE__ */ jsxs160(React29.Fragment, { children: [
|
|
14009
14085
|
error && /* @__PURE__ */ jsx323(
|
|
14010
14086
|
"span",
|
|
14011
14087
|
{
|
|
@@ -14033,14 +14109,14 @@ var Footer2 = () => {
|
|
|
14033
14109
|
var Footer_default = Footer2;
|
|
14034
14110
|
|
|
14035
14111
|
// src/components/Input/components/Select/hooks/SelectMultiple/components/Header/index.tsx
|
|
14036
|
-
import
|
|
14112
|
+
import React30 from "react";
|
|
14037
14113
|
|
|
14038
14114
|
// src/components/Link/index.tsx
|
|
14039
14115
|
import styled40, { css as css30 } from "styled-components";
|
|
14040
14116
|
import { jsx as jsx324 } from "react/jsx-runtime";
|
|
14041
14117
|
var Container11 = styled40.div`
|
|
14042
|
-
${({ $size:
|
|
14043
|
-
const { fontSize, lineHeight } = sizes[
|
|
14118
|
+
${({ $size: size4 }) => {
|
|
14119
|
+
const { fontSize, lineHeight } = sizes[size4 || "small"];
|
|
14044
14120
|
return css30`
|
|
14045
14121
|
font-size: ${fontSize};
|
|
14046
14122
|
line-height: ${lineHeight};
|
|
@@ -14068,12 +14144,12 @@ var Container11 = styled40.div`
|
|
|
14068
14144
|
` : null;
|
|
14069
14145
|
}}
|
|
14070
14146
|
`;
|
|
14071
|
-
var Link = ({ size:
|
|
14147
|
+
var Link = ({ size: size4, colorSetting, disabled, ...props }) => {
|
|
14072
14148
|
return /* @__PURE__ */ jsx324(
|
|
14073
14149
|
Container11,
|
|
14074
14150
|
{
|
|
14075
14151
|
...props,
|
|
14076
|
-
$size:
|
|
14152
|
+
$size: size4,
|
|
14077
14153
|
$colorSetting: colorSetting,
|
|
14078
14154
|
$disabled: disabled
|
|
14079
14155
|
}
|
|
@@ -14144,7 +14220,7 @@ var CheckAll = () => {
|
|
|
14144
14220
|
var Header3 = () => {
|
|
14145
14221
|
const context = useContext3();
|
|
14146
14222
|
if (!context.props.search) {
|
|
14147
|
-
return /* @__PURE__ */ jsx325(
|
|
14223
|
+
return /* @__PURE__ */ jsx325(React30.Fragment, {});
|
|
14148
14224
|
}
|
|
14149
14225
|
const {
|
|
14150
14226
|
searchInput: [searchInput, setSearchInput],
|
|
@@ -14281,12 +14357,12 @@ var parseValue = (value) => {
|
|
|
14281
14357
|
};
|
|
14282
14358
|
var useSelectMultiple = (props, [highlight, setHighlight], [options, setOptions]) => {
|
|
14283
14359
|
const initial = parseValue(props.value);
|
|
14284
|
-
const [checked, setChecked] =
|
|
14360
|
+
const [checked, setChecked] = useState18([
|
|
14285
14361
|
...initial
|
|
14286
14362
|
]);
|
|
14287
14363
|
const limits = resolveLimits(props.minSelected, props.maxSelected);
|
|
14288
14364
|
const { max, enabled } = limits;
|
|
14289
|
-
|
|
14365
|
+
useEffect14(() => {
|
|
14290
14366
|
if (limits.error) {
|
|
14291
14367
|
console.error(`[SelectMultiple]: ${limits.error}`);
|
|
14292
14368
|
}
|
|
@@ -14326,7 +14402,7 @@ var useSelectMultiple = (props, [highlight, setHighlight], [options, setOptions]
|
|
|
14326
14402
|
onReset,
|
|
14327
14403
|
menu: {
|
|
14328
14404
|
itemSpacing: void 0,
|
|
14329
|
-
before: /* @__PURE__ */ jsxs162(
|
|
14405
|
+
before: /* @__PURE__ */ jsxs162(React31.Fragment, { children: [
|
|
14330
14406
|
/* @__PURE__ */ jsx327(Header_default2, {}),
|
|
14331
14407
|
/* @__PURE__ */ jsx327(
|
|
14332
14408
|
HiddenInput,
|
|
@@ -14381,12 +14457,12 @@ var SelectMultiple_default = useSelectMultiple;
|
|
|
14381
14457
|
|
|
14382
14458
|
// src/components/Input/components/Select/index.tsx
|
|
14383
14459
|
import { jsx as jsx328, jsxs as jsxs163 } from "react/jsx-runtime";
|
|
14384
|
-
var Select =
|
|
14460
|
+
var Select = React32.forwardRef(
|
|
14385
14461
|
(props, ref) => {
|
|
14386
14462
|
const { position, loader: loader2, initialLoader } = props;
|
|
14387
|
-
const [options, setOptions] =
|
|
14388
|
-
const [highlight, setHighlight] =
|
|
14389
|
-
const [open, setOpen] =
|
|
14463
|
+
const [options, setOptions] = useState19(initialLoader || []);
|
|
14464
|
+
const [highlight, setHighlight] = useState19(-1);
|
|
14465
|
+
const [open, setOpen] = useState19(false);
|
|
14390
14466
|
const hook = props.type === "select-multiple" ? SelectMultiple_default : Select_default;
|
|
14391
14467
|
const {
|
|
14392
14468
|
parsedOptions,
|
|
@@ -14402,11 +14478,11 @@ var Select = React33.forwardRef(
|
|
|
14402
14478
|
[options, setOptions],
|
|
14403
14479
|
setOpen
|
|
14404
14480
|
);
|
|
14405
|
-
const [_loading, setLoading] =
|
|
14406
|
-
const [search, _setSearch] =
|
|
14407
|
-
const [searchInput, setSearchInput] =
|
|
14408
|
-
const [page, setPage] =
|
|
14409
|
-
const [lastPage, setLastPage] =
|
|
14481
|
+
const [_loading, setLoading] = useState19(true);
|
|
14482
|
+
const [search, _setSearch] = useState19("");
|
|
14483
|
+
const [searchInput, setSearchInput] = useState19("");
|
|
14484
|
+
const [page, setPage] = useState19(1);
|
|
14485
|
+
const [lastPage, setLastPage] = useState19(false);
|
|
14410
14486
|
const loading = props.loading || _loading;
|
|
14411
14487
|
const setSearch = (value) => {
|
|
14412
14488
|
_setSearch(value);
|
|
@@ -14439,7 +14515,7 @@ var Select = React33.forwardRef(
|
|
|
14439
14515
|
}
|
|
14440
14516
|
_onScrollEnd(e);
|
|
14441
14517
|
};
|
|
14442
|
-
const onSubmit =
|
|
14518
|
+
const onSubmit = useCallback4(async () => {
|
|
14443
14519
|
setLoading(true);
|
|
14444
14520
|
const optionsResult = await loader2(search, page);
|
|
14445
14521
|
if (optionsResult === null) return;
|
|
@@ -14455,22 +14531,22 @@ var Select = React33.forwardRef(
|
|
|
14455
14531
|
setLastPage(lastPage2);
|
|
14456
14532
|
setLoading(false);
|
|
14457
14533
|
}, [loader2, search, page, initialLoader]);
|
|
14458
|
-
|
|
14534
|
+
useEffect15(() => {
|
|
14459
14535
|
const timeoutId = setTimeout(() => onSubmit(), 250);
|
|
14460
14536
|
return () => clearTimeout(timeoutId);
|
|
14461
14537
|
}, [onSubmit]);
|
|
14462
|
-
|
|
14538
|
+
useEffect15(() => {
|
|
14463
14539
|
if (open) return;
|
|
14464
14540
|
setSearch("");
|
|
14465
14541
|
onReset();
|
|
14466
14542
|
}, [props.value, open]);
|
|
14467
|
-
|
|
14543
|
+
useEffect15(() => {
|
|
14468
14544
|
setSearchInput(search);
|
|
14469
14545
|
}, [search]);
|
|
14470
|
-
|
|
14546
|
+
useEffect15(() => {
|
|
14471
14547
|
if (page === 1) setHighlight(-1);
|
|
14472
14548
|
}, [page]);
|
|
14473
|
-
|
|
14549
|
+
useEffect15(() => {
|
|
14474
14550
|
const timeoutId = setTimeout(() => setSearch(searchInput), 1e3);
|
|
14475
14551
|
return () => clearTimeout(timeoutId);
|
|
14476
14552
|
}, [searchInput]);
|
|
@@ -14486,7 +14562,7 @@ var Select = React33.forwardRef(
|
|
|
14486
14562
|
/* @__PURE__ */ jsxs163(
|
|
14487
14563
|
RelativeContainer7,
|
|
14488
14564
|
{
|
|
14489
|
-
ref:
|
|
14565
|
+
ref: useOnClickOut_default(() => setOpen(false)),
|
|
14490
14566
|
$width: props.width,
|
|
14491
14567
|
children: [
|
|
14492
14568
|
/* @__PURE__ */ jsx328(
|
|
@@ -14562,7 +14638,7 @@ Select.displayName = "Select";
|
|
|
14562
14638
|
var Select_default2 = Select;
|
|
14563
14639
|
|
|
14564
14640
|
// src/components/Input/components/Switch/index.tsx
|
|
14565
|
-
import
|
|
14641
|
+
import React33 from "react";
|
|
14566
14642
|
|
|
14567
14643
|
// src/components/Input/components/Switch/styles.ts
|
|
14568
14644
|
import styled42, { css as css32 } from "styled-components";
|
|
@@ -14723,7 +14799,7 @@ var Switch = (props) => {
|
|
|
14723
14799
|
$keepSpace: true,
|
|
14724
14800
|
children: label[props.checked ? "after" : "before"]
|
|
14725
14801
|
}
|
|
14726
|
-
) : /* @__PURE__ */ jsxs164(
|
|
14802
|
+
) : /* @__PURE__ */ jsxs164(React33.Fragment, { children: [
|
|
14727
14803
|
label.before && /* @__PURE__ */ jsx329(LabelContainer7, { children: label.before }),
|
|
14728
14804
|
/* @__PURE__ */ jsx329("input", { ...htmlProps, type: "checkbox" }),
|
|
14729
14805
|
/* @__PURE__ */ jsx329("span", {}),
|
|
@@ -14736,10 +14812,10 @@ var Switch = (props) => {
|
|
|
14736
14812
|
var Switch_default = Switch;
|
|
14737
14813
|
|
|
14738
14814
|
// src/components/Input/components/Tags/index.tsx
|
|
14739
|
-
import
|
|
14815
|
+
import React35, { useState as useState20 } from "react";
|
|
14740
14816
|
|
|
14741
14817
|
// src/components/Input/components/Tags/components/Input/index.tsx
|
|
14742
|
-
import
|
|
14818
|
+
import React34 from "react";
|
|
14743
14819
|
|
|
14744
14820
|
// src/components/Input/components/Tags/components/Input/styles.ts
|
|
14745
14821
|
import styled43 from "styled-components";
|
|
@@ -14773,7 +14849,7 @@ var Input4 = styled43.input`
|
|
|
14773
14849
|
|
|
14774
14850
|
// src/components/Input/components/Tags/components/Input/index.tsx
|
|
14775
14851
|
import { jsx as jsx330 } from "react/jsx-runtime";
|
|
14776
|
-
var Input5 =
|
|
14852
|
+
var Input5 = React34.forwardRef(
|
|
14777
14853
|
(props, ref) => {
|
|
14778
14854
|
const [value, setValue] = props.value;
|
|
14779
14855
|
const _onKeyDown = props.onKeyDown || (() => {
|
|
@@ -14930,10 +15006,10 @@ var TagContainer = styled46.div`
|
|
|
14930
15006
|
|
|
14931
15007
|
// src/components/Input/components/Tags/index.tsx
|
|
14932
15008
|
import { jsx as jsx333, jsxs as jsxs166 } from "react/jsx-runtime";
|
|
14933
|
-
var Tags =
|
|
15009
|
+
var Tags = React35.forwardRef(
|
|
14934
15010
|
(props, ref) => {
|
|
14935
15011
|
const { value, setValue } = props;
|
|
14936
|
-
const [inputValue, setInputValue] = props.input?.value ? props.input.value :
|
|
15012
|
+
const [inputValue, setInputValue] = props.input?.value ? props.input.value : useState20("");
|
|
14937
15013
|
const paddingless = props.paddingless || false;
|
|
14938
15014
|
const borderless = props.borderless || false;
|
|
14939
15015
|
const maxTags = props.maxTags || Number.POSITIVE_INFINITY;
|
|
@@ -15001,7 +15077,7 @@ var Tags_default = Tags;
|
|
|
15001
15077
|
|
|
15002
15078
|
// src/components/Input/index.tsx
|
|
15003
15079
|
import { jsx as jsx334 } from "react/jsx-runtime";
|
|
15004
|
-
var Component3 =
|
|
15080
|
+
var Component3 = React36.forwardRef(
|
|
15005
15081
|
(props, ref) => {
|
|
15006
15082
|
switch (props.type) {
|
|
15007
15083
|
case "date": {
|
|
@@ -15145,9 +15221,9 @@ var AppliedFiltersMenu = (props) => {
|
|
|
15145
15221
|
close,
|
|
15146
15222
|
appliedFilters: [appliedFilters, setAppliedFilters]
|
|
15147
15223
|
} = props;
|
|
15148
|
-
const [search, setSearch] =
|
|
15149
|
-
const [searched, setSearched] =
|
|
15150
|
-
|
|
15224
|
+
const [search, setSearch] = useState21("");
|
|
15225
|
+
const [searched, setSearched] = useState21("");
|
|
15226
|
+
useEffect16(() => {
|
|
15151
15227
|
setSearch("");
|
|
15152
15228
|
setSearched("");
|
|
15153
15229
|
}, [open]);
|
|
@@ -15270,13 +15346,13 @@ var AppliedFilters = Object.assign(
|
|
|
15270
15346
|
var AppliedFilters_default = AppliedFilters;
|
|
15271
15347
|
|
|
15272
15348
|
// src/components/Filters/Filters/components/Menu/index.tsx
|
|
15273
|
-
import { useEffect as
|
|
15349
|
+
import { useEffect as useEffect19, useState as useState24 } from "react";
|
|
15274
15350
|
|
|
15275
15351
|
// src/components/Filters/Filters/components/Submenu/index.tsx
|
|
15276
|
-
import
|
|
15352
|
+
import React39, { useCallback as useCallback5, useEffect as useEffect18, useState as useState23 } from "react";
|
|
15277
15353
|
|
|
15278
15354
|
// src/components/Filters/Filters/components/Submenu/components/Header/index.tsx
|
|
15279
|
-
import { useEffect as
|
|
15355
|
+
import { useEffect as useEffect17, useState as useState22 } from "react";
|
|
15280
15356
|
|
|
15281
15357
|
// src/components/Filters/Filters/components/Submenu/components/Header/styles.ts
|
|
15282
15358
|
import styled48 from "styled-components";
|
|
@@ -15310,12 +15386,12 @@ var Header5 = (props) => {
|
|
|
15310
15386
|
allowEmptySearch,
|
|
15311
15387
|
withSearch
|
|
15312
15388
|
} = props;
|
|
15313
|
-
const [search, setSearch] =
|
|
15389
|
+
const [search, setSearch] = useState22("");
|
|
15314
15390
|
const setSearched = allowEmptySearch ? _setSearched : (value) => {
|
|
15315
15391
|
if (value === "") return;
|
|
15316
15392
|
_setSearched(value);
|
|
15317
15393
|
};
|
|
15318
|
-
|
|
15394
|
+
useEffect17(() => {
|
|
15319
15395
|
setSearch(searched);
|
|
15320
15396
|
}, [searched]);
|
|
15321
15397
|
const onSubmit = () => {
|
|
@@ -15427,13 +15503,13 @@ var getInstance = (props) => {
|
|
|
15427
15503
|
var Submenu = (props) => {
|
|
15428
15504
|
const { item, close, setAppliedFilters, closeParent } = props;
|
|
15429
15505
|
const { open, isDynamic, itemSpacing, label, allowEmptySearch, getOptions: getOptions3 } = getInstance(props);
|
|
15430
|
-
const [options, setOptions] =
|
|
15431
|
-
const [page, setPage] =
|
|
15432
|
-
const [search, _setSearch] =
|
|
15433
|
-
const [lastPage, setLastPage] =
|
|
15434
|
-
const [loading, setLoading] =
|
|
15435
|
-
const [, setFirstRender] =
|
|
15436
|
-
const onSearch =
|
|
15506
|
+
const [options, setOptions] = useState23([]);
|
|
15507
|
+
const [page, setPage] = useState23(1);
|
|
15508
|
+
const [search, _setSearch] = useState23("");
|
|
15509
|
+
const [lastPage, setLastPage] = useState23(false);
|
|
15510
|
+
const [loading, setLoading] = useState23(false);
|
|
15511
|
+
const [, setFirstRender] = useState23(true);
|
|
15512
|
+
const onSearch = useCallback5(async () => {
|
|
15437
15513
|
const { options: newOptions, lastPage: lastPage2 } = await getOptions3(search, page);
|
|
15438
15514
|
setLastPage(lastPage2);
|
|
15439
15515
|
setOptions([...newOptions]);
|
|
@@ -15448,12 +15524,12 @@ var Submenu = (props) => {
|
|
|
15448
15524
|
onSearch();
|
|
15449
15525
|
}
|
|
15450
15526
|
};
|
|
15451
|
-
|
|
15527
|
+
useEffect18(() => {
|
|
15452
15528
|
setOptions([]);
|
|
15453
15529
|
setSearch("", false);
|
|
15454
15530
|
setFirstRender(true);
|
|
15455
15531
|
}, [item]);
|
|
15456
|
-
|
|
15532
|
+
useEffect18(() => {
|
|
15457
15533
|
setFirstRender((firstRender) => {
|
|
15458
15534
|
if (!item || isDynamic && firstRender) {
|
|
15459
15535
|
setLoading(false);
|
|
@@ -15534,9 +15610,9 @@ var Submenu = (props) => {
|
|
|
15534
15610
|
loading,
|
|
15535
15611
|
emptyContent: isDynamic && options.length === 0 ? /* @__PURE__ */ jsx338(EmptyMessage, { children: (() => {
|
|
15536
15612
|
if (search !== "") {
|
|
15537
|
-
return /* @__PURE__ */ jsx338(
|
|
15613
|
+
return /* @__PURE__ */ jsx338(React39.Fragment, { children: "Nenhum resultado foi encontrado" });
|
|
15538
15614
|
}
|
|
15539
|
-
return /* @__PURE__ */ jsxs170(
|
|
15615
|
+
return /* @__PURE__ */ jsxs170(React39.Fragment, { children: [
|
|
15540
15616
|
"Utilize a busca para pesquisar por ",
|
|
15541
15617
|
/* @__PURE__ */ jsx338("br", {}),
|
|
15542
15618
|
label.text
|
|
@@ -15557,7 +15633,7 @@ var Submenu_default = Submenu;
|
|
|
15557
15633
|
import { jsx as jsx339 } from "react/jsx-runtime";
|
|
15558
15634
|
var FiltersMenu = (props) => {
|
|
15559
15635
|
const { open, close } = props;
|
|
15560
|
-
const [active, setActive] =
|
|
15636
|
+
const [active, setActive] = useState24(-1);
|
|
15561
15637
|
const items = props.items.map((item) => {
|
|
15562
15638
|
return {
|
|
15563
15639
|
label: typeof item.label === "string" ? item.label : item.label.element,
|
|
@@ -15571,7 +15647,7 @@ var FiltersMenu = (props) => {
|
|
|
15571
15647
|
};
|
|
15572
15648
|
});
|
|
15573
15649
|
const selected = active >= 0 && active < props.items.length ? props.items[active] : void 0;
|
|
15574
|
-
|
|
15650
|
+
useEffect19(() => {
|
|
15575
15651
|
if (open) return;
|
|
15576
15652
|
setActive(-1);
|
|
15577
15653
|
}, [open]);
|
|
@@ -15647,14 +15723,14 @@ var Filters = Object.assign(
|
|
|
15647
15723
|
var Filters_default = Filters;
|
|
15648
15724
|
|
|
15649
15725
|
// src/components/Grid/components/Col/index.tsx
|
|
15650
|
-
import
|
|
15726
|
+
import React42 from "react";
|
|
15651
15727
|
|
|
15652
15728
|
// src/components/Grid/components/Row/context.ts
|
|
15653
|
-
import
|
|
15654
|
-
var Provider5 =
|
|
15729
|
+
import React41 from "react";
|
|
15730
|
+
var Provider5 = React41.createContext({
|
|
15655
15731
|
cols: {}
|
|
15656
15732
|
});
|
|
15657
|
-
var useContext4 = () =>
|
|
15733
|
+
var useContext4 = () => React41.useContext(Provider5);
|
|
15658
15734
|
var context_default4 = Provider5;
|
|
15659
15735
|
|
|
15660
15736
|
// src/components/Grid/components/Col/styles.ts
|
|
@@ -15827,7 +15903,7 @@ var Col = styled50.div`
|
|
|
15827
15903
|
|
|
15828
15904
|
// src/components/Grid/components/Col/index.tsx
|
|
15829
15905
|
import { jsx as jsx341 } from "react/jsx-runtime";
|
|
15830
|
-
var Col2 =
|
|
15906
|
+
var Col2 = React42.forwardRef((props, ref) => {
|
|
15831
15907
|
const context = useContext4();
|
|
15832
15908
|
const colProps = { ...context.cols, ...props };
|
|
15833
15909
|
const htmlProps = filterObject(colProps, [
|
|
@@ -15864,15 +15940,15 @@ Col2.displayName = "Col";
|
|
|
15864
15940
|
var Col_default = Col2;
|
|
15865
15941
|
|
|
15866
15942
|
// src/components/Grid/components/Grid/index.tsx
|
|
15867
|
-
import
|
|
15943
|
+
import React44 from "react";
|
|
15868
15944
|
|
|
15869
15945
|
// src/components/Grid/components/Grid/context.ts
|
|
15870
|
-
import
|
|
15871
|
-
var Provider6 =
|
|
15946
|
+
import React43 from "react";
|
|
15947
|
+
var Provider6 = React43.createContext({
|
|
15872
15948
|
rows: {},
|
|
15873
15949
|
cols: {}
|
|
15874
15950
|
});
|
|
15875
|
-
var useContext5 = () =>
|
|
15951
|
+
var useContext5 = () => React43.useContext(Provider6);
|
|
15876
15952
|
var context_default5 = Provider6;
|
|
15877
15953
|
|
|
15878
15954
|
// src/components/Grid/components/Grid/styles.ts
|
|
@@ -15905,7 +15981,7 @@ var Grid = styled51.div`
|
|
|
15905
15981
|
|
|
15906
15982
|
// src/components/Grid/components/Grid/index.tsx
|
|
15907
15983
|
import { jsx as jsx342 } from "react/jsx-runtime";
|
|
15908
|
-
var Grid2 =
|
|
15984
|
+
var Grid2 = React44.forwardRef((props, ref) => {
|
|
15909
15985
|
const cols = props.cols || {};
|
|
15910
15986
|
const rows = props.rows || {};
|
|
15911
15987
|
const gridProps = filterObject(props, [
|
|
@@ -15928,7 +16004,7 @@ Grid2.displayName = "Grid";
|
|
|
15928
16004
|
var Grid_default2 = Grid2;
|
|
15929
16005
|
|
|
15930
16006
|
// src/components/Grid/components/Row/index.tsx
|
|
15931
|
-
import
|
|
16007
|
+
import React45 from "react";
|
|
15932
16008
|
|
|
15933
16009
|
// src/components/Grid/components/Row/styles.ts
|
|
15934
16010
|
import styled52, { css as css37 } from "styled-components";
|
|
@@ -16055,7 +16131,7 @@ var Row = styled52.div`
|
|
|
16055
16131
|
|
|
16056
16132
|
// src/components/Grid/components/Row/index.tsx
|
|
16057
16133
|
import { jsx as jsx343 } from "react/jsx-runtime";
|
|
16058
|
-
var Row2 =
|
|
16134
|
+
var Row2 = React45.forwardRef((props, ref) => {
|
|
16059
16135
|
const context = useContext5();
|
|
16060
16136
|
const cols = { ...context.cols, ...props.cols || {} };
|
|
16061
16137
|
const rowProps = { ...props, ...context.rows };
|
|
@@ -16099,15 +16175,15 @@ var Grid3 = Object.assign(Grid_default2, {
|
|
|
16099
16175
|
var Grid_default3 = Grid3;
|
|
16100
16176
|
|
|
16101
16177
|
// src/components/Modal/component.tsx
|
|
16102
|
-
import { useEffect as
|
|
16178
|
+
import { useEffect as useEffect21 } from "react";
|
|
16103
16179
|
|
|
16104
16180
|
// src/addons/Portal/index.ts
|
|
16105
|
-
import { useEffect as
|
|
16181
|
+
import { useEffect as useEffect20 } from "react";
|
|
16106
16182
|
import { createPortal } from "react-dom";
|
|
16107
16183
|
var Portal = (props) => {
|
|
16108
16184
|
const { id, opened, children } = props;
|
|
16109
16185
|
const portalRoot = document.createElement("div");
|
|
16110
|
-
|
|
16186
|
+
useEffect20(() => {
|
|
16111
16187
|
if (opened) {
|
|
16112
16188
|
portalRoot.id = id + "-root";
|
|
16113
16189
|
document.body.appendChild(portalRoot);
|
|
@@ -16200,7 +16276,7 @@ var Container14 = styled53.div`
|
|
|
16200
16276
|
|
|
16201
16277
|
${({
|
|
16202
16278
|
theme: theme4,
|
|
16203
|
-
$size:
|
|
16279
|
+
$size: size4,
|
|
16204
16280
|
$customSize: customSize,
|
|
16205
16281
|
$color: color,
|
|
16206
16282
|
$inverted: inverted
|
|
@@ -16208,9 +16284,9 @@ var Container14 = styled53.div`
|
|
|
16208
16284
|
background-color: ${theme4.colors.white};
|
|
16209
16285
|
box-shadow: 0 0 21px 7px ${theme4.getColor("black", 15)};
|
|
16210
16286
|
|
|
16211
|
-
width: ${
|
|
16287
|
+
width: ${size4 === "custom" && customSize ? customSize.width || "auto" : widths[size4]};
|
|
16212
16288
|
|
|
16213
|
-
height: ${
|
|
16289
|
+
height: ${size4 === "custom" && customSize ? customSize.height || "auto" : heights[size4]};
|
|
16214
16290
|
|
|
16215
16291
|
${Header6} {
|
|
16216
16292
|
background-color: ${inverted ? theme4.isDarkColor(color) : theme4.colors[color]};
|
|
@@ -16225,7 +16301,7 @@ var Modal = (props) => {
|
|
|
16225
16301
|
const {
|
|
16226
16302
|
openState,
|
|
16227
16303
|
title,
|
|
16228
|
-
size:
|
|
16304
|
+
size: size4,
|
|
16229
16305
|
color,
|
|
16230
16306
|
inverted,
|
|
16231
16307
|
children,
|
|
@@ -16243,7 +16319,7 @@ var Modal = (props) => {
|
|
|
16243
16319
|
setOpen(false);
|
|
16244
16320
|
}
|
|
16245
16321
|
};
|
|
16246
|
-
|
|
16322
|
+
useEffect21(() => {
|
|
16247
16323
|
const onEscDown = (event) => {
|
|
16248
16324
|
if (closeOnEsc && event.key === "Escape") {
|
|
16249
16325
|
event.preventDefault();
|
|
@@ -16255,11 +16331,11 @@ var Modal = (props) => {
|
|
|
16255
16331
|
document.removeEventListener("keydown", onEscDown);
|
|
16256
16332
|
};
|
|
16257
16333
|
}, []);
|
|
16258
|
-
const _size =
|
|
16334
|
+
const _size = size4 ? heights[size4] : heights.default;
|
|
16259
16335
|
return /* @__PURE__ */ jsx344(Portal_default, { opened: open || false, id: "modal", children: /* @__PURE__ */ jsx344(Background, { onClick: onClickOutside, children: /* @__PURE__ */ jsxs171(
|
|
16260
16336
|
Container14,
|
|
16261
16337
|
{
|
|
16262
|
-
$size:
|
|
16338
|
+
$size: size4 || "small",
|
|
16263
16339
|
$color: color || "blue",
|
|
16264
16340
|
$inverted: inverted,
|
|
16265
16341
|
$customSize: customSize,
|
|
@@ -16445,7 +16521,7 @@ var Modal2 = Object.assign(component_default, {
|
|
|
16445
16521
|
var Modal_default = Modal2;
|
|
16446
16522
|
|
|
16447
16523
|
// src/components/Placeholder/components/Template1/index.tsx
|
|
16448
|
-
import
|
|
16524
|
+
import React47 from "react";
|
|
16449
16525
|
|
|
16450
16526
|
// src/components/Placeholder/components/Template1/styles.ts
|
|
16451
16527
|
import styled57, { css as css39 } from "styled-components";
|
|
@@ -16481,19 +16557,19 @@ var HeaderLine = styled57.div`
|
|
|
16481
16557
|
margin-top: 14px;
|
|
16482
16558
|
}
|
|
16483
16559
|
|
|
16484
|
-
${({ $size:
|
|
16560
|
+
${({ $size: size4 }) => size4 === "mini" && css39`
|
|
16485
16561
|
width: 15%;
|
|
16486
16562
|
`}
|
|
16487
16563
|
|
|
16488
|
-
${({ $size:
|
|
16564
|
+
${({ $size: size4 }) => size4 === "small" && css39`
|
|
16489
16565
|
width: 25%;
|
|
16490
16566
|
`}
|
|
16491
16567
|
|
|
16492
|
-
${({ $size:
|
|
16568
|
+
${({ $size: size4 }) => size4 === "medium" && css39`
|
|
16493
16569
|
width: 45%;
|
|
16494
16570
|
`}
|
|
16495
16571
|
|
|
16496
|
-
${({ $size:
|
|
16572
|
+
${({ $size: size4 }) => size4 === "large" && css39`
|
|
16497
16573
|
width: 75%;
|
|
16498
16574
|
`}
|
|
16499
16575
|
`;
|
|
@@ -16505,7 +16581,7 @@ var MainLine = styled57(HeaderLine)`
|
|
|
16505
16581
|
// src/components/Placeholder/components/Template1/index.tsx
|
|
16506
16582
|
import { jsx as jsx348, jsxs as jsxs172 } from "react/jsx-runtime";
|
|
16507
16583
|
var Template1 = (props) => {
|
|
16508
|
-
if (!props.loading) return /* @__PURE__ */ jsx348(
|
|
16584
|
+
if (!props.loading) return /* @__PURE__ */ jsx348(React47.Fragment, {});
|
|
16509
16585
|
return /* @__PURE__ */ jsxs172(Container15, { children: [
|
|
16510
16586
|
/* @__PURE__ */ jsxs172(Header7, { children: [
|
|
16511
16587
|
/* @__PURE__ */ jsx348(HeaderImage, {}),
|
|
@@ -16526,7 +16602,7 @@ var Template1 = (props) => {
|
|
|
16526
16602
|
var Template1_default = Template1;
|
|
16527
16603
|
|
|
16528
16604
|
// src/components/Placeholder/components/Template2/index.tsx
|
|
16529
|
-
import
|
|
16605
|
+
import React48 from "react";
|
|
16530
16606
|
|
|
16531
16607
|
// src/components/Placeholder/components/Template2/styles.ts
|
|
16532
16608
|
import styled59 from "styled-components";
|
|
@@ -16542,19 +16618,19 @@ var HeaderLine2 = styled58.div`
|
|
|
16542
16618
|
margin-top: 14px;
|
|
16543
16619
|
}
|
|
16544
16620
|
|
|
16545
|
-
${({ $size:
|
|
16621
|
+
${({ $size: size4 }) => size4 === "mini" && css40`
|
|
16546
16622
|
width: 15%;
|
|
16547
16623
|
`}
|
|
16548
16624
|
|
|
16549
|
-
${({ $size:
|
|
16625
|
+
${({ $size: size4 }) => size4 === "small" && css40`
|
|
16550
16626
|
width: 25%;
|
|
16551
16627
|
`}
|
|
16552
16628
|
|
|
16553
|
-
${({ $size:
|
|
16629
|
+
${({ $size: size4 }) => size4 === "medium" && css40`
|
|
16554
16630
|
width: 45%;
|
|
16555
16631
|
`}
|
|
16556
16632
|
|
|
16557
|
-
${({ $size:
|
|
16633
|
+
${({ $size: size4 }) => size4 === "large" && css40`
|
|
16558
16634
|
width: 75%;
|
|
16559
16635
|
`}
|
|
16560
16636
|
`;
|
|
@@ -16596,7 +16672,7 @@ var HeaderLine3 = styled59(HeaderLine2)``;
|
|
|
16596
16672
|
// src/components/Placeholder/components/Template2/index.tsx
|
|
16597
16673
|
import { jsx as jsx349, jsxs as jsxs173 } from "react/jsx-runtime";
|
|
16598
16674
|
var Template2 = (props) => {
|
|
16599
|
-
if (!props.loading) return /* @__PURE__ */ jsx349(
|
|
16675
|
+
if (!props.loading) return /* @__PURE__ */ jsx349(React48.Fragment, {});
|
|
16600
16676
|
return /* @__PURE__ */ jsxs173(Template2Container, { children: [
|
|
16601
16677
|
/* @__PURE__ */ jsxs173(Header8, { children: [
|
|
16602
16678
|
/* @__PURE__ */ jsx349(HeaderImage2, {}),
|
|
@@ -16614,7 +16690,7 @@ var Template2 = (props) => {
|
|
|
16614
16690
|
var Template2_default = Template2;
|
|
16615
16691
|
|
|
16616
16692
|
// src/components/Placeholder/components/Template3/index.tsx
|
|
16617
|
-
import
|
|
16693
|
+
import React49 from "react";
|
|
16618
16694
|
|
|
16619
16695
|
// src/components/Placeholder/components/Template3/styles.ts
|
|
16620
16696
|
import styled60 from "styled-components";
|
|
@@ -16633,7 +16709,7 @@ var Template3Line = styled60(HeaderLine2)`
|
|
|
16633
16709
|
// src/components/Placeholder/components/Template3/index.tsx
|
|
16634
16710
|
import { jsx as jsx350, jsxs as jsxs174 } from "react/jsx-runtime";
|
|
16635
16711
|
var Template3 = (props) => {
|
|
16636
|
-
if (!props.loading) return /* @__PURE__ */ jsx350(
|
|
16712
|
+
if (!props.loading) return /* @__PURE__ */ jsx350(React49.Fragment, {});
|
|
16637
16713
|
return /* @__PURE__ */ jsxs174(Template3Container, { children: [
|
|
16638
16714
|
/* @__PURE__ */ jsx350(Template3Line, { $size: "large", $height: "7px", $color: "#DADADA" }),
|
|
16639
16715
|
/* @__PURE__ */ jsx350(Template3Line, { $size: "small", $height: "7px", $color: "#DADADA" }),
|
|
@@ -16645,7 +16721,7 @@ var Template3 = (props) => {
|
|
|
16645
16721
|
var Template3_default = Template3;
|
|
16646
16722
|
|
|
16647
16723
|
// src/components/Placeholder/components/Template4/index.tsx
|
|
16648
|
-
import
|
|
16724
|
+
import React50 from "react";
|
|
16649
16725
|
|
|
16650
16726
|
// src/components/Placeholder/components/Template4/styles.ts
|
|
16651
16727
|
import styled61, { css as css41 } from "styled-components";
|
|
@@ -16664,19 +16740,19 @@ var HeaderLine4 = styled61.div`
|
|
|
16664
16740
|
margin-top: 14px;
|
|
16665
16741
|
}
|
|
16666
16742
|
|
|
16667
|
-
${({ $size:
|
|
16743
|
+
${({ $size: size4 }) => size4 === "mini" && css41`
|
|
16668
16744
|
width: 15%;
|
|
16669
16745
|
`}
|
|
16670
16746
|
|
|
16671
|
-
${({ $size:
|
|
16747
|
+
${({ $size: size4 }) => size4 === "small" && css41`
|
|
16672
16748
|
width: 25%;
|
|
16673
16749
|
`}
|
|
16674
16750
|
|
|
16675
|
-
${({ $size:
|
|
16751
|
+
${({ $size: size4 }) => size4 === "medium" && css41`
|
|
16676
16752
|
width: 45%;
|
|
16677
16753
|
`}
|
|
16678
16754
|
|
|
16679
|
-
${({ $size:
|
|
16755
|
+
${({ $size: size4 }) => size4 === "large" && css41`
|
|
16680
16756
|
width: 75%;
|
|
16681
16757
|
`}
|
|
16682
16758
|
`;
|
|
@@ -16693,7 +16769,7 @@ var CustomLine = styled61(HeaderLine4)`
|
|
|
16693
16769
|
// src/components/Placeholder/components/Template4/index.tsx
|
|
16694
16770
|
import { jsx as jsx351, jsxs as jsxs175 } from "react/jsx-runtime";
|
|
16695
16771
|
var Template4 = (props) => {
|
|
16696
|
-
if (!props.loading) return /* @__PURE__ */ jsx351(
|
|
16772
|
+
if (!props.loading) return /* @__PURE__ */ jsx351(React50.Fragment, {});
|
|
16697
16773
|
return /* @__PURE__ */ jsxs175(Template4Container, { children: [
|
|
16698
16774
|
/* @__PURE__ */ jsx351(
|
|
16699
16775
|
CustomLine,
|
|
@@ -16772,7 +16848,7 @@ var Template4 = (props) => {
|
|
|
16772
16848
|
var Template4_default = Template4;
|
|
16773
16849
|
|
|
16774
16850
|
// src/components/Placeholder/components/Template5/index.tsx
|
|
16775
|
-
import
|
|
16851
|
+
import React51 from "react";
|
|
16776
16852
|
|
|
16777
16853
|
// src/components/Placeholder/components/Template5/styles.ts
|
|
16778
16854
|
import styled62, { css as css42 } from "styled-components";
|
|
@@ -16802,19 +16878,19 @@ var HeaderLine5 = styled62.div`
|
|
|
16802
16878
|
margin-top: 14px;
|
|
16803
16879
|
}
|
|
16804
16880
|
|
|
16805
|
-
${({ $size:
|
|
16881
|
+
${({ $size: size4 }) => size4 === "mini" && css42`
|
|
16806
16882
|
width: 15%;
|
|
16807
16883
|
`}
|
|
16808
16884
|
|
|
16809
|
-
${({ $size:
|
|
16885
|
+
${({ $size: size4 }) => size4 === "small" && css42`
|
|
16810
16886
|
width: 25%;
|
|
16811
16887
|
`}
|
|
16812
16888
|
|
|
16813
|
-
${({ $size:
|
|
16889
|
+
${({ $size: size4 }) => size4 === "medium" && css42`
|
|
16814
16890
|
width: 45%;
|
|
16815
16891
|
`}
|
|
16816
16892
|
|
|
16817
|
-
${({ $size:
|
|
16893
|
+
${({ $size: size4 }) => size4 === "large" && css42`
|
|
16818
16894
|
width: 75%;
|
|
16819
16895
|
`}
|
|
16820
16896
|
`;
|
|
@@ -16831,7 +16907,7 @@ var MainContent3 = styled62.div`
|
|
|
16831
16907
|
// src/components/Placeholder/components/Template5/index.tsx
|
|
16832
16908
|
import { jsx as jsx352, jsxs as jsxs176 } from "react/jsx-runtime";
|
|
16833
16909
|
var Template5 = (props) => {
|
|
16834
|
-
if (!props.loading) return /* @__PURE__ */ jsx352(
|
|
16910
|
+
if (!props.loading) return /* @__PURE__ */ jsx352(React51.Fragment, {});
|
|
16835
16911
|
return /* @__PURE__ */ jsxs176(Container19, { children: [
|
|
16836
16912
|
/* @__PURE__ */ jsx352(Circle, {}),
|
|
16837
16913
|
/* @__PURE__ */ jsxs176(MainContent3, { children: [
|
|
@@ -16877,7 +16953,7 @@ var Template5 = (props) => {
|
|
|
16877
16953
|
var Template5_default = Template5;
|
|
16878
16954
|
|
|
16879
16955
|
// src/components/Placeholder/components/Template6/index.tsx
|
|
16880
|
-
import
|
|
16956
|
+
import React52 from "react";
|
|
16881
16957
|
|
|
16882
16958
|
// src/components/Placeholder/components/Template6/styles.ts
|
|
16883
16959
|
import styled63, { css as css43 } from "styled-components";
|
|
@@ -16913,15 +16989,15 @@ var HeaderLine6 = styled63.div`
|
|
|
16913
16989
|
width: 15%;
|
|
16914
16990
|
`}
|
|
16915
16991
|
|
|
16916
|
-
${({ $size:
|
|
16992
|
+
${({ $size: size4 }) => size4 === "small" && css43`
|
|
16917
16993
|
width: 25%;
|
|
16918
16994
|
`}
|
|
16919
16995
|
|
|
16920
|
-
${({ $size:
|
|
16996
|
+
${({ $size: size4 }) => size4 === "medium" && css43`
|
|
16921
16997
|
width: 45%;
|
|
16922
16998
|
`}
|
|
16923
16999
|
|
|
16924
|
-
${({ $size:
|
|
17000
|
+
${({ $size: size4 }) => size4 === "large" && css43`
|
|
16925
17001
|
width: 75%;
|
|
16926
17002
|
`}
|
|
16927
17003
|
`;
|
|
@@ -16935,7 +17011,7 @@ var CustomLine3 = styled63(HeaderLine6)`
|
|
|
16935
17011
|
// src/components/Placeholder/components/Template6/index.tsx
|
|
16936
17012
|
import { jsx as jsx353, jsxs as jsxs177 } from "react/jsx-runtime";
|
|
16937
17013
|
var Template6 = (props) => {
|
|
16938
|
-
if (!props.loading) return /* @__PURE__ */ jsx353(
|
|
17014
|
+
if (!props.loading) return /* @__PURE__ */ jsx353(React52.Fragment, {});
|
|
16939
17015
|
return /* @__PURE__ */ jsx353(Container20, { children: /* @__PURE__ */ jsxs177(Header9, { children: [
|
|
16940
17016
|
/* @__PURE__ */ jsx353(
|
|
16941
17017
|
CustomLine3,
|
|
@@ -16969,7 +17045,7 @@ var Template6 = (props) => {
|
|
|
16969
17045
|
var Template6_default = Template6;
|
|
16970
17046
|
|
|
16971
17047
|
// src/components/Placeholder/components/Template7/index.tsx
|
|
16972
|
-
import
|
|
17048
|
+
import React53 from "react";
|
|
16973
17049
|
|
|
16974
17050
|
// src/components/Placeholder/components/Template7/styles.ts
|
|
16975
17051
|
import styled64, { css as css44 } from "styled-components";
|
|
@@ -16997,19 +17073,19 @@ var HeaderLine7 = styled64.div`
|
|
|
16997
17073
|
margin-top: 14px;
|
|
16998
17074
|
}
|
|
16999
17075
|
|
|
17000
|
-
${({ $size:
|
|
17076
|
+
${({ $size: size4 }) => size4 === "mini" && css44`
|
|
17001
17077
|
width: 15%;
|
|
17002
17078
|
`}
|
|
17003
17079
|
|
|
17004
|
-
${({ $size:
|
|
17080
|
+
${({ $size: size4 }) => size4 === "small" && css44`
|
|
17005
17081
|
width: 25%;
|
|
17006
17082
|
`}
|
|
17007
17083
|
|
|
17008
|
-
${({ $size:
|
|
17084
|
+
${({ $size: size4 }) => size4 === "medium" && css44`
|
|
17009
17085
|
width: 45%;
|
|
17010
17086
|
`}
|
|
17011
17087
|
|
|
17012
|
-
${({ $size:
|
|
17088
|
+
${({ $size: size4 }) => size4 === "large" && css44`
|
|
17013
17089
|
width: 75%;
|
|
17014
17090
|
`}
|
|
17015
17091
|
`;
|
|
@@ -17037,7 +17113,7 @@ var Circle2 = styled64.div`
|
|
|
17037
17113
|
// src/components/Placeholder/components/Template7/index.tsx
|
|
17038
17114
|
import { jsx as jsx354, jsxs as jsxs178 } from "react/jsx-runtime";
|
|
17039
17115
|
var Template7 = (props) => {
|
|
17040
|
-
if (!props.loading) return /* @__PURE__ */ jsx354(
|
|
17116
|
+
if (!props.loading) return /* @__PURE__ */ jsx354(React53.Fragment, {});
|
|
17041
17117
|
return /* @__PURE__ */ jsxs178(Container21, { children: [
|
|
17042
17118
|
/* @__PURE__ */ jsx354(Header10, { children: /* @__PURE__ */ jsx354(
|
|
17043
17119
|
CustomLine4,
|
|
@@ -17060,7 +17136,7 @@ var Template7 = (props) => {
|
|
|
17060
17136
|
var Template7_default = Template7;
|
|
17061
17137
|
|
|
17062
17138
|
// src/components/Placeholder/components/Template8/index.tsx
|
|
17063
|
-
import
|
|
17139
|
+
import React54 from "react";
|
|
17064
17140
|
|
|
17065
17141
|
// src/components/Placeholder/components/Template8/styles.ts
|
|
17066
17142
|
import styled65, { css as css45 } from "styled-components";
|
|
@@ -17088,19 +17164,19 @@ var HeaderLine8 = styled65.div`
|
|
|
17088
17164
|
margin-top: 14px;
|
|
17089
17165
|
}
|
|
17090
17166
|
|
|
17091
|
-
${({ $size:
|
|
17167
|
+
${({ $size: size4 }) => size4 === "mini" && css45`
|
|
17092
17168
|
width: 15%;
|
|
17093
17169
|
`}
|
|
17094
17170
|
|
|
17095
|
-
${({ $size:
|
|
17171
|
+
${({ $size: size4 }) => size4 === "small" && css45`
|
|
17096
17172
|
width: 25%;
|
|
17097
17173
|
`}
|
|
17098
17174
|
|
|
17099
|
-
${({ $size:
|
|
17175
|
+
${({ $size: size4 }) => size4 === "medium" && css45`
|
|
17100
17176
|
width: 45%;
|
|
17101
17177
|
`}
|
|
17102
17178
|
|
|
17103
|
-
${({ $size:
|
|
17179
|
+
${({ $size: size4 }) => size4 === "large" && css45`
|
|
17104
17180
|
width: 75%;
|
|
17105
17181
|
`}
|
|
17106
17182
|
`;
|
|
@@ -17121,7 +17197,7 @@ var Main4 = styled65.div`
|
|
|
17121
17197
|
// src/components/Placeholder/components/Template8/index.tsx
|
|
17122
17198
|
import { jsx as jsx355, jsxs as jsxs179 } from "react/jsx-runtime";
|
|
17123
17199
|
var Template8 = (props) => {
|
|
17124
|
-
if (!props.loading) return /* @__PURE__ */ jsx355(
|
|
17200
|
+
if (!props.loading) return /* @__PURE__ */ jsx355(React54.Fragment, {});
|
|
17125
17201
|
return /* @__PURE__ */ jsxs179(Container22, { children: [
|
|
17126
17202
|
/* @__PURE__ */ jsx355(Header11, { children: /* @__PURE__ */ jsx355(
|
|
17127
17203
|
CustomLine5,
|
|
@@ -17157,7 +17233,7 @@ var Template8 = (props) => {
|
|
|
17157
17233
|
var Template8_default = Template8;
|
|
17158
17234
|
|
|
17159
17235
|
// src/components/Placeholder/components/Template9/index.tsx
|
|
17160
|
-
import
|
|
17236
|
+
import React55 from "react";
|
|
17161
17237
|
|
|
17162
17238
|
// src/components/Placeholder/components/Template9/styles.ts
|
|
17163
17239
|
import styled66, { css as css46 } from "styled-components";
|
|
@@ -17185,19 +17261,19 @@ var HeaderLine9 = styled66.div`
|
|
|
17185
17261
|
margin-top: 7px;
|
|
17186
17262
|
}
|
|
17187
17263
|
|
|
17188
|
-
${({ $size:
|
|
17264
|
+
${({ $size: size4 }) => size4 === "mini" && css46`
|
|
17189
17265
|
width: 15%;
|
|
17190
17266
|
`}
|
|
17191
17267
|
|
|
17192
|
-
${({ $size:
|
|
17268
|
+
${({ $size: size4 }) => size4 === "small" && css46`
|
|
17193
17269
|
width: 25%;
|
|
17194
17270
|
`}
|
|
17195
17271
|
|
|
17196
|
-
${({ $size:
|
|
17272
|
+
${({ $size: size4 }) => size4 === "medium" && css46`
|
|
17197
17273
|
width: 45%;
|
|
17198
17274
|
`}
|
|
17199
17275
|
|
|
17200
|
-
${({ $size:
|
|
17276
|
+
${({ $size: size4 }) => size4 === "large" && css46`
|
|
17201
17277
|
width: 75%;
|
|
17202
17278
|
`}
|
|
17203
17279
|
`;
|
|
@@ -17225,7 +17301,7 @@ var Circle3 = styled66.div`
|
|
|
17225
17301
|
// src/components/Placeholder/components/Template9/index.tsx
|
|
17226
17302
|
import { jsx as jsx356, jsxs as jsxs180 } from "react/jsx-runtime";
|
|
17227
17303
|
var Template82 = (props) => {
|
|
17228
|
-
if (!props.loading) return /* @__PURE__ */ jsx356(
|
|
17304
|
+
if (!props.loading) return /* @__PURE__ */ jsx356(React55.Fragment, {});
|
|
17229
17305
|
return /* @__PURE__ */ jsxs180(Container23, { children: [
|
|
17230
17306
|
/* @__PURE__ */ jsxs180(Header12, { children: [
|
|
17231
17307
|
/* @__PURE__ */ jsx356(
|
|
@@ -17253,7 +17329,7 @@ var Template82 = (props) => {
|
|
|
17253
17329
|
var Template9_default = Template82;
|
|
17254
17330
|
|
|
17255
17331
|
// src/components/Placeholder/components/Template10/index.tsx
|
|
17256
|
-
import
|
|
17332
|
+
import React56 from "react";
|
|
17257
17333
|
|
|
17258
17334
|
// src/components/Placeholder/components/Template10/styles.ts
|
|
17259
17335
|
import styled67, { css as css47 } from "styled-components";
|
|
@@ -17281,19 +17357,19 @@ var HeaderLine10 = styled67.div`
|
|
|
17281
17357
|
margin-top: 7px;
|
|
17282
17358
|
}
|
|
17283
17359
|
|
|
17284
|
-
${({ $size:
|
|
17360
|
+
${({ $size: size4 }) => size4 === "mini" && css47`
|
|
17285
17361
|
width: 15%;
|
|
17286
17362
|
`}
|
|
17287
17363
|
|
|
17288
|
-
${({ $size:
|
|
17364
|
+
${({ $size: size4 }) => size4 === "small" && css47`
|
|
17289
17365
|
width: 25%;
|
|
17290
17366
|
`}
|
|
17291
17367
|
|
|
17292
|
-
${({ $size:
|
|
17368
|
+
${({ $size: size4 }) => size4 === "medium" && css47`
|
|
17293
17369
|
width: 45%;
|
|
17294
17370
|
`}
|
|
17295
17371
|
|
|
17296
|
-
${({ $size:
|
|
17372
|
+
${({ $size: size4 }) => size4 === "large" && css47`
|
|
17297
17373
|
width: 75%;
|
|
17298
17374
|
`}
|
|
17299
17375
|
`;
|
|
@@ -17325,7 +17401,7 @@ var Circle4 = styled67.div`
|
|
|
17325
17401
|
// src/components/Placeholder/components/Template10/index.tsx
|
|
17326
17402
|
import { jsx as jsx357, jsxs as jsxs181 } from "react/jsx-runtime";
|
|
17327
17403
|
var Template10 = (props) => {
|
|
17328
|
-
if (!props.loading) return /* @__PURE__ */ jsx357(
|
|
17404
|
+
if (!props.loading) return /* @__PURE__ */ jsx357(React56.Fragment, {});
|
|
17329
17405
|
return /* @__PURE__ */ jsxs181(Container24, { children: [
|
|
17330
17406
|
/* @__PURE__ */ jsxs181(Header13, { children: [
|
|
17331
17407
|
/* @__PURE__ */ jsx357(
|
|
@@ -17538,102 +17614,1927 @@ var ProgressBar = ({ type, value, ...props }) => {
|
|
|
17538
17614
|
};
|
|
17539
17615
|
var ProgressBar_default = ProgressBar;
|
|
17540
17616
|
|
|
17541
|
-
// src/components/
|
|
17542
|
-
import
|
|
17543
|
-
import
|
|
17544
|
-
|
|
17545
|
-
// src/components/Signature/styles.ts
|
|
17546
|
-
import styled69 from "styled-components";
|
|
17547
|
-
var Container26 = styled69.div`
|
|
17548
|
-
width: 100%;
|
|
17549
|
-
height: 100%;
|
|
17550
|
-
|
|
17551
|
-
display: flex;
|
|
17552
|
-
flex-direction: column;
|
|
17553
|
-
gap: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
17554
|
-
`;
|
|
17555
|
-
var CanvasContainer = styled69.div`
|
|
17556
|
-
position: relative;
|
|
17557
|
-
flex: 1;
|
|
17558
|
-
overflow: hidden;
|
|
17559
|
-
background-color: ${({ theme: theme4, $invalid: invalid }) => invalid ? theme4.getColor("warningRed", 5) : theme4.colors.white};
|
|
17560
|
-
|
|
17561
|
-
&[data-placeholder]:before {
|
|
17562
|
-
content: attr(data-placeholder);
|
|
17563
|
-
position: absolute;
|
|
17564
|
-
top: 50%;
|
|
17565
|
-
left: 50%;
|
|
17566
|
-
transform: translate(-50%, -50%);
|
|
17567
|
-
|
|
17568
|
-
color: ${({ theme: theme4, $invalid: invalid }) => theme4.colors[invalid ? "warningRed" : "darkBlue"]};
|
|
17569
|
-
|
|
17570
|
-
${({ theme: theme4 }) => theme4.useTypography("h1")}
|
|
17571
|
-
font-size: 59px;
|
|
17572
|
-
line-height: 71px;
|
|
17573
|
-
opacity: 0.1;
|
|
17574
|
-
z-index: 1;
|
|
17575
|
-
}
|
|
17576
|
-
|
|
17577
|
-
canvas {
|
|
17578
|
-
position: relative;
|
|
17579
|
-
display: block;
|
|
17580
|
-
width: 100%;
|
|
17581
|
-
height: 100%;
|
|
17582
|
-
box-sizing: border-box;
|
|
17583
|
-
border: 1px solid
|
|
17584
|
-
${({ theme: theme4, $invalid: invalid }) => theme4.colors[invalid ? "warningRed" : "lightGrey"]};
|
|
17585
|
-
border-radius: 4px;
|
|
17586
|
-
z-index: 2;
|
|
17587
|
-
}
|
|
17617
|
+
// src/components/Select/index.tsx
|
|
17618
|
+
import React62, { useId, useMemo as useMemo13, useState as useState30 } from "react";
|
|
17619
|
+
import { FloatingPortal as FloatingPortal2 } from "@floating-ui/react";
|
|
17588
17620
|
|
|
17589
|
-
|
|
17590
|
-
|
|
17591
|
-
position: absolute;
|
|
17592
|
-
top: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
17593
|
-
right: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
17594
|
-
display: flex;
|
|
17595
|
-
gap: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
17596
|
-
z-index: 3;
|
|
17621
|
+
// src/components/Select/hooks/useAsyncOptions/index.ts
|
|
17622
|
+
import { useCallback as useCallback6, useEffect as useEffect22, useMemo as useMemo4, useState as useState25 } from "react";
|
|
17597
17623
|
|
|
17598
|
-
|
|
17599
|
-
|
|
17600
|
-
|
|
17601
|
-
border: none;
|
|
17602
|
-
background: none;
|
|
17624
|
+
// src/components/Select/constants.ts
|
|
17625
|
+
var SEARCH_DEBOUNCE_MS = 500;
|
|
17626
|
+
var MENU_EXIT_MS = 250;
|
|
17603
17627
|
|
|
17604
|
-
|
|
17605
|
-
|
|
17606
|
-
|
|
17607
|
-
|
|
17608
|
-
|
|
17609
|
-
|
|
17628
|
+
// src/components/Select/hooks/useAsyncOptions/index.ts
|
|
17629
|
+
var useAsyncOptions = (loader2) => {
|
|
17630
|
+
const [options, setOptions] = useState25([]);
|
|
17631
|
+
const [pagination, setPagination] = useState25({
|
|
17632
|
+
page: 1,
|
|
17633
|
+
last: false,
|
|
17634
|
+
fetched: null
|
|
17635
|
+
});
|
|
17636
|
+
const cursor = useMemo4(
|
|
17637
|
+
() => options.length > 0 ? options[options.length - 1] : null,
|
|
17638
|
+
[options]
|
|
17639
|
+
);
|
|
17640
|
+
const {
|
|
17641
|
+
current: [searchInput, setSearchInput],
|
|
17642
|
+
debounced: [search]
|
|
17643
|
+
} = useDebouncedState_default(
|
|
17644
|
+
"",
|
|
17645
|
+
() => {
|
|
17646
|
+
setOptions([]);
|
|
17647
|
+
setPagination({
|
|
17648
|
+
page: 1,
|
|
17649
|
+
last: true,
|
|
17650
|
+
fetched: null
|
|
17651
|
+
});
|
|
17652
|
+
},
|
|
17653
|
+
SEARCH_DEBOUNCE_MS
|
|
17654
|
+
);
|
|
17655
|
+
const loadOptions = useCallback6(async () => {
|
|
17656
|
+
if (pagination.fetched !== null) return;
|
|
17657
|
+
try {
|
|
17658
|
+
const result = await loader2(search, pagination.page, cursor);
|
|
17659
|
+
if (result === null) return;
|
|
17660
|
+
setOptions(
|
|
17661
|
+
pagination.page === 1 ? result.options : (prev) => [...prev, ...result.options]
|
|
17662
|
+
);
|
|
17663
|
+
setPagination((prev) => ({
|
|
17664
|
+
...prev,
|
|
17665
|
+
fetched: /* @__PURE__ */ new Date(),
|
|
17666
|
+
last: result.last
|
|
17667
|
+
}));
|
|
17668
|
+
} catch (e) {
|
|
17669
|
+
setPagination((prev) => ({ ...prev, fetched: /* @__PURE__ */ new Date(), last: true }));
|
|
17670
|
+
}
|
|
17671
|
+
}, [loader2, search, pagination.page, pagination.fetched, cursor]);
|
|
17672
|
+
const paginate2 = () => setPagination(
|
|
17673
|
+
(prev) => prev.last ? prev : {
|
|
17674
|
+
page: prev.page + 1,
|
|
17675
|
+
last: true,
|
|
17676
|
+
fetched: null
|
|
17677
|
+
}
|
|
17678
|
+
);
|
|
17679
|
+
useEffect22(() => {
|
|
17680
|
+
loadOptions();
|
|
17681
|
+
}, [loadOptions]);
|
|
17682
|
+
return {
|
|
17683
|
+
options,
|
|
17684
|
+
loading: pagination.fetched === null,
|
|
17685
|
+
paginate: paginate2,
|
|
17686
|
+
searchInput: [searchInput, setSearchInput]
|
|
17687
|
+
};
|
|
17688
|
+
};
|
|
17689
|
+
var useAsyncOptions_default = useAsyncOptions;
|
|
17690
|
+
|
|
17691
|
+
// src/components/Select/hooks/useFloatingMenu/index.ts
|
|
17692
|
+
import {
|
|
17693
|
+
autoUpdate,
|
|
17694
|
+
flip,
|
|
17695
|
+
size as size3,
|
|
17696
|
+
useDismiss,
|
|
17697
|
+
useFloating,
|
|
17698
|
+
useInteractions,
|
|
17699
|
+
useTransitionStatus
|
|
17700
|
+
} from "@floating-ui/react";
|
|
17701
|
+
var useFloatingMenu = ({ open, onOpenChange }) => {
|
|
17702
|
+
const floating = useFloating({
|
|
17703
|
+
open,
|
|
17704
|
+
onOpenChange,
|
|
17705
|
+
placement: "bottom-start",
|
|
17706
|
+
whileElementsMounted: autoUpdate,
|
|
17707
|
+
middleware: [
|
|
17708
|
+
flip(),
|
|
17709
|
+
size3({
|
|
17710
|
+
apply({ rects, elements }) {
|
|
17711
|
+
Object.assign(elements.floating.style, {
|
|
17712
|
+
minWidth: `${rects.reference.width}px`
|
|
17713
|
+
});
|
|
17714
|
+
}
|
|
17715
|
+
})
|
|
17716
|
+
]
|
|
17717
|
+
});
|
|
17718
|
+
const transition = useTransitionStatus(floating.context, {
|
|
17719
|
+
duration: MENU_EXIT_MS
|
|
17720
|
+
});
|
|
17721
|
+
const dismiss = useDismiss(floating.context, {
|
|
17722
|
+
outsidePressEvent: "mousedown",
|
|
17723
|
+
escapeKey: true
|
|
17724
|
+
});
|
|
17725
|
+
const interactions = useInteractions([dismiss]);
|
|
17726
|
+
return {
|
|
17727
|
+
floating,
|
|
17728
|
+
transition,
|
|
17729
|
+
interactions
|
|
17730
|
+
};
|
|
17731
|
+
};
|
|
17732
|
+
var useFloatingMenu_default = useFloatingMenu;
|
|
17733
|
+
|
|
17734
|
+
// src/components/Select/hooks/useListNavigation/index.ts
|
|
17735
|
+
import { useCallback as useCallback7, useEffect as useEffect23, useMemo as useMemo5, useState as useState26 } from "react";
|
|
17736
|
+
var INVALID_INDEX = -1;
|
|
17737
|
+
var useActiveIndex = (itemCount, scrollToIndex) => {
|
|
17738
|
+
const [activeIndex, setActiveIndex] = useState26(INVALID_INDEX);
|
|
17739
|
+
useEffect23(() => {
|
|
17740
|
+
setActiveIndex((current) => {
|
|
17741
|
+
if (current >= itemCount) return INVALID_INDEX;
|
|
17742
|
+
return current;
|
|
17743
|
+
});
|
|
17744
|
+
}, [itemCount]);
|
|
17745
|
+
const setActiveIndexMiddleware = (activeIndex2, scroll = true) => {
|
|
17746
|
+
setActiveIndex(activeIndex2);
|
|
17747
|
+
if (activeIndex2 < 0 || !scroll) return;
|
|
17748
|
+
scrollToIndex?.(activeIndex2);
|
|
17749
|
+
};
|
|
17750
|
+
return [activeIndex, setActiveIndexMiddleware];
|
|
17751
|
+
};
|
|
17752
|
+
var useListNavigation = ({
|
|
17753
|
+
itemCount,
|
|
17754
|
+
isItemDisabled,
|
|
17755
|
+
onSelect,
|
|
17756
|
+
scrollToIndex
|
|
17757
|
+
}) => {
|
|
17758
|
+
const [activeIndex, setActiveIndex] = useActiveIndex(itemCount, scrollToIndex);
|
|
17759
|
+
const firstEnabledIndex = useMemo5(() => {
|
|
17760
|
+
for (let index = 0; index < itemCount; index += 1) {
|
|
17761
|
+
if (!isItemDisabled(index)) return index;
|
|
17762
|
+
}
|
|
17763
|
+
return INVALID_INDEX;
|
|
17764
|
+
}, [isItemDisabled, itemCount]);
|
|
17765
|
+
const lastEnabledIndex = useMemo5(() => {
|
|
17766
|
+
for (let index = itemCount - 1; index >= 0; index -= 1) {
|
|
17767
|
+
if (!isItemDisabled(index)) return index;
|
|
17768
|
+
}
|
|
17769
|
+
return INVALID_INDEX;
|
|
17770
|
+
}, [isItemDisabled, itemCount]);
|
|
17771
|
+
const findNextEnabled = useCallback7(
|
|
17772
|
+
(from, direction) => {
|
|
17773
|
+
let index = from;
|
|
17774
|
+
while (index >= 0 && index < itemCount) {
|
|
17775
|
+
if (!isItemDisabled(index)) return index;
|
|
17776
|
+
index += direction;
|
|
17610
17777
|
}
|
|
17611
|
-
|
|
17612
|
-
|
|
17613
|
-
|
|
17778
|
+
return INVALID_INDEX;
|
|
17779
|
+
},
|
|
17780
|
+
[isItemDisabled, itemCount]
|
|
17781
|
+
);
|
|
17782
|
+
const onKeyDown = useCallback7(
|
|
17783
|
+
(event) => {
|
|
17784
|
+
if (event.key === "ArrowDown") {
|
|
17785
|
+
event.preventDefault();
|
|
17786
|
+
const from = activeIndex < 0 ? 0 : activeIndex + 1;
|
|
17787
|
+
const next = findNextEnabled(from, 1);
|
|
17788
|
+
if (next >= 0) setActiveIndex(next);
|
|
17789
|
+
return;
|
|
17614
17790
|
}
|
|
17615
|
-
|
|
17616
|
-
|
|
17791
|
+
if (event.key === "ArrowUp") {
|
|
17792
|
+
event.preventDefault();
|
|
17793
|
+
const from = activeIndex < 0 ? itemCount - 1 : activeIndex - 1;
|
|
17794
|
+
const next = findNextEnabled(from, -1);
|
|
17795
|
+
if (next >= 0) setActiveIndex(next);
|
|
17796
|
+
return;
|
|
17617
17797
|
}
|
|
17618
|
-
|
|
17619
|
-
|
|
17620
|
-
|
|
17621
|
-
|
|
17622
|
-
|
|
17623
|
-
|
|
17624
|
-
|
|
17625
|
-
|
|
17626
|
-
|
|
17627
|
-
|
|
17628
|
-
|
|
17629
|
-
|
|
17630
|
-
|
|
17631
|
-
|
|
17632
|
-
|
|
17798
|
+
if (event.key === "Home") {
|
|
17799
|
+
event.preventDefault();
|
|
17800
|
+
if (firstEnabledIndex >= 0) setActiveIndex(firstEnabledIndex);
|
|
17801
|
+
return;
|
|
17802
|
+
}
|
|
17803
|
+
if (event.key === "End") {
|
|
17804
|
+
event.preventDefault();
|
|
17805
|
+
if (lastEnabledIndex >= 0) setActiveIndex(lastEnabledIndex);
|
|
17806
|
+
return;
|
|
17807
|
+
}
|
|
17808
|
+
if ((event.key === "Enter" || event.key === " ") && activeIndex >= 0) {
|
|
17809
|
+
event.preventDefault();
|
|
17810
|
+
if (!isItemDisabled(activeIndex)) {
|
|
17811
|
+
onSelect(activeIndex);
|
|
17812
|
+
}
|
|
17813
|
+
}
|
|
17814
|
+
},
|
|
17815
|
+
[
|
|
17816
|
+
activeIndex,
|
|
17817
|
+
findNextEnabled,
|
|
17818
|
+
firstEnabledIndex,
|
|
17819
|
+
isItemDisabled,
|
|
17820
|
+
itemCount,
|
|
17821
|
+
lastEnabledIndex,
|
|
17822
|
+
onSelect
|
|
17823
|
+
]
|
|
17824
|
+
);
|
|
17825
|
+
const onMouseEnter = (index) => setActiveIndex(index, false);
|
|
17826
|
+
return {
|
|
17827
|
+
activeIndex,
|
|
17828
|
+
onMouseEnter,
|
|
17829
|
+
onKeyDown
|
|
17830
|
+
};
|
|
17633
17831
|
};
|
|
17634
|
-
var
|
|
17635
|
-
|
|
17636
|
-
|
|
17832
|
+
var useListNavigation_default = useListNavigation;
|
|
17833
|
+
|
|
17834
|
+
// src/components/Select/hooks/useRuleIndex/index.ts
|
|
17835
|
+
import { useCallback as useCallback8, useMemo as useMemo6 } from "react";
|
|
17836
|
+
var useRuleIndex = ({
|
|
17837
|
+
options,
|
|
17838
|
+
getKey,
|
|
17839
|
+
rules
|
|
17840
|
+
}) => {
|
|
17841
|
+
const failedRuleByKey = useMemo6(() => {
|
|
17842
|
+
const failedRuleByKey2 = /* @__PURE__ */ new Map();
|
|
17843
|
+
options.forEach((option) => {
|
|
17844
|
+
const key = getKey(option);
|
|
17845
|
+
const failedRule = rules?.find((rule) => !rule.allow(option));
|
|
17846
|
+
if (failedRule) {
|
|
17847
|
+
failedRuleByKey2.set(key, failedRule);
|
|
17848
|
+
}
|
|
17849
|
+
});
|
|
17850
|
+
return failedRuleByKey2;
|
|
17851
|
+
}, [getKey, options, rules]);
|
|
17852
|
+
const getFailedRuleByKey = useCallback8(
|
|
17853
|
+
(key) => {
|
|
17854
|
+
return failedRuleByKey.get(key);
|
|
17855
|
+
},
|
|
17856
|
+
[failedRuleByKey]
|
|
17857
|
+
);
|
|
17858
|
+
return {
|
|
17859
|
+
getFailedRuleByKey,
|
|
17860
|
+
enabledCount: options.length - failedRuleByKey.size
|
|
17861
|
+
};
|
|
17862
|
+
};
|
|
17863
|
+
var useRuleIndex_default = useRuleIndex;
|
|
17864
|
+
|
|
17865
|
+
// src/components/Select/hooks/useVirtualizedOptions/index.ts
|
|
17866
|
+
import { useEffect as useEffect24, useMemo as useMemo7, useRef as useRef2 } from "react";
|
|
17867
|
+
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
17868
|
+
var useVirtualizedOptions = (params) => {
|
|
17869
|
+
const { optionsLength, loading, onPaginate, overscan = 2 } = params;
|
|
17870
|
+
const estimateSize = useMemo7(() => {
|
|
17871
|
+
const estimateSize2 = params.estimateSize;
|
|
17872
|
+
if (estimateSize2 === void 0) {
|
|
17873
|
+
return () => 46;
|
|
17874
|
+
}
|
|
17875
|
+
if (typeof estimateSize2 === "function") {
|
|
17876
|
+
return estimateSize2;
|
|
17877
|
+
}
|
|
17878
|
+
return () => estimateSize2;
|
|
17879
|
+
}, [params.estimateSize]);
|
|
17880
|
+
const listRef = useRef2(null);
|
|
17881
|
+
const searchRef = useRef2(null);
|
|
17882
|
+
const rowVirtualizer = useVirtualizer({
|
|
17883
|
+
count: optionsLength,
|
|
17884
|
+
getScrollElement: () => listRef.current,
|
|
17885
|
+
estimateSize,
|
|
17886
|
+
overscan
|
|
17887
|
+
});
|
|
17888
|
+
const virtualItems = rowVirtualizer.getVirtualItems();
|
|
17889
|
+
useEffect24(() => {
|
|
17890
|
+
searchRef.current?.focus();
|
|
17891
|
+
}, [searchRef.current]);
|
|
17892
|
+
const endIndex = useMemo7(
|
|
17893
|
+
() => virtualItems[virtualItems.length - 1]?.index ?? 0,
|
|
17894
|
+
[virtualItems]
|
|
17895
|
+
);
|
|
17896
|
+
useEffect24(() => {
|
|
17897
|
+
if (loading || optionsLength < 1) return;
|
|
17898
|
+
if (endIndex >= optionsLength - 1 - overscan) {
|
|
17899
|
+
onPaginate();
|
|
17900
|
+
}
|
|
17901
|
+
}, [loading, endIndex, optionsLength, overscan, onPaginate]);
|
|
17902
|
+
return {
|
|
17903
|
+
listRef,
|
|
17904
|
+
searchRef,
|
|
17905
|
+
rowVirtualizer,
|
|
17906
|
+
virtualItems
|
|
17907
|
+
};
|
|
17908
|
+
};
|
|
17909
|
+
var useVirtualizedOptions_default = useVirtualizedOptions;
|
|
17910
|
+
|
|
17911
|
+
// src/components/Select/instances/multi/index.tsx
|
|
17912
|
+
import React60, { useCallback as useCallback9, useMemo as useMemo11, useState as useState29 } from "react";
|
|
17913
|
+
|
|
17914
|
+
// src/components/Select/components/Apply/index.tsx
|
|
17915
|
+
import { useMemo as useMemo10 } from "react";
|
|
17916
|
+
|
|
17917
|
+
// src/components/Popup/index.tsx
|
|
17918
|
+
import React57, { useMemo as useMemo9, useRef as useRef3 } from "react";
|
|
17919
|
+
import {
|
|
17920
|
+
FloatingPortal,
|
|
17921
|
+
arrow,
|
|
17922
|
+
autoUpdate as autoUpdate2,
|
|
17923
|
+
flip as flip2,
|
|
17924
|
+
hide,
|
|
17925
|
+
offset,
|
|
17926
|
+
shift,
|
|
17927
|
+
useClick,
|
|
17928
|
+
useDismiss as useDismiss2,
|
|
17929
|
+
useFloating as useFloating2,
|
|
17930
|
+
useHover,
|
|
17931
|
+
useInteractions as useInteractions2
|
|
17932
|
+
} from "@floating-ui/react";
|
|
17933
|
+
|
|
17934
|
+
// src/components/Popup/hooks/fallbackPlacements/index.ts
|
|
17935
|
+
import { useMemo as useMemo8 } from "react";
|
|
17936
|
+
var FALLBACK_PLACEMENTS = {
|
|
17937
|
+
top: ["top-start", "top-end", "bottom", "right", "left"],
|
|
17938
|
+
"top-start": ["top", "top-end", "right-start", "left-start", "bottom-start"],
|
|
17939
|
+
"top-end": ["top", "top-start", "right-end", "left-end", "bottom-end"],
|
|
17940
|
+
right: ["right-start", "right-end", "bottom", "top", "left"],
|
|
17941
|
+
"right-start": [
|
|
17942
|
+
"right",
|
|
17943
|
+
"right-end",
|
|
17944
|
+
"bottom-start",
|
|
17945
|
+
"top-start",
|
|
17946
|
+
"left-start"
|
|
17947
|
+
],
|
|
17948
|
+
"right-end": ["right", "right-start", "bottom-end", "top-end", "left-end"],
|
|
17949
|
+
bottom: ["bottom-start", "bottom-end", "top", "right", "left"],
|
|
17950
|
+
"bottom-start": [
|
|
17951
|
+
"bottom",
|
|
17952
|
+
"bottom-end",
|
|
17953
|
+
"right-start",
|
|
17954
|
+
"left-start",
|
|
17955
|
+
"top-start"
|
|
17956
|
+
],
|
|
17957
|
+
"bottom-end": ["bottom", "bottom-start", "right-end", "left-end", "top-end"],
|
|
17958
|
+
left: ["left-start", "left-end", "bottom", "top", "right"],
|
|
17959
|
+
"left-start": [
|
|
17960
|
+
"left",
|
|
17961
|
+
"left-end",
|
|
17962
|
+
"bottom-start",
|
|
17963
|
+
"top-start",
|
|
17964
|
+
"right-start"
|
|
17965
|
+
],
|
|
17966
|
+
"left-end": ["left", "left-start", "bottom-end", "top-end", "right-end"]
|
|
17967
|
+
};
|
|
17968
|
+
var useFallbackPlacements = (props) => {
|
|
17969
|
+
const { placement, fallbackPlacements } = props;
|
|
17970
|
+
const fallbackList = useMemo8(() => {
|
|
17971
|
+
if (fallbackPlacements && fallbackPlacements.length > 0) {
|
|
17972
|
+
return fallbackPlacements;
|
|
17973
|
+
}
|
|
17974
|
+
return FALLBACK_PLACEMENTS[placement];
|
|
17975
|
+
}, [fallbackPlacements, placement]);
|
|
17976
|
+
return fallbackList;
|
|
17977
|
+
};
|
|
17978
|
+
var fallbackPlacements_default = useFallbackPlacements;
|
|
17979
|
+
|
|
17980
|
+
// src/components/Popup/hooks/open/index.ts
|
|
17981
|
+
import { useState as useState27 } from "react";
|
|
17982
|
+
var useOpen = (props) => {
|
|
17983
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState27(false);
|
|
17984
|
+
const isControlled = props.open !== void 0;
|
|
17985
|
+
const open = isControlled ? props.open : uncontrolledOpen;
|
|
17986
|
+
const setOpen = (nextOpen) => {
|
|
17987
|
+
if (isControlled) {
|
|
17988
|
+
props.setOpen?.(nextOpen);
|
|
17989
|
+
return;
|
|
17990
|
+
}
|
|
17991
|
+
setUncontrolledOpen(nextOpen);
|
|
17992
|
+
};
|
|
17993
|
+
return [open, setOpen];
|
|
17994
|
+
};
|
|
17995
|
+
var open_default = useOpen;
|
|
17996
|
+
|
|
17997
|
+
// src/components/Popup/styles.ts
|
|
17998
|
+
import styled69, { css as css48 } from "styled-components";
|
|
17999
|
+
var TooltipArrow = styled69.div`
|
|
18000
|
+
position: absolute;
|
|
18001
|
+
width: 0;
|
|
18002
|
+
height: 0;
|
|
18003
|
+
pointer-events: none;
|
|
18004
|
+
|
|
18005
|
+
${({ $arrow: arrow2, $placement: placement }) => {
|
|
18006
|
+
const width = (arrow2 || "pointed") === "flattened" ? 30 : 16;
|
|
18007
|
+
const halfWidth = width / 2;
|
|
18008
|
+
const borderSize = 1;
|
|
18009
|
+
const length = 6;
|
|
18010
|
+
const [side, align] = placement.split("-");
|
|
18011
|
+
if (side === "top" || side === "bottom") {
|
|
18012
|
+
const vertical = side === "top" ? css48`
|
|
18013
|
+
bottom: 0;
|
|
18014
|
+
&::before {
|
|
18015
|
+
content: '';
|
|
18016
|
+
position: absolute;
|
|
18017
|
+
left: -${halfWidth}px;
|
|
18018
|
+
border-left: ${halfWidth}px solid transparent;
|
|
18019
|
+
border-right: ${halfWidth}px solid transparent;
|
|
18020
|
+
border-top: ${length}px solid var(--tooltip-border);
|
|
18021
|
+
}
|
|
18022
|
+
&::after {
|
|
18023
|
+
content: '';
|
|
18024
|
+
position: absolute;
|
|
18025
|
+
left: -${halfWidth - borderSize}px;
|
|
18026
|
+
top: -${borderSize}px;
|
|
18027
|
+
border-left: ${halfWidth - borderSize}px solid transparent;
|
|
18028
|
+
border-right: ${halfWidth - borderSize}px solid transparent;
|
|
18029
|
+
border-top: ${length - borderSize}px solid var(--tooltip-bg);
|
|
18030
|
+
}
|
|
18031
|
+
` : css48`
|
|
18032
|
+
top: -${length}px;
|
|
18033
|
+
&::before {
|
|
18034
|
+
content: '';
|
|
18035
|
+
position: absolute;
|
|
18036
|
+
left: -${halfWidth}px;
|
|
18037
|
+
border-left: ${halfWidth}px solid transparent;
|
|
18038
|
+
border-right: ${halfWidth}px solid transparent;
|
|
18039
|
+
border-bottom: ${length}px solid var(--tooltip-border);
|
|
18040
|
+
}
|
|
18041
|
+
&::after {
|
|
18042
|
+
content: '';
|
|
18043
|
+
position: absolute;
|
|
18044
|
+
left: -${halfWidth - borderSize}px;
|
|
18045
|
+
top: ${borderSize}px;
|
|
18046
|
+
border-left: ${halfWidth - borderSize}px solid transparent;
|
|
18047
|
+
border-right: ${halfWidth - borderSize}px solid transparent;
|
|
18048
|
+
border-bottom: ${length - borderSize}px solid var(--tooltip-bg);
|
|
18049
|
+
}
|
|
18050
|
+
`;
|
|
18051
|
+
const alignStyles = align === "start" ? css48`
|
|
18052
|
+
left: ${halfWidth}px;
|
|
18053
|
+
margin-left: ${length}px;
|
|
18054
|
+
` : align === "end" ? css48`
|
|
18055
|
+
right: ${halfWidth}px;
|
|
18056
|
+
margin-right: ${length}px;
|
|
18057
|
+
` : css48`
|
|
18058
|
+
left: 50%;
|
|
18059
|
+
`;
|
|
18060
|
+
return css48`
|
|
18061
|
+
${vertical}
|
|
18062
|
+
${alignStyles}
|
|
18063
|
+
`;
|
|
18064
|
+
}
|
|
18065
|
+
const horizontal = side === "left" ? css48`
|
|
18066
|
+
right: 0;
|
|
18067
|
+
&::before {
|
|
18068
|
+
content: '';
|
|
18069
|
+
position: absolute;
|
|
18070
|
+
top: -${halfWidth}px;
|
|
18071
|
+
border-top: ${halfWidth}px solid transparent;
|
|
18072
|
+
border-bottom: ${halfWidth}px solid transparent;
|
|
18073
|
+
border-left: ${length}px solid var(--tooltip-border);
|
|
18074
|
+
}
|
|
18075
|
+
&::after {
|
|
18076
|
+
content: '';
|
|
18077
|
+
position: absolute;
|
|
18078
|
+
top: -${halfWidth - borderSize}px;
|
|
18079
|
+
left: -${borderSize}px;
|
|
18080
|
+
border-top: ${halfWidth - borderSize}px solid transparent;
|
|
18081
|
+
border-bottom: ${halfWidth - borderSize}px solid transparent;
|
|
18082
|
+
border-left: ${length - borderSize}px solid var(--tooltip-bg);
|
|
18083
|
+
}
|
|
18084
|
+
` : css48`
|
|
18085
|
+
left: -${length}px;
|
|
18086
|
+
&::before {
|
|
18087
|
+
content: '';
|
|
18088
|
+
position: absolute;
|
|
18089
|
+
top: -${halfWidth}px;
|
|
18090
|
+
border-top: ${halfWidth}px solid transparent;
|
|
18091
|
+
border-bottom: ${halfWidth}px solid transparent;
|
|
18092
|
+
border-right: ${length}px solid var(--tooltip-border);
|
|
18093
|
+
}
|
|
18094
|
+
&::after {
|
|
18095
|
+
content: '';
|
|
18096
|
+
position: absolute;
|
|
18097
|
+
top: -${halfWidth - borderSize}px;
|
|
18098
|
+
left: ${borderSize}px;
|
|
18099
|
+
border-top: ${halfWidth - borderSize}px solid transparent;
|
|
18100
|
+
border-bottom: ${halfWidth - borderSize}px solid transparent;
|
|
18101
|
+
border-right: ${length - borderSize}px solid var(--tooltip-bg);
|
|
18102
|
+
}
|
|
18103
|
+
`;
|
|
18104
|
+
if (align === "start") {
|
|
18105
|
+
return css48`
|
|
18106
|
+
top: ${halfWidth}px;
|
|
18107
|
+
margin-top: ${length}px;
|
|
18108
|
+
${horizontal}
|
|
18109
|
+
`;
|
|
18110
|
+
}
|
|
18111
|
+
if (align === "end") {
|
|
18112
|
+
return css48`
|
|
18113
|
+
bottom: ${halfWidth}px;
|
|
18114
|
+
margin-bottom: ${length}px;
|
|
18115
|
+
${horizontal}
|
|
18116
|
+
`;
|
|
18117
|
+
}
|
|
18118
|
+
return css48`
|
|
18119
|
+
top: 50%;
|
|
18120
|
+
${horizontal}
|
|
18121
|
+
`;
|
|
18122
|
+
}}
|
|
18123
|
+
`;
|
|
18124
|
+
var TooltipSurface = styled69.div`
|
|
18125
|
+
position: relative;
|
|
18126
|
+
|
|
18127
|
+
${({ theme: theme4, $background: background, $placement: placement }) => {
|
|
18128
|
+
const [side] = placement.split("-");
|
|
18129
|
+
const [bgColor, fontColor, borderColor, borderRadius] = background === "light" ? [theme4.colors.white, theme4.colors.greyishBlue, "#eeeeee", 5] : [
|
|
18130
|
+
theme4.colors.greyishBlue,
|
|
18131
|
+
theme4.colors.white,
|
|
18132
|
+
theme4.colors.greyishBlue,
|
|
18133
|
+
0
|
|
18134
|
+
];
|
|
18135
|
+
const boxShadow = {
|
|
18136
|
+
top: [0, -4],
|
|
18137
|
+
bottom: [0, 4],
|
|
18138
|
+
right: [4, 0],
|
|
18139
|
+
left: [-4, 0]
|
|
18140
|
+
}[side] || [0, 4];
|
|
18141
|
+
return css48`
|
|
18142
|
+
--tooltip-bg: ${bgColor};
|
|
18143
|
+
--tooltip-border: ${borderColor};
|
|
18144
|
+
border: 1px solid ${borderColor};
|
|
18145
|
+
border-radius: ${borderRadius}px;
|
|
18146
|
+
box-shadow: ${boxShadow[0]}px ${boxShadow[1]}px 10px
|
|
18147
|
+
${theme4.getColor("black", 10)};
|
|
18148
|
+
color: ${fontColor};
|
|
18149
|
+
|
|
18150
|
+
&,
|
|
18151
|
+
& ${TooltipArrow} {
|
|
18152
|
+
background-color: ${bgColor};
|
|
18153
|
+
}
|
|
18154
|
+
`;
|
|
18155
|
+
}}
|
|
18156
|
+
|
|
18157
|
+
border-radius: 4px;
|
|
18158
|
+
padding: 8px 10px;
|
|
18159
|
+
font-size: 12px;
|
|
18160
|
+
max-width: 240px;
|
|
18161
|
+
z-index: 1000;
|
|
18162
|
+
`;
|
|
18163
|
+
|
|
18164
|
+
// src/components/Popup/index.tsx
|
|
18165
|
+
import { jsx as jsx360, jsxs as jsxs183 } from "react/jsx-runtime";
|
|
18166
|
+
var mergeRefs = (...refs) => {
|
|
18167
|
+
return (node) => {
|
|
18168
|
+
refs.forEach((ref) => {
|
|
18169
|
+
if (!ref) return;
|
|
18170
|
+
if (typeof ref === "function") ref(node);
|
|
18171
|
+
else ref.current = node;
|
|
18172
|
+
});
|
|
18173
|
+
};
|
|
18174
|
+
};
|
|
18175
|
+
var PopupComponent = (props) => {
|
|
18176
|
+
const {
|
|
18177
|
+
content: Content5,
|
|
18178
|
+
renderTrigger,
|
|
18179
|
+
triggerProps,
|
|
18180
|
+
on = "hover",
|
|
18181
|
+
placement,
|
|
18182
|
+
offset: offsetValue = 8,
|
|
18183
|
+
shift: shiftValue = 8,
|
|
18184
|
+
background = "dark",
|
|
18185
|
+
closeOnClip = false
|
|
18186
|
+
} = props;
|
|
18187
|
+
const arrowStyle = props.arrow || (background === "dark" ? "pointed" : "flattened");
|
|
18188
|
+
const withArrow = arrowStyle !== "none";
|
|
18189
|
+
const [open, setOpen] = open_default(props);
|
|
18190
|
+
const arrowRef = useRef3(null);
|
|
18191
|
+
const fallbackPlacements = fallbackPlacements_default(props);
|
|
18192
|
+
const floating = useFloating2({
|
|
18193
|
+
open,
|
|
18194
|
+
onOpenChange: setOpen,
|
|
18195
|
+
placement,
|
|
18196
|
+
whileElementsMounted: autoUpdate2,
|
|
18197
|
+
middleware: [
|
|
18198
|
+
offset(offsetValue),
|
|
18199
|
+
flip2({ fallbackPlacements, padding: shiftValue }),
|
|
18200
|
+
shift({ padding: shiftValue }),
|
|
18201
|
+
...withArrow ? [arrow({ element: arrowRef })] : [],
|
|
18202
|
+
...closeOnClip ? [
|
|
18203
|
+
hide(),
|
|
18204
|
+
{
|
|
18205
|
+
name: "closeOnClip",
|
|
18206
|
+
fn(state) {
|
|
18207
|
+
if (state.middlewareData.hide?.referenceHidden) {
|
|
18208
|
+
setOpen(false);
|
|
18209
|
+
}
|
|
18210
|
+
return {};
|
|
18211
|
+
}
|
|
18212
|
+
}
|
|
18213
|
+
] : []
|
|
18214
|
+
]
|
|
18215
|
+
});
|
|
18216
|
+
const hover = useHover(floating.context, {
|
|
18217
|
+
move: false,
|
|
18218
|
+
enabled: on === "hover"
|
|
18219
|
+
});
|
|
18220
|
+
const click = useClick(floating.context, {
|
|
18221
|
+
enabled: on === "click"
|
|
18222
|
+
});
|
|
18223
|
+
const dismiss = useDismiss2(floating.context, {
|
|
18224
|
+
outsidePressEvent: "mousedown",
|
|
18225
|
+
escapeKey: true,
|
|
18226
|
+
enabled: on === "click"
|
|
18227
|
+
});
|
|
18228
|
+
const interactions = useInteractions2([hover, click, dismiss]);
|
|
18229
|
+
const referenceProps = useMemo9(() => {
|
|
18230
|
+
const { ref: triggerRef, ...rest } = triggerProps || {};
|
|
18231
|
+
return interactions.getReferenceProps({
|
|
18232
|
+
...rest,
|
|
18233
|
+
ref: mergeRefs(floating.refs.setReference, triggerRef)
|
|
18234
|
+
});
|
|
18235
|
+
}, [floating.refs.setReference, interactions, triggerProps]);
|
|
18236
|
+
return /* @__PURE__ */ jsxs183(React57.Fragment, { children: [
|
|
18237
|
+
renderTrigger(referenceProps),
|
|
18238
|
+
open ? /* @__PURE__ */ jsx360(FloatingPortal, { children: /* @__PURE__ */ jsxs183(
|
|
18239
|
+
TooltipSurface,
|
|
18240
|
+
{
|
|
18241
|
+
ref: floating.refs.setFloating,
|
|
18242
|
+
style: floating.floatingStyles,
|
|
18243
|
+
$placement: floating.placement,
|
|
18244
|
+
$background: background,
|
|
18245
|
+
...interactions.getFloatingProps(),
|
|
18246
|
+
children: [
|
|
18247
|
+
withArrow ? /* @__PURE__ */ jsx360(
|
|
18248
|
+
TooltipArrow,
|
|
18249
|
+
{
|
|
18250
|
+
ref: arrowRef,
|
|
18251
|
+
$arrow: arrowStyle,
|
|
18252
|
+
$placement: floating.placement
|
|
18253
|
+
}
|
|
18254
|
+
) : null,
|
|
18255
|
+
/* @__PURE__ */ jsx360(Content5, {})
|
|
18256
|
+
]
|
|
18257
|
+
}
|
|
18258
|
+
) }) : null
|
|
18259
|
+
] });
|
|
18260
|
+
};
|
|
18261
|
+
var Popup2 = ({
|
|
18262
|
+
enabled,
|
|
18263
|
+
...props
|
|
18264
|
+
}) => {
|
|
18265
|
+
return enabled !== false ? /* @__PURE__ */ jsx360(PopupComponent, { ...props }) : props.renderTrigger(props.triggerProps || {});
|
|
18266
|
+
};
|
|
18267
|
+
var Popup_default = Popup2;
|
|
18268
|
+
|
|
18269
|
+
// src/components/Select/components/Apply/styles.ts
|
|
18270
|
+
import styled70 from "styled-components";
|
|
18271
|
+
var ApplyButton = styled70.button`
|
|
18272
|
+
background: none;
|
|
18273
|
+
border: none;
|
|
18274
|
+
outline: none;
|
|
18275
|
+
padding: 0;
|
|
18276
|
+
|
|
18277
|
+
background-color: ${({ theme: theme4 }) => theme4.colors.blue};
|
|
18278
|
+
border-radius: 3px;
|
|
18279
|
+
|
|
18280
|
+
${({ theme: theme4 }) => theme4.useTypography("h4")}
|
|
18281
|
+
color: ${({ theme: theme4 }) => theme4.colors.white};
|
|
18282
|
+
|
|
18283
|
+
height: 35px;
|
|
18284
|
+
width: 100%;
|
|
18285
|
+
display: flex;
|
|
18286
|
+
align-items: center;
|
|
18287
|
+
justify-content: center;
|
|
18288
|
+
|
|
18289
|
+
transition-property: opacity;
|
|
18290
|
+
transition-duration: 0.25s;
|
|
18291
|
+
transition-timing-function: linear;
|
|
18292
|
+
|
|
18293
|
+
&[aria-disabled='true'] {
|
|
18294
|
+
opacity: 0.5;
|
|
18295
|
+
}
|
|
18296
|
+
&:not([aria-disabled='true']) {
|
|
18297
|
+
cursor: pointer;
|
|
18298
|
+
}
|
|
18299
|
+
`;
|
|
18300
|
+
|
|
18301
|
+
// src/components/Select/components/Apply/index.tsx
|
|
18302
|
+
import { jsx as jsx361 } from "react/jsx-runtime";
|
|
18303
|
+
var Apply = ({
|
|
18304
|
+
setValue,
|
|
18305
|
+
clearable,
|
|
18306
|
+
applyRules,
|
|
18307
|
+
onClose,
|
|
18308
|
+
draft
|
|
18309
|
+
}) => {
|
|
18310
|
+
const value = useMemo10(() => Array.from(draft.values()), [draft]);
|
|
18311
|
+
const failedApplyRule = useMemo10(() => {
|
|
18312
|
+
const rule = applyRules.find((rule2) => !rule2.allow(value));
|
|
18313
|
+
return rule;
|
|
18314
|
+
}, [value, applyRules]);
|
|
18315
|
+
const ApplyRuleComponent = failedApplyRule?.Component;
|
|
18316
|
+
const onApply = () => {
|
|
18317
|
+
if (!clearable && draft.size < 1) return;
|
|
18318
|
+
if (failedApplyRule !== void 0) return;
|
|
18319
|
+
setValue(Array.from(draft.values()));
|
|
18320
|
+
onClose();
|
|
18321
|
+
};
|
|
18322
|
+
return /* @__PURE__ */ jsx361(
|
|
18323
|
+
Popup_default,
|
|
18324
|
+
{
|
|
18325
|
+
...ApplyRuleComponent !== void 0 ? {
|
|
18326
|
+
enabled: true,
|
|
18327
|
+
content: () => /* @__PURE__ */ jsx361(ApplyRuleComponent, { value })
|
|
18328
|
+
} : {
|
|
18329
|
+
enabled: false,
|
|
18330
|
+
content: () => null
|
|
18331
|
+
},
|
|
18332
|
+
on: "click",
|
|
18333
|
+
closeOnClip: true,
|
|
18334
|
+
placement: "right",
|
|
18335
|
+
triggerType: "button",
|
|
18336
|
+
triggerProps: {
|
|
18337
|
+
onClick: onApply
|
|
18338
|
+
},
|
|
18339
|
+
renderTrigger: (props) => /* @__PURE__ */ jsx361(
|
|
18340
|
+
ApplyButton,
|
|
18341
|
+
{
|
|
18342
|
+
type: "button",
|
|
18343
|
+
"aria-disabled": !clearable && draft.size < 1 || failedApplyRule !== void 0,
|
|
18344
|
+
...props,
|
|
18345
|
+
children: "Aplicar"
|
|
18346
|
+
}
|
|
18347
|
+
)
|
|
18348
|
+
}
|
|
18349
|
+
);
|
|
18350
|
+
};
|
|
18351
|
+
var Apply_default = Apply;
|
|
18352
|
+
|
|
18353
|
+
// src/components/Select/components/Scroll/index.tsx
|
|
18354
|
+
import React58 from "react";
|
|
18355
|
+
|
|
18356
|
+
// src/components/Select/components/Scroll/styles.ts
|
|
18357
|
+
import styled71 from "styled-components";
|
|
18358
|
+
var ListContainer = styled71.div`
|
|
18359
|
+
flex: 1;
|
|
18360
|
+
position: relative;
|
|
18361
|
+
overflow: hidden;
|
|
18362
|
+
`;
|
|
18363
|
+
var ListScroll = styled71.div`
|
|
18364
|
+
overflow-y: scroll;
|
|
18365
|
+
overflow-y: overlay;
|
|
18366
|
+
width: 100%;
|
|
18367
|
+
height: 100%;
|
|
18368
|
+
|
|
18369
|
+
/* Firefox */
|
|
18370
|
+
@supports (scrollbar-width: thin) {
|
|
18371
|
+
.scroll {
|
|
18372
|
+
scrollbar-color: ${({ theme: theme4 }) => `${theme4.colors.grey} ${theme4.colors.white}`};
|
|
18373
|
+
scrollbar-width: thin;
|
|
18374
|
+
}
|
|
18375
|
+
}
|
|
18376
|
+
|
|
18377
|
+
/* Chrome/Edge/Safari (WebKit/Blink) */
|
|
18378
|
+
@supports selector(::-webkit-scrollbar) {
|
|
18379
|
+
&::-webkit-scrollbar {
|
|
18380
|
+
width: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
18381
|
+
}
|
|
18382
|
+
&::-webkit-scrollbar-thumb {
|
|
18383
|
+
background: ${({ theme: theme4 }) => theme4.colors.grey};
|
|
18384
|
+
}
|
|
18385
|
+
&::-webkit-scrollbar-track {
|
|
18386
|
+
background: ${({ theme: theme4 }) => theme4.colors.white};
|
|
18387
|
+
}
|
|
18388
|
+
}
|
|
18389
|
+
`;
|
|
18390
|
+
var ListInner = styled71.div`
|
|
18391
|
+
position: relative;
|
|
18392
|
+
width: 100%;
|
|
18393
|
+
`;
|
|
18394
|
+
var EmptyMessage2 = styled71.div`
|
|
18395
|
+
height: 100%;
|
|
18396
|
+
width: 100%;
|
|
18397
|
+
display: flex;
|
|
18398
|
+
align-items: center;
|
|
18399
|
+
justify-content: center;
|
|
18400
|
+
|
|
18401
|
+
${({ theme: theme4 }) => theme4.useTypography("p")}
|
|
18402
|
+
color: ${({ theme: theme4 }) => theme4.getColor("greyishBlue", 80)};
|
|
18403
|
+
`;
|
|
18404
|
+
var MultiHighlight = Checkmark;
|
|
18405
|
+
var SingleHighlight = styled71.div`
|
|
18406
|
+
position: absolute;
|
|
18407
|
+
top: 0;
|
|
18408
|
+
left: 0;
|
|
18409
|
+
height: 100%;
|
|
18410
|
+
width: 3px;
|
|
18411
|
+
|
|
18412
|
+
transition-property: background-color;
|
|
18413
|
+
transition-timing-function: linear;
|
|
18414
|
+
transition-duration: 0.25s;
|
|
18415
|
+
`;
|
|
18416
|
+
var OptionRow = styled71.div`
|
|
18417
|
+
position: absolute;
|
|
18418
|
+
top: 0;
|
|
18419
|
+
left: 0;
|
|
18420
|
+
width: 100%;
|
|
18421
|
+
|
|
18422
|
+
display: flex;
|
|
18423
|
+
align-items: center;
|
|
18424
|
+
gap: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
18425
|
+
|
|
18426
|
+
background-color: ${({ theme: theme4, $active: active }) => active ? theme4.getColor("blue", 15) : theme4.colors.white};
|
|
18427
|
+
padding: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
18428
|
+
|
|
18429
|
+
${({ theme: theme4 }) => theme4.useTypography("p")}
|
|
18430
|
+
color: ${({ theme: theme4 }) => theme4.colors.greyishBlue};
|
|
18431
|
+
|
|
18432
|
+
border-bottom-width: 1px;
|
|
18433
|
+
border-bottom-style: solid;
|
|
18434
|
+
&:nth-last-child(1) {
|
|
18435
|
+
border-bottom-color: transparent;
|
|
18436
|
+
}
|
|
18437
|
+
&:not(:nth-last-child(1)) {
|
|
18438
|
+
border-bottom-color: ${({ theme: theme4 }) => theme4.getColor("greyishBlue", 10)};
|
|
18439
|
+
}
|
|
18440
|
+
|
|
18441
|
+
&[aria-disabled='true'] {
|
|
18442
|
+
cursor: not-allowed;
|
|
18443
|
+
opacity: 0.5;
|
|
18444
|
+
}
|
|
18445
|
+
&:not([aria-disabled='true']) {
|
|
18446
|
+
cursor: pointer;
|
|
18447
|
+
opacity: 1;
|
|
18448
|
+
}
|
|
18449
|
+
|
|
18450
|
+
&[aria-selected='true'] > ${SingleHighlight} {
|
|
18451
|
+
background-color: ${({ theme: theme4 }) => theme4.colors.blue};
|
|
18452
|
+
}
|
|
18453
|
+
&:not([aria-selected='true']) > ${SingleHighlight} {
|
|
18454
|
+
background-color: transparent;
|
|
18455
|
+
}
|
|
18456
|
+
|
|
18457
|
+
> ${MultiHighlight} {
|
|
18458
|
+
background-color: ${({ theme: theme4, $active: active }) => active ? theme4.colors.iceWhite : theme4.colors.white};
|
|
18459
|
+
}
|
|
18460
|
+
|
|
18461
|
+
&[aria-selected='true'] > ${MultiHighlight} {
|
|
18462
|
+
border-color: ${({ theme: theme4 }) => theme4.colors.blue};
|
|
18463
|
+
}
|
|
18464
|
+
&[aria-selected='true'] > ${MultiHighlight}:after {
|
|
18465
|
+
width: 5px;
|
|
18466
|
+
height: 9.5px;
|
|
18467
|
+
border-width: 0 2px 2px 0;
|
|
18468
|
+
left: 5px;
|
|
18469
|
+
top: 1px;
|
|
18470
|
+
}
|
|
18471
|
+
&:not([aria-selected='true']) > ${MultiHighlight} {
|
|
18472
|
+
border-color: ${({ theme: theme4 }) => theme4.colors.lightestGrey};
|
|
18473
|
+
}
|
|
18474
|
+
|
|
18475
|
+
transition-property: background-color, opacity;
|
|
18476
|
+
transition-timing-function: linear;
|
|
18477
|
+
transition-duration: 0.25s;
|
|
18478
|
+
`;
|
|
18479
|
+
|
|
18480
|
+
// src/components/Select/components/Scroll/index.tsx
|
|
18481
|
+
import { jsx as jsx362, jsxs as jsxs184 } from "react/jsx-runtime";
|
|
18482
|
+
var Scroll = React58.forwardRef(
|
|
18483
|
+
({
|
|
18484
|
+
menuId,
|
|
18485
|
+
loading,
|
|
18486
|
+
options,
|
|
18487
|
+
virtualItems,
|
|
18488
|
+
totalSize,
|
|
18489
|
+
measureElement,
|
|
18490
|
+
OptionComponent,
|
|
18491
|
+
onClickOption,
|
|
18492
|
+
onMouseEnterOption,
|
|
18493
|
+
activeIndex,
|
|
18494
|
+
getKey,
|
|
18495
|
+
getIsSelected,
|
|
18496
|
+
getFailedRuleByKey,
|
|
18497
|
+
mode,
|
|
18498
|
+
...props
|
|
18499
|
+
}, ref) => {
|
|
18500
|
+
const Highlight = mode === "single" ? SingleHighlight : MultiHighlight;
|
|
18501
|
+
return /* @__PURE__ */ jsxs184(ListContainer, { children: [
|
|
18502
|
+
loading ? /* @__PURE__ */ jsx362(Loader_default, { filled: true }) : options.length < 1 ? /* @__PURE__ */ jsx362(EmptyMessage2, { children: "Nenhuma op\xE7\xE3o encontrada" }) : null,
|
|
18503
|
+
/* @__PURE__ */ jsx362(
|
|
18504
|
+
ListScroll,
|
|
18505
|
+
{
|
|
18506
|
+
ref,
|
|
18507
|
+
id: menuId,
|
|
18508
|
+
role: "listbox",
|
|
18509
|
+
...props,
|
|
18510
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
18511
|
+
children: /* @__PURE__ */ jsx362(ListInner, { style: { height: `${totalSize}px` }, children: virtualItems.map((virtualItem) => {
|
|
18512
|
+
const option = options[virtualItem.index];
|
|
18513
|
+
if (!option) return null;
|
|
18514
|
+
const optionKey = getKey(option);
|
|
18515
|
+
const failedRule = getFailedRuleByKey(optionKey);
|
|
18516
|
+
const disabled = Boolean(failedRule);
|
|
18517
|
+
const isSelected = getIsSelected(optionKey);
|
|
18518
|
+
const isActive = activeIndex === virtualItem.index;
|
|
18519
|
+
const Component5 = failedRule?.Component;
|
|
18520
|
+
return /* @__PURE__ */ jsx362(
|
|
18521
|
+
Popup_default,
|
|
18522
|
+
{
|
|
18523
|
+
enabled: Boolean(Component5),
|
|
18524
|
+
content: () => /* @__PURE__ */ jsx362(Component5, { option }),
|
|
18525
|
+
on: "click",
|
|
18526
|
+
closeOnClip: true,
|
|
18527
|
+
placement: "right",
|
|
18528
|
+
triggerProps: {
|
|
18529
|
+
ref: measureElement,
|
|
18530
|
+
onMouseEnter: () => onMouseEnterOption(virtualItem.index),
|
|
18531
|
+
onClick: () => onClickOption(virtualItem.index)
|
|
18532
|
+
},
|
|
18533
|
+
renderTrigger: (props2) => /* @__PURE__ */ jsxs184(
|
|
18534
|
+
OptionRow,
|
|
18535
|
+
{
|
|
18536
|
+
id: `${menuId}-option-${virtualItem.index}`,
|
|
18537
|
+
"data-index": virtualItem.index,
|
|
18538
|
+
role: "option",
|
|
18539
|
+
"aria-selected": isSelected,
|
|
18540
|
+
"aria-disabled": disabled,
|
|
18541
|
+
$active: isActive,
|
|
18542
|
+
style: {
|
|
18543
|
+
transform: `translateY(${virtualItem.start}px)`
|
|
18544
|
+
},
|
|
18545
|
+
...props2,
|
|
18546
|
+
children: [
|
|
18547
|
+
/* @__PURE__ */ jsx362(Highlight, {}),
|
|
18548
|
+
/* @__PURE__ */ jsx362(
|
|
18549
|
+
OptionComponent,
|
|
18550
|
+
{
|
|
18551
|
+
option,
|
|
18552
|
+
isActive,
|
|
18553
|
+
isSelected,
|
|
18554
|
+
isDisabled: disabled
|
|
18555
|
+
}
|
|
18556
|
+
)
|
|
18557
|
+
]
|
|
18558
|
+
}
|
|
18559
|
+
)
|
|
18560
|
+
},
|
|
18561
|
+
optionKey
|
|
18562
|
+
);
|
|
18563
|
+
}) })
|
|
18564
|
+
}
|
|
18565
|
+
)
|
|
18566
|
+
] });
|
|
18567
|
+
}
|
|
18568
|
+
);
|
|
18569
|
+
var Scroll_default = Scroll;
|
|
18570
|
+
|
|
18571
|
+
// src/components/Select/components/Search/index.tsx
|
|
18572
|
+
import React59, { useState as useState28 } from "react";
|
|
18573
|
+
|
|
18574
|
+
// src/components/Select/components/Search/styles.ts
|
|
18575
|
+
import styled72 from "styled-components";
|
|
18576
|
+
var SearchContainer = styled72.div`
|
|
18577
|
+
padding: 0 ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
18578
|
+
margin-bottom: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
18579
|
+
|
|
18580
|
+
${({ theme: theme4 }) => theme4.useTypography("p")}
|
|
18581
|
+
|
|
18582
|
+
position: relative;
|
|
18583
|
+
|
|
18584
|
+
> input {
|
|
18585
|
+
width: 100%;
|
|
18586
|
+
min-height: 35px;
|
|
18587
|
+
|
|
18588
|
+
padding-top: 0;
|
|
18589
|
+
/* padding + icon width + gap */
|
|
18590
|
+
padding-right: calc(
|
|
18591
|
+
${({ theme: theme4 }) => `${theme4.spacings.s1} + 24px + ${theme4.spacings.s1}`}
|
|
18592
|
+
);
|
|
18593
|
+
padding-bottom: 0;
|
|
18594
|
+
padding-left: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
18595
|
+
|
|
18596
|
+
outline: none;
|
|
18597
|
+
|
|
18598
|
+
border-style: solid;
|
|
18599
|
+
border-width: 1px;
|
|
18600
|
+
border-color: ${({ theme: theme4 }) => theme4.colors.lightGrey};
|
|
18601
|
+
border-radius: 4px;
|
|
18602
|
+
}
|
|
18603
|
+
|
|
18604
|
+
> :last-child {
|
|
18605
|
+
position: absolute;
|
|
18606
|
+
top: 50%;
|
|
18607
|
+
|
|
18608
|
+
/* parent padding + input padding */
|
|
18609
|
+
right: calc(
|
|
18610
|
+
${({ theme: theme4 }) => `${theme4.spacings.s3} + ${theme4.spacings.s1}`}
|
|
18611
|
+
);
|
|
18612
|
+
transform: translateY(-50%);
|
|
18613
|
+
}
|
|
18614
|
+
`;
|
|
18615
|
+
|
|
18616
|
+
// src/components/Select/components/Search/index.tsx
|
|
18617
|
+
import { jsx as jsx363, jsxs as jsxs185 } from "react/jsx-runtime";
|
|
18618
|
+
var Search = React59.forwardRef(
|
|
18619
|
+
({ menuId, onKeyDown, value: [value, setValue], activeIndex }, ref) => {
|
|
18620
|
+
const [inputRef, setInputRef] = useState28(null);
|
|
18621
|
+
return /* @__PURE__ */ jsxs185(SearchContainer, { children: [
|
|
18622
|
+
/* @__PURE__ */ jsx363(
|
|
18623
|
+
"input",
|
|
18624
|
+
{
|
|
18625
|
+
ref: (node) => {
|
|
18626
|
+
setInputRef(node);
|
|
18627
|
+
if (typeof ref === "function") {
|
|
18628
|
+
ref(node);
|
|
18629
|
+
} else if (ref) {
|
|
18630
|
+
ref.current = node;
|
|
18631
|
+
}
|
|
18632
|
+
},
|
|
18633
|
+
value,
|
|
18634
|
+
onChange: (event) => setValue(event.target.value),
|
|
18635
|
+
onKeyDown,
|
|
18636
|
+
placeholder: "Buscar...",
|
|
18637
|
+
role: "searchbox",
|
|
18638
|
+
"aria-controls": menuId,
|
|
18639
|
+
"aria-activedescendant": activeIndex >= 0 ? `${menuId}-option-${activeIndex}` : void 0
|
|
18640
|
+
}
|
|
18641
|
+
),
|
|
18642
|
+
/* @__PURE__ */ jsx363(
|
|
18643
|
+
Icon_default,
|
|
18644
|
+
{
|
|
18645
|
+
type: "feather",
|
|
18646
|
+
...value.length > 0 ? {
|
|
18647
|
+
icon: "x",
|
|
18648
|
+
onClick: (e) => {
|
|
18649
|
+
e.preventDefault();
|
|
18650
|
+
setValue("");
|
|
18651
|
+
inputRef?.focus();
|
|
18652
|
+
},
|
|
18653
|
+
strokeWidth: "4px"
|
|
18654
|
+
} : {
|
|
18655
|
+
icon: "search",
|
|
18656
|
+
onClick: (e) => {
|
|
18657
|
+
e.preventDefault();
|
|
18658
|
+
e.stopPropagation();
|
|
18659
|
+
inputRef?.focus();
|
|
18660
|
+
}
|
|
18661
|
+
}
|
|
18662
|
+
}
|
|
18663
|
+
)
|
|
18664
|
+
] });
|
|
18665
|
+
}
|
|
18666
|
+
);
|
|
18667
|
+
var Search_default2 = Search;
|
|
18668
|
+
|
|
18669
|
+
// src/components/Select/instances/styles.ts
|
|
18670
|
+
import styled73 from "styled-components";
|
|
18671
|
+
var Header14 = styled73.div`
|
|
18672
|
+
padding: 0 ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
18673
|
+
margin: ${({ theme: theme4 }) => theme4.spacings.s1} 0;
|
|
18674
|
+
display: flex;
|
|
18675
|
+
gap: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
18676
|
+
justify-content: space-between;
|
|
18677
|
+
align-items: center;
|
|
18678
|
+
`;
|
|
18679
|
+
var DraftSwitch = styled73.button`
|
|
18680
|
+
background: none;
|
|
18681
|
+
border: none;
|
|
18682
|
+
outline: none;
|
|
18683
|
+
padding: 0;
|
|
18684
|
+
display: flex;
|
|
18685
|
+
align-items: center;
|
|
18686
|
+
gap: calc(${({ theme: theme4 }) => theme4.spacings.s1} / 2);
|
|
18687
|
+
|
|
18688
|
+
${({ theme: theme4 }) => theme4.useTypography("h4")}
|
|
18689
|
+
color: ${({ theme: theme4 }) => theme4.getColor("black", 80)};
|
|
18690
|
+
|
|
18691
|
+
transition-property: color;
|
|
18692
|
+
transition-duration: 0.4s;
|
|
18693
|
+
transition-timing-function: ease-in-out;
|
|
18694
|
+
|
|
18695
|
+
&:not(:disabled) {
|
|
18696
|
+
cursor: pointer;
|
|
18697
|
+
}
|
|
18698
|
+
|
|
18699
|
+
&:not(:disabled):hover {
|
|
18700
|
+
color: ${({ theme: theme4 }) => theme4.colors.blue};
|
|
18701
|
+
}
|
|
18702
|
+
|
|
18703
|
+
> span:nth-child(1) {
|
|
18704
|
+
position: relative;
|
|
18705
|
+
width: calc(${({ theme: theme4 }) => theme4.spacings.s3} * 2);
|
|
18706
|
+
height: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
18707
|
+
background-color: ${({ theme: theme4 }) => theme4.colors.warningGray};
|
|
18708
|
+
border-radius: 20px;
|
|
18709
|
+
transition-property: background-color;
|
|
18710
|
+
transition-duration: 0.4s;
|
|
18711
|
+
transition-timing-function: ease-in-out;
|
|
18712
|
+
box-sizing: content-box;
|
|
18713
|
+
|
|
18714
|
+
&:before {
|
|
18715
|
+
content: '';
|
|
18716
|
+
transition-property: left, transform;
|
|
18717
|
+
transition-duration: 0.4s;
|
|
18718
|
+
transition-timing-function: ease-in-out;
|
|
18719
|
+
position: absolute;
|
|
18720
|
+
border-width: 1px;
|
|
18721
|
+
border-style: solid;
|
|
18722
|
+
border-radius: 100%;
|
|
18723
|
+
border-color: ${({ theme: theme4 }) => theme4.colors.lightGrey};
|
|
18724
|
+
left: 0;
|
|
18725
|
+
box-shadow: 0px 1px 3px ${({ theme: theme4 }) => theme4.getColor("black", 10)};
|
|
18726
|
+
width: 50%;
|
|
18727
|
+
height: 100%;
|
|
18728
|
+
background-color: ${({ theme: theme4 }) => theme4.colors.white};
|
|
18729
|
+
box-sizing: border-box;
|
|
18730
|
+
}
|
|
18731
|
+
}
|
|
18732
|
+
|
|
18733
|
+
&[aria-checked='true'] > span:nth-child(1) {
|
|
18734
|
+
background-color: ${({ theme: theme4 }) => theme4.colors.blue};
|
|
18735
|
+
}
|
|
18736
|
+
|
|
18737
|
+
&[aria-checked='true'] > span:nth-child(1):before {
|
|
18738
|
+
left: 100%;
|
|
18739
|
+
transform: translateX(-100%);
|
|
18740
|
+
}
|
|
18741
|
+
`;
|
|
18742
|
+
var SelectAllButton = styled73.button`
|
|
18743
|
+
background: none;
|
|
18744
|
+
border: none;
|
|
18745
|
+
outline: none;
|
|
18746
|
+
padding: 0;
|
|
18747
|
+
|
|
18748
|
+
${({ theme: theme4 }) => theme4.useTypography("h6")}
|
|
18749
|
+
color: ${({ theme: theme4 }) => theme4.colors.greyishBlue};
|
|
18750
|
+
|
|
18751
|
+
transition-property: color;
|
|
18752
|
+
transition-duration: 0.25s;
|
|
18753
|
+
transition-timing-function: linear;
|
|
18754
|
+
|
|
18755
|
+
&:not(:disabled) {
|
|
18756
|
+
cursor: pointer;
|
|
18757
|
+
}
|
|
18758
|
+
|
|
18759
|
+
&:not(:disabled):hover {
|
|
18760
|
+
color: ${({ theme: theme4 }) => theme4.colors.blue};
|
|
18761
|
+
}
|
|
18762
|
+
`;
|
|
18763
|
+
|
|
18764
|
+
// src/components/Select/instances/multi/index.tsx
|
|
18765
|
+
import { jsx as jsx364, jsxs as jsxs186 } from "react/jsx-runtime";
|
|
18766
|
+
var buildMap = (values, getKey) => {
|
|
18767
|
+
return new Map(values.map((option) => [getKey(option), option]));
|
|
18768
|
+
};
|
|
18769
|
+
var paginate = () => {
|
|
18770
|
+
};
|
|
18771
|
+
var useDraftOptions = (draft, finder) => {
|
|
18772
|
+
const {
|
|
18773
|
+
current: [searchInput, setSearchInput],
|
|
18774
|
+
debounced: [search]
|
|
18775
|
+
} = useDebouncedState_default("", () => {
|
|
18776
|
+
}, SEARCH_DEBOUNCE_MS);
|
|
18777
|
+
const options = useMemo11(() => {
|
|
18778
|
+
const options2 = Array.from(draft.values());
|
|
18779
|
+
if (!search) return options2;
|
|
18780
|
+
return finder(search, options2);
|
|
18781
|
+
}, [draft, search, finder]);
|
|
18782
|
+
return {
|
|
18783
|
+
options,
|
|
18784
|
+
loading: false,
|
|
18785
|
+
paginate,
|
|
18786
|
+
searchInput: [searchInput, setSearchInput]
|
|
18787
|
+
};
|
|
18788
|
+
};
|
|
18789
|
+
var useDraft = (value, getKey) => {
|
|
18790
|
+
const [draft, setDraft] = useState29(() => ({
|
|
18791
|
+
options: buildMap(value, getKey),
|
|
18792
|
+
on: false
|
|
18793
|
+
}));
|
|
18794
|
+
const setOptions = (value2) => {
|
|
18795
|
+
setDraft((prev) => {
|
|
18796
|
+
const v = typeof value2 === "function" ? value2(prev.options) : value2;
|
|
18797
|
+
if (v === prev.options) return prev;
|
|
18798
|
+
return {
|
|
18799
|
+
options: v,
|
|
18800
|
+
on: prev.on && v.size > 0
|
|
18801
|
+
};
|
|
18802
|
+
});
|
|
18803
|
+
};
|
|
18804
|
+
const setOn = (value2) => {
|
|
18805
|
+
setDraft((prev) => {
|
|
18806
|
+
const v = typeof value2 === "function" ? value2(prev.on) : value2;
|
|
18807
|
+
if (v === prev.on) return prev;
|
|
18808
|
+
return {
|
|
18809
|
+
options: prev.options,
|
|
18810
|
+
on: v && prev.options.size > 0
|
|
18811
|
+
};
|
|
18812
|
+
});
|
|
18813
|
+
};
|
|
18814
|
+
return {
|
|
18815
|
+
draft: [draft.options, setOptions],
|
|
18816
|
+
switchDraft: [draft.on, setOn]
|
|
18817
|
+
};
|
|
18818
|
+
};
|
|
18819
|
+
var SelectMultiOptions = ({
|
|
18820
|
+
loader: loader2,
|
|
18821
|
+
getKey,
|
|
18822
|
+
OptionComponent,
|
|
18823
|
+
rules,
|
|
18824
|
+
overscan,
|
|
18825
|
+
estimateSize,
|
|
18826
|
+
value,
|
|
18827
|
+
setValue,
|
|
18828
|
+
menuId,
|
|
18829
|
+
onClose,
|
|
18830
|
+
clearable = false,
|
|
18831
|
+
finder,
|
|
18832
|
+
applyRules = []
|
|
18833
|
+
}) => {
|
|
18834
|
+
const {
|
|
18835
|
+
draft: [draft, setDraft],
|
|
18836
|
+
switchDraft: [switchDraft, setSwitchDraft]
|
|
18837
|
+
} = useDraft(value, getKey);
|
|
18838
|
+
const asyncOptions = useAsyncOptions_default(loader2);
|
|
18839
|
+
const draftOptions = useDraftOptions(draft, finder);
|
|
18840
|
+
const {
|
|
18841
|
+
options,
|
|
18842
|
+
loading,
|
|
18843
|
+
paginate: paginate2,
|
|
18844
|
+
searchInput: [searchInput, setSearchInput]
|
|
18845
|
+
} = switchDraft ? draftOptions : asyncOptions;
|
|
18846
|
+
const { getFailedRuleByKey, enabledCount } = useRuleIndex_default({
|
|
18847
|
+
options,
|
|
18848
|
+
getKey,
|
|
18849
|
+
rules
|
|
18850
|
+
});
|
|
18851
|
+
const { listRef, searchRef, rowVirtualizer, virtualItems } = useVirtualizedOptions_default({
|
|
18852
|
+
optionsLength: options.length,
|
|
18853
|
+
loading,
|
|
18854
|
+
onPaginate: paginate2,
|
|
18855
|
+
overscan,
|
|
18856
|
+
estimateSize
|
|
18857
|
+
});
|
|
18858
|
+
const isIndexDisabled = (index) => {
|
|
18859
|
+
const option = options[index];
|
|
18860
|
+
if (!option) return true;
|
|
18861
|
+
return Boolean(getFailedRuleByKey(getKey(option)));
|
|
18862
|
+
};
|
|
18863
|
+
const onToggleByIndex = (index) => {
|
|
18864
|
+
const option = options[index];
|
|
18865
|
+
if (!option) return;
|
|
18866
|
+
if (isIndexDisabled(index)) {
|
|
18867
|
+
searchRef.current?.focus();
|
|
18868
|
+
return;
|
|
18869
|
+
}
|
|
18870
|
+
const key = getKey(option);
|
|
18871
|
+
setDraft((current) => {
|
|
18872
|
+
const next = new Map(current);
|
|
18873
|
+
if (next.has(key)) {
|
|
18874
|
+
next.delete(key);
|
|
18875
|
+
} else {
|
|
18876
|
+
next.set(key, option);
|
|
18877
|
+
}
|
|
18878
|
+
return next;
|
|
18879
|
+
});
|
|
18880
|
+
};
|
|
18881
|
+
const navigation = useListNavigation_default({
|
|
18882
|
+
itemCount: options.length,
|
|
18883
|
+
isItemDisabled: isIndexDisabled,
|
|
18884
|
+
onSelect: onToggleByIndex,
|
|
18885
|
+
scrollToIndex: rowVirtualizer.scrollToIndex
|
|
18886
|
+
});
|
|
18887
|
+
const onSelectAll = () => {
|
|
18888
|
+
setDraft((current) => {
|
|
18889
|
+
const next = new Map(current);
|
|
18890
|
+
options.forEach((option) => {
|
|
18891
|
+
const key = getKey(option);
|
|
18892
|
+
if (!getFailedRuleByKey(key)) {
|
|
18893
|
+
next.set(key, option);
|
|
18894
|
+
}
|
|
18895
|
+
});
|
|
18896
|
+
return next;
|
|
18897
|
+
});
|
|
18898
|
+
};
|
|
18899
|
+
const onUnselectAll = () => {
|
|
18900
|
+
setDraft(/* @__PURE__ */ new Map([]));
|
|
18901
|
+
};
|
|
18902
|
+
const getIsSelected = useCallback9((key) => draft.has(key), [draft]);
|
|
18903
|
+
return /* @__PURE__ */ jsxs186(React60.Fragment, { children: [
|
|
18904
|
+
/* @__PURE__ */ jsxs186(Header14, { children: [
|
|
18905
|
+
/* @__PURE__ */ jsxs186(
|
|
18906
|
+
DraftSwitch,
|
|
18907
|
+
{
|
|
18908
|
+
type: "button",
|
|
18909
|
+
role: "switch",
|
|
18910
|
+
"aria-checked": switchDraft,
|
|
18911
|
+
onClick: () => setSwitchDraft((prev) => !prev),
|
|
18912
|
+
disabled: draft.size < 1,
|
|
18913
|
+
children: [
|
|
18914
|
+
/* @__PURE__ */ jsx364("span", {}),
|
|
18915
|
+
"Selecionados (",
|
|
18916
|
+
draft.size,
|
|
18917
|
+
")"
|
|
18918
|
+
]
|
|
18919
|
+
}
|
|
18920
|
+
),
|
|
18921
|
+
/* @__PURE__ */ jsx364(
|
|
18922
|
+
SelectAllButton,
|
|
18923
|
+
{
|
|
18924
|
+
type: "button",
|
|
18925
|
+
...enabledCount > 0 && enabledCount === draft.size ? {
|
|
18926
|
+
onClick: onUnselectAll,
|
|
18927
|
+
children: "Desselecionar tudo"
|
|
18928
|
+
} : {
|
|
18929
|
+
onClick: onSelectAll,
|
|
18930
|
+
children: "Selecionar tudo",
|
|
18931
|
+
disabled: enabledCount < 1
|
|
18932
|
+
}
|
|
18933
|
+
}
|
|
18934
|
+
)
|
|
18935
|
+
] }),
|
|
18936
|
+
/* @__PURE__ */ jsx364(
|
|
18937
|
+
Search_default2,
|
|
18938
|
+
{
|
|
18939
|
+
ref: searchRef,
|
|
18940
|
+
menuId,
|
|
18941
|
+
value: [searchInput, setSearchInput],
|
|
18942
|
+
activeIndex: navigation.activeIndex,
|
|
18943
|
+
onKeyDown: navigation.onKeyDown
|
|
18944
|
+
}
|
|
18945
|
+
),
|
|
18946
|
+
/* @__PURE__ */ jsx364(
|
|
18947
|
+
Scroll_default,
|
|
18948
|
+
{
|
|
18949
|
+
ref: listRef,
|
|
18950
|
+
menuId,
|
|
18951
|
+
options,
|
|
18952
|
+
virtualItems,
|
|
18953
|
+
totalSize: rowVirtualizer.getTotalSize(),
|
|
18954
|
+
measureElement: rowVirtualizer.measureElement,
|
|
18955
|
+
loading,
|
|
18956
|
+
OptionComponent,
|
|
18957
|
+
onClickOption: onToggleByIndex,
|
|
18958
|
+
onMouseEnterOption: navigation.onMouseEnter,
|
|
18959
|
+
activeIndex: navigation.activeIndex,
|
|
18960
|
+
getKey,
|
|
18961
|
+
getIsSelected,
|
|
18962
|
+
getFailedRuleByKey,
|
|
18963
|
+
mode: "multi",
|
|
18964
|
+
"aria-multiselectable": true
|
|
18965
|
+
}
|
|
18966
|
+
),
|
|
18967
|
+
/* @__PURE__ */ jsx364(
|
|
18968
|
+
Apply_default,
|
|
18969
|
+
{
|
|
18970
|
+
setValue,
|
|
18971
|
+
onClose,
|
|
18972
|
+
draft,
|
|
18973
|
+
clearable,
|
|
18974
|
+
applyRules
|
|
18975
|
+
}
|
|
18976
|
+
)
|
|
18977
|
+
] });
|
|
18978
|
+
};
|
|
18979
|
+
var useMultiSelect = ({
|
|
18980
|
+
label,
|
|
18981
|
+
loader: loader2,
|
|
18982
|
+
getKey,
|
|
18983
|
+
OptionComponent,
|
|
18984
|
+
rules,
|
|
18985
|
+
placeholder = "Selecione",
|
|
18986
|
+
required,
|
|
18987
|
+
invalid,
|
|
18988
|
+
clearable,
|
|
18989
|
+
readOnly,
|
|
18990
|
+
viewMode,
|
|
18991
|
+
overscan,
|
|
18992
|
+
estimateSize,
|
|
18993
|
+
height,
|
|
18994
|
+
value,
|
|
18995
|
+
setValue,
|
|
18996
|
+
finder,
|
|
18997
|
+
applyRules,
|
|
18998
|
+
...buttonProps
|
|
18999
|
+
}) => {
|
|
19000
|
+
const closedLabel = useMemo11(() => {
|
|
19001
|
+
if (value.length < 1) {
|
|
19002
|
+
return viewMode ? /* @__PURE__ */ jsx364(React60.Fragment, { children: "\xA0" }) : placeholder;
|
|
19003
|
+
}
|
|
19004
|
+
return `H\xE1 ${value.length} op\xE7\xF5es selecionadas`;
|
|
19005
|
+
}, [placeholder, value.length, viewMode]);
|
|
19006
|
+
return {
|
|
19007
|
+
isEmpty: value.length === 0,
|
|
19008
|
+
placeholder: closedLabel,
|
|
19009
|
+
onClear: () => setValue([]),
|
|
19010
|
+
Component: SelectMultiOptions,
|
|
19011
|
+
buttonProps
|
|
19012
|
+
};
|
|
19013
|
+
};
|
|
19014
|
+
var multi_default = useMultiSelect;
|
|
19015
|
+
|
|
19016
|
+
// src/components/Select/instances/single/index.tsx
|
|
19017
|
+
import React61, { useCallback as useCallback10, useMemo as useMemo12 } from "react";
|
|
19018
|
+
import { jsx as jsx365, jsxs as jsxs187 } from "react/jsx-runtime";
|
|
19019
|
+
var SelectSingleOptions = ({
|
|
19020
|
+
loader: loader2,
|
|
19021
|
+
getKey,
|
|
19022
|
+
OptionComponent,
|
|
19023
|
+
rules,
|
|
19024
|
+
overscan,
|
|
19025
|
+
estimateSize,
|
|
19026
|
+
value,
|
|
19027
|
+
setValue,
|
|
19028
|
+
menuId,
|
|
19029
|
+
onClose,
|
|
19030
|
+
clearable
|
|
19031
|
+
}) => {
|
|
19032
|
+
const {
|
|
19033
|
+
options,
|
|
19034
|
+
loading,
|
|
19035
|
+
paginate: paginate2,
|
|
19036
|
+
searchInput: [searchInput, setSearchInput]
|
|
19037
|
+
} = useAsyncOptions_default(loader2);
|
|
19038
|
+
const { getFailedRuleByKey } = useRuleIndex_default({
|
|
19039
|
+
options,
|
|
19040
|
+
getKey,
|
|
19041
|
+
rules
|
|
19042
|
+
});
|
|
19043
|
+
const { listRef, searchRef, rowVirtualizer, virtualItems } = useVirtualizedOptions_default({
|
|
19044
|
+
optionsLength: options.length,
|
|
19045
|
+
loading,
|
|
19046
|
+
onPaginate: paginate2,
|
|
19047
|
+
overscan,
|
|
19048
|
+
estimateSize
|
|
19049
|
+
});
|
|
19050
|
+
const selectedKey = value ? getKey(value) : null;
|
|
19051
|
+
const isIndexDisabled = (index) => {
|
|
19052
|
+
const option = options[index];
|
|
19053
|
+
if (!option) return true;
|
|
19054
|
+
return Boolean(getFailedRuleByKey(getKey(option)));
|
|
19055
|
+
};
|
|
19056
|
+
const onToggleByIndex = (index) => {
|
|
19057
|
+
const option = options[index];
|
|
19058
|
+
if (!option) return;
|
|
19059
|
+
if (isIndexDisabled(index)) {
|
|
19060
|
+
searchRef.current?.focus();
|
|
19061
|
+
return;
|
|
19062
|
+
}
|
|
19063
|
+
const optionKey = getKey(option);
|
|
19064
|
+
if (selectedKey === optionKey) {
|
|
19065
|
+
if (!clearable) return;
|
|
19066
|
+
setValue(null);
|
|
19067
|
+
} else {
|
|
19068
|
+
setValue(option);
|
|
19069
|
+
}
|
|
19070
|
+
onClose();
|
|
19071
|
+
};
|
|
19072
|
+
const navigation = useListNavigation_default({
|
|
19073
|
+
itemCount: options.length,
|
|
19074
|
+
isItemDisabled: isIndexDisabled,
|
|
19075
|
+
onSelect: onToggleByIndex,
|
|
19076
|
+
scrollToIndex: rowVirtualizer.scrollToIndex
|
|
19077
|
+
});
|
|
19078
|
+
const getIsSelected = useCallback10(
|
|
19079
|
+
(key) => selectedKey === key,
|
|
19080
|
+
[selectedKey]
|
|
19081
|
+
);
|
|
19082
|
+
return /* @__PURE__ */ jsxs187(React61.Fragment, { children: [
|
|
19083
|
+
/* @__PURE__ */ jsx365(
|
|
19084
|
+
Search_default2,
|
|
19085
|
+
{
|
|
19086
|
+
ref: searchRef,
|
|
19087
|
+
menuId,
|
|
19088
|
+
value: [searchInput, setSearchInput],
|
|
19089
|
+
activeIndex: navigation.activeIndex,
|
|
19090
|
+
onKeyDown: navigation.onKeyDown
|
|
19091
|
+
}
|
|
19092
|
+
),
|
|
19093
|
+
/* @__PURE__ */ jsx365(
|
|
19094
|
+
Scroll_default,
|
|
19095
|
+
{
|
|
19096
|
+
ref: listRef,
|
|
19097
|
+
menuId,
|
|
19098
|
+
options,
|
|
19099
|
+
virtualItems,
|
|
19100
|
+
totalSize: rowVirtualizer.getTotalSize(),
|
|
19101
|
+
measureElement: rowVirtualizer.measureElement,
|
|
19102
|
+
loading,
|
|
19103
|
+
OptionComponent,
|
|
19104
|
+
onClickOption: onToggleByIndex,
|
|
19105
|
+
onMouseEnterOption: navigation.onMouseEnter,
|
|
19106
|
+
activeIndex: navigation.activeIndex,
|
|
19107
|
+
getKey,
|
|
19108
|
+
getIsSelected,
|
|
19109
|
+
getFailedRuleByKey,
|
|
19110
|
+
mode: "single",
|
|
19111
|
+
"aria-multiselectable": true
|
|
19112
|
+
}
|
|
19113
|
+
)
|
|
19114
|
+
] });
|
|
19115
|
+
};
|
|
19116
|
+
var useSingleSelect = ({
|
|
19117
|
+
label,
|
|
19118
|
+
loader: loader2,
|
|
19119
|
+
getKey,
|
|
19120
|
+
OptionComponent,
|
|
19121
|
+
rules,
|
|
19122
|
+
placeholder = "Selecione",
|
|
19123
|
+
required,
|
|
19124
|
+
invalid,
|
|
19125
|
+
clearable,
|
|
19126
|
+
readOnly,
|
|
19127
|
+
viewMode,
|
|
19128
|
+
overscan,
|
|
19129
|
+
estimateSize,
|
|
19130
|
+
height,
|
|
19131
|
+
value,
|
|
19132
|
+
setValue,
|
|
19133
|
+
ValueComponent,
|
|
19134
|
+
...buttonProps
|
|
19135
|
+
}) => {
|
|
19136
|
+
const ClosedValueComponent = ValueComponent || OptionComponent;
|
|
19137
|
+
const closedLabel = useMemo12(() => {
|
|
19138
|
+
if (!value) {
|
|
19139
|
+
return viewMode ? /* @__PURE__ */ jsx365(React61.Fragment, { children: "\xA0" }) : placeholder;
|
|
19140
|
+
}
|
|
19141
|
+
return /* @__PURE__ */ jsx365(
|
|
19142
|
+
ClosedValueComponent,
|
|
19143
|
+
{
|
|
19144
|
+
option: value,
|
|
19145
|
+
isActive: false,
|
|
19146
|
+
isSelected: true,
|
|
19147
|
+
isDisabled: false
|
|
19148
|
+
}
|
|
19149
|
+
);
|
|
19150
|
+
}, [ClosedValueComponent, placeholder, value, viewMode]);
|
|
19151
|
+
return {
|
|
19152
|
+
isEmpty: !value,
|
|
19153
|
+
placeholder: closedLabel,
|
|
19154
|
+
onClear: () => setValue(null),
|
|
19155
|
+
Component: SelectSingleOptions,
|
|
19156
|
+
buttonProps
|
|
19157
|
+
};
|
|
19158
|
+
};
|
|
19159
|
+
var single_default = useSingleSelect;
|
|
19160
|
+
|
|
19161
|
+
// src/components/Select/instances/index.tsx
|
|
19162
|
+
var useSelect2 = (props) => {
|
|
19163
|
+
return props.type === "multi-select" ? multi_default(props) : single_default(props);
|
|
19164
|
+
};
|
|
19165
|
+
var instances_default = useSelect2;
|
|
19166
|
+
|
|
19167
|
+
// src/components/Select/styles.ts
|
|
19168
|
+
import styled74, { css as css49 } from "styled-components";
|
|
19169
|
+
var FloatingWrapper = styled74.div`
|
|
19170
|
+
z-index: 1000;
|
|
19171
|
+
|
|
19172
|
+
&,
|
|
19173
|
+
& > div {
|
|
19174
|
+
height: var(--height);
|
|
19175
|
+
min-height: var(--height);
|
|
19176
|
+
max-height: var(--height);
|
|
19177
|
+
}
|
|
19178
|
+
|
|
19179
|
+
> div {
|
|
19180
|
+
position: absolute;
|
|
19181
|
+
bottom: 0;
|
|
19182
|
+
left: 0;
|
|
19183
|
+
width: 100%;
|
|
19184
|
+
padding-top: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
19185
|
+
|
|
19186
|
+
display: flex;
|
|
19187
|
+
flex-direction: column;
|
|
19188
|
+
overflow: hidden;
|
|
19189
|
+
}
|
|
19190
|
+
|
|
19191
|
+
transition-property: height, max-height, min-height;
|
|
19192
|
+
transition-timing-function: linear;
|
|
19193
|
+
transition-duration: ${MENU_EXIT_MS}ms;
|
|
19194
|
+
|
|
19195
|
+
background: ${({ theme: theme4 }) => theme4.colors.white};
|
|
19196
|
+
border: 1px solid ${({ theme: theme4 }) => theme4.colors.lightGrey};
|
|
19197
|
+
border-radius: 6px;
|
|
19198
|
+
box-shadow: 0px 3px 6px ${({ theme: theme4 }) => theme4.getColor("black", 15)};
|
|
19199
|
+
overflow: hidden;
|
|
19200
|
+
`;
|
|
19201
|
+
var Trigger = styled74.button`
|
|
19202
|
+
width: 100%;
|
|
19203
|
+
|
|
19204
|
+
transition-property: opacity, border-color, box-shadow, color,
|
|
19205
|
+
background-color;
|
|
19206
|
+
transition-timing-function: linear;
|
|
19207
|
+
transition-duration: 0.25s;
|
|
19208
|
+
|
|
19209
|
+
${({ $viewMode: viewMode }) => viewMode ? css49`
|
|
19210
|
+
padding: 0;
|
|
19211
|
+
|
|
19212
|
+
border: none;
|
|
19213
|
+
` : css49`
|
|
19214
|
+
min-height: 35px;
|
|
19215
|
+
padding: 0 ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
19216
|
+
|
|
19217
|
+
border-style: solid;
|
|
19218
|
+
border-width: 1px;
|
|
19219
|
+
border-radius: 4px;
|
|
19220
|
+
`}
|
|
19221
|
+
|
|
19222
|
+
outline: none !important;
|
|
19223
|
+
|
|
19224
|
+
&:focus-visible {
|
|
19225
|
+
box-shadow: 3px 3px 6px ${({ theme: theme4 }) => theme4.getColor("black", 15)};
|
|
19226
|
+
}
|
|
19227
|
+
|
|
19228
|
+
text-align: left;
|
|
19229
|
+
display: flex;
|
|
19230
|
+
align-items: center;
|
|
19231
|
+
justify-content: space-between;
|
|
19232
|
+
gap: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
19233
|
+
|
|
19234
|
+
${({ theme: theme4 }) => theme4.useTypography("p")}
|
|
19235
|
+
|
|
19236
|
+
&[aria-invalid='true'] {
|
|
19237
|
+
border-color: ${({ theme: theme4 }) => theme4.colors.warningRed};
|
|
19238
|
+
color: ${({ theme: theme4 }) => theme4.colors.warningRed};
|
|
19239
|
+
background-color: ${({ theme: theme4 }) => theme4.getColor("warningRed", 5)};
|
|
19240
|
+
}
|
|
19241
|
+
&:not([aria-invalid='true']) {
|
|
19242
|
+
border-color: ${({ theme: theme4 }) => theme4.colors.lightGrey};
|
|
19243
|
+
color: ${({ theme: theme4, $empty: empty }) => {
|
|
19244
|
+
return empty ? theme4.colors.darkGrey : theme4.colors.darkBlue;
|
|
19245
|
+
}};
|
|
19246
|
+
background-color: ${({ theme: theme4 }) => theme4.colors.white};
|
|
19247
|
+
}
|
|
19248
|
+
|
|
19249
|
+
&:disabled {
|
|
19250
|
+
opacity: 0.5;
|
|
19251
|
+
}
|
|
19252
|
+
|
|
19253
|
+
&:not(:disabled),
|
|
19254
|
+
&:not([aria-readonly='true']) {
|
|
19255
|
+
cursor: pointer;
|
|
19256
|
+
}
|
|
19257
|
+
|
|
19258
|
+
&:disabled,
|
|
19259
|
+
&[aria-readonly='true'] {
|
|
19260
|
+
pointer-events: none;
|
|
19261
|
+
}
|
|
19262
|
+
|
|
19263
|
+
> i {
|
|
19264
|
+
transition-property: transform;
|
|
19265
|
+
transition-timing-function: linear;
|
|
19266
|
+
transition-duration: 0.25s;
|
|
19267
|
+
transform: rotate(${({ $open: open }) => open ? "180deg" : "0deg"});
|
|
19268
|
+
}
|
|
19269
|
+
`;
|
|
19270
|
+
var TriggerValue = styled74.div`
|
|
19271
|
+
flex: 1;
|
|
19272
|
+
min-width: 0;
|
|
19273
|
+
overflow: hidden;
|
|
19274
|
+
white-space: nowrap;
|
|
19275
|
+
text-overflow: ellipsis;
|
|
19276
|
+
`;
|
|
19277
|
+
var Label11 = styled74.label`
|
|
19278
|
+
display: inline-block;
|
|
19279
|
+
margin-bottom: ${({ theme: theme4, $viewMode: viewMode }) => theme4.spacings[viewMode ? "s3" : "s1"]};
|
|
19280
|
+
|
|
19281
|
+
${({ theme: theme4, $viewMode: viewMode }) => theme4.useTypography("p", {
|
|
19282
|
+
fontWeight: viewMode ? "bold" : "normal"
|
|
19283
|
+
})}
|
|
19284
|
+
color: ${({ theme: theme4 }) => theme4.colors.greyishBlue};
|
|
19285
|
+
|
|
19286
|
+
transition-property: opacity, border-color, box-shadow, color,
|
|
19287
|
+
background-color;
|
|
19288
|
+
transition-timing-function: linear;
|
|
19289
|
+
transition-duration: 0.25s;
|
|
19290
|
+
|
|
19291
|
+
&:has(+ [aria-required='true']):after {
|
|
19292
|
+
content: ' *';
|
|
19293
|
+
}
|
|
19294
|
+
|
|
19295
|
+
&:has(+ :disabled) {
|
|
19296
|
+
opacity: 0.5;
|
|
19297
|
+
}
|
|
19298
|
+
`;
|
|
19299
|
+
var OptionContainer = styled74.div`
|
|
19300
|
+
display: flex;
|
|
19301
|
+
flex-direction: column;
|
|
19302
|
+
gap: calc(${({ theme: theme4 }) => theme4.spacings.s1} / 2);
|
|
19303
|
+
overflow: hidden;
|
|
19304
|
+
|
|
19305
|
+
> div {
|
|
19306
|
+
display: flex;
|
|
19307
|
+
gap: calc(${({ theme: theme4 }) => theme4.spacings.s1} / 2);
|
|
19308
|
+
color: ${({ theme: theme4 }) => theme4.colors.darkBlue};
|
|
19309
|
+
white-space: nowrap;
|
|
19310
|
+
}
|
|
19311
|
+
|
|
19312
|
+
> div:nth-child(1) {
|
|
19313
|
+
${({ theme: theme4 }) => theme4.useTypography("p")}
|
|
19314
|
+
}
|
|
19315
|
+
|
|
19316
|
+
> div:not(:nth-child(1)) {
|
|
19317
|
+
${({ theme: theme4 }) => theme4.useTypography("h6")}
|
|
19318
|
+
opacity: 0.5;
|
|
19319
|
+
}
|
|
19320
|
+
`;
|
|
19321
|
+
|
|
19322
|
+
// src/components/Select/index.tsx
|
|
19323
|
+
import { jsx as jsx366, jsxs as jsxs188 } from "react/jsx-runtime";
|
|
19324
|
+
var Select2 = React62.forwardRef(
|
|
19325
|
+
(props, ref) => {
|
|
19326
|
+
const [open, setOpen] = useState30(false);
|
|
19327
|
+
const id = props.id || useId();
|
|
19328
|
+
const { isRequired, isInvalid: isInvalid2, isViewMode, isDisabled } = Form_default.useContext(
|
|
19329
|
+
props.name
|
|
19330
|
+
);
|
|
19331
|
+
const invalid = isInvalid2() || props.invalid;
|
|
19332
|
+
const required = isRequired() || props.required;
|
|
19333
|
+
const disabled = isDisabled() || props.disabled;
|
|
19334
|
+
const viewMode = isViewMode() || props.viewMode;
|
|
19335
|
+
const { floating, transition, interactions } = useFloatingMenu_default({
|
|
19336
|
+
open,
|
|
19337
|
+
onOpenChange: setOpen
|
|
19338
|
+
});
|
|
19339
|
+
const height = useMemo13(() => {
|
|
19340
|
+
if (transition.status !== "open") return 0;
|
|
19341
|
+
if (props.height !== void 0) return props.height;
|
|
19342
|
+
return props.type === "single-select" ? 240 : 260;
|
|
19343
|
+
}, [transition.status !== "open", props.type, props.height]);
|
|
19344
|
+
const menuId = useId();
|
|
19345
|
+
const onTriggerKeyDown = (event) => {
|
|
19346
|
+
if (!open && ["ArrowDown", "ArrowUp", "Enter", " "].includes(event.key)) {
|
|
19347
|
+
event.preventDefault();
|
|
19348
|
+
setOpen(true);
|
|
19349
|
+
}
|
|
19350
|
+
};
|
|
19351
|
+
const { isEmpty, placeholder, Component: Component5, onClear, buttonProps } = instances_default(props);
|
|
19352
|
+
return /* @__PURE__ */ jsxs188(React62.Fragment, { children: [
|
|
19353
|
+
props.label !== void 0 && /* @__PURE__ */ jsx366(Label11, { htmlFor: id, $viewMode: viewMode, children: props.label }),
|
|
19354
|
+
/* @__PURE__ */ jsxs188(
|
|
19355
|
+
Trigger,
|
|
19356
|
+
{
|
|
19357
|
+
id,
|
|
19358
|
+
type: "button",
|
|
19359
|
+
role: "combobox",
|
|
19360
|
+
"aria-haspopup": "listbox",
|
|
19361
|
+
"aria-expanded": open,
|
|
19362
|
+
"aria-controls": menuId,
|
|
19363
|
+
$open: open,
|
|
19364
|
+
$empty: isEmpty,
|
|
19365
|
+
$viewMode: viewMode,
|
|
19366
|
+
"aria-readonly": props.readOnly || viewMode,
|
|
19367
|
+
"aria-invalid": invalid,
|
|
19368
|
+
"aria-required": required && !viewMode,
|
|
19369
|
+
...interactions.getReferenceProps({
|
|
19370
|
+
...buttonProps,
|
|
19371
|
+
disabled,
|
|
19372
|
+
onClick: (event) => {
|
|
19373
|
+
if (props.readOnly || viewMode || disabled) return;
|
|
19374
|
+
setOpen((current) => !current);
|
|
19375
|
+
buttonProps.onClick?.(event);
|
|
19376
|
+
},
|
|
19377
|
+
onKeyDown: (event) => {
|
|
19378
|
+
if (props.readOnly || viewMode || props.disabled) return;
|
|
19379
|
+
onTriggerKeyDown(event);
|
|
19380
|
+
buttonProps.onKeyDown?.(event);
|
|
19381
|
+
}
|
|
19382
|
+
}),
|
|
19383
|
+
ref: (node) => {
|
|
19384
|
+
floating.refs.setReference(node);
|
|
19385
|
+
if (typeof ref === "function") {
|
|
19386
|
+
ref(node);
|
|
19387
|
+
} else if (ref) {
|
|
19388
|
+
ref.current = node;
|
|
19389
|
+
}
|
|
19390
|
+
},
|
|
19391
|
+
children: [
|
|
19392
|
+
/* @__PURE__ */ jsx366(TriggerValue, { children: placeholder }),
|
|
19393
|
+
!viewMode && /* @__PURE__ */ jsx366(
|
|
19394
|
+
Icon_default,
|
|
19395
|
+
{
|
|
19396
|
+
width: "14px",
|
|
19397
|
+
color: props.invalid ? colors.warningRed : colors.darkGrey,
|
|
19398
|
+
...!isEmpty && props.clearable && !props.disabled && !props.readOnly ? {
|
|
19399
|
+
type: "feather",
|
|
19400
|
+
icon: "x",
|
|
19401
|
+
onClick: (e) => {
|
|
19402
|
+
e.stopPropagation();
|
|
19403
|
+
onClear();
|
|
19404
|
+
},
|
|
19405
|
+
strokeWidth: "4px"
|
|
19406
|
+
} : {
|
|
19407
|
+
type: "semantic",
|
|
19408
|
+
icon: "caret down"
|
|
19409
|
+
}
|
|
19410
|
+
}
|
|
19411
|
+
)
|
|
19412
|
+
]
|
|
19413
|
+
}
|
|
19414
|
+
),
|
|
19415
|
+
transition.isMounted ? /* @__PURE__ */ jsx366(FloatingPortal2, { children: /* @__PURE__ */ jsx366(
|
|
19416
|
+
FloatingWrapper,
|
|
19417
|
+
{
|
|
19418
|
+
ref: floating.refs.setFloating,
|
|
19419
|
+
style: {
|
|
19420
|
+
...floating.floatingStyles,
|
|
19421
|
+
"--height": `${height}px`
|
|
19422
|
+
},
|
|
19423
|
+
...interactions.getFloatingProps(),
|
|
19424
|
+
children: /* @__PURE__ */ jsx366("div", { children: /* @__PURE__ */ jsx366(
|
|
19425
|
+
Component5,
|
|
19426
|
+
{
|
|
19427
|
+
...props,
|
|
19428
|
+
menuId,
|
|
19429
|
+
onClose: () => setOpen(false)
|
|
19430
|
+
}
|
|
19431
|
+
) })
|
|
19432
|
+
}
|
|
19433
|
+
) }) : null
|
|
19434
|
+
] });
|
|
19435
|
+
}
|
|
19436
|
+
);
|
|
19437
|
+
var Select_default3 = Object.assign(Select2, {
|
|
19438
|
+
OptionContainer
|
|
19439
|
+
});
|
|
19440
|
+
|
|
19441
|
+
// src/components/Signature/index.tsx
|
|
19442
|
+
import { useCallback as useCallback11, useEffect as useEffect25, useMemo as useMemo14, useState as useState31 } from "react";
|
|
19443
|
+
import SignatureCanvas from "react-signature-canvas";
|
|
19444
|
+
|
|
19445
|
+
// src/components/Signature/styles.ts
|
|
19446
|
+
import styled75 from "styled-components";
|
|
19447
|
+
var Container26 = styled75.div`
|
|
19448
|
+
width: 100%;
|
|
19449
|
+
height: 100%;
|
|
19450
|
+
|
|
19451
|
+
display: flex;
|
|
19452
|
+
flex-direction: column;
|
|
19453
|
+
gap: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
19454
|
+
`;
|
|
19455
|
+
var CanvasContainer = styled75.div`
|
|
19456
|
+
position: relative;
|
|
19457
|
+
flex: 1;
|
|
19458
|
+
overflow: hidden;
|
|
19459
|
+
background-color: ${({ theme: theme4, $invalid: invalid }) => invalid ? theme4.getColor("warningRed", 5) : theme4.colors.white};
|
|
19460
|
+
|
|
19461
|
+
&[data-placeholder]:before {
|
|
19462
|
+
content: attr(data-placeholder);
|
|
19463
|
+
position: absolute;
|
|
19464
|
+
top: 50%;
|
|
19465
|
+
left: 50%;
|
|
19466
|
+
transform: translate(-50%, -50%);
|
|
19467
|
+
text-align: center;
|
|
19468
|
+
|
|
19469
|
+
color: ${({ theme: theme4, $invalid: invalid }) => theme4.colors[invalid ? "warningRed" : "darkBlue"]};
|
|
19470
|
+
|
|
19471
|
+
${({ theme: theme4 }) => theme4.useTypography("h1")}
|
|
19472
|
+
font-size: 59px;
|
|
19473
|
+
line-height: 71px;
|
|
19474
|
+
opacity: 0.1;
|
|
19475
|
+
z-index: 1;
|
|
19476
|
+
}
|
|
19477
|
+
|
|
19478
|
+
canvas {
|
|
19479
|
+
position: relative;
|
|
19480
|
+
display: block;
|
|
19481
|
+
width: 100%;
|
|
19482
|
+
height: 100%;
|
|
19483
|
+
box-sizing: border-box;
|
|
19484
|
+
border: 1px solid
|
|
19485
|
+
${({ theme: theme4, $invalid: invalid }) => theme4.colors[invalid ? "warningRed" : "lightGrey"]};
|
|
19486
|
+
border-radius: 4px;
|
|
19487
|
+
z-index: 2;
|
|
19488
|
+
}
|
|
19489
|
+
|
|
19490
|
+
/* icons container */
|
|
19491
|
+
> div:nth-child(1) {
|
|
19492
|
+
position: absolute;
|
|
19493
|
+
top: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
19494
|
+
right: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
19495
|
+
display: flex;
|
|
19496
|
+
gap: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
19497
|
+
z-index: 3;
|
|
19498
|
+
|
|
19499
|
+
> button {
|
|
19500
|
+
padding: 0;
|
|
19501
|
+
outline: none;
|
|
19502
|
+
border: none;
|
|
19503
|
+
background: none;
|
|
19504
|
+
|
|
19505
|
+
> i.icon,
|
|
19506
|
+
> i.icon:before {
|
|
19507
|
+
color: #4e4e4e;
|
|
19508
|
+
font-size: 20px;
|
|
19509
|
+
line-height: 20px;
|
|
19510
|
+
width: 20px;
|
|
19511
|
+
}
|
|
19512
|
+
|
|
19513
|
+
&:not(:disabled) {
|
|
19514
|
+
cursor: pointer;
|
|
19515
|
+
}
|
|
19516
|
+
&:disabled {
|
|
19517
|
+
opacity: 0.5;
|
|
19518
|
+
}
|
|
19519
|
+
|
|
19520
|
+
transition: opacity 0.25s linear;
|
|
19521
|
+
}
|
|
19522
|
+
}
|
|
19523
|
+
`;
|
|
19524
|
+
|
|
19525
|
+
// src/components/Signature/index.tsx
|
|
19526
|
+
import { jsx as jsx367, jsxs as jsxs189 } from "react/jsx-runtime";
|
|
19527
|
+
var FONTS = [
|
|
19528
|
+
"GreatVibes",
|
|
19529
|
+
"Pacifico",
|
|
19530
|
+
"Allura"
|
|
19531
|
+
];
|
|
19532
|
+
var FONT_SIZE = 64;
|
|
19533
|
+
var voidFn = () => {
|
|
19534
|
+
};
|
|
19535
|
+
var SignatureInput = ({
|
|
19536
|
+
setValue,
|
|
19537
|
+
value,
|
|
17637
19538
|
penColor,
|
|
17638
19539
|
backgroundColor,
|
|
17639
19540
|
invalid,
|
|
@@ -17644,12 +19545,12 @@ var SignatureInput = ({
|
|
|
17644
19545
|
onEnd = voidFn,
|
|
17645
19546
|
...props
|
|
17646
19547
|
}) => {
|
|
17647
|
-
const [name, setName] =
|
|
17648
|
-
const [font, setFont] =
|
|
17649
|
-
const [showPlaceholder, setShowPlaceholder] =
|
|
17650
|
-
const [loading, setLoading] =
|
|
17651
|
-
const [ref, setRef] =
|
|
17652
|
-
|
|
19548
|
+
const [name, setName] = useState31("");
|
|
19549
|
+
const [font, setFont] = useState31(FONTS[0]);
|
|
19550
|
+
const [showPlaceholder, setShowPlaceholder] = useState31(true);
|
|
19551
|
+
const [loading, setLoading] = useState31(false);
|
|
19552
|
+
const [ref, setRef] = useState31(null);
|
|
19553
|
+
useEffect25(() => {
|
|
17653
19554
|
if (!ref) return;
|
|
17654
19555
|
const refreshValue = () => {
|
|
17655
19556
|
if (ref.isEmpty() && !value) return;
|
|
@@ -17662,7 +19563,7 @@ var SignatureInput = ({
|
|
|
17662
19563
|
window.addEventListener("resize", refreshValue);
|
|
17663
19564
|
return () => window.removeEventListener("resize", refreshValue);
|
|
17664
19565
|
}, [ref, value]);
|
|
17665
|
-
const setByText =
|
|
19566
|
+
const setByText = useCallback11(
|
|
17666
19567
|
async (name2, font2) => {
|
|
17667
19568
|
if (!ref) return;
|
|
17668
19569
|
const trimmed = name2.trim();
|
|
@@ -17691,14 +19592,14 @@ var SignatureInput = ({
|
|
|
17691
19592
|
},
|
|
17692
19593
|
[ref]
|
|
17693
19594
|
);
|
|
17694
|
-
const onBeginHandler =
|
|
19595
|
+
const onBeginHandler = useCallback11(
|
|
17695
19596
|
(event) => {
|
|
17696
19597
|
onBegin(event, ref);
|
|
17697
19598
|
setShowPlaceholder(false);
|
|
17698
19599
|
},
|
|
17699
19600
|
[ref, onBegin]
|
|
17700
19601
|
);
|
|
17701
|
-
const onEndHandler =
|
|
19602
|
+
const onEndHandler = useCallback11(
|
|
17702
19603
|
(event) => {
|
|
17703
19604
|
onEnd(event, ref);
|
|
17704
19605
|
if (!ref || ref.isEmpty()) return;
|
|
@@ -17706,19 +19607,19 @@ var SignatureInput = ({
|
|
|
17706
19607
|
},
|
|
17707
19608
|
[ref, onEnd]
|
|
17708
19609
|
);
|
|
17709
|
-
const onApplyHandler =
|
|
19610
|
+
const onApplyHandler = useCallback11(() => {
|
|
17710
19611
|
setByText(name, font);
|
|
17711
19612
|
}, [name, font, setByText]);
|
|
17712
|
-
const onClearHandler =
|
|
19613
|
+
const onClearHandler = useCallback11(() => {
|
|
17713
19614
|
if (!ref) return;
|
|
17714
19615
|
setShowPlaceholder(true);
|
|
17715
19616
|
setName("");
|
|
17716
19617
|
ref.clear();
|
|
17717
19618
|
setValue("");
|
|
17718
19619
|
}, [ref]);
|
|
17719
|
-
const empty =
|
|
17720
|
-
return /* @__PURE__ */
|
|
17721
|
-
/* @__PURE__ */
|
|
19620
|
+
const empty = useMemo14(() => !value && (!ref || ref.isEmpty()), [ref, value]);
|
|
19621
|
+
return /* @__PURE__ */ jsxs189(Container26, { children: [
|
|
19622
|
+
/* @__PURE__ */ jsx367(
|
|
17722
19623
|
Input_default,
|
|
17723
19624
|
{
|
|
17724
19625
|
label,
|
|
@@ -17741,7 +19642,7 @@ var SignatureInput = ({
|
|
|
17741
19642
|
} : {}
|
|
17742
19643
|
}
|
|
17743
19644
|
),
|
|
17744
|
-
/* @__PURE__ */
|
|
19645
|
+
/* @__PURE__ */ jsxs189(
|
|
17745
19646
|
CanvasContainer,
|
|
17746
19647
|
{
|
|
17747
19648
|
$invalid: invalid,
|
|
@@ -17749,8 +19650,8 @@ var SignatureInput = ({
|
|
|
17749
19650
|
"data-placeholder": canvasPlaceholder
|
|
17750
19651
|
} : {},
|
|
17751
19652
|
children: [
|
|
17752
|
-
/* @__PURE__ */
|
|
17753
|
-
/* @__PURE__ */
|
|
19653
|
+
/* @__PURE__ */ jsxs189("div", { children: [
|
|
19654
|
+
/* @__PURE__ */ jsx367(
|
|
17754
19655
|
"button",
|
|
17755
19656
|
{
|
|
17756
19657
|
type: "button",
|
|
@@ -17763,10 +19664,10 @@ var SignatureInput = ({
|
|
|
17763
19664
|
},
|
|
17764
19665
|
disabled: loading || name.trim().length < 1,
|
|
17765
19666
|
title: "Trocar fonte",
|
|
17766
|
-
children: /* @__PURE__ */
|
|
19667
|
+
children: /* @__PURE__ */ jsx367(Icon_default, { type: "semantic", icon: "font" })
|
|
17767
19668
|
}
|
|
17768
19669
|
),
|
|
17769
|
-
/* @__PURE__ */
|
|
19670
|
+
/* @__PURE__ */ jsx367(
|
|
17770
19671
|
"button",
|
|
17771
19672
|
{
|
|
17772
19673
|
type: "button",
|
|
@@ -17776,12 +19677,12 @@ var SignatureInput = ({
|
|
|
17776
19677
|
},
|
|
17777
19678
|
disabled: empty,
|
|
17778
19679
|
title: "Recortar",
|
|
17779
|
-
children: /* @__PURE__ */
|
|
19680
|
+
children: /* @__PURE__ */ jsx367(Icon_default, { type: "semantic", icon: "cut" })
|
|
17780
19681
|
}
|
|
17781
19682
|
),
|
|
17782
|
-
/* @__PURE__ */
|
|
19683
|
+
/* @__PURE__ */ jsx367("button", { onClick: onClearHandler, disabled: empty, title: "Limpar", children: /* @__PURE__ */ jsx367(Icon_default, { type: "semantic", icon: "eraser" }) })
|
|
17783
19684
|
] }),
|
|
17784
|
-
/* @__PURE__ */
|
|
19685
|
+
/* @__PURE__ */ jsx367(
|
|
17785
19686
|
SignatureCanvas,
|
|
17786
19687
|
{
|
|
17787
19688
|
ref: setRef,
|
|
@@ -17800,17 +19701,17 @@ var SignatureInput = ({
|
|
|
17800
19701
|
var Signature_default = SignatureInput;
|
|
17801
19702
|
|
|
17802
19703
|
// src/components/Tabs/index.tsx
|
|
17803
|
-
import
|
|
19704
|
+
import React68, { useState as useState34 } from "react";
|
|
17804
19705
|
|
|
17805
19706
|
// src/components/Tabs/components/ScrollButtons/index.tsx
|
|
17806
|
-
import
|
|
19707
|
+
import React64, { useCallback as useCallback13, useEffect as useEffect26, useState as useState32 } from "react";
|
|
17807
19708
|
|
|
17808
19709
|
// src/components/Tabs/components/ScrollButton/index.tsx
|
|
17809
|
-
import { useCallback as
|
|
19710
|
+
import { useCallback as useCallback12 } from "react";
|
|
17810
19711
|
|
|
17811
19712
|
// src/components/Tabs/components/ScrollButton/styled.ts
|
|
17812
|
-
import
|
|
17813
|
-
var Container27 =
|
|
19713
|
+
import styled76 from "styled-components";
|
|
19714
|
+
var Container27 = styled76.div`
|
|
17814
19715
|
position: absolute;
|
|
17815
19716
|
top: 0;
|
|
17816
19717
|
height: 100%;
|
|
@@ -17833,31 +19734,31 @@ var Container27 = styled70.div`
|
|
|
17833
19734
|
`;
|
|
17834
19735
|
|
|
17835
19736
|
// src/components/Tabs/components/ScrollButton/index.tsx
|
|
17836
|
-
import { jsx as
|
|
19737
|
+
import { jsx as jsx368 } from "react/jsx-runtime";
|
|
17837
19738
|
var ScrollButton = (props) => {
|
|
17838
19739
|
const { mode, visible, scrollRef } = props;
|
|
17839
19740
|
const icon = `chevron_${mode}`;
|
|
17840
|
-
const onClick =
|
|
19741
|
+
const onClick = useCallback12(() => {
|
|
17841
19742
|
if (!scrollRef) return;
|
|
17842
19743
|
scrollRef.scrollBy({
|
|
17843
19744
|
left: mode === "left" ? -(scrollRef.scrollWidth + 1) : scrollRef.scrollWidth,
|
|
17844
19745
|
behavior: "smooth"
|
|
17845
19746
|
});
|
|
17846
19747
|
}, [scrollRef, mode]);
|
|
17847
|
-
return /* @__PURE__ */
|
|
19748
|
+
return /* @__PURE__ */ jsx368(
|
|
17848
19749
|
Container27,
|
|
17849
19750
|
{
|
|
17850
19751
|
className: ["scroll-arrow", ...visible ? ["visible"] : []].join(" "),
|
|
17851
19752
|
onClick,
|
|
17852
|
-
children: /* @__PURE__ */
|
|
19753
|
+
children: /* @__PURE__ */ jsx368(Icon_default, { type: "feather", icon, width: 16, height: 16, color: "black" })
|
|
17853
19754
|
}
|
|
17854
19755
|
);
|
|
17855
19756
|
};
|
|
17856
19757
|
var ScrollButton_default = ScrollButton;
|
|
17857
19758
|
|
|
17858
19759
|
// src/components/Tabs/components/ScrollButtons/styled.ts
|
|
17859
|
-
import
|
|
17860
|
-
var Container28 =
|
|
19760
|
+
import styled77, { css as css50 } from "styled-components";
|
|
19761
|
+
var Container28 = styled77.div`
|
|
17861
19762
|
overflow-x: auto;
|
|
17862
19763
|
scrollbar-width: thin;
|
|
17863
19764
|
scroll-behavior: smooth;
|
|
@@ -17872,19 +19773,19 @@ var Container28 = styled71.div`
|
|
|
17872
19773
|
display: none; /* Chrome, Safari, Opera */
|
|
17873
19774
|
}
|
|
17874
19775
|
|
|
17875
|
-
${({ theme: theme4, $internal: internal }) => internal &&
|
|
19776
|
+
${({ theme: theme4, $internal: internal }) => internal && css50`
|
|
17876
19777
|
gap: ${theme4.spacings.s6};
|
|
17877
19778
|
`}
|
|
17878
19779
|
`;
|
|
17879
19780
|
|
|
17880
19781
|
// src/components/Tabs/components/ScrollButtons/index.tsx
|
|
17881
|
-
import { jsx as
|
|
19782
|
+
import { jsx as jsx369, jsxs as jsxs190 } from "react/jsx-runtime";
|
|
17882
19783
|
var ScrollButtons = (props) => {
|
|
17883
19784
|
const { activeTabIndex, tabsLength } = props;
|
|
17884
|
-
const [ref, setRef] =
|
|
17885
|
-
const [showLeftArrow, setShowLeftArrow] =
|
|
17886
|
-
const [showRightArrow, setShowRightArrow] =
|
|
17887
|
-
const checkScrollPosition =
|
|
19785
|
+
const [ref, setRef] = useState32(null);
|
|
19786
|
+
const [showLeftArrow, setShowLeftArrow] = useState32(false);
|
|
19787
|
+
const [showRightArrow, setShowRightArrow] = useState32(false);
|
|
19788
|
+
const checkScrollPosition = useCallback13(() => {
|
|
17888
19789
|
if (!ref) return;
|
|
17889
19790
|
if (ref.scrollWidth > ref.offsetWidth) {
|
|
17890
19791
|
const { scrollLeft, scrollWidth, clientWidth } = ref;
|
|
@@ -17895,12 +19796,12 @@ var ScrollButtons = (props) => {
|
|
|
17895
19796
|
setShowRightArrow(false);
|
|
17896
19797
|
}
|
|
17897
19798
|
}, [ref]);
|
|
17898
|
-
|
|
19799
|
+
useEffect26(() => {
|
|
17899
19800
|
checkScrollPosition();
|
|
17900
19801
|
window.addEventListener("resize", checkScrollPosition);
|
|
17901
19802
|
return () => window.removeEventListener("resize", checkScrollPosition);
|
|
17902
19803
|
}, [checkScrollPosition, tabsLength]);
|
|
17903
|
-
|
|
19804
|
+
useEffect26(() => {
|
|
17904
19805
|
if (!ref) return;
|
|
17905
19806
|
if (ref.scrollWidth <= ref.offsetWidth) return;
|
|
17906
19807
|
const element = ref.children[activeTabIndex];
|
|
@@ -17910,9 +19811,9 @@ var ScrollButtons = (props) => {
|
|
|
17910
19811
|
inline: "nearest"
|
|
17911
19812
|
});
|
|
17912
19813
|
}, [activeTabIndex, ref]);
|
|
17913
|
-
return /* @__PURE__ */
|
|
17914
|
-
/* @__PURE__ */
|
|
17915
|
-
/* @__PURE__ */
|
|
19814
|
+
return /* @__PURE__ */ jsxs190(React64.Fragment, { children: [
|
|
19815
|
+
/* @__PURE__ */ jsx369(ScrollButton_default, { scrollRef: ref, mode: "left", visible: showLeftArrow }),
|
|
19816
|
+
/* @__PURE__ */ jsx369(
|
|
17916
19817
|
Container28,
|
|
17917
19818
|
{
|
|
17918
19819
|
ref: setRef,
|
|
@@ -17927,13 +19828,13 @@ var ScrollButtons = (props) => {
|
|
|
17927
19828
|
children: props.children
|
|
17928
19829
|
}
|
|
17929
19830
|
),
|
|
17930
|
-
/* @__PURE__ */
|
|
19831
|
+
/* @__PURE__ */ jsx369(ScrollButton_default, { scrollRef: ref, mode: "right", visible: showRightArrow })
|
|
17931
19832
|
] });
|
|
17932
19833
|
};
|
|
17933
19834
|
var ScrollButtons_default = ScrollButtons;
|
|
17934
19835
|
|
|
17935
19836
|
// src/components/Tabs/components/TabItem/index.tsx
|
|
17936
|
-
import
|
|
19837
|
+
import React67 from "react";
|
|
17937
19838
|
|
|
17938
19839
|
// src/components/Tabs/functions.ts
|
|
17939
19840
|
var sortTabs = (tabs, sorted = []) => {
|
|
@@ -17981,11 +19882,11 @@ var buildComponent = (component, provider) => {
|
|
|
17981
19882
|
};
|
|
17982
19883
|
|
|
17983
19884
|
// src/components/Tabs/components/TabItem/components/Close/index.tsx
|
|
17984
|
-
import { useCallback as
|
|
19885
|
+
import { useCallback as useCallback14 } from "react";
|
|
17985
19886
|
|
|
17986
19887
|
// src/components/Tabs/components/TabItem/components/Close/styles.ts
|
|
17987
|
-
import
|
|
17988
|
-
var Close =
|
|
19888
|
+
import styled78 from "styled-components";
|
|
19889
|
+
var Close = styled78.div`
|
|
17989
19890
|
position: relative;
|
|
17990
19891
|
z-index: 2;
|
|
17991
19892
|
display: flex;
|
|
@@ -18011,7 +19912,7 @@ var Close = styled72.div`
|
|
|
18011
19912
|
`;
|
|
18012
19913
|
|
|
18013
19914
|
// src/components/Tabs/components/TabItem/components/Close/index.tsx
|
|
18014
|
-
import { jsx as
|
|
19915
|
+
import { jsx as jsx370 } from "react/jsx-runtime";
|
|
18015
19916
|
var Close2 = (props) => {
|
|
18016
19917
|
const {
|
|
18017
19918
|
index,
|
|
@@ -18019,7 +19920,7 @@ var Close2 = (props) => {
|
|
|
18019
19920
|
options: [options, setOptions]
|
|
18020
19921
|
} = props;
|
|
18021
19922
|
const onClose = props.onClose || (() => true);
|
|
18022
|
-
const onClickClose =
|
|
19923
|
+
const onClickClose = useCallback14(
|
|
18023
19924
|
async (event) => {
|
|
18024
19925
|
if (options.length === 1) return;
|
|
18025
19926
|
const newOptions = [...options];
|
|
@@ -18033,7 +19934,7 @@ var Close2 = (props) => {
|
|
|
18033
19934
|
},
|
|
18034
19935
|
[options, active, index, onClose]
|
|
18035
19936
|
);
|
|
18036
|
-
return /* @__PURE__ */
|
|
19937
|
+
return /* @__PURE__ */ jsx370(Close, { children: /* @__PURE__ */ jsx370(
|
|
18037
19938
|
Icon_default,
|
|
18038
19939
|
{
|
|
18039
19940
|
type: "feather",
|
|
@@ -18048,11 +19949,11 @@ var Close2 = (props) => {
|
|
|
18048
19949
|
var Close_default = Close2;
|
|
18049
19950
|
|
|
18050
19951
|
// src/components/Tabs/components/TabItem/components/LabelItem/index.tsx
|
|
18051
|
-
import { useState as
|
|
19952
|
+
import { useState as useState33 } from "react";
|
|
18052
19953
|
|
|
18053
19954
|
// src/components/Tabs/components/TabItem/components/LabelItem/styled.ts
|
|
18054
|
-
import
|
|
18055
|
-
var StyledTab =
|
|
19955
|
+
import styled79, { css as css51 } from "styled-components";
|
|
19956
|
+
var StyledTab = styled79.div`
|
|
18056
19957
|
position: relative;
|
|
18057
19958
|
flex: 1;
|
|
18058
19959
|
white-space: nowrap;
|
|
@@ -18085,7 +19986,7 @@ var StyledTab = styled73.div`
|
|
|
18085
19986
|
transition: --color 0.5s, --bgColor 0.5s;
|
|
18086
19987
|
}
|
|
18087
19988
|
|
|
18088
|
-
${({ $primary, $hasSiblings, $internal }) => $primary && $hasSiblings && !$internal &&
|
|
19989
|
+
${({ $primary, $hasSiblings, $internal }) => $primary && $hasSiblings && !$internal && css51`
|
|
18089
19990
|
&::before {
|
|
18090
19991
|
content: '';
|
|
18091
19992
|
position: absolute;
|
|
@@ -18101,11 +20002,11 @@ var StyledTab = styled73.div`
|
|
|
18101
20002
|
`;
|
|
18102
20003
|
|
|
18103
20004
|
// src/components/Tabs/components/TabItem/components/LabelItem/index.tsx
|
|
18104
|
-
import { jsx as
|
|
20005
|
+
import { jsx as jsx371 } from "react/jsx-runtime";
|
|
18105
20006
|
var LabelItem = (props) => {
|
|
18106
20007
|
const { children, onClick, primary, hasSiblings, internal } = props;
|
|
18107
|
-
const [ref, setRef] =
|
|
18108
|
-
return /* @__PURE__ */
|
|
20008
|
+
const [ref, setRef] = useState33(null);
|
|
20009
|
+
return /* @__PURE__ */ jsx371(
|
|
18109
20010
|
StyledTab,
|
|
18110
20011
|
{
|
|
18111
20012
|
ref: setRef,
|
|
@@ -18124,8 +20025,8 @@ var LabelItem = (props) => {
|
|
|
18124
20025
|
var LabelItem_default = LabelItem;
|
|
18125
20026
|
|
|
18126
20027
|
// src/components/Tabs/components/TabItem/styled.ts
|
|
18127
|
-
import
|
|
18128
|
-
var Container29 =
|
|
20028
|
+
import styled80 from "styled-components";
|
|
20029
|
+
var Container29 = styled80.div`
|
|
18129
20030
|
@property --bgColor {
|
|
18130
20031
|
syntax: '<color>';
|
|
18131
20032
|
initial-value: #ffffff;
|
|
@@ -18159,8 +20060,8 @@ var Container29 = styled74.div`
|
|
|
18159
20060
|
`;
|
|
18160
20061
|
|
|
18161
20062
|
// src/components/Tabs/components/TabItem/index.tsx
|
|
18162
|
-
import { jsx as
|
|
18163
|
-
var VoidClose = () => /* @__PURE__ */
|
|
20063
|
+
import { jsx as jsx372, jsxs as jsxs191 } from "react/jsx-runtime";
|
|
20064
|
+
var VoidClose = () => /* @__PURE__ */ jsx372(React67.Fragment, {});
|
|
18164
20065
|
var TabItem = (props) => {
|
|
18165
20066
|
const {
|
|
18166
20067
|
active: [active, setActive],
|
|
@@ -18170,16 +20071,16 @@ var TabItem = (props) => {
|
|
|
18170
20071
|
alwaysOpen
|
|
18171
20072
|
} = props;
|
|
18172
20073
|
const CloseComponent = alwaysOpen || tabs.length < 2 ? VoidClose : Close_default;
|
|
18173
|
-
return /* @__PURE__ */
|
|
20074
|
+
return /* @__PURE__ */ jsx372(React67.Fragment, { children: sortedTabs.map(({ index, ...tab }) => {
|
|
18174
20075
|
const isActive = index === active;
|
|
18175
20076
|
const hasSiblings = hasChildren(tabs, tab.group);
|
|
18176
20077
|
const canClose = !props.internal && (!tab.primary || !hasSiblings);
|
|
18177
|
-
return /* @__PURE__ */
|
|
20078
|
+
return /* @__PURE__ */ jsxs191(
|
|
18178
20079
|
Container29,
|
|
18179
20080
|
{
|
|
18180
20081
|
...isActive ? { className: "active" } : {},
|
|
18181
20082
|
children: [
|
|
18182
|
-
/* @__PURE__ */
|
|
20083
|
+
/* @__PURE__ */ jsx372(
|
|
18183
20084
|
LabelItem_default,
|
|
18184
20085
|
{
|
|
18185
20086
|
children: tab.label,
|
|
@@ -18189,7 +20090,7 @@ var TabItem = (props) => {
|
|
|
18189
20090
|
internal: props.internal
|
|
18190
20091
|
}
|
|
18191
20092
|
),
|
|
18192
|
-
canClose && /* @__PURE__ */
|
|
20093
|
+
canClose && /* @__PURE__ */ jsx372(
|
|
18193
20094
|
CloseComponent,
|
|
18194
20095
|
{
|
|
18195
20096
|
index,
|
|
@@ -18207,13 +20108,13 @@ var TabItem = (props) => {
|
|
|
18207
20108
|
var TabItem_default = TabItem;
|
|
18208
20109
|
|
|
18209
20110
|
// src/components/Tabs/styled.ts
|
|
18210
|
-
import
|
|
20111
|
+
import styled81, { css as css52 } from "styled-components";
|
|
18211
20112
|
var delimiters = {
|
|
18212
20113
|
blue: ["blue"],
|
|
18213
20114
|
grey: ["warningGray"]
|
|
18214
20115
|
};
|
|
18215
|
-
var ComponentContainer =
|
|
18216
|
-
var Tabs =
|
|
20116
|
+
var ComponentContainer = styled81.div``;
|
|
20117
|
+
var Tabs = styled81.div`
|
|
18217
20118
|
position: relative;
|
|
18218
20119
|
overflow: hidden;
|
|
18219
20120
|
|
|
@@ -18228,7 +20129,7 @@ var Tabs = styled75.div`
|
|
|
18228
20129
|
bottom: "s4",
|
|
18229
20130
|
left: "0"
|
|
18230
20131
|
}).split(" ");
|
|
18231
|
-
return
|
|
20132
|
+
return css52`
|
|
18232
20133
|
margin: ${top} 0 ${bottom} 0;
|
|
18233
20134
|
padding: 0 ${right} 0 ${left};
|
|
18234
20135
|
`;
|
|
@@ -18236,7 +20137,7 @@ var Tabs = styled75.div`
|
|
|
18236
20137
|
|
|
18237
20138
|
${({ theme: theme4, $internal: internal, $delimiter: delimiter }) => {
|
|
18238
20139
|
const border = delimiter === "none" ? "none" : internal ? `1px solid ${theme4.getColor(...delimiters[delimiter || "grey"])}` : `2px solid ${theme4.getColor(...delimiters[delimiter || "blue"])}`;
|
|
18239
|
-
return
|
|
20140
|
+
return css52`
|
|
18240
20141
|
border-bottom: ${border};
|
|
18241
20142
|
+ ${ComponentContainer} {
|
|
18242
20143
|
border: 1px solid ${theme4.getColor(...delimiters.grey)};
|
|
@@ -18265,12 +20166,12 @@ var Tabs = styled75.div`
|
|
|
18265
20166
|
`;
|
|
18266
20167
|
|
|
18267
20168
|
// src/components/Tabs/index.tsx
|
|
18268
|
-
import { jsx as
|
|
18269
|
-
var VoidProvider = (props) => /* @__PURE__ */
|
|
20169
|
+
import { jsx as jsx373, jsxs as jsxs192 } from "react/jsx-runtime";
|
|
20170
|
+
var VoidProvider = (props) => /* @__PURE__ */ jsx373(React68.Fragment, { children: props.children });
|
|
18270
20171
|
var Component4 = (props) => {
|
|
18271
20172
|
const components = props.components || {};
|
|
18272
|
-
const [options, setOptions] = typeof props.options[1] === "function" ? props.options :
|
|
18273
|
-
const [active, setActive] = Array.isArray(props.active) ? props.active :
|
|
20173
|
+
const [options, setOptions] = typeof props.options[1] === "function" ? props.options : useState34(props.options);
|
|
20174
|
+
const [active, setActive] = Array.isArray(props.active) ? props.active : useState34(props.active);
|
|
18274
20175
|
const sortedTabs = sortTabs(options.map((tab, index) => ({ ...tab, index })));
|
|
18275
20176
|
const activeTabIndex = sortedTabs.findIndex((tab) => tab.index === active);
|
|
18276
20177
|
const divProps = filterObject(props, [
|
|
@@ -18284,15 +20185,15 @@ var Component4 = (props) => {
|
|
|
18284
20185
|
"delimiter",
|
|
18285
20186
|
"spacing"
|
|
18286
20187
|
]);
|
|
18287
|
-
return /* @__PURE__ */
|
|
18288
|
-
/* @__PURE__ */
|
|
20188
|
+
return /* @__PURE__ */ jsxs192(React68.Fragment, { children: [
|
|
20189
|
+
/* @__PURE__ */ jsx373(
|
|
18289
20190
|
Tabs,
|
|
18290
20191
|
{
|
|
18291
20192
|
...divProps,
|
|
18292
20193
|
$internal: props.internal,
|
|
18293
20194
|
$delimiter: props.delimiter,
|
|
18294
20195
|
$spacing: props.spacing,
|
|
18295
|
-
children: /* @__PURE__ */
|
|
20196
|
+
children: /* @__PURE__ */ jsx373(
|
|
18296
20197
|
ScrollButtons_default,
|
|
18297
20198
|
{
|
|
18298
20199
|
...{
|
|
@@ -18300,7 +20201,7 @@ var Component4 = (props) => {
|
|
|
18300
20201
|
tabsLength: options.length,
|
|
18301
20202
|
internal: props.internal
|
|
18302
20203
|
},
|
|
18303
|
-
children: /* @__PURE__ */
|
|
20204
|
+
children: /* @__PURE__ */ jsx373(
|
|
18304
20205
|
TabItem_default,
|
|
18305
20206
|
{
|
|
18306
20207
|
active: [active, setActive],
|
|
@@ -18317,7 +20218,7 @@ var Component4 = (props) => {
|
|
|
18317
20218
|
),
|
|
18318
20219
|
options.map((tab, index) => {
|
|
18319
20220
|
if (tab.component === void 0) {
|
|
18320
|
-
return /* @__PURE__ */
|
|
20221
|
+
return /* @__PURE__ */ jsx373(React68.Fragment, {}, index);
|
|
18321
20222
|
}
|
|
18322
20223
|
const Component5 = components[tab.component];
|
|
18323
20224
|
const Provider7 = Component5.provider || VoidProvider;
|
|
@@ -18337,7 +20238,7 @@ var Component4 = (props) => {
|
|
|
18337
20238
|
return s === label ? prev : { ...prev, label };
|
|
18338
20239
|
});
|
|
18339
20240
|
};
|
|
18340
|
-
return /* @__PURE__ */
|
|
20241
|
+
return /* @__PURE__ */ jsx373(
|
|
18341
20242
|
Provider7,
|
|
18342
20243
|
{
|
|
18343
20244
|
label: tab.label,
|
|
@@ -18346,7 +20247,7 @@ var Component4 = (props) => {
|
|
|
18346
20247
|
setLabel,
|
|
18347
20248
|
...index === active ? {
|
|
18348
20249
|
active: true,
|
|
18349
|
-
children: /* @__PURE__ */
|
|
20250
|
+
children: /* @__PURE__ */ jsx373(ComponentContainer, { children: /* @__PURE__ */ jsx373(
|
|
18350
20251
|
Component5,
|
|
18351
20252
|
{
|
|
18352
20253
|
data: tab.data,
|
|
@@ -18368,8 +20269,8 @@ var Tabs2 = Object.assign(Component4, {
|
|
|
18368
20269
|
var Tabs_default = Tabs2;
|
|
18369
20270
|
|
|
18370
20271
|
// src/components/TextArea/styles.ts
|
|
18371
|
-
import
|
|
18372
|
-
var Container30 =
|
|
20272
|
+
import styled82 from "styled-components";
|
|
20273
|
+
var Container30 = styled82.textarea`
|
|
18373
20274
|
width: ${({ $width: width }) => width};
|
|
18374
20275
|
height: ${({ $height: height }) => height};
|
|
18375
20276
|
resize: none;
|
|
@@ -18381,26 +20282,26 @@ var Container30 = styled76.textarea`
|
|
|
18381
20282
|
`;
|
|
18382
20283
|
|
|
18383
20284
|
// src/components/TextArea/index.tsx
|
|
18384
|
-
import { jsx as
|
|
20285
|
+
import { jsx as jsx374 } from "react/jsx-runtime";
|
|
18385
20286
|
var TextArea = ({
|
|
18386
20287
|
width,
|
|
18387
20288
|
height,
|
|
18388
20289
|
...props
|
|
18389
20290
|
}) => {
|
|
18390
|
-
return /* @__PURE__ */
|
|
20291
|
+
return /* @__PURE__ */ jsx374(Container30, { ...props, $width: width, $height: height });
|
|
18391
20292
|
};
|
|
18392
20293
|
var TextArea_default = TextArea;
|
|
18393
20294
|
|
|
18394
20295
|
// src/components/Toast/styles.ts
|
|
18395
|
-
import
|
|
18396
|
-
var Container31 =
|
|
20296
|
+
import styled83, { css as css53 } from "styled-components";
|
|
20297
|
+
var Container31 = styled83.div`
|
|
18397
20298
|
border-radius: 4px;
|
|
18398
|
-
width: ${({ $size:
|
|
20299
|
+
width: ${({ $size: size4 }) => size4 === "large" ? "837px" : "460px"};
|
|
18399
20300
|
height: 88px;
|
|
18400
20301
|
border: 1px solid transparent;
|
|
18401
20302
|
position: relative;
|
|
18402
20303
|
|
|
18403
|
-
${({ $color: color }) => color === "success" &&
|
|
20304
|
+
${({ $color: color }) => color === "success" && css53`
|
|
18404
20305
|
background-color: #fcfff5;
|
|
18405
20306
|
opacity: 1;
|
|
18406
20307
|
border-color: #a8c599;
|
|
@@ -18412,7 +20313,7 @@ var Container31 = styled77.div`
|
|
|
18412
20313
|
}
|
|
18413
20314
|
`}
|
|
18414
20315
|
|
|
18415
|
-
${({ $color: color }) => color === "error" &&
|
|
20316
|
+
${({ $color: color }) => color === "error" && css53`
|
|
18416
20317
|
background-color: #fff6f6;
|
|
18417
20318
|
opacity: 1;
|
|
18418
20319
|
border-color: #973937;
|
|
@@ -18424,7 +20325,7 @@ var Container31 = styled77.div`
|
|
|
18424
20325
|
}
|
|
18425
20326
|
`}
|
|
18426
20327
|
|
|
18427
|
-
${({ $color: color }) => color === "warning" &&
|
|
20328
|
+
${({ $color: color }) => color === "warning" && css53`
|
|
18428
20329
|
background-color: #fffaf3;
|
|
18429
20330
|
opacity: 1;
|
|
18430
20331
|
border-color: #ccbea0;
|
|
@@ -18445,7 +20346,7 @@ var Container31 = styled77.div`
|
|
|
18445
20346
|
height: 13px;
|
|
18446
20347
|
}
|
|
18447
20348
|
`;
|
|
18448
|
-
var IconContainer3 =
|
|
20349
|
+
var IconContainer3 = styled83.div`
|
|
18449
20350
|
width: 100%;
|
|
18450
20351
|
display: flex;
|
|
18451
20352
|
align-items: center;
|
|
@@ -18453,7 +20354,7 @@ var IconContainer3 = styled77.div`
|
|
|
18453
20354
|
padding: 14px 14px 0 0;
|
|
18454
20355
|
margin: 0;
|
|
18455
20356
|
`;
|
|
18456
|
-
var IconContent =
|
|
20357
|
+
var IconContent = styled83.div`
|
|
18457
20358
|
width: 100%;
|
|
18458
20359
|
padding: 13px 0 21px 28px;
|
|
18459
20360
|
display: flex;
|
|
@@ -18472,20 +20373,20 @@ var IconContent = styled77.div`
|
|
|
18472
20373
|
`;
|
|
18473
20374
|
|
|
18474
20375
|
// src/components/Toast/index.tsx
|
|
18475
|
-
import { jsx as
|
|
20376
|
+
import { jsx as jsx375, jsxs as jsxs193 } from "react/jsx-runtime";
|
|
18476
20377
|
var Toast = ({
|
|
18477
|
-
size:
|
|
20378
|
+
size: size4,
|
|
18478
20379
|
color,
|
|
18479
20380
|
title,
|
|
18480
20381
|
description,
|
|
18481
20382
|
onClose: handlClose,
|
|
18482
20383
|
...props
|
|
18483
20384
|
}) => {
|
|
18484
|
-
return /* @__PURE__ */
|
|
18485
|
-
/* @__PURE__ */
|
|
18486
|
-
/* @__PURE__ */
|
|
18487
|
-
/* @__PURE__ */
|
|
18488
|
-
/* @__PURE__ */
|
|
20385
|
+
return /* @__PURE__ */ jsxs193(Container31, { ...props, $size: size4, $color: color, children: [
|
|
20386
|
+
/* @__PURE__ */ jsx375(IconContainer3, { children: /* @__PURE__ */ jsx375(Icon_default, { type: "feather", icon: "x", onClick: handlClose }) }),
|
|
20387
|
+
/* @__PURE__ */ jsxs193(IconContent, { children: [
|
|
20388
|
+
/* @__PURE__ */ jsx375("h4", { children: title }),
|
|
20389
|
+
/* @__PURE__ */ jsxs193("p", { children: [
|
|
18489
20390
|
" ",
|
|
18490
20391
|
description
|
|
18491
20392
|
] })
|
|
@@ -18495,15 +20396,15 @@ var Toast = ({
|
|
|
18495
20396
|
var Toast_default = Toast;
|
|
18496
20397
|
|
|
18497
20398
|
// src/components/Zoom/index.tsx
|
|
18498
|
-
import
|
|
20399
|
+
import React69, { useState as useState35 } from "react";
|
|
18499
20400
|
|
|
18500
20401
|
// src/components/Zoom/styles.ts
|
|
18501
|
-
import
|
|
18502
|
-
var Image =
|
|
20402
|
+
import styled84 from "styled-components";
|
|
20403
|
+
var Image = styled84.img`
|
|
18503
20404
|
max-width: 100%;
|
|
18504
20405
|
max-height: 100%;
|
|
18505
20406
|
`;
|
|
18506
|
-
var Container32 =
|
|
20407
|
+
var Container32 = styled84.div`
|
|
18507
20408
|
position: relative;
|
|
18508
20409
|
display: inline-flex;
|
|
18509
20410
|
|
|
@@ -18532,7 +20433,7 @@ var Container32 = styled78.div`
|
|
|
18532
20433
|
}};
|
|
18533
20434
|
}
|
|
18534
20435
|
`;
|
|
18535
|
-
var Dimmer =
|
|
20436
|
+
var Dimmer = styled84.div`
|
|
18536
20437
|
position: absolute;
|
|
18537
20438
|
top: 0;
|
|
18538
20439
|
left: 0;
|
|
@@ -18550,10 +20451,10 @@ var Dimmer = styled78.div`
|
|
|
18550
20451
|
opacity: 1;
|
|
18551
20452
|
}
|
|
18552
20453
|
`;
|
|
18553
|
-
var Button7 =
|
|
20454
|
+
var Button7 = styled84(Button_default)`
|
|
18554
20455
|
background-color: ${({ theme: theme4 }) => theme4.getColor("white", 50)};
|
|
18555
20456
|
`;
|
|
18556
|
-
var ModalContent =
|
|
20457
|
+
var ModalContent = styled84.div`
|
|
18557
20458
|
position: absolute;
|
|
18558
20459
|
width: 100%;
|
|
18559
20460
|
height: 100%;
|
|
@@ -18567,12 +20468,12 @@ var ModalContent = styled78.div`
|
|
|
18567
20468
|
`;
|
|
18568
20469
|
|
|
18569
20470
|
// src/components/Zoom/index.tsx
|
|
18570
|
-
import { jsx as
|
|
20471
|
+
import { jsx as jsx376, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
18571
20472
|
var Zoom = (props) => {
|
|
18572
20473
|
const { src, width, height, ...imgProps } = props;
|
|
18573
|
-
const [modalOpened, setModalOpened] =
|
|
18574
|
-
return /* @__PURE__ */
|
|
18575
|
-
/* @__PURE__ */
|
|
20474
|
+
const [modalOpened, setModalOpened] = useState35(false);
|
|
20475
|
+
return /* @__PURE__ */ jsxs194(React69.Fragment, { children: [
|
|
20476
|
+
/* @__PURE__ */ jsxs194(
|
|
18576
20477
|
Container32,
|
|
18577
20478
|
{
|
|
18578
20479
|
...imgProps,
|
|
@@ -18580,8 +20481,8 @@ var Zoom = (props) => {
|
|
|
18580
20481
|
$width: width,
|
|
18581
20482
|
$height: height,
|
|
18582
20483
|
children: [
|
|
18583
|
-
/* @__PURE__ */
|
|
18584
|
-
/* @__PURE__ */
|
|
20484
|
+
/* @__PURE__ */ jsx376(Image, { src, alt: "zoom" }),
|
|
20485
|
+
/* @__PURE__ */ jsx376(Dimmer, { children: /* @__PURE__ */ jsx376(
|
|
18585
20486
|
Button7,
|
|
18586
20487
|
{
|
|
18587
20488
|
content: "Zoom",
|
|
@@ -18592,14 +20493,14 @@ var Zoom = (props) => {
|
|
|
18592
20493
|
]
|
|
18593
20494
|
}
|
|
18594
20495
|
),
|
|
18595
|
-
/* @__PURE__ */
|
|
20496
|
+
/* @__PURE__ */ jsx376(
|
|
18596
20497
|
Modal_default,
|
|
18597
20498
|
{
|
|
18598
20499
|
openState: [modalOpened, setModalOpened],
|
|
18599
20500
|
size: "large",
|
|
18600
20501
|
title: "Zoom",
|
|
18601
20502
|
closeOnClickOutside: true,
|
|
18602
|
-
children: /* @__PURE__ */
|
|
20503
|
+
children: /* @__PURE__ */ jsx376(ModalContent, { children: /* @__PURE__ */ jsx376("img", { src, alt: "zoom" }) })
|
|
18603
20504
|
}
|
|
18604
20505
|
)
|
|
18605
20506
|
] });
|
|
@@ -18625,6 +20526,7 @@ export {
|
|
|
18625
20526
|
Placeholder_default as MwPlaceholder,
|
|
18626
20527
|
ProgressBar_default as MwProgressBar,
|
|
18627
20528
|
ScrollContainer_default as MwScrollContainer,
|
|
20529
|
+
Select_default3 as MwSelect,
|
|
18628
20530
|
Signature_default as MwSignature,
|
|
18629
20531
|
Tabs_default as MwTabs,
|
|
18630
20532
|
TextArea_default as MwTextArea,
|