@apia/components 4.0.58 → 4.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +40 -7
- package/dist/index.js +192 -75
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ReactNode, Ref, RefObject, DetailedHTMLProps, TextareaHTMLAttributes, ChangeEventHandler, FocusEvent, MutableRefObject, MouseEvent as MouseEvent$1, KeyboardEvent, FC, FunctionComponent, ForwardedRef, ComponentType, ReactElement } from 'react';
|
|
3
3
|
import * as _apia_util from '@apia/util';
|
|
4
|
-
import { IOnFocusConfiguration, TFocusRetriever, TId as TId$1, EventEmitter, StatefulEmitter, TModify, TApiaFilter, TApiaFilterValue } from '@apia/util';
|
|
4
|
+
import { IOnFocusConfiguration, TFocusRetriever, TId as TId$1, EventEmitter, StatefulEmitter, TModify, TLabel, TApiaFilter, TApiaFilterValue } from '@apia/util';
|
|
5
5
|
import { BoxProps, TPalette, InputProps, ThemeUIStyleObject, IconButtonProps, ButtonProps, ThemeUICSSObject, SelectProps, SwitchProps, LabelProps } from '@apia/theme';
|
|
6
6
|
import { TIconName, TIconType } from '@apia/icons';
|
|
7
7
|
import { Args } from 'react-cool-portal';
|
|
@@ -360,7 +360,7 @@ type TabsControllerProps<TabType extends TTab> = {
|
|
|
360
360
|
id: string;
|
|
361
361
|
initialTabs?: TabType[];
|
|
362
362
|
getController?: (controller: TabsController) => unknown;
|
|
363
|
-
initialState?: Pick<Partial<TTabsListState<TabType>>, 'isMultiple'>;
|
|
363
|
+
initialState?: Pick<Partial<TTabsListState<TabType>>, 'isMultiple' | 'showAtLeastOneTab' | 'allowDetach'>;
|
|
364
364
|
onCloseTab?: (tan: Tab) => void;
|
|
365
365
|
orientation: TOrientation;
|
|
366
366
|
};
|
|
@@ -491,10 +491,11 @@ interface IConfirm {
|
|
|
491
491
|
title?: string;
|
|
492
492
|
size?: TModalSize;
|
|
493
493
|
variant?: string;
|
|
494
|
+
htmlContent?: string;
|
|
494
495
|
}
|
|
495
496
|
declare const ConfirmModal: ({ onConfirm, onCancel, title, size, ...props }: IConfirm) => JSX.Element;
|
|
496
497
|
|
|
497
|
-
type TApiaUtilConfirm = Pick<IConfirm, 'additionalButtons' | 'additionalButtonsOnRight' | 'cancelButtonText' | 'children' | 'className' | 'confirmButtonText' | 'confirmButtonVariant' | 'contentRef' | 'hideCancelButton' | 'hideConfirmButton' | 'title' | 'size' | 'variant'>;
|
|
498
|
+
type TApiaUtilConfirm = Pick<IConfirm, 'additionalButtons' | 'additionalButtonsOnRight' | 'cancelButtonText' | 'children' | 'className' | 'confirmButtonText' | 'confirmButtonVariant' | 'contentRef' | 'hideCancelButton' | 'hideConfirmButton' | 'title' | 'size' | 'variant' | 'htmlContent'>;
|
|
498
499
|
type TApiaUtilInnerConfirm = TApiaUtilConfirm & {
|
|
499
500
|
id: string;
|
|
500
501
|
} & Pick<IConfirm, 'onCancel' | 'onConfirm'>;
|
|
@@ -1054,6 +1055,24 @@ type TCheckbox = TModify<ButtonProps, {
|
|
|
1054
1055
|
}>;
|
|
1055
1056
|
declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<TCheckbox, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1056
1057
|
|
|
1058
|
+
type TCheckboxLabel = {
|
|
1059
|
+
/**
|
|
1060
|
+
* Permite mostrar un mensaje de error debajo del campo
|
|
1061
|
+
*/
|
|
1062
|
+
error?: string;
|
|
1063
|
+
hideRequiredMark?: boolean;
|
|
1064
|
+
label: string | TLabel;
|
|
1065
|
+
/**
|
|
1066
|
+
* La propiedad required se utiliza para mostrar el * de requerido.
|
|
1067
|
+
*
|
|
1068
|
+
* @see requiredMarkPosition
|
|
1069
|
+
* @see hideRequiredMark
|
|
1070
|
+
*/
|
|
1071
|
+
required?: boolean;
|
|
1072
|
+
requiredMarkPosition?: 'before' | 'after';
|
|
1073
|
+
};
|
|
1074
|
+
declare const CheckboxLabel: React$1.ForwardRefExoticComponent<TCheckboxLabel & BoxProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1075
|
+
|
|
1057
1076
|
type TDateProps = {
|
|
1058
1077
|
className?: string;
|
|
1059
1078
|
disabled?: boolean;
|
|
@@ -1148,7 +1167,7 @@ type TFieldLabel = {
|
|
|
1148
1167
|
*/
|
|
1149
1168
|
error?: string;
|
|
1150
1169
|
hideRequiredMark?: boolean;
|
|
1151
|
-
label: string;
|
|
1170
|
+
label: string | TLabel;
|
|
1152
1171
|
/**
|
|
1153
1172
|
* La propiedad required se utiliza para mostrar el * de requerido.
|
|
1154
1173
|
*
|
|
@@ -1165,7 +1184,7 @@ declare const FieldLabel: React$1.ForwardRefExoticComponent<{
|
|
|
1165
1184
|
*/
|
|
1166
1185
|
error?: string;
|
|
1167
1186
|
hideRequiredMark?: boolean;
|
|
1168
|
-
label: string;
|
|
1187
|
+
label: string | TLabel;
|
|
1169
1188
|
/**
|
|
1170
1189
|
* La propiedad required se utiliza para mostrar el * de requerido.
|
|
1171
1190
|
*
|
|
@@ -1176,6 +1195,20 @@ declare const FieldLabel: React$1.ForwardRefExoticComponent<{
|
|
|
1176
1195
|
requiredMarkPosition?: "before" | "after";
|
|
1177
1196
|
} & BoxProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1178
1197
|
|
|
1198
|
+
type SwitchMultipleOption<T extends string> = {
|
|
1199
|
+
value: T;
|
|
1200
|
+
label: string;
|
|
1201
|
+
};
|
|
1202
|
+
declare const SwitchMultiple: (<T extends string>({ options, defaultValue, value, onChange, variant, }: {
|
|
1203
|
+
options: SwitchMultipleOption<T>[];
|
|
1204
|
+
defaultValue?: T;
|
|
1205
|
+
value?: T;
|
|
1206
|
+
onChange: (ev: T) => unknown;
|
|
1207
|
+
variant?: string;
|
|
1208
|
+
}) => React$1.JSX.Element) & {
|
|
1209
|
+
displayName: string;
|
|
1210
|
+
};
|
|
1211
|
+
|
|
1179
1212
|
interface IAccordionItemButton {
|
|
1180
1213
|
ariaLabel: string;
|
|
1181
1214
|
/**
|
|
@@ -1583,7 +1616,7 @@ declare function useModal(configuration?: TUseModalConfiguration): {
|
|
|
1583
1616
|
show: () => void;
|
|
1584
1617
|
};
|
|
1585
1618
|
|
|
1586
|
-
declare const Confirm: ({ children, additionalButtons, additionalButtonsOnRight, cancelButtonText: cancelText, className, confirmButtonText: confirmText, confirmButtonVariant, contentRef, disabled, hideCancelButton, hideConfirmButton, isLoading, onCancel, onConfirm, variant, }: Omit<IConfirm, "title">) => React$1.JSX.Element;
|
|
1619
|
+
declare const Confirm: ({ children, additionalButtons, additionalButtonsOnRight, cancelButtonText: cancelText, className, confirmButtonText: confirmText, confirmButtonVariant, contentRef, disabled, hideCancelButton, hideConfirmButton, isLoading, onCancel, onConfirm, variant, htmlContent, }: Omit<IConfirm, "title">) => React$1.JSX.Element;
|
|
1587
1620
|
|
|
1588
1621
|
interface IDialogButtonBar {
|
|
1589
1622
|
children: React$1.ReactNode;
|
|
@@ -2598,5 +2631,5 @@ declare class Templater {
|
|
|
2598
2631
|
parseString(content: string, options?: IAlterDefaultOptions): string | JSX.Element | JSX.Element[];
|
|
2599
2632
|
}
|
|
2600
2633
|
|
|
2601
|
-
export { Accordion, AccordionAside, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, Aside, AsideLoader, AsidePanel, AutoEllipsis, Autocomplete, type AutocompleteCmpProps, AutocompleteController, type AutocompleteOption, type AutocompleteProps, AutogrowTextarea, BaseButton, BodyAside, CalendarModal, Captcha, CenteredHeaderButtons, Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DeadSessionModal, DefaultAccordionItemButton, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FavoriteIcon, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingAside, FooterButtons, FooterResponsiveButtons, HamburguerMenu, Header, HeaderButtons, type IAccordionItemButton, type IAccordionItemProps, type IAccordionProps, type IAlert, type IApiaFilter, type IAsidePanel, type ICalendarModal, type IConfirm, type IDialogButtonBar, type IDialogHeader, type IField, type IFieldErrorMessage, type IFilterCondition, type IFilterDTOState, type IFilterValue, type IIconInput, type IMenuDefinition, type IOverlay, type IPagination, type IParameter, type IParametersGroup, type IRequiredMark, type IResponsiveComponent, type ISimpleButton, type ITableParameterProps, IconButton, IconInput, IconsList, Label, LabelBox, LinearLoader, LinearSpinnerLock, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, _default as MDRenderer, Modal, ModalContext, NumberInput, Overlay, Pagination, Parameter, type ParameterObject, type ParameterPossibleValue, ParameterRender, type ParameterRenderer, type ParameterRendererProps, type ParameterType, Parameters, type ParametersDefinition, ParametersGroup, type ParametersGroupRenderer, ParametersStore, ParametersTable, type Payload, Permissions, ProgressBar, RequiredMark, ScreenLocker, ShowResponsive, SimpleButton, SortableList, SortableListItem, SwitchCard, type TAccordionHandler, type TAccordionItemButton, type TApiaButtonType, type TApiaIconButton, type TCheckbox, type TCssProps, type TDateProps, type TFieldLabel, type TFilterOp, type TFilterPayload, type TFilterType, type TFilterValue, type TFilterValueType, type TGetTabsController, type TIcon, type TIconButton, type TIconRenderer, type TIconSize, type TIconsList, type TListbox, type TMenuItem, type TModal, type TModalSize, type TNumberInput, type TNumberInputChangeEvent, type TOnClickNode, type TOnConfirmSelection, type TOnSelectionChange, type TOpenModal, type TParameterType, type TPickPoolForPermissions, type TPickUserForPermissions, type TSubmenu, type TTab, type TTabLabelRenderer as TTabRenderer, type TToolbarIconButton as TToolDefinition, type TTooltip, type TUploadHandlerProps, type TUploadInProgress, type TUploadedFile, type TUseModalConfiguration, type TVisualizationType, Tab, Tabs, TabsContent, TabsController, TabsList, Templater, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, UnstyledSortableList, UploadHandler, Uploader, WaiTypeAhead, getFieldErrorStyles, getFieldTouchedStyles, importComponent, isFavoriteIcon, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
|
|
2634
|
+
export { Accordion, AccordionAside, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, Aside, AsideLoader, AsidePanel, AutoEllipsis, Autocomplete, type AutocompleteCmpProps, AutocompleteController, type AutocompleteOption, type AutocompleteProps, AutogrowTextarea, BaseButton, BodyAside, CalendarModal, Captcha, CenteredHeaderButtons, Checkbox, CheckboxLabel, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DeadSessionModal, DefaultAccordionItemButton, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FavoriteIcon, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingAside, FooterButtons, FooterResponsiveButtons, HamburguerMenu, Header, HeaderButtons, type IAccordionItemButton, type IAccordionItemProps, type IAccordionProps, type IAlert, type IApiaFilter, type IAsidePanel, type ICalendarModal, type IConfirm, type IDialogButtonBar, type IDialogHeader, type IField, type IFieldErrorMessage, type IFilterCondition, type IFilterDTOState, type IFilterValue, type IIconInput, type IMenuDefinition, type IOverlay, type IPagination, type IParameter, type IParametersGroup, type IRequiredMark, type IResponsiveComponent, type ISimpleButton, type ITableParameterProps, IconButton, IconInput, IconsList, Label, LabelBox, LinearLoader, LinearSpinnerLock, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, _default as MDRenderer, Modal, ModalContext, NumberInput, Overlay, Pagination, Parameter, type ParameterObject, type ParameterPossibleValue, ParameterRender, type ParameterRenderer, type ParameterRendererProps, type ParameterType, Parameters, type ParametersDefinition, ParametersGroup, type ParametersGroupRenderer, ParametersStore, ParametersTable, type Payload, Permissions, ProgressBar, RequiredMark, ScreenLocker, ShowResponsive, SimpleButton, SortableList, SortableListItem, SwitchCard, SwitchMultiple, type SwitchMultipleOption, type TAccordionHandler, type TAccordionItemButton, type TApiaButtonType, type TApiaIconButton, type TCheckbox, type TCheckboxLabel, type TCssProps, type TDateProps, type TFieldLabel, type TFilterOp, type TFilterPayload, type TFilterType, type TFilterValue, type TFilterValueType, type TGetTabsController, type TIcon, type TIconButton, type TIconRenderer, type TIconSize, type TIconsList, type TListbox, type TMenuItem, type TModal, type TModalSize, type TNumberInput, type TNumberInputChangeEvent, type TOnClickNode, type TOnConfirmSelection, type TOnSelectionChange, type TOpenModal, type TParameterType, type TPickPoolForPermissions, type TPickUserForPermissions, type TSubmenu, type TTab, type TTabLabelRenderer as TTabRenderer, type TToolbarIconButton as TToolDefinition, type TTooltip, type TUploadHandlerProps, type TUploadInProgress, type TUploadedFile, type TUseModalConfiguration, type TVisualizationType, Tab, Tabs, TabsContent, TabsController, TabsList, Templater, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, UnstyledSortableList, UploadHandler, Uploader, WaiTypeAhead, getFieldErrorStyles, getFieldTouchedStyles, importComponent, isFavoriteIcon, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
|
|
2602
2635
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { uniqueId as uniqueId$3, cloneDeep, isFunction as isFunction$1 } from 'l
|
|
|
7
7
|
import { Box, getVariant, useBreakpointIndex, Close, responsive, spacing, Heading, Link, Button, Spinner, createElement, Select, Input, Flex, IconButton as IconButton$1, Image, injectStyles, focusOutline, makeStyledComponent, useThemeUI, Label as Label$1, Progress, Grid, Paragraph, Container, Switch, Textarea } from '@apia/theme';
|
|
8
8
|
import { BarLoader } from 'react-spinners';
|
|
9
9
|
import uniqueId$2 from 'lodash-es/uniqueId';
|
|
10
|
-
import { findScrollContainer, useUpdateEffect, focus, focusSelector, getFocusSelector, addBoundary, useCombinedRefs, usePrevious, getLabel, isChild, EventEmitter, useUnmount, useMount, StatefulEmitter, shallowEqual as shallowEqual$1, getSpecificParent, uniqueId as uniqueId$4, getDateFormat, customEvents, persistentStorage, disableChildrenFocus, enableChildrenFocus, decodeHTMLEntities, useDebouncedCallback, getIndex, noNaN, useLatest, useSubscription, toBoolean, useMatchScrollDirection, arrayOrArray } from '@apia/util';
|
|
10
|
+
import { findScrollContainer, useUpdateEffect, focus, focusSelector, getFocusSelector, addBoundary, useCombinedRefs, usePrevious, getLabel, isChild, EventEmitter, useUnmount, useMount, StatefulEmitter, shallowEqual as shallowEqual$1, getSpecificParent, getLabelTooltip, getLabelName, uniqueId as uniqueId$4, getDateFormat, customEvents, persistentStorage, disableChildrenFocus, enableChildrenFocus, decodeHTMLEntities, useDebouncedCallback, getIndex, noNaN, useLatest, useSubscription, toBoolean, useMatchScrollDirection, arrayOrArray } from '@apia/util';
|
|
11
11
|
import usePortal from 'react-cool-portal';
|
|
12
12
|
import { CSSTransition } from 'react-transition-group';
|
|
13
13
|
import { uniqueId as uniqueId$1, defaultNotifier, NotificationsList } from '@apia/notifications';
|
|
@@ -17,6 +17,7 @@ import { makeObservable, observable, makeAutoObservable, reaction, isObservable,
|
|
|
17
17
|
import { observer } from 'mobx-react-lite';
|
|
18
18
|
import { Icon as Icon$1, icons, FileIcon, isIconName } from '@apia/icons';
|
|
19
19
|
import { MenuDivider, SubMenu, MenuItem, ControlledMenu, useMenuState } from '@szhsin/react-menu';
|
|
20
|
+
import axios from 'axios';
|
|
20
21
|
import { shallowEqual } from '@apia/store';
|
|
21
22
|
import AnimateHeight from 'react-animate-height';
|
|
22
23
|
import { useUpdateEffect as useUpdateEffect$1, useScroll } from 'ahooks';
|
|
@@ -1884,7 +1885,8 @@ const Confirm = ({
|
|
|
1884
1885
|
isLoading,
|
|
1885
1886
|
onCancel,
|
|
1886
1887
|
onConfirm,
|
|
1887
|
-
variant
|
|
1888
|
+
variant,
|
|
1889
|
+
htmlContent
|
|
1888
1890
|
}) => {
|
|
1889
1891
|
const { descriptionId } = useModalContext();
|
|
1890
1892
|
const showsCancelButton = onCancel && !hideCancelButton;
|
|
@@ -1901,7 +1903,7 @@ const Confirm = ({
|
|
|
1901
1903
|
...getVariant(variant ?? "layout.common.modals.confirm"),
|
|
1902
1904
|
className: `${className ?? ""} confirm`,
|
|
1903
1905
|
children: [
|
|
1904
|
-
/* @__PURE__ */ jsx(Box, { ref: contentRef, className: "confirm__content", id: descriptionId, children }),
|
|
1906
|
+
/* @__PURE__ */ jsx(Box, { ref: contentRef, className: "confirm__content", id: descriptionId, children: htmlContent ? /* @__PURE__ */ jsx(Box, { dangerouslySetInnerHTML: { __html: htmlContent } }) : children }),
|
|
1905
1907
|
/* @__PURE__ */ jsxs(DialogButtonBar, { className: "confirm__buttonBar", children: [
|
|
1906
1908
|
/* @__PURE__ */ jsx(
|
|
1907
1909
|
Box,
|
|
@@ -3488,8 +3490,8 @@ _timeout = new WeakMap();
|
|
|
3488
3490
|
const SearchBox = observer((props) => {
|
|
3489
3491
|
const handler = useAutocompleteContext();
|
|
3490
3492
|
const breakpoint = useBreakpointIndex();
|
|
3491
|
-
const
|
|
3492
|
-
return /* @__PURE__ */ jsxs(Box, { className: "autocomplete__inputWrapper", children: [
|
|
3493
|
+
const boxRef = useRef(null);
|
|
3494
|
+
return /* @__PURE__ */ jsxs(Box, { className: "autocomplete__inputWrapper", ref: boxRef, children: [
|
|
3493
3495
|
/* @__PURE__ */ jsx(
|
|
3494
3496
|
"input",
|
|
3495
3497
|
{
|
|
@@ -3507,41 +3509,50 @@ const SearchBox = observer((props) => {
|
|
|
3507
3509
|
},
|
|
3508
3510
|
children: handler.state.options.map((c) => /* @__PURE__ */ jsx("option", { value: c.value, children: c.label }, c.value))
|
|
3509
3511
|
}
|
|
3510
|
-
) : /* @__PURE__ */ jsxs(
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
{
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3512
|
+
) : /* @__PURE__ */ jsxs(
|
|
3513
|
+
Box,
|
|
3514
|
+
{
|
|
3515
|
+
sx: { display: "flex", flexDirection: "row", alignItems: "center" },
|
|
3516
|
+
onClick: () => {
|
|
3517
|
+
handler.state.width = boxRef.current?.getBoundingClientRect().width ?? handler.state.width;
|
|
3518
|
+
handler.toggleOpen();
|
|
3519
|
+
},
|
|
3520
|
+
children: [
|
|
3521
|
+
/* @__PURE__ */ jsx(
|
|
3522
|
+
Input,
|
|
3523
|
+
{
|
|
3524
|
+
...props,
|
|
3525
|
+
className: `autocomplete__search ${handler.state.disabled ? "disabled" : ""} ${handler.state.readOnly ? "readOnly" : ""}`,
|
|
3526
|
+
onChange: async (ev) => {
|
|
3527
|
+
handler.search(ev.target.value);
|
|
3528
|
+
},
|
|
3529
|
+
onClick: () => {
|
|
3530
|
+
handler.state.width = boxRef.current?.getBoundingClientRect().width ?? handler.state.width;
|
|
3531
|
+
handler.toggleOpen();
|
|
3532
|
+
},
|
|
3533
|
+
onFocus: (ev) => {
|
|
3534
|
+
ev.target.setSelectionRange(0, ev.target.value.length);
|
|
3535
|
+
},
|
|
3536
|
+
onBlur: () => {
|
|
3537
|
+
handler.close();
|
|
3538
|
+
},
|
|
3539
|
+
value: handler.state.showValue
|
|
3540
|
+
}
|
|
3541
|
+
),
|
|
3542
|
+
/* @__PURE__ */ jsxs(Box, { className: "autocomplete__icons", children: [
|
|
3543
|
+
handler.state.loading && /* @__PURE__ */ jsx(Spinner, { className: "autocomplete__loadingSpinner" }),
|
|
3544
|
+
/* @__PURE__ */ jsx(
|
|
3545
|
+
Icon$1,
|
|
3546
|
+
{
|
|
3547
|
+
title: "",
|
|
3548
|
+
name: handler.state?.icon || "ArrowDown",
|
|
3549
|
+
className: "autocomplete__downArrow"
|
|
3550
|
+
}
|
|
3551
|
+
)
|
|
3552
|
+
] })
|
|
3553
|
+
]
|
|
3554
|
+
}
|
|
3555
|
+
)
|
|
3545
3556
|
] });
|
|
3546
3557
|
});
|
|
3547
3558
|
|
|
@@ -3651,15 +3662,25 @@ const AutogrowTextarea = observer(
|
|
|
3651
3662
|
const bounding = el.getBoundingClientRect();
|
|
3652
3663
|
if (bounding.width > 0) {
|
|
3653
3664
|
clearInterval(interval);
|
|
3665
|
+
const style = window.getComputedStyle(el);
|
|
3654
3666
|
const copy = el.cloneNode(true);
|
|
3655
|
-
copy.style.
|
|
3667
|
+
copy.style.boxSizing = style.boxSizing;
|
|
3668
|
+
copy.style.padding = style.padding;
|
|
3669
|
+
copy.style.border = style.border;
|
|
3670
|
+
copy.style.lineHeight = style.lineHeight;
|
|
3671
|
+
copy.style.font = style.font;
|
|
3672
|
+
copy.style.whiteSpace = style.whiteSpace;
|
|
3656
3673
|
copy.style.position = "fixed";
|
|
3657
3674
|
copy.style.left = "-9999px";
|
|
3658
|
-
copy.style.
|
|
3659
|
-
copy.style.height = "
|
|
3675
|
+
copy.style.top = "0";
|
|
3676
|
+
copy.style.height = "auto";
|
|
3677
|
+
copy.style.opacity = "0";
|
|
3678
|
+
copy.style.overflow = "hidden";
|
|
3679
|
+
copy.style.width = `${el.clientWidth}px`;
|
|
3660
3680
|
document.body.append(copy);
|
|
3661
|
-
|
|
3681
|
+
const height = copy.scrollHeight;
|
|
3662
3682
|
copy.remove();
|
|
3683
|
+
el.style.height = `${height + 5}px`;
|
|
3663
3684
|
}
|
|
3664
3685
|
};
|
|
3665
3686
|
const interval = setInterval(update, 100);
|
|
@@ -4019,6 +4040,93 @@ const Checkbox$1 = forwardRef(
|
|
|
4019
4040
|
);
|
|
4020
4041
|
Checkbox$1.displayName = "Checkbox";
|
|
4021
4042
|
|
|
4043
|
+
const RequiredMark = ({
|
|
4044
|
+
isFormReadonly = false,
|
|
4045
|
+
isRequired = false,
|
|
4046
|
+
isReadonly = false,
|
|
4047
|
+
sx,
|
|
4048
|
+
style,
|
|
4049
|
+
...rest
|
|
4050
|
+
}) => {
|
|
4051
|
+
const mergedSx = {
|
|
4052
|
+
color: "palette.error.main",
|
|
4053
|
+
fontWeight: "bold",
|
|
4054
|
+
...sx ?? style ?? {}
|
|
4055
|
+
};
|
|
4056
|
+
if (!isRequired || isReadonly || isFormReadonly)
|
|
4057
|
+
return null;
|
|
4058
|
+
return /* @__PURE__ */ jsx(
|
|
4059
|
+
Box,
|
|
4060
|
+
{
|
|
4061
|
+
as: "span",
|
|
4062
|
+
sx: mergedSx,
|
|
4063
|
+
className: "requiredMark",
|
|
4064
|
+
title: getLabel("msgReqField").text,
|
|
4065
|
+
...rest,
|
|
4066
|
+
children: "*"
|
|
4067
|
+
}
|
|
4068
|
+
);
|
|
4069
|
+
};
|
|
4070
|
+
|
|
4071
|
+
injectStyles("layout.common.components.checkboxLabel", {
|
|
4072
|
+
display: "flex",
|
|
4073
|
+
flexDirection: "column",
|
|
4074
|
+
gap: 1,
|
|
4075
|
+
".checkboxLabel__label": {
|
|
4076
|
+
fontWeight: "bold"
|
|
4077
|
+
}
|
|
4078
|
+
});
|
|
4079
|
+
const CheckboxLabel = forwardRef(
|
|
4080
|
+
({
|
|
4081
|
+
as,
|
|
4082
|
+
children,
|
|
4083
|
+
error,
|
|
4084
|
+
hideRequiredMark,
|
|
4085
|
+
label,
|
|
4086
|
+
required,
|
|
4087
|
+
requiredMarkPosition = "after",
|
|
4088
|
+
...props
|
|
4089
|
+
}, ref) => {
|
|
4090
|
+
return /* @__PURE__ */ jsxs(
|
|
4091
|
+
Box,
|
|
4092
|
+
{
|
|
4093
|
+
as: as ?? "label",
|
|
4094
|
+
...props,
|
|
4095
|
+
className: `checkboxLabel ${props.className ?? ""} ${error ? "field__withError" : ""}`,
|
|
4096
|
+
...getVariant("layout.common.components.checkboxLabel"),
|
|
4097
|
+
"aria-label": props["aria-label"] ?? getLabelTooltip(label),
|
|
4098
|
+
ref,
|
|
4099
|
+
children: [
|
|
4100
|
+
/* @__PURE__ */ jsxs(Box, { className: "label_row", children: [
|
|
4101
|
+
children,
|
|
4102
|
+
/* @__PURE__ */ jsxs(Box, { className: `checkboxLabel__label`, children: [
|
|
4103
|
+
requiredMarkPosition === "before" && /* @__PURE__ */ jsx(
|
|
4104
|
+
RequiredMark,
|
|
4105
|
+
{
|
|
4106
|
+
isRequired: required,
|
|
4107
|
+
isReadonly: hideRequiredMark,
|
|
4108
|
+
isFormReadonly: hideRequiredMark
|
|
4109
|
+
}
|
|
4110
|
+
),
|
|
4111
|
+
getLabelName(label),
|
|
4112
|
+
requiredMarkPosition === "after" && /* @__PURE__ */ jsx(
|
|
4113
|
+
RequiredMark,
|
|
4114
|
+
{
|
|
4115
|
+
isRequired: required,
|
|
4116
|
+
isReadonly: hideRequiredMark,
|
|
4117
|
+
isFormReadonly: hideRequiredMark
|
|
4118
|
+
}
|
|
4119
|
+
)
|
|
4120
|
+
] })
|
|
4121
|
+
] }),
|
|
4122
|
+
error && /* @__PURE__ */ jsx(Box, { className: "checkboxLabel__error", children: error })
|
|
4123
|
+
]
|
|
4124
|
+
}
|
|
4125
|
+
);
|
|
4126
|
+
}
|
|
4127
|
+
);
|
|
4128
|
+
CheckboxLabel.displayName = "CheckboxLabel";
|
|
4129
|
+
|
|
4022
4130
|
const IconInput = ({
|
|
4023
4131
|
additionalButtons,
|
|
4024
4132
|
additionalButtonsPosition = "before",
|
|
@@ -4528,34 +4636,6 @@ const NumberInput = React__default.forwardRef(
|
|
|
4528
4636
|
}
|
|
4529
4637
|
);
|
|
4530
4638
|
|
|
4531
|
-
const RequiredMark = ({
|
|
4532
|
-
isFormReadonly = false,
|
|
4533
|
-
isRequired = false,
|
|
4534
|
-
isReadonly = false,
|
|
4535
|
-
sx,
|
|
4536
|
-
style,
|
|
4537
|
-
...rest
|
|
4538
|
-
}) => {
|
|
4539
|
-
const mergedSx = {
|
|
4540
|
-
color: "palette.error.main",
|
|
4541
|
-
fontWeight: "bold",
|
|
4542
|
-
...sx ?? style ?? {}
|
|
4543
|
-
};
|
|
4544
|
-
if (!isRequired || isReadonly || isFormReadonly)
|
|
4545
|
-
return null;
|
|
4546
|
-
return /* @__PURE__ */ jsx(
|
|
4547
|
-
Box,
|
|
4548
|
-
{
|
|
4549
|
-
as: "span",
|
|
4550
|
-
sx: mergedSx,
|
|
4551
|
-
className: "requiredMark",
|
|
4552
|
-
title: getLabel("msgReqField").text,
|
|
4553
|
-
...rest,
|
|
4554
|
-
children: "*"
|
|
4555
|
-
}
|
|
4556
|
-
);
|
|
4557
|
-
};
|
|
4558
|
-
|
|
4559
4639
|
const getFieldErrorStyles = (isValid) => {
|
|
4560
4640
|
return {
|
|
4561
4641
|
borderLeftStyle: !isValid ? "solid" : null,
|
|
@@ -4598,7 +4678,7 @@ const FieldLabel = forwardRef(
|
|
|
4598
4678
|
...props,
|
|
4599
4679
|
className: `fieldLabel ${props.className ?? ""}`,
|
|
4600
4680
|
...getVariant("layout.common.components.fieldLabel"),
|
|
4601
|
-
"aria-label": props["aria-label"] ?? label,
|
|
4681
|
+
"aria-label": props["aria-label"] ?? getLabelTooltip(label),
|
|
4602
4682
|
ref,
|
|
4603
4683
|
children: [
|
|
4604
4684
|
/* @__PURE__ */ jsxs(Box, { className: "fieldLabel__label", children: [
|
|
@@ -4610,7 +4690,7 @@ const FieldLabel = forwardRef(
|
|
|
4610
4690
|
isFormReadonly: hideRequiredMark
|
|
4611
4691
|
}
|
|
4612
4692
|
),
|
|
4613
|
-
label,
|
|
4693
|
+
getLabelName(label),
|
|
4614
4694
|
requiredMarkPosition === "after" && /* @__PURE__ */ jsx(
|
|
4615
4695
|
RequiredMark,
|
|
4616
4696
|
{
|
|
@@ -4630,6 +4710,39 @@ const FieldLabel = forwardRef(
|
|
|
4630
4710
|
);
|
|
4631
4711
|
FieldLabel.displayName = "FieldLabel";
|
|
4632
4712
|
|
|
4713
|
+
const SwitchMultiple = observer(
|
|
4714
|
+
({
|
|
4715
|
+
options,
|
|
4716
|
+
defaultValue,
|
|
4717
|
+
value,
|
|
4718
|
+
onChange,
|
|
4719
|
+
variant
|
|
4720
|
+
}) => {
|
|
4721
|
+
const actualValue = value ?? defaultValue;
|
|
4722
|
+
return /* @__PURE__ */ jsx(
|
|
4723
|
+
Box,
|
|
4724
|
+
{
|
|
4725
|
+
...getVariant(variant ?? "layout.validations.fields.switchMultiple"),
|
|
4726
|
+
children: options.map((o, idx) => {
|
|
4727
|
+
const active = actualValue === o.value;
|
|
4728
|
+
return /* @__PURE__ */ jsx(
|
|
4729
|
+
Button,
|
|
4730
|
+
{
|
|
4731
|
+
className: `switchButton ${active ? "active" : ""} ${idx === 0 ? "first" : idx === options.length - 1 ? "last" : "middle"}`,
|
|
4732
|
+
type: "button",
|
|
4733
|
+
onClick: () => {
|
|
4734
|
+
onChange(o.value);
|
|
4735
|
+
},
|
|
4736
|
+
children: o.label
|
|
4737
|
+
},
|
|
4738
|
+
o.value
|
|
4739
|
+
);
|
|
4740
|
+
})
|
|
4741
|
+
}
|
|
4742
|
+
);
|
|
4743
|
+
}
|
|
4744
|
+
);
|
|
4745
|
+
|
|
4633
4746
|
const Checkbox = (props) => {
|
|
4634
4747
|
return /* @__PURE__ */ jsx(
|
|
4635
4748
|
Box,
|
|
@@ -4929,6 +5042,7 @@ const DefaultAccordionItemButton = (props) => {
|
|
|
4929
5042
|
}
|
|
4930
5043
|
),
|
|
4931
5044
|
(props.label ?? props.title ?? props.ariaLabel).split(" | ").map((content, i) => {
|
|
5045
|
+
console.log(props, content, i);
|
|
4932
5046
|
if (typeof props.isHtml === "boolean" && props.isHtml || Array.isArray(props.isHtml) && props.isHtml[i]) {
|
|
4933
5047
|
return /* @__PURE__ */ jsx(
|
|
4934
5048
|
Box,
|
|
@@ -9566,6 +9680,9 @@ class TabsController {
|
|
|
9566
9680
|
if (tab && tabProps) {
|
|
9567
9681
|
if (!tabProps.isClosable && !force)
|
|
9568
9682
|
return false;
|
|
9683
|
+
await axios.post(
|
|
9684
|
+
window.CONTEXT + "/apia.splash.MenuAction.run?action=removeTab&isAjax=true&tabId=" + tabId + window.TAB_ID_REQUEST
|
|
9685
|
+
);
|
|
9569
9686
|
const { onBeforeClose } = tabProps;
|
|
9570
9687
|
if (onBeforeClose) {
|
|
9571
9688
|
const canClose = await onBeforeClose();
|
|
@@ -11360,5 +11477,5 @@ const _FiltersStore = class _FiltersStore {
|
|
|
11360
11477
|
__publicField(_FiltersStore, "instance", new _FiltersStore());
|
|
11361
11478
|
let FiltersStore = _FiltersStore;
|
|
11362
11479
|
|
|
11363
|
-
export { Accordion, AccordionAside, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, Aside, AsideLoader, AsidePanel, AutoEllipsis, Autocomplete, AutocompleteController, AutogrowTextarea, BaseButton, BodyAside, CalendarModal, Captcha, CenteredHeaderButtons, Checkbox$1 as Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DeadSessionModal, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FavoriteIcon, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingAside, FooterButtons, FooterResponsiveButtons, HamburguerMenu, Header, HeaderButtons, IconButton, IconInput, IconsList, Label, LabelBox, LinearLoader, LinearSpinnerLock, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, index as MDRenderer, Modal, ModalContext, NumberInput, Overlay, Pagination, Parameter, ParameterRender, Parameters, ParametersGroup, ParametersStore, ParametersTable, Permissions, ProgressBar, RequiredMark, ScreenLocker, ShowResponsive, SimpleButton, SortableList, SortableListItem, SwitchCard, Tab, Tabs, TabsContent, TabsController, TabsList, Templater, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, UnstyledSortableList, UploadHandler, Uploader, WaiTypeAhead, getFieldErrorStyles, getFieldTouchedStyles, importComponent, isFavoriteIcon, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
|
|
11480
|
+
export { Accordion, AccordionAside, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, Aside, AsideLoader, AsidePanel, AutoEllipsis, Autocomplete, AutocompleteController, AutogrowTextarea, BaseButton, BodyAside, CalendarModal, Captcha, CenteredHeaderButtons, Checkbox$1 as Checkbox, CheckboxLabel, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DeadSessionModal, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FavoriteIcon, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingAside, FooterButtons, FooterResponsiveButtons, HamburguerMenu, Header, HeaderButtons, IconButton, IconInput, IconsList, Label, LabelBox, LinearLoader, LinearSpinnerLock, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, index as MDRenderer, Modal, ModalContext, NumberInput, Overlay, Pagination, Parameter, ParameterRender, Parameters, ParametersGroup, ParametersStore, ParametersTable, Permissions, ProgressBar, RequiredMark, ScreenLocker, ShowResponsive, SimpleButton, SortableList, SortableListItem, SwitchCard, SwitchMultiple, Tab, Tabs, TabsContent, TabsController, TabsList, Templater, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, UnstyledSortableList, UploadHandler, Uploader, WaiTypeAhead, getFieldErrorStyles, getFieldTouchedStyles, importComponent, isFavoriteIcon, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
|
|
11364
11481
|
//# sourceMappingURL=index.js.map
|