pixelon 0.9.2 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/atoms/lumi/PhoneInput/PhoneInput.d.ts +29 -0
- package/dist/components/atoms/lumi/PhoneInput/index.d.ts +3 -0
- package/dist/components/atoms/lumi/PhoneInput/phone-countries.d.ts +19 -0
- package/dist/components/atoms/lumi/SheetSelect/SheetSelect.d.ts +32 -0
- package/dist/components/atoms/lumi/SheetSelect/index.d.ts +2 -0
- package/dist/components/molecules/chat/StructuredContent/components/LocationField/types.d.ts +2 -0
- package/dist/components/molecules/chat/StructuredContent/components/MapView/types.d.ts +7 -0
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveCrud/types.d.ts +23 -1
- package/dist/components/organisms/lumi/DynamicForm/helpers/sanitizers.d.ts +28 -0
- package/dist/components/organisms/lumi/DynamicForm/types.d.ts +4 -0
- package/dist/components/templates/lumi/Crud/types.d.ts +6 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +702 -263
- package/dist/index.js +709 -262
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
- package/src/styles/index.scss +2 -0
- package/dist/components/atoms/chat/AudioWaves/AudioWaves(1).d.ts +0 -21
- package/dist/components/atoms/chat/AudioWaves/index(1).d.ts +0 -2
- package/dist/components/atoms/chat/DateDivider/DateDivider(1).d.ts +0 -7
- package/dist/components/atoms/chat/Loader/Loader(1).d.ts +0 -10
- package/dist/components/atoms/chat/Loader/index(1).d.ts +0 -2
- package/dist/components/atoms/chat/Select/index(1).d.ts +0 -2
- package/dist/components/atoms/lumi/Button/Button(1).d.ts +0 -17
- package/dist/components/atoms/lumi/Checkbox/Checkbox(1).d.ts +0 -5
- package/dist/components/atoms/lumi/Checkbox/index(1).d.ts +0 -2
- package/dist/components/atoms/lumi/Checkbox/index(2).d.ts +0 -2
- package/dist/components/atoms/lumi/Checkbox/types(1).d.ts +0 -93
- package/dist/components/atoms/lumi/CurrencyDisplay/index(1).d.ts +0 -2
- package/dist/components/atoms/lumi/DateDisplay/index(1).d.ts +0 -2
- package/dist/components/atoms/lumi/DateDisplay/index(2).d.ts +0 -2
- package/dist/components/atoms/lumi/DateInput/DateInput(1).d.ts +0 -27
- package/dist/components/atoms/lumi/DateInput/WebDatePicker(1).d.ts +0 -19
- package/dist/components/atoms/lumi/DateInput/WebDatePicker(2).d.ts +0 -19
- package/dist/components/atoms/lumi/Icon/Icon(1).d.ts +0 -52
- package/dist/components/atoms/lumi/Input/index(1).d.ts +0 -3
- package/dist/components/atoms/lumi/Popover/index(1).d.ts +0 -2
- package/dist/components/atoms/lumi/Popover/types(1).d.ts +0 -62
- package/dist/components/atoms/lumi/TextArea/index(1).d.ts +0 -2
- package/dist/components/atoms/lumi/TextArea/types(1).d.ts +0 -35
- package/dist/components/atoms/lumi/TimeInput/TimeInput(1).d.ts +0 -27
- package/dist/components/atoms/lumi/TimeInput/TimeInput(2).d.ts +0 -27
- package/dist/components/molecules/chat/FullscreenViewer/hooks/useSwipeGestures(1).d.ts +0 -12
- package/dist/components/molecules/chat/StructuredContent/StructuredContent(1).d.ts +0 -10
- package/dist/components/molecules/chat/StructuredContent/components/Cart/Cart.d.ts +0 -3
- package/dist/components/molecules/chat/StructuredContent/components/ProductCard/ProductCard.d.ts +0 -3
- package/dist/components/molecules/chat/StructuredContent/components/ProductCarousel/ProductCarousel.d.ts +0 -3
- package/dist/components/molecules/chat/StructuredContent/components/ProductManager/ProductManager.d.ts +0 -3
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveCrud/PriceNegotiationChat.d.ts +0 -4
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/DynamicField(1).d.ts +0 -13
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/buildYupSchema(1).d.ts +0 -4
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/types(1).d.ts +0 -91
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/useReactiveEndpoints(1).d.ts +0 -17
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/useReactiveEndpoints(2).d.ts +0 -23
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/useReactiveForm(1).d.ts +0 -38
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveMap/ReactiveMap.d.ts +0 -12
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveMap/ReactiveMapChat.d.ts +0 -3
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveMap/types.d.ts +0 -36
- package/dist/components/molecules/chat/StructuredContent/components/ServiceShortcuts/ServiceShortcutsChat.d.ts +0 -3
- package/dist/components/molecules/chat/StructuredContent/helpers/contentParser(1).d.ts +0 -7
- package/dist/components/molecules/chat/StructuredContent/index(1).d.ts +0 -2
- package/dist/components/molecules/lumi/Breadcrumb/Breadcrumb(1).d.ts +0 -10
- package/dist/components/molecules/lumi/Breadcrumb/Breadcrumb(2).d.ts +0 -10
- package/dist/components/molecules/lumi/Breadcrumb/types(1).d.ts +0 -105
- package/dist/components/molecules/lumi/Checkbox/Checkbox(1).d.ts +0 -11
- package/dist/components/molecules/lumi/Checkbox/index(1).d.ts +0 -4
- package/dist/components/molecules/lumi/Checkbox/use-cases/index(1).d.ts +0 -1
- package/dist/components/molecules/lumi/Checkbox/validation-helpers(1).d.ts +0 -151
- package/dist/components/molecules/lumi/DateInput/FormDateInput(1).d.ts +0 -12
- package/dist/components/molecules/lumi/DateInput/index(1).d.ts +0 -2
- package/dist/components/molecules/lumi/DateInput/use-cases/FormDateInputClearWithResetUseCase(1).d.ts +0 -21
- package/dist/components/molecules/lumi/DateInput/use-cases/FormDateInputErrorVisibilityUseCase(1).d.ts +0 -21
- package/dist/components/molecules/lumi/Drawer/Drawer(1).d.ts +0 -39
- package/dist/components/molecules/lumi/Drawer/index(1).d.ts +0 -2
- package/dist/components/molecules/lumi/DropdownMenu/DropdownMenu(1).d.ts +0 -22
- package/dist/components/molecules/lumi/DropdownMenu/index(1).d.ts +0 -2
- package/dist/components/molecules/lumi/DropdownMenu/types(1).d.ts +0 -29
- package/dist/components/molecules/lumi/Filter/FilterRow(1).d.ts +0 -13
- package/dist/components/molecules/lumi/Filter/helpers/conditionHelpers(1).d.ts +0 -14
- package/dist/components/molecules/lumi/Filter/index(1).d.ts +0 -5
- package/dist/components/molecules/lumi/Filter/types(1).d.ts +0 -115
- package/dist/components/molecules/lumi/Input/Input(1).d.ts +0 -12
- package/dist/components/molecules/lumi/Menu/Menu(1).d.ts +0 -18
- package/dist/components/molecules/lumi/Menu/MenuContext(1).d.ts +0 -41
- package/dist/components/molecules/lumi/Menu/MenuItem(1).d.ts +0 -6
- package/dist/components/molecules/lumi/Menu/MenuItem(2).d.ts +0 -6
- package/dist/components/molecules/lumi/Menu/MenuItemGroup(1).d.ts +0 -6
- package/dist/components/molecules/lumi/Menu/SubMenu(1).d.ts +0 -6
- package/dist/components/molecules/lumi/Menu/iconHelper(1).d.ts +0 -15
- package/dist/components/molecules/lumi/Menu/index(1).d.ts +0 -8
- package/dist/components/molecules/lumi/Menu/index(2).d.ts +0 -8
- package/dist/components/molecules/lumi/Menu/types(1).d.ts +0 -119
- package/dist/components/molecules/lumi/Pagination/Pagination(1).d.ts +0 -4
- package/dist/components/molecules/lumi/Pagination/index(1).d.ts +0 -2
- package/dist/components/molecules/lumi/Select/Select(1).d.ts +0 -14
- package/dist/components/molecules/lumi/Select/Select(2).d.ts +0 -14
- package/dist/components/molecules/lumi/Select/Select(3).d.ts +0 -14
- package/dist/components/molecules/lumi/Select/index(1).d.ts +0 -2
- package/dist/components/molecules/lumi/Select/index(2).d.ts +0 -2
- package/dist/components/molecules/lumi/Select/use-cases/FormSelectClearWithResetUseCase(1).d.ts +0 -21
- package/dist/components/molecules/lumi/Select/use-cases/FormSelectClearWithResetUseCase(2).d.ts +0 -21
- package/dist/components/molecules/lumi/Select/use-cases/index(1).d.ts +0 -2
- package/dist/components/molecules/lumi/Select/use-cases/index(2).d.ts +0 -2
- package/dist/components/molecules/lumi/SessionExpiryPrompt/SessionExpiryPrompt.d.ts +0 -25
- package/dist/components/molecules/lumi/SessionExpiryPrompt/index.d.ts +0 -1
- package/dist/components/molecules/lumi/Table/Table(1).d.ts +0 -6
- package/dist/components/molecules/lumi/Table/Table(2).d.ts +0 -6
- package/dist/components/molecules/lumi/Table/index(1).d.ts +0 -2
- package/dist/components/molecules/lumi/Table/types(1).d.ts +0 -177
- package/dist/components/molecules/lumi/Table/types(2).d.ts +0 -177
- package/dist/components/molecules/lumi/Tabs/Tabs(1).d.ts +0 -4
- package/dist/components/molecules/lumi/Tabs/Tabs(2).d.ts +0 -4
- package/dist/components/molecules/lumi/Tabs/index(1).d.ts +0 -2
- package/dist/components/molecules/lumi/Tabs/index(2).d.ts +0 -2
- package/dist/components/molecules/lumi/TimeInput/FormTimeInput(1).d.ts +0 -12
- package/dist/components/molecules/lumi/TimeInput/use-cases/FormTimeInputClearWithResetUseCase(1).d.ts +0 -21
- package/dist/components/molecules/lumi/TimeInput/use-cases/FormTimeInputErrorVisibilityUseCase(1).d.ts +0 -21
- package/dist/components/molecules/lumi/TimeInput/use-cases/index(1).d.ts +0 -4
- package/dist/components/organisms/chat/Chat/Chat(1).d.ts +0 -12
- package/dist/components/organisms/chat/Chat/hooks/useChatHandlers(1).d.ts +0 -15
- package/dist/components/organisms/chat/Chat/hooks/useKeyboardLock(1).d.ts +0 -15
- package/dist/components/organisms/chat/Chat/index(1).d.ts +0 -3
- package/dist/components/organisms/chat/Chat/store/index(1).d.ts +0 -4
- package/dist/components/organisms/chat/Chat/use-cases/GroupMessagesByDateUseCase(1).d.ts +0 -20
- package/dist/components/organisms/chat/index(1).d.ts +0 -3
- package/dist/components/organisms/chat/index(2).d.ts +0 -3
- package/dist/components/organisms/lumi/ActionBar/ActionBar(1).d.ts +0 -18
- package/dist/components/organisms/lumi/ActionBar/types(1).d.ts +0 -57
- package/dist/components/organisms/lumi/BaseNavbar/types(1).d.ts +0 -34
- package/dist/components/organisms/lumi/BaseWorkspace/BaseWorkspace(1).d.ts +0 -28
- package/dist/components/organisms/lumi/BaseWorkspace/index(1).d.ts +0 -2
- package/dist/components/organisms/lumi/Calendar/components/CalendarEvent(1).d.ts +0 -18
- package/dist/components/organisms/lumi/Calendar/components/CalendarEvent(2).d.ts +0 -18
- package/dist/components/organisms/lumi/Calendar/components/CalendarEvent(3).d.ts +0 -18
- package/dist/components/organisms/lumi/Calendar/components/CalendarHeader(1).d.ts +0 -14
- package/dist/components/organisms/lumi/Calendar/components/TimeGutter(1).d.ts +0 -10
- package/dist/components/organisms/lumi/Calendar/components/TimeGutter(2).d.ts +0 -10
- package/dist/components/organisms/lumi/Calendar/hooks/index(1).d.ts +0 -4
- package/dist/components/organisms/lumi/Calendar/hooks/useCalendarHeight(1).d.ts +0 -58
- package/dist/components/organisms/lumi/Calendar/hooks/useCalendarHeight(2).d.ts +0 -58
- package/dist/components/organisms/lumi/Calendar/hooks/useEventLayout(1).d.ts +0 -21
- package/dist/components/organisms/lumi/Calendar/hooks/useEventLayout(2).d.ts +0 -21
- package/dist/components/organisms/lumi/Calendar/hooks/useTimeSlots(1).d.ts +0 -14
- package/dist/components/organisms/lumi/Calendar/hooks/useTimeSlots(2).d.ts +0 -14
- package/dist/components/organisms/lumi/Calendar/hooks/useTimeSlots(3).d.ts +0 -14
- package/dist/components/organisms/lumi/Calendar/i18n/index(1).d.ts +0 -1
- package/dist/components/organisms/lumi/Calendar/i18n/index(2).d.ts +0 -1
- package/dist/components/organisms/lumi/Calendar/i18n/translations(1).d.ts +0 -34
- package/dist/components/organisms/lumi/Calendar/index(1).d.ts +0 -2
- package/dist/components/organisms/lumi/Calendar/utils/dateUtils(1).d.ts +0 -140
- package/dist/components/organisms/lumi/Calendar/utils/dateUtils(2).d.ts +0 -140
- package/dist/components/organisms/lumi/Calendar/utils/index(1).d.ts +0 -2
- package/dist/components/organisms/lumi/Calendar/utils/multiDayUtils(1).d.ts +0 -73
- package/dist/components/organisms/lumi/Calendar/views/DayView(1).d.ts +0 -17
- package/dist/components/organisms/lumi/Calendar/views/DayView(2).d.ts +0 -17
- package/dist/components/organisms/lumi/Calendar/views/MonthView(1).d.ts +0 -17
- package/dist/components/organisms/lumi/Calendar/views/MonthView(2).d.ts +0 -17
- package/dist/components/organisms/lumi/Calendar/views/WeekView(1).d.ts +0 -19
- package/dist/components/organisms/lumi/Calendar/views/WeekView(2).d.ts +0 -19
- package/dist/components/organisms/lumi/Calendar/views/YearView(1).d.ts +0 -13
- package/dist/components/organisms/lumi/Calendar/views/index(1).d.ts +0 -4
- package/dist/components/organisms/lumi/Calendar/views/index(2).d.ts +0 -4
- package/dist/components/organisms/lumi/DashboardNavbar/index(1).d.ts +0 -7
- package/dist/components/organisms/lumi/DashboardNavbar/types(1).d.ts +0 -52
- package/dist/components/organisms/lumi/DashboardWorkspace/DashboardWorkspace(1).d.ts +0 -23
- package/dist/components/organisms/lumi/DashboardWorkspace/DashboardWorkspace(2).d.ts +0 -23
- package/dist/components/organisms/lumi/DashboardWorkspace/index(1).d.ts +0 -7
- package/dist/components/organisms/lumi/DashboardWorkspace/index(2).d.ts +0 -7
- package/dist/components/organisms/lumi/DashboardWorkspace/types(1).d.ts +0 -60
- package/dist/components/organisms/lumi/DashboardWorkspace/types(2).d.ts +0 -60
- package/dist/components/organisms/lumi/DynamicForm/DynamicForm(1).d.ts +0 -21
- package/dist/components/organisms/lumi/DynamicForm/helpers/fieldMapper(1).d.ts +0 -17
- package/dist/components/organisms/lumi/DynamicForm/helpers/fieldMapper(2).d.ts +0 -17
- package/dist/components/organisms/lumi/DynamicForm/helpers/fieldRenderer(1).d.ts +0 -6
- package/dist/components/organisms/lumi/DynamicForm/helpers/fieldRenderer(2).d.ts +0 -6
- package/dist/components/organisms/lumi/DynamicForm/index(1).d.ts +0 -2
- package/dist/components/organisms/lumi/DynamicForm/index(2).d.ts +0 -2
- package/dist/components/organisms/lumi/DynamicForm/types(1).d.ts +0 -96
- package/dist/components/organisms/lumi/DynamicForm/types(2).d.ts +0 -96
- package/dist/components/organisms/lumi/FormDrawer/FormDrawer(1).d.ts +0 -5
- package/dist/components/organisms/lumi/FormDrawer/index(1).d.ts +0 -3
- package/dist/components/organisms/lumi/FormDrawer/types(1).d.ts +0 -61
- package/dist/components/organisms/lumi/FormDrawer/types(2).d.ts +0 -61
- package/dist/components/organisms/lumi/Stepper/StepIndicator(1).d.ts +0 -4
- package/dist/components/organisms/lumi/Stepper/Stepper(1).d.ts +0 -5
- package/dist/components/organisms/lumi/Stepper/index(1).d.ts +0 -3
- package/dist/components/organisms/lumi/Stepper/types(1).d.ts +0 -96
- package/dist/components/organisms/lumi/Stepper/types(2).d.ts +0 -96
- package/dist/components/organisms/lumi/index(1).d.ts +0 -10
- package/dist/components/organisms/lumi/index(2).d.ts +0 -10
- package/dist/components/templates/chat/ChatWidget/ChatWidget(1).d.ts +0 -10
- package/dist/components/templates/chat/ChatWidget/hooks/index(1).d.ts +0 -1
- package/dist/components/templates/chat/ChatWidget/index(1).d.ts +0 -2
- package/dist/components/templates/chat/ChatWidget/index(2).d.ts +0 -2
- package/dist/components/templates/chat/ChatWidget/types(1).d.ts +0 -90
- package/dist/components/templates/lumi/Base/hooks/index(1).d.ts +0 -2
- package/dist/components/templates/lumi/Base/hooks/useAppHeight(1).d.ts +0 -21
- package/dist/components/templates/lumi/Base/index(1).d.ts +0 -2
- package/dist/components/templates/lumi/Base/types(1).d.ts +0 -54
- package/dist/components/templates/lumi/Crud/Crud(1).d.ts +0 -6
- package/dist/components/templates/lumi/Crud/Crud(2).d.ts +0 -6
- package/dist/components/templates/lumi/Crud/ScrollToEnd.d.ts +0 -18
- package/dist/components/templates/lumi/Crud/helpers/fieldMapper(1).d.ts +0 -13
- package/dist/components/templates/lumi/Crud/hooks/useCrudActions(1).d.ts +0 -11
- package/dist/components/templates/lumi/Crud/index(1).d.ts +0 -2
- package/dist/components/templates/lumi/Crud/store/actions(1).d.ts +0 -45
- package/dist/components/templates/lumi/Crud/store/crudStore(1).d.ts +0 -8
- package/dist/components/templates/lumi/Crud/store/index(1).d.ts +0 -5
- package/dist/components/templates/lumi/Crud/store/types(1).d.ts +0 -71
- package/dist/components/templates/lumi/Dashboard/Dashboard(1).d.ts +0 -25
- package/dist/components/templates/lumi/Dashboard/hooks/index(1).d.ts +0 -12
- package/dist/components/templates/lumi/Dashboard/hooks/index(2).d.ts +0 -12
- package/dist/components/templates/lumi/Dashboard/hooks/useDashboardStore(1).d.ts +0 -34
- package/dist/components/templates/lumi/Dashboard/hooks/useScrollToTop(1).d.ts +0 -47
- package/dist/components/templates/lumi/Dashboard/index(1).d.ts +0 -10
- package/dist/components/templates/lumi/Dashboard/store/storeKeys(1).d.ts +0 -13
- package/dist/components/templates/lumi/Dashboard/store/types(1).d.ts +0 -73
- package/dist/components/templates/lumi/Dashboard/store/types(2).d.ts +0 -73
- package/dist/components/templates/lumi/Dashboard/types(1).d.ts +0 -114
- package/dist/components/templates/lumi/Dashboard/types(2).d.ts +0 -114
- package/dist/components/templates/lumi/index(1).d.ts +0 -3
- package/dist/core/chat/ChatConfigContext(1).d.ts +0 -36
- package/dist/index(1).esm.js +0 -19378
- package/dist/index(1).js +0 -19487
package/dist/index.esm.js
CHANGED
|
@@ -7343,6 +7343,7 @@ const Input$1 = forwardRef(
|
|
|
7343
7343
|
);
|
|
7344
7344
|
Input$1.displayName = "Input";
|
|
7345
7345
|
|
|
7346
|
+
const sinTildes$2 = (s) => s.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
|
7346
7347
|
const Select$1 = forwardRef(
|
|
7347
7348
|
({
|
|
7348
7349
|
options = [],
|
|
@@ -7391,7 +7392,7 @@ const Select$1 = forwardRef(
|
|
|
7391
7392
|
const selectorRef = useRef(null);
|
|
7392
7393
|
const [dropdownPosition, setDropdownPosition] = useState(null);
|
|
7393
7394
|
const filteredOptions = showSearch && searchValue ? options.filter(
|
|
7394
|
-
(option) => filterOption ? filterOption(searchValue, option) : option.label
|
|
7395
|
+
(option) => filterOption ? filterOption(searchValue, option) : sinTildes$2(option.label).includes(sinTildes$2(searchValue))
|
|
7395
7396
|
) : options;
|
|
7396
7397
|
const isOptionSelected = (option) => {
|
|
7397
7398
|
if (mode === "multiple") {
|
|
@@ -12319,6 +12320,442 @@ const CurrencyDisplay = ({
|
|
|
12319
12320
|
};
|
|
12320
12321
|
CurrencyDisplay.displayName = "CurrencyDisplay";
|
|
12321
12322
|
|
|
12323
|
+
const CARD_VARIANTS = {
|
|
12324
|
+
/** Con sombra: flota sobre el contenido (hojas, diálogos, paneles). */
|
|
12325
|
+
ELEVATED: "elevated"};
|
|
12326
|
+
const CARD_PADDINGS = {
|
|
12327
|
+
MEDIUM: "medium",
|
|
12328
|
+
LARGE: "large"
|
|
12329
|
+
};
|
|
12330
|
+
const CARD_RADII = {
|
|
12331
|
+
NONE: "none",
|
|
12332
|
+
LARGE: "large"
|
|
12333
|
+
};
|
|
12334
|
+
|
|
12335
|
+
const BASE = `${COMPONENT_PREFIX}card`;
|
|
12336
|
+
const Card = React.forwardRef(
|
|
12337
|
+
({
|
|
12338
|
+
variant = CARD_VARIANTS.ELEVATED,
|
|
12339
|
+
padding = CARD_PADDINGS.MEDIUM,
|
|
12340
|
+
radius = CARD_RADII.LARGE,
|
|
12341
|
+
fullWidth = false,
|
|
12342
|
+
className = "",
|
|
12343
|
+
children,
|
|
12344
|
+
...rest
|
|
12345
|
+
}, ref) => {
|
|
12346
|
+
const classes = [
|
|
12347
|
+
BASE,
|
|
12348
|
+
`${BASE}--${variant}`,
|
|
12349
|
+
`${BASE}--padding-${padding}`,
|
|
12350
|
+
`${BASE}--radius-${radius}`,
|
|
12351
|
+
fullWidth ? `${BASE}--full-width` : "",
|
|
12352
|
+
className
|
|
12353
|
+
].filter(Boolean).join(" ");
|
|
12354
|
+
return /* @__PURE__ */ jsx("div", { ref, className: classes, ...rest, children });
|
|
12355
|
+
}
|
|
12356
|
+
);
|
|
12357
|
+
Card.displayName = "Card";
|
|
12358
|
+
|
|
12359
|
+
const CLASS$j = "px-lumi-bottom-sheet";
|
|
12360
|
+
const BottomSheet = ({
|
|
12361
|
+
open,
|
|
12362
|
+
children,
|
|
12363
|
+
onClose,
|
|
12364
|
+
showGrabber = true,
|
|
12365
|
+
closeOnBackdrop = false,
|
|
12366
|
+
closeOnEscape = true,
|
|
12367
|
+
ariaLabelledBy,
|
|
12368
|
+
className = ""
|
|
12369
|
+
}) => {
|
|
12370
|
+
useEffect(() => {
|
|
12371
|
+
if (!open) return;
|
|
12372
|
+
const onKey = (e) => {
|
|
12373
|
+
if (e.key !== "Escape" || !closeOnEscape) return;
|
|
12374
|
+
e.stopPropagation();
|
|
12375
|
+
onClose?.();
|
|
12376
|
+
};
|
|
12377
|
+
document.addEventListener("keydown", onKey, true);
|
|
12378
|
+
const previous = document.body.style.overflow;
|
|
12379
|
+
document.body.style.overflow = "hidden";
|
|
12380
|
+
return () => {
|
|
12381
|
+
document.removeEventListener("keydown", onKey, true);
|
|
12382
|
+
document.body.style.overflow = previous;
|
|
12383
|
+
};
|
|
12384
|
+
}, [open, closeOnEscape, onClose]);
|
|
12385
|
+
if (!open) return null;
|
|
12386
|
+
return createPortal(
|
|
12387
|
+
/* @__PURE__ */ jsxs(
|
|
12388
|
+
"div",
|
|
12389
|
+
{
|
|
12390
|
+
className: [CLASS$j, className].filter(Boolean).join(" "),
|
|
12391
|
+
role: "dialog",
|
|
12392
|
+
"aria-modal": "true",
|
|
12393
|
+
"aria-labelledby": ariaLabelledBy,
|
|
12394
|
+
children: [
|
|
12395
|
+
/* @__PURE__ */ jsx(
|
|
12396
|
+
"div",
|
|
12397
|
+
{
|
|
12398
|
+
className: `${CLASS$j}__backdrop`,
|
|
12399
|
+
"aria-hidden": "true",
|
|
12400
|
+
onClick: closeOnBackdrop ? onClose : void 0
|
|
12401
|
+
}
|
|
12402
|
+
),
|
|
12403
|
+
/* @__PURE__ */ jsxs(
|
|
12404
|
+
Card,
|
|
12405
|
+
{
|
|
12406
|
+
className: `${CLASS$j}__sheet`,
|
|
12407
|
+
padding: CARD_PADDINGS.LARGE,
|
|
12408
|
+
radius: CARD_RADII.NONE,
|
|
12409
|
+
fullWidth: true,
|
|
12410
|
+
children: [
|
|
12411
|
+
showGrabber && /* @__PURE__ */ jsx("div", { className: `${CLASS$j}__grabber`, "aria-hidden": "true" }),
|
|
12412
|
+
children
|
|
12413
|
+
]
|
|
12414
|
+
}
|
|
12415
|
+
)
|
|
12416
|
+
]
|
|
12417
|
+
}
|
|
12418
|
+
),
|
|
12419
|
+
document.body
|
|
12420
|
+
);
|
|
12421
|
+
};
|
|
12422
|
+
BottomSheet.displayName = "BottomSheet";
|
|
12423
|
+
|
|
12424
|
+
const PHONE_COUNTRIES = [
|
|
12425
|
+
{ code: "CO", name: "Colombia", dialCode: "+57", digits: 10 },
|
|
12426
|
+
{ code: "EC", name: "Ecuador", dialCode: "+593", digits: 9 },
|
|
12427
|
+
{ code: "PE", name: "Per\xFA", dialCode: "+51", digits: 9 },
|
|
12428
|
+
{ code: "VE", name: "Venezuela", dialCode: "+58", digits: 10 },
|
|
12429
|
+
{ code: "PA", name: "Panam\xE1", dialCode: "+507", digits: 8 },
|
|
12430
|
+
{ code: "MX", name: "M\xE9xico", dialCode: "+52", digits: 10 },
|
|
12431
|
+
{ code: "AR", name: "Argentina", dialCode: "+54", digits: 10 },
|
|
12432
|
+
{ code: "CL", name: "Chile", dialCode: "+56", digits: 9 },
|
|
12433
|
+
{ code: "BR", name: "Brasil", dialCode: "+55", digits: 11 },
|
|
12434
|
+
{ code: "CR", name: "Costa Rica", dialCode: "+506", digits: 8 },
|
|
12435
|
+
{ code: "US", name: "Estados Unidos", dialCode: "+1", digits: 10 },
|
|
12436
|
+
{ code: "ES", name: "Espa\xF1a", dialCode: "+34", digits: 9 }
|
|
12437
|
+
];
|
|
12438
|
+
const DEFAULT_PHONE_COUNTRY = "CO";
|
|
12439
|
+
function flagOf(code) {
|
|
12440
|
+
const c = (code || "").toUpperCase();
|
|
12441
|
+
if (!/^[A-Z]{2}$/.test(c)) return "";
|
|
12442
|
+
return [...c].map((ch) => String.fromCodePoint(127462 + ch.charCodeAt(0) - 65)).join("");
|
|
12443
|
+
}
|
|
12444
|
+
function splitPhone(value, countries, defaultCountry) {
|
|
12445
|
+
const porDefecto = countries.find((c) => c.code === defaultCountry) ?? countries[0];
|
|
12446
|
+
const v = (value ?? "").replace(/[^0-9+]/g, "");
|
|
12447
|
+
if (v.startsWith("+")) {
|
|
12448
|
+
const d = v.slice(1);
|
|
12449
|
+
const match = countries.filter((c) => d.startsWith(c.dialCode.slice(1))).sort((a, b) => b.dialCode.length - a.dialCode.length)[0];
|
|
12450
|
+
if (match) return { country: match, digits: d.slice(match.dialCode.length - 1) };
|
|
12451
|
+
}
|
|
12452
|
+
return { country: porDefecto, digits: v.replace(/\D/g, "") };
|
|
12453
|
+
}
|
|
12454
|
+
|
|
12455
|
+
const CLASS$i = "px-lumi-phone-input";
|
|
12456
|
+
function sinTildes$1(s) {
|
|
12457
|
+
return s.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase();
|
|
12458
|
+
}
|
|
12459
|
+
const PhoneInput = React.forwardRef(
|
|
12460
|
+
({
|
|
12461
|
+
value,
|
|
12462
|
+
onChange,
|
|
12463
|
+
onBlur,
|
|
12464
|
+
label,
|
|
12465
|
+
placeholder,
|
|
12466
|
+
disabled,
|
|
12467
|
+
readOnly,
|
|
12468
|
+
error,
|
|
12469
|
+
countries = PHONE_COUNTRIES,
|
|
12470
|
+
defaultCountry = DEFAULT_PHONE_COUNTRY,
|
|
12471
|
+
name,
|
|
12472
|
+
id,
|
|
12473
|
+
className,
|
|
12474
|
+
labels
|
|
12475
|
+
}, ref) => {
|
|
12476
|
+
const [paisElegido, setPaisElegido] = useState(defaultCountry);
|
|
12477
|
+
const [abierto, setAbierto] = useState(false);
|
|
12478
|
+
const [busqueda, setBusqueda] = useState("");
|
|
12479
|
+
const { country, digits } = splitPhone(value, countries, value ? defaultCountry : paisElegido);
|
|
12480
|
+
const pais = value ? country : countries.find((c) => c.code === paisElegido) ?? country;
|
|
12481
|
+
const tope = pais.digits ?? 15;
|
|
12482
|
+
const bloqueado = disabled || readOnly;
|
|
12483
|
+
useEffect(() => {
|
|
12484
|
+
if (!abierto) setBusqueda("");
|
|
12485
|
+
}, [abierto]);
|
|
12486
|
+
const visibles = useMemo(() => {
|
|
12487
|
+
const q = sinTildes$1(busqueda.trim());
|
|
12488
|
+
if (!q) return countries;
|
|
12489
|
+
return countries.filter(
|
|
12490
|
+
(c) => sinTildes$1(c.name).includes(q) || c.dialCode.includes(q) || c.code.toLowerCase() === q
|
|
12491
|
+
);
|
|
12492
|
+
}, [busqueda, countries]);
|
|
12493
|
+
const emitir = (c, d) => {
|
|
12494
|
+
onChange?.(d ? `${c.dialCode}${d}` : "");
|
|
12495
|
+
};
|
|
12496
|
+
const handleDigits = (e) => {
|
|
12497
|
+
const d = e.target.value.replace(/\D/g, "").slice(0, tope);
|
|
12498
|
+
emitir(pais, d);
|
|
12499
|
+
};
|
|
12500
|
+
const elegir = (c) => {
|
|
12501
|
+
setPaisElegido(c.code);
|
|
12502
|
+
emitir(c, digits.slice(0, c.digits ?? 15));
|
|
12503
|
+
setAbierto(false);
|
|
12504
|
+
};
|
|
12505
|
+
const tituloId = `${id ?? name ?? "phone"}-pais-titulo`;
|
|
12506
|
+
return /* @__PURE__ */ jsxs("div", { className: [CLASS$i, error && `${CLASS$i}--error`, bloqueado && `${CLASS$i}--disabled`, className].filter(Boolean).join(" "), children: [
|
|
12507
|
+
/* @__PURE__ */ jsxs(
|
|
12508
|
+
"button",
|
|
12509
|
+
{
|
|
12510
|
+
type: "button",
|
|
12511
|
+
className: `${CLASS$i}__country`,
|
|
12512
|
+
"aria-label": `${labels?.pickCountry ?? "Pa\xEDs del celular"}: ${pais.name} ${pais.dialCode}`,
|
|
12513
|
+
"aria-haspopup": "dialog",
|
|
12514
|
+
"aria-expanded": abierto,
|
|
12515
|
+
disabled: bloqueado,
|
|
12516
|
+
onClick: () => setAbierto(true),
|
|
12517
|
+
children: [
|
|
12518
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$i}__flag`, "aria-hidden": "true", children: flagOf(pais.code) }),
|
|
12519
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$i}__code`, children: pais.dialCode }),
|
|
12520
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$i}__caret`, "aria-hidden": "true", children: "\u25BE" })
|
|
12521
|
+
]
|
|
12522
|
+
}
|
|
12523
|
+
),
|
|
12524
|
+
/* @__PURE__ */ jsx("div", { className: `${CLASS$i}__digits`, children: /* @__PURE__ */ jsx(
|
|
12525
|
+
Input$1,
|
|
12526
|
+
{
|
|
12527
|
+
ref,
|
|
12528
|
+
id,
|
|
12529
|
+
name,
|
|
12530
|
+
type: "tel",
|
|
12531
|
+
inputMode: "numeric",
|
|
12532
|
+
autoComplete: "tel-national",
|
|
12533
|
+
label,
|
|
12534
|
+
placeholder,
|
|
12535
|
+
value: digits,
|
|
12536
|
+
onChange: handleDigits,
|
|
12537
|
+
onBlur,
|
|
12538
|
+
disabled,
|
|
12539
|
+
readOnly,
|
|
12540
|
+
error
|
|
12541
|
+
}
|
|
12542
|
+
) }),
|
|
12543
|
+
/* @__PURE__ */ jsxs(
|
|
12544
|
+
BottomSheet,
|
|
12545
|
+
{
|
|
12546
|
+
open: abierto,
|
|
12547
|
+
onClose: () => setAbierto(false),
|
|
12548
|
+
showGrabber: true,
|
|
12549
|
+
closeOnBackdrop: true,
|
|
12550
|
+
ariaLabelledBy: tituloId,
|
|
12551
|
+
className: `${CLASS$i}__sheet`,
|
|
12552
|
+
children: [
|
|
12553
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$i}__sheet-head`, children: [
|
|
12554
|
+
/* @__PURE__ */ jsx("h2", { id: tituloId, className: `${CLASS$i}__sheet-title`, children: labels?.pickCountry ?? "Pa\xEDs del celular" }),
|
|
12555
|
+
/* @__PURE__ */ jsx(
|
|
12556
|
+
"input",
|
|
12557
|
+
{
|
|
12558
|
+
className: `${CLASS$i}__search`,
|
|
12559
|
+
type: "search",
|
|
12560
|
+
value: busqueda,
|
|
12561
|
+
onChange: (e) => setBusqueda(e.target.value),
|
|
12562
|
+
placeholder: labels?.searchPlaceholder ?? "Buscar pa\xEDs o indicativo",
|
|
12563
|
+
autoComplete: "off",
|
|
12564
|
+
"aria-label": labels?.searchPlaceholder ?? "Buscar pa\xEDs o indicativo"
|
|
12565
|
+
}
|
|
12566
|
+
)
|
|
12567
|
+
] }),
|
|
12568
|
+
/* @__PURE__ */ jsxs("ul", { className: `${CLASS$i}__list`, role: "listbox", "aria-labelledby": tituloId, children: [
|
|
12569
|
+
visibles.map((c) => {
|
|
12570
|
+
const activo = c.code === pais.code;
|
|
12571
|
+
return /* @__PURE__ */ jsx("li", { role: "option", "aria-selected": activo, children: /* @__PURE__ */ jsxs(
|
|
12572
|
+
"button",
|
|
12573
|
+
{
|
|
12574
|
+
type: "button",
|
|
12575
|
+
className: [`${CLASS$i}__option`, activo && `${CLASS$i}__option--selected`].filter(Boolean).join(" "),
|
|
12576
|
+
onClick: () => elegir(c),
|
|
12577
|
+
children: [
|
|
12578
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$i}__flag`, "aria-hidden": "true", children: flagOf(c.code) }),
|
|
12579
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$i}__option-name`, children: c.name }),
|
|
12580
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$i}__option-code`, children: c.dialCode })
|
|
12581
|
+
]
|
|
12582
|
+
}
|
|
12583
|
+
) }, c.code);
|
|
12584
|
+
}),
|
|
12585
|
+
visibles.length === 0 && /* @__PURE__ */ jsx("li", { className: `${CLASS$i}__empty`, children: labels?.noResults ?? "Ning\xFAn pa\xEDs coincide." })
|
|
12586
|
+
] })
|
|
12587
|
+
]
|
|
12588
|
+
}
|
|
12589
|
+
)
|
|
12590
|
+
] });
|
|
12591
|
+
}
|
|
12592
|
+
);
|
|
12593
|
+
PhoneInput.displayName = "PhoneInput";
|
|
12594
|
+
|
|
12595
|
+
const CLASS$h = "px-lumi-sheet-select";
|
|
12596
|
+
function sinTildes(s) {
|
|
12597
|
+
return s.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase();
|
|
12598
|
+
}
|
|
12599
|
+
const SheetSelect = React.forwardRef(
|
|
12600
|
+
({
|
|
12601
|
+
value,
|
|
12602
|
+
onChange,
|
|
12603
|
+
onBlur,
|
|
12604
|
+
options,
|
|
12605
|
+
label,
|
|
12606
|
+
placeholder,
|
|
12607
|
+
disabled,
|
|
12608
|
+
readOnly,
|
|
12609
|
+
error,
|
|
12610
|
+
searchable,
|
|
12611
|
+
notFoundContent,
|
|
12612
|
+
sheetTitle,
|
|
12613
|
+
searchPlaceholder,
|
|
12614
|
+
name,
|
|
12615
|
+
id,
|
|
12616
|
+
className
|
|
12617
|
+
}, ref) => {
|
|
12618
|
+
const [abierto, setAbierto] = useState(false);
|
|
12619
|
+
const [busqueda, setBusqueda] = useState("");
|
|
12620
|
+
const bloqueado = disabled || readOnly;
|
|
12621
|
+
const elegida = options.find((o) => String(o.value) === String(value ?? ""));
|
|
12622
|
+
const conBuscador = searchable ?? true;
|
|
12623
|
+
useEffect(() => {
|
|
12624
|
+
if (!abierto) setBusqueda("");
|
|
12625
|
+
}, [abierto]);
|
|
12626
|
+
const visibles = useMemo(() => {
|
|
12627
|
+
const q = sinTildes(busqueda.trim());
|
|
12628
|
+
if (!q) return options;
|
|
12629
|
+
return options.filter((o) => sinTildes(o.label).includes(q) || sinTildes(o.hint ?? "").includes(q));
|
|
12630
|
+
}, [busqueda, options]);
|
|
12631
|
+
const abrir = () => {
|
|
12632
|
+
if (!bloqueado) setAbierto(true);
|
|
12633
|
+
};
|
|
12634
|
+
const elegir = (o) => {
|
|
12635
|
+
onChange?.(o.value);
|
|
12636
|
+
setAbierto(false);
|
|
12637
|
+
onBlur?.();
|
|
12638
|
+
};
|
|
12639
|
+
const tituloId = `${id ?? name ?? "sheet-select"}-titulo`;
|
|
12640
|
+
const titulo = sheetTitle ?? label?.replace(/\s\*$/, "") ?? "";
|
|
12641
|
+
return /* @__PURE__ */ jsxs("div", { className: [CLASS$h, bloqueado && `${CLASS$h}--disabled`, className].filter(Boolean).join(" "), children: [
|
|
12642
|
+
/* @__PURE__ */ jsx(
|
|
12643
|
+
Input$1,
|
|
12644
|
+
{
|
|
12645
|
+
ref,
|
|
12646
|
+
id,
|
|
12647
|
+
name,
|
|
12648
|
+
label,
|
|
12649
|
+
placeholder: placeholder ?? "Seleccionar...",
|
|
12650
|
+
value: elegida?.label ?? "",
|
|
12651
|
+
readOnly: true,
|
|
12652
|
+
disabled,
|
|
12653
|
+
error,
|
|
12654
|
+
onClick: abrir,
|
|
12655
|
+
onKeyDown: (e) => {
|
|
12656
|
+
if (e.key === "Enter" || e.key === " " || e.key === "ArrowDown") {
|
|
12657
|
+
e.preventDefault();
|
|
12658
|
+
abrir();
|
|
12659
|
+
}
|
|
12660
|
+
},
|
|
12661
|
+
role: "combobox",
|
|
12662
|
+
"aria-haspopup": "dialog",
|
|
12663
|
+
"aria-expanded": abierto,
|
|
12664
|
+
className: `${CLASS$h}__field`,
|
|
12665
|
+
suffix: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M6 9l6 6 6-6" }) }),
|
|
12666
|
+
onSuffixClick: abrir,
|
|
12667
|
+
suffixAriaLabel: titulo ? `Elegir ${titulo}` : "Elegir"
|
|
12668
|
+
}
|
|
12669
|
+
),
|
|
12670
|
+
/* @__PURE__ */ jsxs(
|
|
12671
|
+
BottomSheet,
|
|
12672
|
+
{
|
|
12673
|
+
open: abierto,
|
|
12674
|
+
onClose: () => setAbierto(false),
|
|
12675
|
+
showGrabber: true,
|
|
12676
|
+
closeOnBackdrop: true,
|
|
12677
|
+
ariaLabelledBy: tituloId,
|
|
12678
|
+
className: `${CLASS$h}__sheet`,
|
|
12679
|
+
children: [
|
|
12680
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$h}__sheet-head`, children: [
|
|
12681
|
+
/* @__PURE__ */ jsx("h2", { id: tituloId, className: `${CLASS$h}__sheet-title`, children: titulo }),
|
|
12682
|
+
conBuscador && /* @__PURE__ */ jsx(
|
|
12683
|
+
"input",
|
|
12684
|
+
{
|
|
12685
|
+
className: `${CLASS$h}__search`,
|
|
12686
|
+
type: "search",
|
|
12687
|
+
value: busqueda,
|
|
12688
|
+
onChange: (e) => setBusqueda(e.target.value),
|
|
12689
|
+
placeholder: searchPlaceholder ?? "Buscar",
|
|
12690
|
+
autoComplete: "off",
|
|
12691
|
+
"aria-label": searchPlaceholder ?? "Buscar"
|
|
12692
|
+
}
|
|
12693
|
+
)
|
|
12694
|
+
] }),
|
|
12695
|
+
/* @__PURE__ */ jsxs("ul", { className: `${CLASS$h}__list`, role: "listbox", "aria-labelledby": tituloId, children: [
|
|
12696
|
+
visibles.map((o) => {
|
|
12697
|
+
const activo = elegida?.value === o.value;
|
|
12698
|
+
return /* @__PURE__ */ jsx("li", { role: "option", "aria-selected": activo, children: /* @__PURE__ */ jsxs(
|
|
12699
|
+
"button",
|
|
12700
|
+
{
|
|
12701
|
+
type: "button",
|
|
12702
|
+
className: [`${CLASS$h}__option`, activo && `${CLASS$h}__option--selected`].filter(Boolean).join(" "),
|
|
12703
|
+
onClick: () => elegir(o),
|
|
12704
|
+
children: [
|
|
12705
|
+
/* @__PURE__ */ jsxs("span", { className: `${CLASS$h}__option-text`, children: [
|
|
12706
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$h}__option-label`, children: o.label }),
|
|
12707
|
+
o.hint && /* @__PURE__ */ jsx("span", { className: `${CLASS$h}__option-hint`, children: o.hint })
|
|
12708
|
+
] }),
|
|
12709
|
+
activo && /* @__PURE__ */ jsx("svg", { className: `${CLASS$h}__check`, width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M20 6L9 17l-5-5" }) })
|
|
12710
|
+
]
|
|
12711
|
+
}
|
|
12712
|
+
) }, o.value);
|
|
12713
|
+
}),
|
|
12714
|
+
visibles.length === 0 && /* @__PURE__ */ jsx("li", { className: `${CLASS$h}__empty`, children: options.length === 0 ? notFoundContent ?? "No hay opciones disponibles." : "Nada coincide." })
|
|
12715
|
+
] })
|
|
12716
|
+
]
|
|
12717
|
+
}
|
|
12718
|
+
)
|
|
12719
|
+
] });
|
|
12720
|
+
}
|
|
12721
|
+
);
|
|
12722
|
+
SheetSelect.displayName = "SheetSelect";
|
|
12723
|
+
|
|
12724
|
+
const SANITIZE_PRESETS = {
|
|
12725
|
+
/** «abc-123 » → «ABC123». */
|
|
12726
|
+
plate: ["noControl", "alnum", "upper", { maxLength: 8 }],
|
|
12727
|
+
/** «+57 (300) 123-4567» → «573001234567». */
|
|
12728
|
+
phone: ["digits", { maxLength: 15 }],
|
|
12729
|
+
/** «1.000.000» → «1000000». */
|
|
12730
|
+
id: ["digits", { maxLength: 15 }],
|
|
12731
|
+
/** Un nombre: sin control, espacios colapsados, recortado al enviar. */
|
|
12732
|
+
name: ["noControl", "collapseSpaces", { maxLength: 150 }, "trim"],
|
|
12733
|
+
/** Una nota corta. */
|
|
12734
|
+
note: ["noControl", "collapseSpaces", { maxLength: 80 }, "trim"]
|
|
12735
|
+
};
|
|
12736
|
+
const CONTROL = /[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;
|
|
12737
|
+
function expandir(spec) {
|
|
12738
|
+
const lista = Array.isArray(spec) ? spec : [spec];
|
|
12739
|
+
return lista.flatMap((r) => typeof r === "object" && "preset" in r ? SANITIZE_PRESETS[r.preset] ?? [] : [r]);
|
|
12740
|
+
}
|
|
12741
|
+
function aplicar(s, r, live) {
|
|
12742
|
+
if (r === "trim") return live ? s : s.trim();
|
|
12743
|
+
if (r === "upper") return s.toUpperCase();
|
|
12744
|
+
if (r === "lower") return s.toLowerCase();
|
|
12745
|
+
if (r === "digits") return s.replace(/[^0-9]/g, "");
|
|
12746
|
+
if (r === "alnum") return s.replace(/[^A-Za-z0-9]/g, "");
|
|
12747
|
+
if (r === "noControl") return s.replace(CONTROL, "");
|
|
12748
|
+
if (r === "collapseSpaces") return s.replace(/\s{2,}/g, " ");
|
|
12749
|
+
if ("maxLength" in r) return s.slice(0, r.maxLength);
|
|
12750
|
+
if ("strip" in r) return s.replace(new RegExp(r.strip, "g"), "");
|
|
12751
|
+
return s;
|
|
12752
|
+
}
|
|
12753
|
+
function sanitize(value, spec, options = {}) {
|
|
12754
|
+
if (!spec || value === null || value === void 0) return value;
|
|
12755
|
+
if (typeof value !== "string") return value;
|
|
12756
|
+
return expandir(spec).reduce((s, r) => aplicar(s, r, !!options.live), value);
|
|
12757
|
+
}
|
|
12758
|
+
|
|
12322
12759
|
const renderField = ({
|
|
12323
12760
|
field,
|
|
12324
12761
|
control,
|
|
@@ -12406,10 +12843,14 @@ const renderField = ({
|
|
|
12406
12843
|
}, children: formatValue() })
|
|
12407
12844
|
] });
|
|
12408
12845
|
}
|
|
12846
|
+
const onChangeLimpio = field.sanitize ? (e) => {
|
|
12847
|
+
const crudo = e && typeof e === "object" && "target" in e ? e.target.value : e;
|
|
12848
|
+
onChange(sanitize(crudo, field.sanitize, { live: true }));
|
|
12849
|
+
} : onChange;
|
|
12409
12850
|
const commonProps = {
|
|
12410
12851
|
...getCommonProps(),
|
|
12411
12852
|
value: value ?? "",
|
|
12412
|
-
onChange,
|
|
12853
|
+
onChange: onChangeLimpio,
|
|
12413
12854
|
onBlur,
|
|
12414
12855
|
ref,
|
|
12415
12856
|
error: error?.message
|
|
@@ -12434,8 +12875,26 @@ const renderField = ({
|
|
|
12434
12875
|
return /* @__PURE__ */ jsx(Input$1, { ...commonProps, type: "email" });
|
|
12435
12876
|
case "INPUT_PASSWORD":
|
|
12436
12877
|
return /* @__PURE__ */ jsx(Input$1, { ...commonProps, type: "password" });
|
|
12437
|
-
case "INPUT_PHONE":
|
|
12438
|
-
|
|
12878
|
+
case "INPUT_PHONE": {
|
|
12879
|
+
const { countries, defaultCountry } = uiProps ?? {};
|
|
12880
|
+
return /* @__PURE__ */ jsx(
|
|
12881
|
+
PhoneInput,
|
|
12882
|
+
{
|
|
12883
|
+
ref,
|
|
12884
|
+
name,
|
|
12885
|
+
label: fieldLabel,
|
|
12886
|
+
placeholder,
|
|
12887
|
+
disabled: isReadOnly,
|
|
12888
|
+
readOnly: isReadOnly,
|
|
12889
|
+
error: error?.message,
|
|
12890
|
+
value: typeof value === "string" ? value : "",
|
|
12891
|
+
onChange: (v) => onChange(v),
|
|
12892
|
+
onBlur,
|
|
12893
|
+
countries,
|
|
12894
|
+
defaultCountry
|
|
12895
|
+
}
|
|
12896
|
+
);
|
|
12897
|
+
}
|
|
12439
12898
|
case "INPUT_CURRENCY":
|
|
12440
12899
|
return /* @__PURE__ */ jsx(
|
|
12441
12900
|
Input$1,
|
|
@@ -12461,6 +12920,30 @@ const renderField = ({
|
|
|
12461
12920
|
case "TEXTAREA":
|
|
12462
12921
|
return /* @__PURE__ */ jsx(Input$1, { ...commonProps, type: "textarea" });
|
|
12463
12922
|
case "SELECT":
|
|
12923
|
+
if (uiProps?.picker === "sheet") {
|
|
12924
|
+
return /* @__PURE__ */ jsx(
|
|
12925
|
+
SheetSelect,
|
|
12926
|
+
{
|
|
12927
|
+
ref,
|
|
12928
|
+
name,
|
|
12929
|
+
label: fieldLabel,
|
|
12930
|
+
placeholder,
|
|
12931
|
+
disabled: isReadOnly,
|
|
12932
|
+
readOnly: isReadOnly,
|
|
12933
|
+
error: error?.message,
|
|
12934
|
+
value: value == null ? "" : String(value),
|
|
12935
|
+
onChange: (v) => onChange(v),
|
|
12936
|
+
onBlur,
|
|
12937
|
+
options: (options || []).map((o) => ({
|
|
12938
|
+
value: String(o.value),
|
|
12939
|
+
label: String(o.label),
|
|
12940
|
+
hint: o.hint
|
|
12941
|
+
})),
|
|
12942
|
+
searchable: uiProps?.showSearch,
|
|
12943
|
+
notFoundContent: uiProps?.notFoundContent
|
|
12944
|
+
}
|
|
12945
|
+
);
|
|
12946
|
+
}
|
|
12464
12947
|
return /* @__PURE__ */ jsx(
|
|
12465
12948
|
Select$1,
|
|
12466
12949
|
{
|
|
@@ -12590,8 +13073,11 @@ const transformIncomingValues = (values, fields) => {
|
|
|
12590
13073
|
const transformOutgoingValues = (values, fields) => {
|
|
12591
13074
|
const transformed = { ...values };
|
|
12592
13075
|
fields.forEach((field) => {
|
|
13076
|
+
if (field.sanitize && values[field.name] !== void 0) {
|
|
13077
|
+
transformed[field.name] = sanitize(values[field.name], field.sanitize);
|
|
13078
|
+
}
|
|
12593
13079
|
if (field.transformOnSubmit && values[field.name] !== void 0) {
|
|
12594
|
-
transformed[field.name] = field.transformOnSubmit(
|
|
13080
|
+
transformed[field.name] = field.transformOnSubmit(transformed[field.name]);
|
|
12595
13081
|
}
|
|
12596
13082
|
});
|
|
12597
13083
|
return transformed;
|
|
@@ -13180,24 +13666,28 @@ function mapFieldsToFormFields(fields, mode) {
|
|
|
13180
13666
|
placeholder: field.placeholder,
|
|
13181
13667
|
uiProps: field.uiProps,
|
|
13182
13668
|
transformOnSubmit: field.parseValue,
|
|
13183
|
-
gridSpan: field.gridSpan
|
|
13669
|
+
gridSpan: field.gridSpan,
|
|
13184
13670
|
// SPEC-131 T7
|
|
13671
|
+
showIf: field.showIf,
|
|
13672
|
+
// SPEC-181
|
|
13673
|
+
sanitize: field.sanitize
|
|
13674
|
+
// SPEC-183
|
|
13185
13675
|
}));
|
|
13186
13676
|
}
|
|
13187
13677
|
|
|
13188
|
-
const CLASS$
|
|
13678
|
+
const CLASS$g = `${COMPONENT_PREFIX}field-value`;
|
|
13189
13679
|
const FieldValue = ({
|
|
13190
13680
|
label,
|
|
13191
13681
|
children,
|
|
13192
13682
|
layout = "inline",
|
|
13193
13683
|
className
|
|
13194
|
-
}) => /* @__PURE__ */ jsxs("div", { className: [CLASS$
|
|
13195
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
13196
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
13684
|
+
}) => /* @__PURE__ */ jsxs("div", { className: [CLASS$g, `${CLASS$g}--${layout}`, className].filter(Boolean).join(" "), children: [
|
|
13685
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$g}__label`, children: label }),
|
|
13686
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$g}__value`, children })
|
|
13197
13687
|
] });
|
|
13198
13688
|
FieldValue.displayName = "FieldValue";
|
|
13199
13689
|
|
|
13200
|
-
const CLASS$
|
|
13690
|
+
const CLASS$f = `${COMPONENT_PREFIX}record-card`;
|
|
13201
13691
|
const RecordCard = ({
|
|
13202
13692
|
title,
|
|
13203
13693
|
summary,
|
|
@@ -13209,20 +13699,20 @@ const RecordCard = ({
|
|
|
13209
13699
|
className
|
|
13210
13700
|
}) => {
|
|
13211
13701
|
const cuerpoId = useId();
|
|
13212
|
-
return /* @__PURE__ */ jsxs("div", { className: [CLASS$
|
|
13702
|
+
return /* @__PURE__ */ jsxs("div", { className: [CLASS$f, open ? `${CLASS$f}--open` : "", className].filter(Boolean).join(" "), children: [
|
|
13213
13703
|
/* @__PURE__ */ jsxs(
|
|
13214
13704
|
"button",
|
|
13215
13705
|
{
|
|
13216
13706
|
type: "button",
|
|
13217
|
-
className: `${CLASS$
|
|
13707
|
+
className: `${CLASS$f}__header`,
|
|
13218
13708
|
"aria-expanded": open,
|
|
13219
13709
|
"aria-controls": cuerpoId,
|
|
13220
13710
|
"aria-label": ariaLabel,
|
|
13221
13711
|
onClick: onToggle,
|
|
13222
13712
|
children: [
|
|
13223
|
-
/* @__PURE__ */ jsxs("span", { className: `${CLASS$
|
|
13224
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
13225
|
-
summary && /* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
13713
|
+
/* @__PURE__ */ jsxs("span", { className: `${CLASS$f}__heading`, children: [
|
|
13714
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$f}__title`, children: title }),
|
|
13715
|
+
summary && /* @__PURE__ */ jsx("span", { className: `${CLASS$f}__summary`, children: summary })
|
|
13226
13716
|
] }),
|
|
13227
13717
|
/* @__PURE__ */ jsx(
|
|
13228
13718
|
Icon,
|
|
@@ -13230,22 +13720,22 @@ const RecordCard = ({
|
|
|
13230
13720
|
type: open ? "chevron-up" : "chevron-down",
|
|
13231
13721
|
width: 18,
|
|
13232
13722
|
height: 18,
|
|
13233
|
-
className: `${CLASS$
|
|
13723
|
+
className: `${CLASS$f}__chevron`,
|
|
13234
13724
|
"aria-hidden": true
|
|
13235
13725
|
}
|
|
13236
13726
|
)
|
|
13237
13727
|
]
|
|
13238
13728
|
}
|
|
13239
13729
|
),
|
|
13240
|
-
open && /* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
13730
|
+
open && /* @__PURE__ */ jsxs("div", { className: `${CLASS$f}__body`, id: cuerpoId, children: [
|
|
13241
13731
|
children,
|
|
13242
|
-
actions && /* @__PURE__ */ jsx("div", { className: `${CLASS$
|
|
13732
|
+
actions && /* @__PURE__ */ jsx("div", { className: `${CLASS$f}__actions`, children: actions })
|
|
13243
13733
|
] })
|
|
13244
13734
|
] });
|
|
13245
13735
|
};
|
|
13246
13736
|
RecordCard.displayName = "RecordCard";
|
|
13247
13737
|
|
|
13248
|
-
const CLASS$
|
|
13738
|
+
const CLASS$e = `${COMPONENT_PREFIX}crud-cards`;
|
|
13249
13739
|
function summaryFields(fields) {
|
|
13250
13740
|
const visibles = fields.filter((f) => f.showInTable !== false);
|
|
13251
13741
|
const marcados = visibles.filter((f) => f.summary);
|
|
@@ -13264,13 +13754,13 @@ function CardList({
|
|
|
13264
13754
|
const claveResumen = new Set(resumen.map((f) => f.key));
|
|
13265
13755
|
const cuerpo = fields.filter((f) => f.showInTable !== false && !claveResumen.has(f.key));
|
|
13266
13756
|
if (loading && rows.length === 0) {
|
|
13267
|
-
return /* @__PURE__ */ jsx("div", { className: `${CLASS$
|
|
13757
|
+
return /* @__PURE__ */ jsx("div", { className: `${CLASS$e}__estado`, children: "Cargando..." });
|
|
13268
13758
|
}
|
|
13269
13759
|
if (rows.length === 0) {
|
|
13270
|
-
return /* @__PURE__ */ jsx("div", { className: `${CLASS$
|
|
13760
|
+
return /* @__PURE__ */ jsx("div", { className: `${CLASS$e}__estado`, children: emptyText });
|
|
13271
13761
|
}
|
|
13272
13762
|
const [principal, ...secundarios] = resumen;
|
|
13273
|
-
return /* @__PURE__ */ jsx("div", { className: CLASS$
|
|
13763
|
+
return /* @__PURE__ */ jsx("div", { className: CLASS$e, children: rows.map((row) => {
|
|
13274
13764
|
const key = rowKey(row);
|
|
13275
13765
|
const opciones = buildOptions?.(row) ?? [];
|
|
13276
13766
|
const titulo = principal ? renderFieldValue(principal, row) : key;
|
|
@@ -13287,14 +13777,14 @@ function CardList({
|
|
|
13287
13777
|
{
|
|
13288
13778
|
type: "button",
|
|
13289
13779
|
className: [
|
|
13290
|
-
`${CLASS$
|
|
13780
|
+
`${CLASS$e}__accion`,
|
|
13291
13781
|
o.disabled && o.disabledReason ? "is-con-motivo" : ""
|
|
13292
13782
|
].filter(Boolean).join(" "),
|
|
13293
13783
|
disabled: o.disabled,
|
|
13294
13784
|
onClick: () => void o.onClick(),
|
|
13295
13785
|
children: [
|
|
13296
13786
|
/* @__PURE__ */ jsx("span", { children: o.label }),
|
|
13297
|
-
o.disabled && o.disabledReason && /* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
13787
|
+
o.disabled && o.disabledReason && /* @__PURE__ */ jsx("span", { className: `${CLASS$e}__motivo`, children: o.disabledReason })
|
|
13298
13788
|
]
|
|
13299
13789
|
},
|
|
13300
13790
|
o.label
|
|
@@ -13309,7 +13799,7 @@ function CardList({
|
|
|
13309
13799
|
}
|
|
13310
13800
|
CardList.displayName = "CardList";
|
|
13311
13801
|
|
|
13312
|
-
const CLASS$
|
|
13802
|
+
const CLASS$d = `${COMPONENT_PREFIX}crud-scroll-end`;
|
|
13313
13803
|
const MARGEN = 24;
|
|
13314
13804
|
const SELECTOR_CRUD = `.${COMPONENT_PREFIX}table-container, .${COMPONENT_PREFIX}crud-cards`;
|
|
13315
13805
|
const ScrollToEnd = ({
|
|
@@ -13353,7 +13843,7 @@ const ScrollToEnd = ({
|
|
|
13353
13843
|
s.scrollTo({ top: s.scrollHeight, behavior: "smooth" });
|
|
13354
13844
|
}, []);
|
|
13355
13845
|
if (!visible) return null;
|
|
13356
|
-
return /* @__PURE__ */ jsx("button", { type: "button", className: CLASS$
|
|
13846
|
+
return /* @__PURE__ */ jsx("button", { type: "button", className: CLASS$d, onClick: alFinal, "aria-label": label, title: label, children: /* @__PURE__ */ jsx(Icon, { type: "chevron-down", width: 18, height: 18, "aria-hidden": true }) });
|
|
13357
13847
|
};
|
|
13358
13848
|
ScrollToEnd.displayName = "ScrollToEnd";
|
|
13359
13849
|
|
|
@@ -14038,7 +14528,7 @@ function Crud({
|
|
|
14038
14528
|
}
|
|
14039
14529
|
Crud.displayName = "Crud";
|
|
14040
14530
|
|
|
14041
|
-
const CLASS$
|
|
14531
|
+
const CLASS$c = "px-chat-reactive-crud__chat-link";
|
|
14042
14532
|
function Burbuja() {
|
|
14043
14533
|
return /* @__PURE__ */ jsx(
|
|
14044
14534
|
"svg",
|
|
@@ -14065,7 +14555,7 @@ const ChatLinkCell = ({
|
|
|
14065
14555
|
if (targets.length === 1) {
|
|
14066
14556
|
const t = targets[0];
|
|
14067
14557
|
const texto = t.label ? `Abrir chat ${t.label}` : "Abrir chat";
|
|
14068
|
-
return /* @__PURE__ */ jsx("button", { type: "button", className: CLASS$
|
|
14558
|
+
return /* @__PURE__ */ jsx("button", { type: "button", className: CLASS$c, "aria-label": texto, title: texto, onClick: () => abrir(t.id), children: /* @__PURE__ */ jsx(Burbuja, {}) });
|
|
14069
14559
|
}
|
|
14070
14560
|
return /* @__PURE__ */ jsx(
|
|
14071
14561
|
DropdownMenu,
|
|
@@ -14079,7 +14569,7 @@ const ChatLinkCell = ({
|
|
|
14079
14569
|
"button",
|
|
14080
14570
|
{
|
|
14081
14571
|
type: "button",
|
|
14082
|
-
className: CLASS$
|
|
14572
|
+
className: CLASS$c,
|
|
14083
14573
|
"aria-label": `Abrir chat (${targets.length} conversaciones)`,
|
|
14084
14574
|
title: "Abrir chat",
|
|
14085
14575
|
children: /* @__PURE__ */ jsx(Burbuja, {})
|
|
@@ -14092,6 +14582,18 @@ const ChatLinkCell = ({
|
|
|
14092
14582
|
};
|
|
14093
14583
|
ChatLinkCell.displayName = "ChatLinkCell";
|
|
14094
14584
|
|
|
14585
|
+
function obligatorioSiSeVe(s, f, requiredMsg) {
|
|
14586
|
+
if (!f.visibleWhen) return s.required(requiredMsg);
|
|
14587
|
+
const conds = Array.isArray(f.visibleWhen) ? f.visibleWhen : [f.visibleWhen];
|
|
14588
|
+
return s.when(
|
|
14589
|
+
conds.map((c) => c.field),
|
|
14590
|
+
{
|
|
14591
|
+
is: (...vals) => conds.every((c, i) => c.in.includes(String(vals[i]))),
|
|
14592
|
+
then: (sch) => sch.required(requiredMsg),
|
|
14593
|
+
otherwise: (sch) => sch.notRequired()
|
|
14594
|
+
}
|
|
14595
|
+
);
|
|
14596
|
+
}
|
|
14095
14597
|
function buildCrudYupSchema(fields) {
|
|
14096
14598
|
const shape = {};
|
|
14097
14599
|
for (const f of fields) {
|
|
@@ -14121,19 +14623,17 @@ function buildCrudYupSchema(fields) {
|
|
|
14121
14623
|
}
|
|
14122
14624
|
if (f.moleculeType === "INPUT_NUMBER" || f.moleculeType === "INPUT_CURRENCY") {
|
|
14123
14625
|
let s2 = yup.number().transform((val, orig) => orig === "" || orig === null ? void 0 : val).typeError(`${f.label}: n\xFAmero inv\xE1lido`);
|
|
14124
|
-
if (requiredMsg) s2 = s2.required(requiredMsg);
|
|
14125
14626
|
if (v?.min) s2 = s2.min(Number(v.min.value), v.min.message);
|
|
14126
14627
|
if (v?.max) s2 = s2.max(Number(v.max.value), v.max.message);
|
|
14127
|
-
shape[f.name] = s2;
|
|
14628
|
+
shape[f.name] = requiredMsg ? obligatorioSiSeVe(s2, f, requiredMsg) : s2;
|
|
14128
14629
|
continue;
|
|
14129
14630
|
}
|
|
14130
14631
|
let s = yup.string();
|
|
14131
|
-
if (
|
|
14132
|
-
if (v?.pattern) s = s.matches(new RegExp(v.pattern.value), v.pattern.message);
|
|
14632
|
+
if (v?.pattern) s = s.matches(new RegExp(v.pattern.value), { message: v.pattern.message, excludeEmptyString: true });
|
|
14133
14633
|
if (v?.email) s = s.email(v.email);
|
|
14134
14634
|
if (v?.min) s = s.min(Number(v.min.value), v.min.message);
|
|
14135
14635
|
if (v?.max) s = s.max(Number(v.max.value), v.max.message);
|
|
14136
|
-
shape[f.name] = s;
|
|
14636
|
+
shape[f.name] = requiredMsg ? obligatorioSiSeVe(s, f, requiredMsg) : s;
|
|
14137
14637
|
}
|
|
14138
14638
|
return yup.object().shape(shape);
|
|
14139
14639
|
}
|
|
@@ -14143,9 +14643,11 @@ const currency = (value) => {
|
|
|
14143
14643
|
if (isNaN(n)) return String(value ?? "");
|
|
14144
14644
|
return n.toLocaleString("es-CO", { style: "currency", currency: "COP", maximumFractionDigits: 0 });
|
|
14145
14645
|
};
|
|
14646
|
+
const SOLO_FECHA = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
14146
14647
|
const date = (value) => {
|
|
14147
14648
|
if (!value) return "";
|
|
14148
|
-
const
|
|
14649
|
+
const m = SOLO_FECHA.exec(String(value));
|
|
14650
|
+
const d = m ? new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3])) : new Date(String(value));
|
|
14149
14651
|
if (isNaN(d.getTime())) return String(value);
|
|
14150
14652
|
return d.toLocaleDateString("es-CO", { year: "numeric", month: "2-digit", day: "2-digit" });
|
|
14151
14653
|
};
|
|
@@ -14161,7 +14663,14 @@ const datetime = (value) => {
|
|
|
14161
14663
|
minute: "2-digit"
|
|
14162
14664
|
});
|
|
14163
14665
|
};
|
|
14164
|
-
const
|
|
14666
|
+
const phone = (value) => {
|
|
14667
|
+
const s = String(value ?? "").trim();
|
|
14668
|
+
const m = /^\+(\d{1,3})(\d{10})$/.exec(s);
|
|
14669
|
+
if (!m) return s;
|
|
14670
|
+
const [, cc, n] = m;
|
|
14671
|
+
return `+${cc} ${n.slice(0, 3)} ${n.slice(3, 6)} ${n.slice(6)}`;
|
|
14672
|
+
};
|
|
14673
|
+
const CRUD_FORMATTERS = { currency, date, datetime, phone };
|
|
14165
14674
|
function getFormatter(key) {
|
|
14166
14675
|
return key ? CRUD_FORMATTERS[key] : void 0;
|
|
14167
14676
|
}
|
|
@@ -14396,7 +14905,7 @@ function uploadViaEventBus(eventBus, file, fileType) {
|
|
|
14396
14905
|
});
|
|
14397
14906
|
}
|
|
14398
14907
|
|
|
14399
|
-
const CLASS$
|
|
14908
|
+
const CLASS$b = `${COMPONENT_PREFIX$1}file-field`;
|
|
14400
14909
|
function iconoPorNombre(nombre) {
|
|
14401
14910
|
const ext = nombre.split(".").pop()?.toLowerCase() ?? "";
|
|
14402
14911
|
if (["png", "jpg", "jpeg", "gif", "webp", "heic", "heif"].includes(ext)) return ICON_TYPES.IMAGE;
|
|
@@ -14427,18 +14936,18 @@ const FileField = ({
|
|
|
14427
14936
|
const elegir = () => {
|
|
14428
14937
|
if (!disabled) inputRef.current?.click();
|
|
14429
14938
|
};
|
|
14430
|
-
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
14431
|
-
/* @__PURE__ */ jsxs("span", { className: `${CLASS$
|
|
14939
|
+
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$b}${error ? ` ${CLASS$b}--error` : ""}`, children: [
|
|
14940
|
+
/* @__PURE__ */ jsxs("span", { className: `${CLASS$b}__label`, children: [
|
|
14432
14941
|
label,
|
|
14433
14942
|
required ? " *" : "",
|
|
14434
14943
|
multiple && hechos > 0 ? ` (${hechos})` : ""
|
|
14435
14944
|
] }),
|
|
14436
|
-
/* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
14945
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$b}__box`, children: [
|
|
14437
14946
|
/* @__PURE__ */ jsx(
|
|
14438
14947
|
"input",
|
|
14439
14948
|
{
|
|
14440
14949
|
ref: inputRef,
|
|
14441
|
-
className: `${CLASS$
|
|
14950
|
+
className: `${CLASS$b}__native`,
|
|
14442
14951
|
type: "file",
|
|
14443
14952
|
accept,
|
|
14444
14953
|
multiple,
|
|
@@ -14449,14 +14958,14 @@ const FileField = ({
|
|
|
14449
14958
|
}
|
|
14450
14959
|
}
|
|
14451
14960
|
),
|
|
14452
|
-
/* @__PURE__ */ jsxs("button", { type: "button", className: `${CLASS$
|
|
14961
|
+
/* @__PURE__ */ jsxs("button", { type: "button", className: `${CLASS$b}__pick`, onClick: elegir, disabled, children: [
|
|
14453
14962
|
/* @__PURE__ */ jsx(Icon$1, { type: ICON_TYPES.UPLOAD, size: "small" }),
|
|
14454
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
14963
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$b}__pick-text`, children: entries.length === 0 ? multiple ? "Toca para elegir archivos" : "Toca para elegir un archivo" : multiple ? "A\xF1adir m\xE1s" : "Cambiar archivo" })
|
|
14455
14964
|
] }),
|
|
14456
|
-
entries.length > 0 && /* @__PURE__ */ jsx("ul", { className: `${CLASS$
|
|
14457
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
14458
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
14459
|
-
/* @__PURE__ */ jsxs("span", { className: `${CLASS$
|
|
14965
|
+
entries.length > 0 && /* @__PURE__ */ jsx("ul", { className: `${CLASS$b}__list`, children: entries.map((e, i) => /* @__PURE__ */ jsxs("li", { className: `${CLASS$b}__item ${CLASS$b}__item--${e.status}`, children: [
|
|
14966
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$b}__kind`, "aria-hidden": "true", children: /* @__PURE__ */ jsx(Icon$1, { type: iconoPorNombre(e.name), size: "small" }) }),
|
|
14967
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$b}__name`, children: e.name }),
|
|
14968
|
+
/* @__PURE__ */ jsxs("span", { className: `${CLASS$b}__state`, children: [
|
|
14460
14969
|
e.status === "uploading" && "Subiendo\u2026",
|
|
14461
14970
|
e.status === "done" && (pesoLegible(e.size) || "Listo"),
|
|
14462
14971
|
e.status === "error" && "No se pudo subir"
|
|
@@ -14465,7 +14974,7 @@ const FileField = ({
|
|
|
14465
14974
|
"button",
|
|
14466
14975
|
{
|
|
14467
14976
|
type: "button",
|
|
14468
|
-
className: `${CLASS$
|
|
14977
|
+
className: `${CLASS$b}__remove`,
|
|
14469
14978
|
onClick: () => onRemove(i),
|
|
14470
14979
|
"aria-label": `Quitar ${e.name}`,
|
|
14471
14980
|
disabled,
|
|
@@ -14474,8 +14983,8 @@ const FileField = ({
|
|
|
14474
14983
|
)
|
|
14475
14984
|
] }, `${e.name}-${i}`)) })
|
|
14476
14985
|
] }),
|
|
14477
|
-
error && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
14478
|
-
!error && subiendo && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
14986
|
+
error && /* @__PURE__ */ jsx("p", { className: `${CLASS$b}__error`, children: error }),
|
|
14987
|
+
!error && subiendo && /* @__PURE__ */ jsx("p", { className: `${CLASS$b}__hint`, children: "Espera a que terminen de subir." })
|
|
14479
14988
|
] });
|
|
14480
14989
|
};
|
|
14481
14990
|
|
|
@@ -14635,7 +15144,13 @@ function ActionFormDrawer({ action, row, idField, eventBus, onExecute, onClose }
|
|
|
14635
15144
|
options: f.options ?? optionsByField[f.name],
|
|
14636
15145
|
// SPEC-106 T8 — `uiProps` llega tal cual a la molécula, así que el desplegable dice lo
|
|
14637
15146
|
// que pasó de verdad en vez del «no hay» de siempre. Sin error, se queda el de siempre.
|
|
14638
|
-
...optionsErrorByField[f.name]
|
|
15147
|
+
...optionsErrorByField[f.name] || f.searchable ? {
|
|
15148
|
+
uiProps: {
|
|
15149
|
+
...optionsErrorByField[f.name] ? { notFoundContent: optionsErrorByField[f.name] } : {},
|
|
15150
|
+
...f.searchable ? { showSearch: true } : {}
|
|
15151
|
+
// SPEC-174
|
|
15152
|
+
}
|
|
15153
|
+
} : {},
|
|
14639
15154
|
// SPEC-128 — el dinero se escribe como se escribe AQUÍ.
|
|
14640
15155
|
//
|
|
14641
15156
|
// Los campos de moneda caían a `thousandSeparator ?? ','`, un valor por defecto en formato
|
|
@@ -15631,7 +16146,7 @@ function buildMarkerIcon(name, color = "#dc2626", heading = 0) {
|
|
|
15631
16146
|
return `data:image/svg+xml;charset=UTF-8,${encodeURIComponent(svg)}`;
|
|
15632
16147
|
}
|
|
15633
16148
|
|
|
15634
|
-
const CLASS$
|
|
16149
|
+
const CLASS$a = `${COMPONENT_PREFIX$1}map-view`;
|
|
15635
16150
|
const DEFAULT_CENTER = { lat: 4.711, lng: -74.0721 };
|
|
15636
16151
|
const DEFAULT_ZOOM = 12;
|
|
15637
16152
|
const DEFAULT_HEIGHT$1 = 320;
|
|
@@ -15701,6 +16216,8 @@ const MapView = ({
|
|
|
15701
16216
|
eventBus,
|
|
15702
16217
|
expandable = true,
|
|
15703
16218
|
fullBleed = false,
|
|
16219
|
+
interactive = true,
|
|
16220
|
+
expandIcon = "expand",
|
|
15704
16221
|
animateMs,
|
|
15705
16222
|
className
|
|
15706
16223
|
}) => {
|
|
@@ -15756,7 +16273,12 @@ const MapView = ({
|
|
|
15756
16273
|
mapTypeControl: false,
|
|
15757
16274
|
streetViewControl: false,
|
|
15758
16275
|
fullscreenControl: false,
|
|
15759
|
-
styles: leerEstiloDelTema()
|
|
16276
|
+
styles: leerEstiloDelTema(),
|
|
16277
|
+
// SPEC-182 — un mapa solo para mirar no se queda con el gesto: `none` es la forma oficial
|
|
16278
|
+
// de Google de que el dedo y la rueda sigan desplazando la página. Se fija al crear el mapa
|
|
16279
|
+
// porque el modo no cambia en caliente: quien quiera el otro monta otra instancia (la de
|
|
16280
|
+
// pantalla completa lo es).
|
|
16281
|
+
...interactive ? {} : { gestureHandling: "none", zoomControl: false, keyboardShortcuts: false }
|
|
15760
16282
|
});
|
|
15761
16283
|
mapRef.current.addListener("dragstart", () => {
|
|
15762
16284
|
followSuspendedRef.current = true;
|
|
@@ -15774,7 +16296,7 @@ const MapView = ({
|
|
|
15774
16296
|
useEffect(() => {
|
|
15775
16297
|
if (!mapReady || !mapRef.current) return;
|
|
15776
16298
|
const maps = window.google.maps;
|
|
15777
|
-
const editable = !!onMoveRef.current;
|
|
16299
|
+
const editable = interactive && !!onMoveRef.current;
|
|
15778
16300
|
const alive = new Set(list.map((p) => p.id));
|
|
15779
16301
|
markersRef.current.forEach((entry, id) => {
|
|
15780
16302
|
if (alive.has(id)) return;
|
|
@@ -15846,7 +16368,7 @@ const MapView = ({
|
|
|
15846
16368
|
} else {
|
|
15847
16369
|
mapRef.current.fitBounds(bounds);
|
|
15848
16370
|
}
|
|
15849
|
-
}, [mapReady, list, animateMs]);
|
|
16371
|
+
}, [mapReady, list, animateMs, interactive]);
|
|
15850
16372
|
useEffect(() => {
|
|
15851
16373
|
if (!mapReady || !mapRef.current) return;
|
|
15852
16374
|
const maps = window.google.maps;
|
|
@@ -15896,7 +16418,7 @@ const MapView = ({
|
|
|
15896
16418
|
if (!mapReady || !mapRef.current) return;
|
|
15897
16419
|
clickListenerRef.current?.remove?.();
|
|
15898
16420
|
clickListenerRef.current = null;
|
|
15899
|
-
if (!onPointMove || list.length !== 1) return;
|
|
16421
|
+
if (!interactive || !onPointMove || list.length !== 1) return;
|
|
15900
16422
|
const pointId = list[0].id;
|
|
15901
16423
|
clickListenerRef.current = mapRef.current.addListener("click", (e) => {
|
|
15902
16424
|
onMoveRef.current?.(pointId, e.latLng.lat(), e.latLng.lng());
|
|
@@ -15905,7 +16427,7 @@ const MapView = ({
|
|
|
15905
16427
|
clickListenerRef.current?.remove?.();
|
|
15906
16428
|
clickListenerRef.current = null;
|
|
15907
16429
|
};
|
|
15908
|
-
}, [mapReady, list, onPointMove]);
|
|
16430
|
+
}, [mapReady, list, onPointMove, interactive]);
|
|
15909
16431
|
useEffect(
|
|
15910
16432
|
() => () => {
|
|
15911
16433
|
markersRef.current.forEach((entry) => {
|
|
@@ -15932,31 +16454,34 @@ const MapView = ({
|
|
|
15932
16454
|
document.body.style.overflow = prev;
|
|
15933
16455
|
};
|
|
15934
16456
|
}, [expanded]);
|
|
15935
|
-
const rootClass = [CLASS$
|
|
16457
|
+
const rootClass = [CLASS$a, fullBleed && `${CLASS$a}--full-bleed`, className].filter(Boolean).join(" ");
|
|
15936
16458
|
if (overQuota) {
|
|
15937
|
-
return /* @__PURE__ */ jsx("div", { className: rootClass, style: { height }, children: /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
16459
|
+
return /* @__PURE__ */ jsx("div", { className: rootClass, style: { height }, children: /* @__PURE__ */ jsx("p", { className: `${CLASS$a}__state ${CLASS$a}__state--error`, children: labels?.quotaText ?? "Se alcanz\xF3 el l\xEDmite diario de uso del mapa. Intenta ma\xF1ana." }) });
|
|
15938
16460
|
}
|
|
15939
16461
|
if (status === "error") {
|
|
15940
|
-
return /* @__PURE__ */ jsx("div", { className: rootClass, style: { height }, children: /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
16462
|
+
return /* @__PURE__ */ jsx("div", { className: rootClass, style: { height }, children: /* @__PURE__ */ jsx("p", { className: `${CLASS$a}__state ${CLASS$a}__state--error`, children: labels?.errorText ?? "No se pudo cargar el mapa." }) });
|
|
15941
16463
|
}
|
|
15942
16464
|
return /* @__PURE__ */ jsxs("div", { className: rootClass, style: fullBleed ? void 0 : { height }, children: [
|
|
15943
|
-
status !== "ready" && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
15944
|
-
/* @__PURE__ */ jsx("div", { ref: nodeRef, className: `${CLASS$
|
|
15945
|
-
status === "ready" && list.length === 0 && allRoutes.length === 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
15946
|
-
status === "ready" && onPointMove && list.length > 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
16465
|
+
status !== "ready" && /* @__PURE__ */ jsx("p", { className: `${CLASS$a}__state`, children: labels?.loadingText ?? "Cargando mapa\u2026" }),
|
|
16466
|
+
/* @__PURE__ */ jsx("div", { ref: nodeRef, className: `${CLASS$a}__canvas`, "aria-label": "Mapa", role: "application" }),
|
|
16467
|
+
status === "ready" && list.length === 0 && allRoutes.length === 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$a}__empty`, children: labels?.emptyText ?? "Sin ubicaciones para mostrar" }),
|
|
16468
|
+
status === "ready" && interactive && onPointMove && list.length > 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$a}__empty`, children: labels?.moveHint ?? "Arrastra el pin o toca el mapa para ajustar" }),
|
|
15947
16469
|
status === "ready" && expandable && !fullBleed && /* @__PURE__ */ jsx(
|
|
15948
16470
|
"button",
|
|
15949
16471
|
{
|
|
15950
16472
|
type: "button",
|
|
15951
|
-
className: `${CLASS$
|
|
15952
|
-
"aria-label": labels?.expandAria ?? "Ver el mapa en pantalla completa",
|
|
15953
|
-
title: labels?.expandAria ?? "Pantalla completa",
|
|
16473
|
+
className: `${CLASS$a}__expand`,
|
|
16474
|
+
"aria-label": labels?.expandAria ?? (expandIcon === "edit" ? "Ajustar el punto en el mapa" : "Ver el mapa en pantalla completa"),
|
|
16475
|
+
title: labels?.expandAria ?? (expandIcon === "edit" ? "Ajustar el punto" : "Pantalla completa"),
|
|
15954
16476
|
onClick: () => setExpanded(true),
|
|
15955
|
-
children: /* @__PURE__ */
|
|
16477
|
+
children: expandIcon === "edit" ? /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
16478
|
+
/* @__PURE__ */ jsx("path", { d: "M12 20h9" }),
|
|
16479
|
+
/* @__PURE__ */ jsx("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" })
|
|
16480
|
+
] }) : /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7" }) })
|
|
15956
16481
|
}
|
|
15957
16482
|
),
|
|
15958
16483
|
expanded && createPortal(
|
|
15959
|
-
/* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
16484
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$a}-fs`, role: "dialog", "aria-modal": "true", "aria-label": "Mapa", children: [
|
|
15960
16485
|
/* @__PURE__ */ jsx(
|
|
15961
16486
|
MapView,
|
|
15962
16487
|
{
|
|
@@ -15970,7 +16495,7 @@ const MapView = ({
|
|
|
15970
16495
|
"button",
|
|
15971
16496
|
{
|
|
15972
16497
|
type: "button",
|
|
15973
|
-
className: `${CLASS$
|
|
16498
|
+
className: `${CLASS$a}-fs__close`,
|
|
15974
16499
|
"aria-label": labels?.closeAria ?? "Cerrar el mapa",
|
|
15975
16500
|
onClick: () => setExpanded(false),
|
|
15976
16501
|
children: /* @__PURE__ */ jsxs("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
@@ -16086,7 +16611,7 @@ function reverseGeocode(lat, lng) {
|
|
|
16086
16611
|
});
|
|
16087
16612
|
}
|
|
16088
16613
|
|
|
16089
|
-
const CLASS$
|
|
16614
|
+
const CLASS$9 = `${COMPONENT_PREFIX$1}location-field`;
|
|
16090
16615
|
const GPS_TIMEOUT_MS = 1e4;
|
|
16091
16616
|
const CONFIRM_MAP_HEIGHT = 180;
|
|
16092
16617
|
const LocationField = ({
|
|
@@ -16159,16 +16684,16 @@ const LocationField = ({
|
|
|
16159
16684
|
}
|
|
16160
16685
|
};
|
|
16161
16686
|
const hasPoint = value?.lat != null && value?.lng != null;
|
|
16162
|
-
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
16163
|
-
label && /* @__PURE__ */ jsxs("span", { className: `${CLASS$
|
|
16687
|
+
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$9}${error ? ` ${CLASS$9}--error` : ""}`, ref: boxRef, children: [
|
|
16688
|
+
label && /* @__PURE__ */ jsxs("span", { className: `${CLASS$9}__label`, children: [
|
|
16164
16689
|
label,
|
|
16165
16690
|
required ? " *" : ""
|
|
16166
16691
|
] }),
|
|
16167
|
-
/* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
16692
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$9}__row`, children: [
|
|
16168
16693
|
/* @__PURE__ */ jsx(
|
|
16169
16694
|
"input",
|
|
16170
16695
|
{
|
|
16171
|
-
className: `${CLASS$
|
|
16696
|
+
className: `${CLASS$9}__input`,
|
|
16172
16697
|
type: "text",
|
|
16173
16698
|
value: text,
|
|
16174
16699
|
disabled,
|
|
@@ -16182,7 +16707,7 @@ const LocationField = ({
|
|
|
16182
16707
|
"button",
|
|
16183
16708
|
{
|
|
16184
16709
|
type: "button",
|
|
16185
|
-
className: `${CLASS$
|
|
16710
|
+
className: `${CLASS$9}__gps`,
|
|
16186
16711
|
onClick: useMyLocation,
|
|
16187
16712
|
disabled: disabled || gps === "locating",
|
|
16188
16713
|
title: labels?.useMyLocation ?? "Enviar mi ubicaci\xF3n",
|
|
@@ -16196,21 +16721,24 @@ const LocationField = ({
|
|
|
16196
16721
|
}
|
|
16197
16722
|
)
|
|
16198
16723
|
] }),
|
|
16199
|
-
open && suggestions.length > 0 && /* @__PURE__ */ jsx("ul", { className: `${CLASS$
|
|
16200
|
-
error && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
16201
|
-
gps === "denied" && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
16202
|
-
gps === "unavailable" && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
16203
|
-
hasPoint && /* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
16724
|
+
open && suggestions.length > 0 && /* @__PURE__ */ jsx("ul", { className: `${CLASS$9}__suggestions`, children: suggestions.map((s) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("button", { type: "button", onClick: () => void pickSuggestion(s.id, s.description), children: s.description }) }, s.id)) }),
|
|
16725
|
+
error && /* @__PURE__ */ jsx("p", { className: `${CLASS$9}__error`, children: error }),
|
|
16726
|
+
gps === "denied" && /* @__PURE__ */ jsx("p", { className: `${CLASS$9}__hint ${CLASS$9}__hint--warn`, children: labels?.permissionDenied ?? "No diste permiso de ubicaci\xF3n. Puedes escribir la direcci\xF3n." }),
|
|
16727
|
+
gps === "unavailable" && /* @__PURE__ */ jsx("p", { className: `${CLASS$9}__hint ${CLASS$9}__hint--warn`, children: labels?.unavailable ?? "No pudimos obtener tu ubicaci\xF3n. Puedes escribir la direcci\xF3n." }),
|
|
16728
|
+
hasPoint && /* @__PURE__ */ jsxs("div", { className: `${CLASS$9}__confirm`, children: [
|
|
16204
16729
|
/* @__PURE__ */ jsx(
|
|
16205
16730
|
MapView,
|
|
16206
16731
|
{
|
|
16207
16732
|
apiKey,
|
|
16208
16733
|
points: [{ id: "sel", lat: value.lat, lng: value.lng, label: value?.address }],
|
|
16209
16734
|
height: CONFIRM_MAP_HEIGHT,
|
|
16210
|
-
onPointMove: (id, lat, lng) => void movePoint(id, lat, lng)
|
|
16735
|
+
onPointMove: (id, lat, lng) => void movePoint(id, lat, lng),
|
|
16736
|
+
interactive: false,
|
|
16737
|
+
expandIcon: "edit",
|
|
16738
|
+
labels: { expandAria: labels?.editAria ?? "Ajustar el punto en el mapa" }
|
|
16211
16739
|
}
|
|
16212
16740
|
),
|
|
16213
|
-
/* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
16741
|
+
/* @__PURE__ */ jsx("p", { className: `${CLASS$9}__hint`, children: labels?.confirmHint ?? "El pin marca d\xF3nde est\xE1 el veh\xEDculo. Si no es el punto exacto, toca el l\xE1piz: en el mapa grande puedes arrastrar el pin o tocar el lugar correcto." })
|
|
16214
16742
|
] })
|
|
16215
16743
|
] });
|
|
16216
16744
|
};
|
|
@@ -16242,6 +16770,8 @@ function toRenderField(f, loaded, eventBus, mapsApiKey, loadError) {
|
|
|
16242
16770
|
// y, a media fila, su campo hermano se quedaba con ~400px de blanco al lado. Medido entre
|
|
16243
16771
|
// «¿En qué situación está?» y «¿A dónde lo llevamos?» del formulario de solicitud.
|
|
16244
16772
|
gridSpan: 2,
|
|
16773
|
+
showIf: showIfDe(f),
|
|
16774
|
+
// SPEC-181
|
|
16245
16775
|
uiProps: {
|
|
16246
16776
|
// SPEC-074 — `error` viene del render de CUSTOM (DynamicForm ya lo pasaba) y aquí se
|
|
16247
16777
|
// desechaba: el campo obligatorio más importante era el único mudo.
|
|
@@ -16274,14 +16804,22 @@ function toRenderField(f, loaded, eventBus, mapsApiKey, loadError) {
|
|
|
16274
16804
|
columnWidth: f.columnWidth,
|
|
16275
16805
|
fixed: f.fixed,
|
|
16276
16806
|
align: f.align,
|
|
16807
|
+
showIf: showIfDe(f),
|
|
16808
|
+
// SPEC-181
|
|
16809
|
+
sanitize: f.sanitize,
|
|
16810
|
+
// SPEC-183
|
|
16277
16811
|
// SPEC-106 T8 — con un fallo de carga, el desplegable dice que no se pudo preguntar en vez
|
|
16278
16812
|
// de «no hay opciones disponibles», que es una respuesta y no la tenemos.
|
|
16279
|
-
uiProps: loadError ? { options: options ?? [], notFoundContent: loadError } : options ? { options } : void 0,
|
|
16813
|
+
uiProps: loadError ? { options: options ?? [], notFoundContent: loadError, ...f.searchable ? { showSearch: true } : {}, ...f.picker ? { picker: f.picker } : {} } : options ? { options, ...f.searchable ? { showSearch: true } : {}, ...f.picker ? { picker: f.picker } : {} } : f.picker ? { picker: f.picker } : void 0,
|
|
16280
16814
|
formatValue
|
|
16281
16815
|
};
|
|
16282
16816
|
}
|
|
16283
16817
|
const cumpleCondicion = (c, row) => c.in.includes(String(row[c.field]));
|
|
16284
16818
|
const cumplenTodas = (c, row) => (Array.isArray(c) ? c : [c]).every((x) => cumpleCondicion(x, row));
|
|
16819
|
+
function showIfDe(f) {
|
|
16820
|
+
const cond = f.visibleWhen;
|
|
16821
|
+
return cond ? (values) => cumplenTodas(cond, values) : void 0;
|
|
16822
|
+
}
|
|
16285
16823
|
function matchesVisibleWhen(a, row) {
|
|
16286
16824
|
if (a.hiddenWhen && cumplenTodas(a.hiddenWhen, row)) return false;
|
|
16287
16825
|
if (!a.visibleWhen) return true;
|
|
@@ -16833,7 +17371,7 @@ function markFitOutliers(points, radiusKm = FIT_RADIUS_KM) {
|
|
|
16833
17371
|
return { points: marcados, outside };
|
|
16834
17372
|
}
|
|
16835
17373
|
|
|
16836
|
-
const CLASS$
|
|
17374
|
+
const CLASS$8 = `${COMPONENT_PREFIX$1}services-map`;
|
|
16837
17375
|
const DEFAULT_HEIGHT = 340;
|
|
16838
17376
|
function readNumber(row, field) {
|
|
16839
17377
|
if (!field) return void 0;
|
|
@@ -16959,7 +17497,7 @@ const ServicesMap = ({ config, eventBus, apiKey, filter, fill }) => {
|
|
|
16959
17497
|
[livePoints]
|
|
16960
17498
|
);
|
|
16961
17499
|
const nadaQueDibujar = rows !== null && allPoints.length === 0 && route.length === 0;
|
|
16962
|
-
return /* @__PURE__ */ jsx("div", { className: fill ? `${CLASS$
|
|
17500
|
+
return /* @__PURE__ */ jsx("div", { className: fill ? `${CLASS$8} ${CLASS$8}--fill` : CLASS$8, children: rows === null ? /* @__PURE__ */ jsx("p", { className: `${CLASS$8}__state`, children: labels.loadingText ?? "Cargando ubicaciones\u2026" }) : nadaQueDibujar ? /* @__PURE__ */ jsx("p", { className: `${CLASS$8}__state`, children: lineaSinMapa(labels, missing, failed) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16963
17501
|
/* @__PURE__ */ jsx(
|
|
16964
17502
|
MapView,
|
|
16965
17503
|
{
|
|
@@ -16973,20 +17511,20 @@ const ServicesMap = ({ config, eventBus, apiKey, filter, fill }) => {
|
|
|
16973
17511
|
labels: { emptyText: labels.emptyText }
|
|
16974
17512
|
}
|
|
16975
17513
|
),
|
|
16976
|
-
/* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
16977
|
-
livePoints.length > 0 && /* @__PURE__ */ jsxs("p", { className: `${CLASS$
|
|
17514
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$8}__notes`, children: [
|
|
17515
|
+
livePoints.length > 0 && /* @__PURE__ */ jsxs("p", { className: `${CLASS$8}__note ${CLASS$8}__note--live`, children: [
|
|
16978
17516
|
(config.live?.labels?.liveText ?? "{n} en movimiento").replace(
|
|
16979
17517
|
"{n}",
|
|
16980
17518
|
String(livePoints.length)
|
|
16981
17519
|
),
|
|
16982
17520
|
simulated > 0 && ` \xB7 ${config.live?.labels?.simulatedText ?? "incluye posiciones simuladas"}`
|
|
16983
17521
|
] }),
|
|
16984
|
-
missing > 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
16985
|
-
outside > 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
17522
|
+
missing > 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$8}__note`, children: ((missing === 1 ? labels.missingTextOne : void 0) ?? labels.missingText ?? "{n} sin ubicaci\xF3n registrada").replace("{n}", String(missing)) }),
|
|
17523
|
+
outside > 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$8}__note`, children: (labels.outsideText ?? "{n} fuera de la zona (aleja el mapa para verlos)").replace(
|
|
16986
17524
|
"{n}",
|
|
16987
17525
|
String(outside)
|
|
16988
17526
|
) }),
|
|
16989
|
-
failed && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
17527
|
+
failed && /* @__PURE__ */ jsx("p", { className: `${CLASS$8}__note`, children: "No se pudieron cargar las ubicaciones." })
|
|
16990
17528
|
] })
|
|
16991
17529
|
] }) });
|
|
16992
17530
|
};
|
|
@@ -17002,7 +17540,7 @@ function lineaSinMapa(labels, missing, failed) {
|
|
|
17002
17540
|
return labels.emptyText ?? "Sin ubicaciones para mostrar";
|
|
17003
17541
|
}
|
|
17004
17542
|
|
|
17005
|
-
const CLASS$
|
|
17543
|
+
const CLASS$7 = `${COMPONENT_PREFIX$1}service-shortcuts`;
|
|
17006
17544
|
const ICONS = {
|
|
17007
17545
|
// SPEC-126 — quien DESPACHA tambien necesita sus puertas, y una de ellas son las conversaciones
|
|
17008
17546
|
// de sus servicios. Los cinco iconos que habia eran todos de quien PIDE una grua.
|
|
@@ -17056,16 +17594,16 @@ const ServiceShortcuts = ({
|
|
|
17056
17594
|
}) => {
|
|
17057
17595
|
if (!options?.length) return null;
|
|
17058
17596
|
const elegido = !!selectedId;
|
|
17059
|
-
return /* @__PURE__ */ jsx("div", { className: [CLASS$
|
|
17597
|
+
return /* @__PURE__ */ jsx("div", { className: [CLASS$7, elegido ? `${CLASS$7}--used` : ""].filter(Boolean).join(" "), children: options.map((o) => {
|
|
17060
17598
|
const esElegido = o.id === selectedId;
|
|
17061
17599
|
return /* @__PURE__ */ jsxs(
|
|
17062
17600
|
"button",
|
|
17063
17601
|
{
|
|
17064
17602
|
type: "button",
|
|
17065
17603
|
className: [
|
|
17066
|
-
`${CLASS$
|
|
17067
|
-
elegido ? `${CLASS$
|
|
17068
|
-
esElegido ? `${CLASS$
|
|
17604
|
+
`${CLASS$7}__item`,
|
|
17605
|
+
elegido ? `${CLASS$7}__item--off` : "",
|
|
17606
|
+
esElegido ? `${CLASS$7}__item--chosen` : ""
|
|
17069
17607
|
].filter(Boolean).join(" "),
|
|
17070
17608
|
disabled: elegido,
|
|
17071
17609
|
"aria-disabled": elegido,
|
|
@@ -17077,12 +17615,12 @@ const ServiceShortcuts = ({
|
|
|
17077
17615
|
else if (o.route) eventBus?.emit(CHAT_EVENT.NAVIGATE, { route: o.route });
|
|
17078
17616
|
},
|
|
17079
17617
|
children: [
|
|
17080
|
-
o.icon && /* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
17081
|
-
/* @__PURE__ */ jsxs("span", { className: `${CLASS$
|
|
17082
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
17083
|
-
o.hint && /* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
17618
|
+
o.icon && /* @__PURE__ */ jsx("span", { className: `${CLASS$7}__icon`, children: ICONS[o.icon] }),
|
|
17619
|
+
/* @__PURE__ */ jsxs("span", { className: `${CLASS$7}__text`, children: [
|
|
17620
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$7}__label`, children: o.label }),
|
|
17621
|
+
o.hint && /* @__PURE__ */ jsx("span", { className: `${CLASS$7}__hint`, children: o.hint })
|
|
17084
17622
|
] }),
|
|
17085
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
17623
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$7}__arrow`, children: esElegido ? CHECK : elegido ? null : /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("polyline", { points: "9 18 15 12 9 6" }) }) })
|
|
17086
17624
|
]
|
|
17087
17625
|
},
|
|
17088
17626
|
o.id
|
|
@@ -17651,19 +18189,19 @@ function ChatNavigatorChat({ component, eventBus }) {
|
|
|
17651
18189
|
] });
|
|
17652
18190
|
}
|
|
17653
18191
|
|
|
17654
|
-
const CLASS$
|
|
18192
|
+
const CLASS$6 = `${COMPONENT_PREFIX$1}user-tools`;
|
|
17655
18193
|
const UserTools = ({ config, onChange, onAction, className }) => {
|
|
17656
18194
|
const { title, description, items } = config;
|
|
17657
|
-
return /* @__PURE__ */ jsxs("section", { className: [CLASS$
|
|
17658
|
-
title && /* @__PURE__ */ jsx("h2", { className: `${CLASS$
|
|
17659
|
-
description && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
17660
|
-
/* @__PURE__ */ jsx("ul", { className: `${CLASS$
|
|
18195
|
+
return /* @__PURE__ */ jsxs("section", { className: [CLASS$6, className].filter(Boolean).join(" "), children: [
|
|
18196
|
+
title && /* @__PURE__ */ jsx("h2", { className: `${CLASS$6}__title`, children: title }),
|
|
18197
|
+
description && /* @__PURE__ */ jsx("p", { className: `${CLASS$6}__description`, children: description }),
|
|
18198
|
+
/* @__PURE__ */ jsx("ul", { className: `${CLASS$6}__list`, children: items.map((item) => /* @__PURE__ */ jsx("li", { className: `${CLASS$6}__item`, children: item.kind === "action" ? (
|
|
17661
18199
|
// SPEC-139 T9 — un ajuste que se pulsa: mismo renglón (etiqueta y pista), y en vez
|
|
17662
18200
|
// de la caja, un botón que dice lo que hace.
|
|
17663
|
-
/* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
17664
|
-
/* @__PURE__ */ jsxs("span", { className: `${CLASS$
|
|
17665
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
17666
|
-
item.hint && /* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
18201
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$6}__action`, children: [
|
|
18202
|
+
/* @__PURE__ */ jsxs("span", { className: `${CLASS$6}__text`, children: [
|
|
18203
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$6}__label`, children: item.label }),
|
|
18204
|
+
item.hint && /* @__PURE__ */ jsx("span", { className: `${CLASS$6}__hint`, children: item.hint })
|
|
17667
18205
|
] }),
|
|
17668
18206
|
/* @__PURE__ */ jsx(
|
|
17669
18207
|
Button,
|
|
@@ -17682,13 +18220,13 @@ const UserTools = ({ config, onChange, onAction, className }) => {
|
|
|
17682
18220
|
checked: Boolean(item.value),
|
|
17683
18221
|
disabled: item.disabled,
|
|
17684
18222
|
onChange: (checked) => onChange?.(item.id, checked),
|
|
17685
|
-
label: /* @__PURE__ */ jsxs("span", { className: `${CLASS$
|
|
17686
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
17687
|
-
item.hint && /* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
18223
|
+
label: /* @__PURE__ */ jsxs("span", { className: `${CLASS$6}__text`, children: [
|
|
18224
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$6}__label`, children: item.label }),
|
|
18225
|
+
item.hint && /* @__PURE__ */ jsx("span", { className: `${CLASS$6}__hint`, children: item.hint })
|
|
17688
18226
|
] })
|
|
17689
18227
|
}
|
|
17690
18228
|
) }, item.id)) }),
|
|
17691
|
-
items.length === 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
18229
|
+
items.length === 0 && /* @__PURE__ */ jsx("p", { className: `${CLASS$6}__empty`, children: "No hay herramientas disponibles por ahora." })
|
|
17692
18230
|
] });
|
|
17693
18231
|
};
|
|
17694
18232
|
UserTools.displayName = "UserTools";
|
|
@@ -18298,7 +18836,7 @@ const ChatHeader = ({
|
|
|
18298
18836
|
] });
|
|
18299
18837
|
};
|
|
18300
18838
|
|
|
18301
|
-
const CLASS$
|
|
18839
|
+
const CLASS$5 = `${COMPONENT_PREFIX$1}floating-actions`;
|
|
18302
18840
|
const ICON_VALUES = new Set(Object.values(ICON_TYPES));
|
|
18303
18841
|
function renderIcon(icon) {
|
|
18304
18842
|
if (typeof icon === "string" && ICON_VALUES.has(icon)) {
|
|
@@ -18307,23 +18845,23 @@ function renderIcon(icon) {
|
|
|
18307
18845
|
return icon;
|
|
18308
18846
|
}
|
|
18309
18847
|
function Side({ buttons, align, eventBus }) {
|
|
18310
|
-
return /* @__PURE__ */ jsx("div", { className: `${CLASS$
|
|
18848
|
+
return /* @__PURE__ */ jsx("div", { className: `${CLASS$5}__group ${CLASS$5}__group--${align}`, children: buttons.map((b) => {
|
|
18311
18849
|
const emit = () => {
|
|
18312
18850
|
if (b.disabled) return;
|
|
18313
18851
|
eventBus.emit(b.event, b.payload);
|
|
18314
18852
|
};
|
|
18315
18853
|
if (b.custom) {
|
|
18316
|
-
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
18854
|
+
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$5}__slot`, children: [
|
|
18317
18855
|
b.custom,
|
|
18318
|
-
b.panel && b.open && /* @__PURE__ */ jsx("div", { className: `${CLASS$
|
|
18856
|
+
b.panel && b.open && /* @__PURE__ */ jsx("div", { className: `${CLASS$5}__panel ${CLASS$5}__panel--${align}`, children: b.panel })
|
|
18319
18857
|
] }, b.id);
|
|
18320
18858
|
}
|
|
18321
|
-
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
18859
|
+
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$5}__slot`, children: [
|
|
18322
18860
|
/* @__PURE__ */ jsxs(
|
|
18323
18861
|
"button",
|
|
18324
18862
|
{
|
|
18325
18863
|
type: "button",
|
|
18326
|
-
className: [`${CLASS$
|
|
18864
|
+
className: [`${CLASS$5}__button`, b.active ? `${CLASS$5}__button--active` : ""].filter(Boolean).join(" "),
|
|
18327
18865
|
"aria-label": b.ariaLabel,
|
|
18328
18866
|
title: b.ariaLabel,
|
|
18329
18867
|
"aria-pressed": b.active,
|
|
@@ -18331,16 +18869,16 @@ function Side({ buttons, align, eventBus }) {
|
|
|
18331
18869
|
onClick: emit,
|
|
18332
18870
|
children: [
|
|
18333
18871
|
renderIcon(b.icon),
|
|
18334
|
-
b.badge != null && b.badge !== "" && b.badge !== 0 && /* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
18872
|
+
b.badge != null && b.badge !== "" && b.badge !== 0 && /* @__PURE__ */ jsx("span", { className: `${CLASS$5}__badge`, children: b.badge })
|
|
18335
18873
|
]
|
|
18336
18874
|
}
|
|
18337
18875
|
),
|
|
18338
|
-
b.panel && b.open && /* @__PURE__ */ jsx("div", { className: `${CLASS$
|
|
18876
|
+
b.panel && b.open && /* @__PURE__ */ jsx("div", { className: `${CLASS$5}__panel ${CLASS$5}__panel--${align}`, children: b.panel })
|
|
18339
18877
|
] }, b.id);
|
|
18340
18878
|
}) });
|
|
18341
18879
|
}
|
|
18342
18880
|
const ChatFloatingActions = ({ eventBus, left = [], right = [], offset = 12, glass = false }) => {
|
|
18343
|
-
const cls = [CLASS$
|
|
18881
|
+
const cls = [CLASS$5, glass ? `${CLASS$5}--glass` : ""].filter(Boolean).join(" ");
|
|
18344
18882
|
return /* @__PURE__ */ jsxs("div", { className: cls, style: { paddingLeft: offset, paddingRight: offset }, children: [
|
|
18345
18883
|
/* @__PURE__ */ jsx(Side, { buttons: left, align: "left", eventBus }),
|
|
18346
18884
|
/* @__PURE__ */ jsx(Side, { buttons: right, align: "right", eventBus })
|
|
@@ -18773,7 +19311,7 @@ const UserMessage = ({
|
|
|
18773
19311
|
] }) });
|
|
18774
19312
|
};
|
|
18775
19313
|
|
|
18776
|
-
const CLASS$
|
|
19314
|
+
const CLASS$4 = `${COMPONENT_PREFIX$1}photo-picker`;
|
|
18777
19315
|
const PhotoPicker = ({
|
|
18778
19316
|
label,
|
|
18779
19317
|
hint,
|
|
@@ -18798,8 +19336,8 @@ const PhotoPicker = ({
|
|
|
18798
19336
|
void onFiles(e.target.files);
|
|
18799
19337
|
e.target.value = "";
|
|
18800
19338
|
};
|
|
18801
|
-
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
18802
|
-
/* @__PURE__ */ jsxs("span", { className: `${CLASS$
|
|
19339
|
+
return /* @__PURE__ */ jsxs("div", { className: `${CLASS$4}${error ? ` ${CLASS$4}--error` : ""}`, children: [
|
|
19340
|
+
/* @__PURE__ */ jsxs("span", { className: `${CLASS$4}__label`, children: [
|
|
18803
19341
|
label,
|
|
18804
19342
|
required ? " *" : "",
|
|
18805
19343
|
hechas > 0 ? ` (${hechas}${max ? `/${max}` : ""})` : ""
|
|
@@ -18808,7 +19346,7 @@ const PhotoPicker = ({
|
|
|
18808
19346
|
"input",
|
|
18809
19347
|
{
|
|
18810
19348
|
ref: galeriaRef,
|
|
18811
|
-
className: `${CLASS$
|
|
19349
|
+
className: `${CLASS$4}__native`,
|
|
18812
19350
|
type: "file",
|
|
18813
19351
|
accept: "image/*",
|
|
18814
19352
|
multiple: max !== 1,
|
|
@@ -18821,7 +19359,7 @@ const PhotoPicker = ({
|
|
|
18821
19359
|
"input",
|
|
18822
19360
|
{
|
|
18823
19361
|
ref: camaraRef,
|
|
18824
|
-
className: `${CLASS$
|
|
19362
|
+
className: `${CLASS$4}__native`,
|
|
18825
19363
|
type: "file",
|
|
18826
19364
|
accept: "image/*",
|
|
18827
19365
|
capture: "environment",
|
|
@@ -18830,15 +19368,15 @@ const PhotoPicker = ({
|
|
|
18830
19368
|
"data-testid": "photo-picker-camera"
|
|
18831
19369
|
}
|
|
18832
19370
|
),
|
|
18833
|
-
entries.length > 0 && /* @__PURE__ */ jsx("ul", { className: `${CLASS$
|
|
18834
|
-
e.previewUrl ? /* @__PURE__ */ jsx("img", { className: `${CLASS$
|
|
18835
|
-
e.status === "uploading" && /* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
18836
|
-
e.status === "error" && /* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
19371
|
+
entries.length > 0 && /* @__PURE__ */ jsx("ul", { className: `${CLASS$4}__grid`, children: entries.map((e, i) => /* @__PURE__ */ jsxs("li", { className: `${CLASS$4}__thumb ${CLASS$4}__thumb--${e.status}`, children: [
|
|
19372
|
+
e.previewUrl ? /* @__PURE__ */ jsx("img", { className: `${CLASS$4}__img`, src: e.previewUrl, alt: e.name }) : /* @__PURE__ */ jsx("span", { className: `${CLASS$4}__placeholder`, "aria-hidden": "true", children: /* @__PURE__ */ jsx(Icon$1, { type: ICON_TYPES.IMAGE }) }),
|
|
19373
|
+
e.status === "uploading" && /* @__PURE__ */ jsx("span", { className: `${CLASS$4}__state`, children: "Subiendo\u2026" }),
|
|
19374
|
+
e.status === "error" && /* @__PURE__ */ jsx("span", { className: `${CLASS$4}__state ${CLASS$4}__state--error`, children: "No se pudo subir" }),
|
|
18837
19375
|
onRemove && e.status !== "uploading" && /* @__PURE__ */ jsx(
|
|
18838
19376
|
"button",
|
|
18839
19377
|
{
|
|
18840
19378
|
type: "button",
|
|
18841
|
-
className: `${CLASS$
|
|
19379
|
+
className: `${CLASS$4}__remove`,
|
|
18842
19380
|
onClick: () => onRemove(i),
|
|
18843
19381
|
"aria-label": `Quitar ${e.name}`,
|
|
18844
19382
|
disabled,
|
|
@@ -18846,12 +19384,12 @@ const PhotoPicker = ({
|
|
|
18846
19384
|
}
|
|
18847
19385
|
)
|
|
18848
19386
|
] }, `${e.name}-${i}`)) }),
|
|
18849
|
-
/* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
19387
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$4}__actions`, children: [
|
|
18850
19388
|
capture && /* @__PURE__ */ jsxs(
|
|
18851
19389
|
"button",
|
|
18852
19390
|
{
|
|
18853
19391
|
type: "button",
|
|
18854
|
-
className: `${CLASS$
|
|
19392
|
+
className: `${CLASS$4}__pick`,
|
|
18855
19393
|
onClick: () => elegir(camaraRef),
|
|
18856
19394
|
disabled: disabled || lleno,
|
|
18857
19395
|
children: [
|
|
@@ -18864,7 +19402,7 @@ const PhotoPicker = ({
|
|
|
18864
19402
|
"button",
|
|
18865
19403
|
{
|
|
18866
19404
|
type: "button",
|
|
18867
|
-
className: `${CLASS$
|
|
19405
|
+
className: `${CLASS$4}__pick ${CLASS$4}__pick--secondary`,
|
|
18868
19406
|
onClick: () => elegir(galeriaRef),
|
|
18869
19407
|
disabled: disabled || lleno,
|
|
18870
19408
|
children: [
|
|
@@ -18874,13 +19412,13 @@ const PhotoPicker = ({
|
|
|
18874
19412
|
}
|
|
18875
19413
|
)
|
|
18876
19414
|
] }),
|
|
18877
|
-
error && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
18878
|
-
!error && subiendo && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
18879
|
-
!error && !subiendo && hint && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
19415
|
+
error && /* @__PURE__ */ jsx("p", { className: `${CLASS$4}__error`, children: error }),
|
|
19416
|
+
!error && subiendo && /* @__PURE__ */ jsx("p", { className: `${CLASS$4}__hint`, children: "Espera a que terminen de subir." }),
|
|
19417
|
+
!error && !subiendo && hint && /* @__PURE__ */ jsx("p", { className: `${CLASS$4}__hint`, children: hint })
|
|
18880
19418
|
] });
|
|
18881
19419
|
};
|
|
18882
19420
|
|
|
18883
|
-
const CLASS$
|
|
19421
|
+
const CLASS$3 = `${COMPONENT_PREFIX$1}credentials-card`;
|
|
18884
19422
|
async function copiar(texto) {
|
|
18885
19423
|
try {
|
|
18886
19424
|
await navigator.clipboard.writeText(texto);
|
|
@@ -18897,15 +19435,15 @@ const Fila = ({ row }) => {
|
|
|
18897
19435
|
const t = setTimeout(() => setCopiado(false), 1800);
|
|
18898
19436
|
return () => clearTimeout(t);
|
|
18899
19437
|
}, [copiado]);
|
|
18900
|
-
return /* @__PURE__ */ jsxs("li", { className: `${CLASS$
|
|
18901
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
18902
|
-
/* @__PURE__ */ jsx("span", { className: `${CLASS$
|
|
18903
|
-
/* @__PURE__ */ jsxs("span", { className: `${CLASS$
|
|
19438
|
+
return /* @__PURE__ */ jsxs("li", { className: `${CLASS$3}__row`, children: [
|
|
19439
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$3}__label`, children: row.label }),
|
|
19440
|
+
/* @__PURE__ */ jsx("span", { className: `${CLASS$3}__value`, "data-testid": `credential-${row.label}`, children: visible ? row.value : "\u2022".repeat(Math.min(row.value.length, 12)) }),
|
|
19441
|
+
/* @__PURE__ */ jsxs("span", { className: `${CLASS$3}__tools`, children: [
|
|
18904
19442
|
row.masked && /* @__PURE__ */ jsx(
|
|
18905
19443
|
"button",
|
|
18906
19444
|
{
|
|
18907
19445
|
type: "button",
|
|
18908
|
-
className: `${CLASS$
|
|
19446
|
+
className: `${CLASS$3}__tool`,
|
|
18909
19447
|
onClick: () => setVisible((v) => !v),
|
|
18910
19448
|
"aria-label": visible ? `Ocultar ${row.label}` : `Ver ${row.label}`,
|
|
18911
19449
|
children: visible ? "Ocultar" : "Ver"
|
|
@@ -18915,7 +19453,7 @@ const Fila = ({ row }) => {
|
|
|
18915
19453
|
"button",
|
|
18916
19454
|
{
|
|
18917
19455
|
type: "button",
|
|
18918
|
-
className: `${CLASS$
|
|
19456
|
+
className: `${CLASS$3}__tool`,
|
|
18919
19457
|
onClick: async () => setCopiado(await copiar(row.value)),
|
|
18920
19458
|
"aria-label": `Copiar ${row.label}`,
|
|
18921
19459
|
children: copiado ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -18934,12 +19472,12 @@ const CredentialsCard = ({
|
|
|
18934
19472
|
note,
|
|
18935
19473
|
action,
|
|
18936
19474
|
className
|
|
18937
|
-
}) => /* @__PURE__ */ jsxs("section", { className: [CLASS$
|
|
18938
|
-
/* @__PURE__ */ jsx("h3", { className: `${CLASS$
|
|
18939
|
-
intro && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
18940
|
-
/* @__PURE__ */ jsx("ul", { className: `${CLASS$
|
|
18941
|
-
note && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
18942
|
-
action && /* @__PURE__ */ jsx("div", { className: `${CLASS$
|
|
19475
|
+
}) => /* @__PURE__ */ jsxs("section", { className: [CLASS$3, className].filter(Boolean).join(" "), "aria-label": title, children: [
|
|
19476
|
+
/* @__PURE__ */ jsx("h3", { className: `${CLASS$3}__title`, children: title }),
|
|
19477
|
+
intro && /* @__PURE__ */ jsx("p", { className: `${CLASS$3}__intro`, children: intro }),
|
|
19478
|
+
/* @__PURE__ */ jsx("ul", { className: `${CLASS$3}__rows`, children: rows.map((r) => /* @__PURE__ */ jsx(Fila, { row: r }, r.label)) }),
|
|
19479
|
+
note && /* @__PURE__ */ jsx("p", { className: `${CLASS$3}__note`, children: note }),
|
|
19480
|
+
action && /* @__PURE__ */ jsx("div", { className: `${CLASS$3}__action`, children: /* @__PURE__ */ jsx(Button, { fullWidth: true, onClick: action.onClick, disabled: action.disabled, children: action.label }) })
|
|
18943
19481
|
] });
|
|
18944
19482
|
CredentialsCard.displayName = "CredentialsCard";
|
|
18945
19483
|
|
|
@@ -19111,7 +19649,7 @@ const TextArea = forwardRef(
|
|
|
19111
19649
|
);
|
|
19112
19650
|
TextArea.displayName = "TextArea";
|
|
19113
19651
|
|
|
19114
|
-
const CLASS$
|
|
19652
|
+
const CLASS$2 = `${COMPONENT_PREFIX$1}support-request-form`;
|
|
19115
19653
|
const VACIO = { name: "", email: "", phone: "", subject: "", message: "" };
|
|
19116
19654
|
function faltantes(v) {
|
|
19117
19655
|
if (v.name.trim().length < 2) return "Escribe tu nombre.";
|
|
@@ -19156,14 +19694,14 @@ const SupportRequestForm = ({
|
|
|
19156
19694
|
return /* @__PURE__ */ jsxs(
|
|
19157
19695
|
"form",
|
|
19158
19696
|
{
|
|
19159
|
-
className: [CLASS$
|
|
19697
|
+
className: [CLASS$2, sent ? `${CLASS$2}--sent` : "", className].filter(Boolean).join(" "),
|
|
19160
19698
|
onSubmit: enviar,
|
|
19161
19699
|
noValidate: true,
|
|
19162
19700
|
children: [
|
|
19163
|
-
/* @__PURE__ */ jsx("h4", { className: `${CLASS$
|
|
19164
|
-
intro && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
19165
|
-
/* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
19166
|
-
/* @__PURE__ */ jsxs("div", { className: `${CLASS$
|
|
19701
|
+
/* @__PURE__ */ jsx("h4", { className: `${CLASS$2}__title`, children: title }),
|
|
19702
|
+
intro && /* @__PURE__ */ jsx("p", { className: `${CLASS$2}__intro`, children: intro }),
|
|
19703
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$2}__fields`, children: [
|
|
19704
|
+
/* @__PURE__ */ jsxs("div", { className: `${CLASS$2}__row`, children: [
|
|
19167
19705
|
/* @__PURE__ */ jsx(Input$1, { label: "Nombre", value: values.name, onChange: set("name"), fullWidth: true, disabled: sent, autoComplete: "name" }),
|
|
19168
19706
|
/* @__PURE__ */ jsx(Input$1, { label: "Tel\xE9fono (opcional)", value: values.phone, onChange: set("phone"), fullWidth: true, disabled: sent, inputMode: "tel", autoComplete: "tel" })
|
|
19169
19707
|
] }),
|
|
@@ -19171,13 +19709,13 @@ const SupportRequestForm = ({
|
|
|
19171
19709
|
/* @__PURE__ */ jsx(Input$1, { label: "Asunto", value: values.subject, onChange: set("subject"), fullWidth: true, disabled: sent }),
|
|
19172
19710
|
/* @__PURE__ */ jsx(TextArea, { label: "Mensaje", value: values.message, onChange: set("message"), fullWidth: true, disabled: sent, minRows: 3, maxLength: 4e3, showCount: true })
|
|
19173
19711
|
] }),
|
|
19174
|
-
error && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
19175
|
-
sent ? /* @__PURE__ */ jsxs("p", { className: `${CLASS$
|
|
19712
|
+
error && /* @__PURE__ */ jsx("p", { className: `${CLASS$2}__error`, role: "alert", children: error }),
|
|
19713
|
+
sent ? /* @__PURE__ */ jsxs("p", { className: `${CLASS$2}__done`, role: "status", children: [
|
|
19176
19714
|
/* @__PURE__ */ jsx(Icon$1, { type: ICON_TYPES.CHECK, size: "small" }),
|
|
19177
19715
|
/* @__PURE__ */ jsx("span", { children: sentLabel })
|
|
19178
19716
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
19179
|
-
/* @__PURE__ */ jsx("div", { className: `${CLASS$
|
|
19180
|
-
note && /* @__PURE__ */ jsx("p", { className: `${CLASS$
|
|
19717
|
+
/* @__PURE__ */ jsx("div", { className: `${CLASS$2}__actions`, children: /* @__PURE__ */ jsx(Button, { type: "submit", variant: "primary", isLoading: enviando, disabled: enviando, children: submitLabel }) }),
|
|
19718
|
+
note && /* @__PURE__ */ jsx("p", { className: `${CLASS$2}__note`, children: note })
|
|
19181
19719
|
] })
|
|
19182
19720
|
]
|
|
19183
19721
|
}
|
|
@@ -22110,105 +22648,6 @@ const Notification = ({
|
|
|
22110
22648
|
};
|
|
22111
22649
|
Notification.displayName = "Notification";
|
|
22112
22650
|
|
|
22113
|
-
const CARD_VARIANTS = {
|
|
22114
|
-
/** Con sombra: flota sobre el contenido (hojas, diálogos, paneles). */
|
|
22115
|
-
ELEVATED: "elevated"};
|
|
22116
|
-
const CARD_PADDINGS = {
|
|
22117
|
-
MEDIUM: "medium",
|
|
22118
|
-
LARGE: "large"
|
|
22119
|
-
};
|
|
22120
|
-
const CARD_RADII = {
|
|
22121
|
-
NONE: "none",
|
|
22122
|
-
LARGE: "large"
|
|
22123
|
-
};
|
|
22124
|
-
|
|
22125
|
-
const BASE = `${COMPONENT_PREFIX}card`;
|
|
22126
|
-
const Card = React.forwardRef(
|
|
22127
|
-
({
|
|
22128
|
-
variant = CARD_VARIANTS.ELEVATED,
|
|
22129
|
-
padding = CARD_PADDINGS.MEDIUM,
|
|
22130
|
-
radius = CARD_RADII.LARGE,
|
|
22131
|
-
fullWidth = false,
|
|
22132
|
-
className = "",
|
|
22133
|
-
children,
|
|
22134
|
-
...rest
|
|
22135
|
-
}, ref) => {
|
|
22136
|
-
const classes = [
|
|
22137
|
-
BASE,
|
|
22138
|
-
`${BASE}--${variant}`,
|
|
22139
|
-
`${BASE}--padding-${padding}`,
|
|
22140
|
-
`${BASE}--radius-${radius}`,
|
|
22141
|
-
fullWidth ? `${BASE}--full-width` : "",
|
|
22142
|
-
className
|
|
22143
|
-
].filter(Boolean).join(" ");
|
|
22144
|
-
return /* @__PURE__ */ jsx("div", { ref, className: classes, ...rest, children });
|
|
22145
|
-
}
|
|
22146
|
-
);
|
|
22147
|
-
Card.displayName = "Card";
|
|
22148
|
-
|
|
22149
|
-
const CLASS$2 = "px-lumi-bottom-sheet";
|
|
22150
|
-
const BottomSheet = ({
|
|
22151
|
-
open,
|
|
22152
|
-
children,
|
|
22153
|
-
onClose,
|
|
22154
|
-
showGrabber = true,
|
|
22155
|
-
closeOnBackdrop = false,
|
|
22156
|
-
closeOnEscape = true,
|
|
22157
|
-
ariaLabelledBy,
|
|
22158
|
-
className = ""
|
|
22159
|
-
}) => {
|
|
22160
|
-
useEffect(() => {
|
|
22161
|
-
if (!open) return;
|
|
22162
|
-
const onKey = (e) => {
|
|
22163
|
-
if (e.key === "Escape" && closeOnEscape) onClose?.();
|
|
22164
|
-
};
|
|
22165
|
-
document.addEventListener("keydown", onKey);
|
|
22166
|
-
const previous = document.body.style.overflow;
|
|
22167
|
-
document.body.style.overflow = "hidden";
|
|
22168
|
-
return () => {
|
|
22169
|
-
document.removeEventListener("keydown", onKey);
|
|
22170
|
-
document.body.style.overflow = previous;
|
|
22171
|
-
};
|
|
22172
|
-
}, [open, closeOnEscape, onClose]);
|
|
22173
|
-
if (!open) return null;
|
|
22174
|
-
return createPortal(
|
|
22175
|
-
/* @__PURE__ */ jsxs(
|
|
22176
|
-
"div",
|
|
22177
|
-
{
|
|
22178
|
-
className: [CLASS$2, className].filter(Boolean).join(" "),
|
|
22179
|
-
role: "dialog",
|
|
22180
|
-
"aria-modal": "true",
|
|
22181
|
-
"aria-labelledby": ariaLabelledBy,
|
|
22182
|
-
children: [
|
|
22183
|
-
/* @__PURE__ */ jsx(
|
|
22184
|
-
"div",
|
|
22185
|
-
{
|
|
22186
|
-
className: `${CLASS$2}__backdrop`,
|
|
22187
|
-
"aria-hidden": "true",
|
|
22188
|
-
onClick: closeOnBackdrop ? onClose : void 0
|
|
22189
|
-
}
|
|
22190
|
-
),
|
|
22191
|
-
/* @__PURE__ */ jsxs(
|
|
22192
|
-
Card,
|
|
22193
|
-
{
|
|
22194
|
-
className: `${CLASS$2}__sheet`,
|
|
22195
|
-
padding: CARD_PADDINGS.LARGE,
|
|
22196
|
-
radius: CARD_RADII.NONE,
|
|
22197
|
-
fullWidth: true,
|
|
22198
|
-
children: [
|
|
22199
|
-
showGrabber && /* @__PURE__ */ jsx("div", { className: `${CLASS$2}__grabber`, "aria-hidden": "true" }),
|
|
22200
|
-
children
|
|
22201
|
-
]
|
|
22202
|
-
}
|
|
22203
|
-
)
|
|
22204
|
-
]
|
|
22205
|
-
}
|
|
22206
|
-
),
|
|
22207
|
-
document.body
|
|
22208
|
-
);
|
|
22209
|
-
};
|
|
22210
|
-
BottomSheet.displayName = "BottomSheet";
|
|
22211
|
-
|
|
22212
22651
|
const CLASS$1 = `${COMPONENT_PREFIX}live-indicator`;
|
|
22213
22652
|
const LiveIndicator = ({
|
|
22214
22653
|
label,
|
|
@@ -25369,4 +25808,4 @@ function buildBreadcrumbPath(items, targetKey, currentPath = []) {
|
|
|
25369
25808
|
return [];
|
|
25370
25809
|
}
|
|
25371
25810
|
|
|
25372
|
-
export { ActionFormDrawer, BottomSheet, CHAT_CONFIG_DEFAULTS, CHAT_EVENT, ICON_TYPES as CHAT_ICON_TYPES, CarouselDisplay, Chat, AssistantMessage as ChatAssistantMessage, AssistantThinkingIndicator as ChatAssistantThinkingIndicator, AttachmentPreview as ChatAttachmentPreview, Avatar as ChatAvatar, Button$1 as ChatButton, ChatConfigProvider, DateDivider as ChatDateDivider, FileViewer as ChatFileViewer, ChatFloatingActions, FullscreenViewer as ChatFullscreenViewer, ChatHeader as ChatHeaderComponent, Icon$1 as ChatIcon, Input$2 as ChatInput, ChatInput as ChatInputComponent, Link as ChatLink, Loader$1 as ChatLoader, Logo as ChatLogo, MessageStatus as ChatMessageStatus, Modal as ChatModal, ChatNavigator, Select$2 as ChatSelect, SelectMenu as ChatSelectMenu, StructuredContent as ChatStructuredContent, Text as ChatText, Textarea as ChatTextarea, UserAttachments as ChatUserAttachments, UserMessage as ChatUserMessage, ChatWidget, CredentialsCard, FileField, BADGE_VARIANTS as LUMI_BADGE_VARIANTS, DEFAULT_TITLES as LUMI_DEFAULT_TITLES, LUMI_ICON_TYPES, LiveIndicator, LocationField, ActionBar as LumiActionBar, Badge as LumiBadge, Base as LumiBase, BaseNavbar as LumiBaseNavbar, BaseWorkspace as LumiBaseWorkspace, Breadcrumb as LumiBreadcrumb, BreadcrumbItem as LumiBreadcrumbItem, BreadcrumbSeparator as LumiBreadcrumbSeparator, Button as LumiButton, Calendar as LumiCalendar, Card as LumiCard, Checkbox$1 as LumiCheckbox, Crud as LumiCrud, CurrencyDisplay as LumiCurrencyDisplay, Dashboard as LumiDashboard, DashboardNavbar as LumiDashboardNavbar, DashboardSidebar as LumiDashboardSidebar, DashboardWorkspace as LumiDashboardWorkspace, DateDisplay as LumiDateDisplay, DateInput$1 as LumiDateInput, Drawer as LumiDrawer, DropdownMenu as LumiDropdownMenu, DynamicForm as LumiDynamicForm, FieldValue as LumiFieldValue, Filter as LumiFilter, FilterRow as LumiFilterRow, Checkbox as LumiFormCheckbox, DateInput as LumiFormDateInput, FormDrawer as LumiFormDrawer, Input as LumiFormInput, Select as LumiFormSelect, TimeInput as LumiFormTimeInput, Icon as LumiIcon, Input$1 as LumiInput, Loader as LumiLoader, Menu as LumiMenu, MenuItem as LumiMenuItem, MenuItemGroup as LumiMenuItemGroup, Notification as LumiNotification, Pagination as LumiPagination, Popover as LumiPopover, QRCode as LumiQRCode, RecordCard as LumiRecordCard, Select$1 as LumiSelect, StepIndicator as LumiStepIndicator, Stepper as LumiStepper, SubMenu as LumiSubMenu, Table as LumiTable, Tabs as LumiTabs, TextArea as LumiTextArea, TimeInput$1 as LumiTimeInput, Tooltip as LumiTooltip, MapView, PhotoPicker, ReactiveCrud, ServiceShortcuts, ServicesMap, SessionExpiryPrompt, SupportRequestForm, UserTools, chatEventBus, clearChatComponents, createDeepPropertySubscriber, createEventBus, createStore, createStoreMerger, deepMerge, disabledReasonFor, fetchViaEventBus, getLastFleetSnapshot, matchesDisabledWhen, matchesDoneWhen, matchesVisibleWhen, registerChatComponents, setLastFleetSnapshot, useChatConfig, useReactiveCrud };
|
|
25811
|
+
export { ActionFormDrawer, BottomSheet, CHAT_CONFIG_DEFAULTS, CHAT_EVENT, ICON_TYPES as CHAT_ICON_TYPES, CarouselDisplay, Chat, AssistantMessage as ChatAssistantMessage, AssistantThinkingIndicator as ChatAssistantThinkingIndicator, AttachmentPreview as ChatAttachmentPreview, Avatar as ChatAvatar, Button$1 as ChatButton, ChatConfigProvider, DateDivider as ChatDateDivider, FileViewer as ChatFileViewer, ChatFloatingActions, FullscreenViewer as ChatFullscreenViewer, ChatHeader as ChatHeaderComponent, Icon$1 as ChatIcon, Input$2 as ChatInput, ChatInput as ChatInputComponent, Link as ChatLink, Loader$1 as ChatLoader, Logo as ChatLogo, MessageStatus as ChatMessageStatus, Modal as ChatModal, ChatNavigator, Select$2 as ChatSelect, SelectMenu as ChatSelectMenu, StructuredContent as ChatStructuredContent, Text as ChatText, Textarea as ChatTextarea, UserAttachments as ChatUserAttachments, UserMessage as ChatUserMessage, ChatWidget, CredentialsCard, DEFAULT_PHONE_COUNTRY, FileField, BADGE_VARIANTS as LUMI_BADGE_VARIANTS, DEFAULT_TITLES as LUMI_DEFAULT_TITLES, LUMI_ICON_TYPES, LiveIndicator, LocationField, ActionBar as LumiActionBar, Badge as LumiBadge, Base as LumiBase, BaseNavbar as LumiBaseNavbar, BaseWorkspace as LumiBaseWorkspace, Breadcrumb as LumiBreadcrumb, BreadcrumbItem as LumiBreadcrumbItem, BreadcrumbSeparator as LumiBreadcrumbSeparator, Button as LumiButton, Calendar as LumiCalendar, Card as LumiCard, Checkbox$1 as LumiCheckbox, Crud as LumiCrud, CurrencyDisplay as LumiCurrencyDisplay, Dashboard as LumiDashboard, DashboardNavbar as LumiDashboardNavbar, DashboardSidebar as LumiDashboardSidebar, DashboardWorkspace as LumiDashboardWorkspace, DateDisplay as LumiDateDisplay, DateInput$1 as LumiDateInput, Drawer as LumiDrawer, DropdownMenu as LumiDropdownMenu, DynamicForm as LumiDynamicForm, FieldValue as LumiFieldValue, Filter as LumiFilter, FilterRow as LumiFilterRow, Checkbox as LumiFormCheckbox, DateInput as LumiFormDateInput, FormDrawer as LumiFormDrawer, Input as LumiFormInput, Select as LumiFormSelect, TimeInput as LumiFormTimeInput, Icon as LumiIcon, Input$1 as LumiInput, Loader as LumiLoader, Menu as LumiMenu, MenuItem as LumiMenuItem, MenuItemGroup as LumiMenuItemGroup, Notification as LumiNotification, Pagination as LumiPagination, PhoneInput as LumiPhoneInput, Popover as LumiPopover, QRCode as LumiQRCode, RecordCard as LumiRecordCard, Select$1 as LumiSelect, SheetSelect as LumiSheetSelect, StepIndicator as LumiStepIndicator, Stepper as LumiStepper, SubMenu as LumiSubMenu, Table as LumiTable, Tabs as LumiTabs, TextArea as LumiTextArea, TimeInput$1 as LumiTimeInput, Tooltip as LumiTooltip, MapView, PHONE_COUNTRIES, PhotoPicker, ReactiveCrud, SANITIZE_PRESETS, ServiceShortcuts, ServicesMap, SessionExpiryPrompt, SupportRequestForm, UserTools, chatEventBus, clearChatComponents, createDeepPropertySubscriber, createEventBus, createStore, createStoreMerger, deepMerge, disabledReasonFor, fetchViaEventBus, flagOf, getLastFleetSnapshot, matchesDisabledWhen, matchesDoneWhen, matchesVisibleWhen, registerChatComponents, sanitize, setLastFleetSnapshot, splitPhone, useChatConfig, useReactiveCrud };
|