@apia/components 4.0.42 → 4.0.43
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 +2 -1
- package/dist/index.js +33 -8
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -1617,6 +1617,7 @@ type TModalContext = {
|
|
|
1617
1617
|
close: () => unknown;
|
|
1618
1618
|
descriptionId: string;
|
|
1619
1619
|
};
|
|
1620
|
+
declare const ModalContext: React$1.Context<TModalContext | null>;
|
|
1620
1621
|
declare function useModalContext(): TModalContext;
|
|
1621
1622
|
|
|
1622
1623
|
interface ICalendarModal extends TModal {
|
|
@@ -2684,5 +2685,5 @@ declare class Templater {
|
|
|
2684
2685
|
parseString(content: string, options?: IAlterDefaultOptions): string | JSX.Element | JSX.Element[];
|
|
2685
2686
|
}
|
|
2686
2687
|
|
|
2687
|
-
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, AutoscrollContainer, BaseButton, BodyAside, CalendarModal, Captcha, CenteredHeaderButtons, ChatController, ChatMessage, Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DeadSessionModal, DefaultAccordionItemButton, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FavoriteIcon, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingAside, FloatingChatController, FooterButtons, FooterResponsiveButtons, HamburguerMenu, Header, HeaderButtons, type IAccordionItemButton, type IAccordionItemProps, type IAccordionProps, type IAlert, type IApiaFilter, type IAsidePanel, type IAttachment, 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, _default$2 as MessageBlock, _default$1 as MessageBlocks, type MessageCallbackProps, type MessageSubmitCallback, Modal, 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, ProgressBar, RequiredMark, ScreenLocker, ShowResponsive, SimpleButton, SortableList, SortableListItem, type TAccordionHandler, type TAccordionItemButton, type TApiaButtonType, type TApiaIconButton, type TChatControllerState, type TCheckbox, type TComponentRender, 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 TMessageType, type TModal, type TModalSize, type TNumberInput, type TNumberInputChangeEvent, type TOnClickNode, type TOnConfirmSelection, type TOnSelectionChange, type TOpenModal, type TParameterType, 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, getBase64FromBlob, getBase64FromFile, getFieldErrorStyles, getFieldTouchedStyles, getFileExtension, importComponent, isFavoriteIcon, isImage, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
|
|
2688
|
+
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, AutoscrollContainer, BaseButton, BodyAside, CalendarModal, Captcha, CenteredHeaderButtons, ChatController, ChatMessage, Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DeadSessionModal, DefaultAccordionItemButton, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FavoriteIcon, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingAside, FloatingChatController, FooterButtons, FooterResponsiveButtons, HamburguerMenu, Header, HeaderButtons, type IAccordionItemButton, type IAccordionItemProps, type IAccordionProps, type IAlert, type IApiaFilter, type IAsidePanel, type IAttachment, 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, _default$2 as MessageBlock, _default$1 as MessageBlocks, type MessageCallbackProps, type MessageSubmitCallback, 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, ProgressBar, RequiredMark, ScreenLocker, ShowResponsive, SimpleButton, SortableList, SortableListItem, type TAccordionHandler, type TAccordionItemButton, type TApiaButtonType, type TApiaIconButton, type TChatControllerState, type TCheckbox, type TComponentRender, 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 TMessageType, type TModal, type TModalSize, type TNumberInput, type TNumberInputChangeEvent, type TOnClickNode, type TOnConfirmSelection, type TOnSelectionChange, type TOpenModal, type TParameterType, 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, getBase64FromBlob, getBase64FromFile, getFieldErrorStyles, getFieldTouchedStyles, getFileExtension, importComponent, isFavoriteIcon, isImage, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
|
|
2688
2689
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -930,6 +930,8 @@ const WindowModal = forwardRef(
|
|
|
930
930
|
const handleMouseDown = (ev) => {
|
|
931
931
|
if (ev.target.closest?.(
|
|
932
932
|
'[draggable="true"]'
|
|
933
|
+
) || !ev.target.closest?.(
|
|
934
|
+
".modal__header"
|
|
933
935
|
))
|
|
934
936
|
return;
|
|
935
937
|
if (ev.target.closest(
|
|
@@ -985,7 +987,7 @@ const WindowModal = forwardRef(
|
|
|
985
987
|
};
|
|
986
988
|
}
|
|
987
989
|
},
|
|
988
|
-
[onDragStart, setStyle]
|
|
990
|
+
[dragBounded, onDragStart, setStyle]
|
|
989
991
|
),
|
|
990
992
|
children: [
|
|
991
993
|
!noHeader && /* @__PURE__ */ jsx(
|
|
@@ -1180,6 +1182,7 @@ const Overlay = React.forwardRef(
|
|
|
1180
1182
|
);
|
|
1181
1183
|
Overlay.displayName = "Overlay";
|
|
1182
1184
|
|
|
1185
|
+
let canCloseOnClick = true;
|
|
1183
1186
|
const StaticModal = forwardRef(
|
|
1184
1187
|
({
|
|
1185
1188
|
animationDuration = 150,
|
|
@@ -1234,11 +1237,12 @@ const StaticModal = forwardRef(
|
|
|
1234
1237
|
}
|
|
1235
1238
|
);
|
|
1236
1239
|
const overlayClickedHandle = (event) => {
|
|
1237
|
-
if (shouldCloseOnOverlayClick) {
|
|
1240
|
+
if (shouldCloseOnOverlayClick && canCloseOnClick) {
|
|
1238
1241
|
if (event.target.getAttribute("data-type") === "overlay") {
|
|
1239
1242
|
closeHandler();
|
|
1240
1243
|
}
|
|
1241
1244
|
}
|
|
1245
|
+
canCloseOnClick = true;
|
|
1242
1246
|
};
|
|
1243
1247
|
useEscapeKey({ closeHandler, id: innerId, isOpenInner, shouldCloseOnEsc });
|
|
1244
1248
|
useInitialFocus({
|
|
@@ -1253,6 +1257,8 @@ const StaticModal = forwardRef(
|
|
|
1253
1257
|
return Portal ?? React__default.Fragment;
|
|
1254
1258
|
}, []);
|
|
1255
1259
|
const nodeRef = useRef(null);
|
|
1260
|
+
const uns = useRef(() => {
|
|
1261
|
+
});
|
|
1256
1262
|
return /* @__PURE__ */ jsx(
|
|
1257
1263
|
ModalContext.Provider,
|
|
1258
1264
|
{
|
|
@@ -1290,7 +1296,17 @@ const StaticModal = forwardRef(
|
|
|
1290
1296
|
children: /* @__PURE__ */ jsx(
|
|
1291
1297
|
Box,
|
|
1292
1298
|
{
|
|
1293
|
-
ref:
|
|
1299
|
+
ref: (el) => {
|
|
1300
|
+
nodeRef.current = el;
|
|
1301
|
+
uns.current();
|
|
1302
|
+
if (el) {
|
|
1303
|
+
const handleMouseDown = () => {
|
|
1304
|
+
canCloseOnClick = false;
|
|
1305
|
+
};
|
|
1306
|
+
el.addEventListener("mousedown", handleMouseDown);
|
|
1307
|
+
uns.current = () => el.removeEventListener("mousedown", handleMouseDown);
|
|
1308
|
+
}
|
|
1309
|
+
},
|
|
1294
1310
|
className: "modal__variantWrapper",
|
|
1295
1311
|
...variant ? getVariant(variant) : {},
|
|
1296
1312
|
children: /* @__PURE__ */ jsxs(
|
|
@@ -1444,7 +1460,7 @@ var __privateWrapper$2 = (obj, member, setter, getter) => ({
|
|
|
1444
1460
|
return __privateGet$9(obj, member, getter);
|
|
1445
1461
|
}
|
|
1446
1462
|
});
|
|
1447
|
-
var _maxId$1, _maxOverlay;
|
|
1463
|
+
var _maxId$1, _maxOverlay, _innerClose;
|
|
1448
1464
|
class ApiaUtilModalHandler {
|
|
1449
1465
|
constructor(close) {
|
|
1450
1466
|
this.close = close;
|
|
@@ -1456,6 +1472,9 @@ class ApiaUtilModals {
|
|
|
1456
1472
|
__publicField$q(this, "modals", []);
|
|
1457
1473
|
__privateAdd$c(this, _maxId$1, 0);
|
|
1458
1474
|
__privateAdd$c(this, _maxOverlay, 0);
|
|
1475
|
+
__privateAdd$c(this, _innerClose, (id) => {
|
|
1476
|
+
this.modals = this.modals.filter((s) => s.id !== id);
|
|
1477
|
+
});
|
|
1459
1478
|
__publicField$q(this, "Component", observer(() => {
|
|
1460
1479
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1461
1480
|
this.modals.map((current) => /* @__PURE__ */ jsx(OpenModal, { ...current }, current.id)),
|
|
@@ -1472,7 +1491,12 @@ class ApiaUtilModals {
|
|
|
1472
1491
|
});
|
|
1473
1492
|
}
|
|
1474
1493
|
close(id) {
|
|
1475
|
-
|
|
1494
|
+
const modal = this.modals.find((s) => s.id === id);
|
|
1495
|
+
if (modal) {
|
|
1496
|
+
modal.onClose?.();
|
|
1497
|
+
modal.onExited?.();
|
|
1498
|
+
}
|
|
1499
|
+
__privateGet$9(this, _innerClose).call(this, id);
|
|
1476
1500
|
}
|
|
1477
1501
|
open(props) {
|
|
1478
1502
|
const id = props.id ?? `modal_${__privateWrapper$2(this, _maxId$1)._++}`;
|
|
@@ -1483,7 +1507,7 @@ class ApiaUtilModals {
|
|
|
1483
1507
|
onClose: props.onClose,
|
|
1484
1508
|
onExited: () => {
|
|
1485
1509
|
props.onExited?.();
|
|
1486
|
-
this.
|
|
1510
|
+
__privateGet$9(this, _innerClose).call(this, id);
|
|
1487
1511
|
}
|
|
1488
1512
|
});
|
|
1489
1513
|
return new ApiaUtilModalHandler(() => {
|
|
@@ -1531,6 +1555,7 @@ class ApiaUtilModals {
|
|
|
1531
1555
|
}
|
|
1532
1556
|
_maxId$1 = new WeakMap();
|
|
1533
1557
|
_maxOverlay = new WeakMap();
|
|
1558
|
+
_innerClose = new WeakMap();
|
|
1534
1559
|
|
|
1535
1560
|
var __defProp$p = Object.defineProperty;
|
|
1536
1561
|
var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -6343,7 +6368,7 @@ const FileAttachment = observer(
|
|
|
6343
6368
|
collector.add(
|
|
6344
6369
|
new collector.fields.textarea(
|
|
6345
6370
|
"desc",
|
|
6346
|
-
getLabel("
|
|
6371
|
+
getLabel("lblDes").text,
|
|
6347
6372
|
{ initialValue: attachment.description }
|
|
6348
6373
|
)
|
|
6349
6374
|
);
|
|
@@ -12017,5 +12042,5 @@ const _FiltersStore = class _FiltersStore {
|
|
|
12017
12042
|
__publicField(_FiltersStore, "instance", new _FiltersStore());
|
|
12018
12043
|
let FiltersStore = _FiltersStore;
|
|
12019
12044
|
|
|
12020
|
-
export { Accordion, AccordionAside, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, Aside, AsideLoader, AsidePanel, AutoEllipsis, Autocomplete, AutocompleteController, AutogrowTextarea, AutoscrollContainer, BaseButton, BodyAside, CalendarModal, Captcha, CenteredHeaderButtons, ChatController, ChatMessage, Checkbox$1 as Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DeadSessionModal, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FavoriteIcon, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingAside, FloatingChatController, FooterButtons, FooterResponsiveButtons, HamburguerMenu, Header, HeaderButtons, IconButton, IconInput, IconsList, Label, LabelBox, LinearLoader, LinearSpinnerLock, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, MDRenderer$1 as MDRenderer, MessageBlock$1 as MessageBlock, MessageBlocks$1 as MessageBlocks, Modal, NumberInput, Overlay, Pagination, Parameter, ParameterRender, Parameters, ParametersGroup, ParametersStore, ParametersTable, ProgressBar, RequiredMark, ScreenLocker, ShowResponsive, SimpleButton, SortableList, SortableListItem, Tab, Tabs, TabsContent, TabsController, TabsList, Templater, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, UnstyledSortableList, UploadHandler, Uploader, WaiTypeAhead, getBase64FromBlob, getBase64FromFile, getFieldErrorStyles, getFieldTouchedStyles, getFileExtension, importComponent, isFavoriteIcon, isImage, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
|
|
12045
|
+
export { Accordion, AccordionAside, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, Aside, AsideLoader, AsidePanel, AutoEllipsis, Autocomplete, AutocompleteController, AutogrowTextarea, AutoscrollContainer, BaseButton, BodyAside, CalendarModal, Captcha, CenteredHeaderButtons, ChatController, ChatMessage, Checkbox$1 as Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DeadSessionModal, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FavoriteIcon, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingAside, FloatingChatController, FooterButtons, FooterResponsiveButtons, HamburguerMenu, Header, HeaderButtons, IconButton, IconInput, IconsList, Label, LabelBox, LinearLoader, LinearSpinnerLock, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, MDRenderer$1 as MDRenderer, MessageBlock$1 as MessageBlock, MessageBlocks$1 as MessageBlocks, Modal, ModalContext, NumberInput, Overlay, Pagination, Parameter, ParameterRender, Parameters, ParametersGroup, ParametersStore, ParametersTable, ProgressBar, RequiredMark, ScreenLocker, ShowResponsive, SimpleButton, SortableList, SortableListItem, Tab, Tabs, TabsContent, TabsController, TabsList, Templater, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, UnstyledSortableList, UploadHandler, Uploader, WaiTypeAhead, getBase64FromBlob, getBase64FromFile, getFieldErrorStyles, getFieldTouchedStyles, getFileExtension, importComponent, isFavoriteIcon, isImage, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
|
|
12021
12046
|
//# sourceMappingURL=index.js.map
|