@lets-events/react 12.8.2 → 12.8.3
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +29 -12
- package/dist/index.mjs +29 -12
- package/package.json +1 -1
- package/src/components/FormFields/SelectFormField.tsx +20 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @lets-events/react@12.8.
|
|
3
|
+
> @lets-events/react@12.8.3 build
|
|
4
4
|
> tsup src/index.tsx --format esm,cjs --dts --external react
|
|
5
5
|
|
|
6
6
|
[1G[0K[34mCLI[39m Building entry: src/index.tsx
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
[34mCLI[39m Target: es6
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
15
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m395.
|
|
16
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m411.36 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 459ms
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m395.98 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 460ms
|
|
17
17
|
DTS Build start
|
|
18
|
-
DTS ⚡️ Build success in
|
|
19
|
-
DTS dist/index.d.mts
|
|
20
|
-
DTS dist/index.d.ts
|
|
18
|
+
DTS ⚡️ Build success in 8332ms
|
|
19
|
+
DTS dist/index.d.mts 404.05 KB
|
|
20
|
+
DTS dist/index.d.ts 404.05 KB
|
|
21
21
|
[1G[0K⠙[1G[0K
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -15249,13 +15249,16 @@ type SelectFormFieldProps = {
|
|
|
15249
15249
|
required?: boolean;
|
|
15250
15250
|
placeholder?: string;
|
|
15251
15251
|
options: Option[];
|
|
15252
|
+
showMoreButton?: boolean;
|
|
15253
|
+
showMoreButtonLabel?: string;
|
|
15254
|
+
showMoreButtonOnClick?: () => void;
|
|
15252
15255
|
validation?: {
|
|
15253
15256
|
validate?: (value: string) => boolean | string;
|
|
15254
15257
|
};
|
|
15255
15258
|
validationErrorMessage?: string;
|
|
15256
15259
|
defaultValue?: string;
|
|
15257
15260
|
};
|
|
15258
|
-
declare const SelectFormField: ({ name, label, required, placeholder, options, validation, validationErrorMessage, defaultValue, }: SelectFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
15261
|
+
declare const SelectFormField: ({ name, label, required, placeholder, options, showMoreButton, showMoreButtonLabel, showMoreButtonOnClick, validation, validationErrorMessage, defaultValue, }: SelectFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
15259
15262
|
|
|
15260
15263
|
type SwitchFormFieldProps = {
|
|
15261
15264
|
name: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -15249,13 +15249,16 @@ type SelectFormFieldProps = {
|
|
|
15249
15249
|
required?: boolean;
|
|
15250
15250
|
placeholder?: string;
|
|
15251
15251
|
options: Option[];
|
|
15252
|
+
showMoreButton?: boolean;
|
|
15253
|
+
showMoreButtonLabel?: string;
|
|
15254
|
+
showMoreButtonOnClick?: () => void;
|
|
15252
15255
|
validation?: {
|
|
15253
15256
|
validate?: (value: string) => boolean | string;
|
|
15254
15257
|
};
|
|
15255
15258
|
validationErrorMessage?: string;
|
|
15256
15259
|
defaultValue?: string;
|
|
15257
15260
|
};
|
|
15258
|
-
declare const SelectFormField: ({ name, label, required, placeholder, options, validation, validationErrorMessage, defaultValue, }: SelectFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
15261
|
+
declare const SelectFormField: ({ name, label, required, placeholder, options, showMoreButton, showMoreButtonLabel, showMoreButtonOnClick, validation, validationErrorMessage, defaultValue, }: SelectFormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
15259
15262
|
|
|
15260
15263
|
type SwitchFormFieldProps = {
|
|
15261
15264
|
name: string;
|
package/dist/index.js
CHANGED
|
@@ -10898,6 +10898,9 @@ var SelectFormField = ({
|
|
|
10898
10898
|
required,
|
|
10899
10899
|
placeholder = "Selecione",
|
|
10900
10900
|
options,
|
|
10901
|
+
showMoreButton = false,
|
|
10902
|
+
showMoreButtonLabel = "Carregar mais",
|
|
10903
|
+
showMoreButtonOnClick,
|
|
10901
10904
|
validation,
|
|
10902
10905
|
validationErrorMessage = "Este campo \xE9 obrigat\xF3rio.",
|
|
10903
10906
|
defaultValue
|
|
@@ -10931,24 +10934,38 @@ var SelectFormField = ({
|
|
|
10931
10934
|
defaultValue: defaultValue || "",
|
|
10932
10935
|
render: ({ field: { value, onChange } }) => {
|
|
10933
10936
|
const selectedOption = options.find((opt) => opt.value === value);
|
|
10934
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.
|
|
10937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
10935
10938
|
DropdownMenu2,
|
|
10936
10939
|
{
|
|
10937
10940
|
placeholder: (selectedOption == null ? void 0 : selectedOption.label) || placeholder,
|
|
10938
10941
|
fontWeight: "regular",
|
|
10939
10942
|
typography: "labelLarge",
|
|
10940
10943
|
color: haveError ? "error" : "default",
|
|
10941
|
-
children:
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
|
|
10946
|
-
|
|
10947
|
-
|
|
10948
|
-
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
|
|
10944
|
+
children: [
|
|
10945
|
+
options.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10946
|
+
DropdownMenuItem,
|
|
10947
|
+
{
|
|
10948
|
+
value: option.value,
|
|
10949
|
+
onSelect: () => onChange(option.value),
|
|
10950
|
+
fontWeight: "regular",
|
|
10951
|
+
typography: "labelLarge",
|
|
10952
|
+
children: option.label
|
|
10953
|
+
},
|
|
10954
|
+
`${option.value}${index}`
|
|
10955
|
+
)),
|
|
10956
|
+
showMoreButton && showMoreButtonOnClick && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10957
|
+
Button,
|
|
10958
|
+
{
|
|
10959
|
+
variant: "menuDropdownItem",
|
|
10960
|
+
color: "brand",
|
|
10961
|
+
onClick: showMoreButtonOnClick,
|
|
10962
|
+
fontWeight: "semibold",
|
|
10963
|
+
type: "button",
|
|
10964
|
+
css: { justifyContent: "flex-start", color: "var(--colors-brand500)!important" },
|
|
10965
|
+
children: showMoreButtonLabel
|
|
10966
|
+
}
|
|
10967
|
+
)
|
|
10968
|
+
]
|
|
10952
10969
|
}
|
|
10953
10970
|
);
|
|
10954
10971
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -10791,6 +10791,9 @@ var SelectFormField = ({
|
|
|
10791
10791
|
required,
|
|
10792
10792
|
placeholder = "Selecione",
|
|
10793
10793
|
options,
|
|
10794
|
+
showMoreButton = false,
|
|
10795
|
+
showMoreButtonLabel = "Carregar mais",
|
|
10796
|
+
showMoreButtonOnClick,
|
|
10794
10797
|
validation,
|
|
10795
10798
|
validationErrorMessage = "Este campo \xE9 obrigat\xF3rio.",
|
|
10796
10799
|
defaultValue
|
|
@@ -10824,24 +10827,38 @@ var SelectFormField = ({
|
|
|
10824
10827
|
defaultValue: defaultValue || "",
|
|
10825
10828
|
render: ({ field: { value, onChange } }) => {
|
|
10826
10829
|
const selectedOption = options.find((opt) => opt.value === value);
|
|
10827
|
-
return /* @__PURE__ */
|
|
10830
|
+
return /* @__PURE__ */ jsxs23(
|
|
10828
10831
|
DropdownMenu2,
|
|
10829
10832
|
{
|
|
10830
10833
|
placeholder: (selectedOption == null ? void 0 : selectedOption.label) || placeholder,
|
|
10831
10834
|
fontWeight: "regular",
|
|
10832
10835
|
typography: "labelLarge",
|
|
10833
10836
|
color: haveError ? "error" : "default",
|
|
10834
|
-
children:
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
|
|
10837
|
+
children: [
|
|
10838
|
+
options.map((option, index) => /* @__PURE__ */ jsx42(
|
|
10839
|
+
DropdownMenuItem,
|
|
10840
|
+
{
|
|
10841
|
+
value: option.value,
|
|
10842
|
+
onSelect: () => onChange(option.value),
|
|
10843
|
+
fontWeight: "regular",
|
|
10844
|
+
typography: "labelLarge",
|
|
10845
|
+
children: option.label
|
|
10846
|
+
},
|
|
10847
|
+
`${option.value}${index}`
|
|
10848
|
+
)),
|
|
10849
|
+
showMoreButton && showMoreButtonOnClick && /* @__PURE__ */ jsx42(
|
|
10850
|
+
Button,
|
|
10851
|
+
{
|
|
10852
|
+
variant: "menuDropdownItem",
|
|
10853
|
+
color: "brand",
|
|
10854
|
+
onClick: showMoreButtonOnClick,
|
|
10855
|
+
fontWeight: "semibold",
|
|
10856
|
+
type: "button",
|
|
10857
|
+
css: { justifyContent: "flex-start", color: "var(--colors-brand500)!important" },
|
|
10858
|
+
children: showMoreButtonLabel
|
|
10859
|
+
}
|
|
10860
|
+
)
|
|
10861
|
+
]
|
|
10845
10862
|
}
|
|
10846
10863
|
);
|
|
10847
10864
|
}
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import { Flex } from "../Flex";
|
|
|
4
4
|
import { FormLabel } from "./subComponents/FormLabel";
|
|
5
5
|
import { ErrorFormMessage } from "./subComponents/ErrorFormMessage";
|
|
6
6
|
import { getNestedValue } from "../../utils/getNestedValue";
|
|
7
|
+
import { Button } from "../Button";
|
|
7
8
|
|
|
8
9
|
type Option = {
|
|
9
10
|
label: string;
|
|
@@ -16,6 +17,9 @@ export type SelectFormFieldProps = {
|
|
|
16
17
|
required?: boolean;
|
|
17
18
|
placeholder?: string;
|
|
18
19
|
options: Option[];
|
|
20
|
+
showMoreButton?: boolean;
|
|
21
|
+
showMoreButtonLabel?: string;
|
|
22
|
+
showMoreButtonOnClick?: () => void;
|
|
19
23
|
validation?: {
|
|
20
24
|
validate?: (value: string) => boolean | string;
|
|
21
25
|
};
|
|
@@ -29,6 +33,9 @@ export const SelectFormField = ({
|
|
|
29
33
|
required,
|
|
30
34
|
placeholder = "Selecione",
|
|
31
35
|
options,
|
|
36
|
+
showMoreButton = false,
|
|
37
|
+
showMoreButtonLabel = "Carregar mais",
|
|
38
|
+
showMoreButtonOnClick,
|
|
32
39
|
validation,
|
|
33
40
|
validationErrorMessage = "Este campo é obrigatório.",
|
|
34
41
|
defaultValue,
|
|
@@ -82,6 +89,19 @@ export const SelectFormField = ({
|
|
|
82
89
|
{option.label}
|
|
83
90
|
</DropdownMenuItem>
|
|
84
91
|
))}
|
|
92
|
+
|
|
93
|
+
{showMoreButton && showMoreButtonOnClick && (
|
|
94
|
+
<Button
|
|
95
|
+
variant="menuDropdownItem"
|
|
96
|
+
color="brand"
|
|
97
|
+
onClick={showMoreButtonOnClick}
|
|
98
|
+
fontWeight="semibold"
|
|
99
|
+
type="button"
|
|
100
|
+
css={{ justifyContent: "flex-start", color: "var(--colors-brand500)!important" }}
|
|
101
|
+
>
|
|
102
|
+
{showMoreButtonLabel}
|
|
103
|
+
</Button>
|
|
104
|
+
)}
|
|
85
105
|
</DropdownMenu>
|
|
86
106
|
);
|
|
87
107
|
}}
|