@giro-ds/react 12.1.0 → 12.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +76 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +14 -30
- package/dist/index.esm.js +78 -48
- package/dist/index.esm.js.map +1 -1
- package/dist/styles.css +3 -3
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -211,12 +211,7 @@ type ButtonAsCustom = ButtonOwnProps & Omit<React__default.HTMLAttributes<HTMLEl
|
|
|
211
211
|
*/
|
|
212
212
|
type ButtonProps = ButtonAsButton | ButtonAsAnchor | ButtonAsCustom;
|
|
213
213
|
|
|
214
|
-
declare const Button:
|
|
215
|
-
({ ref, as, children, variant, iconPosition, href, to, external, target, rel, disabled, onClick, size, scale, className, type, id, icon, fullWidth, ariaLabel, iconOnly, loading, tooltipText, tooltipSide, tooltipAlign, ...rest }: ButtonProps & {
|
|
216
|
-
ref?: React__default.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
217
|
-
}): React__default.JSX.Element;
|
|
218
|
-
displayName: string;
|
|
219
|
-
};
|
|
214
|
+
declare const Button: React__default.ForwardRefExoticComponent<ButtonProps & React__default.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
220
215
|
|
|
221
216
|
/** Formato de exibição da data aceito pelo componente. */
|
|
222
217
|
type DateFormat = 'dd/mm/yyyy' | 'mm/dd/yyyy' | (string & {});
|
|
@@ -626,12 +621,7 @@ interface FileUploadProps extends Omit<React__default.InputHTMLAttributes<HTMLIn
|
|
|
626
621
|
description?: string;
|
|
627
622
|
}
|
|
628
623
|
|
|
629
|
-
declare const FileUpload:
|
|
630
|
-
({ ref, value, onChange, helperText, error, errorMessage, maxFileSize, maxFilesQuantity, disabled, className, id, accept, multiple, description, descriptionErrorMessage, ...rest }: FileUploadProps & {
|
|
631
|
-
ref?: React__default.Ref<HTMLInputElement>;
|
|
632
|
-
}): React__default.JSX.Element;
|
|
633
|
-
displayName: string;
|
|
634
|
-
};
|
|
624
|
+
declare const FileUpload: React__default.ForwardRefExoticComponent<FileUploadProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
635
625
|
|
|
636
626
|
interface FilterItem$1 {
|
|
637
627
|
/** Identificador único do item (usado em `selectedIds` e `onApplyFilter`) */
|
|
@@ -1119,6 +1109,8 @@ interface VirtualKeyboardProps extends Omit<BaseProps, 'disabled'> {
|
|
|
1119
1109
|
onChange?: (value: string) => void;
|
|
1120
1110
|
/** Callback executado quando uma tecla é pressionada: (key) => void */
|
|
1121
1111
|
onKeyPress?: (key: string) => void;
|
|
1112
|
+
/** Callback executado quando a tecla Enter é pressionada */
|
|
1113
|
+
onEnterPress?: () => void;
|
|
1122
1114
|
/**
|
|
1123
1115
|
* Callback executado sempre que o `type` do teclado muda.
|
|
1124
1116
|
* Útil para que o consumidor saiba o tipo atual e possa reagir à mudança
|
|
@@ -1147,6 +1139,13 @@ interface VirtualKeyboardProps extends Omit<BaseProps, 'disabled'> {
|
|
|
1147
1139
|
* @default true
|
|
1148
1140
|
*/
|
|
1149
1141
|
showTypeSwitchKey?: boolean;
|
|
1142
|
+
/**
|
|
1143
|
+
* Quando `true`, exibe o numpad numérico no formato de 4 colunas (estilo iOS nativo),
|
|
1144
|
+
* com as teclas `-`, `↵` `_`, `⌫` e `→|` (enter/submit).
|
|
1145
|
+
* Só tem efeito quando `type="numeric"` e `variant="native"`.
|
|
1146
|
+
* @default false
|
|
1147
|
+
*/
|
|
1148
|
+
numpadWithEnter?: boolean;
|
|
1150
1149
|
/** Texto de ajuda do TextField exibido no modo `fixed` */
|
|
1151
1150
|
helperText?: string;
|
|
1152
1151
|
/** Sinaliza erro no TextField exibido no modo `fixed` */
|
|
@@ -1220,12 +1219,7 @@ interface SearchProps extends ScalableProps, NativeInputProps {
|
|
|
1220
1219
|
virtualKeyboard?: VirtualKeyboardType;
|
|
1221
1220
|
}
|
|
1222
1221
|
|
|
1223
|
-
declare const Search:
|
|
1224
|
-
({ ref, placeholder, disabled, value, onChange, onKeyDown, onFocus, onBlur, onClear, onClick, onMouseDown, searchMode, onSearch, id, scale, className, style, virtualKeyboard, "data-testid": testId, ...rest }: SearchProps & {
|
|
1225
|
-
ref?: React__default.Ref<HTMLInputElement>;
|
|
1226
|
-
}): React__default.JSX.Element;
|
|
1227
|
-
displayName: string;
|
|
1228
|
-
};
|
|
1222
|
+
declare const Search: React__default.ForwardRefExoticComponent<SearchProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
1229
1223
|
|
|
1230
1224
|
/**
|
|
1231
1225
|
* Props base compartilhadas por todas as configurações de tooltip do select.
|
|
@@ -1722,12 +1716,7 @@ interface TextAreaPropsBase extends Omit<React__default.TextareaHTMLAttributes<H
|
|
|
1722
1716
|
*/
|
|
1723
1717
|
type TextAreaProps = TextAreaPropsBase & TextAreaTooltipConfig;
|
|
1724
1718
|
|
|
1725
|
-
declare const _default$1: React__default.
|
|
1726
|
-
({ ref, className, value, label, placeholder, onChange, disabled, maxLength, required, helperText, tooltipText, tooltipSide, tooltipAlign, errorMessage, error, id, onBlur, onFocus, name, resize, charCount, height, virtualKeyboard, ...rest }: TextAreaProps & {
|
|
1727
|
-
ref?: React__default.Ref<HTMLTextAreaElement>;
|
|
1728
|
-
}): React__default.JSX.Element;
|
|
1729
|
-
displayName: string;
|
|
1730
|
-
}>;
|
|
1719
|
+
declare const _default$1: React__default.NamedExoticComponent<TextAreaProps & React__default.RefAttributes<HTMLTextAreaElement>>;
|
|
1731
1720
|
|
|
1732
1721
|
/** Tipos de input suportados pelo TextField */
|
|
1733
1722
|
type TextFieldType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
|
|
@@ -1824,12 +1813,7 @@ interface TextFieldPropsBase extends ScalableProps, Omit<React__default.InputHTM
|
|
|
1824
1813
|
*/
|
|
1825
1814
|
type TextFieldProps = TextFieldPropsBase & TextFieldTooltipConfig;
|
|
1826
1815
|
|
|
1827
|
-
declare const _default: React__default.
|
|
1828
|
-
({ ref, className, style, value, label, placeholder, type, onChange, disabled, maxLength, required, helperText, tooltipText, tooltipSide, tooltipAlign, errorMessage, error, id, icon, scale, onBlur, onFocus, name, persistIcon, virtualKeyboard, attachedToVirtualKeyboard, disableAutoComplete, ...rest }: TextFieldProps & {
|
|
1829
|
-
ref?: React__default.Ref<HTMLInputElement>;
|
|
1830
|
-
}): React__default.JSX.Element;
|
|
1831
|
-
displayName: string;
|
|
1832
|
-
}>;
|
|
1816
|
+
declare const _default: React__default.NamedExoticComponent<TextFieldProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
1833
1817
|
|
|
1834
1818
|
/**
|
|
1835
1819
|
* Props do componente individual de notificação `Toast`.
|
package/dist/index.esm.js
CHANGED
|
@@ -2,8 +2,8 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { Avatar as Avatar$1, Tooltip as Tooltip$1, Checkbox as Checkbox$1, Popover as Popover$1, Label, AlertDialog, DropdownMenu, Dialog as Dialog$1, RadioGroup, Select as Select$1, Toggle as Toggle$1, ToggleGroup as ToggleGroup$1, Toast as Toast$1, Switch as Switch$1, unstable_OneTimePasswordField } from 'radix-ui';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import React__default, { useId, useMemo, createContext, useState, useContext, useRef, useCallback, useEffect, useLayoutEffect, createElement, memo, useReducer } from 'react';
|
|
6
|
-
import { SpinnerIos16Regular, ChevronUp16Regular, ChevronLeft16Regular, ChevronRight16Regular, ChevronDown16Regular, Dismiss24Regular, Emoji20Regular, ChevronDown20Regular, KeyboardShiftUppercase20Regular, KeyboardShift20Filled, KeyboardShift20Regular, Backspace20Regular, Info12Regular, Dismiss16Regular, Calendar16Regular, DocumentAdd24Regular, Warning24Regular, Document24Regular, FilterRegular, Search16Regular, ChevronDownRegular, ChevronRight16Filled, Subtract16Regular, Add16Regular, SearchInfo20Regular, ArrowSortUp16Regular, ArrowSortDown16Regular, ArrowSort16Regular, Info20Filled, CheckmarkCircle20Filled, Warning20Filled, Dismiss16Filled } from '@fluentui/react-icons';
|
|
5
|
+
import React__default, { useId, useMemo, createContext, useState, useContext, useRef, useCallback, useEffect, useLayoutEffect, createElement, forwardRef, memo, useReducer } from 'react';
|
|
6
|
+
import { SpinnerIos16Regular, ChevronUp16Regular, ChevronLeft16Regular, ChevronRight16Regular, ChevronDown16Regular, Dismiss24Regular, ArrowImport20Regular, Emoji20Regular, ChevronDown20Regular, KeyboardShiftUppercase20Regular, KeyboardShift20Filled, KeyboardShift20Regular, Backspace20Regular, Info12Regular, Dismiss16Regular, Calendar16Regular, DocumentAdd24Regular, Warning24Regular, Document24Regular, FilterRegular, Search16Regular, ChevronDownRegular, ChevronRight16Filled, Subtract16Regular, Add16Regular, SearchInfo20Regular, ArrowSortUp16Regular, ArrowSortDown16Regular, ArrowSort16Regular, Info20Filled, CheckmarkCircle20Filled, Warning20Filled, Dismiss16Filled } from '@fluentui/react-icons';
|
|
7
7
|
import { DayPicker } from 'react-day-picker';
|
|
8
8
|
import { format, addDays, addMonths, addWeeks, addYears, differenceInCalendarDays, differenceInCalendarMonths, eachMonthOfInterval, eachYearOfInterval, endOfISOWeek, endOfMonth, endOfWeek, endOfYear, getISOWeek, getMonth, getYear, getWeek, isAfter, isBefore, isDate, isSameDay, isSameMonth, isSameYear, max, min, setMonth, setYear, startOfDay, startOfISOWeek, startOfMonth, startOfWeek, startOfYear } from 'date-fns';
|
|
9
9
|
import { createPortal } from 'react-dom';
|
|
@@ -65,7 +65,7 @@ const Tooltip = ({ children, text, side = 'bottom', align = 'start', maxWidth, s
|
|
|
65
65
|
|
|
66
66
|
var styles$s = {"button":"Button-module__button___18Bed","button-lg":"Button-module__button-lg___-A8B9","button-sm":"Button-module__button-sm___L7aT7","button-filled":"Button-module__button-filled___IQx1z","button-outlined":"Button-module__button-outlined___hLkLN","button-text":"Button-module__button-text___8GFeA","buttonWithIcon":"Button-module__buttonWithIcon___8ehK1","buttonIconPosition-left":"Button-module__buttonIconPosition-left___uOY6b","buttonIconPosition-right":"Button-module__buttonIconPosition-right___eswRS","buttonIconPosition-both":"Button-module__buttonIconPosition-both___1Lith","buttonNoContent":"Button-module__buttonNoContent___Tc9jk","buttonIconOnly":"Button-module__buttonIconOnly___aifk4","buttonIconLeft":"Button-module__buttonIconLeft___RICR3","buttonIconRight":"Button-module__buttonIconRight___71lu2","buttonFullWidth":"Button-module__buttonFullWidth___tXuVE","disabled":"Button-module__disabled___UzdWL","buttonLoading":"Button-module__buttonLoading___RGdNw","buttonContentHidden":"Button-module__buttonContentHidden___CoCiN","buttonLoadingSpinner":"Button-module__buttonLoadingSpinner___oZxEU","spin":"Button-module__spin___kQKH9"};
|
|
67
67
|
|
|
68
|
-
const Button = ({
|
|
68
|
+
const Button = React__default.forwardRef(({ as, children, variant = 'filled', iconPosition = 'left', href, to, external = false, target, rel, disabled = false, onClick, size = 'lg', scale = 1, className, type = 'button', id, icon, fullWidth = false, ariaLabel, iconOnly = false, loading = false, tooltipText, tooltipSide = 'top', tooltipAlign = 'center', ...rest }, ref) => {
|
|
69
69
|
const generatedId = useId();
|
|
70
70
|
const componentId = id || generatedId;
|
|
71
71
|
const getComponent = () => {
|
|
@@ -181,7 +181,7 @@ const Button = ({ ref, as, children, variant = 'filled', iconPosition = 'left',
|
|
|
181
181
|
return (jsx(Tooltip, { text: tooltipText, side: tooltipSide, align: tooltipAlign, children: jsx(Component, { ...baseProps, ...getNavigationProps(), children: renderContent() }) }));
|
|
182
182
|
}
|
|
183
183
|
return (jsx(Component, { ...baseProps, ...getNavigationProps(), children: renderContent() }));
|
|
184
|
-
};
|
|
184
|
+
});
|
|
185
185
|
Button.displayName = 'Button';
|
|
186
186
|
|
|
187
187
|
function buildFormatLongFn(args) {
|
|
@@ -2845,11 +2845,13 @@ const Checkbox = ({ id, label, onCheckedChange, checked, disabled, className, st
|
|
|
2845
2845
|
}), role: "presentation", tabIndex: disabled ? -1 : 0, children: jsx(Checkbox$1.Root, { className: styles$o.root, checked: indeterminate ? 'indeterminate' : checked, id: componentId, onCheckedChange: onCheckedChange, disabled: disabled, "data-disabled": disabled, "data-indeterminate": indeterminate, "aria-checked": indeterminate ? 'mixed' : checked ? 'true' : 'false', ...rest, children: jsx(Checkbox$1.Indicator, { className: styles$o.indicator, children: indeterminate ? jsx(CheckHalf, {}) : jsx(CheckSmall, {}) }) }) }), jsx("label", { className: clsx(styles$o.label, { [styles$o.disabled]: disabled }), htmlFor: componentId, children: label })] }));
|
|
2846
2846
|
};
|
|
2847
2847
|
|
|
2848
|
-
var styles$n = {"chips":"Chips-module__chips___SOvBe","title":"Chips-module__title___ZhuQi","iconLeft":"Chips-module__iconLeft___tPhnw","iconRight":"Chips-module__iconRight___-HxL2","hasLeftIcon":"Chips-module__hasLeftIcon___D3quS","hasRightIcon":"Chips-module__hasRightIcon___ZMx2Y","brand":"Chips-module__brand___q1Gsm","success":"Chips-module__success___UhxQa","alert":"Chips-module__alert___nvPnr","disabled":"Chips-module__disabled___ElWLI"};
|
|
2848
|
+
var styles$n = {"chips":"Chips-module__chips___SOvBe","title":"Chips-module__title___ZhuQi","iconLeft":"Chips-module__iconLeft___tPhnw","iconRight":"Chips-module__iconRight___-HxL2","hasLeftIcon":"Chips-module__hasLeftIcon___D3quS","hasRightIcon":"Chips-module__hasRightIcon___ZMx2Y","brand":"Chips-module__brand___q1Gsm","success":"Chips-module__success___UhxQa","alert":"Chips-module__alert___nvPnr","interactive":"Chips-module__interactive___4ytKl","disabled":"Chips-module__disabled___ElWLI"};
|
|
2849
2849
|
|
|
2850
2850
|
const Chips = ({ children, leftIcon, rightIcon, variant = 'neutral', disabled = false, backgroundColor, textColor, scale = 1, className, style, ...rest }) => {
|
|
2851
|
+
const isInteractive = typeof rest.onClick === 'function';
|
|
2851
2852
|
const chipsClass = clsx(styles$n.chips, styles$n[variant], {
|
|
2852
2853
|
[styles$n.disabled]: disabled,
|
|
2854
|
+
[styles$n.interactive]: isInteractive && !disabled,
|
|
2853
2855
|
[styles$n.hasLeftIcon]: leftIcon,
|
|
2854
2856
|
[styles$n.hasRightIcon]: rightIcon,
|
|
2855
2857
|
}, className);
|
|
@@ -2859,7 +2861,6 @@ const Chips = ({ children, leftIcon, rightIcon, variant = 'neutral', disabled =
|
|
|
2859
2861
|
...(!disabled && textColor && { '--chips-text': `var(--${textColor})` }),
|
|
2860
2862
|
...style,
|
|
2861
2863
|
};
|
|
2862
|
-
const isInteractive = typeof rest.onClick === 'function';
|
|
2863
2864
|
const { onKeyDown: userOnKeyDown, ...otherRest } = rest;
|
|
2864
2865
|
const handleKeyDown = (e) => {
|
|
2865
2866
|
userOnKeyDown?.(e);
|
|
@@ -2908,6 +2909,7 @@ const ICON_KEY_MAP = {
|
|
|
2908
2909
|
capslock: KeyboardShiftUppercase20Regular,
|
|
2909
2910
|
downkeyboard: ChevronDown20Regular,
|
|
2910
2911
|
emoji: Emoji20Regular,
|
|
2912
|
+
enterNumpad: ArrowImport20Regular,
|
|
2911
2913
|
};
|
|
2912
2914
|
const SHARED_DISPLAY = {
|
|
2913
2915
|
'{capslock}': iconSlot('capslock'),
|
|
@@ -2933,9 +2935,11 @@ const LAYOUT_DISPLAY = {
|
|
|
2933
2935
|
const EMOTICON_KEY = '{emoticon}';
|
|
2934
2936
|
const DOWN_KEYBOARD_KEY = '{downkeyboard}';
|
|
2935
2937
|
const ENTER_KEY = '{enter}';
|
|
2936
|
-
const removeKeyFromLayout = (layout, key) => Object.fromEntries(Object.entries(layout).map(([layoutName, rows]) => [
|
|
2938
|
+
const removeKeyFromLayout = (layout, key, skipLayouts = []) => Object.fromEntries(Object.entries(layout).map(([layoutName, rows]) => [
|
|
2937
2939
|
layoutName,
|
|
2938
|
-
|
|
2940
|
+
skipLayouts.includes(layoutName)
|
|
2941
|
+
? rows
|
|
2942
|
+
: rows.map((row) => row.split(key).join(' ').replace(/\s+/g, ' ').trim()),
|
|
2939
2943
|
]));
|
|
2940
2944
|
const replaceKeyWithBlank = (layout, key) => Object.fromEntries(Object.entries(layout).map(([layoutName, rows]) => [
|
|
2941
2945
|
layoutName,
|
|
@@ -2948,7 +2952,8 @@ const QWERTY_LOWERCASE = [
|
|
|
2948
2952
|
'{shift} z x c v b n m {bksp}',
|
|
2949
2953
|
'{numbers} {alt} {space} . {enter}',
|
|
2950
2954
|
];
|
|
2951
|
-
const NUMPAD = ['1 2 3', '4 5 6', '7 8 9', '{
|
|
2955
|
+
const NUMPAD = ['1 2 3', '4 5 6', '7 8 9', '{abc} 0 {bksp}'];
|
|
2956
|
+
const NUMPAD_WITH_ENTER = ['1 2 3 -', '4 5 6 _', '7 8 9 {bksp}', '{abc} 0 . {enter}'];
|
|
2952
2957
|
const SHARED_LAYOUTS = {
|
|
2953
2958
|
shift: [
|
|
2954
2959
|
'1 2 3 4 5 6 7 8 9 0',
|
|
@@ -2998,11 +3003,17 @@ const NATIVE_LAYOUTS = {
|
|
|
2998
3003
|
const NATIVE_LAYOUT_KEYS = new Set([
|
|
2999
3004
|
'default', 'numeric',
|
|
3000
3005
|
]);
|
|
3001
|
-
const getNativeLayout = (type, Emoji = true, showDownKeyboardButton = true, isFixed = false, showEnterKey = true, showTypeSwitchKey = true) => {
|
|
3006
|
+
const getNativeLayout = (type, Emoji = true, showDownKeyboardButton = true, isFixed = false, showEnterKey = true, showTypeSwitchKey = true, numpadWithEnter = false) => {
|
|
3002
3007
|
const layout = NATIVE_LAYOUTS[type] ?? NATIVE_LAYOUTS.default ?? null;
|
|
3003
3008
|
if (!layout)
|
|
3004
3009
|
return null;
|
|
3005
|
-
let computedLayout =
|
|
3010
|
+
let computedLayout = numpadWithEnter
|
|
3011
|
+
? {
|
|
3012
|
+
...layout,
|
|
3013
|
+
...(type === 'numeric' ? { default: NUMPAD_WITH_ENTER } : {}),
|
|
3014
|
+
numbers: NUMPAD_WITH_ENTER,
|
|
3015
|
+
}
|
|
3016
|
+
: layout;
|
|
3006
3017
|
if (!Emoji) {
|
|
3007
3018
|
computedLayout = removeKeyFromLayout(computedLayout, EMOTICON_KEY);
|
|
3008
3019
|
}
|
|
@@ -3010,7 +3021,9 @@ const getNativeLayout = (type, Emoji = true, showDownKeyboardButton = true, isFi
|
|
|
3010
3021
|
computedLayout = removeKeyFromLayout(computedLayout, DOWN_KEYBOARD_KEY);
|
|
3011
3022
|
}
|
|
3012
3023
|
if (!showEnterKey) {
|
|
3013
|
-
|
|
3024
|
+
// Numpad layouts always preserve {enter}; only remove from QWERTY layouts
|
|
3025
|
+
const numpadLayouts = type === 'numeric' ? ['default', 'numbers'] : ['numbers'];
|
|
3026
|
+
computedLayout = removeKeyFromLayout(computedLayout, ENTER_KEY, numpadLayouts);
|
|
3014
3027
|
}
|
|
3015
3028
|
if (!showTypeSwitchKey) {
|
|
3016
3029
|
computedLayout = removeKeyFromLayout(computedLayout, '{numbers}');
|
|
@@ -3081,13 +3094,16 @@ const ACCENT_OPTIONS = {
|
|
|
3081
3094
|
* <VirtualKeyboard targetRef={inputRef} value={value} onChange={setValue} />
|
|
3082
3095
|
* ```
|
|
3083
3096
|
*/
|
|
3084
|
-
const VirtualKeyboard = ({ variant = 'native', type = 'default', value
|
|
3097
|
+
const VirtualKeyboard = ({ variant = 'native', type = 'default', value, onChange, onKeyPress, onEnterPress, onTypeChange, maxLength, Emoji = false, className, id, placeholder = 'Digite aqui...', helperText, error, errorMessage, targetRef, textFieldScale = 1, showEnterKey = true, showTypeSwitchKey = true, numpadWithEnter = false, }) => {
|
|
3098
|
+
const [internalValue, setInternalValue] = useState(value ?? '');
|
|
3085
3099
|
const [layoutName, setLayoutName] = useState('default');
|
|
3086
3100
|
const [capsLockOn, setCapsLockOn] = useState(false);
|
|
3087
3101
|
const [accentMenu, setAccentMenu] = useState(null);
|
|
3088
3102
|
const [accentMenuOffsetX, setAccentMenuOffsetX] = useState(0);
|
|
3089
|
-
const [activeLayout, setActiveLayout] = useState(getNativeLayout(type, Emoji, variant === 'native', variant === 'fixed', showEnterKey, showTypeSwitchKey));
|
|
3103
|
+
const [activeLayout, setActiveLayout] = useState(getNativeLayout(type, Emoji, variant === 'native', variant === 'fixed', showEnterKey, showTypeSwitchKey, numpadWithEnter));
|
|
3090
3104
|
const visualType = NATIVE_LAYOUT_KEYS.has(type) ? type : 'default';
|
|
3105
|
+
const effectiveValue = onChange !== undefined ? (value ?? '') : internalValue;
|
|
3106
|
+
const isNumpadLayout = (type === 'numeric' && layoutName === 'default') || layoutName === 'numbers';
|
|
3091
3107
|
const [isOpen, setIsOpen] = useState(variant !== 'native');
|
|
3092
3108
|
const hideTimeoutRef = useRef(null);
|
|
3093
3109
|
const scrollTimeoutRef = useRef(null);
|
|
@@ -3100,15 +3116,15 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3100
3116
|
const keyboardInstanceRef = useRef(null);
|
|
3101
3117
|
const accentMenuRef = useRef(null);
|
|
3102
3118
|
const accentButtonRef = useRef(null);
|
|
3103
|
-
const valueRef = useRef(value);
|
|
3119
|
+
const valueRef = useRef(value ?? '');
|
|
3104
3120
|
const [iconSlots, setIconSlots] = useState([]);
|
|
3105
3121
|
const [keyPreview, setKeyPreview] = useState(null);
|
|
3106
3122
|
const [keyPreviewOffsetX, setKeyPreviewOffsetX] = useState(0);
|
|
3107
3123
|
const keyPreviewRef = useRef(null);
|
|
3108
3124
|
const [containerWidth, setContainerWidth] = useState(Infinity);
|
|
3109
3125
|
useEffect(() => {
|
|
3110
|
-
valueRef.current =
|
|
3111
|
-
}, [
|
|
3126
|
+
valueRef.current = effectiveValue;
|
|
3127
|
+
}, [effectiveValue]);
|
|
3112
3128
|
const clearLongPressTimeout = useCallback(() => {
|
|
3113
3129
|
if (longPressTimeoutRef.current !== null) {
|
|
3114
3130
|
clearTimeout(longPressTimeoutRef.current);
|
|
@@ -3123,8 +3139,8 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3123
3139
|
keyboardInstanceRef.current?.setInput(nextValue);
|
|
3124
3140
|
}, []);
|
|
3125
3141
|
useEffect(() => {
|
|
3126
|
-
syncKeyboardInput(
|
|
3127
|
-
}, [
|
|
3142
|
+
syncKeyboardInput(effectiveValue);
|
|
3143
|
+
}, [effectiveValue, syncKeyboardInput]);
|
|
3128
3144
|
useEffect(() => {
|
|
3129
3145
|
onTypeChange?.(type);
|
|
3130
3146
|
}, [type, onTypeChange]);
|
|
@@ -3202,8 +3218,8 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3202
3218
|
useEffect(() => {
|
|
3203
3219
|
setLayoutName('default');
|
|
3204
3220
|
setCapsLockOn(false);
|
|
3205
|
-
setActiveLayout(getNativeLayout(type, Emoji, variant === 'native', variant === 'fixed', showEnterKey, showTypeSwitchKey));
|
|
3206
|
-
}, [type, Emoji, variant, showEnterKey, showTypeSwitchKey]);
|
|
3221
|
+
setActiveLayout(getNativeLayout(type, Emoji, variant === 'native', variant === 'fixed', showEnterKey, showTypeSwitchKey, numpadWithEnter));
|
|
3222
|
+
}, [type, Emoji, variant, showEnterKey, showTypeSwitchKey, numpadWithEnter]);
|
|
3207
3223
|
useEffect(() => {
|
|
3208
3224
|
if (!Emoji && layoutName === 'emoticon') {
|
|
3209
3225
|
setLayoutName(type === 'numeric' ? 'abc' : 'default');
|
|
@@ -3283,7 +3299,10 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3283
3299
|
if (newSlots.length === 0)
|
|
3284
3300
|
return;
|
|
3285
3301
|
newSlots.forEach((s) => s.setAttribute('data-icon-root', 'true'));
|
|
3286
|
-
setIconSlots((prev) => [
|
|
3302
|
+
setIconSlots((prev) => [
|
|
3303
|
+
...prev.filter((slot) => container.contains(slot)),
|
|
3304
|
+
...newSlots,
|
|
3305
|
+
]);
|
|
3287
3306
|
};
|
|
3288
3307
|
registerNewSlots();
|
|
3289
3308
|
const observer = new MutationObserver(() => {
|
|
@@ -3294,7 +3313,7 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3294
3313
|
return () => {
|
|
3295
3314
|
observer.disconnect();
|
|
3296
3315
|
};
|
|
3297
|
-
}, []);
|
|
3316
|
+
}, [variant]);
|
|
3298
3317
|
useEffect(() => {
|
|
3299
3318
|
closeAccentMenu();
|
|
3300
3319
|
setAccentMenuOffsetX(0);
|
|
@@ -3376,6 +3395,8 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3376
3395
|
const currentValue = valueRef.current;
|
|
3377
3396
|
if (maxLength === undefined || currentValue.length < maxLength) {
|
|
3378
3397
|
const nextValue = `${currentValue}${heldKey}`;
|
|
3398
|
+
if (onChange === undefined)
|
|
3399
|
+
setInternalValue(nextValue);
|
|
3379
3400
|
onChange?.(nextValue);
|
|
3380
3401
|
onKeyPress?.(heldKey);
|
|
3381
3402
|
syncKeyboardInput(nextValue);
|
|
@@ -3409,6 +3430,8 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3409
3430
|
return;
|
|
3410
3431
|
}
|
|
3411
3432
|
const nextValue = `${currentValue}${accentedChar}`;
|
|
3433
|
+
if (onChange === undefined)
|
|
3434
|
+
setInternalValue(nextValue);
|
|
3412
3435
|
onChange?.(nextValue);
|
|
3413
3436
|
onKeyPress?.(accentedChar);
|
|
3414
3437
|
closeAccentMenu();
|
|
@@ -3499,12 +3522,16 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3499
3522
|
if (isHeldAccentKey) {
|
|
3500
3523
|
return;
|
|
3501
3524
|
}
|
|
3525
|
+
if (button === '{enter}') {
|
|
3526
|
+
onEnterPress?.();
|
|
3527
|
+
}
|
|
3502
3528
|
onKeyPress?.(button);
|
|
3503
3529
|
}, [
|
|
3504
3530
|
type,
|
|
3505
3531
|
layoutName,
|
|
3506
3532
|
capsLockOn,
|
|
3507
3533
|
onKeyPress,
|
|
3534
|
+
onEnterPress,
|
|
3508
3535
|
onTypeChange,
|
|
3509
3536
|
Emoji,
|
|
3510
3537
|
variant,
|
|
@@ -3531,8 +3558,10 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3531
3558
|
}
|
|
3532
3559
|
if (maxLength !== undefined && input.length > maxLength)
|
|
3533
3560
|
return;
|
|
3561
|
+
if (onChange === undefined)
|
|
3562
|
+
setInternalValue(input);
|
|
3534
3563
|
onChange?.(input);
|
|
3535
|
-
}, [maxLength, onChange, syncKeyboardInput]);
|
|
3564
|
+
}, [maxLength, onChange, setInternalValue, syncKeyboardInput]);
|
|
3536
3565
|
const portalSizes = useMemo(() => {
|
|
3537
3566
|
if (containerWidth <= 360)
|
|
3538
3567
|
return { preview: 42, option: 44, fontSize: 'var(--font-size-16)' };
|
|
@@ -3548,15 +3577,16 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3548
3577
|
const baseDisplay = LAYOUT_DISPLAY[visualType];
|
|
3549
3578
|
if (!baseDisplay)
|
|
3550
3579
|
return baseDisplay;
|
|
3551
|
-
|
|
3552
|
-
|
|
3580
|
+
const display = { ...baseDisplay };
|
|
3581
|
+
if (numpadWithEnter && isNumpadLayout) {
|
|
3582
|
+
display['{enter}'] = '<span data-icon-key="enterNumpad"></span>';
|
|
3553
3583
|
}
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
}, [visualType, variant]);
|
|
3559
|
-
const keyboardEl = activeLayout ? (jsxs("div", { ref: keyboardWrapperRef, className: clsx(styles$k.keyboardWrapper,
|
|
3584
|
+
if (variant === 'fixed') {
|
|
3585
|
+
display['{bksp}'] = (display['{bksp}'] ?? '').replace(/\s*Apagar$/, '');
|
|
3586
|
+
}
|
|
3587
|
+
return display;
|
|
3588
|
+
}, [visualType, variant, numpadWithEnter, isNumpadLayout]);
|
|
3589
|
+
const keyboardEl = activeLayout ? (jsxs("div", { ref: keyboardWrapperRef, className: clsx(styles$k.keyboardWrapper, isNumpadLayout && styles$k.keyboardNumpadActive), onPointerDownCapture: handleLongPressStart, onPointerUpCapture: handleLongPressEnd, onPointerLeave: handleLongPressEnd, onPointerCancelCapture: handleLongPressEnd, children: [jsx(Keyboard, { keyboardRef: (instance) => {
|
|
3560
3590
|
keyboardInstanceRef.current = instance;
|
|
3561
3591
|
if (instance) {
|
|
3562
3592
|
instance.setInput(valueRef.current);
|
|
@@ -3594,9 +3624,9 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3594
3624
|
event.stopPropagation();
|
|
3595
3625
|
}, onClick: () => handleAccentSelect(option), children: option }, `${accentMenu.sourceKey}-${option}`))) }, rowIndex))) }), document.body))] })) : null;
|
|
3596
3626
|
if (variant === 'native' && typeof document !== 'undefined') {
|
|
3597
|
-
return createPortal(jsx("div", { id: id, className: clsx(styles$k.overlay, { [styles$k.overlayOpen]: isOpen }, styles$k[
|
|
3627
|
+
return createPortal(jsx("div", { id: id, className: clsx(styles$k.overlay, { [styles$k.overlayOpen]: isOpen }, styles$k[isNumpadLayout ? 'layout--numeric' : 'layout--default'], className), children: keyboardEl }), document.body);
|
|
3598
3628
|
}
|
|
3599
|
-
return (jsxs("div", { id: id, className: clsx(styles$k.container, styles$k[`mode--${variant}`], styles$k[
|
|
3629
|
+
return (jsxs("div", { id: id, className: clsx(styles$k.container, styles$k[`mode--${variant}`], styles$k[isNumpadLayout ? 'layout--numeric' : 'layout--default'], className), children: [variant === 'fixed' && (jsx("div", { className: styles$k.textFieldContainer, children: jsx(TextField$1, { placeholder: placeholder, value: effectiveValue, onChange: onChange, helperText: helperText, error: error, errorMessage: errorMessage, readOnly: true, disableAutoComplete: true, maxLength: maxLength, attachedToVirtualKeyboard: true, className: styles$k.textFieldWrapper, scale: textFieldScale }) })), keyboardEl] }));
|
|
3600
3630
|
};
|
|
3601
3631
|
|
|
3602
3632
|
var styles$j = {"container":"TextField-module__container___WJHFR","inputWrapper":"TextField-module__inputWrapper___INjfd","inputContainer":"TextField-module__inputContainer___3EsFJ","icon":"TextField-module__icon___p1vwi","clearButton":"TextField-module__clearButton___kgOot","inputWithIcon":"TextField-module__inputWithIcon___shqkL","helperText":"TextField-module__helperText___d5QGC","error":"TextField-module__error___IGQzp","disabled":"TextField-module__disabled___roIKP","attachedToVirtualKeyboard":"TextField-module__attachedToVirtualKeyboard___fuO2O","errorWithMessage":"TextField-module__errorWithMessage___m-5AA","clearButtonIcon":"TextField-module__clearButtonIcon___Z2iyc"};
|
|
@@ -3625,7 +3655,7 @@ const LabelComponent = ({ children, htmlFor, required = false, tooltip = false,
|
|
|
3625
3655
|
return container;
|
|
3626
3656
|
};
|
|
3627
3657
|
|
|
3628
|
-
const TextField = ({
|
|
3658
|
+
const TextField = forwardRef(({ className, style, value, label, placeholder, type = 'text', onChange, disabled = false, maxLength, required = false, helperText, tooltipText, tooltipSide = 'bottom', tooltipAlign = 'start', errorMessage, error, id, icon, scale = 1, onBlur, onFocus, name, persistIcon = false, virtualKeyboard, attachedToVirtualKeyboard, disableAutoComplete = false, ...rest }, ref) => {
|
|
3629
3659
|
const normalizeValue = (val) => {
|
|
3630
3660
|
return val === undefined || val === null ? '' : String(val);
|
|
3631
3661
|
};
|
|
@@ -3689,7 +3719,7 @@ const TextField = ({ ref, className, style, value, label, placeholder, type = 't
|
|
|
3689
3719
|
const containerClass = clsx(styles$j.container, className, {
|
|
3690
3720
|
[styles$j.attachedToVirtualKeyboard]: attachedToVirtualKeyboard,
|
|
3691
3721
|
[styles$j.disabled]: disabled,
|
|
3692
|
-
[styles$j.error]:
|
|
3722
|
+
[styles$j.error]: hasError,
|
|
3693
3723
|
[styles$j.errorWithMessage]: !!errorMessage,
|
|
3694
3724
|
});
|
|
3695
3725
|
return (jsxs("div", { className: containerClass, style: { ...containerStyle, ...style }, children: [label && (jsx(LabelComponent, { scale: scale, htmlFor: componentId, required: required, tooltip: !!tooltipText, tooltipText: tooltipText, side: tooltipSide, align: tooltipAlign, error: hasError, disabled: disabled, children: label })), jsxs("div", { className: styles$j.inputWrapper, children: [jsxs("div", { className: styles$j.inputContainer, children: [jsx("input", { ...rest, ref: setInputRefs, id: componentId, name: name, type: type, value: inputValue, placeholder: placeholder, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, maxLength: maxLength, disabled: disabled, "aria-invalid": hasError, "aria-required": required, "aria-describedby": helperId, inputMode: (virtualKeyboard === 'default' || virtualKeyboard === 'numeric') ? 'none' : rest.inputMode, autoComplete: (disableAutoComplete || virtualKeyboard === 'default' || virtualKeyboard === 'numeric') ? 'off' : rest.autoComplete, className: clsx({
|
|
@@ -3703,7 +3733,7 @@ const TextField = ({ ref, className, style, value, label, placeholder, type = 't
|
|
|
3703
3733
|
onChange?.(val);
|
|
3704
3734
|
}
|
|
3705
3735
|
} }) }))] }));
|
|
3706
|
-
};
|
|
3736
|
+
});
|
|
3707
3737
|
TextField.displayName = 'TextField';
|
|
3708
3738
|
var TextField$1 = React__default.memo(TextField);
|
|
3709
3739
|
|
|
@@ -3799,7 +3829,7 @@ function validatePartialDate(value, locale = 'pt-br') {
|
|
|
3799
3829
|
return 'incomplete';
|
|
3800
3830
|
}
|
|
3801
3831
|
|
|
3802
|
-
const DatePicker = ({ locale = 'pt-br', calendarSide = 'bottom', calendarAlign = 'start', helperText, required = false, label = 'Data', value, defaultValue, onChange, disabled = false, error: externalError, minDate, maxDate, 'data-testid': testId, scale = 1, className, style, ...rest }) => {
|
|
3832
|
+
const DatePicker = ({ locale = 'pt-br', calendarSide = 'bottom', calendarAlign = 'start', helperText, required = false, label = 'Data', value, defaultValue, onChange, disabled = false, error: externalError, minDate, maxDate, 'data-testid': testId, scale = 1, id, className, style, ...rest }) => {
|
|
3803
3833
|
const fieldId = useId();
|
|
3804
3834
|
const calendarId = `${fieldId}-calendar`;
|
|
3805
3835
|
const containerStyle = { '--giro-scale': scale };
|
|
@@ -3929,7 +3959,7 @@ const DatePicker = ({ locale = 'pt-br', calendarSide = 'bottom', calendarAlign =
|
|
|
3929
3959
|
}
|
|
3930
3960
|
}
|
|
3931
3961
|
};
|
|
3932
|
-
return (jsx("div", { ref: wrapperRef, className: clsx(styles$h.datePicker, className), style: { ...containerStyle, ...style }, ...rest, children: jsx(Popover, { open: showCalendar, onOpenChange: setShowCalendar, asAnchor: true, trigger: jsx(TextField$1, { className: styles$h.textfieldContainer, type: "tel", icon: jsx(Calendar16Regular, { onClick: !disabled ? handleIconClick : undefined, className: clsx(styles$h.datePickerIcon, disabled && styles$h.datePickerIconDisabled) }), onChange: (e) => {
|
|
3962
|
+
return (jsx("div", { ref: wrapperRef, id: id, className: clsx(styles$h.datePicker, className), style: { ...containerStyle, ...style }, ...rest, children: jsx(Popover, { open: showCalendar, onOpenChange: setShowCalendar, asAnchor: true, trigger: jsx(TextField$1, { className: styles$h.textfieldContainer, type: "tel", icon: jsx(Calendar16Regular, { onClick: !disabled ? handleIconClick : undefined, className: clsx(styles$h.datePickerIcon, disabled && styles$h.datePickerIconDisabled) }), onChange: (e) => {
|
|
3933
3963
|
handleTextFieldChange(String(e));
|
|
3934
3964
|
}, onKeyDown: handleKeyDown, onFocus: handleFocus, persistIcon: true, autoComplete: "off", value: displayValue, helperText: !externalError ? (helperText || undefined) : undefined, errorMessage: externalError ? combinedHelperText : undefined, error: hasValidationError ? true : undefined, maxLength: 10, required: required, label: label, disabled: disabled, scale: scale, id: fieldId, "data-testid": testId, placeholder: locale === 'en-us' ? 'MM/DD/YYYY' : 'DD/MM/YYYY', "aria-label": "Open calendar", "aria-expanded": showCalendar, "aria-controls": calendarId, "aria-invalid": hasValidationError, "aria-describedby": externalError ? undefined : (helperText ? `${fieldId}-help` : undefined) }), content: jsx(Calendar, { selected: currentSelectedDate, currentDate: currentDate, onDateChange: setCurrentDate, onDaySelect: handleDaySelect, locale: locale, format: locale === 'en-us' ? 'mm/dd/yyyy' : 'dd/mm/yyyy', minDate: minDate, maxDate: maxDate, scale: scale, id: calendarId, onClear: () => {
|
|
3935
3965
|
handleDateChange(null);
|
|
@@ -4033,7 +4063,7 @@ const matchesAccept = (file, accept) => {
|
|
|
4033
4063
|
return fileType === type;
|
|
4034
4064
|
});
|
|
4035
4065
|
};
|
|
4036
|
-
const FileUpload = ({
|
|
4066
|
+
const FileUpload = forwardRef(({ value, onChange, helperText, error = false, errorMessage, maxFileSize, maxFilesQuantity, disabled = false, className, id, accept, multiple = true, description = 'Clique ou arraste os arquivos aqui', descriptionErrorMessage = 'Falha ao subir um ou mais arquivos.', ...rest }, ref) => {
|
|
4037
4067
|
const generatedId = useId();
|
|
4038
4068
|
const componentId = id || generatedId;
|
|
4039
4069
|
const helperId = `${componentId}-helper`;
|
|
@@ -4168,7 +4198,7 @@ const FileUpload = ({ ref, value, onChange, helperText, error = false, errorMess
|
|
|
4168
4198
|
}
|
|
4169
4199
|
}, children: jsx(Dismiss16Regular, { "aria-hidden": "true" }) })] }, `${file.name}-${index}`));
|
|
4170
4200
|
}) }))] }), displayedHelper && (jsx("span", { id: helperId, role: isError ? 'alert' : undefined, className: clsx(styles$e.helperText, isError && styles$e.errorText), children: displayedHelper }))] }));
|
|
4171
|
-
};
|
|
4201
|
+
});
|
|
4172
4202
|
FileUpload.displayName = 'FileUpload';
|
|
4173
4203
|
|
|
4174
4204
|
var styles$d = {"container":"Filter-module__container___cqntK","panel":"Filter-module__panel___19HqD","search":"Filter-module__search___f0gzj","list":"Filter-module__list___UpBk1","item":"Filter-module__item___oNdeY","itemSelected":"Filter-module__itemSelected___JIpJV","itemText":"Filter-module__itemText___RS--0","itemDisabled":"Filter-module__itemDisabled___X-ktg","itemIcon":"Filter-module__itemIcon___RjJSa","noResults":"Filter-module__noResults___3m6pn","footer":"Filter-module__footer___yYS5j","buttonContent":"Filter-module__buttonContent___28fKe","buttonArrow":"Filter-module__buttonArrow___VJlpc","buttonIcon":"Filter-module__buttonIcon___OOBpZ","triggerWrapper":"Filter-module__triggerWrapper___ptPRL","triggerContent":"Filter-module__triggerContent___LYo9j","body":"Filter-module__body___qsyhk","combinedFooter":"Filter-module__combinedFooter___kTnHP"};
|
|
@@ -4195,7 +4225,7 @@ const Combined = ({ buttonText = 'Filtrar', icon, variant = 'outlined', disabled
|
|
|
4195
4225
|
|
|
4196
4226
|
var styles$c = {"search":"Search-module__search___u3QsV","searchLeftIcon":"Search-module__searchLeftIcon___OKOBq","disabled":"Search-module__disabled___adbxO","inputWithClearIcon":"Search-module__inputWithClearIcon___cqvkq","searchClearIcon":"Search-module__searchClearIcon___qX9-h"};
|
|
4197
4227
|
|
|
4198
|
-
const Search = ({
|
|
4228
|
+
const Search = React__default.forwardRef(({ placeholder = 'Dica do que deve ser buscado', disabled = false, value, onChange, onKeyDown, onFocus, onBlur, onClear, onClick, onMouseDown, searchMode = 'instant', onSearch, id, scale = 1, className, style, virtualKeyboard, 'data-testid': testId, ...rest }, ref) => {
|
|
4199
4229
|
const [internalValue, setInternalValue] = useState('');
|
|
4200
4230
|
const { internalRef: inputRef, setRefs: setInputRefs } = useInputKeyboardValue(ref);
|
|
4201
4231
|
const isControlled = value !== undefined && onChange !== undefined;
|
|
@@ -4267,7 +4297,7 @@ const Search = ({ ref, placeholder = 'Dica do que deve ser buscado', disabled =
|
|
|
4267
4297
|
setInternalValue(val);
|
|
4268
4298
|
}
|
|
4269
4299
|
} }) }))] }));
|
|
4270
|
-
};
|
|
4300
|
+
});
|
|
4271
4301
|
Search.displayName = 'Search';
|
|
4272
4302
|
|
|
4273
4303
|
const Simple = ({ items, type = 'multiple', selectedIds, onApplyFilter, placeholder = 'Selecionar...', enableSearch = false, buttonText = 'Filter', icon, variant = 'outlined', onOpen, onClose, side = 'bottom', align = 'start', disabled = false, className, selectedDate, onDateSelect, onClearDate, minDate, maxDate, locale = 'pt-br', id, ...rest }) => {
|
|
@@ -5097,13 +5127,13 @@ const ExpandableSelectItem = ({ item, variant, onSelect, selectedValues, level =
|
|
|
5097
5127
|
}, role: "button", tabIndex: item.disabled ? -1 : 0, "data-disabled": item.disabled || undefined, "data-selected": isSelected && !hasChildren ? 'true' : undefined, "data-testid": `select-item-${item.value}`, children: [variant === 'icon' && item.icon && (jsx("span", { className: styles$6.icon, children: item.icon })), jsxs("div", { className: styles$6.textContent, children: [jsx("div", { className: styles$6.title, children: item.text }), item.subTitle && jsx("div", { className: styles$6.subTitle, children: item.subTitle })] }), hasChildren && (jsx("span", { className: styles$6.chevron, children: isExpanded ? jsx(ChevronDown16Regular, {}) : jsx(ChevronRight16Regular, {}) }))] }) }), hasChildren && isExpanded && (jsx("div", { className: styles$6.childrenWrapper, children: item.children.map((child) => (jsx(ExpandableSelectItem, { item: child, variant: variant, onSelect: onSelect, selectedValues: selectedValues, level: level + 1 }, child.id || child.value))) }))] }));
|
|
5098
5128
|
};
|
|
5099
5129
|
|
|
5100
|
-
const SelectItem = ({
|
|
5130
|
+
const SelectItem = React__default.forwardRef(({ text, subTitle, icon, disabled, value, variant, disableFocusOnHover, ...restProps }, ref) => {
|
|
5101
5131
|
return (jsxs("div", { className: clsx(styles$6.itemWrapper, {
|
|
5102
5132
|
[styles$6.disabled]: disabled,
|
|
5103
5133
|
}), "data-disabled": disabled || undefined, "data-testid": `select-item-${value}`, ref: ref, children: [variant === 'icon' && icon && (jsx("span", { className: styles$6.icon, children: icon })), jsxs(Select$1.Item, { className: clsx(styles$6.item, {
|
|
5104
5134
|
[styles$6.disabled]: disabled,
|
|
5105
5135
|
}), value: value, disabled: disabled, onPointerMove: disableFocusOnHover ? (e) => e.preventDefault() : undefined, ...restProps, children: [jsx(Select$1.ItemText, { className: styles$6.title, children: text }), subTitle && jsx("div", { className: styles$6.subTitle, children: subTitle }), jsx(Select$1.ItemIndicator, { className: styles$6.itemIndicator })] })] }));
|
|
5106
|
-
};
|
|
5136
|
+
});
|
|
5107
5137
|
SelectItem.displayName = 'SelectItem';
|
|
5108
5138
|
|
|
5109
5139
|
const initialState = {
|
|
@@ -5673,7 +5703,7 @@ const TableV2 = ({ columns, data, rowSelection: rowSelectionConfig, enableSortin
|
|
|
5673
5703
|
maxWidth: col.column.columnDef.maxSize !== Number.MAX_SAFE_INTEGER
|
|
5674
5704
|
? col.column.columnDef.maxSize
|
|
5675
5705
|
: undefined,
|
|
5676
|
-
}, children: jsx("div", { className: styles$5.tableThContent, children: col.isPlaceholder ? null : col.column.getCanSort() ? (jsxs("button", { type: "button", className: styles$5.tableSortButton, onClick: col.column.getToggleSortingHandler(), "aria-label": `Ordenar por ${typeof col.column.columnDef.header === 'string' ? col.column.columnDef.header : col.id}`, children: [flexRender(col.column.columnDef.header, col.getContext()), col.column.getIsSorted() === 'asc' ? (jsx(ArrowSortUp16Regular, { className: styles$5.tableSortIcon })) : col.column.getIsSorted() === 'desc' ? (jsx(ArrowSortDown16Regular, { className: styles$5.tableSortIcon })) : (jsx(ArrowSort16Regular, { className:
|
|
5706
|
+
}, children: jsx("div", { className: styles$5.tableThContent, children: col.isPlaceholder ? null : col.column.getCanSort() ? (jsxs("button", { type: "button", className: styles$5.tableSortButton, onClick: col.column.getToggleSortingHandler(), "aria-label": `Ordenar por ${typeof col.column.columnDef.header === 'string' ? col.column.columnDef.header : col.id}`, children: [flexRender(col.column.columnDef.header, col.getContext()), col.column.getIsSorted() === 'asc' ? (jsx(ArrowSortUp16Regular, { className: styles$5.tableSortIcon })) : col.column.getIsSorted() === 'desc' ? (jsx(ArrowSortDown16Regular, { className: styles$5.tableSortIcon })) : (jsx(ArrowSort16Regular, { className: styles$5.tableSortIconNeutral }))] })) : (flexRender(col.column.columnDef.header, col.getContext())) }) }, col.id))) }, headerGroup.id))) }), jsx("tbody", { className: styles$5.tableBody, children: loading ? (Array.from({ length: skeletonRowCount }).map((_, rowIdx) => (jsx("tr", { className: styles$5.tableRow, children: table.getVisibleLeafColumns().map((col) => (jsx("td", { className: styles$5.tableTd, children: jsx(Skeleton, {}) }, col.id))) }, `skeleton-row-${rowIdx}`)))) : table.getRowModel().rows.length > 0 ? (table.getRowModel().rows.map((row, index) => {
|
|
5677
5707
|
const rowProps = onRow?.(row.original, index) ?? {};
|
|
5678
5708
|
return (jsx("tr", { className: clsx(styles$5.tableRow, rowProps.className), onClick: rowProps.onClick, onDoubleClick: rowProps.onDoubleClick, children: row.getVisibleCells().map((cell) => (jsx("td", { className: styles$5.tableTd, style: {
|
|
5679
5709
|
textAlign: cell.column.columnDef.meta?.align,
|
|
@@ -5698,7 +5728,7 @@ const TableV2 = ({ columns, data, rowSelection: rowSelectionConfig, enableSortin
|
|
|
5698
5728
|
|
|
5699
5729
|
var styles$3 = {"container":"TextArea-module__container___WEBC-","inputWrapper":"TextArea-module__inputWrapper___-omPx","inputContainer":"TextArea-module__inputContainer___0-jKY","footer":"TextArea-module__footer___7XMlj","helperText":"TextArea-module__helperText___709rD","charCount":"TextArea-module__charCount___zdbxM","error":"TextArea-module__error___DWDms","disabled":"TextArea-module__disabled___lHxCa"};
|
|
5700
5730
|
|
|
5701
|
-
const TextArea = ({
|
|
5731
|
+
const TextArea = forwardRef(({ className, value, label, placeholder, onChange, disabled = false, maxLength, required = false, helperText, tooltipText, tooltipSide = 'bottom', tooltipAlign = 'start', errorMessage, error, id, onBlur, onFocus, name, resize = 'vertical', charCount = false, height, virtualKeyboard, ...rest }, ref) => {
|
|
5702
5732
|
const normalizeValue = (val) => {
|
|
5703
5733
|
return val === undefined || val === null ? '' : String(val);
|
|
5704
5734
|
};
|
|
@@ -5743,7 +5773,7 @@ const TextArea = ({ ref, className, value, label, placeholder, onChange, disable
|
|
|
5743
5773
|
onChange?.(val);
|
|
5744
5774
|
}
|
|
5745
5775
|
} }) }))] }));
|
|
5746
|
-
};
|
|
5776
|
+
});
|
|
5747
5777
|
TextArea.displayName = 'TextArea';
|
|
5748
5778
|
var TextArea_default = React__default.memo(TextArea);
|
|
5749
5779
|
|