@mw-kit/mw-ui 1.8.22 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +18 -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 +2396 -521
- package/dist/index.mjs +2415 -520
- 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,
|
|
@@ -13079,7 +13152,7 @@ var RadioButton = (props) => {
|
|
|
13079
13152
|
var RadioButton_default = RadioButton;
|
|
13080
13153
|
|
|
13081
13154
|
// src/components/Input/components/Range/index.tsx
|
|
13082
|
-
import
|
|
13155
|
+
import React24 from "react";
|
|
13083
13156
|
|
|
13084
13157
|
// src/components/Input/components/Range/styles/Input/index.ts
|
|
13085
13158
|
import styled27, { css as css22 } from "styled-components";
|
|
@@ -13514,18 +13587,18 @@ var getMarkerLeft = (markers, range, index, value, min, strict) => {
|
|
|
13514
13587
|
const left = `calc(${p}% - 10px - ${x}px)`;
|
|
13515
13588
|
return left;
|
|
13516
13589
|
};
|
|
13517
|
-
var getLeftCalc = (
|
|
13590
|
+
var getLeftCalc = (size4, bullet2, value, min, max) => {
|
|
13518
13591
|
const percent = (value - min) * 100 / (max - min);
|
|
13519
|
-
const calc = `calc(${percent}% - ${bullet2 * percent / 100}px + ${(bullet2 -
|
|
13592
|
+
const calc = `calc(${percent}% - ${bullet2 * percent / 100}px + ${(bullet2 - size4) / 2}px)`;
|
|
13520
13593
|
return calc;
|
|
13521
13594
|
};
|
|
13522
|
-
var getBarLeft = (
|
|
13523
|
-
return `min(max(${calc}, 0%), calc(100% - ${
|
|
13595
|
+
var getBarLeft = (size4, calc) => {
|
|
13596
|
+
return `min(max(${calc}, 0%), calc(100% - ${size4}px))`;
|
|
13524
13597
|
};
|
|
13525
|
-
var getIndicatorLeft = (
|
|
13526
|
-
return `min(max(${calc}, calc(0% - ${
|
|
13598
|
+
var getIndicatorLeft = (size4, calc) => {
|
|
13599
|
+
return `min(max(${calc}, calc(0% - ${size4}px)), calc(100% - ${size4}px))`;
|
|
13527
13600
|
};
|
|
13528
|
-
var Range =
|
|
13601
|
+
var Range = React24.forwardRef(
|
|
13529
13602
|
(props, ref) => {
|
|
13530
13603
|
const { label, minLabel, maxLabel, width, setValue, hideNavbar } = props;
|
|
13531
13604
|
const { isRequired, isInvalid: isInvalid2, isViewMode, isDisabled } = Form_default.useContext(
|
|
@@ -13735,10 +13808,10 @@ Range.displayName = "input";
|
|
|
13735
13808
|
var Range_default = Range;
|
|
13736
13809
|
|
|
13737
13810
|
// src/components/Input/components/Select/index.tsx
|
|
13738
|
-
import
|
|
13811
|
+
import React32, { useCallback as useCallback4, useEffect as useEffect15, useState as useState19 } from "react";
|
|
13739
13812
|
|
|
13740
13813
|
// src/components/Input/components/Select/hooks/Select/index.tsx
|
|
13741
|
-
import
|
|
13814
|
+
import React27 from "react";
|
|
13742
13815
|
|
|
13743
13816
|
// src/components/Input/components/Select/styles.ts
|
|
13744
13817
|
import styled38, { css as css28 } from "styled-components";
|
|
@@ -13766,7 +13839,7 @@ var HiddenInput = styled38.input`
|
|
|
13766
13839
|
`;
|
|
13767
13840
|
|
|
13768
13841
|
// src/components/Input/components/Select/hooks/Navigation/index.ts
|
|
13769
|
-
import { useCallback as
|
|
13842
|
+
import { useCallback as useCallback3 } from "react";
|
|
13770
13843
|
var isAvailable = (index, option) => {
|
|
13771
13844
|
return !option.disabled && !(option.rules || []).some((rule) => rule(index, option.data) !== true);
|
|
13772
13845
|
};
|
|
@@ -13776,7 +13849,7 @@ var useNavigation = (props) => {
|
|
|
13776
13849
|
options,
|
|
13777
13850
|
onSelectHighlight
|
|
13778
13851
|
} = props;
|
|
13779
|
-
const onKeyDown =
|
|
13852
|
+
const onKeyDown = useCallback3(
|
|
13780
13853
|
(e) => {
|
|
13781
13854
|
if (e.key === "ArrowDown") {
|
|
13782
13855
|
e.preventDefault();
|
|
@@ -13825,12 +13898,12 @@ var useNavigation = (props) => {
|
|
|
13825
13898
|
var Navigation_default2 = useNavigation;
|
|
13826
13899
|
|
|
13827
13900
|
// src/components/Input/components/Select/hooks/Select/components/Header/index.tsx
|
|
13828
|
-
import
|
|
13901
|
+
import React26 from "react";
|
|
13829
13902
|
|
|
13830
13903
|
// src/components/Input/components/Select/hooks/Select/context.ts
|
|
13831
|
-
import
|
|
13832
|
-
var Provider3 =
|
|
13833
|
-
var useContext2 = () =>
|
|
13904
|
+
import React25 from "react";
|
|
13905
|
+
var Provider3 = React25.createContext({});
|
|
13906
|
+
var useContext2 = () => React25.useContext(Provider3);
|
|
13834
13907
|
var context_default2 = Provider3;
|
|
13835
13908
|
|
|
13836
13909
|
// src/components/Input/components/Select/hooks/Select/components/Header/styles.ts
|
|
@@ -13846,7 +13919,7 @@ import { jsx as jsx321 } from "react/jsx-runtime";
|
|
|
13846
13919
|
var Header2 = () => {
|
|
13847
13920
|
const context = useContext2();
|
|
13848
13921
|
if (!context.props.search) {
|
|
13849
|
-
return /* @__PURE__ */ jsx321(
|
|
13922
|
+
return /* @__PURE__ */ jsx321(React26.Fragment, {});
|
|
13850
13923
|
}
|
|
13851
13924
|
const {
|
|
13852
13925
|
searchInput: [searchInput, setSearchInput]
|
|
@@ -13939,7 +14012,7 @@ var useSelect = (props, [highlight, setHighlight], [options, setOptions], setOpe
|
|
|
13939
14012
|
onReset,
|
|
13940
14013
|
menu: {
|
|
13941
14014
|
itemSpacing: "s3",
|
|
13942
|
-
before: /* @__PURE__ */ jsxs159(
|
|
14015
|
+
before: /* @__PURE__ */ jsxs159(React27.Fragment, { children: [
|
|
13943
14016
|
/* @__PURE__ */ jsx322(Header_default, {}),
|
|
13944
14017
|
/* @__PURE__ */ jsx322(
|
|
13945
14018
|
HiddenInput,
|
|
@@ -13970,15 +14043,15 @@ var useSelect = (props, [highlight, setHighlight], [options, setOptions], setOpe
|
|
|
13970
14043
|
var Select_default = useSelect;
|
|
13971
14044
|
|
|
13972
14045
|
// src/components/Input/components/Select/hooks/SelectMultiple/index.tsx
|
|
13973
|
-
import
|
|
14046
|
+
import React31, { useEffect as useEffect14, useState as useState18 } from "react";
|
|
13974
14047
|
|
|
13975
14048
|
// src/components/Input/components/Select/hooks/SelectMultiple/components/Footer/index.tsx
|
|
13976
|
-
import
|
|
14049
|
+
import React29 from "react";
|
|
13977
14050
|
|
|
13978
14051
|
// src/components/Input/components/Select/hooks/SelectMultiple/context.ts
|
|
13979
|
-
import
|
|
13980
|
-
var Provider4 =
|
|
13981
|
-
var useContext3 = () =>
|
|
14052
|
+
import React28 from "react";
|
|
14053
|
+
var Provider4 = React28.createContext({});
|
|
14054
|
+
var useContext3 = () => React28.useContext(Provider4);
|
|
13982
14055
|
var context_default3 = Provider4;
|
|
13983
14056
|
|
|
13984
14057
|
// src/components/Input/components/Select/hooks/SelectMultiple/components/Footer/index.tsx
|
|
@@ -14008,7 +14081,7 @@ var Footer2 = () => {
|
|
|
14008
14081
|
setValue(value2, data);
|
|
14009
14082
|
setOpen(false);
|
|
14010
14083
|
};
|
|
14011
|
-
return /* @__PURE__ */ jsxs160(
|
|
14084
|
+
return /* @__PURE__ */ jsxs160(React29.Fragment, { children: [
|
|
14012
14085
|
error && /* @__PURE__ */ jsx323(
|
|
14013
14086
|
"span",
|
|
14014
14087
|
{
|
|
@@ -14036,14 +14109,14 @@ var Footer2 = () => {
|
|
|
14036
14109
|
var Footer_default = Footer2;
|
|
14037
14110
|
|
|
14038
14111
|
// src/components/Input/components/Select/hooks/SelectMultiple/components/Header/index.tsx
|
|
14039
|
-
import
|
|
14112
|
+
import React30 from "react";
|
|
14040
14113
|
|
|
14041
14114
|
// src/components/Link/index.tsx
|
|
14042
14115
|
import styled40, { css as css30 } from "styled-components";
|
|
14043
14116
|
import { jsx as jsx324 } from "react/jsx-runtime";
|
|
14044
14117
|
var Container11 = styled40.div`
|
|
14045
|
-
${({ $size:
|
|
14046
|
-
const { fontSize, lineHeight } = sizes[
|
|
14118
|
+
${({ $size: size4 }) => {
|
|
14119
|
+
const { fontSize, lineHeight } = sizes[size4 || "small"];
|
|
14047
14120
|
return css30`
|
|
14048
14121
|
font-size: ${fontSize};
|
|
14049
14122
|
line-height: ${lineHeight};
|
|
@@ -14071,12 +14144,12 @@ var Container11 = styled40.div`
|
|
|
14071
14144
|
` : null;
|
|
14072
14145
|
}}
|
|
14073
14146
|
`;
|
|
14074
|
-
var Link = ({ size:
|
|
14147
|
+
var Link = ({ size: size4, colorSetting, disabled, ...props }) => {
|
|
14075
14148
|
return /* @__PURE__ */ jsx324(
|
|
14076
14149
|
Container11,
|
|
14077
14150
|
{
|
|
14078
14151
|
...props,
|
|
14079
|
-
$size:
|
|
14152
|
+
$size: size4,
|
|
14080
14153
|
$colorSetting: colorSetting,
|
|
14081
14154
|
$disabled: disabled
|
|
14082
14155
|
}
|
|
@@ -14147,7 +14220,7 @@ var CheckAll = () => {
|
|
|
14147
14220
|
var Header3 = () => {
|
|
14148
14221
|
const context = useContext3();
|
|
14149
14222
|
if (!context.props.search) {
|
|
14150
|
-
return /* @__PURE__ */ jsx325(
|
|
14223
|
+
return /* @__PURE__ */ jsx325(React30.Fragment, {});
|
|
14151
14224
|
}
|
|
14152
14225
|
const {
|
|
14153
14226
|
searchInput: [searchInput, setSearchInput],
|
|
@@ -14284,12 +14357,12 @@ var parseValue = (value) => {
|
|
|
14284
14357
|
};
|
|
14285
14358
|
var useSelectMultiple = (props, [highlight, setHighlight], [options, setOptions]) => {
|
|
14286
14359
|
const initial = parseValue(props.value);
|
|
14287
|
-
const [checked, setChecked] =
|
|
14360
|
+
const [checked, setChecked] = useState18([
|
|
14288
14361
|
...initial
|
|
14289
14362
|
]);
|
|
14290
14363
|
const limits = resolveLimits(props.minSelected, props.maxSelected);
|
|
14291
14364
|
const { max, enabled } = limits;
|
|
14292
|
-
|
|
14365
|
+
useEffect14(() => {
|
|
14293
14366
|
if (limits.error) {
|
|
14294
14367
|
console.error(`[SelectMultiple]: ${limits.error}`);
|
|
14295
14368
|
}
|
|
@@ -14329,7 +14402,7 @@ var useSelectMultiple = (props, [highlight, setHighlight], [options, setOptions]
|
|
|
14329
14402
|
onReset,
|
|
14330
14403
|
menu: {
|
|
14331
14404
|
itemSpacing: void 0,
|
|
14332
|
-
before: /* @__PURE__ */ jsxs162(
|
|
14405
|
+
before: /* @__PURE__ */ jsxs162(React31.Fragment, { children: [
|
|
14333
14406
|
/* @__PURE__ */ jsx327(Header_default2, {}),
|
|
14334
14407
|
/* @__PURE__ */ jsx327(
|
|
14335
14408
|
HiddenInput,
|
|
@@ -14384,12 +14457,12 @@ var SelectMultiple_default = useSelectMultiple;
|
|
|
14384
14457
|
|
|
14385
14458
|
// src/components/Input/components/Select/index.tsx
|
|
14386
14459
|
import { jsx as jsx328, jsxs as jsxs163 } from "react/jsx-runtime";
|
|
14387
|
-
var Select =
|
|
14460
|
+
var Select = React32.forwardRef(
|
|
14388
14461
|
(props, ref) => {
|
|
14389
14462
|
const { position, loader: loader2, initialLoader } = props;
|
|
14390
|
-
const [options, setOptions] =
|
|
14391
|
-
const [highlight, setHighlight] =
|
|
14392
|
-
const [open, setOpen] =
|
|
14463
|
+
const [options, setOptions] = useState19(initialLoader || []);
|
|
14464
|
+
const [highlight, setHighlight] = useState19(-1);
|
|
14465
|
+
const [open, setOpen] = useState19(false);
|
|
14393
14466
|
const hook = props.type === "select-multiple" ? SelectMultiple_default : Select_default;
|
|
14394
14467
|
const {
|
|
14395
14468
|
parsedOptions,
|
|
@@ -14405,11 +14478,11 @@ var Select = React33.forwardRef(
|
|
|
14405
14478
|
[options, setOptions],
|
|
14406
14479
|
setOpen
|
|
14407
14480
|
);
|
|
14408
|
-
const [_loading, setLoading] =
|
|
14409
|
-
const [search, _setSearch] =
|
|
14410
|
-
const [searchInput, setSearchInput] =
|
|
14411
|
-
const [page, setPage] =
|
|
14412
|
-
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);
|
|
14413
14486
|
const loading = props.loading || _loading;
|
|
14414
14487
|
const setSearch = (value) => {
|
|
14415
14488
|
_setSearch(value);
|
|
@@ -14442,7 +14515,7 @@ var Select = React33.forwardRef(
|
|
|
14442
14515
|
}
|
|
14443
14516
|
_onScrollEnd(e);
|
|
14444
14517
|
};
|
|
14445
|
-
const onSubmit =
|
|
14518
|
+
const onSubmit = useCallback4(async () => {
|
|
14446
14519
|
setLoading(true);
|
|
14447
14520
|
const optionsResult = await loader2(search, page);
|
|
14448
14521
|
if (optionsResult === null) return;
|
|
@@ -14458,22 +14531,22 @@ var Select = React33.forwardRef(
|
|
|
14458
14531
|
setLastPage(lastPage2);
|
|
14459
14532
|
setLoading(false);
|
|
14460
14533
|
}, [loader2, search, page, initialLoader]);
|
|
14461
|
-
|
|
14534
|
+
useEffect15(() => {
|
|
14462
14535
|
const timeoutId = setTimeout(() => onSubmit(), 250);
|
|
14463
14536
|
return () => clearTimeout(timeoutId);
|
|
14464
14537
|
}, [onSubmit]);
|
|
14465
|
-
|
|
14538
|
+
useEffect15(() => {
|
|
14466
14539
|
if (open) return;
|
|
14467
14540
|
setSearch("");
|
|
14468
14541
|
onReset();
|
|
14469
14542
|
}, [props.value, open]);
|
|
14470
|
-
|
|
14543
|
+
useEffect15(() => {
|
|
14471
14544
|
setSearchInput(search);
|
|
14472
14545
|
}, [search]);
|
|
14473
|
-
|
|
14546
|
+
useEffect15(() => {
|
|
14474
14547
|
if (page === 1) setHighlight(-1);
|
|
14475
14548
|
}, [page]);
|
|
14476
|
-
|
|
14549
|
+
useEffect15(() => {
|
|
14477
14550
|
const timeoutId = setTimeout(() => setSearch(searchInput), 1e3);
|
|
14478
14551
|
return () => clearTimeout(timeoutId);
|
|
14479
14552
|
}, [searchInput]);
|
|
@@ -14489,7 +14562,7 @@ var Select = React33.forwardRef(
|
|
|
14489
14562
|
/* @__PURE__ */ jsxs163(
|
|
14490
14563
|
RelativeContainer7,
|
|
14491
14564
|
{
|
|
14492
|
-
ref:
|
|
14565
|
+
ref: useOnClickOut_default(() => setOpen(false)),
|
|
14493
14566
|
$width: props.width,
|
|
14494
14567
|
children: [
|
|
14495
14568
|
/* @__PURE__ */ jsx328(
|
|
@@ -14565,7 +14638,7 @@ Select.displayName = "Select";
|
|
|
14565
14638
|
var Select_default2 = Select;
|
|
14566
14639
|
|
|
14567
14640
|
// src/components/Input/components/Switch/index.tsx
|
|
14568
|
-
import
|
|
14641
|
+
import React33 from "react";
|
|
14569
14642
|
|
|
14570
14643
|
// src/components/Input/components/Switch/styles.ts
|
|
14571
14644
|
import styled42, { css as css32 } from "styled-components";
|
|
@@ -14726,7 +14799,7 @@ var Switch = (props) => {
|
|
|
14726
14799
|
$keepSpace: true,
|
|
14727
14800
|
children: label[props.checked ? "after" : "before"]
|
|
14728
14801
|
}
|
|
14729
|
-
) : /* @__PURE__ */ jsxs164(
|
|
14802
|
+
) : /* @__PURE__ */ jsxs164(React33.Fragment, { children: [
|
|
14730
14803
|
label.before && /* @__PURE__ */ jsx329(LabelContainer7, { children: label.before }),
|
|
14731
14804
|
/* @__PURE__ */ jsx329("input", { ...htmlProps, type: "checkbox" }),
|
|
14732
14805
|
/* @__PURE__ */ jsx329("span", {}),
|
|
@@ -14739,10 +14812,10 @@ var Switch = (props) => {
|
|
|
14739
14812
|
var Switch_default = Switch;
|
|
14740
14813
|
|
|
14741
14814
|
// src/components/Input/components/Tags/index.tsx
|
|
14742
|
-
import
|
|
14815
|
+
import React35, { useState as useState20 } from "react";
|
|
14743
14816
|
|
|
14744
14817
|
// src/components/Input/components/Tags/components/Input/index.tsx
|
|
14745
|
-
import
|
|
14818
|
+
import React34 from "react";
|
|
14746
14819
|
|
|
14747
14820
|
// src/components/Input/components/Tags/components/Input/styles.ts
|
|
14748
14821
|
import styled43 from "styled-components";
|
|
@@ -14776,7 +14849,7 @@ var Input4 = styled43.input`
|
|
|
14776
14849
|
|
|
14777
14850
|
// src/components/Input/components/Tags/components/Input/index.tsx
|
|
14778
14851
|
import { jsx as jsx330 } from "react/jsx-runtime";
|
|
14779
|
-
var Input5 =
|
|
14852
|
+
var Input5 = React34.forwardRef(
|
|
14780
14853
|
(props, ref) => {
|
|
14781
14854
|
const [value, setValue] = props.value;
|
|
14782
14855
|
const _onKeyDown = props.onKeyDown || (() => {
|
|
@@ -14933,10 +15006,10 @@ var TagContainer = styled46.div`
|
|
|
14933
15006
|
|
|
14934
15007
|
// src/components/Input/components/Tags/index.tsx
|
|
14935
15008
|
import { jsx as jsx333, jsxs as jsxs166 } from "react/jsx-runtime";
|
|
14936
|
-
var Tags =
|
|
15009
|
+
var Tags = React35.forwardRef(
|
|
14937
15010
|
(props, ref) => {
|
|
14938
15011
|
const { value, setValue } = props;
|
|
14939
|
-
const [inputValue, setInputValue] = props.input?.value ? props.input.value :
|
|
15012
|
+
const [inputValue, setInputValue] = props.input?.value ? props.input.value : useState20("");
|
|
14940
15013
|
const paddingless = props.paddingless || false;
|
|
14941
15014
|
const borderless = props.borderless || false;
|
|
14942
15015
|
const maxTags = props.maxTags || Number.POSITIVE_INFINITY;
|
|
@@ -15004,7 +15077,7 @@ var Tags_default = Tags;
|
|
|
15004
15077
|
|
|
15005
15078
|
// src/components/Input/index.tsx
|
|
15006
15079
|
import { jsx as jsx334 } from "react/jsx-runtime";
|
|
15007
|
-
var Component3 =
|
|
15080
|
+
var Component3 = React36.forwardRef(
|
|
15008
15081
|
(props, ref) => {
|
|
15009
15082
|
switch (props.type) {
|
|
15010
15083
|
case "date": {
|
|
@@ -15148,9 +15221,9 @@ var AppliedFiltersMenu = (props) => {
|
|
|
15148
15221
|
close,
|
|
15149
15222
|
appliedFilters: [appliedFilters, setAppliedFilters]
|
|
15150
15223
|
} = props;
|
|
15151
|
-
const [search, setSearch] =
|
|
15152
|
-
const [searched, setSearched] =
|
|
15153
|
-
|
|
15224
|
+
const [search, setSearch] = useState21("");
|
|
15225
|
+
const [searched, setSearched] = useState21("");
|
|
15226
|
+
useEffect16(() => {
|
|
15154
15227
|
setSearch("");
|
|
15155
15228
|
setSearched("");
|
|
15156
15229
|
}, [open]);
|
|
@@ -15273,13 +15346,13 @@ var AppliedFilters = Object.assign(
|
|
|
15273
15346
|
var AppliedFilters_default = AppliedFilters;
|
|
15274
15347
|
|
|
15275
15348
|
// src/components/Filters/Filters/components/Menu/index.tsx
|
|
15276
|
-
import { useEffect as
|
|
15349
|
+
import { useEffect as useEffect19, useState as useState24 } from "react";
|
|
15277
15350
|
|
|
15278
15351
|
// src/components/Filters/Filters/components/Submenu/index.tsx
|
|
15279
|
-
import
|
|
15352
|
+
import React39, { useCallback as useCallback5, useEffect as useEffect18, useState as useState23 } from "react";
|
|
15280
15353
|
|
|
15281
15354
|
// src/components/Filters/Filters/components/Submenu/components/Header/index.tsx
|
|
15282
|
-
import { useEffect as
|
|
15355
|
+
import { useEffect as useEffect17, useState as useState22 } from "react";
|
|
15283
15356
|
|
|
15284
15357
|
// src/components/Filters/Filters/components/Submenu/components/Header/styles.ts
|
|
15285
15358
|
import styled48 from "styled-components";
|
|
@@ -15313,12 +15386,12 @@ var Header5 = (props) => {
|
|
|
15313
15386
|
allowEmptySearch,
|
|
15314
15387
|
withSearch
|
|
15315
15388
|
} = props;
|
|
15316
|
-
const [search, setSearch] =
|
|
15389
|
+
const [search, setSearch] = useState22("");
|
|
15317
15390
|
const setSearched = allowEmptySearch ? _setSearched : (value) => {
|
|
15318
15391
|
if (value === "") return;
|
|
15319
15392
|
_setSearched(value);
|
|
15320
15393
|
};
|
|
15321
|
-
|
|
15394
|
+
useEffect17(() => {
|
|
15322
15395
|
setSearch(searched);
|
|
15323
15396
|
}, [searched]);
|
|
15324
15397
|
const onSubmit = () => {
|
|
@@ -15430,13 +15503,13 @@ var getInstance = (props) => {
|
|
|
15430
15503
|
var Submenu = (props) => {
|
|
15431
15504
|
const { item, close, setAppliedFilters, closeParent } = props;
|
|
15432
15505
|
const { open, isDynamic, itemSpacing, label, allowEmptySearch, getOptions: getOptions3 } = getInstance(props);
|
|
15433
|
-
const [options, setOptions] =
|
|
15434
|
-
const [page, setPage] =
|
|
15435
|
-
const [search, _setSearch] =
|
|
15436
|
-
const [lastPage, setLastPage] =
|
|
15437
|
-
const [loading, setLoading] =
|
|
15438
|
-
const [, setFirstRender] =
|
|
15439
|
-
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 () => {
|
|
15440
15513
|
const { options: newOptions, lastPage: lastPage2 } = await getOptions3(search, page);
|
|
15441
15514
|
setLastPage(lastPage2);
|
|
15442
15515
|
setOptions([...newOptions]);
|
|
@@ -15451,12 +15524,12 @@ var Submenu = (props) => {
|
|
|
15451
15524
|
onSearch();
|
|
15452
15525
|
}
|
|
15453
15526
|
};
|
|
15454
|
-
|
|
15527
|
+
useEffect18(() => {
|
|
15455
15528
|
setOptions([]);
|
|
15456
15529
|
setSearch("", false);
|
|
15457
15530
|
setFirstRender(true);
|
|
15458
15531
|
}, [item]);
|
|
15459
|
-
|
|
15532
|
+
useEffect18(() => {
|
|
15460
15533
|
setFirstRender((firstRender) => {
|
|
15461
15534
|
if (!item || isDynamic && firstRender) {
|
|
15462
15535
|
setLoading(false);
|
|
@@ -15537,9 +15610,9 @@ var Submenu = (props) => {
|
|
|
15537
15610
|
loading,
|
|
15538
15611
|
emptyContent: isDynamic && options.length === 0 ? /* @__PURE__ */ jsx338(EmptyMessage, { children: (() => {
|
|
15539
15612
|
if (search !== "") {
|
|
15540
|
-
return /* @__PURE__ */ jsx338(
|
|
15613
|
+
return /* @__PURE__ */ jsx338(React39.Fragment, { children: "Nenhum resultado foi encontrado" });
|
|
15541
15614
|
}
|
|
15542
|
-
return /* @__PURE__ */ jsxs170(
|
|
15615
|
+
return /* @__PURE__ */ jsxs170(React39.Fragment, { children: [
|
|
15543
15616
|
"Utilize a busca para pesquisar por ",
|
|
15544
15617
|
/* @__PURE__ */ jsx338("br", {}),
|
|
15545
15618
|
label.text
|
|
@@ -15560,7 +15633,7 @@ var Submenu_default = Submenu;
|
|
|
15560
15633
|
import { jsx as jsx339 } from "react/jsx-runtime";
|
|
15561
15634
|
var FiltersMenu = (props) => {
|
|
15562
15635
|
const { open, close } = props;
|
|
15563
|
-
const [active, setActive] =
|
|
15636
|
+
const [active, setActive] = useState24(-1);
|
|
15564
15637
|
const items = props.items.map((item) => {
|
|
15565
15638
|
return {
|
|
15566
15639
|
label: typeof item.label === "string" ? item.label : item.label.element,
|
|
@@ -15574,7 +15647,7 @@ var FiltersMenu = (props) => {
|
|
|
15574
15647
|
};
|
|
15575
15648
|
});
|
|
15576
15649
|
const selected = active >= 0 && active < props.items.length ? props.items[active] : void 0;
|
|
15577
|
-
|
|
15650
|
+
useEffect19(() => {
|
|
15578
15651
|
if (open) return;
|
|
15579
15652
|
setActive(-1);
|
|
15580
15653
|
}, [open]);
|
|
@@ -15650,14 +15723,14 @@ var Filters = Object.assign(
|
|
|
15650
15723
|
var Filters_default = Filters;
|
|
15651
15724
|
|
|
15652
15725
|
// src/components/Grid/components/Col/index.tsx
|
|
15653
|
-
import
|
|
15726
|
+
import React42 from "react";
|
|
15654
15727
|
|
|
15655
15728
|
// src/components/Grid/components/Row/context.ts
|
|
15656
|
-
import
|
|
15657
|
-
var Provider5 =
|
|
15729
|
+
import React41 from "react";
|
|
15730
|
+
var Provider5 = React41.createContext({
|
|
15658
15731
|
cols: {}
|
|
15659
15732
|
});
|
|
15660
|
-
var useContext4 = () =>
|
|
15733
|
+
var useContext4 = () => React41.useContext(Provider5);
|
|
15661
15734
|
var context_default4 = Provider5;
|
|
15662
15735
|
|
|
15663
15736
|
// src/components/Grid/components/Col/styles.ts
|
|
@@ -15830,7 +15903,7 @@ var Col = styled50.div`
|
|
|
15830
15903
|
|
|
15831
15904
|
// src/components/Grid/components/Col/index.tsx
|
|
15832
15905
|
import { jsx as jsx341 } from "react/jsx-runtime";
|
|
15833
|
-
var Col2 =
|
|
15906
|
+
var Col2 = React42.forwardRef((props, ref) => {
|
|
15834
15907
|
const context = useContext4();
|
|
15835
15908
|
const colProps = { ...context.cols, ...props };
|
|
15836
15909
|
const htmlProps = filterObject(colProps, [
|
|
@@ -15867,15 +15940,15 @@ Col2.displayName = "Col";
|
|
|
15867
15940
|
var Col_default = Col2;
|
|
15868
15941
|
|
|
15869
15942
|
// src/components/Grid/components/Grid/index.tsx
|
|
15870
|
-
import
|
|
15943
|
+
import React44 from "react";
|
|
15871
15944
|
|
|
15872
15945
|
// src/components/Grid/components/Grid/context.ts
|
|
15873
|
-
import
|
|
15874
|
-
var Provider6 =
|
|
15946
|
+
import React43 from "react";
|
|
15947
|
+
var Provider6 = React43.createContext({
|
|
15875
15948
|
rows: {},
|
|
15876
15949
|
cols: {}
|
|
15877
15950
|
});
|
|
15878
|
-
var useContext5 = () =>
|
|
15951
|
+
var useContext5 = () => React43.useContext(Provider6);
|
|
15879
15952
|
var context_default5 = Provider6;
|
|
15880
15953
|
|
|
15881
15954
|
// src/components/Grid/components/Grid/styles.ts
|
|
@@ -15908,7 +15981,7 @@ var Grid = styled51.div`
|
|
|
15908
15981
|
|
|
15909
15982
|
// src/components/Grid/components/Grid/index.tsx
|
|
15910
15983
|
import { jsx as jsx342 } from "react/jsx-runtime";
|
|
15911
|
-
var Grid2 =
|
|
15984
|
+
var Grid2 = React44.forwardRef((props, ref) => {
|
|
15912
15985
|
const cols = props.cols || {};
|
|
15913
15986
|
const rows = props.rows || {};
|
|
15914
15987
|
const gridProps = filterObject(props, [
|
|
@@ -15931,7 +16004,7 @@ Grid2.displayName = "Grid";
|
|
|
15931
16004
|
var Grid_default2 = Grid2;
|
|
15932
16005
|
|
|
15933
16006
|
// src/components/Grid/components/Row/index.tsx
|
|
15934
|
-
import
|
|
16007
|
+
import React45 from "react";
|
|
15935
16008
|
|
|
15936
16009
|
// src/components/Grid/components/Row/styles.ts
|
|
15937
16010
|
import styled52, { css as css37 } from "styled-components";
|
|
@@ -16058,7 +16131,7 @@ var Row = styled52.div`
|
|
|
16058
16131
|
|
|
16059
16132
|
// src/components/Grid/components/Row/index.tsx
|
|
16060
16133
|
import { jsx as jsx343 } from "react/jsx-runtime";
|
|
16061
|
-
var Row2 =
|
|
16134
|
+
var Row2 = React45.forwardRef((props, ref) => {
|
|
16062
16135
|
const context = useContext5();
|
|
16063
16136
|
const cols = { ...context.cols, ...props.cols || {} };
|
|
16064
16137
|
const rowProps = { ...props, ...context.rows };
|
|
@@ -16102,15 +16175,15 @@ var Grid3 = Object.assign(Grid_default2, {
|
|
|
16102
16175
|
var Grid_default3 = Grid3;
|
|
16103
16176
|
|
|
16104
16177
|
// src/components/Modal/component.tsx
|
|
16105
|
-
import { useEffect as
|
|
16178
|
+
import { useEffect as useEffect21 } from "react";
|
|
16106
16179
|
|
|
16107
16180
|
// src/addons/Portal/index.ts
|
|
16108
|
-
import { useEffect as
|
|
16181
|
+
import { useEffect as useEffect20 } from "react";
|
|
16109
16182
|
import { createPortal } from "react-dom";
|
|
16110
16183
|
var Portal = (props) => {
|
|
16111
16184
|
const { id, opened, children } = props;
|
|
16112
16185
|
const portalRoot = document.createElement("div");
|
|
16113
|
-
|
|
16186
|
+
useEffect20(() => {
|
|
16114
16187
|
if (opened) {
|
|
16115
16188
|
portalRoot.id = id + "-root";
|
|
16116
16189
|
document.body.appendChild(portalRoot);
|
|
@@ -16203,7 +16276,7 @@ var Container14 = styled53.div`
|
|
|
16203
16276
|
|
|
16204
16277
|
${({
|
|
16205
16278
|
theme: theme4,
|
|
16206
|
-
$size:
|
|
16279
|
+
$size: size4,
|
|
16207
16280
|
$customSize: customSize,
|
|
16208
16281
|
$color: color,
|
|
16209
16282
|
$inverted: inverted
|
|
@@ -16211,9 +16284,9 @@ var Container14 = styled53.div`
|
|
|
16211
16284
|
background-color: ${theme4.colors.white};
|
|
16212
16285
|
box-shadow: 0 0 21px 7px ${theme4.getColor("black", 15)};
|
|
16213
16286
|
|
|
16214
|
-
width: ${
|
|
16287
|
+
width: ${size4 === "custom" && customSize ? customSize.width || "auto" : widths[size4]};
|
|
16215
16288
|
|
|
16216
|
-
height: ${
|
|
16289
|
+
height: ${size4 === "custom" && customSize ? customSize.height || "auto" : heights[size4]};
|
|
16217
16290
|
|
|
16218
16291
|
${Header6} {
|
|
16219
16292
|
background-color: ${inverted ? theme4.isDarkColor(color) : theme4.colors[color]};
|
|
@@ -16228,7 +16301,7 @@ var Modal = (props) => {
|
|
|
16228
16301
|
const {
|
|
16229
16302
|
openState,
|
|
16230
16303
|
title,
|
|
16231
|
-
size:
|
|
16304
|
+
size: size4,
|
|
16232
16305
|
color,
|
|
16233
16306
|
inverted,
|
|
16234
16307
|
children,
|
|
@@ -16246,7 +16319,7 @@ var Modal = (props) => {
|
|
|
16246
16319
|
setOpen(false);
|
|
16247
16320
|
}
|
|
16248
16321
|
};
|
|
16249
|
-
|
|
16322
|
+
useEffect21(() => {
|
|
16250
16323
|
const onEscDown = (event) => {
|
|
16251
16324
|
if (closeOnEsc && event.key === "Escape") {
|
|
16252
16325
|
event.preventDefault();
|
|
@@ -16258,11 +16331,11 @@ var Modal = (props) => {
|
|
|
16258
16331
|
document.removeEventListener("keydown", onEscDown);
|
|
16259
16332
|
};
|
|
16260
16333
|
}, []);
|
|
16261
|
-
const _size =
|
|
16334
|
+
const _size = size4 ? heights[size4] : heights.default;
|
|
16262
16335
|
return /* @__PURE__ */ jsx344(Portal_default, { opened: open || false, id: "modal", children: /* @__PURE__ */ jsx344(Background, { onClick: onClickOutside, children: /* @__PURE__ */ jsxs171(
|
|
16263
16336
|
Container14,
|
|
16264
16337
|
{
|
|
16265
|
-
$size:
|
|
16338
|
+
$size: size4 || "small",
|
|
16266
16339
|
$color: color || "blue",
|
|
16267
16340
|
$inverted: inverted,
|
|
16268
16341
|
$customSize: customSize,
|
|
@@ -16448,7 +16521,7 @@ var Modal2 = Object.assign(component_default, {
|
|
|
16448
16521
|
var Modal_default = Modal2;
|
|
16449
16522
|
|
|
16450
16523
|
// src/components/Placeholder/components/Template1/index.tsx
|
|
16451
|
-
import
|
|
16524
|
+
import React47 from "react";
|
|
16452
16525
|
|
|
16453
16526
|
// src/components/Placeholder/components/Template1/styles.ts
|
|
16454
16527
|
import styled57, { css as css39 } from "styled-components";
|
|
@@ -16484,19 +16557,19 @@ var HeaderLine = styled57.div`
|
|
|
16484
16557
|
margin-top: 14px;
|
|
16485
16558
|
}
|
|
16486
16559
|
|
|
16487
|
-
${({ $size:
|
|
16560
|
+
${({ $size: size4 }) => size4 === "mini" && css39`
|
|
16488
16561
|
width: 15%;
|
|
16489
16562
|
`}
|
|
16490
16563
|
|
|
16491
|
-
${({ $size:
|
|
16564
|
+
${({ $size: size4 }) => size4 === "small" && css39`
|
|
16492
16565
|
width: 25%;
|
|
16493
16566
|
`}
|
|
16494
16567
|
|
|
16495
|
-
${({ $size:
|
|
16568
|
+
${({ $size: size4 }) => size4 === "medium" && css39`
|
|
16496
16569
|
width: 45%;
|
|
16497
16570
|
`}
|
|
16498
16571
|
|
|
16499
|
-
${({ $size:
|
|
16572
|
+
${({ $size: size4 }) => size4 === "large" && css39`
|
|
16500
16573
|
width: 75%;
|
|
16501
16574
|
`}
|
|
16502
16575
|
`;
|
|
@@ -16508,7 +16581,7 @@ var MainLine = styled57(HeaderLine)`
|
|
|
16508
16581
|
// src/components/Placeholder/components/Template1/index.tsx
|
|
16509
16582
|
import { jsx as jsx348, jsxs as jsxs172 } from "react/jsx-runtime";
|
|
16510
16583
|
var Template1 = (props) => {
|
|
16511
|
-
if (!props.loading) return /* @__PURE__ */ jsx348(
|
|
16584
|
+
if (!props.loading) return /* @__PURE__ */ jsx348(React47.Fragment, {});
|
|
16512
16585
|
return /* @__PURE__ */ jsxs172(Container15, { children: [
|
|
16513
16586
|
/* @__PURE__ */ jsxs172(Header7, { children: [
|
|
16514
16587
|
/* @__PURE__ */ jsx348(HeaderImage, {}),
|
|
@@ -16529,7 +16602,7 @@ var Template1 = (props) => {
|
|
|
16529
16602
|
var Template1_default = Template1;
|
|
16530
16603
|
|
|
16531
16604
|
// src/components/Placeholder/components/Template2/index.tsx
|
|
16532
|
-
import
|
|
16605
|
+
import React48 from "react";
|
|
16533
16606
|
|
|
16534
16607
|
// src/components/Placeholder/components/Template2/styles.ts
|
|
16535
16608
|
import styled59 from "styled-components";
|
|
@@ -16545,19 +16618,19 @@ var HeaderLine2 = styled58.div`
|
|
|
16545
16618
|
margin-top: 14px;
|
|
16546
16619
|
}
|
|
16547
16620
|
|
|
16548
|
-
${({ $size:
|
|
16621
|
+
${({ $size: size4 }) => size4 === "mini" && css40`
|
|
16549
16622
|
width: 15%;
|
|
16550
16623
|
`}
|
|
16551
16624
|
|
|
16552
|
-
${({ $size:
|
|
16625
|
+
${({ $size: size4 }) => size4 === "small" && css40`
|
|
16553
16626
|
width: 25%;
|
|
16554
16627
|
`}
|
|
16555
16628
|
|
|
16556
|
-
${({ $size:
|
|
16629
|
+
${({ $size: size4 }) => size4 === "medium" && css40`
|
|
16557
16630
|
width: 45%;
|
|
16558
16631
|
`}
|
|
16559
16632
|
|
|
16560
|
-
${({ $size:
|
|
16633
|
+
${({ $size: size4 }) => size4 === "large" && css40`
|
|
16561
16634
|
width: 75%;
|
|
16562
16635
|
`}
|
|
16563
16636
|
`;
|
|
@@ -16599,7 +16672,7 @@ var HeaderLine3 = styled59(HeaderLine2)``;
|
|
|
16599
16672
|
// src/components/Placeholder/components/Template2/index.tsx
|
|
16600
16673
|
import { jsx as jsx349, jsxs as jsxs173 } from "react/jsx-runtime";
|
|
16601
16674
|
var Template2 = (props) => {
|
|
16602
|
-
if (!props.loading) return /* @__PURE__ */ jsx349(
|
|
16675
|
+
if (!props.loading) return /* @__PURE__ */ jsx349(React48.Fragment, {});
|
|
16603
16676
|
return /* @__PURE__ */ jsxs173(Template2Container, { children: [
|
|
16604
16677
|
/* @__PURE__ */ jsxs173(Header8, { children: [
|
|
16605
16678
|
/* @__PURE__ */ jsx349(HeaderImage2, {}),
|
|
@@ -16617,7 +16690,7 @@ var Template2 = (props) => {
|
|
|
16617
16690
|
var Template2_default = Template2;
|
|
16618
16691
|
|
|
16619
16692
|
// src/components/Placeholder/components/Template3/index.tsx
|
|
16620
|
-
import
|
|
16693
|
+
import React49 from "react";
|
|
16621
16694
|
|
|
16622
16695
|
// src/components/Placeholder/components/Template3/styles.ts
|
|
16623
16696
|
import styled60 from "styled-components";
|
|
@@ -16636,7 +16709,7 @@ var Template3Line = styled60(HeaderLine2)`
|
|
|
16636
16709
|
// src/components/Placeholder/components/Template3/index.tsx
|
|
16637
16710
|
import { jsx as jsx350, jsxs as jsxs174 } from "react/jsx-runtime";
|
|
16638
16711
|
var Template3 = (props) => {
|
|
16639
|
-
if (!props.loading) return /* @__PURE__ */ jsx350(
|
|
16712
|
+
if (!props.loading) return /* @__PURE__ */ jsx350(React49.Fragment, {});
|
|
16640
16713
|
return /* @__PURE__ */ jsxs174(Template3Container, { children: [
|
|
16641
16714
|
/* @__PURE__ */ jsx350(Template3Line, { $size: "large", $height: "7px", $color: "#DADADA" }),
|
|
16642
16715
|
/* @__PURE__ */ jsx350(Template3Line, { $size: "small", $height: "7px", $color: "#DADADA" }),
|
|
@@ -16648,7 +16721,7 @@ var Template3 = (props) => {
|
|
|
16648
16721
|
var Template3_default = Template3;
|
|
16649
16722
|
|
|
16650
16723
|
// src/components/Placeholder/components/Template4/index.tsx
|
|
16651
|
-
import
|
|
16724
|
+
import React50 from "react";
|
|
16652
16725
|
|
|
16653
16726
|
// src/components/Placeholder/components/Template4/styles.ts
|
|
16654
16727
|
import styled61, { css as css41 } from "styled-components";
|
|
@@ -16667,19 +16740,19 @@ var HeaderLine4 = styled61.div`
|
|
|
16667
16740
|
margin-top: 14px;
|
|
16668
16741
|
}
|
|
16669
16742
|
|
|
16670
|
-
${({ $size:
|
|
16743
|
+
${({ $size: size4 }) => size4 === "mini" && css41`
|
|
16671
16744
|
width: 15%;
|
|
16672
16745
|
`}
|
|
16673
16746
|
|
|
16674
|
-
${({ $size:
|
|
16747
|
+
${({ $size: size4 }) => size4 === "small" && css41`
|
|
16675
16748
|
width: 25%;
|
|
16676
16749
|
`}
|
|
16677
16750
|
|
|
16678
|
-
${({ $size:
|
|
16751
|
+
${({ $size: size4 }) => size4 === "medium" && css41`
|
|
16679
16752
|
width: 45%;
|
|
16680
16753
|
`}
|
|
16681
16754
|
|
|
16682
|
-
${({ $size:
|
|
16755
|
+
${({ $size: size4 }) => size4 === "large" && css41`
|
|
16683
16756
|
width: 75%;
|
|
16684
16757
|
`}
|
|
16685
16758
|
`;
|
|
@@ -16696,7 +16769,7 @@ var CustomLine = styled61(HeaderLine4)`
|
|
|
16696
16769
|
// src/components/Placeholder/components/Template4/index.tsx
|
|
16697
16770
|
import { jsx as jsx351, jsxs as jsxs175 } from "react/jsx-runtime";
|
|
16698
16771
|
var Template4 = (props) => {
|
|
16699
|
-
if (!props.loading) return /* @__PURE__ */ jsx351(
|
|
16772
|
+
if (!props.loading) return /* @__PURE__ */ jsx351(React50.Fragment, {});
|
|
16700
16773
|
return /* @__PURE__ */ jsxs175(Template4Container, { children: [
|
|
16701
16774
|
/* @__PURE__ */ jsx351(
|
|
16702
16775
|
CustomLine,
|
|
@@ -16775,7 +16848,7 @@ var Template4 = (props) => {
|
|
|
16775
16848
|
var Template4_default = Template4;
|
|
16776
16849
|
|
|
16777
16850
|
// src/components/Placeholder/components/Template5/index.tsx
|
|
16778
|
-
import
|
|
16851
|
+
import React51 from "react";
|
|
16779
16852
|
|
|
16780
16853
|
// src/components/Placeholder/components/Template5/styles.ts
|
|
16781
16854
|
import styled62, { css as css42 } from "styled-components";
|
|
@@ -16805,19 +16878,19 @@ var HeaderLine5 = styled62.div`
|
|
|
16805
16878
|
margin-top: 14px;
|
|
16806
16879
|
}
|
|
16807
16880
|
|
|
16808
|
-
${({ $size:
|
|
16881
|
+
${({ $size: size4 }) => size4 === "mini" && css42`
|
|
16809
16882
|
width: 15%;
|
|
16810
16883
|
`}
|
|
16811
16884
|
|
|
16812
|
-
${({ $size:
|
|
16885
|
+
${({ $size: size4 }) => size4 === "small" && css42`
|
|
16813
16886
|
width: 25%;
|
|
16814
16887
|
`}
|
|
16815
16888
|
|
|
16816
|
-
${({ $size:
|
|
16889
|
+
${({ $size: size4 }) => size4 === "medium" && css42`
|
|
16817
16890
|
width: 45%;
|
|
16818
16891
|
`}
|
|
16819
16892
|
|
|
16820
|
-
${({ $size:
|
|
16893
|
+
${({ $size: size4 }) => size4 === "large" && css42`
|
|
16821
16894
|
width: 75%;
|
|
16822
16895
|
`}
|
|
16823
16896
|
`;
|
|
@@ -16834,7 +16907,7 @@ var MainContent3 = styled62.div`
|
|
|
16834
16907
|
// src/components/Placeholder/components/Template5/index.tsx
|
|
16835
16908
|
import { jsx as jsx352, jsxs as jsxs176 } from "react/jsx-runtime";
|
|
16836
16909
|
var Template5 = (props) => {
|
|
16837
|
-
if (!props.loading) return /* @__PURE__ */ jsx352(
|
|
16910
|
+
if (!props.loading) return /* @__PURE__ */ jsx352(React51.Fragment, {});
|
|
16838
16911
|
return /* @__PURE__ */ jsxs176(Container19, { children: [
|
|
16839
16912
|
/* @__PURE__ */ jsx352(Circle, {}),
|
|
16840
16913
|
/* @__PURE__ */ jsxs176(MainContent3, { children: [
|
|
@@ -16880,7 +16953,7 @@ var Template5 = (props) => {
|
|
|
16880
16953
|
var Template5_default = Template5;
|
|
16881
16954
|
|
|
16882
16955
|
// src/components/Placeholder/components/Template6/index.tsx
|
|
16883
|
-
import
|
|
16956
|
+
import React52 from "react";
|
|
16884
16957
|
|
|
16885
16958
|
// src/components/Placeholder/components/Template6/styles.ts
|
|
16886
16959
|
import styled63, { css as css43 } from "styled-components";
|
|
@@ -16916,15 +16989,15 @@ var HeaderLine6 = styled63.div`
|
|
|
16916
16989
|
width: 15%;
|
|
16917
16990
|
`}
|
|
16918
16991
|
|
|
16919
|
-
${({ $size:
|
|
16992
|
+
${({ $size: size4 }) => size4 === "small" && css43`
|
|
16920
16993
|
width: 25%;
|
|
16921
16994
|
`}
|
|
16922
16995
|
|
|
16923
|
-
${({ $size:
|
|
16996
|
+
${({ $size: size4 }) => size4 === "medium" && css43`
|
|
16924
16997
|
width: 45%;
|
|
16925
16998
|
`}
|
|
16926
16999
|
|
|
16927
|
-
${({ $size:
|
|
17000
|
+
${({ $size: size4 }) => size4 === "large" && css43`
|
|
16928
17001
|
width: 75%;
|
|
16929
17002
|
`}
|
|
16930
17003
|
`;
|
|
@@ -16938,7 +17011,7 @@ var CustomLine3 = styled63(HeaderLine6)`
|
|
|
16938
17011
|
// src/components/Placeholder/components/Template6/index.tsx
|
|
16939
17012
|
import { jsx as jsx353, jsxs as jsxs177 } from "react/jsx-runtime";
|
|
16940
17013
|
var Template6 = (props) => {
|
|
16941
|
-
if (!props.loading) return /* @__PURE__ */ jsx353(
|
|
17014
|
+
if (!props.loading) return /* @__PURE__ */ jsx353(React52.Fragment, {});
|
|
16942
17015
|
return /* @__PURE__ */ jsx353(Container20, { children: /* @__PURE__ */ jsxs177(Header9, { children: [
|
|
16943
17016
|
/* @__PURE__ */ jsx353(
|
|
16944
17017
|
CustomLine3,
|
|
@@ -16972,7 +17045,7 @@ var Template6 = (props) => {
|
|
|
16972
17045
|
var Template6_default = Template6;
|
|
16973
17046
|
|
|
16974
17047
|
// src/components/Placeholder/components/Template7/index.tsx
|
|
16975
|
-
import
|
|
17048
|
+
import React53 from "react";
|
|
16976
17049
|
|
|
16977
17050
|
// src/components/Placeholder/components/Template7/styles.ts
|
|
16978
17051
|
import styled64, { css as css44 } from "styled-components";
|
|
@@ -17000,19 +17073,19 @@ var HeaderLine7 = styled64.div`
|
|
|
17000
17073
|
margin-top: 14px;
|
|
17001
17074
|
}
|
|
17002
17075
|
|
|
17003
|
-
${({ $size:
|
|
17076
|
+
${({ $size: size4 }) => size4 === "mini" && css44`
|
|
17004
17077
|
width: 15%;
|
|
17005
17078
|
`}
|
|
17006
17079
|
|
|
17007
|
-
${({ $size:
|
|
17080
|
+
${({ $size: size4 }) => size4 === "small" && css44`
|
|
17008
17081
|
width: 25%;
|
|
17009
17082
|
`}
|
|
17010
17083
|
|
|
17011
|
-
${({ $size:
|
|
17084
|
+
${({ $size: size4 }) => size4 === "medium" && css44`
|
|
17012
17085
|
width: 45%;
|
|
17013
17086
|
`}
|
|
17014
17087
|
|
|
17015
|
-
${({ $size:
|
|
17088
|
+
${({ $size: size4 }) => size4 === "large" && css44`
|
|
17016
17089
|
width: 75%;
|
|
17017
17090
|
`}
|
|
17018
17091
|
`;
|
|
@@ -17040,7 +17113,7 @@ var Circle2 = styled64.div`
|
|
|
17040
17113
|
// src/components/Placeholder/components/Template7/index.tsx
|
|
17041
17114
|
import { jsx as jsx354, jsxs as jsxs178 } from "react/jsx-runtime";
|
|
17042
17115
|
var Template7 = (props) => {
|
|
17043
|
-
if (!props.loading) return /* @__PURE__ */ jsx354(
|
|
17116
|
+
if (!props.loading) return /* @__PURE__ */ jsx354(React53.Fragment, {});
|
|
17044
17117
|
return /* @__PURE__ */ jsxs178(Container21, { children: [
|
|
17045
17118
|
/* @__PURE__ */ jsx354(Header10, { children: /* @__PURE__ */ jsx354(
|
|
17046
17119
|
CustomLine4,
|
|
@@ -17063,7 +17136,7 @@ var Template7 = (props) => {
|
|
|
17063
17136
|
var Template7_default = Template7;
|
|
17064
17137
|
|
|
17065
17138
|
// src/components/Placeholder/components/Template8/index.tsx
|
|
17066
|
-
import
|
|
17139
|
+
import React54 from "react";
|
|
17067
17140
|
|
|
17068
17141
|
// src/components/Placeholder/components/Template8/styles.ts
|
|
17069
17142
|
import styled65, { css as css45 } from "styled-components";
|
|
@@ -17091,19 +17164,19 @@ var HeaderLine8 = styled65.div`
|
|
|
17091
17164
|
margin-top: 14px;
|
|
17092
17165
|
}
|
|
17093
17166
|
|
|
17094
|
-
${({ $size:
|
|
17167
|
+
${({ $size: size4 }) => size4 === "mini" && css45`
|
|
17095
17168
|
width: 15%;
|
|
17096
17169
|
`}
|
|
17097
17170
|
|
|
17098
|
-
${({ $size:
|
|
17171
|
+
${({ $size: size4 }) => size4 === "small" && css45`
|
|
17099
17172
|
width: 25%;
|
|
17100
17173
|
`}
|
|
17101
17174
|
|
|
17102
|
-
${({ $size:
|
|
17175
|
+
${({ $size: size4 }) => size4 === "medium" && css45`
|
|
17103
17176
|
width: 45%;
|
|
17104
17177
|
`}
|
|
17105
17178
|
|
|
17106
|
-
${({ $size:
|
|
17179
|
+
${({ $size: size4 }) => size4 === "large" && css45`
|
|
17107
17180
|
width: 75%;
|
|
17108
17181
|
`}
|
|
17109
17182
|
`;
|
|
@@ -17124,7 +17197,7 @@ var Main4 = styled65.div`
|
|
|
17124
17197
|
// src/components/Placeholder/components/Template8/index.tsx
|
|
17125
17198
|
import { jsx as jsx355, jsxs as jsxs179 } from "react/jsx-runtime";
|
|
17126
17199
|
var Template8 = (props) => {
|
|
17127
|
-
if (!props.loading) return /* @__PURE__ */ jsx355(
|
|
17200
|
+
if (!props.loading) return /* @__PURE__ */ jsx355(React54.Fragment, {});
|
|
17128
17201
|
return /* @__PURE__ */ jsxs179(Container22, { children: [
|
|
17129
17202
|
/* @__PURE__ */ jsx355(Header11, { children: /* @__PURE__ */ jsx355(
|
|
17130
17203
|
CustomLine5,
|
|
@@ -17160,7 +17233,7 @@ var Template8 = (props) => {
|
|
|
17160
17233
|
var Template8_default = Template8;
|
|
17161
17234
|
|
|
17162
17235
|
// src/components/Placeholder/components/Template9/index.tsx
|
|
17163
|
-
import
|
|
17236
|
+
import React55 from "react";
|
|
17164
17237
|
|
|
17165
17238
|
// src/components/Placeholder/components/Template9/styles.ts
|
|
17166
17239
|
import styled66, { css as css46 } from "styled-components";
|
|
@@ -17188,19 +17261,19 @@ var HeaderLine9 = styled66.div`
|
|
|
17188
17261
|
margin-top: 7px;
|
|
17189
17262
|
}
|
|
17190
17263
|
|
|
17191
|
-
${({ $size:
|
|
17264
|
+
${({ $size: size4 }) => size4 === "mini" && css46`
|
|
17192
17265
|
width: 15%;
|
|
17193
17266
|
`}
|
|
17194
17267
|
|
|
17195
|
-
${({ $size:
|
|
17268
|
+
${({ $size: size4 }) => size4 === "small" && css46`
|
|
17196
17269
|
width: 25%;
|
|
17197
17270
|
`}
|
|
17198
17271
|
|
|
17199
|
-
${({ $size:
|
|
17272
|
+
${({ $size: size4 }) => size4 === "medium" && css46`
|
|
17200
17273
|
width: 45%;
|
|
17201
17274
|
`}
|
|
17202
17275
|
|
|
17203
|
-
${({ $size:
|
|
17276
|
+
${({ $size: size4 }) => size4 === "large" && css46`
|
|
17204
17277
|
width: 75%;
|
|
17205
17278
|
`}
|
|
17206
17279
|
`;
|
|
@@ -17228,7 +17301,7 @@ var Circle3 = styled66.div`
|
|
|
17228
17301
|
// src/components/Placeholder/components/Template9/index.tsx
|
|
17229
17302
|
import { jsx as jsx356, jsxs as jsxs180 } from "react/jsx-runtime";
|
|
17230
17303
|
var Template82 = (props) => {
|
|
17231
|
-
if (!props.loading) return /* @__PURE__ */ jsx356(
|
|
17304
|
+
if (!props.loading) return /* @__PURE__ */ jsx356(React55.Fragment, {});
|
|
17232
17305
|
return /* @__PURE__ */ jsxs180(Container23, { children: [
|
|
17233
17306
|
/* @__PURE__ */ jsxs180(Header12, { children: [
|
|
17234
17307
|
/* @__PURE__ */ jsx356(
|
|
@@ -17256,7 +17329,7 @@ var Template82 = (props) => {
|
|
|
17256
17329
|
var Template9_default = Template82;
|
|
17257
17330
|
|
|
17258
17331
|
// src/components/Placeholder/components/Template10/index.tsx
|
|
17259
|
-
import
|
|
17332
|
+
import React56 from "react";
|
|
17260
17333
|
|
|
17261
17334
|
// src/components/Placeholder/components/Template10/styles.ts
|
|
17262
17335
|
import styled67, { css as css47 } from "styled-components";
|
|
@@ -17284,19 +17357,19 @@ var HeaderLine10 = styled67.div`
|
|
|
17284
17357
|
margin-top: 7px;
|
|
17285
17358
|
}
|
|
17286
17359
|
|
|
17287
|
-
${({ $size:
|
|
17360
|
+
${({ $size: size4 }) => size4 === "mini" && css47`
|
|
17288
17361
|
width: 15%;
|
|
17289
17362
|
`}
|
|
17290
17363
|
|
|
17291
|
-
${({ $size:
|
|
17364
|
+
${({ $size: size4 }) => size4 === "small" && css47`
|
|
17292
17365
|
width: 25%;
|
|
17293
17366
|
`}
|
|
17294
17367
|
|
|
17295
|
-
${({ $size:
|
|
17368
|
+
${({ $size: size4 }) => size4 === "medium" && css47`
|
|
17296
17369
|
width: 45%;
|
|
17297
17370
|
`}
|
|
17298
17371
|
|
|
17299
|
-
${({ $size:
|
|
17372
|
+
${({ $size: size4 }) => size4 === "large" && css47`
|
|
17300
17373
|
width: 75%;
|
|
17301
17374
|
`}
|
|
17302
17375
|
`;
|
|
@@ -17328,7 +17401,7 @@ var Circle4 = styled67.div`
|
|
|
17328
17401
|
// src/components/Placeholder/components/Template10/index.tsx
|
|
17329
17402
|
import { jsx as jsx357, jsxs as jsxs181 } from "react/jsx-runtime";
|
|
17330
17403
|
var Template10 = (props) => {
|
|
17331
|
-
if (!props.loading) return /* @__PURE__ */ jsx357(
|
|
17404
|
+
if (!props.loading) return /* @__PURE__ */ jsx357(React56.Fragment, {});
|
|
17332
17405
|
return /* @__PURE__ */ jsxs181(Container24, { children: [
|
|
17333
17406
|
/* @__PURE__ */ jsxs181(Header13, { children: [
|
|
17334
17407
|
/* @__PURE__ */ jsx357(
|
|
@@ -17541,140 +17614,1961 @@ var ProgressBar = ({ type, value, ...props }) => {
|
|
|
17541
17614
|
};
|
|
17542
17615
|
var ProgressBar_default = ProgressBar;
|
|
17543
17616
|
|
|
17544
|
-
// src/components/
|
|
17545
|
-
import
|
|
17546
|
-
import
|
|
17547
|
-
|
|
17548
|
-
// src/components/Signature/styles.ts
|
|
17549
|
-
import styled69 from "styled-components";
|
|
17550
|
-
var Container26 = styled69.div`
|
|
17551
|
-
width: 100%;
|
|
17552
|
-
height: 100%;
|
|
17553
|
-
|
|
17554
|
-
display: flex;
|
|
17555
|
-
flex-direction: column;
|
|
17556
|
-
gap: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
17557
|
-
`;
|
|
17558
|
-
var CanvasContainer = styled69.div`
|
|
17559
|
-
position: relative;
|
|
17560
|
-
flex: 1;
|
|
17561
|
-
overflow: hidden;
|
|
17562
|
-
background-color: ${({ theme: theme4, $invalid: invalid }) => invalid ? theme4.getColor("warningRed", 5) : theme4.colors.white};
|
|
17563
|
-
|
|
17564
|
-
&[data-placeholder]:before {
|
|
17565
|
-
content: attr(data-placeholder);
|
|
17566
|
-
position: absolute;
|
|
17567
|
-
top: 50%;
|
|
17568
|
-
left: 50%;
|
|
17569
|
-
transform: translate(-50%, -50%);
|
|
17570
|
-
text-align: center;
|
|
17571
|
-
|
|
17572
|
-
color: ${({ theme: theme4, $invalid: invalid }) => theme4.colors[invalid ? "warningRed" : "darkBlue"]};
|
|
17573
|
-
|
|
17574
|
-
${({ theme: theme4 }) => theme4.useTypography("h1")}
|
|
17575
|
-
font-size: 59px;
|
|
17576
|
-
line-height: 71px;
|
|
17577
|
-
opacity: 0.1;
|
|
17578
|
-
z-index: 1;
|
|
17579
|
-
}
|
|
17580
|
-
|
|
17581
|
-
canvas {
|
|
17582
|
-
position: relative;
|
|
17583
|
-
display: block;
|
|
17584
|
-
width: 100%;
|
|
17585
|
-
height: 100%;
|
|
17586
|
-
box-sizing: border-box;
|
|
17587
|
-
border: 1px solid
|
|
17588
|
-
${({ theme: theme4, $invalid: invalid }) => theme4.colors[invalid ? "warningRed" : "lightGrey"]};
|
|
17589
|
-
border-radius: 4px;
|
|
17590
|
-
z-index: 2;
|
|
17591
|
-
}
|
|
17592
|
-
|
|
17593
|
-
/* icons container */
|
|
17594
|
-
> div:nth-child(1) {
|
|
17595
|
-
position: absolute;
|
|
17596
|
-
top: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
17597
|
-
right: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
17598
|
-
display: flex;
|
|
17599
|
-
gap: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
17600
|
-
z-index: 3;
|
|
17601
|
-
|
|
17602
|
-
> button {
|
|
17603
|
-
padding: 0;
|
|
17604
|
-
outline: none;
|
|
17605
|
-
border: none;
|
|
17606
|
-
background: none;
|
|
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";
|
|
17607
17620
|
|
|
17608
|
-
|
|
17609
|
-
|
|
17610
|
-
color: #4e4e4e;
|
|
17611
|
-
font-size: 20px;
|
|
17612
|
-
line-height: 20px;
|
|
17613
|
-
width: 20px;
|
|
17614
|
-
}
|
|
17621
|
+
// src/components/Select/hooks/useAsyncOptions/index.ts
|
|
17622
|
+
import { useCallback as useCallback6, useEffect as useEffect22, useMemo as useMemo4, useState as useState25 } from "react";
|
|
17615
17623
|
|
|
17616
|
-
|
|
17617
|
-
|
|
17618
|
-
|
|
17619
|
-
&:disabled {
|
|
17620
|
-
opacity: 0.5;
|
|
17621
|
-
}
|
|
17624
|
+
// src/components/Select/constants.ts
|
|
17625
|
+
var SEARCH_DEBOUNCE_MS = 500;
|
|
17626
|
+
var MENU_EXIT_MS = 250;
|
|
17622
17627
|
|
|
17623
|
-
|
|
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 }));
|
|
17624
17670
|
}
|
|
17625
|
-
}
|
|
17626
|
-
|
|
17627
|
-
|
|
17628
|
-
|
|
17629
|
-
|
|
17630
|
-
|
|
17631
|
-
|
|
17632
|
-
|
|
17633
|
-
|
|
17634
|
-
|
|
17635
|
-
|
|
17636
|
-
|
|
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
|
+
};
|
|
17637
17688
|
};
|
|
17638
|
-
var
|
|
17639
|
-
|
|
17640
|
-
|
|
17641
|
-
|
|
17642
|
-
|
|
17643
|
-
|
|
17644
|
-
|
|
17645
|
-
|
|
17646
|
-
|
|
17647
|
-
|
|
17648
|
-
|
|
17649
|
-
|
|
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
|
|
17650
17757
|
}) => {
|
|
17651
|
-
const [
|
|
17652
|
-
const
|
|
17653
|
-
|
|
17654
|
-
|
|
17655
|
-
|
|
17656
|
-
|
|
17657
|
-
|
|
17658
|
-
|
|
17659
|
-
|
|
17660
|
-
|
|
17661
|
-
|
|
17662
|
-
|
|
17663
|
-
|
|
17664
|
-
|
|
17665
|
-
|
|
17666
|
-
|
|
17667
|
-
|
|
17668
|
-
|
|
17669
|
-
|
|
17670
|
-
|
|
17671
|
-
|
|
17672
|
-
|
|
17673
|
-
|
|
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;
|
|
17777
|
+
}
|
|
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);
|
|
17674
17789
|
return;
|
|
17675
17790
|
}
|
|
17676
|
-
|
|
17677
|
-
|
|
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;
|
|
17797
|
+
}
|
|
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
|
+
};
|
|
17831
|
+
};
|
|
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
|
+
${({ theme: theme4 }) => theme4.useTypography("p")}
|
|
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
|
+
padding: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
18158
|
+
`;
|
|
18159
|
+
|
|
18160
|
+
// src/components/Popup/index.tsx
|
|
18161
|
+
import { jsx as jsx360, jsxs as jsxs183 } from "react/jsx-runtime";
|
|
18162
|
+
var mergeRefs = (...refs) => {
|
|
18163
|
+
return (node) => {
|
|
18164
|
+
refs.forEach((ref) => {
|
|
18165
|
+
if (!ref) return;
|
|
18166
|
+
if (typeof ref === "function") ref(node);
|
|
18167
|
+
else ref.current = node;
|
|
18168
|
+
});
|
|
18169
|
+
};
|
|
18170
|
+
};
|
|
18171
|
+
var PopupComponent = (props) => {
|
|
18172
|
+
const {
|
|
18173
|
+
content: Content5,
|
|
18174
|
+
renderTrigger,
|
|
18175
|
+
triggerProps,
|
|
18176
|
+
on = "hover",
|
|
18177
|
+
placement,
|
|
18178
|
+
offset: offsetValue = 8,
|
|
18179
|
+
shift: shiftValue = 8,
|
|
18180
|
+
background = "dark",
|
|
18181
|
+
closeOnClip = false,
|
|
18182
|
+
zIndex = 1e3
|
|
18183
|
+
} = props;
|
|
18184
|
+
const arrowStyle = props.arrow || (background === "dark" ? "pointed" : "flattened");
|
|
18185
|
+
const withArrow = arrowStyle !== "none";
|
|
18186
|
+
const [open, setOpen] = open_default(props);
|
|
18187
|
+
const arrowRef = useRef3(null);
|
|
18188
|
+
const fallbackPlacements = fallbackPlacements_default(props);
|
|
18189
|
+
const floating = useFloating2({
|
|
18190
|
+
open,
|
|
18191
|
+
onOpenChange: setOpen,
|
|
18192
|
+
placement,
|
|
18193
|
+
whileElementsMounted: autoUpdate2,
|
|
18194
|
+
middleware: [
|
|
18195
|
+
offset(offsetValue),
|
|
18196
|
+
flip2({ fallbackPlacements, padding: shiftValue }),
|
|
18197
|
+
shift({ padding: shiftValue }),
|
|
18198
|
+
...withArrow ? [arrow({ element: arrowRef })] : [],
|
|
18199
|
+
...closeOnClip ? [
|
|
18200
|
+
hide(),
|
|
18201
|
+
{
|
|
18202
|
+
name: "closeOnClip",
|
|
18203
|
+
fn(state) {
|
|
18204
|
+
if (state.middlewareData.hide?.referenceHidden) {
|
|
18205
|
+
setOpen(false);
|
|
18206
|
+
}
|
|
18207
|
+
return {};
|
|
18208
|
+
}
|
|
18209
|
+
}
|
|
18210
|
+
] : []
|
|
18211
|
+
]
|
|
18212
|
+
});
|
|
18213
|
+
const hover = useHover(floating.context, {
|
|
18214
|
+
move: false,
|
|
18215
|
+
enabled: on === "hover"
|
|
18216
|
+
});
|
|
18217
|
+
const click = useClick(floating.context, {
|
|
18218
|
+
enabled: on === "click"
|
|
18219
|
+
});
|
|
18220
|
+
const dismiss = useDismiss2(floating.context, {
|
|
18221
|
+
outsidePressEvent: "mousedown",
|
|
18222
|
+
escapeKey: true,
|
|
18223
|
+
enabled: on === "click"
|
|
18224
|
+
});
|
|
18225
|
+
const interactions = useInteractions2([hover, click, dismiss]);
|
|
18226
|
+
const referenceProps = useMemo9(() => {
|
|
18227
|
+
const { ref: triggerRef, ...rest } = triggerProps || {};
|
|
18228
|
+
return interactions.getReferenceProps({
|
|
18229
|
+
...rest,
|
|
18230
|
+
ref: mergeRefs(floating.refs.setReference, triggerRef)
|
|
18231
|
+
});
|
|
18232
|
+
}, [floating.refs.setReference, interactions, triggerProps]);
|
|
18233
|
+
return /* @__PURE__ */ jsxs183(React57.Fragment, { children: [
|
|
18234
|
+
renderTrigger(referenceProps),
|
|
18235
|
+
open ? /* @__PURE__ */ jsx360(FloatingPortal, { children: /* @__PURE__ */ jsxs183(
|
|
18236
|
+
TooltipSurface,
|
|
18237
|
+
{
|
|
18238
|
+
ref: floating.refs.setFloating,
|
|
18239
|
+
style: { ...floating.floatingStyles, zIndex },
|
|
18240
|
+
$placement: floating.placement,
|
|
18241
|
+
$background: background,
|
|
18242
|
+
...interactions.getFloatingProps(),
|
|
18243
|
+
children: [
|
|
18244
|
+
withArrow ? /* @__PURE__ */ jsx360(
|
|
18245
|
+
TooltipArrow,
|
|
18246
|
+
{
|
|
18247
|
+
ref: arrowRef,
|
|
18248
|
+
$arrow: arrowStyle,
|
|
18249
|
+
$placement: floating.placement
|
|
18250
|
+
}
|
|
18251
|
+
) : null,
|
|
18252
|
+
/* @__PURE__ */ jsx360(Content5, {})
|
|
18253
|
+
]
|
|
18254
|
+
}
|
|
18255
|
+
) }) : null
|
|
18256
|
+
] });
|
|
18257
|
+
};
|
|
18258
|
+
var Popup2 = ({
|
|
18259
|
+
enabled,
|
|
18260
|
+
...props
|
|
18261
|
+
}) => {
|
|
18262
|
+
return enabled !== false ? /* @__PURE__ */ jsx360(PopupComponent, { ...props }) : props.renderTrigger(props.triggerProps || {});
|
|
18263
|
+
};
|
|
18264
|
+
var Popup_default = Popup2;
|
|
18265
|
+
|
|
18266
|
+
// src/components/Select/components/Apply/styles.ts
|
|
18267
|
+
import styled70 from "styled-components";
|
|
18268
|
+
var ApplyButton = styled70.button`
|
|
18269
|
+
background: none;
|
|
18270
|
+
border: none;
|
|
18271
|
+
outline: none;
|
|
18272
|
+
padding: 0;
|
|
18273
|
+
|
|
18274
|
+
background-color: ${({ theme: theme4 }) => theme4.colors.blue};
|
|
18275
|
+
border-radius: 3px;
|
|
18276
|
+
|
|
18277
|
+
${({ theme: theme4 }) => theme4.useTypography("h4")}
|
|
18278
|
+
color: ${({ theme: theme4 }) => theme4.colors.white};
|
|
18279
|
+
|
|
18280
|
+
height: 35px;
|
|
18281
|
+
width: 100%;
|
|
18282
|
+
display: flex;
|
|
18283
|
+
align-items: center;
|
|
18284
|
+
justify-content: center;
|
|
18285
|
+
|
|
18286
|
+
transition-property: opacity;
|
|
18287
|
+
transition-duration: 0.25s;
|
|
18288
|
+
transition-timing-function: linear;
|
|
18289
|
+
|
|
18290
|
+
&[aria-disabled='true'] {
|
|
18291
|
+
opacity: 0.5;
|
|
18292
|
+
}
|
|
18293
|
+
&:not([aria-disabled='true']) {
|
|
18294
|
+
cursor: pointer;
|
|
18295
|
+
}
|
|
18296
|
+
`;
|
|
18297
|
+
|
|
18298
|
+
// src/components/Select/components/Apply/index.tsx
|
|
18299
|
+
import { jsx as jsx361 } from "react/jsx-runtime";
|
|
18300
|
+
var Apply = ({
|
|
18301
|
+
setValue,
|
|
18302
|
+
clearable,
|
|
18303
|
+
applyRules,
|
|
18304
|
+
onClose,
|
|
18305
|
+
draft
|
|
18306
|
+
}) => {
|
|
18307
|
+
const value = useMemo10(() => Array.from(draft.values()), [draft]);
|
|
18308
|
+
const failedApplyRule = useMemo10(() => {
|
|
18309
|
+
const rule = applyRules.find((rule2) => !rule2.allow(value));
|
|
18310
|
+
return rule;
|
|
18311
|
+
}, [value, applyRules]);
|
|
18312
|
+
const ApplyRuleComponent = failedApplyRule?.Component;
|
|
18313
|
+
const onApply = () => {
|
|
18314
|
+
if (!clearable && draft.size < 1) return;
|
|
18315
|
+
if (failedApplyRule !== void 0) return;
|
|
18316
|
+
setValue(Array.from(draft.values()));
|
|
18317
|
+
onClose();
|
|
18318
|
+
};
|
|
18319
|
+
return /* @__PURE__ */ jsx361(
|
|
18320
|
+
Popup_default,
|
|
18321
|
+
{
|
|
18322
|
+
...ApplyRuleComponent !== void 0 ? {
|
|
18323
|
+
enabled: true,
|
|
18324
|
+
content: () => /* @__PURE__ */ jsx361(ApplyRuleComponent, { value })
|
|
18325
|
+
} : {
|
|
18326
|
+
enabled: false,
|
|
18327
|
+
content: () => null
|
|
18328
|
+
},
|
|
18329
|
+
on: "click",
|
|
18330
|
+
closeOnClip: true,
|
|
18331
|
+
placement: "right",
|
|
18332
|
+
triggerType: "button",
|
|
18333
|
+
triggerProps: {
|
|
18334
|
+
onClick: onApply
|
|
18335
|
+
},
|
|
18336
|
+
renderTrigger: (props) => /* @__PURE__ */ jsx361(
|
|
18337
|
+
ApplyButton,
|
|
18338
|
+
{
|
|
18339
|
+
type: "button",
|
|
18340
|
+
"aria-disabled": !clearable && draft.size < 1 || failedApplyRule !== void 0,
|
|
18341
|
+
...props,
|
|
18342
|
+
children: "Aplicar"
|
|
18343
|
+
}
|
|
18344
|
+
)
|
|
18345
|
+
}
|
|
18346
|
+
);
|
|
18347
|
+
};
|
|
18348
|
+
var Apply_default = Apply;
|
|
18349
|
+
|
|
18350
|
+
// src/components/Select/components/Scroll/index.tsx
|
|
18351
|
+
import React58 from "react";
|
|
18352
|
+
|
|
18353
|
+
// src/components/Select/components/Scroll/styles.ts
|
|
18354
|
+
import styled71 from "styled-components";
|
|
18355
|
+
var ListContainer = styled71.div`
|
|
18356
|
+
flex: 1;
|
|
18357
|
+
position: relative;
|
|
18358
|
+
overflow: hidden;
|
|
18359
|
+
`;
|
|
18360
|
+
var ListScroll = styled71.div`
|
|
18361
|
+
overflow-y: scroll;
|
|
18362
|
+
overflow-y: overlay;
|
|
18363
|
+
width: 100%;
|
|
18364
|
+
height: 100%;
|
|
18365
|
+
|
|
18366
|
+
/* Firefox */
|
|
18367
|
+
@supports (scrollbar-width: thin) {
|
|
18368
|
+
.scroll {
|
|
18369
|
+
scrollbar-color: ${({ theme: theme4 }) => `${theme4.colors.grey} ${theme4.colors.white}`};
|
|
18370
|
+
scrollbar-width: thin;
|
|
18371
|
+
}
|
|
18372
|
+
}
|
|
18373
|
+
|
|
18374
|
+
/* Chrome/Edge/Safari (WebKit/Blink) */
|
|
18375
|
+
@supports selector(::-webkit-scrollbar) {
|
|
18376
|
+
&::-webkit-scrollbar {
|
|
18377
|
+
width: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
18378
|
+
}
|
|
18379
|
+
&::-webkit-scrollbar-thumb {
|
|
18380
|
+
background: ${({ theme: theme4 }) => theme4.colors.grey};
|
|
18381
|
+
}
|
|
18382
|
+
&::-webkit-scrollbar-track {
|
|
18383
|
+
background: ${({ theme: theme4 }) => theme4.colors.white};
|
|
18384
|
+
}
|
|
18385
|
+
}
|
|
18386
|
+
`;
|
|
18387
|
+
var ListInner = styled71.div`
|
|
18388
|
+
position: relative;
|
|
18389
|
+
width: 100%;
|
|
18390
|
+
`;
|
|
18391
|
+
var EmptyMessage2 = styled71.div`
|
|
18392
|
+
height: 100%;
|
|
18393
|
+
width: 100%;
|
|
18394
|
+
display: flex;
|
|
18395
|
+
align-items: center;
|
|
18396
|
+
justify-content: center;
|
|
18397
|
+
|
|
18398
|
+
${({ theme: theme4 }) => theme4.useTypography("p")}
|
|
18399
|
+
color: ${({ theme: theme4 }) => theme4.getColor("greyishBlue", 80)};
|
|
18400
|
+
`;
|
|
18401
|
+
var MultiHighlight = Checkmark;
|
|
18402
|
+
var SingleHighlight = styled71.div`
|
|
18403
|
+
position: absolute;
|
|
18404
|
+
top: 0;
|
|
18405
|
+
left: 0;
|
|
18406
|
+
height: 100%;
|
|
18407
|
+
width: 3px;
|
|
18408
|
+
|
|
18409
|
+
transition-property: background-color;
|
|
18410
|
+
transition-timing-function: linear;
|
|
18411
|
+
transition-duration: 0.25s;
|
|
18412
|
+
`;
|
|
18413
|
+
var OptionRow = styled71.div`
|
|
18414
|
+
position: absolute;
|
|
18415
|
+
top: 0;
|
|
18416
|
+
left: 0;
|
|
18417
|
+
width: 100%;
|
|
18418
|
+
|
|
18419
|
+
display: flex;
|
|
18420
|
+
align-items: center;
|
|
18421
|
+
gap: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
18422
|
+
|
|
18423
|
+
background-color: ${({ theme: theme4, $active: active }) => active ? theme4.getColor("blue", 15) : theme4.colors.white};
|
|
18424
|
+
padding: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
18425
|
+
|
|
18426
|
+
${({ theme: theme4 }) => theme4.useTypography("p")}
|
|
18427
|
+
color: ${({ theme: theme4 }) => theme4.colors.greyishBlue};
|
|
18428
|
+
|
|
18429
|
+
border-bottom-width: 1px;
|
|
18430
|
+
border-bottom-style: solid;
|
|
18431
|
+
&:nth-last-child(1) {
|
|
18432
|
+
border-bottom-color: transparent;
|
|
18433
|
+
}
|
|
18434
|
+
&:not(:nth-last-child(1)) {
|
|
18435
|
+
border-bottom-color: ${({ theme: theme4 }) => theme4.getColor("greyishBlue", 10)};
|
|
18436
|
+
}
|
|
18437
|
+
|
|
18438
|
+
&[aria-disabled='true'] {
|
|
18439
|
+
cursor: not-allowed;
|
|
18440
|
+
opacity: 0.5;
|
|
18441
|
+
}
|
|
18442
|
+
&:not([aria-disabled='true']) {
|
|
18443
|
+
cursor: pointer;
|
|
18444
|
+
opacity: 1;
|
|
18445
|
+
}
|
|
18446
|
+
|
|
18447
|
+
&[aria-selected='true'] > ${SingleHighlight} {
|
|
18448
|
+
background-color: ${({ theme: theme4 }) => theme4.colors.blue};
|
|
18449
|
+
}
|
|
18450
|
+
&:not([aria-selected='true']) > ${SingleHighlight} {
|
|
18451
|
+
background-color: transparent;
|
|
18452
|
+
}
|
|
18453
|
+
|
|
18454
|
+
> ${MultiHighlight} {
|
|
18455
|
+
background-color: ${({ theme: theme4, $active: active }) => active ? theme4.colors.iceWhite : theme4.colors.white};
|
|
18456
|
+
}
|
|
18457
|
+
|
|
18458
|
+
&[aria-selected='true'] > ${MultiHighlight} {
|
|
18459
|
+
border-color: ${({ theme: theme4 }) => theme4.colors.blue};
|
|
18460
|
+
}
|
|
18461
|
+
&[aria-selected='true'] > ${MultiHighlight}:after {
|
|
18462
|
+
width: 5px;
|
|
18463
|
+
height: 9.5px;
|
|
18464
|
+
border-width: 0 2px 2px 0;
|
|
18465
|
+
left: 5px;
|
|
18466
|
+
top: 1px;
|
|
18467
|
+
}
|
|
18468
|
+
&:not([aria-selected='true']) > ${MultiHighlight} {
|
|
18469
|
+
border-color: ${({ theme: theme4 }) => theme4.colors.lightestGrey};
|
|
18470
|
+
}
|
|
18471
|
+
|
|
18472
|
+
transition-property: background-color, opacity;
|
|
18473
|
+
transition-timing-function: linear;
|
|
18474
|
+
transition-duration: 0.25s;
|
|
18475
|
+
`;
|
|
18476
|
+
|
|
18477
|
+
// src/components/Select/components/Scroll/index.tsx
|
|
18478
|
+
import { jsx as jsx362, jsxs as jsxs184 } from "react/jsx-runtime";
|
|
18479
|
+
var Scroll = React58.forwardRef(
|
|
18480
|
+
({
|
|
18481
|
+
menuId,
|
|
18482
|
+
loading,
|
|
18483
|
+
options,
|
|
18484
|
+
virtualItems,
|
|
18485
|
+
totalSize,
|
|
18486
|
+
measureElement,
|
|
18487
|
+
OptionComponent,
|
|
18488
|
+
onClickOption,
|
|
18489
|
+
onMouseEnterOption,
|
|
18490
|
+
activeIndex,
|
|
18491
|
+
getKey,
|
|
18492
|
+
getIsSelected,
|
|
18493
|
+
getFailedRuleByKey,
|
|
18494
|
+
mode,
|
|
18495
|
+
...props
|
|
18496
|
+
}, ref) => {
|
|
18497
|
+
const Highlight = mode === "single" ? SingleHighlight : MultiHighlight;
|
|
18498
|
+
return /* @__PURE__ */ jsxs184(ListContainer, { children: [
|
|
18499
|
+
loading ? /* @__PURE__ */ jsx362(Loader_default, { filled: true }) : options.length < 1 ? /* @__PURE__ */ jsx362(EmptyMessage2, { children: "Nenhuma op\xE7\xE3o encontrada" }) : null,
|
|
18500
|
+
/* @__PURE__ */ jsx362(
|
|
18501
|
+
ListScroll,
|
|
18502
|
+
{
|
|
18503
|
+
ref,
|
|
18504
|
+
id: menuId,
|
|
18505
|
+
role: "listbox",
|
|
18506
|
+
...props,
|
|
18507
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
18508
|
+
children: /* @__PURE__ */ jsx362(ListInner, { style: { height: `${totalSize}px` }, children: virtualItems.map((virtualItem) => {
|
|
18509
|
+
const option = options[virtualItem.index];
|
|
18510
|
+
if (!option) return null;
|
|
18511
|
+
const optionKey = getKey(option);
|
|
18512
|
+
const failedRule = getFailedRuleByKey(optionKey);
|
|
18513
|
+
const disabled = Boolean(failedRule);
|
|
18514
|
+
const isSelected = getIsSelected(optionKey);
|
|
18515
|
+
const isActive = activeIndex === virtualItem.index;
|
|
18516
|
+
const Component5 = failedRule?.Component;
|
|
18517
|
+
return /* @__PURE__ */ jsx362(
|
|
18518
|
+
Popup_default,
|
|
18519
|
+
{
|
|
18520
|
+
enabled: Boolean(Component5),
|
|
18521
|
+
content: () => /* @__PURE__ */ jsx362(Component5, { option }),
|
|
18522
|
+
on: "click",
|
|
18523
|
+
closeOnClip: true,
|
|
18524
|
+
placement: "right",
|
|
18525
|
+
triggerProps: {
|
|
18526
|
+
ref: measureElement,
|
|
18527
|
+
onMouseEnter: () => onMouseEnterOption(virtualItem.index),
|
|
18528
|
+
onClick: () => onClickOption(virtualItem.index)
|
|
18529
|
+
},
|
|
18530
|
+
renderTrigger: (props2) => /* @__PURE__ */ jsxs184(
|
|
18531
|
+
OptionRow,
|
|
18532
|
+
{
|
|
18533
|
+
id: `${menuId}-option-${virtualItem.index}`,
|
|
18534
|
+
"data-index": virtualItem.index,
|
|
18535
|
+
role: "option",
|
|
18536
|
+
"aria-selected": isSelected,
|
|
18537
|
+
"aria-disabled": disabled,
|
|
18538
|
+
$active: isActive,
|
|
18539
|
+
style: {
|
|
18540
|
+
transform: `translateY(${virtualItem.start}px)`
|
|
18541
|
+
},
|
|
18542
|
+
...props2,
|
|
18543
|
+
children: [
|
|
18544
|
+
/* @__PURE__ */ jsx362(Highlight, {}),
|
|
18545
|
+
/* @__PURE__ */ jsx362(
|
|
18546
|
+
OptionComponent,
|
|
18547
|
+
{
|
|
18548
|
+
option,
|
|
18549
|
+
isActive,
|
|
18550
|
+
isSelected,
|
|
18551
|
+
isDisabled: disabled
|
|
18552
|
+
}
|
|
18553
|
+
)
|
|
18554
|
+
]
|
|
18555
|
+
}
|
|
18556
|
+
)
|
|
18557
|
+
},
|
|
18558
|
+
optionKey
|
|
18559
|
+
);
|
|
18560
|
+
}) })
|
|
18561
|
+
}
|
|
18562
|
+
)
|
|
18563
|
+
] });
|
|
18564
|
+
}
|
|
18565
|
+
);
|
|
18566
|
+
var Scroll_default = Scroll;
|
|
18567
|
+
|
|
18568
|
+
// src/components/Select/components/Search/index.tsx
|
|
18569
|
+
import React59, { useState as useState28 } from "react";
|
|
18570
|
+
|
|
18571
|
+
// src/components/Select/components/Search/styles.ts
|
|
18572
|
+
import styled72 from "styled-components";
|
|
18573
|
+
var SearchContainer = styled72.div`
|
|
18574
|
+
padding: 0 ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
18575
|
+
margin-bottom: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
18576
|
+
|
|
18577
|
+
${({ theme: theme4 }) => theme4.useTypography("p")}
|
|
18578
|
+
|
|
18579
|
+
position: relative;
|
|
18580
|
+
|
|
18581
|
+
> input {
|
|
18582
|
+
width: 100%;
|
|
18583
|
+
min-height: 35px;
|
|
18584
|
+
|
|
18585
|
+
padding-top: 0;
|
|
18586
|
+
/* padding + icon width + gap */
|
|
18587
|
+
padding-right: calc(
|
|
18588
|
+
${({ theme: theme4 }) => `${theme4.spacings.s1} + 24px + ${theme4.spacings.s1}`}
|
|
18589
|
+
);
|
|
18590
|
+
padding-bottom: 0;
|
|
18591
|
+
padding-left: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
18592
|
+
|
|
18593
|
+
outline: none;
|
|
18594
|
+
|
|
18595
|
+
border-style: solid;
|
|
18596
|
+
border-width: 1px;
|
|
18597
|
+
border-color: ${({ theme: theme4 }) => theme4.colors.lightGrey};
|
|
18598
|
+
border-radius: 4px;
|
|
18599
|
+
}
|
|
18600
|
+
|
|
18601
|
+
> :last-child {
|
|
18602
|
+
position: absolute;
|
|
18603
|
+
top: 50%;
|
|
18604
|
+
|
|
18605
|
+
/* parent padding + input padding */
|
|
18606
|
+
right: calc(
|
|
18607
|
+
${({ theme: theme4 }) => `${theme4.spacings.s3} + ${theme4.spacings.s1}`}
|
|
18608
|
+
);
|
|
18609
|
+
transform: translateY(-50%);
|
|
18610
|
+
}
|
|
18611
|
+
`;
|
|
18612
|
+
|
|
18613
|
+
// src/components/Select/components/Search/index.tsx
|
|
18614
|
+
import { jsx as jsx363, jsxs as jsxs185 } from "react/jsx-runtime";
|
|
18615
|
+
var Search = React59.forwardRef(
|
|
18616
|
+
({ menuId, onKeyDown, value: [value, setValue], activeIndex }, ref) => {
|
|
18617
|
+
const [inputRef, setInputRef] = useState28(null);
|
|
18618
|
+
return /* @__PURE__ */ jsxs185(SearchContainer, { children: [
|
|
18619
|
+
/* @__PURE__ */ jsx363(
|
|
18620
|
+
"input",
|
|
18621
|
+
{
|
|
18622
|
+
ref: (node) => {
|
|
18623
|
+
setInputRef(node);
|
|
18624
|
+
if (typeof ref === "function") {
|
|
18625
|
+
ref(node);
|
|
18626
|
+
} else if (ref) {
|
|
18627
|
+
ref.current = node;
|
|
18628
|
+
}
|
|
18629
|
+
},
|
|
18630
|
+
value,
|
|
18631
|
+
onChange: (event) => setValue(event.target.value),
|
|
18632
|
+
onKeyDown,
|
|
18633
|
+
placeholder: "Buscar...",
|
|
18634
|
+
role: "searchbox",
|
|
18635
|
+
"aria-controls": menuId,
|
|
18636
|
+
"aria-activedescendant": activeIndex >= 0 ? `${menuId}-option-${activeIndex}` : void 0
|
|
18637
|
+
}
|
|
18638
|
+
),
|
|
18639
|
+
/* @__PURE__ */ jsx363(
|
|
18640
|
+
Icon_default,
|
|
18641
|
+
{
|
|
18642
|
+
type: "feather",
|
|
18643
|
+
...value.length > 0 ? {
|
|
18644
|
+
icon: "x",
|
|
18645
|
+
onClick: (e) => {
|
|
18646
|
+
e.preventDefault();
|
|
18647
|
+
setValue("");
|
|
18648
|
+
inputRef?.focus();
|
|
18649
|
+
},
|
|
18650
|
+
strokeWidth: "4px"
|
|
18651
|
+
} : {
|
|
18652
|
+
icon: "search",
|
|
18653
|
+
onClick: (e) => {
|
|
18654
|
+
e.preventDefault();
|
|
18655
|
+
e.stopPropagation();
|
|
18656
|
+
inputRef?.focus();
|
|
18657
|
+
}
|
|
18658
|
+
}
|
|
18659
|
+
}
|
|
18660
|
+
)
|
|
18661
|
+
] });
|
|
18662
|
+
}
|
|
18663
|
+
);
|
|
18664
|
+
var Search_default2 = Search;
|
|
18665
|
+
|
|
18666
|
+
// src/components/Select/instances/styles.ts
|
|
18667
|
+
import styled73 from "styled-components";
|
|
18668
|
+
var Header14 = styled73.div`
|
|
18669
|
+
padding: 0 ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
18670
|
+
margin: ${({ theme: theme4 }) => theme4.spacings.s1} 0;
|
|
18671
|
+
display: flex;
|
|
18672
|
+
gap: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
18673
|
+
justify-content: space-between;
|
|
18674
|
+
align-items: center;
|
|
18675
|
+
`;
|
|
18676
|
+
var DraftSwitch = styled73.button`
|
|
18677
|
+
background: none;
|
|
18678
|
+
border: none;
|
|
18679
|
+
outline: none;
|
|
18680
|
+
padding: 0;
|
|
18681
|
+
display: flex;
|
|
18682
|
+
align-items: center;
|
|
18683
|
+
gap: calc(${({ theme: theme4 }) => theme4.spacings.s1} / 2);
|
|
18684
|
+
|
|
18685
|
+
${({ theme: theme4 }) => theme4.useTypography("h4")}
|
|
18686
|
+
color: ${({ theme: theme4 }) => theme4.getColor("black", 80)};
|
|
18687
|
+
|
|
18688
|
+
transition-property: color;
|
|
18689
|
+
transition-duration: 0.4s;
|
|
18690
|
+
transition-timing-function: ease-in-out;
|
|
18691
|
+
|
|
18692
|
+
&:not(:disabled) {
|
|
18693
|
+
cursor: pointer;
|
|
18694
|
+
}
|
|
18695
|
+
|
|
18696
|
+
&:not(:disabled):hover {
|
|
18697
|
+
color: ${({ theme: theme4 }) => theme4.colors.blue};
|
|
18698
|
+
}
|
|
18699
|
+
|
|
18700
|
+
> span:nth-child(1) {
|
|
18701
|
+
position: relative;
|
|
18702
|
+
width: calc(${({ theme: theme4 }) => theme4.spacings.s3} * 2);
|
|
18703
|
+
height: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
18704
|
+
background-color: ${({ theme: theme4 }) => theme4.colors.warningGray};
|
|
18705
|
+
border-radius: 20px;
|
|
18706
|
+
transition-property: background-color;
|
|
18707
|
+
transition-duration: 0.4s;
|
|
18708
|
+
transition-timing-function: ease-in-out;
|
|
18709
|
+
box-sizing: content-box;
|
|
18710
|
+
|
|
18711
|
+
&:before {
|
|
18712
|
+
content: '';
|
|
18713
|
+
transition-property: left, transform;
|
|
18714
|
+
transition-duration: 0.4s;
|
|
18715
|
+
transition-timing-function: ease-in-out;
|
|
18716
|
+
position: absolute;
|
|
18717
|
+
border-width: 1px;
|
|
18718
|
+
border-style: solid;
|
|
18719
|
+
border-radius: 100%;
|
|
18720
|
+
border-color: ${({ theme: theme4 }) => theme4.colors.lightGrey};
|
|
18721
|
+
left: 0;
|
|
18722
|
+
box-shadow: 0px 1px 3px ${({ theme: theme4 }) => theme4.getColor("black", 10)};
|
|
18723
|
+
width: 50%;
|
|
18724
|
+
height: 100%;
|
|
18725
|
+
background-color: ${({ theme: theme4 }) => theme4.colors.white};
|
|
18726
|
+
box-sizing: border-box;
|
|
18727
|
+
}
|
|
18728
|
+
}
|
|
18729
|
+
|
|
18730
|
+
&[aria-checked='true'] > span:nth-child(1) {
|
|
18731
|
+
background-color: ${({ theme: theme4 }) => theme4.colors.blue};
|
|
18732
|
+
}
|
|
18733
|
+
|
|
18734
|
+
&[aria-checked='true'] > span:nth-child(1):before {
|
|
18735
|
+
left: 100%;
|
|
18736
|
+
transform: translateX(-100%);
|
|
18737
|
+
}
|
|
18738
|
+
`;
|
|
18739
|
+
var SelectAllButton = styled73.button`
|
|
18740
|
+
background: none;
|
|
18741
|
+
border: none;
|
|
18742
|
+
outline: none;
|
|
18743
|
+
padding: 0;
|
|
18744
|
+
|
|
18745
|
+
${({ theme: theme4 }) => theme4.useTypography("h6")}
|
|
18746
|
+
color: ${({ theme: theme4 }) => theme4.colors.greyishBlue};
|
|
18747
|
+
|
|
18748
|
+
transition-property: color;
|
|
18749
|
+
transition-duration: 0.25s;
|
|
18750
|
+
transition-timing-function: linear;
|
|
18751
|
+
|
|
18752
|
+
&:not(:disabled) {
|
|
18753
|
+
cursor: pointer;
|
|
18754
|
+
}
|
|
18755
|
+
|
|
18756
|
+
&:not(:disabled):hover {
|
|
18757
|
+
color: ${({ theme: theme4 }) => theme4.colors.blue};
|
|
18758
|
+
}
|
|
18759
|
+
`;
|
|
18760
|
+
|
|
18761
|
+
// src/components/Select/instances/multi/index.tsx
|
|
18762
|
+
import { jsx as jsx364, jsxs as jsxs186 } from "react/jsx-runtime";
|
|
18763
|
+
var buildMap = (values, getKey) => {
|
|
18764
|
+
return new Map(values.map((option) => [getKey(option), option]));
|
|
18765
|
+
};
|
|
18766
|
+
var paginate = () => {
|
|
18767
|
+
};
|
|
18768
|
+
var useDraftOptions = (draft, finder) => {
|
|
18769
|
+
const {
|
|
18770
|
+
current: [searchInput, setSearchInput],
|
|
18771
|
+
debounced: [search]
|
|
18772
|
+
} = useDebouncedState_default("", () => {
|
|
18773
|
+
}, SEARCH_DEBOUNCE_MS);
|
|
18774
|
+
const options = useMemo11(() => {
|
|
18775
|
+
const options2 = Array.from(draft.values());
|
|
18776
|
+
if (!search) return options2;
|
|
18777
|
+
return finder(search, options2);
|
|
18778
|
+
}, [draft, search, finder]);
|
|
18779
|
+
return {
|
|
18780
|
+
options,
|
|
18781
|
+
loading: false,
|
|
18782
|
+
paginate,
|
|
18783
|
+
searchInput: [searchInput, setSearchInput]
|
|
18784
|
+
};
|
|
18785
|
+
};
|
|
18786
|
+
var useDraft = (value, getKey) => {
|
|
18787
|
+
const [draft, setDraft] = useState29(() => ({
|
|
18788
|
+
options: buildMap(value, getKey),
|
|
18789
|
+
on: false
|
|
18790
|
+
}));
|
|
18791
|
+
const setOptions = (value2) => {
|
|
18792
|
+
setDraft((prev) => {
|
|
18793
|
+
const v = typeof value2 === "function" ? value2(prev.options) : value2;
|
|
18794
|
+
if (v === prev.options) return prev;
|
|
18795
|
+
return {
|
|
18796
|
+
options: v,
|
|
18797
|
+
on: prev.on && v.size > 0
|
|
18798
|
+
};
|
|
18799
|
+
});
|
|
18800
|
+
};
|
|
18801
|
+
const setOn = (value2) => {
|
|
18802
|
+
setDraft((prev) => {
|
|
18803
|
+
const v = typeof value2 === "function" ? value2(prev.on) : value2;
|
|
18804
|
+
if (v === prev.on) return prev;
|
|
18805
|
+
return {
|
|
18806
|
+
options: prev.options,
|
|
18807
|
+
on: v && prev.options.size > 0
|
|
18808
|
+
};
|
|
18809
|
+
});
|
|
18810
|
+
};
|
|
18811
|
+
return {
|
|
18812
|
+
draft: [draft.options, setOptions],
|
|
18813
|
+
switchDraft: [draft.on, setOn]
|
|
18814
|
+
};
|
|
18815
|
+
};
|
|
18816
|
+
var SelectMultiOptions = ({
|
|
18817
|
+
loader: loader2,
|
|
18818
|
+
getKey,
|
|
18819
|
+
OptionComponent,
|
|
18820
|
+
rules,
|
|
18821
|
+
overscan,
|
|
18822
|
+
estimateSize,
|
|
18823
|
+
value,
|
|
18824
|
+
setValue,
|
|
18825
|
+
menuId,
|
|
18826
|
+
onClose,
|
|
18827
|
+
clearable = false,
|
|
18828
|
+
finder,
|
|
18829
|
+
applyRules = []
|
|
18830
|
+
}) => {
|
|
18831
|
+
const {
|
|
18832
|
+
draft: [draft, setDraft],
|
|
18833
|
+
switchDraft: [switchDraft, setSwitchDraft]
|
|
18834
|
+
} = useDraft(value, getKey);
|
|
18835
|
+
const asyncOptions = useAsyncOptions_default(loader2);
|
|
18836
|
+
const draftOptions = useDraftOptions(draft, finder);
|
|
18837
|
+
const {
|
|
18838
|
+
options,
|
|
18839
|
+
loading,
|
|
18840
|
+
paginate: paginate2,
|
|
18841
|
+
searchInput: [searchInput, setSearchInput]
|
|
18842
|
+
} = switchDraft ? draftOptions : asyncOptions;
|
|
18843
|
+
const { getFailedRuleByKey, enabledCount } = useRuleIndex_default({
|
|
18844
|
+
options,
|
|
18845
|
+
getKey,
|
|
18846
|
+
rules
|
|
18847
|
+
});
|
|
18848
|
+
const { listRef, searchRef, rowVirtualizer, virtualItems } = useVirtualizedOptions_default({
|
|
18849
|
+
optionsLength: options.length,
|
|
18850
|
+
loading,
|
|
18851
|
+
onPaginate: paginate2,
|
|
18852
|
+
overscan,
|
|
18853
|
+
estimateSize
|
|
18854
|
+
});
|
|
18855
|
+
const isIndexDisabled = (index) => {
|
|
18856
|
+
const option = options[index];
|
|
18857
|
+
if (!option) return true;
|
|
18858
|
+
return Boolean(getFailedRuleByKey(getKey(option)));
|
|
18859
|
+
};
|
|
18860
|
+
const onToggleByIndex = (index) => {
|
|
18861
|
+
const option = options[index];
|
|
18862
|
+
if (!option) return;
|
|
18863
|
+
if (isIndexDisabled(index)) {
|
|
18864
|
+
searchRef.current?.focus();
|
|
18865
|
+
return;
|
|
18866
|
+
}
|
|
18867
|
+
const key = getKey(option);
|
|
18868
|
+
setDraft((current) => {
|
|
18869
|
+
const next = new Map(current);
|
|
18870
|
+
if (next.has(key)) {
|
|
18871
|
+
next.delete(key);
|
|
18872
|
+
} else {
|
|
18873
|
+
next.set(key, option);
|
|
18874
|
+
}
|
|
18875
|
+
return next;
|
|
18876
|
+
});
|
|
18877
|
+
};
|
|
18878
|
+
const navigation = useListNavigation_default({
|
|
18879
|
+
itemCount: options.length,
|
|
18880
|
+
isItemDisabled: isIndexDisabled,
|
|
18881
|
+
onSelect: onToggleByIndex,
|
|
18882
|
+
scrollToIndex: rowVirtualizer.scrollToIndex
|
|
18883
|
+
});
|
|
18884
|
+
const onSelectAll = () => {
|
|
18885
|
+
setDraft((current) => {
|
|
18886
|
+
const next = new Map(current);
|
|
18887
|
+
options.forEach((option) => {
|
|
18888
|
+
const key = getKey(option);
|
|
18889
|
+
if (!getFailedRuleByKey(key)) {
|
|
18890
|
+
next.set(key, option);
|
|
18891
|
+
}
|
|
18892
|
+
});
|
|
18893
|
+
return next;
|
|
18894
|
+
});
|
|
18895
|
+
};
|
|
18896
|
+
const onUnselectAll = () => {
|
|
18897
|
+
setDraft(/* @__PURE__ */ new Map([]));
|
|
18898
|
+
};
|
|
18899
|
+
const getIsSelected = useCallback9((key) => draft.has(key), [draft]);
|
|
18900
|
+
return /* @__PURE__ */ jsxs186(React60.Fragment, { children: [
|
|
18901
|
+
/* @__PURE__ */ jsxs186(Header14, { children: [
|
|
18902
|
+
/* @__PURE__ */ jsxs186(
|
|
18903
|
+
DraftSwitch,
|
|
18904
|
+
{
|
|
18905
|
+
type: "button",
|
|
18906
|
+
role: "switch",
|
|
18907
|
+
"aria-checked": switchDraft,
|
|
18908
|
+
onClick: () => setSwitchDraft((prev) => !prev),
|
|
18909
|
+
disabled: draft.size < 1,
|
|
18910
|
+
children: [
|
|
18911
|
+
/* @__PURE__ */ jsx364("span", {}),
|
|
18912
|
+
"Selecionados (",
|
|
18913
|
+
draft.size,
|
|
18914
|
+
")"
|
|
18915
|
+
]
|
|
18916
|
+
}
|
|
18917
|
+
),
|
|
18918
|
+
/* @__PURE__ */ jsx364(
|
|
18919
|
+
SelectAllButton,
|
|
18920
|
+
{
|
|
18921
|
+
type: "button",
|
|
18922
|
+
...enabledCount > 0 && enabledCount === draft.size ? {
|
|
18923
|
+
onClick: onUnselectAll,
|
|
18924
|
+
children: "Desselecionar tudo"
|
|
18925
|
+
} : {
|
|
18926
|
+
onClick: onSelectAll,
|
|
18927
|
+
children: "Selecionar tudo",
|
|
18928
|
+
disabled: enabledCount < 1
|
|
18929
|
+
}
|
|
18930
|
+
}
|
|
18931
|
+
)
|
|
18932
|
+
] }),
|
|
18933
|
+
/* @__PURE__ */ jsx364(
|
|
18934
|
+
Search_default2,
|
|
18935
|
+
{
|
|
18936
|
+
ref: searchRef,
|
|
18937
|
+
menuId,
|
|
18938
|
+
value: [searchInput, setSearchInput],
|
|
18939
|
+
activeIndex: navigation.activeIndex,
|
|
18940
|
+
onKeyDown: navigation.onKeyDown
|
|
18941
|
+
}
|
|
18942
|
+
),
|
|
18943
|
+
/* @__PURE__ */ jsx364(
|
|
18944
|
+
Scroll_default,
|
|
18945
|
+
{
|
|
18946
|
+
ref: listRef,
|
|
18947
|
+
menuId,
|
|
18948
|
+
options,
|
|
18949
|
+
virtualItems,
|
|
18950
|
+
totalSize: rowVirtualizer.getTotalSize(),
|
|
18951
|
+
measureElement: rowVirtualizer.measureElement,
|
|
18952
|
+
loading,
|
|
18953
|
+
OptionComponent,
|
|
18954
|
+
onClickOption: onToggleByIndex,
|
|
18955
|
+
onMouseEnterOption: navigation.onMouseEnter,
|
|
18956
|
+
activeIndex: navigation.activeIndex,
|
|
18957
|
+
getKey,
|
|
18958
|
+
getIsSelected,
|
|
18959
|
+
getFailedRuleByKey,
|
|
18960
|
+
mode: "multi",
|
|
18961
|
+
"aria-multiselectable": true
|
|
18962
|
+
}
|
|
18963
|
+
),
|
|
18964
|
+
/* @__PURE__ */ jsx364(
|
|
18965
|
+
Apply_default,
|
|
18966
|
+
{
|
|
18967
|
+
setValue,
|
|
18968
|
+
onClose,
|
|
18969
|
+
draft,
|
|
18970
|
+
clearable,
|
|
18971
|
+
applyRules
|
|
18972
|
+
}
|
|
18973
|
+
)
|
|
18974
|
+
] });
|
|
18975
|
+
};
|
|
18976
|
+
var useMultiSelect = ({
|
|
18977
|
+
label,
|
|
18978
|
+
loader: loader2,
|
|
18979
|
+
getKey,
|
|
18980
|
+
OptionComponent,
|
|
18981
|
+
rules,
|
|
18982
|
+
placeholder = "Selecione",
|
|
18983
|
+
required,
|
|
18984
|
+
invalid,
|
|
18985
|
+
clearable,
|
|
18986
|
+
readOnly,
|
|
18987
|
+
viewMode,
|
|
18988
|
+
overscan,
|
|
18989
|
+
estimateSize,
|
|
18990
|
+
height,
|
|
18991
|
+
value,
|
|
18992
|
+
setValue,
|
|
18993
|
+
finder,
|
|
18994
|
+
applyRules,
|
|
18995
|
+
...buttonProps
|
|
18996
|
+
}) => {
|
|
18997
|
+
const closedLabel = useMemo11(() => {
|
|
18998
|
+
if (value.length < 1) {
|
|
18999
|
+
return viewMode ? /* @__PURE__ */ jsx364(React60.Fragment, { children: "\xA0" }) : placeholder;
|
|
19000
|
+
}
|
|
19001
|
+
return `H\xE1 ${value.length} op\xE7\xF5es selecionadas`;
|
|
19002
|
+
}, [placeholder, value.length, viewMode]);
|
|
19003
|
+
return {
|
|
19004
|
+
isEmpty: value.length === 0,
|
|
19005
|
+
placeholder: closedLabel,
|
|
19006
|
+
onClear: () => setValue([]),
|
|
19007
|
+
Component: SelectMultiOptions,
|
|
19008
|
+
buttonProps
|
|
19009
|
+
};
|
|
19010
|
+
};
|
|
19011
|
+
var multi_default = useMultiSelect;
|
|
19012
|
+
|
|
19013
|
+
// src/components/Select/instances/single/index.tsx
|
|
19014
|
+
import React61, { useCallback as useCallback10, useMemo as useMemo12 } from "react";
|
|
19015
|
+
import { jsx as jsx365, jsxs as jsxs187 } from "react/jsx-runtime";
|
|
19016
|
+
var SelectSingleOptions = ({
|
|
19017
|
+
loader: loader2,
|
|
19018
|
+
getKey,
|
|
19019
|
+
OptionComponent,
|
|
19020
|
+
rules,
|
|
19021
|
+
overscan,
|
|
19022
|
+
estimateSize,
|
|
19023
|
+
value,
|
|
19024
|
+
setValue,
|
|
19025
|
+
menuId,
|
|
19026
|
+
onClose,
|
|
19027
|
+
clearable
|
|
19028
|
+
}) => {
|
|
19029
|
+
const {
|
|
19030
|
+
options,
|
|
19031
|
+
loading,
|
|
19032
|
+
paginate: paginate2,
|
|
19033
|
+
searchInput: [searchInput, setSearchInput]
|
|
19034
|
+
} = useAsyncOptions_default(loader2);
|
|
19035
|
+
const { getFailedRuleByKey } = useRuleIndex_default({
|
|
19036
|
+
options,
|
|
19037
|
+
getKey,
|
|
19038
|
+
rules
|
|
19039
|
+
});
|
|
19040
|
+
const { listRef, searchRef, rowVirtualizer, virtualItems } = useVirtualizedOptions_default({
|
|
19041
|
+
optionsLength: options.length,
|
|
19042
|
+
loading,
|
|
19043
|
+
onPaginate: paginate2,
|
|
19044
|
+
overscan,
|
|
19045
|
+
estimateSize
|
|
19046
|
+
});
|
|
19047
|
+
const selectedKey = value ? getKey(value) : null;
|
|
19048
|
+
const isIndexDisabled = (index) => {
|
|
19049
|
+
const option = options[index];
|
|
19050
|
+
if (!option) return true;
|
|
19051
|
+
return Boolean(getFailedRuleByKey(getKey(option)));
|
|
19052
|
+
};
|
|
19053
|
+
const onToggleByIndex = (index) => {
|
|
19054
|
+
const option = options[index];
|
|
19055
|
+
if (!option) return;
|
|
19056
|
+
if (isIndexDisabled(index)) {
|
|
19057
|
+
searchRef.current?.focus();
|
|
19058
|
+
return;
|
|
19059
|
+
}
|
|
19060
|
+
const optionKey = getKey(option);
|
|
19061
|
+
if (selectedKey === optionKey) {
|
|
19062
|
+
if (!clearable) return;
|
|
19063
|
+
setValue(null);
|
|
19064
|
+
} else {
|
|
19065
|
+
setValue(option);
|
|
19066
|
+
}
|
|
19067
|
+
onClose();
|
|
19068
|
+
};
|
|
19069
|
+
const navigation = useListNavigation_default({
|
|
19070
|
+
itemCount: options.length,
|
|
19071
|
+
isItemDisabled: isIndexDisabled,
|
|
19072
|
+
onSelect: onToggleByIndex,
|
|
19073
|
+
scrollToIndex: rowVirtualizer.scrollToIndex
|
|
19074
|
+
});
|
|
19075
|
+
const getIsSelected = useCallback10(
|
|
19076
|
+
(key) => selectedKey === key,
|
|
19077
|
+
[selectedKey]
|
|
19078
|
+
);
|
|
19079
|
+
return /* @__PURE__ */ jsxs187(React61.Fragment, { children: [
|
|
19080
|
+
/* @__PURE__ */ jsx365(
|
|
19081
|
+
Search_default2,
|
|
19082
|
+
{
|
|
19083
|
+
ref: searchRef,
|
|
19084
|
+
menuId,
|
|
19085
|
+
value: [searchInput, setSearchInput],
|
|
19086
|
+
activeIndex: navigation.activeIndex,
|
|
19087
|
+
onKeyDown: navigation.onKeyDown
|
|
19088
|
+
}
|
|
19089
|
+
),
|
|
19090
|
+
/* @__PURE__ */ jsx365(
|
|
19091
|
+
Scroll_default,
|
|
19092
|
+
{
|
|
19093
|
+
ref: listRef,
|
|
19094
|
+
menuId,
|
|
19095
|
+
options,
|
|
19096
|
+
virtualItems,
|
|
19097
|
+
totalSize: rowVirtualizer.getTotalSize(),
|
|
19098
|
+
measureElement: rowVirtualizer.measureElement,
|
|
19099
|
+
loading,
|
|
19100
|
+
OptionComponent,
|
|
19101
|
+
onClickOption: onToggleByIndex,
|
|
19102
|
+
onMouseEnterOption: navigation.onMouseEnter,
|
|
19103
|
+
activeIndex: navigation.activeIndex,
|
|
19104
|
+
getKey,
|
|
19105
|
+
getIsSelected,
|
|
19106
|
+
getFailedRuleByKey,
|
|
19107
|
+
mode: "single",
|
|
19108
|
+
"aria-multiselectable": true
|
|
19109
|
+
}
|
|
19110
|
+
)
|
|
19111
|
+
] });
|
|
19112
|
+
};
|
|
19113
|
+
var useSingleSelect = ({
|
|
19114
|
+
label,
|
|
19115
|
+
loader: loader2,
|
|
19116
|
+
getKey,
|
|
19117
|
+
OptionComponent,
|
|
19118
|
+
rules,
|
|
19119
|
+
placeholder = "Selecione",
|
|
19120
|
+
required,
|
|
19121
|
+
invalid,
|
|
19122
|
+
clearable,
|
|
19123
|
+
readOnly,
|
|
19124
|
+
viewMode,
|
|
19125
|
+
overscan,
|
|
19126
|
+
estimateSize,
|
|
19127
|
+
height,
|
|
19128
|
+
value,
|
|
19129
|
+
setValue,
|
|
19130
|
+
ValueComponent,
|
|
19131
|
+
...buttonProps
|
|
19132
|
+
}) => {
|
|
19133
|
+
const ClosedValueComponent = ValueComponent || OptionComponent;
|
|
19134
|
+
const closedLabel = useMemo12(() => {
|
|
19135
|
+
if (!value) {
|
|
19136
|
+
return viewMode ? /* @__PURE__ */ jsx365(React61.Fragment, { children: "\xA0" }) : placeholder;
|
|
19137
|
+
}
|
|
19138
|
+
return /* @__PURE__ */ jsx365(
|
|
19139
|
+
ClosedValueComponent,
|
|
19140
|
+
{
|
|
19141
|
+
option: value,
|
|
19142
|
+
isActive: false,
|
|
19143
|
+
isSelected: true,
|
|
19144
|
+
isDisabled: false
|
|
19145
|
+
}
|
|
19146
|
+
);
|
|
19147
|
+
}, [ClosedValueComponent, placeholder, value, viewMode]);
|
|
19148
|
+
return {
|
|
19149
|
+
isEmpty: !value,
|
|
19150
|
+
placeholder: closedLabel,
|
|
19151
|
+
onClear: () => setValue(null),
|
|
19152
|
+
Component: SelectSingleOptions,
|
|
19153
|
+
buttonProps
|
|
19154
|
+
};
|
|
19155
|
+
};
|
|
19156
|
+
var single_default = useSingleSelect;
|
|
19157
|
+
|
|
19158
|
+
// src/components/Select/instances/index.tsx
|
|
19159
|
+
var useSelect2 = ({ type, ...props }) => {
|
|
19160
|
+
return type === "multi-select" ? multi_default(props) : single_default(props);
|
|
19161
|
+
};
|
|
19162
|
+
var instances_default = useSelect2;
|
|
19163
|
+
|
|
19164
|
+
// src/components/Select/styles.ts
|
|
19165
|
+
import styled74, { css as css49 } from "styled-components";
|
|
19166
|
+
var FloatingWrapper = styled74.div`
|
|
19167
|
+
z-index: 1000;
|
|
19168
|
+
|
|
19169
|
+
&,
|
|
19170
|
+
& > div {
|
|
19171
|
+
height: var(--height);
|
|
19172
|
+
min-height: var(--height);
|
|
19173
|
+
max-height: var(--height);
|
|
19174
|
+
}
|
|
19175
|
+
|
|
19176
|
+
> div {
|
|
19177
|
+
position: absolute;
|
|
19178
|
+
bottom: 0;
|
|
19179
|
+
left: 0;
|
|
19180
|
+
width: 100%;
|
|
19181
|
+
padding-top: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
19182
|
+
|
|
19183
|
+
display: flex;
|
|
19184
|
+
flex-direction: column;
|
|
19185
|
+
overflow: hidden;
|
|
19186
|
+
}
|
|
19187
|
+
|
|
19188
|
+
transition-property: height, max-height, min-height;
|
|
19189
|
+
transition-timing-function: linear;
|
|
19190
|
+
transition-duration: ${MENU_EXIT_MS}ms;
|
|
19191
|
+
|
|
19192
|
+
background: ${({ theme: theme4 }) => theme4.colors.white};
|
|
19193
|
+
border: 1px solid ${({ theme: theme4 }) => theme4.colors.lightGrey};
|
|
19194
|
+
border-radius: 6px;
|
|
19195
|
+
box-shadow: 0px 3px 6px ${({ theme: theme4 }) => theme4.getColor("black", 15)};
|
|
19196
|
+
overflow: hidden;
|
|
19197
|
+
`;
|
|
19198
|
+
var Trigger = styled74.button`
|
|
19199
|
+
width: 100%;
|
|
19200
|
+
|
|
19201
|
+
transition-property: opacity, border-color, box-shadow, color,
|
|
19202
|
+
background-color;
|
|
19203
|
+
transition-timing-function: linear;
|
|
19204
|
+
transition-duration: 0.25s;
|
|
19205
|
+
|
|
19206
|
+
${({ $viewMode: viewMode }) => viewMode ? css49`
|
|
19207
|
+
padding: 0;
|
|
19208
|
+
|
|
19209
|
+
border: none;
|
|
19210
|
+
` : css49`
|
|
19211
|
+
min-height: 35px;
|
|
19212
|
+
padding: 0 ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
19213
|
+
|
|
19214
|
+
border-style: solid;
|
|
19215
|
+
border-width: 1px;
|
|
19216
|
+
border-radius: 4px;
|
|
19217
|
+
`}
|
|
19218
|
+
|
|
19219
|
+
outline: none !important;
|
|
19220
|
+
|
|
19221
|
+
&:focus-visible {
|
|
19222
|
+
box-shadow: 3px 3px 6px ${({ theme: theme4 }) => theme4.getColor("black", 15)};
|
|
19223
|
+
}
|
|
19224
|
+
|
|
19225
|
+
text-align: left;
|
|
19226
|
+
display: flex;
|
|
19227
|
+
align-items: center;
|
|
19228
|
+
justify-content: space-between;
|
|
19229
|
+
gap: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
19230
|
+
|
|
19231
|
+
${({ theme: theme4 }) => theme4.useTypography("p")}
|
|
19232
|
+
|
|
19233
|
+
&[aria-invalid='true'] {
|
|
19234
|
+
border-color: ${({ theme: theme4 }) => theme4.colors.warningRed};
|
|
19235
|
+
color: ${({ theme: theme4 }) => theme4.colors.warningRed};
|
|
19236
|
+
background-color: ${({ theme: theme4 }) => theme4.getColor("warningRed", 5)};
|
|
19237
|
+
}
|
|
19238
|
+
&:not([aria-invalid='true']) {
|
|
19239
|
+
border-color: ${({ theme: theme4 }) => theme4.colors.lightGrey};
|
|
19240
|
+
color: ${({ theme: theme4, $empty: empty }) => {
|
|
19241
|
+
return empty ? theme4.colors.darkGrey : theme4.colors.darkBlue;
|
|
19242
|
+
}};
|
|
19243
|
+
background-color: ${({ theme: theme4 }) => theme4.colors.white};
|
|
19244
|
+
}
|
|
19245
|
+
|
|
19246
|
+
&:disabled {
|
|
19247
|
+
opacity: 0.5;
|
|
19248
|
+
}
|
|
19249
|
+
|
|
19250
|
+
&:not(:disabled),
|
|
19251
|
+
&:not([aria-readonly='true']) {
|
|
19252
|
+
cursor: pointer;
|
|
19253
|
+
}
|
|
19254
|
+
|
|
19255
|
+
&:disabled,
|
|
19256
|
+
&[aria-readonly='true'] {
|
|
19257
|
+
pointer-events: none;
|
|
19258
|
+
}
|
|
19259
|
+
|
|
19260
|
+
> i {
|
|
19261
|
+
transition-property: transform;
|
|
19262
|
+
transition-timing-function: linear;
|
|
19263
|
+
transition-duration: 0.25s;
|
|
19264
|
+
transform: rotate(${({ $open: open }) => open ? "180deg" : "0deg"});
|
|
19265
|
+
}
|
|
19266
|
+
`;
|
|
19267
|
+
var TriggerValue = styled74.div`
|
|
19268
|
+
flex: 1;
|
|
19269
|
+
min-width: 0;
|
|
19270
|
+
overflow: hidden;
|
|
19271
|
+
white-space: nowrap;
|
|
19272
|
+
text-overflow: ellipsis;
|
|
19273
|
+
`;
|
|
19274
|
+
var Label11 = styled74.label`
|
|
19275
|
+
display: inline-block;
|
|
19276
|
+
margin-bottom: ${({ theme: theme4, $viewMode: viewMode }) => theme4.spacings[viewMode ? "s3" : "s1"]};
|
|
19277
|
+
|
|
19278
|
+
${({ theme: theme4, $viewMode: viewMode }) => theme4.useTypography("p", {
|
|
19279
|
+
fontWeight: viewMode ? "bold" : "normal"
|
|
19280
|
+
})}
|
|
19281
|
+
color: ${({ theme: theme4 }) => theme4.colors.greyishBlue};
|
|
19282
|
+
|
|
19283
|
+
transition-property: opacity, border-color, box-shadow, color,
|
|
19284
|
+
background-color;
|
|
19285
|
+
transition-timing-function: linear;
|
|
19286
|
+
transition-duration: 0.25s;
|
|
19287
|
+
|
|
19288
|
+
&:has(+ [aria-required='true']):after {
|
|
19289
|
+
content: ' *';
|
|
19290
|
+
}
|
|
19291
|
+
|
|
19292
|
+
&:has(+ :disabled) {
|
|
19293
|
+
opacity: 0.5;
|
|
19294
|
+
}
|
|
19295
|
+
`;
|
|
19296
|
+
var OptionContainer = styled74.div`
|
|
19297
|
+
display: flex;
|
|
19298
|
+
flex-direction: column;
|
|
19299
|
+
gap: calc(${({ theme: theme4 }) => theme4.spacings.s1} / 2);
|
|
19300
|
+
overflow: hidden;
|
|
19301
|
+
|
|
19302
|
+
> div {
|
|
19303
|
+
display: flex;
|
|
19304
|
+
gap: calc(${({ theme: theme4 }) => theme4.spacings.s1} / 2);
|
|
19305
|
+
color: ${({ theme: theme4 }) => theme4.colors.darkBlue};
|
|
19306
|
+
white-space: nowrap;
|
|
19307
|
+
}
|
|
19308
|
+
|
|
19309
|
+
> div:nth-child(1) {
|
|
19310
|
+
${({ theme: theme4 }) => theme4.useTypography("p")}
|
|
19311
|
+
}
|
|
19312
|
+
|
|
19313
|
+
> div:not(:nth-child(1)) {
|
|
19314
|
+
${({ theme: theme4 }) => theme4.useTypography("h6")}
|
|
19315
|
+
opacity: 0.5;
|
|
19316
|
+
}
|
|
19317
|
+
`;
|
|
19318
|
+
|
|
19319
|
+
// src/components/Select/index.tsx
|
|
19320
|
+
import { jsx as jsx366, jsxs as jsxs188 } from "react/jsx-runtime";
|
|
19321
|
+
var Select2 = React62.forwardRef(
|
|
19322
|
+
(props, ref) => {
|
|
19323
|
+
const [open, setOpen] = useState30(false);
|
|
19324
|
+
const id = props.id || useId();
|
|
19325
|
+
const { isRequired, isInvalid: isInvalid2, isViewMode, isDisabled } = Form_default.useContext(
|
|
19326
|
+
props.name
|
|
19327
|
+
);
|
|
19328
|
+
const invalid = isInvalid2() || props.invalid;
|
|
19329
|
+
const required = isRequired() || props.required;
|
|
19330
|
+
const disabled = isDisabled() || props.disabled;
|
|
19331
|
+
const viewMode = isViewMode() || props.viewMode;
|
|
19332
|
+
const { floating, transition, interactions } = useFloatingMenu_default({
|
|
19333
|
+
open,
|
|
19334
|
+
onOpenChange: setOpen
|
|
19335
|
+
});
|
|
19336
|
+
const height = useMemo13(() => {
|
|
19337
|
+
if (transition.status !== "open") return 0;
|
|
19338
|
+
if (props.height !== void 0) return props.height;
|
|
19339
|
+
return props.type === "single-select" ? 240 : 260;
|
|
19340
|
+
}, [transition.status !== "open", props.type, props.height]);
|
|
19341
|
+
const menuId = useId();
|
|
19342
|
+
const onTriggerKeyDown = (event) => {
|
|
19343
|
+
if (!open && ["ArrowDown", "ArrowUp", "Enter", " "].includes(event.key)) {
|
|
19344
|
+
event.preventDefault();
|
|
19345
|
+
setOpen(true);
|
|
19346
|
+
}
|
|
19347
|
+
};
|
|
19348
|
+
const { isEmpty, placeholder, Component: Component5, onClear, buttonProps } = instances_default(props);
|
|
19349
|
+
return /* @__PURE__ */ jsxs188(React62.Fragment, { children: [
|
|
19350
|
+
props.label !== void 0 && /* @__PURE__ */ jsx366(Label11, { htmlFor: id, $viewMode: viewMode, children: props.label }),
|
|
19351
|
+
/* @__PURE__ */ jsxs188(
|
|
19352
|
+
Trigger,
|
|
19353
|
+
{
|
|
19354
|
+
id,
|
|
19355
|
+
type: "button",
|
|
19356
|
+
role: "combobox",
|
|
19357
|
+
"aria-haspopup": "listbox",
|
|
19358
|
+
"aria-expanded": open,
|
|
19359
|
+
"aria-controls": menuId,
|
|
19360
|
+
$open: open,
|
|
19361
|
+
$empty: isEmpty,
|
|
19362
|
+
$viewMode: viewMode,
|
|
19363
|
+
"aria-readonly": props.readOnly || viewMode,
|
|
19364
|
+
"aria-invalid": invalid,
|
|
19365
|
+
"aria-required": required && !viewMode,
|
|
19366
|
+
...interactions.getReferenceProps({
|
|
19367
|
+
...buttonProps,
|
|
19368
|
+
disabled,
|
|
19369
|
+
onClick: (event) => {
|
|
19370
|
+
if (props.readOnly || viewMode || disabled) return;
|
|
19371
|
+
setOpen((current) => !current);
|
|
19372
|
+
buttonProps.onClick?.(event);
|
|
19373
|
+
},
|
|
19374
|
+
onKeyDown: (event) => {
|
|
19375
|
+
if (props.readOnly || viewMode || props.disabled) return;
|
|
19376
|
+
onTriggerKeyDown(event);
|
|
19377
|
+
buttonProps.onKeyDown?.(event);
|
|
19378
|
+
}
|
|
19379
|
+
}),
|
|
19380
|
+
ref: (node) => {
|
|
19381
|
+
floating.refs.setReference(node);
|
|
19382
|
+
if (typeof ref === "function") {
|
|
19383
|
+
ref(node);
|
|
19384
|
+
} else if (ref) {
|
|
19385
|
+
ref.current = node;
|
|
19386
|
+
}
|
|
19387
|
+
},
|
|
19388
|
+
children: [
|
|
19389
|
+
/* @__PURE__ */ jsx366(TriggerValue, { children: placeholder }),
|
|
19390
|
+
!viewMode && /* @__PURE__ */ jsx366(
|
|
19391
|
+
Icon_default,
|
|
19392
|
+
{
|
|
19393
|
+
width: "14px",
|
|
19394
|
+
color: props.invalid ? colors.warningRed : colors.darkGrey,
|
|
19395
|
+
...!isEmpty && props.clearable && !props.disabled && !props.readOnly ? {
|
|
19396
|
+
type: "feather",
|
|
19397
|
+
icon: "x",
|
|
19398
|
+
onClick: (e) => {
|
|
19399
|
+
e.stopPropagation();
|
|
19400
|
+
onClear();
|
|
19401
|
+
},
|
|
19402
|
+
strokeWidth: "4px"
|
|
19403
|
+
} : {
|
|
19404
|
+
type: "semantic",
|
|
19405
|
+
icon: "caret down"
|
|
19406
|
+
}
|
|
19407
|
+
}
|
|
19408
|
+
)
|
|
19409
|
+
]
|
|
19410
|
+
}
|
|
19411
|
+
),
|
|
19412
|
+
transition.isMounted ? /* @__PURE__ */ jsx366(FloatingPortal2, { children: /* @__PURE__ */ jsx366(
|
|
19413
|
+
FloatingWrapper,
|
|
19414
|
+
{
|
|
19415
|
+
ref: floating.refs.setFloating,
|
|
19416
|
+
style: {
|
|
19417
|
+
...floating.floatingStyles,
|
|
19418
|
+
"--height": `${height}px`
|
|
19419
|
+
},
|
|
19420
|
+
...interactions.getFloatingProps(),
|
|
19421
|
+
children: /* @__PURE__ */ jsx366("div", { children: /* @__PURE__ */ jsx366(
|
|
19422
|
+
Component5,
|
|
19423
|
+
{
|
|
19424
|
+
...props,
|
|
19425
|
+
menuId,
|
|
19426
|
+
onClose: () => setOpen(false)
|
|
19427
|
+
}
|
|
19428
|
+
) })
|
|
19429
|
+
}
|
|
19430
|
+
) }) : null
|
|
19431
|
+
] });
|
|
19432
|
+
}
|
|
19433
|
+
);
|
|
19434
|
+
var Select_default3 = Object.assign(Select2, {
|
|
19435
|
+
OptionContainer
|
|
19436
|
+
});
|
|
19437
|
+
|
|
19438
|
+
// src/components/Signature/index.tsx
|
|
19439
|
+
import { useCallback as useCallback11, useEffect as useEffect25, useMemo as useMemo14, useState as useState31 } from "react";
|
|
19440
|
+
import SignatureCanvas from "react-signature-canvas";
|
|
19441
|
+
|
|
19442
|
+
// src/components/Signature/styles.ts
|
|
19443
|
+
import styled75 from "styled-components";
|
|
19444
|
+
var Container26 = styled75.div`
|
|
19445
|
+
width: 100%;
|
|
19446
|
+
height: 100%;
|
|
19447
|
+
|
|
19448
|
+
display: flex;
|
|
19449
|
+
flex-direction: column;
|
|
19450
|
+
gap: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
19451
|
+
`;
|
|
19452
|
+
var CanvasContainer = styled75.div`
|
|
19453
|
+
position: relative;
|
|
19454
|
+
flex: 1;
|
|
19455
|
+
overflow: hidden;
|
|
19456
|
+
background-color: ${({ theme: theme4, $invalid: invalid }) => invalid ? theme4.getColor("warningRed", 5) : theme4.colors.white};
|
|
19457
|
+
|
|
19458
|
+
&[data-placeholder]:before {
|
|
19459
|
+
content: attr(data-placeholder);
|
|
19460
|
+
position: absolute;
|
|
19461
|
+
top: 50%;
|
|
19462
|
+
left: 50%;
|
|
19463
|
+
transform: translate(-50%, -50%);
|
|
19464
|
+
text-align: center;
|
|
19465
|
+
|
|
19466
|
+
color: ${({ theme: theme4, $invalid: invalid }) => theme4.colors[invalid ? "warningRed" : "darkBlue"]};
|
|
19467
|
+
|
|
19468
|
+
${({ theme: theme4 }) => theme4.useTypography("h1")}
|
|
19469
|
+
font-size: 59px;
|
|
19470
|
+
line-height: 71px;
|
|
19471
|
+
opacity: 0.1;
|
|
19472
|
+
z-index: 1;
|
|
19473
|
+
}
|
|
19474
|
+
|
|
19475
|
+
canvas {
|
|
19476
|
+
position: relative;
|
|
19477
|
+
display: block;
|
|
19478
|
+
width: 100%;
|
|
19479
|
+
height: 100%;
|
|
19480
|
+
box-sizing: border-box;
|
|
19481
|
+
border: 1px solid
|
|
19482
|
+
${({ theme: theme4, $invalid: invalid }) => theme4.colors[invalid ? "warningRed" : "lightGrey"]};
|
|
19483
|
+
border-radius: 4px;
|
|
19484
|
+
z-index: 2;
|
|
19485
|
+
}
|
|
19486
|
+
|
|
19487
|
+
/* icons container */
|
|
19488
|
+
> div:nth-child(1) {
|
|
19489
|
+
position: absolute;
|
|
19490
|
+
top: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
19491
|
+
right: ${({ theme: theme4 }) => theme4.spacings.s3};
|
|
19492
|
+
display: flex;
|
|
19493
|
+
gap: ${({ theme: theme4 }) => theme4.spacings.s1};
|
|
19494
|
+
z-index: 3;
|
|
19495
|
+
|
|
19496
|
+
> button {
|
|
19497
|
+
padding: 0;
|
|
19498
|
+
outline: none;
|
|
19499
|
+
border: none;
|
|
19500
|
+
background: none;
|
|
19501
|
+
|
|
19502
|
+
> i.icon,
|
|
19503
|
+
> i.icon:before {
|
|
19504
|
+
color: #4e4e4e;
|
|
19505
|
+
font-size: 20px;
|
|
19506
|
+
line-height: 20px;
|
|
19507
|
+
width: 20px;
|
|
19508
|
+
}
|
|
19509
|
+
|
|
19510
|
+
&:not(:disabled) {
|
|
19511
|
+
cursor: pointer;
|
|
19512
|
+
}
|
|
19513
|
+
&:disabled {
|
|
19514
|
+
opacity: 0.5;
|
|
19515
|
+
}
|
|
19516
|
+
|
|
19517
|
+
transition: opacity 0.25s linear;
|
|
19518
|
+
}
|
|
19519
|
+
}
|
|
19520
|
+
`;
|
|
19521
|
+
|
|
19522
|
+
// src/components/Signature/index.tsx
|
|
19523
|
+
import { jsx as jsx367, jsxs as jsxs189 } from "react/jsx-runtime";
|
|
19524
|
+
var FONTS = [
|
|
19525
|
+
"GreatVibes",
|
|
19526
|
+
"Pacifico",
|
|
19527
|
+
"Allura"
|
|
19528
|
+
];
|
|
19529
|
+
var FONT_SIZE = 64;
|
|
19530
|
+
var voidFn = () => {
|
|
19531
|
+
};
|
|
19532
|
+
var SignatureInput = ({
|
|
19533
|
+
setValue,
|
|
19534
|
+
value,
|
|
19535
|
+
penColor,
|
|
19536
|
+
backgroundColor,
|
|
19537
|
+
invalid,
|
|
19538
|
+
label = "Digite seu nome",
|
|
19539
|
+
inputPlaceholder = "Digite seu nome",
|
|
19540
|
+
canvasPlaceholder = "Assine aqui",
|
|
19541
|
+
onBegin = voidFn,
|
|
19542
|
+
onEnd = voidFn,
|
|
19543
|
+
...props
|
|
19544
|
+
}) => {
|
|
19545
|
+
const [name, setName] = useState31("");
|
|
19546
|
+
const [font, setFont] = useState31(FONTS[0]);
|
|
19547
|
+
const [showPlaceholder, setShowPlaceholder] = useState31(true);
|
|
19548
|
+
const [loading, setLoading] = useState31(false);
|
|
19549
|
+
const [ref, setRef] = useState31(null);
|
|
19550
|
+
useEffect25(() => {
|
|
19551
|
+
if (!ref) return;
|
|
19552
|
+
const refreshValue = () => {
|
|
19553
|
+
if (ref.isEmpty() && !value) return;
|
|
19554
|
+
const v = ref.toDataURL("image/png");
|
|
19555
|
+
if (v === value) return;
|
|
19556
|
+
ref.clear();
|
|
19557
|
+
ref.fromDataURL(value);
|
|
19558
|
+
};
|
|
19559
|
+
refreshValue();
|
|
19560
|
+
window.addEventListener("resize", refreshValue);
|
|
19561
|
+
return () => window.removeEventListener("resize", refreshValue);
|
|
19562
|
+
}, [ref, value]);
|
|
19563
|
+
const setByText = useCallback11(
|
|
19564
|
+
async (name2, font2) => {
|
|
19565
|
+
if (!ref) return;
|
|
19566
|
+
const trimmed = name2.trim();
|
|
19567
|
+
if (trimmed.length < 1) {
|
|
19568
|
+
return;
|
|
19569
|
+
}
|
|
19570
|
+
setLoading(true);
|
|
19571
|
+
const ready = await ensureFontLoaded(fonts_default[font2], FONT_SIZE, trimmed);
|
|
17678
19572
|
setLoading(false);
|
|
17679
19573
|
if (!ready) return;
|
|
17680
19574
|
const c = document.createElement("canvas");
|
|
@@ -17695,14 +19589,14 @@ var SignatureInput = ({
|
|
|
17695
19589
|
},
|
|
17696
19590
|
[ref]
|
|
17697
19591
|
);
|
|
17698
|
-
const onBeginHandler =
|
|
19592
|
+
const onBeginHandler = useCallback11(
|
|
17699
19593
|
(event) => {
|
|
17700
19594
|
onBegin(event, ref);
|
|
17701
19595
|
setShowPlaceholder(false);
|
|
17702
19596
|
},
|
|
17703
19597
|
[ref, onBegin]
|
|
17704
19598
|
);
|
|
17705
|
-
const onEndHandler =
|
|
19599
|
+
const onEndHandler = useCallback11(
|
|
17706
19600
|
(event) => {
|
|
17707
19601
|
onEnd(event, ref);
|
|
17708
19602
|
if (!ref || ref.isEmpty()) return;
|
|
@@ -17710,19 +19604,19 @@ var SignatureInput = ({
|
|
|
17710
19604
|
},
|
|
17711
19605
|
[ref, onEnd]
|
|
17712
19606
|
);
|
|
17713
|
-
const onApplyHandler =
|
|
19607
|
+
const onApplyHandler = useCallback11(() => {
|
|
17714
19608
|
setByText(name, font);
|
|
17715
19609
|
}, [name, font, setByText]);
|
|
17716
|
-
const onClearHandler =
|
|
19610
|
+
const onClearHandler = useCallback11(() => {
|
|
17717
19611
|
if (!ref) return;
|
|
17718
19612
|
setShowPlaceholder(true);
|
|
17719
19613
|
setName("");
|
|
17720
19614
|
ref.clear();
|
|
17721
19615
|
setValue("");
|
|
17722
19616
|
}, [ref]);
|
|
17723
|
-
const empty =
|
|
17724
|
-
return /* @__PURE__ */
|
|
17725
|
-
/* @__PURE__ */
|
|
19617
|
+
const empty = useMemo14(() => !value && (!ref || ref.isEmpty()), [ref, value]);
|
|
19618
|
+
return /* @__PURE__ */ jsxs189(Container26, { children: [
|
|
19619
|
+
/* @__PURE__ */ jsx367(
|
|
17726
19620
|
Input_default,
|
|
17727
19621
|
{
|
|
17728
19622
|
label,
|
|
@@ -17745,7 +19639,7 @@ var SignatureInput = ({
|
|
|
17745
19639
|
} : {}
|
|
17746
19640
|
}
|
|
17747
19641
|
),
|
|
17748
|
-
/* @__PURE__ */
|
|
19642
|
+
/* @__PURE__ */ jsxs189(
|
|
17749
19643
|
CanvasContainer,
|
|
17750
19644
|
{
|
|
17751
19645
|
$invalid: invalid,
|
|
@@ -17753,8 +19647,8 @@ var SignatureInput = ({
|
|
|
17753
19647
|
"data-placeholder": canvasPlaceholder
|
|
17754
19648
|
} : {},
|
|
17755
19649
|
children: [
|
|
17756
|
-
/* @__PURE__ */
|
|
17757
|
-
/* @__PURE__ */
|
|
19650
|
+
/* @__PURE__ */ jsxs189("div", { children: [
|
|
19651
|
+
/* @__PURE__ */ jsx367(
|
|
17758
19652
|
"button",
|
|
17759
19653
|
{
|
|
17760
19654
|
type: "button",
|
|
@@ -17767,10 +19661,10 @@ var SignatureInput = ({
|
|
|
17767
19661
|
},
|
|
17768
19662
|
disabled: loading || name.trim().length < 1,
|
|
17769
19663
|
title: "Trocar fonte",
|
|
17770
|
-
children: /* @__PURE__ */
|
|
19664
|
+
children: /* @__PURE__ */ jsx367(Icon_default, { type: "semantic", icon: "font" })
|
|
17771
19665
|
}
|
|
17772
19666
|
),
|
|
17773
|
-
/* @__PURE__ */
|
|
19667
|
+
/* @__PURE__ */ jsx367(
|
|
17774
19668
|
"button",
|
|
17775
19669
|
{
|
|
17776
19670
|
type: "button",
|
|
@@ -17780,12 +19674,12 @@ var SignatureInput = ({
|
|
|
17780
19674
|
},
|
|
17781
19675
|
disabled: empty,
|
|
17782
19676
|
title: "Recortar",
|
|
17783
|
-
children: /* @__PURE__ */
|
|
19677
|
+
children: /* @__PURE__ */ jsx367(Icon_default, { type: "semantic", icon: "cut" })
|
|
17784
19678
|
}
|
|
17785
19679
|
),
|
|
17786
|
-
/* @__PURE__ */
|
|
19680
|
+
/* @__PURE__ */ jsx367("button", { onClick: onClearHandler, disabled: empty, title: "Limpar", children: /* @__PURE__ */ jsx367(Icon_default, { type: "semantic", icon: "eraser" }) })
|
|
17787
19681
|
] }),
|
|
17788
|
-
/* @__PURE__ */
|
|
19682
|
+
/* @__PURE__ */ jsx367(
|
|
17789
19683
|
SignatureCanvas,
|
|
17790
19684
|
{
|
|
17791
19685
|
ref: setRef,
|
|
@@ -17804,17 +19698,17 @@ var SignatureInput = ({
|
|
|
17804
19698
|
var Signature_default = SignatureInput;
|
|
17805
19699
|
|
|
17806
19700
|
// src/components/Tabs/index.tsx
|
|
17807
|
-
import
|
|
19701
|
+
import React68, { useState as useState34 } from "react";
|
|
17808
19702
|
|
|
17809
19703
|
// src/components/Tabs/components/ScrollButtons/index.tsx
|
|
17810
|
-
import
|
|
19704
|
+
import React64, { useCallback as useCallback13, useEffect as useEffect26, useState as useState32 } from "react";
|
|
17811
19705
|
|
|
17812
19706
|
// src/components/Tabs/components/ScrollButton/index.tsx
|
|
17813
|
-
import { useCallback as
|
|
19707
|
+
import { useCallback as useCallback12 } from "react";
|
|
17814
19708
|
|
|
17815
19709
|
// src/components/Tabs/components/ScrollButton/styled.ts
|
|
17816
|
-
import
|
|
17817
|
-
var Container27 =
|
|
19710
|
+
import styled76 from "styled-components";
|
|
19711
|
+
var Container27 = styled76.div`
|
|
17818
19712
|
position: absolute;
|
|
17819
19713
|
top: 0;
|
|
17820
19714
|
height: 100%;
|
|
@@ -17837,31 +19731,31 @@ var Container27 = styled70.div`
|
|
|
17837
19731
|
`;
|
|
17838
19732
|
|
|
17839
19733
|
// src/components/Tabs/components/ScrollButton/index.tsx
|
|
17840
|
-
import { jsx as
|
|
19734
|
+
import { jsx as jsx368 } from "react/jsx-runtime";
|
|
17841
19735
|
var ScrollButton = (props) => {
|
|
17842
19736
|
const { mode, visible, scrollRef } = props;
|
|
17843
19737
|
const icon = `chevron_${mode}`;
|
|
17844
|
-
const onClick =
|
|
19738
|
+
const onClick = useCallback12(() => {
|
|
17845
19739
|
if (!scrollRef) return;
|
|
17846
19740
|
scrollRef.scrollBy({
|
|
17847
19741
|
left: mode === "left" ? -(scrollRef.scrollWidth + 1) : scrollRef.scrollWidth,
|
|
17848
19742
|
behavior: "smooth"
|
|
17849
19743
|
});
|
|
17850
19744
|
}, [scrollRef, mode]);
|
|
17851
|
-
return /* @__PURE__ */
|
|
19745
|
+
return /* @__PURE__ */ jsx368(
|
|
17852
19746
|
Container27,
|
|
17853
19747
|
{
|
|
17854
19748
|
className: ["scroll-arrow", ...visible ? ["visible"] : []].join(" "),
|
|
17855
19749
|
onClick,
|
|
17856
|
-
children: /* @__PURE__ */
|
|
19750
|
+
children: /* @__PURE__ */ jsx368(Icon_default, { type: "feather", icon, width: 16, height: 16, color: "black" })
|
|
17857
19751
|
}
|
|
17858
19752
|
);
|
|
17859
19753
|
};
|
|
17860
19754
|
var ScrollButton_default = ScrollButton;
|
|
17861
19755
|
|
|
17862
19756
|
// src/components/Tabs/components/ScrollButtons/styled.ts
|
|
17863
|
-
import
|
|
17864
|
-
var Container28 =
|
|
19757
|
+
import styled77, { css as css50 } from "styled-components";
|
|
19758
|
+
var Container28 = styled77.div`
|
|
17865
19759
|
overflow-x: auto;
|
|
17866
19760
|
scrollbar-width: thin;
|
|
17867
19761
|
scroll-behavior: smooth;
|
|
@@ -17876,19 +19770,19 @@ var Container28 = styled71.div`
|
|
|
17876
19770
|
display: none; /* Chrome, Safari, Opera */
|
|
17877
19771
|
}
|
|
17878
19772
|
|
|
17879
|
-
${({ theme: theme4, $internal: internal }) => internal &&
|
|
19773
|
+
${({ theme: theme4, $internal: internal }) => internal && css50`
|
|
17880
19774
|
gap: ${theme4.spacings.s6};
|
|
17881
19775
|
`}
|
|
17882
19776
|
`;
|
|
17883
19777
|
|
|
17884
19778
|
// src/components/Tabs/components/ScrollButtons/index.tsx
|
|
17885
|
-
import { jsx as
|
|
19779
|
+
import { jsx as jsx369, jsxs as jsxs190 } from "react/jsx-runtime";
|
|
17886
19780
|
var ScrollButtons = (props) => {
|
|
17887
19781
|
const { activeTabIndex, tabsLength } = props;
|
|
17888
|
-
const [ref, setRef] =
|
|
17889
|
-
const [showLeftArrow, setShowLeftArrow] =
|
|
17890
|
-
const [showRightArrow, setShowRightArrow] =
|
|
17891
|
-
const checkScrollPosition =
|
|
19782
|
+
const [ref, setRef] = useState32(null);
|
|
19783
|
+
const [showLeftArrow, setShowLeftArrow] = useState32(false);
|
|
19784
|
+
const [showRightArrow, setShowRightArrow] = useState32(false);
|
|
19785
|
+
const checkScrollPosition = useCallback13(() => {
|
|
17892
19786
|
if (!ref) return;
|
|
17893
19787
|
if (ref.scrollWidth > ref.offsetWidth) {
|
|
17894
19788
|
const { scrollLeft, scrollWidth, clientWidth } = ref;
|
|
@@ -17899,12 +19793,12 @@ var ScrollButtons = (props) => {
|
|
|
17899
19793
|
setShowRightArrow(false);
|
|
17900
19794
|
}
|
|
17901
19795
|
}, [ref]);
|
|
17902
|
-
|
|
19796
|
+
useEffect26(() => {
|
|
17903
19797
|
checkScrollPosition();
|
|
17904
19798
|
window.addEventListener("resize", checkScrollPosition);
|
|
17905
19799
|
return () => window.removeEventListener("resize", checkScrollPosition);
|
|
17906
19800
|
}, [checkScrollPosition, tabsLength]);
|
|
17907
|
-
|
|
19801
|
+
useEffect26(() => {
|
|
17908
19802
|
if (!ref) return;
|
|
17909
19803
|
if (ref.scrollWidth <= ref.offsetWidth) return;
|
|
17910
19804
|
const element = ref.children[activeTabIndex];
|
|
@@ -17914,9 +19808,9 @@ var ScrollButtons = (props) => {
|
|
|
17914
19808
|
inline: "nearest"
|
|
17915
19809
|
});
|
|
17916
19810
|
}, [activeTabIndex, ref]);
|
|
17917
|
-
return /* @__PURE__ */
|
|
17918
|
-
/* @__PURE__ */
|
|
17919
|
-
/* @__PURE__ */
|
|
19811
|
+
return /* @__PURE__ */ jsxs190(React64.Fragment, { children: [
|
|
19812
|
+
/* @__PURE__ */ jsx369(ScrollButton_default, { scrollRef: ref, mode: "left", visible: showLeftArrow }),
|
|
19813
|
+
/* @__PURE__ */ jsx369(
|
|
17920
19814
|
Container28,
|
|
17921
19815
|
{
|
|
17922
19816
|
ref: setRef,
|
|
@@ -17931,13 +19825,13 @@ var ScrollButtons = (props) => {
|
|
|
17931
19825
|
children: props.children
|
|
17932
19826
|
}
|
|
17933
19827
|
),
|
|
17934
|
-
/* @__PURE__ */
|
|
19828
|
+
/* @__PURE__ */ jsx369(ScrollButton_default, { scrollRef: ref, mode: "right", visible: showRightArrow })
|
|
17935
19829
|
] });
|
|
17936
19830
|
};
|
|
17937
19831
|
var ScrollButtons_default = ScrollButtons;
|
|
17938
19832
|
|
|
17939
19833
|
// src/components/Tabs/components/TabItem/index.tsx
|
|
17940
|
-
import
|
|
19834
|
+
import React67 from "react";
|
|
17941
19835
|
|
|
17942
19836
|
// src/components/Tabs/functions.ts
|
|
17943
19837
|
var sortTabs = (tabs, sorted = []) => {
|
|
@@ -17985,11 +19879,11 @@ var buildComponent = (component, provider) => {
|
|
|
17985
19879
|
};
|
|
17986
19880
|
|
|
17987
19881
|
// src/components/Tabs/components/TabItem/components/Close/index.tsx
|
|
17988
|
-
import { useCallback as
|
|
19882
|
+
import { useCallback as useCallback14 } from "react";
|
|
17989
19883
|
|
|
17990
19884
|
// src/components/Tabs/components/TabItem/components/Close/styles.ts
|
|
17991
|
-
import
|
|
17992
|
-
var Close =
|
|
19885
|
+
import styled78 from "styled-components";
|
|
19886
|
+
var Close = styled78.div`
|
|
17993
19887
|
position: relative;
|
|
17994
19888
|
z-index: 2;
|
|
17995
19889
|
display: flex;
|
|
@@ -18015,7 +19909,7 @@ var Close = styled72.div`
|
|
|
18015
19909
|
`;
|
|
18016
19910
|
|
|
18017
19911
|
// src/components/Tabs/components/TabItem/components/Close/index.tsx
|
|
18018
|
-
import { jsx as
|
|
19912
|
+
import { jsx as jsx370 } from "react/jsx-runtime";
|
|
18019
19913
|
var Close2 = (props) => {
|
|
18020
19914
|
const {
|
|
18021
19915
|
index,
|
|
@@ -18023,7 +19917,7 @@ var Close2 = (props) => {
|
|
|
18023
19917
|
options: [options, setOptions]
|
|
18024
19918
|
} = props;
|
|
18025
19919
|
const onClose = props.onClose || (() => true);
|
|
18026
|
-
const onClickClose =
|
|
19920
|
+
const onClickClose = useCallback14(
|
|
18027
19921
|
async (event) => {
|
|
18028
19922
|
if (options.length === 1) return;
|
|
18029
19923
|
const newOptions = [...options];
|
|
@@ -18037,7 +19931,7 @@ var Close2 = (props) => {
|
|
|
18037
19931
|
},
|
|
18038
19932
|
[options, active, index, onClose]
|
|
18039
19933
|
);
|
|
18040
|
-
return /* @__PURE__ */
|
|
19934
|
+
return /* @__PURE__ */ jsx370(Close, { children: /* @__PURE__ */ jsx370(
|
|
18041
19935
|
Icon_default,
|
|
18042
19936
|
{
|
|
18043
19937
|
type: "feather",
|
|
@@ -18052,11 +19946,11 @@ var Close2 = (props) => {
|
|
|
18052
19946
|
var Close_default = Close2;
|
|
18053
19947
|
|
|
18054
19948
|
// src/components/Tabs/components/TabItem/components/LabelItem/index.tsx
|
|
18055
|
-
import { useState as
|
|
19949
|
+
import { useState as useState33 } from "react";
|
|
18056
19950
|
|
|
18057
19951
|
// src/components/Tabs/components/TabItem/components/LabelItem/styled.ts
|
|
18058
|
-
import
|
|
18059
|
-
var StyledTab =
|
|
19952
|
+
import styled79, { css as css51 } from "styled-components";
|
|
19953
|
+
var StyledTab = styled79.div`
|
|
18060
19954
|
position: relative;
|
|
18061
19955
|
flex: 1;
|
|
18062
19956
|
white-space: nowrap;
|
|
@@ -18089,7 +19983,7 @@ var StyledTab = styled73.div`
|
|
|
18089
19983
|
transition: --color 0.5s, --bgColor 0.5s;
|
|
18090
19984
|
}
|
|
18091
19985
|
|
|
18092
|
-
${({ $primary, $hasSiblings, $internal }) => $primary && $hasSiblings && !$internal &&
|
|
19986
|
+
${({ $primary, $hasSiblings, $internal }) => $primary && $hasSiblings && !$internal && css51`
|
|
18093
19987
|
&::before {
|
|
18094
19988
|
content: '';
|
|
18095
19989
|
position: absolute;
|
|
@@ -18105,11 +19999,11 @@ var StyledTab = styled73.div`
|
|
|
18105
19999
|
`;
|
|
18106
20000
|
|
|
18107
20001
|
// src/components/Tabs/components/TabItem/components/LabelItem/index.tsx
|
|
18108
|
-
import { jsx as
|
|
20002
|
+
import { jsx as jsx371 } from "react/jsx-runtime";
|
|
18109
20003
|
var LabelItem = (props) => {
|
|
18110
20004
|
const { children, onClick, primary, hasSiblings, internal } = props;
|
|
18111
|
-
const [ref, setRef] =
|
|
18112
|
-
return /* @__PURE__ */
|
|
20005
|
+
const [ref, setRef] = useState33(null);
|
|
20006
|
+
return /* @__PURE__ */ jsx371(
|
|
18113
20007
|
StyledTab,
|
|
18114
20008
|
{
|
|
18115
20009
|
ref: setRef,
|
|
@@ -18128,8 +20022,8 @@ var LabelItem = (props) => {
|
|
|
18128
20022
|
var LabelItem_default = LabelItem;
|
|
18129
20023
|
|
|
18130
20024
|
// src/components/Tabs/components/TabItem/styled.ts
|
|
18131
|
-
import
|
|
18132
|
-
var Container29 =
|
|
20025
|
+
import styled80 from "styled-components";
|
|
20026
|
+
var Container29 = styled80.div`
|
|
18133
20027
|
@property --bgColor {
|
|
18134
20028
|
syntax: '<color>';
|
|
18135
20029
|
initial-value: #ffffff;
|
|
@@ -18163,8 +20057,8 @@ var Container29 = styled74.div`
|
|
|
18163
20057
|
`;
|
|
18164
20058
|
|
|
18165
20059
|
// src/components/Tabs/components/TabItem/index.tsx
|
|
18166
|
-
import { jsx as
|
|
18167
|
-
var VoidClose = () => /* @__PURE__ */
|
|
20060
|
+
import { jsx as jsx372, jsxs as jsxs191 } from "react/jsx-runtime";
|
|
20061
|
+
var VoidClose = () => /* @__PURE__ */ jsx372(React67.Fragment, {});
|
|
18168
20062
|
var TabItem = (props) => {
|
|
18169
20063
|
const {
|
|
18170
20064
|
active: [active, setActive],
|
|
@@ -18174,16 +20068,16 @@ var TabItem = (props) => {
|
|
|
18174
20068
|
alwaysOpen
|
|
18175
20069
|
} = props;
|
|
18176
20070
|
const CloseComponent = alwaysOpen || tabs.length < 2 ? VoidClose : Close_default;
|
|
18177
|
-
return /* @__PURE__ */
|
|
20071
|
+
return /* @__PURE__ */ jsx372(React67.Fragment, { children: sortedTabs.map(({ index, ...tab }) => {
|
|
18178
20072
|
const isActive = index === active;
|
|
18179
20073
|
const hasSiblings = hasChildren(tabs, tab.group);
|
|
18180
20074
|
const canClose = !props.internal && (!tab.primary || !hasSiblings);
|
|
18181
|
-
return /* @__PURE__ */
|
|
20075
|
+
return /* @__PURE__ */ jsxs191(
|
|
18182
20076
|
Container29,
|
|
18183
20077
|
{
|
|
18184
20078
|
...isActive ? { className: "active" } : {},
|
|
18185
20079
|
children: [
|
|
18186
|
-
/* @__PURE__ */
|
|
20080
|
+
/* @__PURE__ */ jsx372(
|
|
18187
20081
|
LabelItem_default,
|
|
18188
20082
|
{
|
|
18189
20083
|
children: tab.label,
|
|
@@ -18193,7 +20087,7 @@ var TabItem = (props) => {
|
|
|
18193
20087
|
internal: props.internal
|
|
18194
20088
|
}
|
|
18195
20089
|
),
|
|
18196
|
-
canClose && /* @__PURE__ */
|
|
20090
|
+
canClose && /* @__PURE__ */ jsx372(
|
|
18197
20091
|
CloseComponent,
|
|
18198
20092
|
{
|
|
18199
20093
|
index,
|
|
@@ -18211,13 +20105,13 @@ var TabItem = (props) => {
|
|
|
18211
20105
|
var TabItem_default = TabItem;
|
|
18212
20106
|
|
|
18213
20107
|
// src/components/Tabs/styled.ts
|
|
18214
|
-
import
|
|
20108
|
+
import styled81, { css as css52 } from "styled-components";
|
|
18215
20109
|
var delimiters = {
|
|
18216
20110
|
blue: ["blue"],
|
|
18217
20111
|
grey: ["warningGray"]
|
|
18218
20112
|
};
|
|
18219
|
-
var ComponentContainer =
|
|
18220
|
-
var Tabs =
|
|
20113
|
+
var ComponentContainer = styled81.div``;
|
|
20114
|
+
var Tabs = styled81.div`
|
|
18221
20115
|
position: relative;
|
|
18222
20116
|
overflow: hidden;
|
|
18223
20117
|
|
|
@@ -18232,7 +20126,7 @@ var Tabs = styled75.div`
|
|
|
18232
20126
|
bottom: "s4",
|
|
18233
20127
|
left: "0"
|
|
18234
20128
|
}).split(" ");
|
|
18235
|
-
return
|
|
20129
|
+
return css52`
|
|
18236
20130
|
margin: ${top} 0 ${bottom} 0;
|
|
18237
20131
|
padding: 0 ${right} 0 ${left};
|
|
18238
20132
|
`;
|
|
@@ -18240,7 +20134,7 @@ var Tabs = styled75.div`
|
|
|
18240
20134
|
|
|
18241
20135
|
${({ theme: theme4, $internal: internal, $delimiter: delimiter }) => {
|
|
18242
20136
|
const border = delimiter === "none" ? "none" : internal ? `1px solid ${theme4.getColor(...delimiters[delimiter || "grey"])}` : `2px solid ${theme4.getColor(...delimiters[delimiter || "blue"])}`;
|
|
18243
|
-
return
|
|
20137
|
+
return css52`
|
|
18244
20138
|
border-bottom: ${border};
|
|
18245
20139
|
+ ${ComponentContainer} {
|
|
18246
20140
|
border: 1px solid ${theme4.getColor(...delimiters.grey)};
|
|
@@ -18269,12 +20163,12 @@ var Tabs = styled75.div`
|
|
|
18269
20163
|
`;
|
|
18270
20164
|
|
|
18271
20165
|
// src/components/Tabs/index.tsx
|
|
18272
|
-
import { jsx as
|
|
18273
|
-
var VoidProvider = (props) => /* @__PURE__ */
|
|
20166
|
+
import { jsx as jsx373, jsxs as jsxs192 } from "react/jsx-runtime";
|
|
20167
|
+
var VoidProvider = (props) => /* @__PURE__ */ jsx373(React68.Fragment, { children: props.children });
|
|
18274
20168
|
var Component4 = (props) => {
|
|
18275
20169
|
const components = props.components || {};
|
|
18276
|
-
const [options, setOptions] = typeof props.options[1] === "function" ? props.options :
|
|
18277
|
-
const [active, setActive] = Array.isArray(props.active) ? props.active :
|
|
20170
|
+
const [options, setOptions] = typeof props.options[1] === "function" ? props.options : useState34(props.options);
|
|
20171
|
+
const [active, setActive] = Array.isArray(props.active) ? props.active : useState34(props.active);
|
|
18278
20172
|
const sortedTabs = sortTabs(options.map((tab, index) => ({ ...tab, index })));
|
|
18279
20173
|
const activeTabIndex = sortedTabs.findIndex((tab) => tab.index === active);
|
|
18280
20174
|
const divProps = filterObject(props, [
|
|
@@ -18288,15 +20182,15 @@ var Component4 = (props) => {
|
|
|
18288
20182
|
"delimiter",
|
|
18289
20183
|
"spacing"
|
|
18290
20184
|
]);
|
|
18291
|
-
return /* @__PURE__ */
|
|
18292
|
-
/* @__PURE__ */
|
|
20185
|
+
return /* @__PURE__ */ jsxs192(React68.Fragment, { children: [
|
|
20186
|
+
/* @__PURE__ */ jsx373(
|
|
18293
20187
|
Tabs,
|
|
18294
20188
|
{
|
|
18295
20189
|
...divProps,
|
|
18296
20190
|
$internal: props.internal,
|
|
18297
20191
|
$delimiter: props.delimiter,
|
|
18298
20192
|
$spacing: props.spacing,
|
|
18299
|
-
children: /* @__PURE__ */
|
|
20193
|
+
children: /* @__PURE__ */ jsx373(
|
|
18300
20194
|
ScrollButtons_default,
|
|
18301
20195
|
{
|
|
18302
20196
|
...{
|
|
@@ -18304,7 +20198,7 @@ var Component4 = (props) => {
|
|
|
18304
20198
|
tabsLength: options.length,
|
|
18305
20199
|
internal: props.internal
|
|
18306
20200
|
},
|
|
18307
|
-
children: /* @__PURE__ */
|
|
20201
|
+
children: /* @__PURE__ */ jsx373(
|
|
18308
20202
|
TabItem_default,
|
|
18309
20203
|
{
|
|
18310
20204
|
active: [active, setActive],
|
|
@@ -18321,7 +20215,7 @@ var Component4 = (props) => {
|
|
|
18321
20215
|
),
|
|
18322
20216
|
options.map((tab, index) => {
|
|
18323
20217
|
if (tab.component === void 0) {
|
|
18324
|
-
return /* @__PURE__ */
|
|
20218
|
+
return /* @__PURE__ */ jsx373(React68.Fragment, {}, index);
|
|
18325
20219
|
}
|
|
18326
20220
|
const Component5 = components[tab.component];
|
|
18327
20221
|
const Provider7 = Component5.provider || VoidProvider;
|
|
@@ -18341,7 +20235,7 @@ var Component4 = (props) => {
|
|
|
18341
20235
|
return s === label ? prev : { ...prev, label };
|
|
18342
20236
|
});
|
|
18343
20237
|
};
|
|
18344
|
-
return /* @__PURE__ */
|
|
20238
|
+
return /* @__PURE__ */ jsx373(
|
|
18345
20239
|
Provider7,
|
|
18346
20240
|
{
|
|
18347
20241
|
label: tab.label,
|
|
@@ -18350,7 +20244,7 @@ var Component4 = (props) => {
|
|
|
18350
20244
|
setLabel,
|
|
18351
20245
|
...index === active ? {
|
|
18352
20246
|
active: true,
|
|
18353
|
-
children: /* @__PURE__ */
|
|
20247
|
+
children: /* @__PURE__ */ jsx373(ComponentContainer, { children: /* @__PURE__ */ jsx373(
|
|
18354
20248
|
Component5,
|
|
18355
20249
|
{
|
|
18356
20250
|
data: tab.data,
|
|
@@ -18372,8 +20266,8 @@ var Tabs2 = Object.assign(Component4, {
|
|
|
18372
20266
|
var Tabs_default = Tabs2;
|
|
18373
20267
|
|
|
18374
20268
|
// src/components/TextArea/styles.ts
|
|
18375
|
-
import
|
|
18376
|
-
var Container30 =
|
|
20269
|
+
import styled82 from "styled-components";
|
|
20270
|
+
var Container30 = styled82.textarea`
|
|
18377
20271
|
width: ${({ $width: width }) => width};
|
|
18378
20272
|
height: ${({ $height: height }) => height};
|
|
18379
20273
|
resize: none;
|
|
@@ -18385,26 +20279,26 @@ var Container30 = styled76.textarea`
|
|
|
18385
20279
|
`;
|
|
18386
20280
|
|
|
18387
20281
|
// src/components/TextArea/index.tsx
|
|
18388
|
-
import { jsx as
|
|
20282
|
+
import { jsx as jsx374 } from "react/jsx-runtime";
|
|
18389
20283
|
var TextArea = ({
|
|
18390
20284
|
width,
|
|
18391
20285
|
height,
|
|
18392
20286
|
...props
|
|
18393
20287
|
}) => {
|
|
18394
|
-
return /* @__PURE__ */
|
|
20288
|
+
return /* @__PURE__ */ jsx374(Container30, { ...props, $width: width, $height: height });
|
|
18395
20289
|
};
|
|
18396
20290
|
var TextArea_default = TextArea;
|
|
18397
20291
|
|
|
18398
20292
|
// src/components/Toast/styles.ts
|
|
18399
|
-
import
|
|
18400
|
-
var Container31 =
|
|
20293
|
+
import styled83, { css as css53 } from "styled-components";
|
|
20294
|
+
var Container31 = styled83.div`
|
|
18401
20295
|
border-radius: 4px;
|
|
18402
|
-
width: ${({ $size:
|
|
20296
|
+
width: ${({ $size: size4 }) => size4 === "large" ? "837px" : "460px"};
|
|
18403
20297
|
height: 88px;
|
|
18404
20298
|
border: 1px solid transparent;
|
|
18405
20299
|
position: relative;
|
|
18406
20300
|
|
|
18407
|
-
${({ $color: color }) => color === "success" &&
|
|
20301
|
+
${({ $color: color }) => color === "success" && css53`
|
|
18408
20302
|
background-color: #fcfff5;
|
|
18409
20303
|
opacity: 1;
|
|
18410
20304
|
border-color: #a8c599;
|
|
@@ -18416,7 +20310,7 @@ var Container31 = styled77.div`
|
|
|
18416
20310
|
}
|
|
18417
20311
|
`}
|
|
18418
20312
|
|
|
18419
|
-
${({ $color: color }) => color === "error" &&
|
|
20313
|
+
${({ $color: color }) => color === "error" && css53`
|
|
18420
20314
|
background-color: #fff6f6;
|
|
18421
20315
|
opacity: 1;
|
|
18422
20316
|
border-color: #973937;
|
|
@@ -18428,7 +20322,7 @@ var Container31 = styled77.div`
|
|
|
18428
20322
|
}
|
|
18429
20323
|
`}
|
|
18430
20324
|
|
|
18431
|
-
${({ $color: color }) => color === "warning" &&
|
|
20325
|
+
${({ $color: color }) => color === "warning" && css53`
|
|
18432
20326
|
background-color: #fffaf3;
|
|
18433
20327
|
opacity: 1;
|
|
18434
20328
|
border-color: #ccbea0;
|
|
@@ -18449,7 +20343,7 @@ var Container31 = styled77.div`
|
|
|
18449
20343
|
height: 13px;
|
|
18450
20344
|
}
|
|
18451
20345
|
`;
|
|
18452
|
-
var IconContainer3 =
|
|
20346
|
+
var IconContainer3 = styled83.div`
|
|
18453
20347
|
width: 100%;
|
|
18454
20348
|
display: flex;
|
|
18455
20349
|
align-items: center;
|
|
@@ -18457,7 +20351,7 @@ var IconContainer3 = styled77.div`
|
|
|
18457
20351
|
padding: 14px 14px 0 0;
|
|
18458
20352
|
margin: 0;
|
|
18459
20353
|
`;
|
|
18460
|
-
var IconContent =
|
|
20354
|
+
var IconContent = styled83.div`
|
|
18461
20355
|
width: 100%;
|
|
18462
20356
|
padding: 13px 0 21px 28px;
|
|
18463
20357
|
display: flex;
|
|
@@ -18476,20 +20370,20 @@ var IconContent = styled77.div`
|
|
|
18476
20370
|
`;
|
|
18477
20371
|
|
|
18478
20372
|
// src/components/Toast/index.tsx
|
|
18479
|
-
import { jsx as
|
|
20373
|
+
import { jsx as jsx375, jsxs as jsxs193 } from "react/jsx-runtime";
|
|
18480
20374
|
var Toast = ({
|
|
18481
|
-
size:
|
|
20375
|
+
size: size4,
|
|
18482
20376
|
color,
|
|
18483
20377
|
title,
|
|
18484
20378
|
description,
|
|
18485
20379
|
onClose: handlClose,
|
|
18486
20380
|
...props
|
|
18487
20381
|
}) => {
|
|
18488
|
-
return /* @__PURE__ */
|
|
18489
|
-
/* @__PURE__ */
|
|
18490
|
-
/* @__PURE__ */
|
|
18491
|
-
/* @__PURE__ */
|
|
18492
|
-
/* @__PURE__ */
|
|
20382
|
+
return /* @__PURE__ */ jsxs193(Container31, { ...props, $size: size4, $color: color, children: [
|
|
20383
|
+
/* @__PURE__ */ jsx375(IconContainer3, { children: /* @__PURE__ */ jsx375(Icon_default, { type: "feather", icon: "x", onClick: handlClose }) }),
|
|
20384
|
+
/* @__PURE__ */ jsxs193(IconContent, { children: [
|
|
20385
|
+
/* @__PURE__ */ jsx375("h4", { children: title }),
|
|
20386
|
+
/* @__PURE__ */ jsxs193("p", { children: [
|
|
18493
20387
|
" ",
|
|
18494
20388
|
description
|
|
18495
20389
|
] })
|
|
@@ -18499,15 +20393,15 @@ var Toast = ({
|
|
|
18499
20393
|
var Toast_default = Toast;
|
|
18500
20394
|
|
|
18501
20395
|
// src/components/Zoom/index.tsx
|
|
18502
|
-
import
|
|
20396
|
+
import React69, { useState as useState35 } from "react";
|
|
18503
20397
|
|
|
18504
20398
|
// src/components/Zoom/styles.ts
|
|
18505
|
-
import
|
|
18506
|
-
var Image =
|
|
20399
|
+
import styled84 from "styled-components";
|
|
20400
|
+
var Image = styled84.img`
|
|
18507
20401
|
max-width: 100%;
|
|
18508
20402
|
max-height: 100%;
|
|
18509
20403
|
`;
|
|
18510
|
-
var Container32 =
|
|
20404
|
+
var Container32 = styled84.div`
|
|
18511
20405
|
position: relative;
|
|
18512
20406
|
display: inline-flex;
|
|
18513
20407
|
|
|
@@ -18536,7 +20430,7 @@ var Container32 = styled78.div`
|
|
|
18536
20430
|
}};
|
|
18537
20431
|
}
|
|
18538
20432
|
`;
|
|
18539
|
-
var Dimmer =
|
|
20433
|
+
var Dimmer = styled84.div`
|
|
18540
20434
|
position: absolute;
|
|
18541
20435
|
top: 0;
|
|
18542
20436
|
left: 0;
|
|
@@ -18554,10 +20448,10 @@ var Dimmer = styled78.div`
|
|
|
18554
20448
|
opacity: 1;
|
|
18555
20449
|
}
|
|
18556
20450
|
`;
|
|
18557
|
-
var Button7 =
|
|
20451
|
+
var Button7 = styled84(Button_default)`
|
|
18558
20452
|
background-color: ${({ theme: theme4 }) => theme4.getColor("white", 50)};
|
|
18559
20453
|
`;
|
|
18560
|
-
var ModalContent =
|
|
20454
|
+
var ModalContent = styled84.div`
|
|
18561
20455
|
position: absolute;
|
|
18562
20456
|
width: 100%;
|
|
18563
20457
|
height: 100%;
|
|
@@ -18571,12 +20465,12 @@ var ModalContent = styled78.div`
|
|
|
18571
20465
|
`;
|
|
18572
20466
|
|
|
18573
20467
|
// src/components/Zoom/index.tsx
|
|
18574
|
-
import { jsx as
|
|
20468
|
+
import { jsx as jsx376, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
18575
20469
|
var Zoom = (props) => {
|
|
18576
20470
|
const { src, width, height, ...imgProps } = props;
|
|
18577
|
-
const [modalOpened, setModalOpened] =
|
|
18578
|
-
return /* @__PURE__ */
|
|
18579
|
-
/* @__PURE__ */
|
|
20471
|
+
const [modalOpened, setModalOpened] = useState35(false);
|
|
20472
|
+
return /* @__PURE__ */ jsxs194(React69.Fragment, { children: [
|
|
20473
|
+
/* @__PURE__ */ jsxs194(
|
|
18580
20474
|
Container32,
|
|
18581
20475
|
{
|
|
18582
20476
|
...imgProps,
|
|
@@ -18584,8 +20478,8 @@ var Zoom = (props) => {
|
|
|
18584
20478
|
$width: width,
|
|
18585
20479
|
$height: height,
|
|
18586
20480
|
children: [
|
|
18587
|
-
/* @__PURE__ */
|
|
18588
|
-
/* @__PURE__ */
|
|
20481
|
+
/* @__PURE__ */ jsx376(Image, { src, alt: "zoom" }),
|
|
20482
|
+
/* @__PURE__ */ jsx376(Dimmer, { children: /* @__PURE__ */ jsx376(
|
|
18589
20483
|
Button7,
|
|
18590
20484
|
{
|
|
18591
20485
|
content: "Zoom",
|
|
@@ -18596,14 +20490,14 @@ var Zoom = (props) => {
|
|
|
18596
20490
|
]
|
|
18597
20491
|
}
|
|
18598
20492
|
),
|
|
18599
|
-
/* @__PURE__ */
|
|
20493
|
+
/* @__PURE__ */ jsx376(
|
|
18600
20494
|
Modal_default,
|
|
18601
20495
|
{
|
|
18602
20496
|
openState: [modalOpened, setModalOpened],
|
|
18603
20497
|
size: "large",
|
|
18604
20498
|
title: "Zoom",
|
|
18605
20499
|
closeOnClickOutside: true,
|
|
18606
|
-
children: /* @__PURE__ */
|
|
20500
|
+
children: /* @__PURE__ */ jsx376(ModalContent, { children: /* @__PURE__ */ jsx376("img", { src, alt: "zoom" }) })
|
|
18607
20501
|
}
|
|
18608
20502
|
)
|
|
18609
20503
|
] });
|
|
@@ -18629,6 +20523,7 @@ export {
|
|
|
18629
20523
|
Placeholder_default as MwPlaceholder,
|
|
18630
20524
|
ProgressBar_default as MwProgressBar,
|
|
18631
20525
|
ScrollContainer_default as MwScrollContainer,
|
|
20526
|
+
Select_default3 as MwSelect,
|
|
18632
20527
|
Signature_default as MwSignature,
|
|
18633
20528
|
Tabs_default as MwTabs,
|
|
18634
20529
|
TextArea_default as MwTextArea,
|