@apia/components 4.0.19 → 4.0.24
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 +170 -92
- package/dist/index.js +725 -521
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -3,11 +3,11 @@ import * as React from 'react';
|
|
|
3
3
|
import React__default, { createContext, useContext, useEffect, useMemo, useState, useCallback, useRef, forwardRef, Fragment as Fragment$1, useDeferredValue, lazy, Suspense, useTransition, Children, memo, isValidElement, cloneElement } from 'react';
|
|
4
4
|
import parse, { domToReact, Element } from 'html-react-parser';
|
|
5
5
|
import { Spinner as Spinner$1, Box as Box$1 } from 'theme-ui';
|
|
6
|
-
import { uniqueId as uniqueId$3, debounce, cloneDeep, isFunction
|
|
6
|
+
import { uniqueId as uniqueId$3, debounce, cloneDeep, isFunction } from 'lodash-es';
|
|
7
7
|
import { Box, getVariant, useBreakpointIndex, Close, responsive, spacing, Heading, Button, Spinner, createElement, Select, Input, Flex, IconButton as IconButton$1, Image, injectStyles, Progress, Label, Paragraph, Container, Form, focusOutline, makeStyledComponent, useThemeUI, Grid, 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, EventEmitter, useMount, getLabel, getSpecificParent, customEvents, isChild, useUnmount, StatefulEmitter, shallowEqual as shallowEqual$1,
|
|
10
|
+
import { findScrollContainer, useUpdateEffect, focus, focusSelector, getFocusSelector, addBoundary, useCombinedRefs, usePrevious, EventEmitter, useMount, getLabel, getSpecificParent, customEvents, isChild, useUnmount, StatefulEmitter, shallowEqual as shallowEqual$1, getDateFormat, uniqueId as uniqueId$4, AudioRecorder, persistentStorage, disableChildrenFocus, enableChildrenFocus, decodeHTMLEntities, useDebouncedCallback, getIndex, noNaN, useLatest, useSubscription, 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';
|
|
@@ -20,12 +20,14 @@ import { useMenuState, ControlledMenu, MenuItem, MenuDivider, SubMenu } from '@s
|
|
|
20
20
|
import { shallowEqual } from '@apia/store';
|
|
21
21
|
import AnimateHeight from 'react-animate-height';
|
|
22
22
|
import { useUpdateEffect as useUpdateEffect$1 } from 'ahooks';
|
|
23
|
+
import { FaCalendarAlt } from '@meronex/icons/fa';
|
|
23
24
|
import dayjs from 'dayjs';
|
|
24
|
-
import
|
|
25
|
+
import Calendar from 'react-calendar';
|
|
25
26
|
import ReactInputMask from 'react-input-mask';
|
|
26
27
|
import { Collector } from '@apia/validations';
|
|
27
28
|
import { Remarkable } from 'remarkable';
|
|
28
29
|
import { IconButton as IconButton$2, ApiaUtil as ApiaUtil$1 } from '@apia/components';
|
|
30
|
+
import isFunction$1 from 'lodash-es/isFunction';
|
|
29
31
|
import { createFAsomeStore } from '@apia/dom-store';
|
|
30
32
|
import { keyframes } from '@emotion/react';
|
|
31
33
|
|
|
@@ -1021,68 +1023,68 @@ var __publicField$r = (obj, key, value) => {
|
|
|
1021
1023
|
__defNormalProp$r(obj, key + "" , value);
|
|
1022
1024
|
return value;
|
|
1023
1025
|
};
|
|
1024
|
-
var __accessCheck$
|
|
1026
|
+
var __accessCheck$c = (obj, member, msg) => {
|
|
1025
1027
|
if (!member.has(obj))
|
|
1026
1028
|
throw TypeError("Cannot " + msg);
|
|
1027
1029
|
};
|
|
1028
|
-
var __privateGet$
|
|
1029
|
-
__accessCheck$
|
|
1030
|
+
var __privateGet$9 = (obj, member, getter) => {
|
|
1031
|
+
__accessCheck$c(obj, member, "read from private field");
|
|
1030
1032
|
return getter ? getter.call(obj) : member.get(obj);
|
|
1031
1033
|
};
|
|
1032
|
-
var __privateAdd$
|
|
1034
|
+
var __privateAdd$c = (obj, member, value) => {
|
|
1033
1035
|
if (member.has(obj))
|
|
1034
1036
|
throw TypeError("Cannot add the same private member more than once");
|
|
1035
1037
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1036
1038
|
};
|
|
1037
|
-
var __privateSet$
|
|
1038
|
-
__accessCheck$
|
|
1039
|
+
var __privateSet$7 = (obj, member, value, setter) => {
|
|
1040
|
+
__accessCheck$c(obj, member, "write to private field");
|
|
1039
1041
|
member.set(obj, value);
|
|
1040
1042
|
return value;
|
|
1041
1043
|
};
|
|
1042
1044
|
var __privateMethod$3 = (obj, member, method) => {
|
|
1043
|
-
__accessCheck$
|
|
1045
|
+
__accessCheck$c(obj, member, "access private method");
|
|
1044
1046
|
return method;
|
|
1045
1047
|
};
|
|
1046
|
-
var _isLocked, _onChangeCb, _onDestroyCb, _evaluate, evaluate_fn, _a
|
|
1048
|
+
var _isLocked, _onChangeCb, _onDestroyCb, _evaluate, evaluate_fn, _a;
|
|
1047
1049
|
class BodyScrollLocker {
|
|
1048
1050
|
constructor() {
|
|
1049
|
-
__privateAdd$
|
|
1050
|
-
__privateAdd$
|
|
1051
|
+
__privateAdd$c(this, _isLocked, false);
|
|
1052
|
+
__privateAdd$c(this, _onChangeCb, () => {
|
|
1051
1053
|
});
|
|
1052
|
-
__privateAdd$
|
|
1054
|
+
__privateAdd$c(this, _onDestroyCb, () => {
|
|
1053
1055
|
});
|
|
1054
1056
|
}
|
|
1055
1057
|
get isLocked() {
|
|
1056
|
-
return __privateGet$
|
|
1058
|
+
return __privateGet$9(this, _isLocked);
|
|
1057
1059
|
}
|
|
1058
1060
|
destroy() {
|
|
1059
|
-
__privateGet$
|
|
1061
|
+
__privateGet$9(this, _onDestroyCb).call(this);
|
|
1060
1062
|
}
|
|
1061
1063
|
lock() {
|
|
1062
|
-
__privateSet$
|
|
1063
|
-
__privateGet$
|
|
1064
|
+
__privateSet$7(this, _isLocked, true);
|
|
1065
|
+
__privateGet$9(this, _onChangeCb).call(this);
|
|
1064
1066
|
}
|
|
1065
1067
|
unlock() {
|
|
1066
|
-
__privateSet$
|
|
1067
|
-
__privateGet$
|
|
1068
|
+
__privateSet$7(this, _isLocked, false);
|
|
1069
|
+
__privateGet$9(this, _onChangeCb).call(this);
|
|
1068
1070
|
}
|
|
1069
1071
|
onChange(cb) {
|
|
1070
|
-
__privateSet$
|
|
1071
|
-
return () => __privateSet$
|
|
1072
|
+
__privateSet$7(this, _onChangeCb, cb);
|
|
1073
|
+
return () => __privateSet$7(this, _onChangeCb, () => {
|
|
1072
1074
|
});
|
|
1073
1075
|
}
|
|
1074
1076
|
onDestroy(cb) {
|
|
1075
|
-
__privateSet$
|
|
1076
|
-
return () => __privateSet$
|
|
1077
|
+
__privateSet$7(this, _onDestroyCb, cb);
|
|
1078
|
+
return () => __privateSet$7(this, _onDestroyCb, () => {
|
|
1077
1079
|
});
|
|
1078
1080
|
}
|
|
1079
1081
|
}
|
|
1080
1082
|
_isLocked = new WeakMap();
|
|
1081
1083
|
_onChangeCb = new WeakMap();
|
|
1082
1084
|
_onDestroyCb = new WeakMap();
|
|
1083
|
-
const BodyScrollLock = new (_a
|
|
1085
|
+
const BodyScrollLock = new (_a = class {
|
|
1084
1086
|
constructor() {
|
|
1085
|
-
__privateAdd$
|
|
1087
|
+
__privateAdd$c(this, _evaluate);
|
|
1086
1088
|
__publicField$r(this, "lockers", []);
|
|
1087
1089
|
}
|
|
1088
1090
|
getLocker() {
|
|
@@ -1103,7 +1105,7 @@ const BodyScrollLock = new (_a$1 = class {
|
|
|
1103
1105
|
document.body.style.overflow = willLock ? "hidden" : "auto";
|
|
1104
1106
|
if (!(willLock && document.body.scrollHeight > document.body.clientHeight))
|
|
1105
1107
|
document.body.style.paddingRight = "0px";
|
|
1106
|
-
}, _a
|
|
1108
|
+
}, _a)();
|
|
1107
1109
|
function useBodyScrollLock(isLocked) {
|
|
1108
1110
|
useEffect(() => {
|
|
1109
1111
|
const locker = BodyScrollLock.getLocker();
|
|
@@ -1374,6 +1376,7 @@ const OpenModal = (props) => {
|
|
|
1374
1376
|
...modalProps,
|
|
1375
1377
|
onExited: () => {
|
|
1376
1378
|
props.onClose?.();
|
|
1379
|
+
props.onExited?.();
|
|
1377
1380
|
if (!hasConfirmed.current) {
|
|
1378
1381
|
props.onCancel?.();
|
|
1379
1382
|
}
|
|
@@ -1414,30 +1417,30 @@ var __publicField$q = (obj, key, value) => {
|
|
|
1414
1417
|
__defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1415
1418
|
return value;
|
|
1416
1419
|
};
|
|
1417
|
-
var __accessCheck$
|
|
1420
|
+
var __accessCheck$b = (obj, member, msg) => {
|
|
1418
1421
|
if (!member.has(obj))
|
|
1419
1422
|
throw TypeError("Cannot " + msg);
|
|
1420
1423
|
};
|
|
1421
|
-
var __privateGet$
|
|
1422
|
-
__accessCheck$
|
|
1424
|
+
var __privateGet$8 = (obj, member, getter) => {
|
|
1425
|
+
__accessCheck$b(obj, member, "read from private field");
|
|
1423
1426
|
return getter ? getter.call(obj) : member.get(obj);
|
|
1424
1427
|
};
|
|
1425
|
-
var __privateAdd$
|
|
1428
|
+
var __privateAdd$b = (obj, member, value) => {
|
|
1426
1429
|
if (member.has(obj))
|
|
1427
1430
|
throw TypeError("Cannot add the same private member more than once");
|
|
1428
1431
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1429
1432
|
};
|
|
1430
|
-
var __privateSet$
|
|
1431
|
-
__accessCheck$
|
|
1433
|
+
var __privateSet$6 = (obj, member, value, setter) => {
|
|
1434
|
+
__accessCheck$b(obj, member, "write to private field");
|
|
1432
1435
|
member.set(obj, value);
|
|
1433
1436
|
return value;
|
|
1434
1437
|
};
|
|
1435
1438
|
var __privateWrapper$2 = (obj, member, setter, getter) => ({
|
|
1436
1439
|
set _(value) {
|
|
1437
|
-
__privateSet$
|
|
1440
|
+
__privateSet$6(obj, member, value);
|
|
1438
1441
|
},
|
|
1439
1442
|
get _() {
|
|
1440
|
-
return __privateGet$
|
|
1443
|
+
return __privateGet$8(obj, member, getter);
|
|
1441
1444
|
}
|
|
1442
1445
|
});
|
|
1443
1446
|
var _emitter$4, _maxId$1, _maxOverlay, _useModalsList;
|
|
@@ -1449,15 +1452,15 @@ class ApiaUtilModalHandler {
|
|
|
1449
1452
|
class ApiaUtilModals {
|
|
1450
1453
|
constructor() {
|
|
1451
1454
|
__publicField$q(this, "overlays", []);
|
|
1452
|
-
__privateAdd$
|
|
1453
|
-
__privateAdd$
|
|
1454
|
-
__privateAdd$
|
|
1455
|
-
__privateAdd$
|
|
1455
|
+
__privateAdd$b(this, _emitter$4, new EventEmitter());
|
|
1456
|
+
__privateAdd$b(this, _maxId$1, 0);
|
|
1457
|
+
__privateAdd$b(this, _maxOverlay, 0);
|
|
1458
|
+
__privateAdd$b(this, _useModalsList, () => {
|
|
1456
1459
|
const [modals, setModals] = useState(
|
|
1457
1460
|
[]
|
|
1458
1461
|
);
|
|
1459
1462
|
useMount(() => {
|
|
1460
|
-
const u1 = __privateGet$
|
|
1463
|
+
const u1 = __privateGet$8(this, _emitter$4).on("open", (ev) => {
|
|
1461
1464
|
setModals((current) => [
|
|
1462
1465
|
...current,
|
|
1463
1466
|
{
|
|
@@ -1473,12 +1476,12 @@ class ApiaUtilModals {
|
|
|
1473
1476
|
}
|
|
1474
1477
|
]);
|
|
1475
1478
|
});
|
|
1476
|
-
const u2 = __privateGet$
|
|
1479
|
+
const u2 = __privateGet$8(this, _emitter$4).on("closeAll", () => {
|
|
1477
1480
|
setModals(
|
|
1478
1481
|
(current) => current.map((modal) => ({ ...modal, isOpen: false }))
|
|
1479
1482
|
);
|
|
1480
1483
|
});
|
|
1481
|
-
const u3 = __privateGet$
|
|
1484
|
+
const u3 = __privateGet$8(this, _emitter$4).on("close", (modalId) => {
|
|
1482
1485
|
setModals(
|
|
1483
1486
|
(current) => current.map(
|
|
1484
1487
|
(modal) => modal.id === modalId ? { ...modal, isOpen: false } : modal
|
|
@@ -1494,7 +1497,7 @@ class ApiaUtilModals {
|
|
|
1494
1497
|
return modals;
|
|
1495
1498
|
});
|
|
1496
1499
|
__publicField$q(this, "Component", observer(() => {
|
|
1497
|
-
const modals = __privateGet$
|
|
1500
|
+
const modals = __privateGet$8(this, _useModalsList).call(this);
|
|
1498
1501
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1499
1502
|
modals.map((current) => /* @__PURE__ */ jsx(OpenModal, { ...current }, current.id)),
|
|
1500
1503
|
this.overlays.map((c) => c.render)
|
|
@@ -1509,13 +1512,13 @@ class ApiaUtilModals {
|
|
|
1509
1512
|
});
|
|
1510
1513
|
}
|
|
1511
1514
|
close(id) {
|
|
1512
|
-
__privateGet$
|
|
1515
|
+
__privateGet$8(this, _emitter$4).emit("close", id);
|
|
1513
1516
|
}
|
|
1514
1517
|
open(props) {
|
|
1515
1518
|
const id = props.id ?? `modal_${__privateWrapper$2(this, _maxId$1)._++}`;
|
|
1516
|
-
__privateGet$
|
|
1519
|
+
__privateGet$8(this, _emitter$4).emit("open", { ...props, id });
|
|
1517
1520
|
return new ApiaUtilModalHandler(() => {
|
|
1518
|
-
__privateGet$
|
|
1521
|
+
__privateGet$8(this, _emitter$4).emit("close", id);
|
|
1519
1522
|
});
|
|
1520
1523
|
}
|
|
1521
1524
|
/**
|
|
@@ -1609,6 +1612,10 @@ const TabsContext = React__default.createContext(null);
|
|
|
1609
1612
|
function useTabsContext() {
|
|
1610
1613
|
return React__default.useContext(TabsContext);
|
|
1611
1614
|
}
|
|
1615
|
+
const CurrentTabContext = React__default.createContext(null);
|
|
1616
|
+
function useCurrentTab() {
|
|
1617
|
+
return React__default.useContext(CurrentTabContext);
|
|
1618
|
+
}
|
|
1612
1619
|
|
|
1613
1620
|
const ContextMenu = observer(
|
|
1614
1621
|
({
|
|
@@ -1860,7 +1867,10 @@ function useShowScrollButtons() {
|
|
|
1860
1867
|
}
|
|
1861
1868
|
|
|
1862
1869
|
const TabsList = observer(
|
|
1863
|
-
({
|
|
1870
|
+
({
|
|
1871
|
+
arrowsBehavior = "focus",
|
|
1872
|
+
children
|
|
1873
|
+
}) => {
|
|
1864
1874
|
const controller = useTabsContext();
|
|
1865
1875
|
const [showScrollButtons, setRef] = useShowScrollButtons();
|
|
1866
1876
|
const onClickPrev = React__default.useCallback(() => {
|
|
@@ -1894,6 +1904,7 @@ const TabsList = observer(
|
|
|
1894
1904
|
...getVariant("layout.common.tabs.primary"),
|
|
1895
1905
|
ref: setRef,
|
|
1896
1906
|
children: [
|
|
1907
|
+
children?.beforeFixedTabs,
|
|
1897
1908
|
/* @__PURE__ */ jsx(Box, { className: "tabsList__fixedTabs", children: fixedTabs.map((current) => /* @__PURE__ */ jsx(Item, { tab: current }, current.id)) }),
|
|
1898
1909
|
/* @__PURE__ */ jsx(
|
|
1899
1910
|
ContextMenu,
|
|
@@ -1962,17 +1973,17 @@ var __publicField$o = (obj, key, value) => {
|
|
|
1962
1973
|
__defNormalProp$o(obj, key + "" , value);
|
|
1963
1974
|
return value;
|
|
1964
1975
|
};
|
|
1965
|
-
var __accessCheck$
|
|
1976
|
+
var __accessCheck$a = (obj, member, msg) => {
|
|
1966
1977
|
if (!member.has(obj))
|
|
1967
1978
|
throw TypeError("Cannot " + msg);
|
|
1968
1979
|
};
|
|
1969
|
-
var __privateAdd$
|
|
1980
|
+
var __privateAdd$a = (obj, member, value) => {
|
|
1970
1981
|
if (member.has(obj))
|
|
1971
1982
|
throw TypeError("Cannot add the same private member more than once");
|
|
1972
1983
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1973
1984
|
};
|
|
1974
1985
|
var __privateMethod$2 = (obj, member, method) => {
|
|
1975
|
-
__accessCheck$
|
|
1986
|
+
__accessCheck$a(obj, member, "access private method");
|
|
1976
1987
|
return method;
|
|
1977
1988
|
};
|
|
1978
1989
|
var _innerAppend, innerAppend_fn;
|
|
@@ -1994,6 +2005,9 @@ class Tab {
|
|
|
1994
2005
|
open(closeOthers) {
|
|
1995
2006
|
this.controller.openTab(this.id, closeOthers);
|
|
1996
2007
|
}
|
|
2008
|
+
remove() {
|
|
2009
|
+
this.controller.remove(this.id);
|
|
2010
|
+
}
|
|
1997
2011
|
toggle(isShown) {
|
|
1998
2012
|
this.controller.toggleTab(this.state.id, isShown);
|
|
1999
2013
|
}
|
|
@@ -2002,7 +2016,7 @@ class TabsController {
|
|
|
2002
2016
|
constructor(id, props) {
|
|
2003
2017
|
this.id = id;
|
|
2004
2018
|
this.props = props;
|
|
2005
|
-
__privateAdd$
|
|
2019
|
+
__privateAdd$a(this, _innerAppend);
|
|
2006
2020
|
__publicField$o(this, "state", {
|
|
2007
2021
|
isMultiple: false,
|
|
2008
2022
|
openTabsHistory: /* @__PURE__ */ new Set(),
|
|
@@ -2035,7 +2049,7 @@ class TabsController {
|
|
|
2035
2049
|
/**
|
|
2036
2050
|
* Obviamente agrega un tab al listado de tabs
|
|
2037
2051
|
*/
|
|
2038
|
-
append(tab,
|
|
2052
|
+
append(tab, behavior) {
|
|
2039
2053
|
if (this.getTab(tab.id)) {
|
|
2040
2054
|
void ApiaUtil.instance.dialogs.confirm({
|
|
2041
2055
|
children: getLabel("msgTabIsOpen").text,
|
|
@@ -2046,10 +2060,10 @@ class TabsController {
|
|
|
2046
2060
|
...tab,
|
|
2047
2061
|
id: `${tab.id}_${uniqueId$2()}`,
|
|
2048
2062
|
additionalProps: tab.additionalProps ?? {}
|
|
2049
|
-
},
|
|
2063
|
+
}, behavior);
|
|
2050
2064
|
});
|
|
2051
2065
|
} else
|
|
2052
|
-
__privateMethod$2(this, _innerAppend, innerAppend_fn).call(this, tab,
|
|
2066
|
+
__privateMethod$2(this, _innerAppend, innerAppend_fn).call(this, tab, behavior);
|
|
2053
2067
|
}
|
|
2054
2068
|
async closeAll(closeFixedTabsAsWell = false, force = false) {
|
|
2055
2069
|
for (const tab of this.tabsList) {
|
|
@@ -2118,6 +2132,10 @@ class TabsController {
|
|
|
2118
2132
|
this.openTab(this.tabsList[0].id);
|
|
2119
2133
|
}
|
|
2120
2134
|
}
|
|
2135
|
+
remove(tabId) {
|
|
2136
|
+
this.state.openTabsHistory.delete(this.state.tabs.get(tabId));
|
|
2137
|
+
this.state.tabs.delete(tabId);
|
|
2138
|
+
}
|
|
2121
2139
|
async toggleTab(tabId, isShown) {
|
|
2122
2140
|
const willBeOpen = isShown || !this.getTab(tabId)?.state.isOpen;
|
|
2123
2141
|
if (willBeOpen) {
|
|
@@ -2260,11 +2278,19 @@ class TabsController {
|
|
|
2260
2278
|
}
|
|
2261
2279
|
}
|
|
2262
2280
|
_innerAppend = new WeakSet();
|
|
2263
|
-
innerAppend_fn = function(tab,
|
|
2264
|
-
this.state.tabs.
|
|
2281
|
+
innerAppend_fn = function(tab, behavior) {
|
|
2282
|
+
const tabsArray = [...this.state.tabs.values()];
|
|
2283
|
+
const afterId = behavior?.insertAfterId ?? tabsArray[tabsArray.length - 1]?.id;
|
|
2284
|
+
for (let i = 0; i <= tabsArray.length; i++) {
|
|
2285
|
+
if (!tabsArray[i] || tabsArray[i]?.id === afterId) {
|
|
2286
|
+
tabsArray.splice(i + 1, 0, new Tab(tab, this));
|
|
2287
|
+
break;
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
this.state.tabs = new Map(tabsArray.map((c) => [c.id, c]));
|
|
2265
2291
|
if (tab.isOpen) {
|
|
2266
|
-
this.openTab(tab.id, closeOthers);
|
|
2267
|
-
this.focusTab(tab.id, closeOthers);
|
|
2292
|
+
this.openTab(tab.id, behavior?.closeOthers);
|
|
2293
|
+
this.focusTab(tab.id, behavior?.closeOthers);
|
|
2268
2294
|
}
|
|
2269
2295
|
this.checkAtLeastOneOpen();
|
|
2270
2296
|
};
|
|
@@ -2291,6 +2317,8 @@ const InnerRenderer = observer(({ tab }) => {
|
|
|
2291
2317
|
},
|
|
2292
2318
|
tab.id
|
|
2293
2319
|
);
|
|
2320
|
+
const uns = useRef(() => {
|
|
2321
|
+
});
|
|
2294
2322
|
return /* @__PURE__ */ jsx(
|
|
2295
2323
|
Box,
|
|
2296
2324
|
{
|
|
@@ -2303,6 +2331,18 @@ const InnerRenderer = observer(({ tab }) => {
|
|
|
2303
2331
|
sx: {
|
|
2304
2332
|
display: state.isOpen ? void 0 : "none"
|
|
2305
2333
|
},
|
|
2334
|
+
ref: (el) => {
|
|
2335
|
+
uns.current();
|
|
2336
|
+
if (el instanceof HTMLElement) {
|
|
2337
|
+
const handleFocus = () => {
|
|
2338
|
+
tab.open();
|
|
2339
|
+
};
|
|
2340
|
+
el.addEventListener(customEvents.focus, handleFocus);
|
|
2341
|
+
uns.current = () => {
|
|
2342
|
+
el.removeEventListener(customEvents.focus, handleFocus);
|
|
2343
|
+
};
|
|
2344
|
+
}
|
|
2345
|
+
},
|
|
2306
2346
|
children: accordion ?? tabContent
|
|
2307
2347
|
},
|
|
2308
2348
|
state.id
|
|
@@ -2319,7 +2359,7 @@ const TabsContent = observer((props) => {
|
|
|
2319
2359
|
...getVariant("layout.common.tabs.primary.content"),
|
|
2320
2360
|
...props,
|
|
2321
2361
|
children: controller.tabsList.map((tab) => {
|
|
2322
|
-
return /* @__PURE__ */ jsx(InnerRenderer, { tab }, tab.id);
|
|
2362
|
+
return /* @__PURE__ */ jsx(CurrentTabContext.Provider, { value: tab, children: /* @__PURE__ */ jsx(InnerRenderer, { tab }, tab.id) });
|
|
2323
2363
|
})
|
|
2324
2364
|
}
|
|
2325
2365
|
);
|
|
@@ -2698,48 +2738,48 @@ var __publicField$n = (obj, key, value) => {
|
|
|
2698
2738
|
__defNormalProp$n(obj, key + "" , value);
|
|
2699
2739
|
return value;
|
|
2700
2740
|
};
|
|
2701
|
-
var __accessCheck$
|
|
2741
|
+
var __accessCheck$9 = (obj, member, msg) => {
|
|
2702
2742
|
if (!member.has(obj))
|
|
2703
2743
|
throw TypeError("Cannot " + msg);
|
|
2704
2744
|
};
|
|
2705
|
-
var __privateGet$
|
|
2706
|
-
__accessCheck$
|
|
2745
|
+
var __privateGet$7 = (obj, member, getter) => {
|
|
2746
|
+
__accessCheck$9(obj, member, "read from private field");
|
|
2707
2747
|
return getter ? getter.call(obj) : member.get(obj);
|
|
2708
2748
|
};
|
|
2709
|
-
var __privateAdd$
|
|
2749
|
+
var __privateAdd$9 = (obj, member, value) => {
|
|
2710
2750
|
if (member.has(obj))
|
|
2711
2751
|
throw TypeError("Cannot add the same private member more than once");
|
|
2712
2752
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
2713
2753
|
};
|
|
2714
|
-
var __privateSet$
|
|
2715
|
-
__accessCheck$
|
|
2754
|
+
var __privateSet$5 = (obj, member, value, setter) => {
|
|
2755
|
+
__accessCheck$9(obj, member, "write to private field");
|
|
2716
2756
|
member.set(obj, value);
|
|
2717
2757
|
return value;
|
|
2718
2758
|
};
|
|
2719
2759
|
var __privateWrapper$1 = (obj, member, setter, getter) => ({
|
|
2720
2760
|
set _(value) {
|
|
2721
|
-
__privateSet$
|
|
2761
|
+
__privateSet$5(obj, member, value);
|
|
2722
2762
|
},
|
|
2723
2763
|
get _() {
|
|
2724
|
-
return __privateGet$
|
|
2764
|
+
return __privateGet$7(obj, member, getter);
|
|
2725
2765
|
}
|
|
2726
2766
|
});
|
|
2727
2767
|
var _emitter$3, _maxIdAlert, _maxIdConfirm;
|
|
2728
2768
|
class ApiaUtilDialogs {
|
|
2729
2769
|
constructor() {
|
|
2730
|
-
__privateAdd$
|
|
2731
|
-
__privateAdd$
|
|
2732
|
-
__privateAdd$
|
|
2770
|
+
__privateAdd$9(this, _emitter$3, new EventEmitter());
|
|
2771
|
+
__privateAdd$9(this, _maxIdAlert, 0);
|
|
2772
|
+
__privateAdd$9(this, _maxIdConfirm, 0);
|
|
2733
2773
|
__publicField$n(this, "Component", () => {
|
|
2734
2774
|
const [confirmDialogs, setConfirmDialogs] = useState([]);
|
|
2735
2775
|
const [alertsDialogs, setAlertsDialogs] = useState(
|
|
2736
2776
|
[]
|
|
2737
2777
|
);
|
|
2738
2778
|
useMount(() => {
|
|
2739
|
-
const unsuscribe1 = __privateGet$
|
|
2779
|
+
const unsuscribe1 = __privateGet$7(this, _emitter$3).on("alert", (ev) => {
|
|
2740
2780
|
setAlertsDialogs((current) => [...current, ev]);
|
|
2741
2781
|
});
|
|
2742
|
-
const unsuscribe2 = __privateGet$
|
|
2782
|
+
const unsuscribe2 = __privateGet$7(this, _emitter$3).on("confirm", (ev) => {
|
|
2743
2783
|
setConfirmDialogs((current) => [...current, ev]);
|
|
2744
2784
|
});
|
|
2745
2785
|
return () => {
|
|
@@ -2777,7 +2817,7 @@ class ApiaUtilDialogs {
|
|
|
2777
2817
|
}
|
|
2778
2818
|
alert(props) {
|
|
2779
2819
|
return new Promise((resolve) => {
|
|
2780
|
-
__privateGet$
|
|
2820
|
+
__privateGet$7(this, _emitter$3).emit("alert", {
|
|
2781
2821
|
...props,
|
|
2782
2822
|
onClose: () => resolve(),
|
|
2783
2823
|
id: `confirm${__privateWrapper$1(this, _maxIdAlert)._++}`
|
|
@@ -2786,7 +2826,7 @@ class ApiaUtilDialogs {
|
|
|
2786
2826
|
}
|
|
2787
2827
|
confirm(props) {
|
|
2788
2828
|
return new Promise((resolve) => {
|
|
2789
|
-
__privateGet$
|
|
2829
|
+
__privateGet$7(this, _emitter$3).emit("confirm", {
|
|
2790
2830
|
...props,
|
|
2791
2831
|
id: `confirm${__privateWrapper$1(this, _maxIdConfirm)._++}`,
|
|
2792
2832
|
onCancel: () => resolve(false),
|
|
@@ -2850,31 +2890,31 @@ function parseStringToApiaNumber(value) {
|
|
|
2850
2890
|
)}${decimalsString.length > 0 ? `${decimalSeparator$1}${decimalsString}` : ""}`;
|
|
2851
2891
|
}
|
|
2852
2892
|
|
|
2853
|
-
var __accessCheck$
|
|
2893
|
+
var __accessCheck$8 = (obj, member, msg) => {
|
|
2854
2894
|
if (!member.has(obj))
|
|
2855
2895
|
throw TypeError("Cannot " + msg);
|
|
2856
2896
|
};
|
|
2857
|
-
var __privateAdd$
|
|
2897
|
+
var __privateAdd$8 = (obj, member, value) => {
|
|
2858
2898
|
if (member.has(obj))
|
|
2859
2899
|
throw TypeError("Cannot add the same private member more than once");
|
|
2860
2900
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
2861
2901
|
};
|
|
2862
2902
|
var __privateMethod$1 = (obj, member, method) => {
|
|
2863
|
-
__accessCheck$
|
|
2903
|
+
__accessCheck$8(obj, member, "access private method");
|
|
2864
2904
|
return method;
|
|
2865
2905
|
};
|
|
2866
2906
|
var _parseString, parseString_fn, _findDelimiter, findDelimiter_fn, _parseCellValue, parseCellValue_fn;
|
|
2867
2907
|
const delimiters = [",", ";", " ", "|"];
|
|
2868
2908
|
class ApiaUtilParsers {
|
|
2869
2909
|
constructor() {
|
|
2870
|
-
__privateAdd$
|
|
2910
|
+
__privateAdd$8(this, _parseString);
|
|
2871
2911
|
/**
|
|
2872
2912
|
* Inspecciona las primeras filas de un array de strings, en búsqueda del mejor delimitador
|
|
2873
2913
|
* para convertir esos strings a array de datos, que serán el resultado de haber interpretado
|
|
2874
2914
|
* un documento CSV.
|
|
2875
2915
|
*/
|
|
2876
|
-
__privateAdd$
|
|
2877
|
-
__privateAdd$
|
|
2916
|
+
__privateAdd$8(this, _findDelimiter);
|
|
2917
|
+
__privateAdd$8(this, _parseCellValue);
|
|
2878
2918
|
}
|
|
2879
2919
|
/**
|
|
2880
2920
|
* Toma un número sin separadores de miles y lo devuelve en el formato
|
|
@@ -3033,25 +3073,25 @@ var __publicField$l = (obj, key, value) => {
|
|
|
3033
3073
|
__defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3034
3074
|
return value;
|
|
3035
3075
|
};
|
|
3036
|
-
var __accessCheck$
|
|
3076
|
+
var __accessCheck$7 = (obj, member, msg) => {
|
|
3037
3077
|
if (!member.has(obj))
|
|
3038
3078
|
throw TypeError("Cannot " + msg);
|
|
3039
3079
|
};
|
|
3040
|
-
var __privateGet$
|
|
3041
|
-
__accessCheck$
|
|
3080
|
+
var __privateGet$6 = (obj, member, getter) => {
|
|
3081
|
+
__accessCheck$7(obj, member, "read from private field");
|
|
3042
3082
|
return getter ? getter.call(obj) : member.get(obj);
|
|
3043
3083
|
};
|
|
3044
|
-
var __privateAdd$
|
|
3084
|
+
var __privateAdd$7 = (obj, member, value) => {
|
|
3045
3085
|
if (member.has(obj))
|
|
3046
3086
|
throw TypeError("Cannot add the same private member more than once");
|
|
3047
3087
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
3048
3088
|
};
|
|
3049
|
-
var __privateSet$
|
|
3050
|
-
__accessCheck$
|
|
3089
|
+
var __privateSet$4 = (obj, member, value, setter) => {
|
|
3090
|
+
__accessCheck$7(obj, member, "write to private field");
|
|
3051
3091
|
member.set(obj, value);
|
|
3052
3092
|
return value;
|
|
3053
3093
|
};
|
|
3054
|
-
var _timeout, _tooltipTimeout, _unsuscribe,
|
|
3094
|
+
var _timeout, _tooltipTimeout, _unsuscribe, _tooltip;
|
|
3055
3095
|
let y$1 = 0, x$1 = 0;
|
|
3056
3096
|
document?.addEventListener("mousemove", (ev) => {
|
|
3057
3097
|
x$1 = ev.clientX;
|
|
@@ -3060,55 +3100,53 @@ document?.addEventListener("mousemove", (ev) => {
|
|
|
3060
3100
|
class AutomaticTooltip {
|
|
3061
3101
|
constructor(tooltip = null, handler) {
|
|
3062
3102
|
this.handler = handler;
|
|
3063
|
-
__privateAdd$
|
|
3064
|
-
__privateAdd$
|
|
3065
|
-
__privateAdd$
|
|
3066
|
-
__privateAdd$8(this, _tooltipController, null);
|
|
3103
|
+
__privateAdd$7(this, _timeout, 500);
|
|
3104
|
+
__privateAdd$7(this, _tooltipTimeout, 0);
|
|
3105
|
+
__privateAdd$7(this, _unsuscribe, null);
|
|
3067
3106
|
__publicField$l(this, "ref", (el) => {
|
|
3068
3107
|
var _a, _b;
|
|
3069
|
-
(_a = __privateGet$
|
|
3108
|
+
(_a = __privateGet$6(this, _unsuscribe)) == null ? void 0 : _a.call(this);
|
|
3070
3109
|
const listener = () => {
|
|
3071
|
-
clearTimeout(__privateGet$
|
|
3072
|
-
__privateSet$
|
|
3073
|
-
if (__privateGet$
|
|
3074
|
-
|
|
3110
|
+
clearTimeout(__privateGet$6(this, _tooltipTimeout));
|
|
3111
|
+
__privateSet$4(this, _tooltipTimeout, setTimeout(() => {
|
|
3112
|
+
if (__privateGet$6(this, _tooltip)?.children)
|
|
3113
|
+
this.handler.open({
|
|
3075
3114
|
closeOnMouseLeaveTooltip: true,
|
|
3076
3115
|
closeOnEscape: true,
|
|
3077
3116
|
closeOnScrollOut: true,
|
|
3078
|
-
...__privateGet$
|
|
3117
|
+
...__privateGet$6(this, _tooltip),
|
|
3079
3118
|
anchorPoint: { left: x$1 + 3, top: y$1 + 3 }
|
|
3080
|
-
})
|
|
3081
|
-
}, __privateGet$
|
|
3119
|
+
});
|
|
3120
|
+
}, __privateGet$6(this, _timeout)));
|
|
3082
3121
|
};
|
|
3083
3122
|
const reset = () => {
|
|
3084
|
-
clearTimeout(__privateGet$
|
|
3123
|
+
clearTimeout(__privateGet$6(this, _tooltipTimeout));
|
|
3085
3124
|
};
|
|
3086
3125
|
if (el) {
|
|
3087
3126
|
el.addEventListener("mousemove", listener);
|
|
3088
3127
|
el.addEventListener("mouseleave", reset);
|
|
3089
|
-
__privateSet$
|
|
3128
|
+
__privateSet$4(this, _unsuscribe, () => {
|
|
3090
3129
|
el.removeEventListener("mousemove", listener);
|
|
3091
3130
|
el.removeEventListener("mouseleave", reset);
|
|
3092
3131
|
});
|
|
3093
3132
|
} else {
|
|
3094
|
-
(_b = __privateGet$
|
|
3133
|
+
(_b = __privateGet$6(this, _unsuscribe)) == null ? void 0 : _b.call(this);
|
|
3095
3134
|
reset();
|
|
3096
3135
|
}
|
|
3097
3136
|
});
|
|
3098
|
-
__privateAdd$
|
|
3137
|
+
__privateAdd$7(this, _tooltip, null);
|
|
3099
3138
|
__publicField$l(this, "update", (tooltip) => {
|
|
3100
|
-
__privateSet$
|
|
3139
|
+
__privateSet$4(this, _tooltip, tooltip);
|
|
3101
3140
|
});
|
|
3102
|
-
__privateSet$
|
|
3141
|
+
__privateSet$4(this, _tooltip, tooltip);
|
|
3103
3142
|
if (tooltip?.timeout !== void 0) {
|
|
3104
|
-
__privateSet$
|
|
3143
|
+
__privateSet$4(this, _timeout, tooltip?.timeout);
|
|
3105
3144
|
}
|
|
3106
3145
|
}
|
|
3107
3146
|
}
|
|
3108
3147
|
_timeout = new WeakMap();
|
|
3109
3148
|
_tooltipTimeout = new WeakMap();
|
|
3110
3149
|
_unsuscribe = new WeakMap();
|
|
3111
|
-
_tooltipController = new WeakMap();
|
|
3112
3150
|
_tooltip = new WeakMap();
|
|
3113
3151
|
|
|
3114
3152
|
function isAttachToElementAFunction(attachToElement) {
|
|
@@ -3454,15 +3492,15 @@ var __publicField$k = (obj, key, value) => {
|
|
|
3454
3492
|
__defNormalProp$k(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3455
3493
|
return value;
|
|
3456
3494
|
};
|
|
3457
|
-
var __accessCheck$
|
|
3495
|
+
var __accessCheck$6 = (obj, member, msg) => {
|
|
3458
3496
|
if (!member.has(obj))
|
|
3459
3497
|
throw TypeError("Cannot " + msg);
|
|
3460
3498
|
};
|
|
3461
|
-
var __privateGet$
|
|
3462
|
-
__accessCheck$
|
|
3499
|
+
var __privateGet$5 = (obj, member, getter) => {
|
|
3500
|
+
__accessCheck$6(obj, member, "read from private field");
|
|
3463
3501
|
return getter ? getter.call(obj) : member.get(obj);
|
|
3464
3502
|
};
|
|
3465
|
-
var __privateAdd$
|
|
3503
|
+
var __privateAdd$6 = (obj, member, value) => {
|
|
3466
3504
|
if (member.has(obj))
|
|
3467
3505
|
throw TypeError("Cannot add the same private member more than once");
|
|
3468
3506
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
@@ -3470,10 +3508,10 @@ var __privateAdd$7 = (obj, member, value) => {
|
|
|
3470
3508
|
var _emitter$2, _shoutChangedList;
|
|
3471
3509
|
class ApiaUtilTooltips {
|
|
3472
3510
|
constructor() {
|
|
3473
|
-
__privateAdd$
|
|
3511
|
+
__privateAdd$6(this, _emitter$2, new EventEmitter());
|
|
3474
3512
|
__publicField$k(this, "tooltips", []);
|
|
3475
|
-
__privateAdd$
|
|
3476
|
-
__privateGet$
|
|
3513
|
+
__privateAdd$6(this, _shoutChangedList, () => {
|
|
3514
|
+
__privateGet$5(this, _emitter$2).emit("changedList", [...this.tooltips]);
|
|
3477
3515
|
});
|
|
3478
3516
|
/**
|
|
3479
3517
|
* Permite crear un tooltip que se abrirá automáticamente al estar parado
|
|
@@ -3492,11 +3530,11 @@ class ApiaUtilTooltips {
|
|
|
3492
3530
|
});
|
|
3493
3531
|
__publicField$k(this, "close", (id) => {
|
|
3494
3532
|
this.tooltips = this.tooltips.filter((current) => current.id !== id);
|
|
3495
|
-
__privateGet$
|
|
3533
|
+
__privateGet$5(this, _shoutChangedList).call(this);
|
|
3496
3534
|
});
|
|
3497
3535
|
__publicField$k(this, "closeAll", () => {
|
|
3498
3536
|
this.tooltips = [];
|
|
3499
|
-
__privateGet$
|
|
3537
|
+
__privateGet$5(this, _shoutChangedList).call(this);
|
|
3500
3538
|
});
|
|
3501
3539
|
__publicField$k(this, "open", (tooltip) => {
|
|
3502
3540
|
const controller = new ApiaUtilTooltip(tooltip, () => {
|
|
@@ -3508,29 +3546,35 @@ class ApiaUtilTooltips {
|
|
|
3508
3546
|
} else {
|
|
3509
3547
|
this.tooltips = [...this.tooltips, controller];
|
|
3510
3548
|
}
|
|
3511
|
-
__privateGet$
|
|
3549
|
+
__privateGet$5(this, _shoutChangedList).call(this);
|
|
3512
3550
|
return controller;
|
|
3513
3551
|
});
|
|
3514
3552
|
__publicField$k(this, "Component", () => {
|
|
3515
3553
|
const [tooltips, setTooltips] = useState(this.tooltips);
|
|
3516
3554
|
useMount(() => {
|
|
3517
|
-
const unsuscribeToList = __privateGet$
|
|
3555
|
+
const unsuscribeToList = __privateGet$5(this, _emitter$2).on("changedList", (ev) => {
|
|
3518
3556
|
setTooltips(ev);
|
|
3519
3557
|
});
|
|
3520
3558
|
return () => {
|
|
3521
3559
|
unsuscribeToList();
|
|
3522
3560
|
};
|
|
3523
3561
|
});
|
|
3524
|
-
return /* @__PURE__ */ jsx(
|
|
3525
|
-
|
|
3562
|
+
return /* @__PURE__ */ jsx(
|
|
3563
|
+
FreeFocusInside,
|
|
3526
3564
|
{
|
|
3527
|
-
...
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3565
|
+
...{ sx: { position: "relative", zIndex: "tooltip" } },
|
|
3566
|
+
children: tooltips.map((current) => /* @__PURE__ */ createElement(
|
|
3567
|
+
Tooltip,
|
|
3568
|
+
{
|
|
3569
|
+
...current.props,
|
|
3570
|
+
onClose: () => {
|
|
3571
|
+
current.close();
|
|
3572
|
+
},
|
|
3573
|
+
key: current.id
|
|
3574
|
+
}
|
|
3575
|
+
))
|
|
3532
3576
|
}
|
|
3533
|
-
)
|
|
3577
|
+
);
|
|
3534
3578
|
});
|
|
3535
3579
|
document.addEventListener("keydown", (ev) => {
|
|
3536
3580
|
if (ev.code === "Escape" && this.tooltips.find((c) => c.props.closeOnEscape !== false)) {
|
|
@@ -3539,7 +3583,7 @@ class ApiaUtilTooltips {
|
|
|
3539
3583
|
this.tooltips = this.tooltips.filter(
|
|
3540
3584
|
(current) => current.props.closeOnEscape === false
|
|
3541
3585
|
);
|
|
3542
|
-
__privateGet$
|
|
3586
|
+
__privateGet$5(this, _shoutChangedList).call(this);
|
|
3543
3587
|
}
|
|
3544
3588
|
});
|
|
3545
3589
|
}
|
|
@@ -3553,30 +3597,30 @@ var __publicField$j = (obj, key, value) => {
|
|
|
3553
3597
|
__defNormalProp$j(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3554
3598
|
return value;
|
|
3555
3599
|
};
|
|
3556
|
-
var __accessCheck$
|
|
3600
|
+
var __accessCheck$5 = (obj, member, msg) => {
|
|
3557
3601
|
if (!member.has(obj))
|
|
3558
3602
|
throw TypeError("Cannot " + msg);
|
|
3559
3603
|
};
|
|
3560
|
-
var __privateGet$
|
|
3561
|
-
__accessCheck$
|
|
3604
|
+
var __privateGet$4 = (obj, member, getter) => {
|
|
3605
|
+
__accessCheck$5(obj, member, "read from private field");
|
|
3562
3606
|
return getter ? getter.call(obj) : member.get(obj);
|
|
3563
3607
|
};
|
|
3564
|
-
var __privateAdd$
|
|
3608
|
+
var __privateAdd$5 = (obj, member, value) => {
|
|
3565
3609
|
if (member.has(obj))
|
|
3566
3610
|
throw TypeError("Cannot add the same private member more than once");
|
|
3567
3611
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
3568
3612
|
};
|
|
3569
|
-
var __privateSet$
|
|
3570
|
-
__accessCheck$
|
|
3613
|
+
var __privateSet$3 = (obj, member, value, setter) => {
|
|
3614
|
+
__accessCheck$5(obj, member, "write to private field");
|
|
3571
3615
|
member.set(obj, value);
|
|
3572
3616
|
return value;
|
|
3573
3617
|
};
|
|
3574
3618
|
var __privateWrapper = (obj, member, setter, getter) => ({
|
|
3575
3619
|
set _(value) {
|
|
3576
|
-
__privateSet$
|
|
3620
|
+
__privateSet$3(obj, member, value);
|
|
3577
3621
|
},
|
|
3578
3622
|
get _() {
|
|
3579
|
-
return __privateGet$
|
|
3623
|
+
return __privateGet$4(obj, member, getter);
|
|
3580
3624
|
}
|
|
3581
3625
|
});
|
|
3582
3626
|
var _emitter$1, _items$1, _hooks, _maxId, _RenderMenu;
|
|
@@ -3585,14 +3629,14 @@ function isSubmenu(item) {
|
|
|
3585
3629
|
}
|
|
3586
3630
|
class ApiaUtilMenu {
|
|
3587
3631
|
constructor() {
|
|
3588
|
-
__privateAdd$
|
|
3589
|
-
__privateAdd$
|
|
3632
|
+
__privateAdd$5(this, _emitter$1, new EventEmitter());
|
|
3633
|
+
__privateAdd$5(this, _items$1, []);
|
|
3590
3634
|
__publicField$j(this, "menuProps", null);
|
|
3591
|
-
__privateAdd$
|
|
3635
|
+
__privateAdd$5(this, _hooks, {
|
|
3592
3636
|
useIsOpen: () => {
|
|
3593
3637
|
const [isOpen, setIsOpen] = useState(false);
|
|
3594
3638
|
useMount(() => {
|
|
3595
|
-
return __privateGet$
|
|
3639
|
+
return __privateGet$4(this, _emitter$1).on("toggle", setIsOpen);
|
|
3596
3640
|
});
|
|
3597
3641
|
return [
|
|
3598
3642
|
isOpen,
|
|
@@ -3603,18 +3647,18 @@ class ApiaUtilMenu {
|
|
|
3603
3647
|
}
|
|
3604
3648
|
});
|
|
3605
3649
|
__publicField$j(this, "close", () => {
|
|
3606
|
-
__privateGet$
|
|
3650
|
+
__privateGet$4(this, _emitter$1).emit("toggle", false);
|
|
3607
3651
|
});
|
|
3608
3652
|
__publicField$j(this, "open", ({
|
|
3609
3653
|
menuProps,
|
|
3610
3654
|
items
|
|
3611
3655
|
}) => {
|
|
3612
|
-
__privateSet$
|
|
3656
|
+
__privateSet$3(this, _items$1, items);
|
|
3613
3657
|
this.menuProps = menuProps;
|
|
3614
|
-
__privateGet$
|
|
3658
|
+
__privateGet$4(this, _emitter$1).emit("toggle", true);
|
|
3615
3659
|
});
|
|
3616
|
-
__privateAdd$
|
|
3617
|
-
__privateAdd$
|
|
3660
|
+
__privateAdd$5(this, _maxId, 0);
|
|
3661
|
+
__privateAdd$5(this, _RenderMenu, (submenu) => {
|
|
3618
3662
|
const hasIcon = submenu.items.find(
|
|
3619
3663
|
(c) => !!c.icon
|
|
3620
3664
|
);
|
|
@@ -3627,7 +3671,7 @@ class ApiaUtilMenu {
|
|
|
3627
3671
|
{
|
|
3628
3672
|
label: current.label,
|
|
3629
3673
|
className: hasIcon ? "with-icon" : "",
|
|
3630
|
-
children: __privateGet$
|
|
3674
|
+
children: __privateGet$4(this, _RenderMenu).call(this, current)
|
|
3631
3675
|
},
|
|
3632
3676
|
`submenu${__privateWrapper(this, _maxId)._++}`
|
|
3633
3677
|
);
|
|
@@ -3647,7 +3691,7 @@ class ApiaUtilMenu {
|
|
|
3647
3691
|
}) });
|
|
3648
3692
|
});
|
|
3649
3693
|
__publicField$j(this, "Component", () => {
|
|
3650
|
-
const [isOpen, close] = __privateGet$
|
|
3694
|
+
const [isOpen, close] = __privateGet$4(this, _hooks).useIsOpen();
|
|
3651
3695
|
if (!isOpen)
|
|
3652
3696
|
return null;
|
|
3653
3697
|
return /* @__PURE__ */ jsx(FreeFocusInside, { children: /* @__PURE__ */ jsx(
|
|
@@ -3659,7 +3703,7 @@ class ApiaUtilMenu {
|
|
|
3659
3703
|
close();
|
|
3660
3704
|
this.menuProps?.onClose?.(ev);
|
|
3661
3705
|
},
|
|
3662
|
-
children: __privateGet$
|
|
3706
|
+
children: __privateGet$4(this, _RenderMenu).call(this, { label: "", items: __privateGet$4(this, _items$1) })
|
|
3663
3707
|
}
|
|
3664
3708
|
) });
|
|
3665
3709
|
});
|
|
@@ -3699,21 +3743,21 @@ var __publicField$h = (obj, key, value) => {
|
|
|
3699
3743
|
__defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3700
3744
|
return value;
|
|
3701
3745
|
};
|
|
3702
|
-
var __accessCheck$
|
|
3746
|
+
var __accessCheck$4 = (obj, member, msg) => {
|
|
3703
3747
|
if (!member.has(obj))
|
|
3704
3748
|
throw TypeError("Cannot " + msg);
|
|
3705
3749
|
};
|
|
3706
|
-
var __privateGet$
|
|
3707
|
-
__accessCheck$
|
|
3750
|
+
var __privateGet$3 = (obj, member, getter) => {
|
|
3751
|
+
__accessCheck$4(obj, member, "read from private field");
|
|
3708
3752
|
return getter ? getter.call(obj) : member.get(obj);
|
|
3709
3753
|
};
|
|
3710
|
-
var __privateAdd$
|
|
3754
|
+
var __privateAdd$4 = (obj, member, value) => {
|
|
3711
3755
|
if (member.has(obj))
|
|
3712
3756
|
throw TypeError("Cannot add the same private member more than once");
|
|
3713
3757
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
3714
3758
|
};
|
|
3715
|
-
var __privateSet$
|
|
3716
|
-
__accessCheck$
|
|
3759
|
+
var __privateSet$2 = (obj, member, value, setter) => {
|
|
3760
|
+
__accessCheck$4(obj, member, "write to private field");
|
|
3717
3761
|
member.set(obj, value);
|
|
3718
3762
|
return value;
|
|
3719
3763
|
};
|
|
@@ -3747,14 +3791,14 @@ const _ApiaUtil = class _ApiaUtil {
|
|
|
3747
3791
|
this.tooltips = new ApiaUtilTooltips();
|
|
3748
3792
|
}
|
|
3749
3793
|
static get instance() {
|
|
3750
|
-
if (!__privateGet$
|
|
3751
|
-
__privateSet$
|
|
3794
|
+
if (!__privateGet$3(this, _instance)) {
|
|
3795
|
+
__privateSet$2(this, _instance, new _ApiaUtil());
|
|
3752
3796
|
}
|
|
3753
|
-
return __privateGet$
|
|
3797
|
+
return __privateGet$3(this, _instance);
|
|
3754
3798
|
}
|
|
3755
3799
|
};
|
|
3756
3800
|
_instance = new WeakMap();
|
|
3757
|
-
__privateAdd$
|
|
3801
|
+
__privateAdd$4(_ApiaUtil, _instance, void 0);
|
|
3758
3802
|
let ApiaUtil = _ApiaUtil;
|
|
3759
3803
|
|
|
3760
3804
|
var __defProp$g = Object.defineProperty;
|
|
@@ -3863,7 +3907,7 @@ const OptionsBox = observer(() => {
|
|
|
3863
3907
|
return /* @__PURE__ */ jsxs(
|
|
3864
3908
|
Box,
|
|
3865
3909
|
{
|
|
3866
|
-
className: `autocomplete__option ${handler.focusedIndex === i ? "focused" : ""}`,
|
|
3910
|
+
className: `autocomplete__option ${handler.focusedIndex === i ? "focused" : ""} ${handler.state.readOnly ? "readOnly" : ""}`,
|
|
3867
3911
|
onMouseDown: (ev) => {
|
|
3868
3912
|
ev.stopPropagation();
|
|
3869
3913
|
ev.preventDefault();
|
|
@@ -3891,21 +3935,21 @@ var __publicField$f = (obj, key, value) => {
|
|
|
3891
3935
|
__defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3892
3936
|
return value;
|
|
3893
3937
|
};
|
|
3894
|
-
var __accessCheck$
|
|
3938
|
+
var __accessCheck$3 = (obj, member, msg) => {
|
|
3895
3939
|
if (!member.has(obj))
|
|
3896
3940
|
throw TypeError("Cannot " + msg);
|
|
3897
3941
|
};
|
|
3898
|
-
var __privateGet$
|
|
3899
|
-
__accessCheck$
|
|
3942
|
+
var __privateGet$2 = (obj, member, getter) => {
|
|
3943
|
+
__accessCheck$3(obj, member, "read from private field");
|
|
3900
3944
|
return getter ? getter.call(obj) : member.get(obj);
|
|
3901
3945
|
};
|
|
3902
|
-
var __privateAdd$
|
|
3946
|
+
var __privateAdd$3 = (obj, member, value) => {
|
|
3903
3947
|
if (member.has(obj))
|
|
3904
3948
|
throw TypeError("Cannot add the same private member more than once");
|
|
3905
3949
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
3906
3950
|
};
|
|
3907
|
-
var __privateSet$
|
|
3908
|
-
__accessCheck$
|
|
3951
|
+
var __privateSet$1 = (obj, member, value, setter) => {
|
|
3952
|
+
__accessCheck$3(obj, member, "write to private field");
|
|
3909
3953
|
member.set(obj, value);
|
|
3910
3954
|
return value;
|
|
3911
3955
|
};
|
|
@@ -3923,7 +3967,7 @@ class AutocompleteController {
|
|
|
3923
3967
|
value: "",
|
|
3924
3968
|
width: 55
|
|
3925
3969
|
});
|
|
3926
|
-
__privateAdd$
|
|
3970
|
+
__privateAdd$3(this, _actualSearch, (str) => {
|
|
3927
3971
|
this.state.options.forEach((c) => {
|
|
3928
3972
|
if (this.state.caseInsensitive) {
|
|
3929
3973
|
c.filtered = (c.searchLabel ?? c.label?.toString?.() ?? c.value).toLowerCase().indexOf(str.toLowerCase()) === -1;
|
|
@@ -3935,10 +3979,10 @@ class AutocompleteController {
|
|
|
3935
3979
|
}
|
|
3936
3980
|
});
|
|
3937
3981
|
});
|
|
3938
|
-
__privateAdd$
|
|
3939
|
-
return debounce(__privateGet$
|
|
3982
|
+
__privateAdd$3(this, _makeSearch, () => {
|
|
3983
|
+
return debounce(__privateGet$2(this, _actualSearch), this.state.searchDebounce);
|
|
3940
3984
|
});
|
|
3941
|
-
__privateAdd$
|
|
3985
|
+
__privateAdd$3(this, _search, __privateGet$2(this, _makeSearch).call(this));
|
|
3942
3986
|
__publicField$f(this, "tooltipRef", null);
|
|
3943
3987
|
Object.assign(this.state, properties);
|
|
3944
3988
|
if (properties.value) {
|
|
@@ -3954,7 +3998,7 @@ class AutocompleteController {
|
|
|
3954
3998
|
reaction(
|
|
3955
3999
|
() => this.state.searchDebounce,
|
|
3956
4000
|
() => {
|
|
3957
|
-
__privateSet$
|
|
4001
|
+
__privateSet$1(this, _search, __privateGet$2(this, _makeSearch).call(this));
|
|
3958
4002
|
}
|
|
3959
4003
|
);
|
|
3960
4004
|
reaction(
|
|
@@ -3984,7 +4028,7 @@ class AutocompleteController {
|
|
|
3984
4028
|
close(selectValue = true) {
|
|
3985
4029
|
this.tooltipRef?.close();
|
|
3986
4030
|
this.tooltipRef = null;
|
|
3987
|
-
__privateGet$
|
|
4031
|
+
__privateGet$2(this, _actualSearch).call(this, "");
|
|
3988
4032
|
if (selectValue) {
|
|
3989
4033
|
let currentValue = this.state.options.find(
|
|
3990
4034
|
(c) => c.value === this.state.focusedValue
|
|
@@ -4111,7 +4155,7 @@ class AutocompleteController {
|
|
|
4111
4155
|
return;
|
|
4112
4156
|
}
|
|
4113
4157
|
this.state.showValue = str;
|
|
4114
|
-
__privateGet$
|
|
4158
|
+
__privateGet$2(this, _search).call(this, str);
|
|
4115
4159
|
}
|
|
4116
4160
|
selectFocused() {
|
|
4117
4161
|
this.close();
|
|
@@ -4120,16 +4164,18 @@ class AutocompleteController {
|
|
|
4120
4164
|
this.setValue(newValue);
|
|
4121
4165
|
}
|
|
4122
4166
|
}
|
|
4123
|
-
async setValue(value) {
|
|
4124
|
-
if (this.state.disabled || this.state.readOnly) {
|
|
4167
|
+
async setValue(value, props) {
|
|
4168
|
+
if (this.state.disabled || this.state.readOnly || value === this.state.value && props?.fireOnChange !== false) {
|
|
4125
4169
|
return;
|
|
4126
4170
|
}
|
|
4127
4171
|
const selectedOption = this.state.options.find((c) => c.value === value);
|
|
4128
4172
|
const newValue = selectedOption?.value || "";
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
if (
|
|
4132
|
-
|
|
4173
|
+
if (props?.fireOnChange !== false) {
|
|
4174
|
+
const onChangeResult = this.state.onChange?.(newValue, this);
|
|
4175
|
+
if (onChangeResult instanceof Promise) {
|
|
4176
|
+
if (!await onChangeResult) {
|
|
4177
|
+
return;
|
|
4178
|
+
}
|
|
4133
4179
|
}
|
|
4134
4180
|
}
|
|
4135
4181
|
this.state.value = newValue;
|
|
@@ -4141,7 +4187,7 @@ _actualSearch = new WeakMap();
|
|
|
4141
4187
|
_makeSearch = new WeakMap();
|
|
4142
4188
|
_search = new WeakMap();
|
|
4143
4189
|
|
|
4144
|
-
const SearchBox = observer(() => {
|
|
4190
|
+
const SearchBox = observer((props) => {
|
|
4145
4191
|
const handler = useAutocompleteContext();
|
|
4146
4192
|
const breakpoint = useBreakpointIndex();
|
|
4147
4193
|
const inputRef = useRef(null);
|
|
@@ -4167,6 +4213,7 @@ const SearchBox = observer(() => {
|
|
|
4167
4213
|
/* @__PURE__ */ jsx(
|
|
4168
4214
|
Input,
|
|
4169
4215
|
{
|
|
4216
|
+
...props,
|
|
4170
4217
|
ref: inputRef,
|
|
4171
4218
|
className: `autocomplete__search ${handler.state.disabled ? "disabled" : ""} ${handler.state.readOnly ? "readOnly" : ""}`,
|
|
4172
4219
|
onChange: (ev) => {
|
|
@@ -4225,6 +4272,7 @@ const KeyHandler$1 = observer((props) => {
|
|
|
4225
4272
|
handler.focusPrevious();
|
|
4226
4273
|
break;
|
|
4227
4274
|
case "Enter":
|
|
4275
|
+
case "NumpadEnter":
|
|
4228
4276
|
ev.preventDefault();
|
|
4229
4277
|
if (handler.isOpen) {
|
|
4230
4278
|
handler.selectFocused();
|
|
@@ -4279,10 +4327,10 @@ const Autocomplete = (props) => {
|
|
|
4279
4327
|
});
|
|
4280
4328
|
const prevProps = usePrevious(props.properties);
|
|
4281
4329
|
if (!shallowEqual$1(prevProps.current, props.properties) && handler?.state) {
|
|
4330
|
+
Object.assign(handler.state, props.properties);
|
|
4282
4331
|
if (prevProps.current?.value !== props.properties?.value && props.properties?.value !== void 0) {
|
|
4283
|
-
handler.setValue(props.properties.value);
|
|
4332
|
+
handler.setValue(props.properties.value, { fireOnChange: false });
|
|
4284
4333
|
}
|
|
4285
|
-
Object.assign(handler.state, props.properties);
|
|
4286
4334
|
}
|
|
4287
4335
|
if (!handler) {
|
|
4288
4336
|
return null;
|
|
@@ -4293,7 +4341,7 @@ const Autocomplete = (props) => {
|
|
|
4293
4341
|
className: `autocomplete ${props.properties?.className || ""}`,
|
|
4294
4342
|
"data-autocomplete-box": handler.state.id,
|
|
4295
4343
|
...getVariant("layout.common.components.autocomplete"),
|
|
4296
|
-
children: /* @__PURE__ */ jsx(SearchBox, {})
|
|
4344
|
+
children: /* @__PURE__ */ jsx(SearchBox, { ...props.inputProps })
|
|
4297
4345
|
}
|
|
4298
4346
|
) });
|
|
4299
4347
|
};
|
|
@@ -4673,122 +4721,29 @@ const Checkbox$1 = forwardRef(
|
|
|
4673
4721
|
);
|
|
4674
4722
|
Checkbox$1.displayName = "Checkbox";
|
|
4675
4723
|
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
var __publicField$e = (obj, key, value) => {
|
|
4679
|
-
__defNormalProp$e(obj, key + "" , value);
|
|
4680
|
-
return value;
|
|
4681
|
-
};
|
|
4682
|
-
var __accessCheck$3 = (obj, member, msg) => {
|
|
4683
|
-
if (!member.has(obj))
|
|
4684
|
-
throw TypeError("Cannot " + msg);
|
|
4685
|
-
};
|
|
4686
|
-
var __privateGet$2 = (obj, member, getter) => {
|
|
4687
|
-
__accessCheck$3(obj, member, "read from private field");
|
|
4688
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
4689
|
-
};
|
|
4690
|
-
var __privateAdd$3 = (obj, member, value) => {
|
|
4691
|
-
if (member.has(obj))
|
|
4692
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
4693
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
4694
|
-
};
|
|
4695
|
-
var __privateSet$1 = (obj, member, value, setter) => {
|
|
4696
|
-
__accessCheck$3(obj, member, "write to private field");
|
|
4697
|
-
member.set(obj, value);
|
|
4698
|
-
return value;
|
|
4699
|
-
};
|
|
4700
|
-
var _onFocusCallbacks, _a;
|
|
4701
|
-
const historySize = 50;
|
|
4702
|
-
const globalFocus = new (_a = class {
|
|
4703
|
-
constructor() {
|
|
4704
|
-
__publicField$e(this, "focused", []);
|
|
4705
|
-
__privateAdd$3(this, _onFocusCallbacks, []);
|
|
4706
|
-
debugDispatcher.on(
|
|
4707
|
-
"focusHistory",
|
|
4708
|
-
() => {
|
|
4709
|
-
console.info(this.focused);
|
|
4710
|
-
},
|
|
4711
|
-
"Muestra el historial de elementos que recibieron foco."
|
|
4712
|
-
);
|
|
4713
|
-
}
|
|
4714
|
-
offFocus(cb) {
|
|
4715
|
-
__privateSet$1(this, _onFocusCallbacks, __privateGet$2(this, _onFocusCallbacks).filter((current) => {
|
|
4716
|
-
return current !== cb;
|
|
4717
|
-
}));
|
|
4718
|
-
}
|
|
4719
|
-
onFocus(cb) {
|
|
4720
|
-
__privateGet$2(this, _onFocusCallbacks).push(cb);
|
|
4721
|
-
return () => {
|
|
4722
|
-
this.offFocus(cb);
|
|
4723
|
-
};
|
|
4724
|
-
}
|
|
4725
|
-
inDocument(el) {
|
|
4726
|
-
return el instanceof Function || el instanceof HTMLElement && el.offsetParent !== null;
|
|
4727
|
-
}
|
|
4728
|
-
set focus(element) {
|
|
4729
|
-
this.focused = this.focused.filter((el) => {
|
|
4730
|
-
const existsInDocument = this.inDocument(el) && element !== el;
|
|
4731
|
-
return existsInDocument;
|
|
4732
|
-
});
|
|
4733
|
-
this.focused.unshift(element);
|
|
4734
|
-
if (this.focused.length > historySize) {
|
|
4735
|
-
this.focused = this.focused.splice(0, historySize);
|
|
4736
|
-
}
|
|
4737
|
-
__privateGet$2(this, _onFocusCallbacks).forEach((cb) => {
|
|
4738
|
-
return cb();
|
|
4739
|
-
});
|
|
4740
|
-
}
|
|
4741
|
-
get list() {
|
|
4742
|
-
return [...this.focused];
|
|
4743
|
-
}
|
|
4744
|
-
/**
|
|
4745
|
-
* @param querySelector A query selector against which the element should match
|
|
4746
|
-
* @returns The last HTMLElement if no querySelector argument provided or else, the last which matches
|
|
4747
|
-
* against that query selector.
|
|
4748
|
-
* */
|
|
4749
|
-
last(querySelector, omit = 0) {
|
|
4750
|
-
if (querySelector)
|
|
4751
|
-
for (let i = omit; i <= this.focused.length; i++) {
|
|
4752
|
-
const storedElement = this.focused[i];
|
|
4753
|
-
const element = (
|
|
4754
|
-
// eslint-disable-next-line no-nested-ternary
|
|
4755
|
-
storedElement?.id !== void 0 ? storedElement : isFunction(storedElement) ? storedElement(false) : null
|
|
4756
|
-
);
|
|
4757
|
-
if (element && this.inDocument(element) && element.matches && element.matches(querySelector))
|
|
4758
|
-
return element;
|
|
4759
|
-
}
|
|
4760
|
-
else
|
|
4761
|
-
return this.focused[this.focused.length - 1];
|
|
4762
|
-
return null;
|
|
4763
|
-
}
|
|
4764
|
-
}, _onFocusCallbacks = new WeakMap(), _a)();
|
|
4765
|
-
|
|
4766
|
-
const FieldErrorMessage = ({ children, name }) => {
|
|
4767
|
-
const [ref, setRef] = React.useState(null);
|
|
4768
|
-
React.useEffect(() => {
|
|
4769
|
-
if (children) {
|
|
4770
|
-
const event = new CustomEvent(customEvents.focus, { bubbles: true });
|
|
4771
|
-
ref?.dispatchEvent(event);
|
|
4772
|
-
}
|
|
4773
|
-
}, [children, ref]);
|
|
4774
|
-
if (children) {
|
|
4724
|
+
const CalModal = React__default.forwardRef(
|
|
4725
|
+
({ handleClickDay, calValue, locale }) => {
|
|
4775
4726
|
return /* @__PURE__ */ jsx(
|
|
4776
4727
|
Box,
|
|
4777
4728
|
{
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4729
|
+
...getVariant("layout.common.components.datePicker"),
|
|
4730
|
+
className: "datePicker",
|
|
4731
|
+
children: /* @__PURE__ */ jsx(
|
|
4732
|
+
Calendar,
|
|
4733
|
+
{
|
|
4734
|
+
onClickDay: handleClickDay,
|
|
4735
|
+
locale,
|
|
4736
|
+
value: calValue || /* @__PURE__ */ new Date(),
|
|
4737
|
+
nextLabel: "\u203A",
|
|
4738
|
+
next2Label: "\xBB",
|
|
4739
|
+
prevLabel: "\u2039",
|
|
4740
|
+
prev2Label: "\xAB"
|
|
4741
|
+
}
|
|
4742
|
+
)
|
|
4787
4743
|
}
|
|
4788
4744
|
);
|
|
4789
4745
|
}
|
|
4790
|
-
|
|
4791
|
-
};
|
|
4746
|
+
);
|
|
4792
4747
|
|
|
4793
4748
|
const IconInput = ({
|
|
4794
4749
|
additionalButtons,
|
|
@@ -4819,8 +4774,10 @@ const IconInput = ({
|
|
|
4819
4774
|
if (onBlur && (!ev.relatedTarget || ev.relatedTarget && !isChild(
|
|
4820
4775
|
ev.relatedTarget,
|
|
4821
4776
|
(current) => current === parentRef.current
|
|
4822
|
-
)))
|
|
4777
|
+
))) {
|
|
4778
|
+
Object.assign(ev.target, { value: innerInputRef.current?.value });
|
|
4823
4779
|
onBlur(ev);
|
|
4780
|
+
}
|
|
4824
4781
|
},
|
|
4825
4782
|
[onBlur]
|
|
4826
4783
|
);
|
|
@@ -4865,21 +4822,6 @@ const IconInput = ({
|
|
|
4865
4822
|
);
|
|
4866
4823
|
};
|
|
4867
4824
|
|
|
4868
|
-
const getFieldErrorStyles = (isValid) => {
|
|
4869
|
-
return {
|
|
4870
|
-
borderLeftStyle: !isValid ? "solid" : null,
|
|
4871
|
-
borderLeftWidth: !isValid ? "4px" : null,
|
|
4872
|
-
borderLeftColor: !isValid ? "danger" : void 0
|
|
4873
|
-
};
|
|
4874
|
-
};
|
|
4875
|
-
const getFieldTouchedStyles = (isTouched) => {
|
|
4876
|
-
return {
|
|
4877
|
-
borderStyle: isTouched ? "solid" : null,
|
|
4878
|
-
borderWidth: isTouched ? "1px" : null,
|
|
4879
|
-
borderColor: isTouched ? "orange" : void 0
|
|
4880
|
-
};
|
|
4881
|
-
};
|
|
4882
|
-
|
|
4883
4825
|
const DEFAULT_LOCALE = window.LANG_CODE;
|
|
4884
4826
|
const DEFAULT_MASK_PLACEHOLDER = "_";
|
|
4885
4827
|
const dateFormat = getDateFormat();
|
|
@@ -4892,9 +4834,11 @@ const DateInput = React__default.forwardRef(
|
|
|
4892
4834
|
({
|
|
4893
4835
|
allowPickBeforeToday,
|
|
4894
4836
|
buttonProps: outerButtonProps,
|
|
4837
|
+
CalModalRenderer,
|
|
4895
4838
|
className,
|
|
4896
4839
|
error,
|
|
4897
4840
|
getCustomMask,
|
|
4841
|
+
inputClassName,
|
|
4898
4842
|
isLoading,
|
|
4899
4843
|
onBlur,
|
|
4900
4844
|
onChange,
|
|
@@ -4904,63 +4848,55 @@ const DateInput = React__default.forwardRef(
|
|
|
4904
4848
|
value: outerValue,
|
|
4905
4849
|
...props
|
|
4906
4850
|
}, ref) => {
|
|
4907
|
-
const id = React__default.useMemo(uniqueId$
|
|
4851
|
+
const id = React__default.useMemo(uniqueId$3, []);
|
|
4908
4852
|
const [inputValue, setInputValue] = React__default.useState(outerValue ?? "");
|
|
4909
4853
|
const [calValue, setCalValue] = React__default.useState();
|
|
4910
4854
|
const boxRef = React__default.useRef(null);
|
|
4911
|
-
const {
|
|
4912
|
-
|
|
4913
|
-
globalFocus.focus = () => boxRef.current?.querySelector(".iconButton");
|
|
4914
|
-
return new Promise((resolve) => {
|
|
4915
|
-
let currentSelectedDate = dayjs(inputValue, dateFormat);
|
|
4916
|
-
if (!currentSelectedDate.isValid())
|
|
4917
|
-
currentSelectedDate = dayjs(/* @__PURE__ */ new Date());
|
|
4918
|
-
setCalValue(currentSelectedDate.toDate());
|
|
4919
|
-
resolve();
|
|
4920
|
-
});
|
|
4921
|
-
}
|
|
4922
|
-
});
|
|
4855
|
+
const { deleteFiltersTimestamp, ...otherProps } = props;
|
|
4856
|
+
const hasBlured = useRef(false);
|
|
4923
4857
|
const [stateError, setError] = React__default.useState(error ?? null);
|
|
4924
4858
|
const lastEmittedValue = React__default.useRef(outerValue ?? "");
|
|
4925
|
-
useUpdateEffect(() => {
|
|
4859
|
+
useUpdateEffect$1(() => {
|
|
4926
4860
|
setInputValue(outerValue ?? "");
|
|
4927
4861
|
lastEmittedValue.current = outerValue;
|
|
4928
4862
|
}, [outerValue]);
|
|
4929
|
-
useUpdateEffect(() => {
|
|
4863
|
+
useUpdateEffect$1(() => {
|
|
4930
4864
|
setError(error ?? null);
|
|
4931
4865
|
}, [error]);
|
|
4932
|
-
useUpdateEffect(() => {
|
|
4866
|
+
useUpdateEffect$1(() => {
|
|
4867
|
+
setError(null);
|
|
4868
|
+
if (deleteFiltersTimestamp !== void 0) {
|
|
4869
|
+
setCalendarValue("");
|
|
4870
|
+
}
|
|
4871
|
+
}, [deleteFiltersTimestamp]);
|
|
4872
|
+
useUpdateEffect$1(() => {
|
|
4933
4873
|
if (onError)
|
|
4934
4874
|
onError(stateError);
|
|
4875
|
+
if (stateError) {
|
|
4876
|
+
setInputValue("");
|
|
4877
|
+
}
|
|
4878
|
+
if (onError)
|
|
4879
|
+
onError(stateError ?? "");
|
|
4935
4880
|
}, [stateError]);
|
|
4936
4881
|
const shoutOnChange = React__default.useCallback(
|
|
4937
4882
|
(newValue) => {
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
if (result) {
|
|
4941
|
-
lastEmittedValue.current = newValue;
|
|
4942
|
-
}
|
|
4943
|
-
return result;
|
|
4944
|
-
}
|
|
4945
|
-
return true;
|
|
4883
|
+
lastEmittedValue.current = newValue;
|
|
4884
|
+
return onChange?.(newValue) ?? true;
|
|
4946
4885
|
},
|
|
4947
4886
|
[onChange]
|
|
4948
4887
|
);
|
|
4949
4888
|
const setCalendarValue = React__default.useCallback(
|
|
4950
|
-
(value, nocheck) => {
|
|
4889
|
+
(value, nocheck, avoidShout) => {
|
|
4951
4890
|
if (value === "") {
|
|
4952
|
-
|
|
4891
|
+
if (getMaskForDateFormat().replaceAll("9", DEFAULT_MASK_PLACEHOLDER) !== inputValue)
|
|
4892
|
+
void shoutOnChange("");
|
|
4953
4893
|
setInputValue("");
|
|
4894
|
+
setCalValue(/* @__PURE__ */ new Date());
|
|
4954
4895
|
return;
|
|
4955
4896
|
}
|
|
4956
|
-
let newDate;
|
|
4957
|
-
if (
|
|
4958
|
-
newDate = dayjs(
|
|
4959
|
-
if (!newDate.isValid())
|
|
4960
|
-
newDate = dayjs(/* @__PURE__ */ new Date());
|
|
4961
|
-
} else {
|
|
4962
|
-
newDate = dayjs(/* @__PURE__ */ new Date());
|
|
4963
|
-
}
|
|
4897
|
+
let newDate = dayjs(value, dateFormat);
|
|
4898
|
+
if (!newDate.isValid())
|
|
4899
|
+
newDate = dayjs(/* @__PURE__ */ new Date(), dateFormat);
|
|
4964
4900
|
const formattedDate = newDate.format(dateFormat);
|
|
4965
4901
|
const today = /* @__PURE__ */ new Date();
|
|
4966
4902
|
today.setHours(0, 0, 0, 0);
|
|
@@ -4973,16 +4909,27 @@ const DateInput = React__default.forwardRef(
|
|
|
4973
4909
|
setInputValue("");
|
|
4974
4910
|
setError(window.MSG_FEC_FIN_MAY_FEC_INI);
|
|
4975
4911
|
} else {
|
|
4976
|
-
|
|
4977
|
-
if (shoutResult === false) {
|
|
4978
|
-
setInputValue(shoutResult || "");
|
|
4979
|
-
setError(null);
|
|
4980
|
-
} else if (typeof shoutResult === "string") {
|
|
4981
|
-
setInputValue("");
|
|
4982
|
-
setError(shoutResult);
|
|
4983
|
-
} else {
|
|
4912
|
+
if (avoidShout) {
|
|
4984
4913
|
setInputValue(formattedDate);
|
|
4985
4914
|
setError(null);
|
|
4915
|
+
setCalValue(newDate.toDate());
|
|
4916
|
+
} else {
|
|
4917
|
+
const shoutResult = shoutOnChange(
|
|
4918
|
+
value === "" ? "" : formattedDate
|
|
4919
|
+
);
|
|
4920
|
+
if (shoutResult === false) {
|
|
4921
|
+
setInputValue(shoutResult || "");
|
|
4922
|
+
setError(null);
|
|
4923
|
+
setCalValue(/* @__PURE__ */ new Date());
|
|
4924
|
+
} else if (typeof shoutResult === "string") {
|
|
4925
|
+
setInputValue("");
|
|
4926
|
+
setError(shoutResult);
|
|
4927
|
+
setCalValue(/* @__PURE__ */ new Date());
|
|
4928
|
+
} else {
|
|
4929
|
+
setInputValue(formattedDate);
|
|
4930
|
+
setError(null);
|
|
4931
|
+
setCalValue(newDate.toDate());
|
|
4932
|
+
}
|
|
4986
4933
|
}
|
|
4987
4934
|
}
|
|
4988
4935
|
},
|
|
@@ -4990,40 +4937,70 @@ const DateInput = React__default.forwardRef(
|
|
|
4990
4937
|
);
|
|
4991
4938
|
const selectDate = React__default.useCallback(
|
|
4992
4939
|
(val) => {
|
|
4993
|
-
hide();
|
|
4994
4940
|
const newValue = dayjs(val).format(dateFormat);
|
|
4995
4941
|
setCalendarValue(newValue, true);
|
|
4996
4942
|
},
|
|
4997
|
-
[
|
|
4943
|
+
[setCalendarValue]
|
|
4998
4944
|
);
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
4945
|
+
useEffect(() => {
|
|
4946
|
+
if (stateError !== "" && stateError !== null) {
|
|
4947
|
+
ApiaUtil.instance.notifications.notify({
|
|
4948
|
+
message: stateError,
|
|
4949
|
+
type: "warning"
|
|
4950
|
+
});
|
|
4951
|
+
}
|
|
4952
|
+
}, [stateError]);
|
|
5002
4953
|
const handleBlur = React__default.useCallback(
|
|
5003
4954
|
(ev) => {
|
|
4955
|
+
hasBlured.current = true;
|
|
4956
|
+
if (ev.target.value && !dayjs(ev.target.value, dateFormat, true).isValid()) {
|
|
4957
|
+
setInputValue("");
|
|
4958
|
+
onError?.(window.MSG_INVALID_DATE);
|
|
4959
|
+
return;
|
|
4960
|
+
}
|
|
5004
4961
|
if (onBlur && !isChild(ev.relatedTarget, (current) => {
|
|
5005
4962
|
return current.id === `DateModal${id}` || current.id === `DateInput${id}`;
|
|
5006
4963
|
})) {
|
|
5007
|
-
|
|
4964
|
+
const newEvent = {
|
|
4965
|
+
...ev,
|
|
4966
|
+
target: ev.target.matches("input.dateInput") ? ev.target : ev.target.closest(".dateInput")?.querySelector(
|
|
4967
|
+
"input"
|
|
4968
|
+
)
|
|
4969
|
+
};
|
|
4970
|
+
const actualBlur = onBlur instanceof Promise ? onBlur : (ev2) => new Promise((resolve) => {
|
|
4971
|
+
const result = onBlur?.(ev2);
|
|
4972
|
+
resolve(result);
|
|
4973
|
+
});
|
|
4974
|
+
void actualBlur(newEvent).then((result) => {
|
|
4975
|
+
if (typeof result === "string") {
|
|
4976
|
+
setError(result);
|
|
4977
|
+
} else if (result === false) {
|
|
4978
|
+
setInputValue("");
|
|
4979
|
+
}
|
|
4980
|
+
});
|
|
5008
4981
|
}
|
|
5009
4982
|
},
|
|
5010
|
-
[id, onBlur]
|
|
4983
|
+
[id, onBlur, onError]
|
|
5011
4984
|
);
|
|
5012
4985
|
const inputProps = React__default.useMemo(
|
|
5013
4986
|
() => ({
|
|
5014
|
-
...
|
|
5015
|
-
className:
|
|
5016
|
-
value: renderLabel ? renderLabel(inputValue) : inputValue,
|
|
5017
|
-
|
|
4987
|
+
...otherProps,
|
|
4988
|
+
className: `dateInput ${inputClassName ?? ""}`,
|
|
4989
|
+
value: stateError ? "" : renderLabel ? renderLabel(inputValue) : inputValue,
|
|
4990
|
+
ref,
|
|
5018
4991
|
onChange: (ev) => {
|
|
5019
4992
|
setInputValue(ev.target.value);
|
|
5020
4993
|
if (getMaskForDateFormat().replaceAll("9", DEFAULT_MASK_PLACEHOLDER) !== ev.target.value && ev.target.value !== "")
|
|
5021
4994
|
setError(null);
|
|
5022
4995
|
},
|
|
5023
4996
|
onBlur: (ev) => {
|
|
5024
|
-
if (!(props.readOnly || getCustomMask))
|
|
5025
|
-
setCalendarValue(ev.target.value);
|
|
5026
|
-
|
|
4997
|
+
if (!(props.readOnly || getCustomMask || document.querySelector(".overlay.screenLock")))
|
|
4998
|
+
setCalendarValue(ev.target.value, false, true);
|
|
4999
|
+
if (hasBlured.current) {
|
|
5000
|
+
hasBlured.current = false;
|
|
5001
|
+
} else if (!document.querySelector(".overlay.screenLock")) {
|
|
5002
|
+
handleBlur(ev);
|
|
5003
|
+
}
|
|
5027
5004
|
},
|
|
5028
5005
|
onKeyDown: (ev) => {
|
|
5029
5006
|
if (ev.key === "Enter")
|
|
@@ -5031,18 +5008,21 @@ const DateInput = React__default.forwardRef(
|
|
|
5031
5008
|
}
|
|
5032
5009
|
}),
|
|
5033
5010
|
[
|
|
5034
|
-
|
|
5035
|
-
|
|
5011
|
+
otherProps,
|
|
5012
|
+
inputClassName,
|
|
5013
|
+
stateError,
|
|
5014
|
+
renderLabel,
|
|
5036
5015
|
inputValue,
|
|
5037
|
-
props,
|
|
5038
5016
|
ref,
|
|
5039
|
-
|
|
5040
|
-
|
|
5017
|
+
props.readOnly,
|
|
5018
|
+
getCustomMask,
|
|
5019
|
+
setCalendarValue,
|
|
5020
|
+
handleBlur
|
|
5041
5021
|
]
|
|
5042
5022
|
);
|
|
5043
5023
|
const buttonProps = React__default.useMemo(
|
|
5044
5024
|
() => ({
|
|
5045
|
-
disabled: props.disabled
|
|
5025
|
+
disabled: props.disabled || props.readOnly,
|
|
5046
5026
|
"aria-label": window.LBL_PICK_DATE,
|
|
5047
5027
|
...outerButtonProps
|
|
5048
5028
|
}),
|
|
@@ -5060,60 +5040,118 @@ const DateInput = React__default.forwardRef(
|
|
|
5060
5040
|
`#DateInput${id} input`
|
|
5061
5041
|
)?.focus();
|
|
5062
5042
|
},
|
|
5063
|
-
type: "button",
|
|
5064
5043
|
title: getLabel("btnAiDelete").text,
|
|
5065
|
-
"aria-label": getLabel("btnAiDelete").text
|
|
5044
|
+
"aria-label": getLabel("btnAiDelete").text,
|
|
5045
|
+
type: "button"
|
|
5066
5046
|
}
|
|
5067
5047
|
),
|
|
5068
5048
|
[id, onDelete, setCalendarValue]
|
|
5069
5049
|
);
|
|
5070
|
-
return /* @__PURE__ */
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5050
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
5051
|
+
Box,
|
|
5052
|
+
{
|
|
5053
|
+
...getVariant("forms.dateInput"),
|
|
5054
|
+
className: `${className ?? ""} dateInput`,
|
|
5055
|
+
id: `DateInput${id}`,
|
|
5056
|
+
ref: boxRef,
|
|
5057
|
+
onBlur: (e) => {
|
|
5058
|
+
if (hasBlured.current) {
|
|
5059
|
+
hasBlured.current = false;
|
|
5060
|
+
} else if (!document.querySelector(".overlay.screenLock")) {
|
|
5061
|
+
handleBlur(e);
|
|
5062
|
+
}
|
|
5063
|
+
},
|
|
5064
|
+
children: /* @__PURE__ */ jsx(
|
|
5065
|
+
IconInput,
|
|
5066
|
+
{
|
|
5067
|
+
additionalButtons: inputValue && inputValue !== getMaskForDateFormat().replaceAll(
|
|
5068
|
+
"9",
|
|
5069
|
+
DEFAULT_MASK_PLACEHOLDER
|
|
5070
|
+
) && !props.readOnly && !props.disabled ? additionalButtons : void 0,
|
|
5071
|
+
buttonProps,
|
|
5072
|
+
className: `${stateError !== null ? "field__withError" : ""}`,
|
|
5073
|
+
icon: FaCalendarAlt,
|
|
5074
|
+
inputProps,
|
|
5075
|
+
isLoading,
|
|
5076
|
+
mask: getCustomMask ? getCustomMask() : getMaskForDateFormat(),
|
|
5077
|
+
maskPlaceholder: DEFAULT_MASK_PLACEHOLDER,
|
|
5078
|
+
onClick: (ev) => {
|
|
5079
|
+
const tooltip = ApiaUtil.instance.tooltips.open({
|
|
5080
|
+
attachToElement() {
|
|
5081
|
+
return ev.target.closest(
|
|
5082
|
+
"button"
|
|
5083
|
+
);
|
|
5084
|
+
},
|
|
5085
|
+
attachToElementAnchorPoint: "center",
|
|
5086
|
+
closeOnClick: false,
|
|
5087
|
+
closeOnClickOut: true,
|
|
5088
|
+
closeOnEscape: true,
|
|
5089
|
+
closeOnMouseLeaveTooltip: false,
|
|
5090
|
+
closeOnMouseLeaveAttachedElement: false,
|
|
5091
|
+
closeOnScrollOut: true,
|
|
5092
|
+
children: CalModalRenderer ? /* @__PURE__ */ jsx(
|
|
5093
|
+
CalModalRenderer,
|
|
5094
|
+
{
|
|
5095
|
+
calValue,
|
|
5096
|
+
locale: DEFAULT_LOCALE,
|
|
5097
|
+
handleClickDay: (ev2) => {
|
|
5098
|
+
selectDate(ev2);
|
|
5099
|
+
setCalValue(ev2);
|
|
5100
|
+
tooltip.close();
|
|
5101
|
+
}
|
|
5102
|
+
}
|
|
5103
|
+
) : /* @__PURE__ */ jsx(
|
|
5104
|
+
CalModal,
|
|
5105
|
+
{
|
|
5106
|
+
calValue,
|
|
5107
|
+
locale: DEFAULT_LOCALE,
|
|
5108
|
+
handleClickDay: (ev2) => {
|
|
5109
|
+
selectDate(ev2);
|
|
5110
|
+
setCalValue(ev2);
|
|
5111
|
+
tooltip.close();
|
|
5112
|
+
}
|
|
5113
|
+
}
|
|
5114
|
+
),
|
|
5115
|
+
initialFocusGetter(el) {
|
|
5116
|
+
return el.querySelector(`.react-calendar__tile--active`);
|
|
5117
|
+
},
|
|
5118
|
+
minSize: { width: 350, height: 310 }
|
|
5119
|
+
});
|
|
5120
|
+
},
|
|
5121
|
+
readOnly: props.readOnly
|
|
5122
|
+
}
|
|
5123
|
+
)
|
|
5124
|
+
}
|
|
5125
|
+
) });
|
|
5114
5126
|
}
|
|
5115
5127
|
);
|
|
5116
|
-
|
|
5128
|
+
|
|
5129
|
+
const FieldErrorMessage = ({ children, name }) => {
|
|
5130
|
+
const [ref, setRef] = React.useState(null);
|
|
5131
|
+
React.useEffect(() => {
|
|
5132
|
+
if (children) {
|
|
5133
|
+
const event = new CustomEvent(customEvents.focus, { bubbles: true });
|
|
5134
|
+
ref?.dispatchEvent(event);
|
|
5135
|
+
}
|
|
5136
|
+
}, [children, ref]);
|
|
5137
|
+
if (children) {
|
|
5138
|
+
return /* @__PURE__ */ jsx(
|
|
5139
|
+
Box,
|
|
5140
|
+
{
|
|
5141
|
+
ref: setRef,
|
|
5142
|
+
role: "alert",
|
|
5143
|
+
"data-testid": name ? `err_${name}` : null,
|
|
5144
|
+
sx: {
|
|
5145
|
+
mb: "0",
|
|
5146
|
+
color: "danger",
|
|
5147
|
+
pt: "2"
|
|
5148
|
+
},
|
|
5149
|
+
children
|
|
5150
|
+
}
|
|
5151
|
+
);
|
|
5152
|
+
}
|
|
5153
|
+
return null;
|
|
5154
|
+
};
|
|
5117
5155
|
|
|
5118
5156
|
function fillZeros(amount) {
|
|
5119
5157
|
return Array(Math.max(0, amount)).fill(0).join("");
|
|
@@ -5275,6 +5313,21 @@ const RequiredMark = ({
|
|
|
5275
5313
|
return isRequired && !isReadonly && !isFormReadonly ? /* @__PURE__ */ jsx("span", { className: "requiredMark", title: getLabel("msgReqField").text, children: "*" }) : null;
|
|
5276
5314
|
};
|
|
5277
5315
|
|
|
5316
|
+
const getFieldErrorStyles = (isValid) => {
|
|
5317
|
+
return {
|
|
5318
|
+
borderLeftStyle: !isValid ? "solid" : null,
|
|
5319
|
+
borderLeftWidth: !isValid ? "4px" : null,
|
|
5320
|
+
borderLeftColor: !isValid ? "danger" : void 0
|
|
5321
|
+
};
|
|
5322
|
+
};
|
|
5323
|
+
const getFieldTouchedStyles = (isTouched) => {
|
|
5324
|
+
return {
|
|
5325
|
+
borderStyle: isTouched ? "solid" : null,
|
|
5326
|
+
borderWidth: isTouched ? "1px" : null,
|
|
5327
|
+
borderColor: isTouched ? "orange" : void 0
|
|
5328
|
+
};
|
|
5329
|
+
};
|
|
5330
|
+
|
|
5278
5331
|
injectStyles("layout.common.components.fieldLabel", {
|
|
5279
5332
|
display: "flex",
|
|
5280
5333
|
flexDirection: "column",
|
|
@@ -5381,10 +5434,12 @@ const AutoEllipsis = ({
|
|
|
5381
5434
|
const timeout = useRef(0);
|
|
5382
5435
|
const ref = useCallback(
|
|
5383
5436
|
(el) => {
|
|
5384
|
-
if (!el)
|
|
5437
|
+
if (!el || !document.contains(el))
|
|
5385
5438
|
return;
|
|
5386
5439
|
unsuscribe.current();
|
|
5387
5440
|
function showBox() {
|
|
5441
|
+
if (!el || !document.contains(el))
|
|
5442
|
+
return;
|
|
5388
5443
|
document.querySelectorAll(".autoellipsis_clone").forEach((c) => c.remove());
|
|
5389
5444
|
clone.current = el.cloneNode(true);
|
|
5390
5445
|
const target = findParent?.(el) ?? el;
|
|
@@ -5416,18 +5471,17 @@ const AutoEllipsis = ({
|
|
|
5416
5471
|
clone.current.style.fill = "var(--theme-ui-colors-palette-text-primary)";
|
|
5417
5472
|
clone.current.style.pointerEvents = "none";
|
|
5418
5473
|
clone.current.style.wordBreak = "break-all";
|
|
5474
|
+
clone.current.classList.add("autoellipsis_clone");
|
|
5419
5475
|
const overridenStyles = overrideStyles?.(el);
|
|
5420
5476
|
if (overridenStyles) {
|
|
5421
|
-
|
|
5477
|
+
Object.entries(overridenStyles).forEach(([name, value]) => {
|
|
5478
|
+
if (name.match(/webkit/))
|
|
5479
|
+
return;
|
|
5422
5480
|
try {
|
|
5423
|
-
|
|
5424
|
-
const value = overridenStyles[name];
|
|
5425
|
-
if (!name.match(/webkit/)) {
|
|
5426
|
-
clone.current.style[name] = value;
|
|
5427
|
-
}
|
|
5481
|
+
clone.current.style[name] = value;
|
|
5428
5482
|
} catch (e) {
|
|
5429
5483
|
}
|
|
5430
|
-
}
|
|
5484
|
+
});
|
|
5431
5485
|
}
|
|
5432
5486
|
clone.current.addEventListener("mouseleave", (ev) => {
|
|
5433
5487
|
if (isChild(
|
|
@@ -5437,8 +5491,17 @@ const AutoEllipsis = ({
|
|
|
5437
5491
|
return;
|
|
5438
5492
|
clone.current?.remove();
|
|
5439
5493
|
});
|
|
5494
|
+
let interval = 0;
|
|
5440
5495
|
function close() {
|
|
5496
|
+
clone.current?.remove();
|
|
5497
|
+
document.removeEventListener("scroll", close);
|
|
5498
|
+
clearInterval(interval);
|
|
5441
5499
|
}
|
|
5500
|
+
interval = setInterval(() => {
|
|
5501
|
+
if (!document.contains(el)) {
|
|
5502
|
+
close();
|
|
5503
|
+
}
|
|
5504
|
+
}, 100);
|
|
5442
5505
|
document.addEventListener("scroll", close);
|
|
5443
5506
|
document.body.append(clone.current);
|
|
5444
5507
|
const cloneBounding = clone.current.getBoundingClientRect();
|
|
@@ -5665,19 +5728,40 @@ const AccordionItemContent = ({
|
|
|
5665
5728
|
const duration = handler.hooks.usePropsSelector(
|
|
5666
5729
|
(current) => current.animationDuration
|
|
5667
5730
|
);
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5731
|
+
const uns = useRef(() => {
|
|
5732
|
+
});
|
|
5733
|
+
return /* @__PURE__ */ jsxs(
|
|
5734
|
+
Box,
|
|
5735
|
+
{
|
|
5736
|
+
className: "accordion__item",
|
|
5737
|
+
"data-id": id,
|
|
5738
|
+
ref: (el) => {
|
|
5739
|
+
uns.current();
|
|
5740
|
+
if (el instanceof HTMLElement) {
|
|
5741
|
+
const handleFocus = () => {
|
|
5742
|
+
handler.toggleItem(id, true);
|
|
5743
|
+
};
|
|
5744
|
+
el.addEventListener(customEvents.focus, handleFocus);
|
|
5745
|
+
uns.current = () => {
|
|
5746
|
+
el.removeEventListener(customEvents.focus, handleFocus);
|
|
5747
|
+
};
|
|
5748
|
+
}
|
|
5749
|
+
},
|
|
5750
|
+
children: [
|
|
5751
|
+
button,
|
|
5752
|
+
/* @__PURE__ */ jsx(
|
|
5753
|
+
AnimateHeight,
|
|
5754
|
+
{
|
|
5755
|
+
className: `accordion__item__content ${isExpanded ? " expanded" : ""}`,
|
|
5756
|
+
height: isExpanded ? "auto" : 0,
|
|
5757
|
+
duration,
|
|
5758
|
+
id: `accordion__${handler.id}__${id}`,
|
|
5759
|
+
children: actualChildren
|
|
5760
|
+
}
|
|
5761
|
+
)
|
|
5762
|
+
]
|
|
5763
|
+
}
|
|
5764
|
+
);
|
|
5681
5765
|
};
|
|
5682
5766
|
|
|
5683
5767
|
const AccordionItem = ({
|
|
@@ -5873,6 +5957,7 @@ const LabelBox = ({
|
|
|
5873
5957
|
tooltip,
|
|
5874
5958
|
closeTooltip,
|
|
5875
5959
|
onClose,
|
|
5960
|
+
variant,
|
|
5876
5961
|
...props
|
|
5877
5962
|
}) => {
|
|
5878
5963
|
return /* @__PURE__ */ jsxs(
|
|
@@ -5880,17 +5965,16 @@ const LabelBox = ({
|
|
|
5880
5965
|
{
|
|
5881
5966
|
...props,
|
|
5882
5967
|
title: tooltip,
|
|
5883
|
-
className: `labelBox ${className ?? ""}`,
|
|
5884
|
-
|
|
5968
|
+
className: `labelBox ${className ?? ""} ${variant || "normal"}`,
|
|
5969
|
+
...getVariant("layout.common.boxes.labelBox"),
|
|
5885
5970
|
children: [
|
|
5886
5971
|
/* @__PURE__ */ jsx(Box, { className: "labelAndIcon", as: "span", children: label }),
|
|
5887
|
-
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
5972
|
+
onClose && /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
5888
5973
|
Close,
|
|
5889
5974
|
{
|
|
5890
5975
|
type: "button",
|
|
5891
5976
|
className: "closeButton",
|
|
5892
5977
|
onClick: onClose,
|
|
5893
|
-
disabled: !onClose,
|
|
5894
5978
|
title: closeTooltip,
|
|
5895
5979
|
variant: "icon-outline-danger"
|
|
5896
5980
|
}
|
|
@@ -5900,10 +5984,10 @@ const LabelBox = ({
|
|
|
5900
5984
|
);
|
|
5901
5985
|
};
|
|
5902
5986
|
|
|
5903
|
-
var __defProp$
|
|
5904
|
-
var __defNormalProp$
|
|
5905
|
-
var __publicField$
|
|
5906
|
-
__defNormalProp$
|
|
5987
|
+
var __defProp$e = Object.defineProperty;
|
|
5988
|
+
var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5989
|
+
var __publicField$e = (obj, key, value) => {
|
|
5990
|
+
__defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5907
5991
|
return value;
|
|
5908
5992
|
};
|
|
5909
5993
|
let maxId = 0;
|
|
@@ -5913,8 +5997,8 @@ class ChatMessage {
|
|
|
5913
5997
|
this.messageType = messageType;
|
|
5914
5998
|
this.attachments = attachments;
|
|
5915
5999
|
this.reference = reference;
|
|
5916
|
-
__publicField$
|
|
5917
|
-
__publicField$
|
|
6000
|
+
__publicField$e(this, "id");
|
|
6001
|
+
__publicField$e(this, "clone", () => new ChatMessage(
|
|
5918
6002
|
this.message,
|
|
5919
6003
|
this.messageType,
|
|
5920
6004
|
this.attachments.map((x) => {
|
|
@@ -6051,12 +6135,13 @@ const Dropzone = ({
|
|
|
6051
6135
|
className,
|
|
6052
6136
|
messageError,
|
|
6053
6137
|
progress = 0,
|
|
6054
|
-
defaultLabel = getLabel("
|
|
6138
|
+
defaultLabel = getLabel("btnUploadClass").text,
|
|
6055
6139
|
draggingLabel = getLabel("lblDroping").text,
|
|
6056
6140
|
onClick,
|
|
6057
|
-
onChange
|
|
6141
|
+
onChange,
|
|
6142
|
+
handleInfoButton
|
|
6058
6143
|
}) => {
|
|
6059
|
-
const innerSx = messageError ? { borderLeft: "
|
|
6144
|
+
const innerSx = messageError ? { borderLeft: "2px solid", borderColor: "danger" } : {};
|
|
6060
6145
|
const fileInputRef = useRef(null);
|
|
6061
6146
|
const handleClick = (ev) => {
|
|
6062
6147
|
onClick?.(ev);
|
|
@@ -6078,38 +6163,61 @@ const Dropzone = ({
|
|
|
6078
6163
|
return /* @__PURE__ */ jsxs(
|
|
6079
6164
|
Box,
|
|
6080
6165
|
{
|
|
6081
|
-
tabIndex: 0,
|
|
6082
6166
|
...getVariant("layout.execution.components.uploader.dropzone"),
|
|
6083
|
-
|
|
6084
|
-
className: `dropzone ${className ?? ""}`,
|
|
6085
|
-
onClick: handleClick,
|
|
6086
|
-
onDrop: (e) => {
|
|
6087
|
-
e.preventDefault();
|
|
6088
|
-
const newFiles = Array.from(e.dataTransfer.files);
|
|
6089
|
-
setIsDragging(false);
|
|
6090
|
-
onChange?.(newFiles);
|
|
6091
|
-
},
|
|
6092
|
-
onDragEnter: handleDragStart,
|
|
6093
|
-
onDragLeave: handleDragLeave,
|
|
6094
|
-
onDragOver: handleDragOver,
|
|
6167
|
+
className: "dropzone__container",
|
|
6095
6168
|
children: [
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
/* @__PURE__ */ jsx(
|
|
6099
|
-
"input",
|
|
6169
|
+
/* @__PURE__ */ jsxs(
|
|
6170
|
+
Box,
|
|
6100
6171
|
{
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
const newFiles = Array.from([...e.target.files]);
|
|
6109
|
-
onChange?.(newFiles);
|
|
6110
|
-
e.target.value = "";
|
|
6172
|
+
tabIndex: 0,
|
|
6173
|
+
sx: { ...innerSx, sx },
|
|
6174
|
+
className: `dropzone ${className ?? ""}`,
|
|
6175
|
+
onClick: handleClick,
|
|
6176
|
+
onKeyDown: (ev) => {
|
|
6177
|
+
if (ev.code === "Enter" || ev.code === "Space") {
|
|
6178
|
+
handleClick(ev);
|
|
6111
6179
|
}
|
|
6112
|
-
}
|
|
6180
|
+
},
|
|
6181
|
+
onDrop: (e) => {
|
|
6182
|
+
e.preventDefault();
|
|
6183
|
+
const newFiles = Array.from(e.dataTransfer.files);
|
|
6184
|
+
setIsDragging(false);
|
|
6185
|
+
onChange?.(newFiles);
|
|
6186
|
+
},
|
|
6187
|
+
onDragEnter: handleDragStart,
|
|
6188
|
+
onDragLeave: handleDragLeave,
|
|
6189
|
+
onDragOver: handleDragOver,
|
|
6190
|
+
children: [
|
|
6191
|
+
progress > 0 && progress < 100 && /* @__PURE__ */ jsx(Progress, { max: 100, value: progress, className: "progressBar" }),
|
|
6192
|
+
messageError ? /* @__PURE__ */ jsx(Box, { color: "danger", children: messageError }) : isDragging ? draggingLabel : defaultLabel,
|
|
6193
|
+
/* @__PURE__ */ jsx(
|
|
6194
|
+
"input",
|
|
6195
|
+
{
|
|
6196
|
+
multiple: true,
|
|
6197
|
+
type: "file",
|
|
6198
|
+
ref: fileInputRef,
|
|
6199
|
+
style: { display: "none" },
|
|
6200
|
+
onChange: (e) => {
|
|
6201
|
+
e.preventDefault();
|
|
6202
|
+
if (e.target.files) {
|
|
6203
|
+
const newFiles = Array.from([...e.target.files]);
|
|
6204
|
+
onChange?.(newFiles);
|
|
6205
|
+
e.target.value = "";
|
|
6206
|
+
}
|
|
6207
|
+
}
|
|
6208
|
+
}
|
|
6209
|
+
)
|
|
6210
|
+
]
|
|
6211
|
+
}
|
|
6212
|
+
),
|
|
6213
|
+
handleInfoButton && /* @__PURE__ */ jsx(
|
|
6214
|
+
IconButton,
|
|
6215
|
+
{
|
|
6216
|
+
className: "info",
|
|
6217
|
+
iconSize: "Sm",
|
|
6218
|
+
icon: "Info",
|
|
6219
|
+
onMouseEnter: handleInfoButton,
|
|
6220
|
+
onClick: handleClick
|
|
6113
6221
|
}
|
|
6114
6222
|
)
|
|
6115
6223
|
]
|
|
@@ -6117,6 +6225,86 @@ const Dropzone = ({
|
|
|
6117
6225
|
);
|
|
6118
6226
|
};
|
|
6119
6227
|
|
|
6228
|
+
var __defProp$d = Object.defineProperty;
|
|
6229
|
+
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6230
|
+
var __publicField$d = (obj, key, value) => {
|
|
6231
|
+
__defNormalProp$d(obj, key + "" , value);
|
|
6232
|
+
return value;
|
|
6233
|
+
};
|
|
6234
|
+
class UploadHandler {
|
|
6235
|
+
constructor(props) {
|
|
6236
|
+
this.props = props;
|
|
6237
|
+
__publicField$d(this, "state", { inProgressFiles: [], uploadedFiles: [] });
|
|
6238
|
+
makeAutoObservable(this);
|
|
6239
|
+
this.state.uploadedFiles = this.props.initialFiles;
|
|
6240
|
+
}
|
|
6241
|
+
delete(file) {
|
|
6242
|
+
this.props.onDelete(file).then((res) => {
|
|
6243
|
+
if (res === true) {
|
|
6244
|
+
this.state.uploadedFiles = this.state.uploadedFiles.filter(
|
|
6245
|
+
(c) => c !== file
|
|
6246
|
+
);
|
|
6247
|
+
} else if (typeof res === "string") {
|
|
6248
|
+
ApiaUtil.instance.notifications.notify({
|
|
6249
|
+
message: res
|
|
6250
|
+
});
|
|
6251
|
+
}
|
|
6252
|
+
});
|
|
6253
|
+
}
|
|
6254
|
+
start(files) {
|
|
6255
|
+
files.forEach((file) => {
|
|
6256
|
+
const newUpload = {
|
|
6257
|
+
abortController: new AbortController(),
|
|
6258
|
+
id: uniqueId$4("file_upload"),
|
|
6259
|
+
file,
|
|
6260
|
+
progress: 0
|
|
6261
|
+
};
|
|
6262
|
+
this.state.inProgressFiles.push(newUpload);
|
|
6263
|
+
this.props.onUpload(newUpload).then((res) => {
|
|
6264
|
+
this.state.inProgressFiles = this.state.inProgressFiles.filter(
|
|
6265
|
+
(c) => c.id !== newUpload.id
|
|
6266
|
+
);
|
|
6267
|
+
if (typeof res === "string") {
|
|
6268
|
+
ApiaUtil.instance.notifications.notify({
|
|
6269
|
+
message: res,
|
|
6270
|
+
icon: ""
|
|
6271
|
+
});
|
|
6272
|
+
} else if (res) {
|
|
6273
|
+
this.state.uploadedFiles.push(res);
|
|
6274
|
+
}
|
|
6275
|
+
});
|
|
6276
|
+
});
|
|
6277
|
+
}
|
|
6278
|
+
}
|
|
6279
|
+
const Uploader = observer(({ handler }) => {
|
|
6280
|
+
return /* @__PURE__ */ jsxs(Box, { className: "file_uploader", children: [
|
|
6281
|
+
/* @__PURE__ */ jsx(Box, { className: "file_uploader__dropzone", children: (handler.props.isMultiple || handler.state.uploadedFiles.length === 0 && handler.state.inProgressFiles.length === 0) && /* @__PURE__ */ jsx(
|
|
6282
|
+
Dropzone,
|
|
6283
|
+
{
|
|
6284
|
+
onChange: (ev) => {
|
|
6285
|
+
handler.start(ev);
|
|
6286
|
+
}
|
|
6287
|
+
}
|
|
6288
|
+
) }),
|
|
6289
|
+
/* @__PURE__ */ jsx(Box, { className: "file_uploader__in_progress", children: handler.state.inProgressFiles.map((c) => /* @__PURE__ */ jsx(
|
|
6290
|
+
Dropzone,
|
|
6291
|
+
{
|
|
6292
|
+
progress: c.progress,
|
|
6293
|
+
messageError: c.error
|
|
6294
|
+
},
|
|
6295
|
+
c.file.name
|
|
6296
|
+
)) }),
|
|
6297
|
+
/* @__PURE__ */ jsx(Box, { className: "file_uploader__files_list", children: handler.state.uploadedFiles.map((c) => /* @__PURE__ */ jsx(
|
|
6298
|
+
FileCard,
|
|
6299
|
+
{
|
|
6300
|
+
name: c.name,
|
|
6301
|
+
handleClose: () => handler.delete(c)
|
|
6302
|
+
},
|
|
6303
|
+
c.id
|
|
6304
|
+
)) })
|
|
6305
|
+
] });
|
|
6306
|
+
});
|
|
6307
|
+
|
|
6120
6308
|
const FileAttachment = observer(
|
|
6121
6309
|
({
|
|
6122
6310
|
attachment,
|
|
@@ -6187,14 +6375,15 @@ const Attachments = observer(
|
|
|
6187
6375
|
({
|
|
6188
6376
|
attachments,
|
|
6189
6377
|
onRemove,
|
|
6190
|
-
onAddDescription
|
|
6378
|
+
onAddDescription,
|
|
6379
|
+
className
|
|
6191
6380
|
}) => {
|
|
6192
6381
|
if (!attachments.length)
|
|
6193
6382
|
return null;
|
|
6194
6383
|
return /* @__PURE__ */ jsx(
|
|
6195
6384
|
Box,
|
|
6196
6385
|
{
|
|
6197
|
-
className:
|
|
6386
|
+
className: `attachments ${className}`,
|
|
6198
6387
|
...getVariant("layout.common.chat.attachments"),
|
|
6199
6388
|
children: attachments.map((x) => /* @__PURE__ */ jsx(
|
|
6200
6389
|
FileAttachment,
|
|
@@ -6804,7 +6993,7 @@ const _Templater = class _Templater {
|
|
|
6804
6993
|
Object.entries(replacementVars).forEach(([varName, varContent]) => {
|
|
6805
6994
|
if (varContent)
|
|
6806
6995
|
Object.entries(varContent).forEach(([key, value]) => {
|
|
6807
|
-
if (isFunction
|
|
6996
|
+
if (isFunction(value)) {
|
|
6808
6997
|
if (!contextMethods[contextId])
|
|
6809
6998
|
contextMethods[contextId] = {};
|
|
6810
6999
|
const methodId = uniqueId$3();
|
|
@@ -6903,38 +7092,43 @@ const Message = observer(
|
|
|
6903
7092
|
}
|
|
6904
7093
|
);
|
|
6905
7094
|
|
|
6906
|
-
const History = observer(
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
first =
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
return /* @__PURE__ */ jsx(
|
|
6924
|
-
Message,
|
|
6925
|
-
{
|
|
6926
|
-
className: first ? "first" : last ? "last" : void 0,
|
|
6927
|
-
type: current.messageType,
|
|
6928
|
-
id: String(current.id),
|
|
6929
|
-
attachments: current.attachments,
|
|
6930
|
-
reference: current.reference,
|
|
6931
|
-
message: current.message
|
|
7095
|
+
const History = observer(
|
|
7096
|
+
({
|
|
7097
|
+
messages,
|
|
7098
|
+
className
|
|
7099
|
+
}) => {
|
|
7100
|
+
let currentType = "";
|
|
7101
|
+
return /* @__PURE__ */ jsx(AutoscrollContainer, { className, children: /* @__PURE__ */ jsx(
|
|
7102
|
+
Box,
|
|
7103
|
+
{
|
|
7104
|
+
...getVariant("layout.common.chat.history"),
|
|
7105
|
+
className: "chat_history",
|
|
7106
|
+
children: messages.map((current, i) => {
|
|
7107
|
+
let first = false;
|
|
7108
|
+
let last = false;
|
|
7109
|
+
if (currentType !== current.messageType) {
|
|
7110
|
+
currentType = current.messageType;
|
|
7111
|
+
first = true;
|
|
6932
7112
|
}
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
7113
|
+
if (i === messages.length - 1 || messages[i + 1].messageType !== current.messageType) {
|
|
7114
|
+
last = true;
|
|
7115
|
+
}
|
|
7116
|
+
return /* @__PURE__ */ jsx(
|
|
7117
|
+
Message,
|
|
7118
|
+
{
|
|
7119
|
+
className: first ? "first" : last ? "last" : void 0,
|
|
7120
|
+
type: current.messageType,
|
|
7121
|
+
id: String(current.id),
|
|
7122
|
+
attachments: current.attachments,
|
|
7123
|
+
reference: current.reference,
|
|
7124
|
+
message: current.message
|
|
7125
|
+
}
|
|
7126
|
+
);
|
|
7127
|
+
})
|
|
7128
|
+
}
|
|
7129
|
+
) });
|
|
7130
|
+
}
|
|
7131
|
+
);
|
|
6938
7132
|
|
|
6939
7133
|
function getBase64FromFile(f) {
|
|
6940
7134
|
return ((f2) => new Promise((resolve, reject) => {
|
|
@@ -6980,7 +7174,8 @@ const TextArea = observer(
|
|
|
6980
7174
|
onPrev,
|
|
6981
7175
|
onNext,
|
|
6982
7176
|
value,
|
|
6983
|
-
attachments
|
|
7177
|
+
attachments,
|
|
7178
|
+
className
|
|
6984
7179
|
}) => {
|
|
6985
7180
|
const fileInputRef = useRef(null);
|
|
6986
7181
|
const searchControlsRef = useRef(null);
|
|
@@ -7072,7 +7267,7 @@ const TextArea = observer(
|
|
|
7072
7267
|
ev.preventDefault();
|
|
7073
7268
|
onSubmit();
|
|
7074
7269
|
},
|
|
7075
|
-
className:
|
|
7270
|
+
className: `search_controls ${className}`,
|
|
7076
7271
|
...getVariant("layout.common.chat.form"),
|
|
7077
7272
|
children: [
|
|
7078
7273
|
dragging ? /* @__PURE__ */ jsx(
|
|
@@ -7089,7 +7284,6 @@ const TextArea = observer(
|
|
|
7089
7284
|
children: getLabel("msgAiDragAndDrop").text
|
|
7090
7285
|
}
|
|
7091
7286
|
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7092
|
-
" ",
|
|
7093
7287
|
/* @__PURE__ */ jsx(
|
|
7094
7288
|
AutogrowTextarea,
|
|
7095
7289
|
{
|
|
@@ -7241,7 +7435,7 @@ class CameraController {
|
|
|
7241
7435
|
}
|
|
7242
7436
|
async closeCamera() {
|
|
7243
7437
|
if (!this.videoElement.srcObject)
|
|
7244
|
-
return
|
|
7438
|
+
return;
|
|
7245
7439
|
const canvas = document.createElement("canvas");
|
|
7246
7440
|
canvas.width = this.videoElement.videoWidth;
|
|
7247
7441
|
canvas.height = this.videoElement.videoHeight;
|
|
@@ -7280,9 +7474,10 @@ var __publicField$a = (obj, key, value) => {
|
|
|
7280
7474
|
return value;
|
|
7281
7475
|
};
|
|
7282
7476
|
class ChatController {
|
|
7283
|
-
constructor(props, onMessageSubmit, additionalOptions) {
|
|
7477
|
+
constructor(props, onMessageSubmit, additionalOptions, classNames) {
|
|
7284
7478
|
this.onMessageSubmit = onMessageSubmit;
|
|
7285
7479
|
this.additionalOptions = additionalOptions;
|
|
7480
|
+
this.classNames = classNames;
|
|
7286
7481
|
__publicField$a(this, "currentIndex", 0);
|
|
7287
7482
|
__publicField$a(this, "state", {
|
|
7288
7483
|
isLoading: false,
|
|
@@ -7346,7 +7541,13 @@ class ChatController {
|
|
|
7346
7541
|
}
|
|
7347
7542
|
}
|
|
7348
7543
|
});
|
|
7349
|
-
__publicField$a(this, "History", observer(() => /* @__PURE__ */ jsx(
|
|
7544
|
+
__publicField$a(this, "History", observer(() => /* @__PURE__ */ jsx(
|
|
7545
|
+
History,
|
|
7546
|
+
{
|
|
7547
|
+
messages: this.state.messages,
|
|
7548
|
+
className: this.classNames?.history
|
|
7549
|
+
}
|
|
7550
|
+
)));
|
|
7350
7551
|
__publicField$a(this, "Attachments", observer(() => /* @__PURE__ */ jsx(
|
|
7351
7552
|
Attachments,
|
|
7352
7553
|
{
|
|
@@ -7354,6 +7555,7 @@ class ChatController {
|
|
|
7354
7555
|
onRemove: (a) => {
|
|
7355
7556
|
this.removeAttachment(a);
|
|
7356
7557
|
},
|
|
7558
|
+
className: this.classNames?.attachments,
|
|
7357
7559
|
onAddDescription: (a, ev) => this.state.currentMessage.addAttachmentDescription(a, ev)
|
|
7358
7560
|
}
|
|
7359
7561
|
)));
|
|
@@ -7361,6 +7563,7 @@ class ChatController {
|
|
|
7361
7563
|
TextArea,
|
|
7362
7564
|
{
|
|
7363
7565
|
additionalOptions: this.additionalOptions,
|
|
7566
|
+
className: this.classNames?.textarea,
|
|
7364
7567
|
value: this.state.currentMessage.message,
|
|
7365
7568
|
isLoading: this.state.isLoading,
|
|
7366
7569
|
isRecording: this.internalAudioRecorder.state.recording,
|
|
@@ -7539,7 +7742,8 @@ class FloatingChatController extends ChatController {
|
|
|
7539
7742
|
super(
|
|
7540
7743
|
{ isWindowOpen: false, ...props },
|
|
7541
7744
|
props.onMessageSubmit,
|
|
7542
|
-
props.additionalOptions
|
|
7745
|
+
props.additionalOptions,
|
|
7746
|
+
props.classNames
|
|
7543
7747
|
);
|
|
7544
7748
|
__publicField$9(this, "modalTitle");
|
|
7545
7749
|
__publicField$9(this, "Window", observer(() => {
|
|
@@ -7737,7 +7941,7 @@ const CollapsiblePanel = React__default.forwardRef(
|
|
|
7737
7941
|
className: `collapsiblePanel ${className ?? ""}`,
|
|
7738
7942
|
...getVariant("layout.common.components.collapsiblePanel"),
|
|
7739
7943
|
ref: (el) => {
|
|
7740
|
-
if (isFunction(outerRef))
|
|
7944
|
+
if (isFunction$1(outerRef))
|
|
7741
7945
|
outerRef(el);
|
|
7742
7946
|
setRef(el);
|
|
7743
7947
|
},
|
|
@@ -10929,5 +11133,5 @@ const _FiltersStore = class _FiltersStore {
|
|
|
10929
11133
|
__publicField(_FiltersStore, "instance", new _FiltersStore());
|
|
10930
11134
|
let FiltersStore = _FiltersStore;
|
|
10931
11135
|
|
|
10932
|
-
export { Accordion, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, AutoEllipsis, Autocomplete, AutocompleteController, AutogrowTextarea, AutoscrollContainer, BaseButton, CalendarModal, Captcha, ChatController, ChatMessage, Checkbox$1 as Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingChatController, IconButton, IconInput, IconsList, LabelBox, LinearLoader, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, Modal, NumberInput, Overlay, Parameter, ParameterRender, Parameters, ParametersGroup, ParametersStore, ParametersTable, ProgressBar, RequiredMark, ScreenLocker, SimpleButton, SortableList, SortableListItem, Tab, Tabs, TabsContent, TabsController, TabsList, Templater, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, UnstyledSortableList, WaiTypeAhead, getBase64FromBlob, getBase64FromFile, getFieldErrorStyles, getFieldTouchedStyles, getFileExtension, importComponent, isImage, isParametersGroup, makeResponsiveComponent, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useModal, useModalContext, useOtherTagButton, useTabsContext };
|
|
11136
|
+
export { Accordion, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, AutoEllipsis, Autocomplete, AutocompleteController, AutogrowTextarea, AutoscrollContainer, BaseButton, CalendarModal, Captcha, ChatController, ChatMessage, Checkbox$1 as Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingChatController, IconButton, IconInput, IconsList, LabelBox, LinearLoader, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, Modal, NumberInput, Overlay, Parameter, ParameterRender, Parameters, ParametersGroup, ParametersStore, ParametersTable, ProgressBar, RequiredMark, ScreenLocker, 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, isImage, isParametersGroup, makeResponsiveComponent, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useModal, useModalContext, useOtherTagButton, useTabsContext };
|
|
10933
11137
|
//# sourceMappingURL=index.js.map
|