@lets-events/react 12.10.17 → 12.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +2 -2
- package/.turbo/turbo-build.log +21 -19
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +17 -6
- package/dist/index.d.ts +17 -6
- package/dist/index.js +348 -253
- package/dist/index.mjs +325 -230
- package/package.json +1 -1
- package/src/components/Alert.tsx +303 -303
- package/src/components/Avatar.tsx +55 -55
- package/src/components/Badge.tsx +132 -132
- package/src/components/Box.tsx +3 -3
- package/src/components/Button/index.tsx +85 -85
- package/src/components/Button/styledComponents.ts +361 -361
- package/src/components/ButtonGroup.tsx +484 -484
- package/src/components/Calendar/index.tsx +168 -168
- package/src/components/Calendar/styledComponents.ts +480 -480
- package/src/components/Card.tsx +74 -74
- package/src/components/CheckboxGroup.tsx +176 -176
- package/src/components/Container.tsx +39 -39
- package/src/components/Divider.tsx +7 -7
- package/src/components/DoubleCalendar/index.tsx +204 -204
- package/src/components/Drawer/index.tsx +113 -113
- package/src/components/Drawer/styledComponents.ts +97 -97
- package/src/components/Dropdown.tsx +302 -302
- package/src/components/Filter.tsx +164 -164
- package/src/components/Flex.tsx +130 -130
- package/src/components/FormFields/AddressFormFields/CityFormField.tsx +111 -111
- package/src/components/FormFields/AddressFormFields/CountryFormField.tsx +33 -33
- package/src/components/FormFields/AddressFormFields/PostalCodeFormField.tsx +39 -39
- package/src/components/FormFields/AddressFormFields/StateFormField.tsx +32 -32
- package/src/components/FormFields/AddressFormFields/index.tsx +141 -141
- package/src/components/FormFields/BirthDateFormField.tsx +84 -84
- package/src/components/FormFields/CNPJFormField.tsx +87 -87
- package/src/components/FormFields/CPFFormField.tsx +78 -78
- package/src/components/FormFields/CalendarFormField.tsx +98 -98
- package/src/components/FormFields/CheckboxGroupFormField.tsx +91 -91
- package/src/components/FormFields/DateAndTimeFormField.tsx +217 -217
- package/src/components/FormFields/DoubleCalendarFormField.tsx +96 -96
- package/src/components/FormFields/EmailFormField.tsx +27 -27
- package/src/components/FormFields/Form.tsx +39 -39
- package/src/components/FormFields/IdentityDocumentNumberFormField.tsx +32 -32
- package/src/components/FormFields/MultiSelectFormField.tsx +64 -64
- package/src/components/FormFields/PhoneFormField.tsx +40 -40
- package/src/components/FormFields/RadioGroupFormField.tsx +88 -88
- package/src/components/FormFields/RichEditorFormField.tsx +128 -128
- package/src/components/FormFields/SelectFormField.tsx +113 -113
- package/src/components/FormFields/SwitchFormField.tsx +46 -46
- package/src/components/FormFields/TextAreaFormField.tsx +61 -61
- package/src/components/FormFields/TextFormField.tsx +112 -112
- package/src/components/FormFields/TimePickerFormField.tsx +88 -88
- package/src/components/FormFields/subComponents/ErrorFormMessage.tsx +36 -36
- package/src/components/FormFields/subComponents/FormLabel.tsx +36 -36
- package/src/components/FormFields/utils/validation.ts +23 -23
- package/src/components/Grid.tsx +137 -137
- package/src/components/Icon.tsx +47 -47
- package/src/components/MenuDropdown/index.tsx +38 -38
- package/src/components/MenuDropdown/styledComponents.ts +31 -31
- package/src/components/Modal.tsx +130 -114
- package/src/components/MultiSelect/index.tsx +417 -305
- package/src/components/MultiSelect/styledComponents.ts +176 -160
- package/src/components/RadioGroup.tsx +210 -210
- package/src/components/RichEditor/QuillComponent.tsx +419 -419
- package/src/components/RichEditor/RichEditor.tsx +53 -53
- package/src/components/RichEditor/RichTextPresenter.tsx +18 -18
- package/src/components/RichEditor/editorConfig.ts +149 -149
- package/src/components/RichEditor/index.ts +3 -3
- package/src/components/RichEditor/styledComponents.ts +1175 -1175
- package/src/components/RichEditor/types.ts +12 -12
- package/src/components/Section.tsx +33 -33
- package/src/components/Step.tsx +164 -164
- package/src/components/Switch.tsx +108 -108
- package/src/components/Text.tsx +54 -54
- package/src/components/TextField.tsx +423 -423
- package/src/components/TextareaField.tsx +116 -116
- package/src/components/TimePicker.tsx +357 -357
- package/src/components/Toast/components/ToastItem.tsx +41 -41
- package/src/components/Toast/components/ToastProvider.tsx +63 -63
- package/src/components/Toast/hooks/useToast.ts +12 -12
- package/src/components/Toast/index.tsx +5 -5
- package/src/components/Toast/styles/index.ts +135 -135
- package/src/components/Toast/types/index.ts +46 -46
- package/src/components/ToggleElement/index.tsx +58 -58
- package/src/components/Tooltip/index.tsx +73 -73
- package/src/components/Tooltip/styles.ts +77 -77
- package/src/hooks/useCountries.ts +41 -41
- package/src/hooks/useImageUpload.ts +139 -139
- package/src/hooks/useMediaQuery.ts +19 -0
- package/src/hooks/useOnClickOutside.tsx +42 -42
- package/src/index.tsx +72 -72
- package/src/styles/index.ts +41 -41
- package/src/types/typographyValues.ts +178 -178
- package/src/utils/getNestedValue.ts +3 -3
- package/src/utils/states.ts +29 -29
- package/src/utils/uploadService.ts +180 -180
- package/tsconfig.json +3 -3
- package/tsup.config.ts +38 -38
package/dist/index.mjs
CHANGED
|
@@ -143,7 +143,7 @@ var require_react_is_development = __commonJS({
|
|
|
143
143
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
144
144
|
var Element = REACT_ELEMENT_TYPE;
|
|
145
145
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
146
|
-
var
|
|
146
|
+
var Fragment8 = REACT_FRAGMENT_TYPE;
|
|
147
147
|
var Lazy = REACT_LAZY_TYPE;
|
|
148
148
|
var Memo = REACT_MEMO_TYPE;
|
|
149
149
|
var Portal = REACT_PORTAL_TYPE;
|
|
@@ -202,7 +202,7 @@ var require_react_is_development = __commonJS({
|
|
|
202
202
|
exports.ContextProvider = ContextProvider;
|
|
203
203
|
exports.Element = Element;
|
|
204
204
|
exports.ForwardRef = ForwardRef;
|
|
205
|
-
exports.Fragment =
|
|
205
|
+
exports.Fragment = Fragment8;
|
|
206
206
|
exports.Lazy = Lazy;
|
|
207
207
|
exports.Memo = Memo;
|
|
208
208
|
exports.Portal = Portal;
|
|
@@ -3768,13 +3768,21 @@ function Modal(_a) {
|
|
|
3768
3768
|
title,
|
|
3769
3769
|
trigger,
|
|
3770
3770
|
zIndex,
|
|
3771
|
-
maxWidth
|
|
3771
|
+
maxWidth,
|
|
3772
|
+
maxHeight,
|
|
3773
|
+
height,
|
|
3774
|
+
preventAutoFocus = false,
|
|
3775
|
+
fitContent = false
|
|
3772
3776
|
} = _b, props = __objRest(_b, [
|
|
3773
3777
|
"children",
|
|
3774
3778
|
"title",
|
|
3775
3779
|
"trigger",
|
|
3776
3780
|
"zIndex",
|
|
3777
|
-
"maxWidth"
|
|
3781
|
+
"maxWidth",
|
|
3782
|
+
"maxHeight",
|
|
3783
|
+
"height",
|
|
3784
|
+
"preventAutoFocus",
|
|
3785
|
+
"fitContent"
|
|
3778
3786
|
]);
|
|
3779
3787
|
const { onOpenChange } = props;
|
|
3780
3788
|
return /* @__PURE__ */ jsxs5(ModalRadix.Root, __spreadProps(__spreadValues({}, props), { children: [
|
|
@@ -3788,9 +3796,14 @@ function Modal(_a) {
|
|
|
3788
3796
|
children: /* @__PURE__ */ jsxs5(
|
|
3789
3797
|
ModalContentStyled,
|
|
3790
3798
|
{
|
|
3791
|
-
|
|
3792
|
-
|
|
3799
|
+
onOpenAutoFocus: (event) => {
|
|
3800
|
+
if (preventAutoFocus) {
|
|
3801
|
+
event.preventDefault();
|
|
3802
|
+
}
|
|
3793
3803
|
},
|
|
3804
|
+
css: __spreadValues(__spreadValues(__spreadValues({
|
|
3805
|
+
maxWidth
|
|
3806
|
+
}, maxHeight !== void 0 && { maxHeight }), height !== void 0 && { height }), fitContent && height === void 0 && { height: "fit-content" }),
|
|
3794
3807
|
children: [
|
|
3795
3808
|
title && /* @__PURE__ */ jsxs5(ModalHeaderStyled, { children: [
|
|
3796
3809
|
/* @__PURE__ */ jsx13(ModalTitleStyled, { asChild: true, children: /* @__PURE__ */ jsx13(Text, { typography: "headline6", fontWeight: "medium", children: title }) }),
|
|
@@ -9969,7 +9982,7 @@ function Tooltip({
|
|
|
9969
9982
|
}
|
|
9970
9983
|
|
|
9971
9984
|
// src/components/MultiSelect/index.tsx
|
|
9972
|
-
import React10, { useCallback as useCallback2, useRef as useRef8, useState as
|
|
9985
|
+
import React10, { useCallback as useCallback2, useRef as useRef8, useState as useState10 } from "react";
|
|
9973
9986
|
import { DropdownMenu as DropdownMenu4, Theme as Theme3 } from "@radix-ui/themes";
|
|
9974
9987
|
import { FontAwesomeIcon as FontAwesomeIcon3 } from "@fortawesome/react-fontawesome";
|
|
9975
9988
|
import {
|
|
@@ -9979,6 +9992,22 @@ import {
|
|
|
9979
9992
|
} from "@fortawesome/free-solid-svg-icons";
|
|
9980
9993
|
import { useMemo as useMemo2 } from "react";
|
|
9981
9994
|
|
|
9995
|
+
// src/hooks/useMediaQuery.ts
|
|
9996
|
+
import { useEffect as useEffect8, useState as useState9 } from "react";
|
|
9997
|
+
function useMediaQuery(query) {
|
|
9998
|
+
const [matches, setMatches] = useState9(
|
|
9999
|
+
() => typeof window !== "undefined" ? window.matchMedia(query).matches : false
|
|
10000
|
+
);
|
|
10001
|
+
useEffect8(() => {
|
|
10002
|
+
const media = window.matchMedia(query);
|
|
10003
|
+
const listener = (event) => setMatches(event.matches);
|
|
10004
|
+
setMatches(media.matches);
|
|
10005
|
+
media.addEventListener("change", listener);
|
|
10006
|
+
return () => media.removeEventListener("change", listener);
|
|
10007
|
+
}, [query]);
|
|
10008
|
+
return matches;
|
|
10009
|
+
}
|
|
10010
|
+
|
|
9982
10011
|
// src/components/MultiSelect/styledComponents.ts
|
|
9983
10012
|
import { DropdownMenu as DropdownMenu3 } from "@radix-ui/themes";
|
|
9984
10013
|
var StyledContent = styled(DropdownMenu3.Content, {
|
|
@@ -10090,6 +10119,19 @@ var StyledText = styled(Text, {
|
|
|
10090
10119
|
whiteSpace: "nowrap",
|
|
10091
10120
|
textOverflow: "ellipsis"
|
|
10092
10121
|
});
|
|
10122
|
+
var StyledSectionDivider = styled("div", {
|
|
10123
|
+
borderBottom: "1px solid #CFCFCF",
|
|
10124
|
+
margin: "0 16px"
|
|
10125
|
+
});
|
|
10126
|
+
var StyledSectionTitle = styled(Text, {
|
|
10127
|
+
padding: "$8 $16 $4"
|
|
10128
|
+
});
|
|
10129
|
+
var StyledModalOptionsWrapper = styled("div", {
|
|
10130
|
+
overflowY: "auto",
|
|
10131
|
+
padding: "$16 0",
|
|
10132
|
+
width: "100%",
|
|
10133
|
+
boxSizing: "border-box"
|
|
10134
|
+
});
|
|
10093
10135
|
var ButtonSelectAllStyled = styled("button", {
|
|
10094
10136
|
display: "flex !important",
|
|
10095
10137
|
alignItems: "center",
|
|
@@ -10126,13 +10168,17 @@ var ButtonSelectAllStyled = styled("button", {
|
|
|
10126
10168
|
});
|
|
10127
10169
|
|
|
10128
10170
|
// src/components/MultiSelect/index.tsx
|
|
10129
|
-
import { jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
10171
|
+
import { Fragment as Fragment3, jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
10172
|
+
var MOBILE_MODAL_MAX_HEIGHT = "90vh";
|
|
10173
|
+
var MOBILE_MODAL_HEADER_OFFSET = "65px";
|
|
10174
|
+
var MOBILE_BREAKPOINT = "(max-width: 840px)";
|
|
10130
10175
|
var MultiSelect = React10.forwardRef(
|
|
10131
10176
|
({
|
|
10132
10177
|
placeholder,
|
|
10133
10178
|
value: selectedValues = [],
|
|
10134
10179
|
onValueChange,
|
|
10135
|
-
options,
|
|
10180
|
+
options = [],
|
|
10181
|
+
optionsBySection,
|
|
10136
10182
|
color,
|
|
10137
10183
|
width = "100%",
|
|
10138
10184
|
zIndex = "auto",
|
|
@@ -10146,18 +10192,30 @@ var MultiSelect = React10.forwardRef(
|
|
|
10146
10192
|
selectedScroll = false,
|
|
10147
10193
|
showMoreButton = false,
|
|
10148
10194
|
showMoreButtonLabel = "Carregar mais",
|
|
10149
|
-
showMoreButtonOnClick
|
|
10195
|
+
showMoreButtonOnClick,
|
|
10196
|
+
helperTextAfterField = ""
|
|
10150
10197
|
}, fowardedRef) => {
|
|
10151
|
-
const [isOpen, setIsOpen] =
|
|
10198
|
+
const [isOpen, setIsOpen] = useState10(false);
|
|
10152
10199
|
const triggerRef = useRef8(null);
|
|
10153
|
-
const [allOptionsSelected, setAllOptionsSelected] =
|
|
10200
|
+
const [allOptionsSelected, setAllOptionsSelected] = useState10(false);
|
|
10201
|
+
const isMobile = useMediaQuery(MOBILE_BREAKPOINT);
|
|
10202
|
+
const hasSections = !!(optionsBySection == null ? void 0 : optionsBySection.length);
|
|
10203
|
+
const resolvedOptions = useMemo2(() => {
|
|
10204
|
+
if (hasSections) {
|
|
10205
|
+
return optionsBySection.reduce(
|
|
10206
|
+
(acc, section) => acc.concat(section.options),
|
|
10207
|
+
[]
|
|
10208
|
+
);
|
|
10209
|
+
}
|
|
10210
|
+
return options;
|
|
10211
|
+
}, [hasSections, options, optionsBySection]);
|
|
10154
10212
|
const labelByValue = useMemo2(() => {
|
|
10155
|
-
return
|
|
10213
|
+
return resolvedOptions.reduce((prev, curr) => {
|
|
10156
10214
|
return __spreadProps(__spreadValues({}, prev), {
|
|
10157
10215
|
[curr.value]: curr.label
|
|
10158
10216
|
});
|
|
10159
10217
|
}, {});
|
|
10160
|
-
}, [
|
|
10218
|
+
}, [resolvedOptions]);
|
|
10161
10219
|
const handleRemove = useCallback2(
|
|
10162
10220
|
(value) => {
|
|
10163
10221
|
const newValue = selectedValues.filter((v) => v !== value);
|
|
@@ -10169,16 +10227,16 @@ var MultiSelect = React10.forwardRef(
|
|
|
10169
10227
|
(e) => {
|
|
10170
10228
|
e.preventDefault();
|
|
10171
10229
|
e.stopPropagation();
|
|
10172
|
-
const allSelected = selectedValues.length ===
|
|
10230
|
+
const allSelected = selectedValues.length === resolvedOptions.length;
|
|
10173
10231
|
if (allSelected) {
|
|
10174
10232
|
onValueChange == null ? void 0 : onValueChange([]);
|
|
10175
10233
|
setAllOptionsSelected(false);
|
|
10176
10234
|
} else {
|
|
10177
|
-
onValueChange == null ? void 0 : onValueChange(
|
|
10235
|
+
onValueChange == null ? void 0 : onValueChange(resolvedOptions.map((o) => o.value));
|
|
10178
10236
|
setAllOptionsSelected(true);
|
|
10179
10237
|
}
|
|
10180
10238
|
},
|
|
10181
|
-
[selectedValues,
|
|
10239
|
+
[selectedValues, resolvedOptions, onValueChange]
|
|
10182
10240
|
);
|
|
10183
10241
|
const text = useMemo2(() => {
|
|
10184
10242
|
if (selectedValues.length > 0 && singleSelect) {
|
|
@@ -10186,7 +10244,7 @@ var MultiSelect = React10.forwardRef(
|
|
|
10186
10244
|
return labelByValue[value];
|
|
10187
10245
|
}
|
|
10188
10246
|
return placeholder != null ? placeholder : "Selecione";
|
|
10189
|
-
}, [selectedValues, placeholder, singleSelect]);
|
|
10247
|
+
}, [selectedValues, placeholder, singleSelect, labelByValue]);
|
|
10190
10248
|
const handleItemClick = (v) => {
|
|
10191
10249
|
onValueChange == null ? void 0 : onValueChange([v]);
|
|
10192
10250
|
setIsOpen(false);
|
|
@@ -10200,43 +10258,153 @@ var MultiSelect = React10.forwardRef(
|
|
|
10200
10258
|
},
|
|
10201
10259
|
[disabled]
|
|
10202
10260
|
);
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
|
|
10261
|
+
const triggerElement = /* @__PURE__ */ jsxs16(
|
|
10262
|
+
StyledTrigger,
|
|
10263
|
+
{
|
|
10264
|
+
ref: (r) => {
|
|
10265
|
+
if (!r) return;
|
|
10266
|
+
triggerRef.current = r;
|
|
10267
|
+
if (fowardedRef) {
|
|
10268
|
+
if (typeof fowardedRef === "function") fowardedRef(r);
|
|
10269
|
+
else fowardedRef.current = r;
|
|
10270
|
+
}
|
|
10271
|
+
},
|
|
10272
|
+
color,
|
|
10273
|
+
disabled,
|
|
10274
|
+
style: width !== "100%" ? { width } : void 0,
|
|
10275
|
+
onClick: !isMobile ? handleToggle : void 0,
|
|
10276
|
+
children: [
|
|
10277
|
+
/* @__PURE__ */ jsx27(
|
|
10278
|
+
StyledText,
|
|
10279
|
+
{
|
|
10280
|
+
typography: "labelMedium",
|
|
10281
|
+
color: disabled ? "dark400" : void 0,
|
|
10282
|
+
children: text
|
|
10283
|
+
}
|
|
10284
|
+
),
|
|
10285
|
+
/* @__PURE__ */ jsx27(
|
|
10286
|
+
FontAwesomeIcon3,
|
|
10287
|
+
{
|
|
10288
|
+
icon: isOpen ? faChevronUp2 : faChevronDown2,
|
|
10289
|
+
size: "sm",
|
|
10290
|
+
color: disabled ? colors.dark400 : colors.dark600
|
|
10291
|
+
}
|
|
10292
|
+
)
|
|
10293
|
+
]
|
|
10294
|
+
}
|
|
10295
|
+
);
|
|
10296
|
+
const selectAllBlock = selectedAllOptions && /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
10297
|
+
/* @__PURE__ */ jsxs16(
|
|
10298
|
+
ButtonSelectAllStyled,
|
|
10299
|
+
{
|
|
10300
|
+
css: itemStyle,
|
|
10301
|
+
onClick: (e) => {
|
|
10302
|
+
handleSelectAll(e);
|
|
10303
|
+
setIsOpen(false);
|
|
10304
|
+
},
|
|
10305
|
+
type: "button",
|
|
10306
|
+
children: [
|
|
10307
|
+
/* @__PURE__ */ jsx27("div", { className: allOptionsSelected ? "checked" : "" }),
|
|
10308
|
+
/* @__PURE__ */ jsx27(Text, { typography: "labelSmall", children: selectedAllText ? selectedAllText : "Selecionar Todos" })
|
|
10309
|
+
]
|
|
10310
|
+
}
|
|
10311
|
+
),
|
|
10312
|
+
/* @__PURE__ */ jsx27(StyledSectionDivider, {})
|
|
10313
|
+
] });
|
|
10314
|
+
const showMoreButtonBlock = showMoreButton && showMoreButtonOnClick && /* @__PURE__ */ jsx27(
|
|
10315
|
+
Button,
|
|
10316
|
+
{
|
|
10317
|
+
variant: "menuDropdownItem",
|
|
10318
|
+
color: "brand",
|
|
10319
|
+
onClick: showMoreButtonOnClick,
|
|
10320
|
+
fontWeight: "semibold",
|
|
10321
|
+
type: "button",
|
|
10322
|
+
css: {
|
|
10323
|
+
justifyContent: "flex-start",
|
|
10324
|
+
color: "var(--colors-brand500)!important"
|
|
10325
|
+
},
|
|
10326
|
+
children: showMoreButtonLabel
|
|
10327
|
+
}
|
|
10328
|
+
);
|
|
10329
|
+
const renderCheckboxOptions = () => {
|
|
10330
|
+
if (hasSections) {
|
|
10331
|
+
return optionsBySection.map((section, sectionIndex) => /* @__PURE__ */ jsxs16(React10.Fragment, { children: [
|
|
10332
|
+
sectionIndex > 0 && /* @__PURE__ */ jsx27(StyledSectionDivider, {}),
|
|
10333
|
+
/* @__PURE__ */ jsx27(StyledSectionTitle, { typography: "labelSmall", fontWeight: "semibold", color: "dark600", children: section.name }),
|
|
10334
|
+
section.options.map(({ value, label }, i) => /* @__PURE__ */ jsx27(CheckboxItem, { value, css: itemStyle, children: /* @__PURE__ */ jsx27(Text, { typography: "labelSmall", children: label }) }, `${section.name}-${i}`))
|
|
10335
|
+
] }, section.name));
|
|
10336
|
+
}
|
|
10337
|
+
return resolvedOptions.map(({ value, label }, i) => /* @__PURE__ */ jsx27(CheckboxItem, { value, css: itemStyle, children: /* @__PURE__ */ jsx27(Text, { typography: "labelSmall", children: label }) }, i));
|
|
10338
|
+
};
|
|
10339
|
+
const renderSingleSelectOptions = () => {
|
|
10340
|
+
if (hasSections) {
|
|
10341
|
+
return optionsBySection.map((section, sectionIndex) => /* @__PURE__ */ jsxs16(React10.Fragment, { children: [
|
|
10342
|
+
sectionIndex > 0 && /* @__PURE__ */ jsx27(StyledSectionDivider, {}),
|
|
10343
|
+
/* @__PURE__ */ jsx27(StyledSectionTitle, { typography: "labelSmall", fontWeight: "semibold", color: "dark600", children: section.name }),
|
|
10344
|
+
section.options.map(({ value, label }, i) => /* @__PURE__ */ jsx27(StyledItem2, { onClick: () => handleItemClick(value), children: /* @__PURE__ */ jsx27(Text, { typography: "labelSmall", children: label }) }, `${section.name}-${i}`))
|
|
10345
|
+
] }, section.name));
|
|
10346
|
+
}
|
|
10347
|
+
return resolvedOptions.map(({ value, label }, i) => /* @__PURE__ */ jsx27(StyledItem2, { onClick: () => handleItemClick(value), children: /* @__PURE__ */ jsx27(Text, { typography: "labelSmall", children: label }) }, i));
|
|
10348
|
+
};
|
|
10349
|
+
const optionsContent = !singleSelect ? /* @__PURE__ */ jsx27(
|
|
10350
|
+
CheckboxGroup,
|
|
10351
|
+
{
|
|
10352
|
+
value: selectedValues,
|
|
10353
|
+
onValueChange: (v) => {
|
|
10354
|
+
onValueChange == null ? void 0 : onValueChange(v);
|
|
10355
|
+
setAllOptionsSelected((v || []).length === resolvedOptions.length);
|
|
10356
|
+
},
|
|
10357
|
+
children: /* @__PURE__ */ jsxs16(
|
|
10358
|
+
StyledFlexWithMaxHeight,
|
|
10207
10359
|
{
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
if (typeof fowardedRef === "function") fowardedRef(r);
|
|
10213
|
-
else fowardedRef.current = r;
|
|
10214
|
-
}
|
|
10215
|
-
},
|
|
10216
|
-
color,
|
|
10217
|
-
disabled,
|
|
10218
|
-
style: width !== "100%" ? { width } : void 0,
|
|
10219
|
-
onClick: handleToggle,
|
|
10360
|
+
direction: "column",
|
|
10361
|
+
gap: 8,
|
|
10362
|
+
hasMaxHeight: !!maxHeight && !isMobile,
|
|
10363
|
+
style: maxHeight && !isMobile ? { maxHeight } : void 0,
|
|
10220
10364
|
children: [
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
|
|
10224
|
-
typography: "labelMedium",
|
|
10225
|
-
color: disabled ? "dark400" : void 0,
|
|
10226
|
-
children: text
|
|
10227
|
-
}
|
|
10228
|
-
),
|
|
10229
|
-
/* @__PURE__ */ jsx27(
|
|
10230
|
-
FontAwesomeIcon3,
|
|
10231
|
-
{
|
|
10232
|
-
icon: isOpen ? faChevronUp2 : faChevronDown2,
|
|
10233
|
-
size: "sm",
|
|
10234
|
-
color: disabled ? colors.dark400 : colors.dark600
|
|
10235
|
-
}
|
|
10236
|
-
)
|
|
10365
|
+
selectAllBlock,
|
|
10366
|
+
renderCheckboxOptions(),
|
|
10367
|
+
showMoreButtonBlock
|
|
10237
10368
|
]
|
|
10238
10369
|
}
|
|
10239
|
-
)
|
|
10370
|
+
)
|
|
10371
|
+
}
|
|
10372
|
+
) : /* @__PURE__ */ jsxs16(
|
|
10373
|
+
StyledFlexWithMaxHeight,
|
|
10374
|
+
{
|
|
10375
|
+
direction: "column",
|
|
10376
|
+
gap: 8,
|
|
10377
|
+
hasMaxHeight: !!maxHeight && !isMobile,
|
|
10378
|
+
style: maxHeight && !isMobile ? { maxHeight } : void 0,
|
|
10379
|
+
children: [
|
|
10380
|
+
renderSingleSelectOptions(),
|
|
10381
|
+
showMoreButtonBlock
|
|
10382
|
+
]
|
|
10383
|
+
}
|
|
10384
|
+
);
|
|
10385
|
+
const modalZIndex = zIndex === "auto" ? void 0 : Number(zIndex);
|
|
10386
|
+
return /* @__PURE__ */ jsxs16(Theme3, { style: width !== "100%" ? { width } : void 0, children: [
|
|
10387
|
+
isMobile ? /* @__PURE__ */ jsx27(
|
|
10388
|
+
Modal,
|
|
10389
|
+
{
|
|
10390
|
+
open: disabled ? false : isOpen,
|
|
10391
|
+
onOpenChange: (open) => !disabled && setIsOpen(open),
|
|
10392
|
+
trigger: triggerElement,
|
|
10393
|
+
title: placeholder != null ? placeholder : "Selecione",
|
|
10394
|
+
maxHeight: MOBILE_MODAL_MAX_HEIGHT,
|
|
10395
|
+
zIndex: modalZIndex,
|
|
10396
|
+
preventAutoFocus: true,
|
|
10397
|
+
fitContent: true,
|
|
10398
|
+
children: /* @__PURE__ */ jsx27(
|
|
10399
|
+
StyledModalOptionsWrapper,
|
|
10400
|
+
{
|
|
10401
|
+
css: { maxHeight: `calc(${MOBILE_MODAL_MAX_HEIGHT} - ${MOBILE_MODAL_HEADER_OFFSET})` },
|
|
10402
|
+
children: optionsContent
|
|
10403
|
+
}
|
|
10404
|
+
)
|
|
10405
|
+
}
|
|
10406
|
+
) : /* @__PURE__ */ jsxs16(DropdownMenu4.Root, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
10407
|
+
/* @__PURE__ */ jsx27(DropdownMenu4.Trigger, { children: triggerElement }),
|
|
10240
10408
|
/* @__PURE__ */ jsx27(
|
|
10241
10409
|
StyledContent,
|
|
10242
10410
|
{
|
|
@@ -10244,158 +10412,85 @@ var MultiSelect = React10.forwardRef(
|
|
|
10244
10412
|
width: "100%",
|
|
10245
10413
|
zIndex: zIndex === "auto" ? 999999 : zIndex
|
|
10246
10414
|
},
|
|
10247
|
-
children:
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10260
|
-
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
selectedAllOptions && /* @__PURE__ */ jsxs16(
|
|
10264
|
-
ButtonSelectAllStyled,
|
|
10265
|
-
{
|
|
10266
|
-
css: itemStyle,
|
|
10267
|
-
onClick: (e) => {
|
|
10268
|
-
handleSelectAll(e), setIsOpen(false);
|
|
10269
|
-
},
|
|
10270
|
-
type: "button",
|
|
10271
|
-
children: [
|
|
10272
|
-
/* @__PURE__ */ jsx27("div", { className: allOptionsSelected ? "checked" : "" }),
|
|
10273
|
-
/* @__PURE__ */ jsx27(Text, { typography: "labelSmall", children: selectedAllText ? selectedAllText : "Selecionar Todos" })
|
|
10274
|
-
]
|
|
10275
|
-
}
|
|
10276
|
-
),
|
|
10277
|
-
options.map(({ value, label }, i) => /* @__PURE__ */ jsx27(CheckboxItem, { value, css: itemStyle, children: /* @__PURE__ */ jsx27(Text, { typography: "labelSmall", children: label }) }, i)),
|
|
10278
|
-
showMoreButton && showMoreButtonOnClick && /* @__PURE__ */ jsx27(
|
|
10279
|
-
Button,
|
|
10280
|
-
{
|
|
10281
|
-
variant: "menuDropdownItem",
|
|
10282
|
-
color: "brand",
|
|
10283
|
-
onClick: showMoreButtonOnClick,
|
|
10284
|
-
fontWeight: "semibold",
|
|
10285
|
-
type: "button",
|
|
10286
|
-
css: {
|
|
10287
|
-
justifyContent: "flex-start",
|
|
10288
|
-
color: "var(--colors-brand500)!important"
|
|
10289
|
-
},
|
|
10290
|
-
children: showMoreButtonLabel
|
|
10291
|
-
}
|
|
10292
|
-
)
|
|
10293
|
-
]
|
|
10294
|
-
}
|
|
10295
|
-
)
|
|
10296
|
-
}
|
|
10297
|
-
) : /* @__PURE__ */ jsxs16(
|
|
10298
|
-
StyledFlexWithMaxHeight,
|
|
10415
|
+
children: optionsContent
|
|
10416
|
+
}
|
|
10417
|
+
)
|
|
10418
|
+
] }),
|
|
10419
|
+
/* @__PURE__ */ jsxs16("div", { style: { padding: "4px 8px 0 0" }, children: [
|
|
10420
|
+
helperTextAfterField && /* @__PURE__ */ jsx27(Text, { typography: "captionMedium", fontWeight: "regular", color: "dark600", children: helperTextAfterField }),
|
|
10421
|
+
selectedValues.length > 0 && showSelectedValues && /* @__PURE__ */ jsx27(
|
|
10422
|
+
StyledFlexSelectedItems,
|
|
10423
|
+
{
|
|
10424
|
+
direction: selectedOrientation,
|
|
10425
|
+
gap: 8,
|
|
10426
|
+
align: selectedOrientation === "column" ? "start" : "center",
|
|
10427
|
+
justify: "start",
|
|
10428
|
+
css: __spreadValues({}, selectedScroll && { maxHeight: maxHeight || "400px" }),
|
|
10429
|
+
children: allOptionsSelected ? /* @__PURE__ */ jsxs16(
|
|
10430
|
+
Flex,
|
|
10299
10431
|
{
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
style: maxHeight ? { maxHeight } : void 0,
|
|
10432
|
+
gap: 4,
|
|
10433
|
+
align: "center",
|
|
10434
|
+
css: { flexWrap: "wrap" },
|
|
10304
10435
|
children: [
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
Button,
|
|
10436
|
+
/* @__PURE__ */ jsx27(
|
|
10437
|
+
CloseBtnStyled,
|
|
10308
10438
|
{
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10439
|
+
onClick: (e) => {
|
|
10440
|
+
e.stopPropagation();
|
|
10441
|
+
onValueChange == null ? void 0 : onValueChange([]);
|
|
10442
|
+
setAllOptionsSelected(false);
|
|
10443
|
+
},
|
|
10313
10444
|
type: "button",
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10445
|
+
children: /* @__PURE__ */ jsx27(FontAwesomeIcon3, { icon: faSquareXmark, size: "sm" })
|
|
10446
|
+
}
|
|
10447
|
+
),
|
|
10448
|
+
/* @__PURE__ */ jsx27(
|
|
10449
|
+
Text,
|
|
10450
|
+
{
|
|
10451
|
+
typography: "captionMedium",
|
|
10452
|
+
fontWeight: "regular",
|
|
10453
|
+
color: "dark600",
|
|
10454
|
+
children: "Todos selecionados"
|
|
10455
|
+
}
|
|
10456
|
+
)
|
|
10457
|
+
]
|
|
10458
|
+
},
|
|
10459
|
+
"all-selected"
|
|
10460
|
+
) : selectedValues.map((value) => /* @__PURE__ */ jsxs16(
|
|
10461
|
+
Flex,
|
|
10462
|
+
{
|
|
10463
|
+
gap: 4,
|
|
10464
|
+
align: "center",
|
|
10465
|
+
css: { flexWrap: "wrap" },
|
|
10466
|
+
children: [
|
|
10467
|
+
/* @__PURE__ */ jsx27(
|
|
10468
|
+
CloseBtnStyled,
|
|
10469
|
+
{
|
|
10470
|
+
onClick: (e) => {
|
|
10471
|
+
e.stopPropagation();
|
|
10472
|
+
handleRemove(value);
|
|
10317
10473
|
},
|
|
10318
|
-
|
|
10474
|
+
type: "button",
|
|
10475
|
+
children: /* @__PURE__ */ jsx27(FontAwesomeIcon3, { icon: faSquareXmark, size: "sm" })
|
|
10476
|
+
}
|
|
10477
|
+
),
|
|
10478
|
+
/* @__PURE__ */ jsx27(
|
|
10479
|
+
Text,
|
|
10480
|
+
{
|
|
10481
|
+
typography: "captionMedium",
|
|
10482
|
+
fontWeight: "regular",
|
|
10483
|
+
color: "dark600",
|
|
10484
|
+
children: labelByValue[value]
|
|
10319
10485
|
}
|
|
10320
10486
|
)
|
|
10321
10487
|
]
|
|
10322
|
-
}
|
|
10323
|
-
|
|
10488
|
+
},
|
|
10489
|
+
value
|
|
10490
|
+
))
|
|
10324
10491
|
}
|
|
10325
10492
|
)
|
|
10326
|
-
] })
|
|
10327
|
-
selectedValues.length > 0 && showSelectedValues && /* @__PURE__ */ jsx27(
|
|
10328
|
-
StyledFlexSelectedItems,
|
|
10329
|
-
{
|
|
10330
|
-
direction: selectedOrientation,
|
|
10331
|
-
gap: 8,
|
|
10332
|
-
align: selectedOrientation === "column" ? "start" : "center",
|
|
10333
|
-
justify: "start",
|
|
10334
|
-
css: __spreadValues({}, selectedScroll && { maxHeight: maxHeight || "400px" }),
|
|
10335
|
-
children: allOptionsSelected ? /* @__PURE__ */ jsxs16(
|
|
10336
|
-
Flex,
|
|
10337
|
-
{
|
|
10338
|
-
gap: 4,
|
|
10339
|
-
align: "center",
|
|
10340
|
-
css: { flexWrap: "wrap" },
|
|
10341
|
-
children: [
|
|
10342
|
-
/* @__PURE__ */ jsx27(
|
|
10343
|
-
CloseBtnStyled,
|
|
10344
|
-
{
|
|
10345
|
-
onClick: (e) => {
|
|
10346
|
-
e.stopPropagation();
|
|
10347
|
-
onValueChange == null ? void 0 : onValueChange([]);
|
|
10348
|
-
setAllOptionsSelected(false);
|
|
10349
|
-
},
|
|
10350
|
-
type: "button",
|
|
10351
|
-
children: /* @__PURE__ */ jsx27(FontAwesomeIcon3, { icon: faSquareXmark, size: "sm" })
|
|
10352
|
-
}
|
|
10353
|
-
),
|
|
10354
|
-
/* @__PURE__ */ jsx27(
|
|
10355
|
-
Text,
|
|
10356
|
-
{
|
|
10357
|
-
typography: "captionMedium",
|
|
10358
|
-
fontWeight: "regular",
|
|
10359
|
-
color: "dark600",
|
|
10360
|
-
children: "Todos selecionados"
|
|
10361
|
-
}
|
|
10362
|
-
)
|
|
10363
|
-
]
|
|
10364
|
-
},
|
|
10365
|
-
"all-selected"
|
|
10366
|
-
) : selectedValues.map((value) => /* @__PURE__ */ jsxs16(
|
|
10367
|
-
Flex,
|
|
10368
|
-
{
|
|
10369
|
-
gap: 4,
|
|
10370
|
-
align: "center",
|
|
10371
|
-
css: { flexWrap: "wrap" },
|
|
10372
|
-
children: [
|
|
10373
|
-
/* @__PURE__ */ jsx27(
|
|
10374
|
-
CloseBtnStyled,
|
|
10375
|
-
{
|
|
10376
|
-
onClick: (e) => {
|
|
10377
|
-
e.stopPropagation();
|
|
10378
|
-
handleRemove(value);
|
|
10379
|
-
},
|
|
10380
|
-
type: "button",
|
|
10381
|
-
children: /* @__PURE__ */ jsx27(FontAwesomeIcon3, { icon: faSquareXmark, size: "sm" })
|
|
10382
|
-
}
|
|
10383
|
-
),
|
|
10384
|
-
/* @__PURE__ */ jsx27(
|
|
10385
|
-
Text,
|
|
10386
|
-
{
|
|
10387
|
-
typography: "captionMedium",
|
|
10388
|
-
fontWeight: "regular",
|
|
10389
|
-
color: "dark600",
|
|
10390
|
-
children: labelByValue[value]
|
|
10391
|
-
}
|
|
10392
|
-
)
|
|
10393
|
-
]
|
|
10394
|
-
},
|
|
10395
|
-
value
|
|
10396
|
-
))
|
|
10397
|
-
}
|
|
10398
|
-
)
|
|
10493
|
+
] })
|
|
10399
10494
|
] });
|
|
10400
10495
|
}
|
|
10401
10496
|
);
|
|
@@ -10408,8 +10503,8 @@ var Divider = styled("div", {
|
|
|
10408
10503
|
});
|
|
10409
10504
|
|
|
10410
10505
|
// src/components/ToggleElement/index.tsx
|
|
10411
|
-
import { useState as
|
|
10412
|
-
import { Fragment as
|
|
10506
|
+
import { useState as useState11 } from "react";
|
|
10507
|
+
import { Fragment as Fragment4, jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
10413
10508
|
function ToggleElement({
|
|
10414
10509
|
children,
|
|
10415
10510
|
label,
|
|
@@ -10420,7 +10515,7 @@ function ToggleElement({
|
|
|
10420
10515
|
buttonProps,
|
|
10421
10516
|
onOpenChange
|
|
10422
10517
|
}) {
|
|
10423
|
-
const [internalOpen, setInternalOpen] =
|
|
10518
|
+
const [internalOpen, setInternalOpen] = useState11(defaultOpen);
|
|
10424
10519
|
const isControlled = open !== void 0;
|
|
10425
10520
|
const isOpen = isControlled ? open : internalOpen;
|
|
10426
10521
|
const handleClick = () => {
|
|
@@ -10430,7 +10525,7 @@ function ToggleElement({
|
|
|
10430
10525
|
}
|
|
10431
10526
|
onOpenChange == null ? void 0 : onOpenChange(nextOpen);
|
|
10432
10527
|
};
|
|
10433
|
-
return /* @__PURE__ */ jsxs17(
|
|
10528
|
+
return /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
10434
10529
|
(!isOpen || !hideButtonWhenOpen) && /* @__PURE__ */ jsxs17(
|
|
10435
10530
|
Button,
|
|
10436
10531
|
__spreadProps(__spreadValues({
|
|
@@ -11385,14 +11480,14 @@ var brazilianStates = [
|
|
|
11385
11480
|
];
|
|
11386
11481
|
|
|
11387
11482
|
// src/components/FormFields/AddressFormFields/StateFormField.tsx
|
|
11388
|
-
import { Fragment as
|
|
11483
|
+
import { Fragment as Fragment5, jsx as jsx46 } from "react/jsx-runtime";
|
|
11389
11484
|
function StateFormField({
|
|
11390
11485
|
name,
|
|
11391
11486
|
label,
|
|
11392
11487
|
required,
|
|
11393
11488
|
isBrazil
|
|
11394
11489
|
}) {
|
|
11395
|
-
return /* @__PURE__ */ jsx46(
|
|
11490
|
+
return /* @__PURE__ */ jsx46(Fragment5, { children: isBrazil ? /* @__PURE__ */ jsx46(
|
|
11396
11491
|
SelectFormField,
|
|
11397
11492
|
{
|
|
11398
11493
|
name,
|
|
@@ -11404,9 +11499,9 @@ function StateFormField({
|
|
|
11404
11499
|
}
|
|
11405
11500
|
|
|
11406
11501
|
// src/components/FormFields/AddressFormFields/CityFormField.tsx
|
|
11407
|
-
import { useEffect as
|
|
11502
|
+
import { useEffect as useEffect9, useState as useState12 } from "react";
|
|
11408
11503
|
import { useFormContext as useFormContext5, Controller as Controller2 } from "react-hook-form";
|
|
11409
|
-
import { Fragment as
|
|
11504
|
+
import { Fragment as Fragment6, jsx as jsx47 } from "react/jsx-runtime";
|
|
11410
11505
|
function CityFormField({
|
|
11411
11506
|
name,
|
|
11412
11507
|
label,
|
|
@@ -11417,9 +11512,9 @@ function CityFormField({
|
|
|
11417
11512
|
}) {
|
|
11418
11513
|
const { control, watch } = useFormContext5();
|
|
11419
11514
|
const selectedState = watch(stateName);
|
|
11420
|
-
const [cities, setCities] =
|
|
11421
|
-
const [loading, setLoading] =
|
|
11422
|
-
|
|
11515
|
+
const [cities, setCities] = useState12([]);
|
|
11516
|
+
const [loading, setLoading] = useState12(false);
|
|
11517
|
+
useEffect9(() => {
|
|
11423
11518
|
if (!isBrazil) {
|
|
11424
11519
|
setCities([]);
|
|
11425
11520
|
return;
|
|
@@ -11458,7 +11553,7 @@ function CityFormField({
|
|
|
11458
11553
|
}
|
|
11459
11554
|
fetchCities();
|
|
11460
11555
|
}, [selectedState, isBrazil]);
|
|
11461
|
-
return /* @__PURE__ */ jsx47(
|
|
11556
|
+
return /* @__PURE__ */ jsx47(Fragment6, { children: isBrazil && cities.length > 0 ? /* @__PURE__ */ jsx47(
|
|
11462
11557
|
Controller2,
|
|
11463
11558
|
{
|
|
11464
11559
|
name,
|
|
@@ -11805,10 +11900,10 @@ var EmailFormField = ({
|
|
|
11805
11900
|
import { useController as useController3 } from "react-hook-form";
|
|
11806
11901
|
|
|
11807
11902
|
// src/components/RichEditor/RichEditor.tsx
|
|
11808
|
-
import { useEffect as
|
|
11903
|
+
import { useEffect as useEffect11, useState as useState14 } from "react";
|
|
11809
11904
|
|
|
11810
11905
|
// src/components/RichEditor/QuillComponent.tsx
|
|
11811
|
-
import { useState as
|
|
11906
|
+
import { useState as useState13, useRef as useRef9, useEffect as useEffect10, useCallback as useCallback4 } from "react";
|
|
11812
11907
|
import { useQuill } from "react-quilljs";
|
|
11813
11908
|
|
|
11814
11909
|
// src/utils/uploadService.ts
|
|
@@ -13011,10 +13106,10 @@ var QuillComponent = ({
|
|
|
13011
13106
|
onCharacterCountChange,
|
|
13012
13107
|
maxLength
|
|
13013
13108
|
}) => {
|
|
13014
|
-
const [showVideoModal, setShowVideoModal] =
|
|
13015
|
-
const [videoUrl, setVideoUrl] =
|
|
13016
|
-
const [showLinkModal, setShowLinkModal] =
|
|
13017
|
-
const [linkUrl, setLinkUrl] =
|
|
13109
|
+
const [showVideoModal, setShowVideoModal] = useState13(false);
|
|
13110
|
+
const [videoUrl, setVideoUrl] = useState13("");
|
|
13111
|
+
const [showLinkModal, setShowLinkModal] = useState13(false);
|
|
13112
|
+
const [linkUrl, setLinkUrl] = useState13("");
|
|
13018
13113
|
const videoModalRef = useRef9(null);
|
|
13019
13114
|
const linkModalRef = useRef9(null);
|
|
13020
13115
|
const { addToast, removeToast } = useToast();
|
|
@@ -13067,7 +13162,7 @@ var QuillComponent = ({
|
|
|
13067
13162
|
}),
|
|
13068
13163
|
[disabled, quill, addToast, removeToast, uploadConfig, onChange]
|
|
13069
13164
|
);
|
|
13070
|
-
|
|
13165
|
+
useEffect10(() => {
|
|
13071
13166
|
if (!quill) return;
|
|
13072
13167
|
if (value !== void 0 && value !== null) {
|
|
13073
13168
|
const currentContent = quill.root.innerHTML;
|
|
@@ -13083,7 +13178,7 @@ var QuillComponent = ({
|
|
|
13083
13178
|
}
|
|
13084
13179
|
onCharacterCountChange == null ? void 0 : onCharacterCountChange(quill.getText().trim().length);
|
|
13085
13180
|
}, [quill, value, onCharacterCountChange]);
|
|
13086
|
-
|
|
13181
|
+
useEffect10(() => {
|
|
13087
13182
|
if (quill) {
|
|
13088
13183
|
quill.on("text-change", (delta, oldDelta, source) => {
|
|
13089
13184
|
if (source === "user") {
|
|
@@ -13144,7 +13239,7 @@ var QuillComponent = ({
|
|
|
13144
13239
|
}, 2e3);
|
|
13145
13240
|
}
|
|
13146
13241
|
}, [quill, onChange, handleImageUpload, onCharacterCountChange, formats]);
|
|
13147
|
-
|
|
13242
|
+
useEffect10(() => {
|
|
13148
13243
|
if (quill) {
|
|
13149
13244
|
quill.enable(!disabled);
|
|
13150
13245
|
if (!disabled) {
|
|
@@ -13211,7 +13306,7 @@ var QuillComponent = ({
|
|
|
13211
13306
|
setVideoUrl("");
|
|
13212
13307
|
setShowVideoModal(false);
|
|
13213
13308
|
}, [videoUrl, quill]);
|
|
13214
|
-
|
|
13309
|
+
useEffect10(() => {
|
|
13215
13310
|
const handleClickOutside = (event) => {
|
|
13216
13311
|
if (showVideoModal && videoModalRef.current && !videoModalRef.current.contains(event.target)) {
|
|
13217
13312
|
handleVideoCancel();
|
|
@@ -13373,8 +13468,8 @@ var QuillComponent_default = QuillComponent;
|
|
|
13373
13468
|
// src/components/RichEditor/RichEditor.tsx
|
|
13374
13469
|
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
13375
13470
|
var RichEditor = (props) => {
|
|
13376
|
-
const [isClient, setIsClient] =
|
|
13377
|
-
|
|
13471
|
+
const [isClient, setIsClient] = useState14(false);
|
|
13472
|
+
useEffect11(() => {
|
|
13378
13473
|
setIsClient(typeof window !== "undefined");
|
|
13379
13474
|
}, []);
|
|
13380
13475
|
if (!isClient) return null;
|
|
@@ -13396,8 +13491,8 @@ var RichTextPresenter = ({ richText }) => {
|
|
|
13396
13491
|
var RichTextPresenter_default = RichTextPresenter;
|
|
13397
13492
|
|
|
13398
13493
|
// src/components/FormFields/RichEditorFormField.tsx
|
|
13399
|
-
import { useEffect as
|
|
13400
|
-
import { Fragment as
|
|
13494
|
+
import { useEffect as useEffect12, useState as useState15 } from "react";
|
|
13495
|
+
import { Fragment as Fragment7, jsx as jsx56, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
13401
13496
|
var getPlainTextLengthFromHtml = (html) => {
|
|
13402
13497
|
var _a, _b;
|
|
13403
13498
|
if (!html.trim()) return 0;
|
|
@@ -13445,7 +13540,7 @@ var RichEditorFormField = (_a) => {
|
|
|
13445
13540
|
}
|
|
13446
13541
|
}
|
|
13447
13542
|
});
|
|
13448
|
-
const [caracterQuantity, setCaracterQuantity] =
|
|
13543
|
+
const [caracterQuantity, setCaracterQuantity] = useState15(
|
|
13449
13544
|
() => getRemainingCharacters(maxLength, field.value)
|
|
13450
13545
|
);
|
|
13451
13546
|
const handleCharacterCountChange = (count) => {
|
|
@@ -13453,7 +13548,7 @@ var RichEditorFormField = (_a) => {
|
|
|
13453
13548
|
setCaracterQuantity(Math.max(0, maxLength - count));
|
|
13454
13549
|
}
|
|
13455
13550
|
};
|
|
13456
|
-
|
|
13551
|
+
useEffect12(() => {
|
|
13457
13552
|
setCaracterQuantity(getRemainingCharacters(maxLength, field.value));
|
|
13458
13553
|
}, [field.value, maxLength]);
|
|
13459
13554
|
const fieldError = fieldState.error;
|
|
@@ -13471,7 +13566,7 @@ var RichEditorFormField = (_a) => {
|
|
|
13471
13566
|
}
|
|
13472
13567
|
),
|
|
13473
13568
|
/* @__PURE__ */ jsx56(Badge, { color: "grey", size: "xs", children: caracterQuantity })
|
|
13474
|
-
] }) : /* @__PURE__ */ jsx56(
|
|
13569
|
+
] }) : /* @__PURE__ */ jsx56(Fragment7, { children: label && /* @__PURE__ */ jsx56(
|
|
13475
13570
|
FormLabel,
|
|
13476
13571
|
{
|
|
13477
13572
|
name,
|
|
@@ -13727,7 +13822,7 @@ var TimePickerFormField = (_a) => {
|
|
|
13727
13822
|
|
|
13728
13823
|
// src/components/FormFields/DateAndTimeFormField.tsx
|
|
13729
13824
|
import { useController as useController7 } from "react-hook-form";
|
|
13730
|
-
import { useCallback as useCallback8, useEffect as
|
|
13825
|
+
import { useCallback as useCallback8, useEffect as useEffect13, useMemo as useMemo4, useState as useState16 } from "react";
|
|
13731
13826
|
import { jsx as jsx60, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
13732
13827
|
var DateAndTimeFormField = (_a) => {
|
|
13733
13828
|
var _b = _a, {
|
|
@@ -13815,9 +13910,9 @@ var DateAndTimeFormField = (_a) => {
|
|
|
13815
13910
|
return { selectedDateFromIso: void 0, selectedTimeFromIso: void 0 };
|
|
13816
13911
|
}
|
|
13817
13912
|
}, [isoValue]);
|
|
13818
|
-
const [draftDate, setDraftDate] =
|
|
13819
|
-
const [draftTime, setDraftTime] =
|
|
13820
|
-
|
|
13913
|
+
const [draftDate, setDraftDate] = useState16(selectedDateFromIso);
|
|
13914
|
+
const [draftTime, setDraftTime] = useState16(selectedTimeFromIso);
|
|
13915
|
+
useEffect13(() => {
|
|
13821
13916
|
setDraftDate(selectedDateFromIso);
|
|
13822
13917
|
setDraftTime(selectedTimeFromIso);
|
|
13823
13918
|
}, [selectedDateFromIso, selectedTimeFromIso]);
|
|
@@ -13908,11 +14003,11 @@ var DateAndTimeFormField = (_a) => {
|
|
|
13908
14003
|
};
|
|
13909
14004
|
|
|
13910
14005
|
// src/hooks/useImageUpload.ts
|
|
13911
|
-
import { useState as
|
|
14006
|
+
import { useState as useState17, useCallback as useCallback9 } from "react";
|
|
13912
14007
|
var useImageUpload = (options) => {
|
|
13913
|
-
const [isUploading, setIsUploading] =
|
|
13914
|
-
const [progress, setProgress] =
|
|
13915
|
-
const [error, setError] =
|
|
14008
|
+
const [isUploading, setIsUploading] = useState17(false);
|
|
14009
|
+
const [progress, setProgress] = useState17(null);
|
|
14010
|
+
const [error, setError] = useState17(null);
|
|
13916
14011
|
const {
|
|
13917
14012
|
onSuccess,
|
|
13918
14013
|
onError,
|