@arkyn/components 3.0.1-beta.92 → 3.0.1-beta.94
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/bundle.js +4150 -4009
- package/dist/bundle.umd.cjs +40 -40
- package/dist/components/checkbox/index.js +3 -3
- package/dist/components/currencyInput/index.js +3 -3
- package/dist/components/imageUpload/index.d.ts +2 -0
- package/dist/components/imageUpload/index.d.ts.map +1 -1
- package/dist/components/imageUpload/index.js +3 -2
- package/dist/components/input/index.js +3 -3
- package/dist/components/mapView/index.js +1 -1
- package/dist/components/maskedInput/index.js +3 -3
- package/dist/components/multiSelect/index.d.ts.map +1 -1
- package/dist/components/multiSelect/index.js +2 -2
- package/dist/components/pagination/chevronButton/index.d.ts +9 -0
- package/dist/components/pagination/chevronButton/index.d.ts.map +1 -0
- package/dist/components/pagination/chevronButton/index.js +9 -0
- package/dist/components/pagination/currentButton/index.d.ts +7 -0
- package/dist/components/pagination/currentButton/index.d.ts.map +1 -0
- package/dist/components/pagination/currentButton/index.js +6 -0
- package/dist/components/pagination/index.d.ts +51 -0
- package/dist/components/pagination/index.d.ts.map +1 -0
- package/dist/components/pagination/index.js +37 -0
- package/dist/components/pagination/pageButton/index.d.ts +8 -0
- package/dist/components/pagination/pageButton/index.d.ts.map +1 -0
- package/dist/components/pagination/pageButton/index.js +7 -0
- package/dist/components/pagination/paginationService.d.ts +26 -0
- package/dist/components/pagination/paginationService.d.ts.map +1 -0
- package/dist/components/pagination/paginationService.js +62 -0
- package/dist/components/pagination/spread/index.d.ts +4 -0
- package/dist/components/pagination/spread/index.d.ts.map +1 -0
- package/dist/components/pagination/spread/index.js +7 -0
- package/dist/components/phoneInput/index.d.ts.map +1 -1
- package/dist/components/phoneInput/index.js +2 -2
- package/dist/components/radio/radioGroup/index.js +3 -3
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/index.js +2 -2
- package/dist/components/textarea/index.js +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -66,7 +66,7 @@ import "./styles.css";
|
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
68
|
function Checkbox(props) {
|
|
69
|
-
const { id, name, className:
|
|
69
|
+
const { id, name, className: wrapperClassName = "", size = "md", errorMessage: baseErrorMessage, defaultChecked = false, label, checked: baseChecked = null, onCheck, orientation = "horizontalReverse", value, ...rest } = props;
|
|
70
70
|
const { fieldErrors } = useForm();
|
|
71
71
|
const checkboxRef = useRef(null);
|
|
72
72
|
const checkboxId = id || useId();
|
|
@@ -76,12 +76,12 @@ function Checkbox(props) {
|
|
|
76
76
|
const currentChecked = typeof baseChecked === "boolean" ? baseChecked : isChecked;
|
|
77
77
|
const errorClass = isError ? "errorTrue" : "errorFalse";
|
|
78
78
|
const currentCheckedClass = currentChecked ? "checkedTrue" : "checkedFalse";
|
|
79
|
-
const className = `arkynCheckbox ${size} ${errorClass} ${currentCheckedClass}
|
|
79
|
+
const className = `arkynCheckbox ${size} ${errorClass} ${currentCheckedClass}`;
|
|
80
80
|
function handleCheck() {
|
|
81
81
|
const defaultChecked = isChecked;
|
|
82
82
|
setIsChecked(!defaultChecked);
|
|
83
83
|
onCheck && onCheck(!defaultChecked ? value || "checked" : "");
|
|
84
84
|
}
|
|
85
|
-
return (_jsxs(FieldWrapper, { orientation: orientation, children: [label && _jsx(FieldLabel, { htmlFor: checkboxId, children: label }), _jsxs("button", { id: checkboxId, type: "button", className: className, onClick: handleCheck, ...rest, children: [_jsx("input", { type: "hidden", name: name, ref: checkboxRef, value: currentChecked ? value || "checked" : "" }), _jsx(Check, {})] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
85
|
+
return (_jsxs(FieldWrapper, { orientation: orientation, className: wrapperClassName, children: [label && _jsx(FieldLabel, { htmlFor: checkboxId, children: label }), _jsxs("button", { id: checkboxId, type: "button", className: className, onClick: handleCheck, ...rest, children: [_jsx("input", { type: "hidden", name: name, ref: checkboxRef, value: currentChecked ? value || "checked" : "" }), _jsx(Check, {})] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
86
86
|
}
|
|
87
87
|
export { Checkbox };
|
|
@@ -82,7 +82,7 @@ import "./style.css";
|
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
84
84
|
function CurrencyInput(props) {
|
|
85
|
-
const { name, disabled, title, style, variant = "solid", label, className:
|
|
85
|
+
const { name, disabled, title, style, variant = "solid", label, className: wrapperClassName = "", value, defaultValue, max = 1000000000, locale, onChange, prefix, suffix, isLoading = false, leftIcon, readOnly, onFocus, onBlur, errorMessage: baseErrorMessage, showAsterisk, rightIcon, size = "md", id, ...rest } = props;
|
|
86
86
|
const { fieldErrors } = useForm();
|
|
87
87
|
const [isFocused, setIsFocused] = useState(false);
|
|
88
88
|
const [maskedValue, setMaskedValue] = useState("0");
|
|
@@ -135,7 +135,7 @@ function CurrencyInput(props) {
|
|
|
135
135
|
const errored = isError ? "errored" : "";
|
|
136
136
|
const opacity = isDisabled || readOnly || isLoading ? "opacity" : "";
|
|
137
137
|
const focused = isFocused ? "focused" : "";
|
|
138
|
-
const className = `arkynCurrencyInput ${hasPrefix} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}
|
|
139
|
-
return (_jsxs(FieldWrapper, { children: [label && (_jsx(FieldLabel, { showAsterisk: showAsterisk, htmlFor: inputId, children: label })), _jsxs("section", { title: title, style: style,
|
|
138
|
+
const className = `arkynCurrencyInput ${hasPrefix} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}`;
|
|
139
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && (_jsx(FieldLabel, { showAsterisk: showAsterisk, htmlFor: inputId, children: label })), _jsxs("section", { title: title, style: style, className: className, onClick: handleSectionClick, children: [_jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), _jsx(IconRenderer, { show: showLeftSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { show: !isLoading, icon: leftIcon, iconSize: iconSize }), _jsx("input", { disabled: isDisabled, readOnly: readOnly, ref: inputRef, onFocus: handleFocus, onBlur: handleBlur, onChange: handleChange, id: inputId, placeholder: isDisabled ? maskedValue : undefined, value: isDisabled ? undefined : maskedValue, ...rest }), _jsx("input", { type: "hidden", name: name, value: normalizeValue(maskedValue), readOnly: true }), _jsx(IconRenderer, { show: !isLoading, icon: rightIcon, iconSize: iconSize }), _jsx(IconRenderer, { show: showRightSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { iconSize: iconSize, icon: suffix, className: "suffix" })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
140
140
|
}
|
|
141
141
|
export { CurrencyInput };
|
|
@@ -3,6 +3,7 @@ type ImageUploadProps = {
|
|
|
3
3
|
name: string;
|
|
4
4
|
action: string;
|
|
5
5
|
defaultValue?: string | null;
|
|
6
|
+
className?: string;
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
label?: string;
|
|
8
9
|
showAsterisk?: boolean;
|
|
@@ -22,6 +23,7 @@ type ImageUploadProps = {
|
|
|
22
23
|
* @param props.name - Required field name for form handling
|
|
23
24
|
* @param props.defaultValue - Initial image URL to display as preview. Default: ""
|
|
24
25
|
* @param props.disabled - Whether the image upload is disabled. Default: false
|
|
26
|
+
* @param props.className - Additional class name(s) for the wrapper element
|
|
25
27
|
* @param props.label - Optional label text to display above the image upload area
|
|
26
28
|
* @param props.showAsterisk - Whether to show asterisk on label for required fields. Default: false
|
|
27
29
|
* @param props.changeImageButtonText - Text for the button to change/replace an uploaded image. Default: "Alterar imagem"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/imageUpload/index.tsx"],"names":[],"mappings":"AASA,OAAO,cAAc,CAAC;AAEtB,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/imageUpload/index.tsx"],"names":[],"mappings":"AASA,OAAO,cAAc,CAAC;AAEtB,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8FG;AAEH,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAqG3C;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -14,6 +14,7 @@ import "./styles.css";
|
|
|
14
14
|
* @param props.name - Required field name for form handling
|
|
15
15
|
* @param props.defaultValue - Initial image URL to display as preview. Default: ""
|
|
16
16
|
* @param props.disabled - Whether the image upload is disabled. Default: false
|
|
17
|
+
* @param props.className - Additional class name(s) for the wrapper element
|
|
17
18
|
* @param props.label - Optional label text to display above the image upload area
|
|
18
19
|
* @param props.showAsterisk - Whether to show asterisk on label for required fields. Default: false
|
|
19
20
|
* @param props.changeImageButtonText - Text for the button to change/replace an uploaded image. Default: "Alterar imagem"
|
|
@@ -102,7 +103,7 @@ import "./styles.css";
|
|
|
102
103
|
* ```
|
|
103
104
|
*/
|
|
104
105
|
function ImageUpload(props) {
|
|
105
|
-
const { name, defaultValue = "", label, showAsterisk = false, action, fileName = "file", method = "POST", acceptImage = "image/*", fileResponseName = "url", changeImageButtonText = "Alterar imagem", selectImageButtonText = "Selecionar imagem", dropImageText = "Ou arraste e solte a imagem aqui", onChange, disabled = false, } = props;
|
|
106
|
+
const { name, defaultValue = "", label, showAsterisk = false, action, fileName = "file", className: wrapperClassName = "", method = "POST", acceptImage = "image/*", fileResponseName = "url", changeImageButtonText = "Alterar imagem", selectImageButtonText = "Selecionar imagem", dropImageText = "Ou arraste e solte a imagem aqui", onChange, disabled = false, } = props;
|
|
106
107
|
const { fieldErrors } = useForm();
|
|
107
108
|
const fieldError = fieldErrors?.[name];
|
|
108
109
|
const [value, setValue] = useState(defaultValue);
|
|
@@ -143,6 +144,6 @@ function ImageUpload(props) {
|
|
|
143
144
|
const hasErrorClassName = errorMessage ? "hasError" : "noHasError";
|
|
144
145
|
const hasImageClassName = filePath ? "hasImage" : "noHasImage";
|
|
145
146
|
const className = `arkynImageUpload ${hasErrorClassName} ${hasImageClassName}`;
|
|
146
|
-
return (_jsxs(FieldWrapper, { children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs("div", { className: className, children: [_jsx("input", { type: "hidden", name: name, value: value || "" }), !filePath && (_jsx(NoFileContent, { disabled: disabled, isLoading: isLoading, acceptImage: acceptImage, dropImageText: dropImageText, handleSelectFile: handleSelectFile, selectImageButtonText: selectImageButtonText })), filePath && (_jsx(HasFileContent, { disabled: disabled, isLoading: isLoading, acceptImage: acceptImage, filePath: filePath, handleSelectFile: handleSelectFile, changeImageButtonText: changeImageButtonText, reSendImage: !!errorMessage && file ? () => handleUploadImage(file) : undefined }))] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
147
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs("div", { className: className, children: [_jsx("input", { type: "hidden", name: name, value: value || "" }), !filePath && (_jsx(NoFileContent, { disabled: disabled, isLoading: isLoading, acceptImage: acceptImage, dropImageText: dropImageText, handleSelectFile: handleSelectFile, selectImageButtonText: selectImageButtonText })), filePath && (_jsx(HasFileContent, { disabled: disabled, isLoading: isLoading, acceptImage: acceptImage, filePath: filePath, handleSelectFile: handleSelectFile, changeImageButtonText: changeImageButtonText, reSendImage: !!errorMessage && file ? () => handleUploadImage(file) : undefined }))] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
147
148
|
}
|
|
148
149
|
export { ImageUpload };
|
|
@@ -70,7 +70,7 @@ import "./style.css";
|
|
|
70
70
|
* ```
|
|
71
71
|
*/
|
|
72
72
|
function Input(props) {
|
|
73
|
-
const { name, disabled, title, style, variant = "solid", label, className:
|
|
73
|
+
const { name, disabled, title, style, variant = "solid", label, className: wrapperClassName = "", prefix, suffix, isLoading = false, leftIcon, readOnly, onFocus, onBlur, errorMessage: baseErrorMessage, showAsterisk, rightIcon, type = "text", size = "md", id, value, placeholder, ...rest } = props;
|
|
74
74
|
const { fieldErrors } = useForm();
|
|
75
75
|
const [isFocused, setIsFocused] = useState(false);
|
|
76
76
|
const inputRef = useRef(null);
|
|
@@ -108,7 +108,7 @@ function Input(props) {
|
|
|
108
108
|
const opacity = isDisabled || readOnly || isLoading ? "opacity" : "";
|
|
109
109
|
const focused = isFocused ? "focused" : "";
|
|
110
110
|
const disabledClass = disabled ? "disabled" : "";
|
|
111
|
-
const className = `arkynInput ${hasPrefix} ${disabledClass} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}
|
|
112
|
-
return (_jsxs(FieldWrapper, { children: [label && (_jsx(FieldLabel, { showAsterisk: showAsterisk, htmlFor: inputId, children: label })), _jsxs("section", { title: title, style: style, onClick: handleSectionClick, className: className, children: [_jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), _jsx(IconRenderer, { show: showLeftSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { show: !isLoading, icon: leftIcon, iconSize: iconSize }), _jsx("input", { disabled: isDisabled, readOnly: readOnly, ref: inputRef, onFocus: handleFocus, onBlur: handleBlur, type: type, id: inputId, name: name, placeholder: isDisabled ? value || placeholder : placeholder, value: isDisabled ? undefined : value, ...rest }), _jsx(IconRenderer, { show: !isLoading, icon: rightIcon, iconSize: iconSize }), _jsx(IconRenderer, { show: showRightSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { iconSize: iconSize, icon: suffix, className: "suffix" })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
111
|
+
const className = `arkynInput ${hasPrefix} ${disabledClass} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}`;
|
|
112
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && (_jsx(FieldLabel, { showAsterisk: showAsterisk, htmlFor: inputId, children: label })), _jsxs("section", { title: title, style: style, onClick: handleSectionClick, className: className, children: [_jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), _jsx(IconRenderer, { show: showLeftSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { show: !isLoading, icon: leftIcon, iconSize: iconSize }), _jsx("input", { disabled: isDisabled, readOnly: readOnly, ref: inputRef, onFocus: handleFocus, onBlur: handleBlur, type: type, id: inputId, name: name, placeholder: isDisabled ? value || placeholder : placeholder, value: isDisabled ? undefined : value, ...rest }), _jsx(IconRenderer, { show: !isLoading, icon: rightIcon, iconSize: iconSize }), _jsx(IconRenderer, { show: showRightSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { iconSize: iconSize, icon: suffix, className: "suffix" })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
113
113
|
}
|
|
114
114
|
export { Input };
|
|
@@ -8,7 +8,7 @@ function MapView(props) {
|
|
|
8
8
|
return (_jsx("div", { className: "arkynMapViewPinnedEmpty " + className, ...rest, children: _jsx(MapPinned, {}) }));
|
|
9
9
|
}
|
|
10
10
|
return (_jsx("div", { className: "arkynMapViewPinned " + className, ...rest, children: _jsx(Map, { zoom: zoom, center: coordinates, mapContainerStyle: {
|
|
11
|
-
borderRadius: "
|
|
11
|
+
borderRadius: "8px",
|
|
12
12
|
width: "100%",
|
|
13
13
|
height: "100%",
|
|
14
14
|
}, children: _jsx(Marker, { draggable: draggable, position: coordinates }) }) }));
|
|
@@ -91,7 +91,7 @@ const BaseInput = forwardRef((props, ref) => {
|
|
|
91
91
|
* ```
|
|
92
92
|
*/
|
|
93
93
|
function MaskedInput(props) {
|
|
94
|
-
const { name, disabled, title, style, variant = "solid", separate, mask, showMask, replacement, label, className:
|
|
94
|
+
const { name, disabled, title, style, variant = "solid", separate, mask, showMask, replacement, label, className: wrapperClassName = "", prefix, suffix, isLoading = false, leftIcon, readOnly, onFocus, onBlur, errorMessage: baseErrorMessage, defaultValue, showAsterisk, rightIcon, size = "md", id, value, placeholder, ...rest } = props;
|
|
95
95
|
const { fieldErrors } = useForm();
|
|
96
96
|
const [isFocused, setIsFocused] = useState(false);
|
|
97
97
|
const inputRef = useRef(null);
|
|
@@ -125,7 +125,7 @@ function MaskedInput(props) {
|
|
|
125
125
|
const errored = isError ? "errored" : "";
|
|
126
126
|
const opacity = isDisabled || readOnly || isLoading ? "opacity" : "";
|
|
127
127
|
const focused = isFocused ? "focused" : "";
|
|
128
|
-
const className = `arkynMaskedInput ${hasPrefix} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}
|
|
129
|
-
return (_jsxs(FieldWrapper, { children: [label && (_jsx(FieldLabel, { showAsterisk: showAsterisk, htmlFor: inputId, children: label })), _jsxs("section", { title: title, style: style, onClick: handleSectionClick, className: className, children: [_jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), _jsx(IconRenderer, { show: showLeftSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { show: !isLoading, icon: leftIcon, iconSize: iconSize }), _jsx(InputMask, { component: BaseInput, mask: mask, replacement: replacement, separate: separate, showMask: showMask, ref: inputRef, onFocus: handleFocus, onBlur: handleBlur, disabled: isDisabled, readOnly: readOnly, id: inputId, name: name, defaultValue: defaultValue || undefined, placeholder: isDisabled ? value || placeholder : placeholder, value: isDisabled ? undefined : value, ...rest }), _jsx(IconRenderer, { show: !isLoading, icon: rightIcon, iconSize: iconSize }), _jsx(IconRenderer, { show: showRightSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { iconSize: iconSize, icon: suffix, className: "suffix" })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
128
|
+
const className = `arkynMaskedInput ${hasPrefix} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}`;
|
|
129
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && (_jsx(FieldLabel, { showAsterisk: showAsterisk, htmlFor: inputId, children: label })), _jsxs("section", { title: title, style: style, onClick: handleSectionClick, className: className, children: [_jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), _jsx(IconRenderer, { show: showLeftSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { show: !isLoading, icon: leftIcon, iconSize: iconSize }), _jsx(InputMask, { component: BaseInput, mask: mask, replacement: replacement, separate: separate, showMask: showMask, ref: inputRef, onFocus: handleFocus, onBlur: handleBlur, disabled: isDisabled, readOnly: readOnly, id: inputId, name: name, defaultValue: defaultValue || undefined, placeholder: isDisabled ? value || placeholder : placeholder, value: isDisabled ? undefined : value, ...rest }), _jsx(IconRenderer, { show: !isLoading, icon: rightIcon, iconSize: iconSize }), _jsx(IconRenderer, { show: showRightSpinner, iconSize: iconSize, className: "spinner", icon: Loader2 }), _jsx(IconRenderer, { iconSize: iconSize, icon: suffix, className: "suffix" })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
130
130
|
}
|
|
131
131
|
export { MaskedInput };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/multiSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAA2B,MAAM,OAAO,CAAC;AAiB5D,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE5C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,C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,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAErC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAEjD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;IAE5C,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,QAAQ,CAAC,EAAE,UAAU,CAAC;IAEtB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AAEH,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAwK3C;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -104,7 +104,7 @@ import { MultiSelectSpinner } from "./multiSelectSpinner";
|
|
|
104
104
|
* ```
|
|
105
105
|
*/
|
|
106
106
|
function MultiSelect(props) {
|
|
107
|
-
const { name, options, className = "", placeholder = "Selecione...", closeOnSelect = false, defaultValue = [], errorMessage: baseErrorMessage, isLoading = false, readOnly = false, isSearchable = false, id, label, optionMaxHeight, showAsterisk, leftIcon: LeftIcon, onSearch, onChange, onBlur, notFoundText = "Sem opções disponíveis", onFocus, disabled: baseDisabled = false, prefix, size = "md", value, variant = "solid", } = props;
|
|
107
|
+
const { name, options, className: wrapperClassName = "", placeholder = "Selecione...", closeOnSelect = false, defaultValue = [], errorMessage: baseErrorMessage, isLoading = false, readOnly = false, isSearchable = false, id, label, optionMaxHeight, showAsterisk, leftIcon: LeftIcon, onSearch, onChange, onBlur, notFoundText = "Sem opções disponíveis", onFocus, disabled: baseDisabled = false, prefix, size = "md", value, variant = "solid", } = props;
|
|
108
108
|
const { fieldErrors } = useForm();
|
|
109
109
|
const multiSelectRef = useRef(null);
|
|
110
110
|
const multiSelectId = id || useId();
|
|
@@ -164,6 +164,6 @@ function MultiSelect(props) {
|
|
|
164
164
|
return true;
|
|
165
165
|
return false;
|
|
166
166
|
});
|
|
167
|
-
return (_jsxs(FieldWrapper, { children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs(MultiSelectContainer, { handleContainerFocus: handleContainerFocus, disabled: disabled, isError: isError, isFocused: isFocused, isLoading: isLoading, readOnly: readOnly, size: size, variant: variant,
|
|
167
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs(MultiSelectContainer, { handleContainerFocus: handleContainerFocus, disabled: disabled, isError: isError, isFocused: isFocused, isLoading: isLoading, readOnly: readOnly, size: size, variant: variant, prefixExists: !!prefix, id: multiSelectId, children: [_jsx("input", { ref: multiSelectRef, name: name, value: JSON.stringify(forceSelectedOptions), type: "hidden" }), _jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), LeftIcon && _jsx(LeftIcon, { size: iconSize, strokeWidth: 2.5 }), _jsxs(MultiSelectContent, { size: size, children: [forceSelectedOptions.map((value) => (_jsx(MultiSelectMark, { label: getOptionLabel(value), value: value, handleChangeValue: handleChangeValue, disabled: disabled }, value))), forceSelectedOptions.length <= 0 && _jsx("p", { children: placeholder })] }), _jsxs(MultiSelectOptionsContainer, { isFocused: isFocused, isSearchable: isSearchable, search: search, onSearch: handleSearch, children: [mappedOptions.map(({ label, value }) => (_jsx(MultiSelectOption, { label: label, value: value, size: size, handleChangeValue: handleChangeValue, optionHasSelected: optionHasSelected }, value))), mappedOptions.length <= 0 && _jsx("p", { children: notFoundText })] }), _jsx(MultiSelectChevron, { disabled: disabled, isFocused: isFocused, readOnly: readOnly, iconSize: iconSize, isLoading: isLoading }), _jsx(MultiSelectSpinner, { iconSize: iconSize, isLoading: isLoading }), _jsx(MultiSelectOverlay, { handleBlur: handleBlur, isFocused: isFocused })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
168
168
|
}
|
|
169
169
|
export { MultiSelect };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./styles.css";
|
|
2
|
+
type ChevronButtonProps = {
|
|
3
|
+
orientation: "left" | "right";
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
handlePageChange: () => void;
|
|
6
|
+
};
|
|
7
|
+
declare function ChevronButton(props: ChevronButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { ChevronButton };
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/pagination/chevronButton/index.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAEtB,KAAK,kBAAkB,GAAG;IACxB,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAEF,iBAAS,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CAa/C;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
function ChevronButton(props) {
|
|
5
|
+
const { orientation, handlePageChange, disabled } = props;
|
|
6
|
+
const icon = { left: _jsx(ChevronLeft, {}), right: _jsx(ChevronRight, {}) };
|
|
7
|
+
return (_jsx("button", { className: "arkynChevronPageButton", disabled: disabled, onClick: handlePageChange, children: icon[orientation] }));
|
|
8
|
+
}
|
|
9
|
+
export { ChevronButton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/pagination/currentButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,KAAK,kBAAkB,GAAG;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,iBAAS,aAAa,CAAC,EAAE,WAAW,EAAE,EAAE,kBAAkB,2CAMzD;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Pagination component.
|
|
5
|
+
*/
|
|
6
|
+
type PaginationProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Number of sibling pages to show on each side of the current page.
|
|
9
|
+
* @default 1
|
|
10
|
+
*/
|
|
11
|
+
siblingsCount?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Total number of records/items to paginate.
|
|
14
|
+
*/
|
|
15
|
+
totalCountRegisters: number;
|
|
16
|
+
/**
|
|
17
|
+
* The currently active page number (1-indexed).
|
|
18
|
+
*/
|
|
19
|
+
currentPage: number;
|
|
20
|
+
/**
|
|
21
|
+
* Number of records to display per page.
|
|
22
|
+
* @default 10
|
|
23
|
+
*/
|
|
24
|
+
registerPerPage?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Callback function triggered when the page changes.
|
|
27
|
+
* @param page - The new page number
|
|
28
|
+
*/
|
|
29
|
+
onChange?: (page: number) => void;
|
|
30
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "onChange">;
|
|
31
|
+
/**
|
|
32
|
+
* Pagination component for navigating through paginated data.
|
|
33
|
+
*
|
|
34
|
+
* @component
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* <Pagination
|
|
38
|
+
* totalCountRegisters={100}
|
|
39
|
+
* currentPage={1}
|
|
40
|
+
* registerPerPage={10}
|
|
41
|
+
* siblingsCount={1}
|
|
42
|
+
* onChange={(page) => console.log('Page changed to:', page)}
|
|
43
|
+
* />
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @param props - The component props
|
|
47
|
+
* @returns A pagination navigation component with page numbers and navigation buttons
|
|
48
|
+
*/
|
|
49
|
+
declare function Pagination(props: PaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export { Pagination };
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/pagination/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAQvC,OAAO,cAAc,CAAC;AAEtB;;GAEG;AACH,KAAK,eAAe,GAAG;IACrB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAErD;;;;;;;;;;;;;;;;;GAiBG;AAEH,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,2CA6EzC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronButton } from "./chevronButton";
|
|
3
|
+
import { CurrentButton } from "./currentButton";
|
|
4
|
+
import { PageButton } from "./pageButton";
|
|
5
|
+
import { PaginationService } from "./paginationService";
|
|
6
|
+
import { Spread } from "./spread";
|
|
7
|
+
import "./styles.css";
|
|
8
|
+
/**
|
|
9
|
+
* Pagination component for navigating through paginated data.
|
|
10
|
+
*
|
|
11
|
+
* @component
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Pagination
|
|
15
|
+
* totalCountRegisters={100}
|
|
16
|
+
* currentPage={1}
|
|
17
|
+
* registerPerPage={10}
|
|
18
|
+
* siblingsCount={1}
|
|
19
|
+
* onChange={(page) => console.log('Page changed to:', page)}
|
|
20
|
+
* />
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @param props - The component props
|
|
24
|
+
* @returns A pagination navigation component with page numbers and navigation buttons
|
|
25
|
+
*/
|
|
26
|
+
function Pagination(props) {
|
|
27
|
+
const { totalCountRegisters: baseTotalCountRegisters, siblingsCount: baseSiblingsCount, currentPage: baseCurrentPage, registerPerPage: baseRegisterPerPage, onChange: baseOnChange, ...rest } = props;
|
|
28
|
+
const { currentPage, siblingsCount, previousPages, nextPages, lastPage, handlePageChange, handleMinusChange, handlePlusChange, } = new PaginationService({
|
|
29
|
+
totalCountRegisters: baseTotalCountRegisters,
|
|
30
|
+
currentPage: baseCurrentPage,
|
|
31
|
+
registerPerPage: baseRegisterPerPage,
|
|
32
|
+
siblingsCount: baseSiblingsCount,
|
|
33
|
+
onChange: baseOnChange,
|
|
34
|
+
});
|
|
35
|
+
return (_jsxs("div", { className: "arkynPagination", ...rest, children: [_jsx(ChevronButton, { orientation: "left", handlePageChange: handleMinusChange, disabled: currentPage <= 1 }), currentPage > 1 + siblingsCount && (_jsxs(_Fragment, { children: [_jsx(PageButton, { page: 1, handlePageChange: () => handlePageChange(1) }), currentPage > 2 + siblingsCount && _jsx(Spread, {})] })), previousPages.map((page, index) => (_jsx(PageButton, { page: page, handlePageChange: handleMinusChange }, index))), _jsx(CurrentButton, { currentPage: currentPage }), nextPages.map((page, index) => (_jsx(PageButton, { page: page, handlePageChange: handlePlusChange }, index))), currentPage + siblingsCount < lastPage && (_jsxs(_Fragment, { children: [currentPage + 1 + siblingsCount < lastPage && _jsx(Spread, {}), _jsx(PageButton, { page: lastPage, handlePageChange: () => handlePageChange(lastPage) })] })), _jsx(ChevronButton, { orientation: "right", handlePageChange: handlePlusChange, disabled: currentPage >= lastPage })] }));
|
|
36
|
+
}
|
|
37
|
+
export { Pagination };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/pagination/pageButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAEF,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,2CAOzC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./styles.css";
|
|
3
|
+
function PageButton(props) {
|
|
4
|
+
const { page, handlePageChange } = props;
|
|
5
|
+
return (_jsx("button", { className: "arkynPaginationPageButton", onClick: handlePageChange, children: page }));
|
|
6
|
+
}
|
|
7
|
+
export { PageButton };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type PaginationServiceConstructor = {
|
|
2
|
+
currentPage: number;
|
|
3
|
+
totalCountRegisters: number;
|
|
4
|
+
registerPerPage?: number;
|
|
5
|
+
siblingsCount?: number;
|
|
6
|
+
onChange?: (page: number) => void;
|
|
7
|
+
};
|
|
8
|
+
declare class PaginationService {
|
|
9
|
+
currentPage: number;
|
|
10
|
+
totalCountRegisters: number;
|
|
11
|
+
registerPerPage: number;
|
|
12
|
+
siblingsCount: number;
|
|
13
|
+
lastPage: number;
|
|
14
|
+
onChange?: (page: number) => void;
|
|
15
|
+
previousPages: number[];
|
|
16
|
+
nextPages: number[];
|
|
17
|
+
private generatePagesArray;
|
|
18
|
+
private generatePreviousPages;
|
|
19
|
+
private generateNextPages;
|
|
20
|
+
constructor(props: PaginationServiceConstructor);
|
|
21
|
+
handlePageChange: (page: number) => void;
|
|
22
|
+
handlePlusChange: () => void;
|
|
23
|
+
handleMinusChange: () => void;
|
|
24
|
+
}
|
|
25
|
+
export { PaginationService };
|
|
26
|
+
//# sourceMappingURL=paginationService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paginationService.d.ts","sourceRoot":"","sources":["../../../src/components/pagination/paginationService.ts"],"names":[],"mappings":"AAAA,KAAK,4BAA4B,GAAG;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,cAAM,iBAAiB;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,iBAAiB;gBAQb,KAAK,EAAE,4BAA4B;IAiB/C,gBAAgB,GAAI,MAAM,MAAM,UAO9B;IAEF,gBAAgB,aAMd;IAEF,iBAAiB,aAMf;CACH;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
class PaginationService {
|
|
2
|
+
currentPage;
|
|
3
|
+
totalCountRegisters;
|
|
4
|
+
registerPerPage;
|
|
5
|
+
siblingsCount;
|
|
6
|
+
lastPage;
|
|
7
|
+
onChange;
|
|
8
|
+
previousPages;
|
|
9
|
+
nextPages;
|
|
10
|
+
generatePagesArray(from, to) {
|
|
11
|
+
return [...new Array(to - from)]
|
|
12
|
+
.map((_, index) => from + index + 1)
|
|
13
|
+
.filter((page) => page > 0);
|
|
14
|
+
}
|
|
15
|
+
generatePreviousPages(currentPage, siblingsCount) {
|
|
16
|
+
if (!(currentPage > 1))
|
|
17
|
+
return [];
|
|
18
|
+
return this.generatePagesArray(currentPage - 1 - siblingsCount, currentPage - 1);
|
|
19
|
+
}
|
|
20
|
+
generateNextPages(currentPage, siblingsCount) {
|
|
21
|
+
if (!(currentPage < this.lastPage))
|
|
22
|
+
return [];
|
|
23
|
+
return this.generatePagesArray(currentPage, Math.min(currentPage + siblingsCount, this.lastPage));
|
|
24
|
+
}
|
|
25
|
+
constructor(props) {
|
|
26
|
+
this.totalCountRegisters = props.totalCountRegisters;
|
|
27
|
+
this.currentPage = props.currentPage;
|
|
28
|
+
this.registerPerPage = props?.registerPerPage || 20;
|
|
29
|
+
this.siblingsCount = props?.siblingsCount || 2;
|
|
30
|
+
this.lastPage = Math.ceil(this.totalCountRegisters / this.registerPerPage);
|
|
31
|
+
this.onChange = props?.onChange;
|
|
32
|
+
this.previousPages = this.generatePreviousPages(this.currentPage, this.siblingsCount);
|
|
33
|
+
this.nextPages = this.generateNextPages(this.currentPage, this.siblingsCount);
|
|
34
|
+
}
|
|
35
|
+
handlePageChange = (page) => {
|
|
36
|
+
if (page < 1)
|
|
37
|
+
return;
|
|
38
|
+
if (page > this.lastPage)
|
|
39
|
+
return;
|
|
40
|
+
if (this.onChange) {
|
|
41
|
+
this.currentPage = page;
|
|
42
|
+
this.onChange(this.currentPage);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
handlePlusChange = () => {
|
|
46
|
+
if (this.currentPage >= this.lastPage)
|
|
47
|
+
return;
|
|
48
|
+
if (this.onChange) {
|
|
49
|
+
this.currentPage += 1;
|
|
50
|
+
this.onChange(this.currentPage);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
handleMinusChange = () => {
|
|
54
|
+
if (this.currentPage <= 1)
|
|
55
|
+
return;
|
|
56
|
+
if (this.onChange) {
|
|
57
|
+
this.currentPage -= 1;
|
|
58
|
+
this.onChange(this.currentPage);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export { PaginationService };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/pagination/spread/index.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAEtB,iBAAS,MAAM,4CAMd;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/phoneInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AA0B7C,KAAK,eAAe,GAAG;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,C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,CAAC,EAAE,MAAM,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,cAAc,CAAC,EAAE,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC;IACnD,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwGG;AAEH,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,2CA0LzC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -118,7 +118,7 @@ import { PhoneInputMask } from "./phoneInputMask";
|
|
|
118
118
|
* phone numbers according to each country's specific format and mask patterns.
|
|
119
119
|
*/
|
|
120
120
|
function PhoneInput(props) {
|
|
121
|
-
const { defaultCountry, label, className = "", disabled = false, errorMessage: baseErrorMessage, isLoading = false, readOnly = false, size = "md", defaultValue = "", variant = "solid", showAsterisk, name, onChange, searchCountryPlaceholder = "Pesquisar país", notFoundCountryText = "Nenhum país encontrado", id, } = props;
|
|
121
|
+
const { defaultCountry, label, className: wrapperClassName = "", disabled = false, errorMessage: baseErrorMessage, isLoading = false, readOnly = false, size = "md", defaultValue = "", variant = "solid", showAsterisk, name, onChange, searchCountryPlaceholder = "Pesquisar país", notFoundCountryText = "Nenhum país encontrado", id, } = props;
|
|
122
122
|
const defaultData = getDefaultFormatPhoneNumber(defaultValue);
|
|
123
123
|
const [isFocused, setIsFocused] = useState(false);
|
|
124
124
|
const [search, setSearch] = useState("");
|
|
@@ -190,7 +190,7 @@ function PhoneInput(props) {
|
|
|
190
190
|
returnValue += removeNumberMasks(props || value);
|
|
191
191
|
return returnValue;
|
|
192
192
|
}
|
|
193
|
-
return (_jsxs(FieldWrapper, { children: [label && (_jsx(FieldLabel, { htmlFor: phoneInputId, showAsterisk: showAsterisk, children: label })), _jsxs(PhoneInputContainer, { disabled: isDisabled, isError: isError, isLoading: isLoading, isFocused: isFocused, readOnly: readOnly, size: size, variant: variant,
|
|
193
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && (_jsx(FieldLabel, { htmlFor: phoneInputId, showAsterisk: showAsterisk, children: label })), _jsxs(PhoneInputContainer, { disabled: isDisabled, isError: isError, isLoading: isLoading, isFocused: isFocused, readOnly: readOnly, size: size, variant: variant, onFocus: handleContainerFocus, children: [_jsx(PhoneInputCountrySelector, { currentCountry: currentCountry, onClick: handleOpenCountryOptions, size: size }), _jsxs(PhoneInputCountryOptionsContainer, { isOpen: isDisabled ? false : readOnly ? false : showCountryOptions, search: search, placeholder: searchCountryPlaceholder, onSearch: setSearch, children: [countries
|
|
194
194
|
.filter((country) => filterCountryFunction(country))
|
|
195
195
|
.map((country) => (_jsx(PhoneInputCountryOption, { country: country, handleChangeValue: () => {
|
|
196
196
|
setCurrentCountry(country);
|
|
@@ -84,7 +84,7 @@ import "./styles.css";
|
|
|
84
84
|
* ```
|
|
85
85
|
*/
|
|
86
86
|
function RadioGroup(props) {
|
|
87
|
-
const { defaultValue = "", name, label, showAsterisk, errorMessage: baseErrorMessage, value: forceValue, onChange, size = "md", className:
|
|
87
|
+
const { defaultValue = "", name, label, showAsterisk, errorMessage: baseErrorMessage, value: forceValue, onChange, size = "md", className: wrapperClassName = "", disabled = false, ...rest } = props;
|
|
88
88
|
const [value, setValue] = useState(defaultValue);
|
|
89
89
|
const { fieldErrors } = useForm();
|
|
90
90
|
function handleChange(value) {
|
|
@@ -94,7 +94,7 @@ function RadioGroup(props) {
|
|
|
94
94
|
}
|
|
95
95
|
const errorMessage = baseErrorMessage || fieldErrors?.[name];
|
|
96
96
|
const isError = !!errorMessage;
|
|
97
|
-
const className = `arkynRadioGroup ${size}
|
|
98
|
-
return (_jsxs(FieldWrapper, { children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs(RadioProvider, { isError: isError, size: size, value: forceValue || value, handleChange: handleChange, disabled: disabled, children: [_jsx("input", { style: { display: "none" }, type: "text", readOnly: true, name: name, value: forceValue || value }), _jsx("div", { className: className.trim(), ...rest })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
97
|
+
const className = `arkynRadioGroup ${size}`;
|
|
98
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs(RadioProvider, { isError: isError, size: size, value: forceValue || value, handleChange: handleChange, disabled: disabled, children: [_jsx("input", { style: { display: "none" }, type: "text", readOnly: true, name: name, value: forceValue || value }), _jsx("div", { className: className.trim(), ...rest })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
99
99
|
}
|
|
100
100
|
export { RadioGroup };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAA2B,MAAM,OAAO,CAAC;AAgB5D,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE5C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,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Spinner } from "./selectSpinner";
|
|
|
103
103
|
* ```
|
|
104
104
|
*/
|
|
105
105
|
function Select(props) {
|
|
106
|
-
const { name, options, className = "", placeholder = "Selecione...", closeOnSelect = true, defaultValue = "", errorMessage: baseErrorMessage, isLoading = false, readOnly = false, isSearchable = false, id, label, optionMaxHeight, showAsterisk, leftIcon: LeftIcon, onSearch, onChange, onBlur, notFoundText = "Sem opções disponíveis", onFocus, disabled: baseDisabled = false, prefix, size = "md", value, variant = "solid", } = props;
|
|
106
|
+
const { name, options, className: wrapperClassName = "", placeholder = "Selecione...", closeOnSelect = true, defaultValue = "", errorMessage: baseErrorMessage, isLoading = false, readOnly = false, isSearchable = false, id, label, optionMaxHeight, showAsterisk, leftIcon: LeftIcon, onSearch, onChange, onBlur, notFoundText = "Sem opções disponíveis", onFocus, disabled: baseDisabled = false, prefix, size = "md", value, variant = "solid", } = props;
|
|
107
107
|
const { fieldErrors } = useForm();
|
|
108
108
|
const selectRef = useRef(null);
|
|
109
109
|
const selectId = id || useId();
|
|
@@ -163,6 +163,6 @@ function Select(props) {
|
|
|
163
163
|
return true;
|
|
164
164
|
return false;
|
|
165
165
|
});
|
|
166
|
-
return (_jsxs(FieldWrapper, { children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs(SelectContainer, { handleContainerFocus: handleContainerFocus, disabled: disabled, isError: isError, isFocused: isFocused, isLoading: isLoading, readOnly: readOnly, size: size, variant: variant,
|
|
166
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs(SelectContainer, { handleContainerFocus: handleContainerFocus, disabled: disabled, isError: isError, isFocused: isFocused, isLoading: isLoading, readOnly: readOnly, size: size, variant: variant, prefixExists: !!prefix, id: selectId, children: [_jsx("input", { ref: selectRef, name: name, value: forceSelectedOptions, type: "hidden" }), _jsx(IconRenderer, { iconSize: iconSize, icon: prefix, className: "prefix" }), LeftIcon && _jsx(LeftIcon, { size: iconSize, strokeWidth: 2.5 }), _jsxs(SelectContent, { size: size, children: [forceSelectedOptions !== "" && (_jsx("p", { className: "hasValue", children: getOptionLabel(forceSelectedOptions) })), forceSelectedOptions === "" && _jsx("p", { children: placeholder })] }), _jsxs(SelectOptionsContainer, { isFocused: isFocused, isSearchable: isSearchable, search: search, onSearch: handleSearch, children: [mappedOptions.map(({ label, value }) => (_jsx(SelectOption, { label: label, value: value, size: size, handleChangeValue: handleChangeValue, optionHasSelected: optionHasSelected }, value))), mappedOptions.length <= 0 && _jsx("p", { children: notFoundText })] }), _jsx(SelectChevron, { disabled: disabled, isFocused: isFocused, readOnly: readOnly, iconSize: iconSize, isLoading: isLoading }), _jsx(SelectSpinner, { iconSize: iconSize, isLoading: isLoading }), _jsx(SelectOverlay, { handleBlur: handleBlur, isFocused: isFocused })] }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
167
167
|
}
|
|
168
168
|
export { Select };
|
|
@@ -96,7 +96,7 @@ import "./styles.css";
|
|
|
96
96
|
* ```
|
|
97
97
|
*/
|
|
98
98
|
function Textarea(props) {
|
|
99
|
-
const { variant = "solid", size = "md", className:
|
|
99
|
+
const { variant = "solid", size = "md", className: wrapperClassName, errorMessage: baseErrorMessage, disabled = false, readOnly = false, label, showAsterisk, name, onFocus, onBlur, title, style, value, defaultValue, placeholder, id, ...rest } = props;
|
|
100
100
|
const { fieldErrors } = useForm();
|
|
101
101
|
const [isFocused, setIsFocused] = useState(false);
|
|
102
102
|
const textareaRef = useRef(null);
|
|
@@ -106,7 +106,7 @@ function Textarea(props) {
|
|
|
106
106
|
const errorClass = isError ? "errorTrue" : "errorFalse";
|
|
107
107
|
const opacityClass = disabled || readOnly ? "opacityTrue" : "opacityFalse";
|
|
108
108
|
const focusedClass = isFocused ? "focusedTrue" : "focusedFalse";
|
|
109
|
-
const className = `arkynTextarea ${variant} ${size} ${opacityClass} ${errorClass} ${focusedClass}
|
|
109
|
+
const className = `arkynTextarea ${variant} ${size} ${opacityClass} ${errorClass} ${focusedClass}`;
|
|
110
110
|
function handleSectionClick() {
|
|
111
111
|
if (disabled || !textareaRef?.current)
|
|
112
112
|
return;
|
|
@@ -123,6 +123,6 @@ function Textarea(props) {
|
|
|
123
123
|
if (onBlur)
|
|
124
124
|
onBlur(e);
|
|
125
125
|
}
|
|
126
|
-
return (_jsxs(FieldWrapper, { children: [label && (_jsx(FieldLabel, { htmlFor: textareaId, showAsterisk: showAsterisk, children: label })), _jsx("section", { title: title, style: style, onClick: handleSectionClick, className: className, children: _jsx("textarea", { id: textareaId, disabled: disabled, readOnly: readOnly, ref: textareaRef, name: name, onFocus: handleFocus, onBlur: handleBlur, defaultValue: defaultValue || "", placeholder: disabled ? value || placeholder : placeholder, value: disabled ? undefined : value, ...rest }) }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
126
|
+
return (_jsxs(FieldWrapper, { className: wrapperClassName, children: [label && (_jsx(FieldLabel, { htmlFor: textareaId, showAsterisk: showAsterisk, children: label })), _jsx("section", { title: title, style: style, onClick: handleSectionClick, className: className, children: _jsx("textarea", { id: textareaId, disabled: disabled, readOnly: readOnly, ref: textareaRef, name: name, onFocus: handleFocus, onBlur: handleBlur, defaultValue: defaultValue || "", placeholder: disabled ? value || placeholder : placeholder, value: disabled ? undefined : value, ...rest }) }), errorMessage && _jsx(FieldError, { children: errorMessage })] }));
|
|
127
127
|
}
|
|
128
128
|
export { Textarea };
|
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export { ModalContainer } from "./components/modal/modalContainer";
|
|
|
28
28
|
export { ModalFooter } from "./components/modal/modalFooter";
|
|
29
29
|
export { ModalHeader } from "./components/modal/modalHeader";
|
|
30
30
|
export { MultiSelect } from "./components/multiSelect";
|
|
31
|
+
export { Pagination } from "./components/pagination";
|
|
31
32
|
export { PhoneInput } from "./components/phoneInput";
|
|
32
33
|
export { Popover } from "./components/popover";
|
|
33
34
|
export { RadioBox } from "./components/radio/radioBox";
|