@apia/components 4.0.44 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +75 -66
- package/dist/index.js +617 -451
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -4,10 +4,10 @@ import React__default, { createContext, useContext, useEffect, useMemo, useState
|
|
|
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
6
|
import { uniqueId as uniqueId$3, cloneDeep, isFunction as isFunction$1 } from 'lodash-es';
|
|
7
|
-
import { Box, getVariant, useBreakpointIndex, Close, responsive, spacing, Heading, Link, Button, Spinner, createElement, Select, Input, Flex, IconButton as IconButton$1, Image, injectStyles, focusOutline, makeStyledComponent, useThemeUI, Label as Label$1, Progress, Grid, Paragraph, Container, Textarea } from '@apia/theme';
|
|
7
|
+
import { Box, getVariant, useBreakpointIndex, Close, responsive, spacing, Heading, Link, Button, Spinner, createElement, Select, Input, Flex, IconButton as IconButton$1, Image, injectStyles, focusOutline, makeStyledComponent, useThemeUI, Label as Label$1, Progress, Grid, Paragraph, Container, Switch, Textarea } from '@apia/theme';
|
|
8
8
|
import { BarLoader } from 'react-spinners';
|
|
9
9
|
import uniqueId$2 from 'lodash-es/uniqueId';
|
|
10
|
-
import { findScrollContainer, useUpdateEffect, focus, focusSelector, getFocusSelector, addBoundary, useCombinedRefs, usePrevious, getLabel, dateToApiaFormat, dateFromApiaFormat, isChild, EventEmitter, useUnmount, useMount, StatefulEmitter, shallowEqual as shallowEqual$1, getSpecificParent, getDateFormat, customEvents, persistentStorage, disableChildrenFocus, enableChildrenFocus, decodeHTMLEntities, useDebouncedCallback, getIndex, noNaN, useLatest, useSubscription,
|
|
10
|
+
import { findScrollContainer, useUpdateEffect, focus, focusSelector, getFocusSelector, addBoundary, useCombinedRefs, usePrevious, getLabel, dateToApiaFormat, dateFromApiaFormat, isChild, EventEmitter, useUnmount, useMount, StatefulEmitter, shallowEqual as shallowEqual$1, getSpecificParent, uniqueId as uniqueId$4, getDateFormat, customEvents, persistentStorage, disableChildrenFocus, enableChildrenFocus, decodeHTMLEntities, useDebouncedCallback, getIndex, noNaN, useLatest, useSubscription, toBoolean, useMatchScrollDirection, arrayOrArray } from '@apia/util';
|
|
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';
|
|
@@ -21,13 +21,14 @@ import { shallowEqual } from '@apia/store';
|
|
|
21
21
|
import AnimateHeight from 'react-animate-height';
|
|
22
22
|
import { useUpdateEffect as useUpdateEffect$1, useScroll } from 'ahooks';
|
|
23
23
|
import { FaCalendarAlt, FaBars } from '@meronex/icons/fa';
|
|
24
|
-
import dayjs from 'dayjs';
|
|
25
|
-
import Calendar from 'react-calendar';
|
|
26
24
|
import ReactInputMask from 'react-input-mask';
|
|
25
|
+
import Calendar from 'react-calendar';
|
|
26
|
+
import dayjs from 'dayjs';
|
|
27
27
|
import isFunction from 'lodash-es/isFunction';
|
|
28
28
|
import { createFAsomeStore } from '@apia/dom-store';
|
|
29
29
|
import { keyframes } from '@emotion/react';
|
|
30
30
|
import { Remarkable } from 'remarkable';
|
|
31
|
+
import { makeApiaUsersModal2, makeApiaPoolsModals2 } from '@apia/api';
|
|
31
32
|
|
|
32
33
|
const AccordionContext = createContext(null);
|
|
33
34
|
const AccordionItemContext = createContext(null);
|
|
@@ -38,10 +39,10 @@ const useAccordionContext = () => {
|
|
|
38
39
|
return context;
|
|
39
40
|
};
|
|
40
41
|
|
|
41
|
-
var __defProp$
|
|
42
|
-
var __defNormalProp$
|
|
43
|
-
var __publicField$
|
|
44
|
-
__defNormalProp$
|
|
42
|
+
var __defProp$p = Object.defineProperty;
|
|
43
|
+
var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
44
|
+
var __publicField$p = (obj, key, value) => {
|
|
45
|
+
__defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
45
46
|
return value;
|
|
46
47
|
};
|
|
47
48
|
function makeItemStateSelectorHook(handler) {
|
|
@@ -73,10 +74,10 @@ class AccordionHandler {
|
|
|
73
74
|
constructor(id, props) {
|
|
74
75
|
this.id = id;
|
|
75
76
|
this.props = props;
|
|
76
|
-
__publicField$
|
|
77
|
-
__publicField$
|
|
78
|
-
__publicField$
|
|
79
|
-
__publicField$
|
|
77
|
+
__publicField$p(this, "itemsState", {});
|
|
78
|
+
__publicField$p(this, "itemsStateListeners", {});
|
|
79
|
+
__publicField$p(this, "propsListeners", []);
|
|
80
|
+
__publicField$p(this, "hooks", {
|
|
80
81
|
useAccordionContextProvider: () => {
|
|
81
82
|
const Provider = useMemo(
|
|
82
83
|
() => ({ children }) => /* @__PURE__ */ jsx(AccordionContext.Provider, { value: this, children }),
|
|
@@ -1019,10 +1020,10 @@ const WindowModal = forwardRef(
|
|
|
1019
1020
|
}
|
|
1020
1021
|
);
|
|
1021
1022
|
|
|
1022
|
-
var __defProp$
|
|
1023
|
-
var __defNormalProp$
|
|
1024
|
-
var __publicField$
|
|
1025
|
-
__defNormalProp$
|
|
1023
|
+
var __defProp$o = Object.defineProperty;
|
|
1024
|
+
var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1025
|
+
var __publicField$o = (obj, key, value) => {
|
|
1026
|
+
__defNormalProp$o(obj, key + "" , value);
|
|
1026
1027
|
return value;
|
|
1027
1028
|
};
|
|
1028
1029
|
var __accessCheck$d = (obj, member, msg) => {
|
|
@@ -1087,7 +1088,7 @@ _onDestroyCb = new WeakMap();
|
|
|
1087
1088
|
const BodyScrollLock = new (_a = class {
|
|
1088
1089
|
constructor() {
|
|
1089
1090
|
__privateAdd$d(this, _evaluate);
|
|
1090
|
-
__publicField$
|
|
1091
|
+
__publicField$o(this, "lockers", []);
|
|
1091
1092
|
}
|
|
1092
1093
|
getLocker() {
|
|
1093
1094
|
const locker = new BodyScrollLocker();
|
|
@@ -1432,10 +1433,10 @@ const OpenModal = (props) => {
|
|
|
1432
1433
|
);
|
|
1433
1434
|
};
|
|
1434
1435
|
|
|
1435
|
-
var __defProp$
|
|
1436
|
-
var __defNormalProp$
|
|
1437
|
-
var __publicField$
|
|
1438
|
-
__defNormalProp$
|
|
1436
|
+
var __defProp$n = Object.defineProperty;
|
|
1437
|
+
var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1438
|
+
var __publicField$n = (obj, key, value) => {
|
|
1439
|
+
__defNormalProp$n(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1439
1440
|
return value;
|
|
1440
1441
|
};
|
|
1441
1442
|
var __accessCheck$c = (obj, member, msg) => {
|
|
@@ -1479,14 +1480,14 @@ class ApiaUtilModalHandler {
|
|
|
1479
1480
|
}
|
|
1480
1481
|
class ApiaUtilModals {
|
|
1481
1482
|
constructor() {
|
|
1482
|
-
__publicField$
|
|
1483
|
-
__publicField$
|
|
1483
|
+
__publicField$n(this, "overlays", []);
|
|
1484
|
+
__publicField$n(this, "modals", []);
|
|
1484
1485
|
__privateAdd$c(this, _maxId$1, 0);
|
|
1485
1486
|
__privateAdd$c(this, _maxOverlay, 0);
|
|
1486
1487
|
__privateAdd$c(this, _innerClose, (id) => {
|
|
1487
1488
|
this.modals = this.modals.filter((s) => s.id !== id);
|
|
1488
1489
|
});
|
|
1489
|
-
__publicField$
|
|
1490
|
+
__publicField$n(this, "Component", observer(() => {
|
|
1490
1491
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1491
1492
|
this.modals.map((current) => /* @__PURE__ */ jsx(OpenModal, { ...current }, current.id)),
|
|
1492
1493
|
this.overlays.map((c) => c.render)
|
|
@@ -1576,29 +1577,37 @@ _maxId$1 = new WeakMap();
|
|
|
1576
1577
|
_maxOverlay = new WeakMap();
|
|
1577
1578
|
_innerClose = new WeakMap();
|
|
1578
1579
|
|
|
1579
|
-
var __defProp$
|
|
1580
|
-
var __defNormalProp$
|
|
1581
|
-
var __publicField$
|
|
1582
|
-
__defNormalProp$
|
|
1580
|
+
var __defProp$m = Object.defineProperty;
|
|
1581
|
+
var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1582
|
+
var __publicField$m = (obj, key, value) => {
|
|
1583
|
+
__defNormalProp$m(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1583
1584
|
return value;
|
|
1584
1585
|
};
|
|
1585
1586
|
class ApiaUtilNotifications {
|
|
1586
|
-
constructor() {
|
|
1587
|
-
|
|
1587
|
+
constructor(util) {
|
|
1588
|
+
this.util = util;
|
|
1589
|
+
__publicField$m(this, "close", (id) => {
|
|
1588
1590
|
defaultNotifier.close(id);
|
|
1589
1591
|
});
|
|
1590
|
-
__publicField$
|
|
1592
|
+
__publicField$m(this, "closeAll", () => {
|
|
1591
1593
|
defaultNotifier.closeAll();
|
|
1592
1594
|
});
|
|
1593
|
-
__publicField$
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1595
|
+
__publicField$m(this, "notify", (notification) => {
|
|
1596
|
+
if (notification.type === "modal") {
|
|
1597
|
+
this.util.dialogs.alert({
|
|
1598
|
+
children: notification.message,
|
|
1599
|
+
title: notification.title || ""
|
|
1600
|
+
});
|
|
1601
|
+
} else {
|
|
1602
|
+
defaultNotifier.notify({
|
|
1603
|
+
...notification,
|
|
1604
|
+
type: notification.type ?? "warning"
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1598
1607
|
});
|
|
1599
1608
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1600
|
-
__publicField$
|
|
1601
|
-
__publicField$
|
|
1609
|
+
__publicField$m(this, "useSelector", (selector) => defaultNotifier.useSelector(selector));
|
|
1610
|
+
__publicField$m(this, "Component", () => {
|
|
1602
1611
|
return /* @__PURE__ */ jsx(NotificationsList, {});
|
|
1603
1612
|
});
|
|
1604
1613
|
}
|
|
@@ -2021,10 +2030,10 @@ const AlertModal = ({
|
|
|
2021
2030
|
);
|
|
2022
2031
|
};
|
|
2023
2032
|
|
|
2024
|
-
var __defProp$
|
|
2025
|
-
var __defNormalProp$
|
|
2026
|
-
var __publicField$
|
|
2027
|
-
__defNormalProp$
|
|
2033
|
+
var __defProp$l = Object.defineProperty;
|
|
2034
|
+
var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2035
|
+
var __publicField$l = (obj, key, value) => {
|
|
2036
|
+
__defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2028
2037
|
return value;
|
|
2029
2038
|
};
|
|
2030
2039
|
var __accessCheck$b = (obj, member, msg) => {
|
|
@@ -2058,9 +2067,9 @@ class ApiaUtilDialogs {
|
|
|
2058
2067
|
constructor() {
|
|
2059
2068
|
__privateAdd$b(this, _maxIdAlert, 0);
|
|
2060
2069
|
__privateAdd$b(this, _maxIdConfirm, 0);
|
|
2061
|
-
__publicField$
|
|
2062
|
-
__publicField$
|
|
2063
|
-
__publicField$
|
|
2070
|
+
__publicField$l(this, "alerts", []);
|
|
2071
|
+
__publicField$l(this, "dialogs", []);
|
|
2072
|
+
__publicField$l(this, "Component", observer(() => {
|
|
2064
2073
|
const removeModal = useCallback(
|
|
2065
2074
|
(which) => {
|
|
2066
2075
|
this.dialogs = this.dialogs.filter((search) => search !== which);
|
|
@@ -2330,10 +2339,10 @@ parseCellValue_fn = function(cellValue) {
|
|
|
2330
2339
|
return cellValue.match(/^\s*"?([^"]+)"?[\s\r\n]*$/)?.[1] ?? cellValue;
|
|
2331
2340
|
};
|
|
2332
2341
|
|
|
2333
|
-
var __defProp$
|
|
2334
|
-
var __defNormalProp$
|
|
2335
|
-
var __publicField$
|
|
2336
|
-
__defNormalProp$
|
|
2342
|
+
var __defProp$k = Object.defineProperty;
|
|
2343
|
+
var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2344
|
+
var __publicField$k = (obj, key, value) => {
|
|
2345
|
+
__defNormalProp$k(obj, key + "" , value);
|
|
2337
2346
|
return value;
|
|
2338
2347
|
};
|
|
2339
2348
|
let maxId = 0;
|
|
@@ -2341,14 +2350,14 @@ class ApiaUtilTooltip {
|
|
|
2341
2350
|
constructor(props, close) {
|
|
2342
2351
|
this.props = props;
|
|
2343
2352
|
this.close = close;
|
|
2344
|
-
__publicField$
|
|
2353
|
+
__publicField$k(this, "id", `tooltip__${maxId++}`);
|
|
2345
2354
|
}
|
|
2346
2355
|
}
|
|
2347
2356
|
|
|
2348
|
-
var __defProp$
|
|
2349
|
-
var __defNormalProp$
|
|
2350
|
-
var __publicField$
|
|
2351
|
-
__defNormalProp$
|
|
2357
|
+
var __defProp$j = Object.defineProperty;
|
|
2358
|
+
var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2359
|
+
var __publicField$j = (obj, key, value) => {
|
|
2360
|
+
__defNormalProp$j(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2352
2361
|
return value;
|
|
2353
2362
|
};
|
|
2354
2363
|
var __accessCheck$9 = (obj, member, msg) => {
|
|
@@ -2381,7 +2390,7 @@ class AutomaticTooltip {
|
|
|
2381
2390
|
__privateAdd$9(this, _timeout$1, 500);
|
|
2382
2391
|
__privateAdd$9(this, _tooltipTimeout, 0);
|
|
2383
2392
|
__privateAdd$9(this, _unsuscribe, null);
|
|
2384
|
-
__publicField$
|
|
2393
|
+
__publicField$j(this, "ref", (el) => {
|
|
2385
2394
|
var _a, _b;
|
|
2386
2395
|
(_a = __privateGet$7(this, _unsuscribe)) == null ? void 0 : _a.call(this);
|
|
2387
2396
|
const listener = () => {
|
|
@@ -2413,7 +2422,7 @@ class AutomaticTooltip {
|
|
|
2413
2422
|
}
|
|
2414
2423
|
});
|
|
2415
2424
|
__privateAdd$9(this, _tooltip, null);
|
|
2416
|
-
__publicField$
|
|
2425
|
+
__publicField$j(this, "update", (tooltip) => {
|
|
2417
2426
|
__privateSet$5(this, _tooltip, tooltip);
|
|
2418
2427
|
});
|
|
2419
2428
|
__privateSet$5(this, _tooltip, tooltip);
|
|
@@ -2764,10 +2773,10 @@ const Tooltip = ({
|
|
|
2764
2773
|
);
|
|
2765
2774
|
};
|
|
2766
2775
|
|
|
2767
|
-
var __defProp$
|
|
2768
|
-
var __defNormalProp$
|
|
2769
|
-
var __publicField$
|
|
2770
|
-
__defNormalProp$
|
|
2776
|
+
var __defProp$i = Object.defineProperty;
|
|
2777
|
+
var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2778
|
+
var __publicField$i = (obj, key, value) => {
|
|
2779
|
+
__defNormalProp$i(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2771
2780
|
return value;
|
|
2772
2781
|
};
|
|
2773
2782
|
var __accessCheck$8 = (obj, member, msg) => {
|
|
@@ -2787,7 +2796,7 @@ var _emitter$2, _shoutChangedList;
|
|
|
2787
2796
|
class ApiaUtilTooltips {
|
|
2788
2797
|
constructor() {
|
|
2789
2798
|
__privateAdd$8(this, _emitter$2, new EventEmitter());
|
|
2790
|
-
__publicField$
|
|
2799
|
+
__publicField$i(this, "tooltips", []);
|
|
2791
2800
|
__privateAdd$8(this, _shoutChangedList, () => {
|
|
2792
2801
|
__privateGet$6(this, _emitter$2).emit("changedList", [...this.tooltips]);
|
|
2793
2802
|
});
|
|
@@ -2795,7 +2804,7 @@ class ApiaUtilTooltips {
|
|
|
2795
2804
|
* Permite crear un tooltip que se abrirá automáticamente al estar parado
|
|
2796
2805
|
* sobre un elemento durante 300ms
|
|
2797
2806
|
*/
|
|
2798
|
-
__publicField$
|
|
2807
|
+
__publicField$i(this, "useHover", (tooltip) => {
|
|
2799
2808
|
let tt = void 0;
|
|
2800
2809
|
tt = useMemo(() => {
|
|
2801
2810
|
tt?.ref(null);
|
|
@@ -2806,15 +2815,15 @@ class ApiaUtilTooltips {
|
|
|
2806
2815
|
});
|
|
2807
2816
|
return tt;
|
|
2808
2817
|
});
|
|
2809
|
-
__publicField$
|
|
2818
|
+
__publicField$i(this, "close", (id) => {
|
|
2810
2819
|
this.tooltips = this.tooltips.filter((current) => current.id !== id);
|
|
2811
2820
|
__privateGet$6(this, _shoutChangedList).call(this);
|
|
2812
2821
|
});
|
|
2813
|
-
__publicField$
|
|
2822
|
+
__publicField$i(this, "closeAll", () => {
|
|
2814
2823
|
this.tooltips = [];
|
|
2815
2824
|
__privateGet$6(this, _shoutChangedList).call(this);
|
|
2816
2825
|
});
|
|
2817
|
-
__publicField$
|
|
2826
|
+
__publicField$i(this, "open", (tooltip) => {
|
|
2818
2827
|
const controller = new ApiaUtilTooltip(tooltip, () => {
|
|
2819
2828
|
this.close(controller.id);
|
|
2820
2829
|
controller.props.onClose?.();
|
|
@@ -2827,7 +2836,7 @@ class ApiaUtilTooltips {
|
|
|
2827
2836
|
__privateGet$6(this, _shoutChangedList).call(this);
|
|
2828
2837
|
return controller;
|
|
2829
2838
|
});
|
|
2830
|
-
__publicField$
|
|
2839
|
+
__publicField$i(this, "Component", () => {
|
|
2831
2840
|
const [tooltips, setTooltips] = useState(this.tooltips);
|
|
2832
2841
|
useMount(() => {
|
|
2833
2842
|
const unsuscribeToList = __privateGet$6(this, _emitter$2).on("changedList", (ev) => {
|
|
@@ -2869,10 +2878,10 @@ class ApiaUtilTooltips {
|
|
|
2869
2878
|
_emitter$2 = new WeakMap();
|
|
2870
2879
|
_shoutChangedList = new WeakMap();
|
|
2871
2880
|
|
|
2872
|
-
var __defProp$
|
|
2873
|
-
var __defNormalProp$
|
|
2874
|
-
var __publicField$
|
|
2875
|
-
__defNormalProp$
|
|
2881
|
+
var __defProp$h = Object.defineProperty;
|
|
2882
|
+
var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2883
|
+
var __publicField$h = (obj, key, value) => {
|
|
2884
|
+
__defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2876
2885
|
return value;
|
|
2877
2886
|
};
|
|
2878
2887
|
var __accessCheck$7 = (obj, member, msg) => {
|
|
@@ -2909,7 +2918,7 @@ class ApiaUtilMenu {
|
|
|
2909
2918
|
constructor() {
|
|
2910
2919
|
__privateAdd$7(this, _emitter$1, new EventEmitter());
|
|
2911
2920
|
__privateAdd$7(this, _items$1, []);
|
|
2912
|
-
__publicField$
|
|
2921
|
+
__publicField$h(this, "menuProps", null);
|
|
2913
2922
|
__privateAdd$7(this, _hooks, {
|
|
2914
2923
|
useIsOpen: () => {
|
|
2915
2924
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -2924,10 +2933,10 @@ class ApiaUtilMenu {
|
|
|
2924
2933
|
];
|
|
2925
2934
|
}
|
|
2926
2935
|
});
|
|
2927
|
-
__publicField$
|
|
2936
|
+
__publicField$h(this, "close", () => {
|
|
2928
2937
|
__privateGet$5(this, _emitter$1).emit("toggle", false);
|
|
2929
2938
|
});
|
|
2930
|
-
__publicField$
|
|
2939
|
+
__publicField$h(this, "open", ({
|
|
2931
2940
|
menuProps,
|
|
2932
2941
|
items
|
|
2933
2942
|
}) => {
|
|
@@ -2968,7 +2977,7 @@ class ApiaUtilMenu {
|
|
|
2968
2977
|
return /* @__PURE__ */ createElement(MenuItem, { ...current, key: current.key }, children);
|
|
2969
2978
|
}) });
|
|
2970
2979
|
});
|
|
2971
|
-
__publicField$
|
|
2980
|
+
__publicField$h(this, "Component", () => {
|
|
2972
2981
|
const [isOpen, close] = __privateGet$5(this, _hooks).useIsOpen();
|
|
2973
2982
|
if (!isOpen)
|
|
2974
2983
|
return null;
|
|
@@ -2993,17 +3002,17 @@ _hooks = new WeakMap();
|
|
|
2993
3002
|
_maxId = new WeakMap();
|
|
2994
3003
|
_RenderMenu = new WeakMap();
|
|
2995
3004
|
|
|
2996
|
-
var __defProp$
|
|
2997
|
-
var __defNormalProp$
|
|
2998
|
-
var __publicField$
|
|
2999
|
-
__defNormalProp$
|
|
3005
|
+
var __defProp$g = Object.defineProperty;
|
|
3006
|
+
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3007
|
+
var __publicField$g = (obj, key, value) => {
|
|
3008
|
+
__defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3000
3009
|
return value;
|
|
3001
3010
|
};
|
|
3002
3011
|
class ApiaUtilMouse extends EventEmitter {
|
|
3003
3012
|
constructor() {
|
|
3004
3013
|
super();
|
|
3005
|
-
__publicField$
|
|
3006
|
-
__publicField$
|
|
3014
|
+
__publicField$g(this, "x", 0);
|
|
3015
|
+
__publicField$g(this, "y", 0);
|
|
3007
3016
|
document.addEventListener("mousemove", (ev) => {
|
|
3008
3017
|
this.x = ev.clientX;
|
|
3009
3018
|
this.y = ev.clientY;
|
|
@@ -3015,10 +3024,10 @@ class ApiaUtilMouse extends EventEmitter {
|
|
|
3015
3024
|
}
|
|
3016
3025
|
}
|
|
3017
3026
|
|
|
3018
|
-
var __defProp$
|
|
3019
|
-
var __defNormalProp$
|
|
3020
|
-
var __publicField$
|
|
3021
|
-
__defNormalProp$
|
|
3027
|
+
var __defProp$f = Object.defineProperty;
|
|
3028
|
+
var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3029
|
+
var __publicField$f = (obj, key, value) => {
|
|
3030
|
+
__defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3022
3031
|
return value;
|
|
3023
3032
|
};
|
|
3024
3033
|
var __accessCheck$6 = (obj, member, msg) => {
|
|
@@ -3042,15 +3051,15 @@ var __privateSet$3 = (obj, member, value, setter) => {
|
|
|
3042
3051
|
var _instance;
|
|
3043
3052
|
const _ApiaUtil = class _ApiaUtil {
|
|
3044
3053
|
constructor() {
|
|
3045
|
-
__publicField$
|
|
3046
|
-
__publicField$
|
|
3047
|
-
__publicField$
|
|
3048
|
-
__publicField$
|
|
3049
|
-
__publicField$
|
|
3050
|
-
__publicField$
|
|
3051
|
-
__publicField$
|
|
3052
|
-
__publicField$
|
|
3053
|
-
__publicField$
|
|
3054
|
+
__publicField$f(this, "dialogs");
|
|
3055
|
+
__publicField$f(this, "menu");
|
|
3056
|
+
__publicField$f(this, "modals");
|
|
3057
|
+
__publicField$f(this, "mouse");
|
|
3058
|
+
__publicField$f(this, "notifications");
|
|
3059
|
+
__publicField$f(this, "parsers");
|
|
3060
|
+
__publicField$f(this, "tabs");
|
|
3061
|
+
__publicField$f(this, "tooltips");
|
|
3062
|
+
__publicField$f(this, "Component", () => {
|
|
3054
3063
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3055
3064
|
/* @__PURE__ */ jsx(this.dialogs.Component, {}),
|
|
3056
3065
|
/* @__PURE__ */ jsx(this.modals.Component, {}),
|
|
@@ -3063,7 +3072,7 @@ const _ApiaUtil = class _ApiaUtil {
|
|
|
3063
3072
|
this.menu = new ApiaUtilMenu();
|
|
3064
3073
|
this.modals = new ApiaUtilModals();
|
|
3065
3074
|
this.mouse = new ApiaUtilMouse();
|
|
3066
|
-
this.notifications = new ApiaUtilNotifications();
|
|
3075
|
+
this.notifications = new ApiaUtilNotifications(this);
|
|
3067
3076
|
this.parsers = new ApiaUtilParsers();
|
|
3068
3077
|
this.tabs = new ApiaUtilTabsController();
|
|
3069
3078
|
this.tooltips = new ApiaUtilTooltips();
|
|
@@ -3079,22 +3088,22 @@ _instance = new WeakMap();
|
|
|
3079
3088
|
__privateAdd$6(_ApiaUtil, _instance, void 0);
|
|
3080
3089
|
let ApiaUtil = _ApiaUtil;
|
|
3081
3090
|
|
|
3082
|
-
var __defProp$
|
|
3083
|
-
var __defNormalProp$
|
|
3084
|
-
var __publicField$
|
|
3085
|
-
__defNormalProp$
|
|
3091
|
+
var __defProp$e = Object.defineProperty;
|
|
3092
|
+
var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3093
|
+
var __publicField$e = (obj, key, value) => {
|
|
3094
|
+
__defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3086
3095
|
return value;
|
|
3087
3096
|
};
|
|
3088
3097
|
class ScreenLocker {
|
|
3089
3098
|
constructor() {
|
|
3090
|
-
__publicField$
|
|
3099
|
+
__publicField$e(this, "emitter", new StatefulEmitter({
|
|
3091
3100
|
locks: {
|
|
3092
3101
|
common: { count: 0 },
|
|
3093
3102
|
linear: { count: 0 },
|
|
3094
3103
|
white: { count: 1 }
|
|
3095
3104
|
}
|
|
3096
3105
|
}));
|
|
3097
|
-
__publicField$
|
|
3106
|
+
__publicField$e(this, "lock", (options) => {
|
|
3098
3107
|
this.emitter.setState("locks", (s) => {
|
|
3099
3108
|
const key = options?.type ?? "common";
|
|
3100
3109
|
return {
|
|
@@ -3110,11 +3119,11 @@ class ScreenLocker {
|
|
|
3110
3119
|
};
|
|
3111
3120
|
});
|
|
3112
3121
|
});
|
|
3113
|
-
__publicField$
|
|
3122
|
+
__publicField$e(this, "hasReleased", false);
|
|
3114
3123
|
/**
|
|
3115
3124
|
* This method will work once, then, the action will be ignored. The ScreenLocker starts always locked on white, when this method is called, all listeners of onRelease will be called and the lock will be released.
|
|
3116
3125
|
*/
|
|
3117
|
-
__publicField$
|
|
3126
|
+
__publicField$e(this, "release", () => {
|
|
3118
3127
|
if (this.hasReleased)
|
|
3119
3128
|
return;
|
|
3120
3129
|
this.hasReleased = true;
|
|
@@ -3130,11 +3139,11 @@ class ScreenLocker {
|
|
|
3130
3139
|
/**
|
|
3131
3140
|
* This method notifies when the screenLock is released by the first time.
|
|
3132
3141
|
*/
|
|
3133
|
-
__publicField$
|
|
3142
|
+
__publicField$e(this, "onRelease", this.emitter.on.bind(this.emitter, "release"));
|
|
3134
3143
|
/**
|
|
3135
3144
|
* This component is the responsible for putting the lock courtain in the browser when it's required. It must be used once per application.
|
|
3136
3145
|
*/
|
|
3137
|
-
__publicField$
|
|
3146
|
+
__publicField$e(this, "Component", () => {
|
|
3138
3147
|
const locks = this.emitter.useState("locks");
|
|
3139
3148
|
const style = {
|
|
3140
3149
|
alignItems: "center",
|
|
@@ -3207,10 +3216,10 @@ const OptionsBox = observer(() => {
|
|
|
3207
3216
|
}) });
|
|
3208
3217
|
});
|
|
3209
3218
|
|
|
3210
|
-
var __defProp$
|
|
3211
|
-
var __defNormalProp$
|
|
3212
|
-
var __publicField$
|
|
3213
|
-
__defNormalProp$
|
|
3219
|
+
var __defProp$d = Object.defineProperty;
|
|
3220
|
+
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3221
|
+
var __publicField$d = (obj, key, value) => {
|
|
3222
|
+
__defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3214
3223
|
return value;
|
|
3215
3224
|
};
|
|
3216
3225
|
var __accessCheck$5 = (obj, member, msg) => {
|
|
@@ -3234,7 +3243,7 @@ var __privateSet$2 = (obj, member, value, setter) => {
|
|
|
3234
3243
|
var _actualSearch, _timeout;
|
|
3235
3244
|
class AutocompleteController {
|
|
3236
3245
|
constructor(properties) {
|
|
3237
|
-
__publicField$
|
|
3246
|
+
__publicField$d(this, "state", {
|
|
3238
3247
|
disabled: false,
|
|
3239
3248
|
readOnly: false,
|
|
3240
3249
|
id: uniqueId$3("autocomplete"),
|
|
@@ -3267,13 +3276,17 @@ class AutocompleteController {
|
|
|
3267
3276
|
}
|
|
3268
3277
|
});
|
|
3269
3278
|
__privateAdd$5(this, _timeout, 0);
|
|
3270
|
-
__publicField$
|
|
3279
|
+
__publicField$d(this, "tooltipRef", null);
|
|
3271
3280
|
Object.assign(this.state, properties);
|
|
3272
3281
|
if (properties.value) {
|
|
3273
3282
|
this.state.showValue = String(
|
|
3274
3283
|
properties.options?.find((c) => c.value === properties.value)?.label
|
|
3275
3284
|
);
|
|
3276
3285
|
this.state.focusedValue = properties.value;
|
|
3286
|
+
} else if (properties.options) {
|
|
3287
|
+
this.state.value = properties.options[0]?.value;
|
|
3288
|
+
this.state.showValue = properties.options[0]?.label?.toString?.() || "";
|
|
3289
|
+
properties.onChange?.(this.state.value, this);
|
|
3277
3290
|
}
|
|
3278
3291
|
makeAutoObservable(this, {
|
|
3279
3292
|
getAutocompleteBox: false,
|
|
@@ -3468,7 +3481,7 @@ class AutocompleteController {
|
|
|
3468
3481
|
_actualSearch = new WeakMap();
|
|
3469
3482
|
_timeout = new WeakMap();
|
|
3470
3483
|
|
|
3471
|
-
const
|
|
3484
|
+
const UnobservedSearchBox = forwardRef((props, ref) => {
|
|
3472
3485
|
const handler = useAutocompleteContext();
|
|
3473
3486
|
const breakpoint = useBreakpointIndex();
|
|
3474
3487
|
const inputRef = useRef(null);
|
|
@@ -3484,6 +3497,7 @@ const SearchBox = observer((props) => {
|
|
|
3484
3497
|
breakpoint <= 3 ? /* @__PURE__ */ jsx(
|
|
3485
3498
|
Select,
|
|
3486
3499
|
{
|
|
3500
|
+
ref,
|
|
3487
3501
|
disabled: handler.state.disabled,
|
|
3488
3502
|
onChange: (ev) => {
|
|
3489
3503
|
handler.setValue(ev.target.value);
|
|
@@ -3495,7 +3509,13 @@ const SearchBox = observer((props) => {
|
|
|
3495
3509
|
Input,
|
|
3496
3510
|
{
|
|
3497
3511
|
...props,
|
|
3498
|
-
ref:
|
|
3512
|
+
ref: (el) => {
|
|
3513
|
+
inputRef.current = el;
|
|
3514
|
+
try {
|
|
3515
|
+
ref(el);
|
|
3516
|
+
} catch (_) {
|
|
3517
|
+
}
|
|
3518
|
+
},
|
|
3499
3519
|
className: `autocomplete__search ${handler.state.disabled ? "disabled" : ""} ${handler.state.readOnly ? "readOnly" : ""}`,
|
|
3500
3520
|
onChange: async (ev) => {
|
|
3501
3521
|
handler.search(ev.target.value);
|
|
@@ -3527,6 +3547,9 @@ const SearchBox = observer((props) => {
|
|
|
3527
3547
|
] })
|
|
3528
3548
|
] });
|
|
3529
3549
|
});
|
|
3550
|
+
const SearchBox = observer(
|
|
3551
|
+
UnobservedSearchBox
|
|
3552
|
+
);
|
|
3530
3553
|
|
|
3531
3554
|
const KeyHandler$1 = observer((props) => {
|
|
3532
3555
|
const handler = useAutocompleteContext();
|
|
@@ -3599,7 +3622,7 @@ const KeyHandler$1 = observer((props) => {
|
|
|
3599
3622
|
);
|
|
3600
3623
|
});
|
|
3601
3624
|
|
|
3602
|
-
const Autocomplete = (props) => {
|
|
3625
|
+
const Autocomplete = forwardRef((props, ref) => {
|
|
3603
3626
|
const [handler] = useState(() => {
|
|
3604
3627
|
const newHandler = props.handler ?? new AutocompleteController(props.properties ?? {});
|
|
3605
3628
|
props.getHandler?.(newHandler);
|
|
@@ -3622,10 +3645,10 @@ const Autocomplete = (props) => {
|
|
|
3622
3645
|
className: `autocomplete ${props.properties?.className || ""}`,
|
|
3623
3646
|
"data-autocomplete-box": handler.state.id,
|
|
3624
3647
|
...getVariant("layout.common.components.autocomplete"),
|
|
3625
|
-
children: /* @__PURE__ */ jsx(SearchBox, { ...props.inputProps })
|
|
3648
|
+
children: /* @__PURE__ */ jsx(SearchBox, { ref, ...props.inputProps })
|
|
3626
3649
|
}
|
|
3627
3650
|
) });
|
|
3628
|
-
};
|
|
3651
|
+
});
|
|
3629
3652
|
|
|
3630
3653
|
const AutogrowTextarea = observer(
|
|
3631
3654
|
(props) => {
|
|
@@ -4002,30 +4025,6 @@ const Checkbox$1 = forwardRef(
|
|
|
4002
4025
|
);
|
|
4003
4026
|
Checkbox$1.displayName = "Checkbox";
|
|
4004
4027
|
|
|
4005
|
-
const CalModal = React__default.forwardRef(
|
|
4006
|
-
({ handleClickDay, calValue, locale }) => {
|
|
4007
|
-
return /* @__PURE__ */ jsx(
|
|
4008
|
-
Box,
|
|
4009
|
-
{
|
|
4010
|
-
...getVariant("layout.common.components.datePicker"),
|
|
4011
|
-
className: "datePicker",
|
|
4012
|
-
children: /* @__PURE__ */ jsx(
|
|
4013
|
-
Calendar,
|
|
4014
|
-
{
|
|
4015
|
-
onClickDay: handleClickDay,
|
|
4016
|
-
locale,
|
|
4017
|
-
value: calValue || /* @__PURE__ */ new Date(),
|
|
4018
|
-
nextLabel: "\u203A",
|
|
4019
|
-
next2Label: "\xBB",
|
|
4020
|
-
prevLabel: "\u2039",
|
|
4021
|
-
prev2Label: "\xAB"
|
|
4022
|
-
}
|
|
4023
|
-
)
|
|
4024
|
-
}
|
|
4025
|
-
);
|
|
4026
|
-
}
|
|
4027
|
-
);
|
|
4028
|
-
|
|
4029
4028
|
const IconInput = ({
|
|
4030
4029
|
additionalButtons,
|
|
4031
4030
|
additionalButtonsPosition = "before",
|
|
@@ -4102,6 +4101,50 @@ const IconInput = ({
|
|
|
4102
4101
|
);
|
|
4103
4102
|
};
|
|
4104
4103
|
|
|
4104
|
+
const CalModal = React__default.forwardRef(
|
|
4105
|
+
({ handleClickDay, calValue, locale, onBlur }) => {
|
|
4106
|
+
const uns = useRef(() => {
|
|
4107
|
+
});
|
|
4108
|
+
return /* @__PURE__ */ jsx(
|
|
4109
|
+
Box,
|
|
4110
|
+
{
|
|
4111
|
+
...getVariant("layout.common.components.datePicker"),
|
|
4112
|
+
className: "datePicker",
|
|
4113
|
+
ref: (el) => {
|
|
4114
|
+
uns.current();
|
|
4115
|
+
if (el instanceof HTMLElement) {
|
|
4116
|
+
const h = (ev) => {
|
|
4117
|
+
onBlur?.(ev);
|
|
4118
|
+
};
|
|
4119
|
+
el.addEventListener("blur", h, { capture: true });
|
|
4120
|
+
uns.current = () => {
|
|
4121
|
+
el.removeEventListener("blur", h, { capture: true });
|
|
4122
|
+
};
|
|
4123
|
+
}
|
|
4124
|
+
},
|
|
4125
|
+
children: /* @__PURE__ */ jsx(
|
|
4126
|
+
Calendar,
|
|
4127
|
+
{
|
|
4128
|
+
onClickDay: handleClickDay,
|
|
4129
|
+
locale,
|
|
4130
|
+
value: calValue || /* @__PURE__ */ new Date(),
|
|
4131
|
+
nextLabel: "\u203A",
|
|
4132
|
+
next2Label: "\xBB",
|
|
4133
|
+
prevLabel: "\u2039",
|
|
4134
|
+
prev2Label: "\xAB"
|
|
4135
|
+
}
|
|
4136
|
+
)
|
|
4137
|
+
}
|
|
4138
|
+
);
|
|
4139
|
+
}
|
|
4140
|
+
);
|
|
4141
|
+
|
|
4142
|
+
var __defProp$c = Object.defineProperty;
|
|
4143
|
+
var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4144
|
+
var __publicField$c = (obj, key, value) => {
|
|
4145
|
+
__defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4146
|
+
return value;
|
|
4147
|
+
};
|
|
4105
4148
|
const DEFAULT_LOCALE = window.LANG_CODE;
|
|
4106
4149
|
const DEFAULT_MASK_PLACEHOLDER = "_";
|
|
4107
4150
|
const dateFormat = getDateFormat();
|
|
@@ -4110,334 +4153,210 @@ const getMaskForDateFormat = () => {
|
|
|
4110
4153
|
return "9999/99/99";
|
|
4111
4154
|
return "99/99/9999";
|
|
4112
4155
|
};
|
|
4113
|
-
|
|
4114
|
-
({
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
}
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
},
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4156
|
+
class DateInputController {
|
|
4157
|
+
constructor() {
|
|
4158
|
+
__publicField$c(this, "props", {});
|
|
4159
|
+
__publicField$c(this, "state", {});
|
|
4160
|
+
__publicField$c(this, "_ref", null);
|
|
4161
|
+
__publicField$c(this, "error", false);
|
|
4162
|
+
__publicField$c(this, "inputValue", "");
|
|
4163
|
+
__publicField$c(this, "value", null);
|
|
4164
|
+
__publicField$c(this, "previousValue", "");
|
|
4165
|
+
this.props.id = uniqueId$4("date-input");
|
|
4166
|
+
makeAutoObservable(this);
|
|
4167
|
+
}
|
|
4168
|
+
clear() {
|
|
4169
|
+
this.setValueFromString("");
|
|
4170
|
+
this.focus();
|
|
4171
|
+
}
|
|
4172
|
+
focus() {
|
|
4173
|
+
const input = this._ref?.querySelector("input");
|
|
4174
|
+
if (input) {
|
|
4175
|
+
input.focus();
|
|
4176
|
+
setTimeout(() => {
|
|
4177
|
+
window.requestAnimationFrame(() => {
|
|
4178
|
+
input.setSelectionRange(0, input.value.length);
|
|
4179
|
+
});
|
|
4180
|
+
}, 0);
|
|
4181
|
+
}
|
|
4182
|
+
}
|
|
4183
|
+
ref(el) {
|
|
4184
|
+
this._ref = el;
|
|
4185
|
+
}
|
|
4186
|
+
get calendarElementId() {
|
|
4187
|
+
return `DateModal${this.props.id}`;
|
|
4188
|
+
}
|
|
4189
|
+
isInsidePicker(el) {
|
|
4190
|
+
return !!el?.closest(`#${this.props.id}, #${this.calendarElementId}`);
|
|
4191
|
+
}
|
|
4192
|
+
onBlur(ev) {
|
|
4193
|
+
if (!this.isInsidePicker(ev.relatedTarget)) {
|
|
4194
|
+
if (this.error) {
|
|
4195
|
+
this.inputValue = "";
|
|
4196
|
+
this.value = null;
|
|
4197
|
+
this.error = false;
|
|
4198
|
+
}
|
|
4199
|
+
this.props.onBlur?.(this.inputValue, ev);
|
|
4200
|
+
}
|
|
4201
|
+
}
|
|
4202
|
+
onInputChange(ev) {
|
|
4203
|
+
this.setValueFromString(ev.target.value);
|
|
4204
|
+
}
|
|
4205
|
+
onCalendarSelect(value) {
|
|
4206
|
+
this.setValue(value);
|
|
4207
|
+
}
|
|
4208
|
+
openCalendar(ev) {
|
|
4209
|
+
const tooltip = ApiaUtil.instance.tooltips.open({
|
|
4210
|
+
attachToElement() {
|
|
4211
|
+
return ev.target.closest("button");
|
|
4169
4212
|
},
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
if (formattedDate !== inputValue && nocheck !== true) {
|
|
4187
|
-
void shoutOnChange("");
|
|
4188
|
-
setInputValue("");
|
|
4189
|
-
setError(window.MSG_INVALID_DATE);
|
|
4190
|
-
} else if (allowPickBeforeToday === false && newDate.isBefore(today)) {
|
|
4191
|
-
void shoutOnChange("");
|
|
4192
|
-
setInputValue("");
|
|
4193
|
-
setError(window.MSG_FEC_FIN_MAY_FEC_INI);
|
|
4194
|
-
} else {
|
|
4195
|
-
if (avoidShout) {
|
|
4196
|
-
setInputValue(formattedDate);
|
|
4197
|
-
setError(null);
|
|
4198
|
-
setCalValue(newDate.toDate());
|
|
4199
|
-
} else {
|
|
4200
|
-
const shoutResult = shoutOnChange(
|
|
4201
|
-
value === "" ? "" : formattedDate
|
|
4202
|
-
);
|
|
4203
|
-
if (shoutResult === false) {
|
|
4204
|
-
setInputValue(shoutResult || "");
|
|
4205
|
-
setError(null);
|
|
4206
|
-
setCalValue(/* @__PURE__ */ new Date());
|
|
4207
|
-
} else if (typeof shoutResult === "string") {
|
|
4208
|
-
setInputValue("");
|
|
4209
|
-
setError(shoutResult);
|
|
4210
|
-
setCalValue(/* @__PURE__ */ new Date());
|
|
4211
|
-
} else {
|
|
4212
|
-
setInputValue(formattedDate);
|
|
4213
|
-
setError(null);
|
|
4214
|
-
setCalValue(newDate.toDate());
|
|
4215
|
-
}
|
|
4213
|
+
attachToElementAnchorPoint: "center",
|
|
4214
|
+
closeOnClick: false,
|
|
4215
|
+
closeOnClickOut: true,
|
|
4216
|
+
closeOnEscape: true,
|
|
4217
|
+
closeOnMouseLeaveTooltip: false,
|
|
4218
|
+
closeOnMouseLeaveAttachedElement: false,
|
|
4219
|
+
closeOnScrollOut: true,
|
|
4220
|
+
children: /* @__PURE__ */ jsx("div", { id: this.calendarElementId, children: /* @__PURE__ */ jsx(
|
|
4221
|
+
CalModal,
|
|
4222
|
+
{
|
|
4223
|
+
calValue: this.value || /* @__PURE__ */ new Date(),
|
|
4224
|
+
locale: DEFAULT_LOCALE,
|
|
4225
|
+
handleClickDay: (date) => {
|
|
4226
|
+
tooltip.close();
|
|
4227
|
+
this.onCalendarSelect(date);
|
|
4228
|
+
this.focus();
|
|
4216
4229
|
}
|
|
4217
4230
|
}
|
|
4231
|
+
) }),
|
|
4232
|
+
initialFocusGetter(el) {
|
|
4233
|
+
return el.querySelector(`.react-calendar__tile--active`);
|
|
4218
4234
|
},
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
},
|
|
4226
|
-
[setCalendarValue]
|
|
4227
|
-
);
|
|
4228
|
-
useEffect(() => {
|
|
4229
|
-
if (stateError !== "" && stateError !== null && !avoidErrorMessage) {
|
|
4230
|
-
ApiaUtil.instance.notifications.notify({
|
|
4231
|
-
message: stateError,
|
|
4232
|
-
type: "warning"
|
|
4235
|
+
minSize: { width: 350, height: 310 },
|
|
4236
|
+
onClose: () => {
|
|
4237
|
+
window.requestAnimationFrame(() => {
|
|
4238
|
+
if (!this.isInsidePicker(document.activeElement)) {
|
|
4239
|
+
this.props.onBlur?.(this.inputValue);
|
|
4240
|
+
}
|
|
4233
4241
|
});
|
|
4234
4242
|
}
|
|
4235
|
-
}
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
};
|
|
4253
|
-
const actualBlur = onBlur instanceof Promise ? onBlur : (ev2) => new Promise((resolve) => {
|
|
4254
|
-
const result = onBlur?.(ev2);
|
|
4255
|
-
resolve(result);
|
|
4256
|
-
});
|
|
4257
|
-
void actualBlur(newEvent).then((result) => {
|
|
4258
|
-
if (typeof result === "string") {
|
|
4259
|
-
setError(result);
|
|
4260
|
-
} else if (result === false) {
|
|
4261
|
-
setInputValue("");
|
|
4262
|
-
}
|
|
4263
|
-
});
|
|
4264
|
-
}
|
|
4265
|
-
},
|
|
4266
|
-
[id, onBlur, onError]
|
|
4267
|
-
);
|
|
4268
|
-
const inputProps = React__default.useMemo(
|
|
4269
|
-
() => ({
|
|
4270
|
-
...otherProps,
|
|
4271
|
-
className: `dateInput ${inputClassName ?? ""}`,
|
|
4272
|
-
value: stateError ? "" : renderLabel ? renderLabel(inputValue) : inputValue,
|
|
4273
|
-
ref,
|
|
4274
|
-
onChange: (ev) => {
|
|
4275
|
-
if (props.readOnly) {
|
|
4276
|
-
return;
|
|
4277
|
-
}
|
|
4278
|
-
setInputValue(ev.target.value);
|
|
4279
|
-
if (getMaskForDateFormat().replaceAll("9", DEFAULT_MASK_PLACEHOLDER) !== ev.target.value && ev.target.value !== "") {
|
|
4280
|
-
setError(null);
|
|
4281
|
-
const hasPlaceHolder = ev.target.value.match(/_/);
|
|
4282
|
-
if (!hasPlaceHolder)
|
|
4283
|
-
return onChange?.(ev.target.value);
|
|
4284
|
-
} else if (getMaskForDateFormat().replaceAll("9", DEFAULT_MASK_PLACEHOLDER) === ev.target.value) {
|
|
4285
|
-
setCalendarValue("");
|
|
4286
|
-
}
|
|
4287
|
-
},
|
|
4288
|
-
onBlur: (ev) => {
|
|
4289
|
-
setIsFocused(false);
|
|
4290
|
-
if (!(props.readOnly || getCustomMask || document.querySelector(".overlay.screenLock")))
|
|
4291
|
-
setCalendarValue(ev.target.value, false, true);
|
|
4292
|
-
if (hasBlured.current) {
|
|
4293
|
-
hasBlured.current = false;
|
|
4294
|
-
} else if (!document.querySelector(".overlay.screenLock")) {
|
|
4295
|
-
handleBlur(ev);
|
|
4296
|
-
}
|
|
4297
|
-
},
|
|
4298
|
-
onFocus: () => {
|
|
4299
|
-
setIsFocused(true);
|
|
4300
|
-
},
|
|
4301
|
-
onKeyDown: (ev) => {
|
|
4302
|
-
if (ev.key === "Enter")
|
|
4303
|
-
setCalendarValue(inputValue);
|
|
4304
|
-
}
|
|
4305
|
-
}),
|
|
4306
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4307
|
-
[
|
|
4308
|
-
otherProps,
|
|
4309
|
-
inputClassName,
|
|
4310
|
-
stateError,
|
|
4311
|
-
renderLabel,
|
|
4312
|
-
inputValue,
|
|
4313
|
-
ref,
|
|
4314
|
-
props.readOnly,
|
|
4315
|
-
getCustomMask,
|
|
4316
|
-
setCalendarValue,
|
|
4317
|
-
handleBlur
|
|
4318
|
-
]
|
|
4319
|
-
);
|
|
4320
|
-
const buttonProps = React__default.useMemo(
|
|
4321
|
-
() => ({
|
|
4322
|
-
disabled: props.disabled || props.readOnly,
|
|
4323
|
-
"aria-label": window.LBL_PICK_DATE,
|
|
4324
|
-
...outerButtonProps
|
|
4325
|
-
}),
|
|
4326
|
-
[outerButtonProps, props.disabled, props.readOnly]
|
|
4327
|
-
);
|
|
4328
|
-
const additionalButtons = React__default.useMemo(() => {
|
|
4329
|
-
const doDelete = (e) => {
|
|
4330
|
-
e?.stopPropagation();
|
|
4331
|
-
setCalendarValue("");
|
|
4332
|
-
onDelete?.();
|
|
4333
|
-
document.querySelector(`#DateInput${id} input`)?.focus();
|
|
4334
|
-
};
|
|
4335
|
-
return /* @__PURE__ */ jsx(
|
|
4336
|
-
"span",
|
|
4337
|
-
{
|
|
4338
|
-
role: "button",
|
|
4339
|
-
tabIndex: 0,
|
|
4340
|
-
onMouseDown: (e) => {
|
|
4341
|
-
e.preventDefault();
|
|
4342
|
-
e.stopPropagation();
|
|
4343
|
-
},
|
|
4344
|
-
onClick: (e) => {
|
|
4345
|
-
e.stopPropagation();
|
|
4346
|
-
doDelete(e);
|
|
4347
|
-
},
|
|
4348
|
-
onKeyDown: (e) => {
|
|
4349
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
4350
|
-
e.preventDefault();
|
|
4351
|
-
doDelete(e);
|
|
4352
|
-
}
|
|
4353
|
-
},
|
|
4354
|
-
"aria-label": getLabel("btnAiDelete").text,
|
|
4355
|
-
title: getLabel("btnAiDelete").text,
|
|
4356
|
-
children: /* @__PURE__ */ jsx(Close, { type: "button", className: "delete_date_button" })
|
|
4243
|
+
});
|
|
4244
|
+
}
|
|
4245
|
+
setValueFromString(str, fire = true) {
|
|
4246
|
+
if (str === "") {
|
|
4247
|
+
this.inputValue = "";
|
|
4248
|
+
this.setValue(null, fire);
|
|
4249
|
+
} else if (str !== this.inputValue) {
|
|
4250
|
+
const hasPlaceHolder = str.match(/_/);
|
|
4251
|
+
if (!hasPlaceHolder) {
|
|
4252
|
+
const value = dayjs(str, dateFormat);
|
|
4253
|
+
const formattedDate = value.format(dateFormat);
|
|
4254
|
+
if (value.isValid() && formattedDate === str) {
|
|
4255
|
+
this.setValue(value.toDate(), fire);
|
|
4256
|
+
} else {
|
|
4257
|
+
this.inputValue = str;
|
|
4258
|
+
this.props.onError?.(getLabel("msgInvalidDate").text);
|
|
4259
|
+
this.error = true;
|
|
4357
4260
|
}
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4261
|
+
} else {
|
|
4262
|
+
this.inputValue = str;
|
|
4263
|
+
}
|
|
4264
|
+
}
|
|
4265
|
+
}
|
|
4266
|
+
async setValue(date, fire = true) {
|
|
4267
|
+
this.error = false;
|
|
4268
|
+
if (date !== this.value) {
|
|
4269
|
+
const dateValue = dayjs(date);
|
|
4270
|
+
const newValue = dateValue.isValid() ? dateValue.format(dateFormat) : "";
|
|
4271
|
+
const res = fire ? await this.props.onChange?.(newValue) : null;
|
|
4272
|
+
this.inputValue = newValue || "";
|
|
4273
|
+
if (typeof res !== "string") {
|
|
4274
|
+
this.value = date;
|
|
4275
|
+
} else {
|
|
4276
|
+
this.error = true;
|
|
4277
|
+
this.value = null;
|
|
4278
|
+
this.props.onError?.(res);
|
|
4279
|
+
}
|
|
4280
|
+
}
|
|
4281
|
+
}
|
|
4282
|
+
render(props) {
|
|
4283
|
+
const { onBlur, onChange, onError, id } = props;
|
|
4284
|
+
Object.assign(this.props, {
|
|
4285
|
+
onBlur,
|
|
4286
|
+
onChange,
|
|
4287
|
+
onError,
|
|
4288
|
+
id: id ?? this.props.id
|
|
4289
|
+
});
|
|
4290
|
+
const { value, disabled, readonly } = props;
|
|
4291
|
+
Object.assign(this.state, { readonly, value, disabled });
|
|
4292
|
+
if (value !== void 0 && this.previousValue !== value) {
|
|
4293
|
+
this.previousValue = value;
|
|
4294
|
+
this.setValueFromString(value, false);
|
|
4295
|
+
}
|
|
4296
|
+
}
|
|
4297
|
+
}
|
|
4298
|
+
const DateInput = observer(
|
|
4299
|
+
({
|
|
4300
|
+
className,
|
|
4301
|
+
disabled,
|
|
4302
|
+
id: outerId,
|
|
4303
|
+
inputRef,
|
|
4304
|
+
onBlur,
|
|
4305
|
+
onChange,
|
|
4306
|
+
onError,
|
|
4307
|
+
readonly,
|
|
4308
|
+
value: outerValue
|
|
4309
|
+
}) => {
|
|
4310
|
+
const controller = useMemo(() => new DateInputController(), []);
|
|
4311
|
+
controller.render({
|
|
4312
|
+
className,
|
|
4313
|
+
disabled,
|
|
4314
|
+
id: outerId,
|
|
4315
|
+
inputRef,
|
|
4316
|
+
onBlur,
|
|
4317
|
+
onChange,
|
|
4318
|
+
onError,
|
|
4319
|
+
readonly,
|
|
4320
|
+
value: outerValue
|
|
4321
|
+
});
|
|
4322
|
+
return /* @__PURE__ */ jsx(
|
|
4361
4323
|
Box,
|
|
4362
4324
|
{
|
|
4363
4325
|
...getVariant("forms.dateInput"),
|
|
4364
4326
|
className: `${className ?? ""} dateInput`,
|
|
4365
|
-
id:
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
setIsFocused(false);
|
|
4369
|
-
if (hasBlured.current) {
|
|
4370
|
-
hasBlured.current = false;
|
|
4371
|
-
} else if (!document.querySelector(".overlay.screenLock")) {
|
|
4372
|
-
handleBlur(e);
|
|
4373
|
-
}
|
|
4374
|
-
},
|
|
4327
|
+
id: controller.props.id,
|
|
4328
|
+
onBlur: controller.onBlur.bind(controller),
|
|
4329
|
+
ref: controller.ref.bind(controller),
|
|
4375
4330
|
children: /* @__PURE__ */ jsx(
|
|
4376
4331
|
IconInput,
|
|
4377
4332
|
{
|
|
4378
|
-
additionalButtons: (
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4333
|
+
additionalButtons: controller.inputValue && getMaskForDateFormat().replaceAll("9", DEFAULT_MASK_PLACEHOLDER) !== controller.inputValue ? /* @__PURE__ */ jsx(
|
|
4334
|
+
Close,
|
|
4335
|
+
{
|
|
4336
|
+
as: "button",
|
|
4337
|
+
onClick: controller.clear.bind(controller),
|
|
4338
|
+
className: "delete_date_button",
|
|
4339
|
+
onMouseDown: (e) => {
|
|
4340
|
+
e.preventDefault();
|
|
4341
|
+
e.stopPropagation();
|
|
4342
|
+
}
|
|
4343
|
+
}
|
|
4344
|
+
) : void 0,
|
|
4345
|
+
buttonProps: { disabled },
|
|
4388
4346
|
icon: FaCalendarAlt,
|
|
4389
|
-
inputProps
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
onClick: (ev) => {
|
|
4394
|
-
const tooltip = ApiaUtil.instance.tooltips.open({
|
|
4395
|
-
attachToElement() {
|
|
4396
|
-
return ev.target.closest(
|
|
4397
|
-
"button"
|
|
4398
|
-
);
|
|
4399
|
-
},
|
|
4400
|
-
attachToElementAnchorPoint: "center",
|
|
4401
|
-
closeOnClick: false,
|
|
4402
|
-
closeOnClickOut: true,
|
|
4403
|
-
closeOnEscape: true,
|
|
4404
|
-
closeOnMouseLeaveTooltip: false,
|
|
4405
|
-
closeOnMouseLeaveAttachedElement: false,
|
|
4406
|
-
closeOnScrollOut: true,
|
|
4407
|
-
children: CalModalRenderer ? /* @__PURE__ */ jsx(
|
|
4408
|
-
CalModalRenderer,
|
|
4409
|
-
{
|
|
4410
|
-
calValue,
|
|
4411
|
-
locale: DEFAULT_LOCALE,
|
|
4412
|
-
handleClickDay: (ev2) => {
|
|
4413
|
-
selectDate(ev2);
|
|
4414
|
-
setCalValue(ev2);
|
|
4415
|
-
tooltip.close();
|
|
4416
|
-
}
|
|
4417
|
-
}
|
|
4418
|
-
) : /* @__PURE__ */ jsx(
|
|
4419
|
-
CalModal,
|
|
4420
|
-
{
|
|
4421
|
-
calValue,
|
|
4422
|
-
locale: DEFAULT_LOCALE,
|
|
4423
|
-
handleClickDay: (ev2) => {
|
|
4424
|
-
selectDate(ev2);
|
|
4425
|
-
setCalValue(ev2);
|
|
4426
|
-
tooltip.close();
|
|
4427
|
-
}
|
|
4428
|
-
}
|
|
4429
|
-
),
|
|
4430
|
-
initialFocusGetter(el) {
|
|
4431
|
-
return el.querySelector(`.react-calendar__tile--active`);
|
|
4432
|
-
},
|
|
4433
|
-
minSize: { width: 350, height: 310 }
|
|
4434
|
-
});
|
|
4347
|
+
inputProps: {
|
|
4348
|
+
disabled,
|
|
4349
|
+
onChange: controller.onInputChange.bind(controller),
|
|
4350
|
+
value: controller.inputValue
|
|
4435
4351
|
},
|
|
4436
|
-
|
|
4352
|
+
mask: getMaskForDateFormat(),
|
|
4353
|
+
maskPlaceholder: DEFAULT_MASK_PLACEHOLDER,
|
|
4354
|
+
onClick: controller.openCalendar.bind(controller),
|
|
4355
|
+
readOnly: readonly
|
|
4437
4356
|
}
|
|
4438
4357
|
)
|
|
4439
4358
|
}
|
|
4440
|
-
)
|
|
4359
|
+
);
|
|
4441
4360
|
}
|
|
4442
4361
|
);
|
|
4443
4362
|
|
|
@@ -4660,7 +4579,7 @@ const FieldLabel = forwardRef(
|
|
|
4660
4579
|
{
|
|
4661
4580
|
as: as ?? "label",
|
|
4662
4581
|
...props,
|
|
4663
|
-
className: `fieldLabel ${props.className ?? ""}`,
|
|
4582
|
+
className: `fieldLabel ${props.className ?? ""} ${error ? "field_with_error" : ""}`,
|
|
4664
4583
|
...getVariant("layout.common.components.fieldLabel"),
|
|
4665
4584
|
"aria-label": props["aria-label"] ?? label,
|
|
4666
4585
|
ref,
|
|
@@ -7725,7 +7644,7 @@ const Dropzone = ({
|
|
|
7725
7644
|
return /* @__PURE__ */ jsxs(
|
|
7726
7645
|
Box,
|
|
7727
7646
|
{
|
|
7728
|
-
...getVariant("layout.
|
|
7647
|
+
...getVariant("layout.common.components.uploader.dropzone"),
|
|
7729
7648
|
className: "dropzone__container",
|
|
7730
7649
|
children: [
|
|
7731
7650
|
/* @__PURE__ */ jsxs(
|
|
@@ -8828,6 +8747,253 @@ const MDRenderer = ({ str }) => {
|
|
|
8828
8747
|
};
|
|
8829
8748
|
var index = memo(MDRenderer);
|
|
8830
8749
|
|
|
8750
|
+
const SwitchCard = observer(
|
|
8751
|
+
({
|
|
8752
|
+
align = "left",
|
|
8753
|
+
icon,
|
|
8754
|
+
label,
|
|
8755
|
+
notSwitchedLabel,
|
|
8756
|
+
onClose,
|
|
8757
|
+
onSwitch,
|
|
8758
|
+
switchedLabel,
|
|
8759
|
+
switchProps,
|
|
8760
|
+
value,
|
|
8761
|
+
disabled
|
|
8762
|
+
}) => {
|
|
8763
|
+
const [isSwitched, setIsSwitched] = useState(toBoolean(value));
|
|
8764
|
+
useEffect(() => {
|
|
8765
|
+
setIsSwitched(toBoolean(value));
|
|
8766
|
+
}, [value]);
|
|
8767
|
+
const handleSwitchChange = (e) => {
|
|
8768
|
+
const newValue = e.target.checked;
|
|
8769
|
+
setIsSwitched(newValue);
|
|
8770
|
+
if (onSwitch) {
|
|
8771
|
+
onSwitch(newValue);
|
|
8772
|
+
}
|
|
8773
|
+
};
|
|
8774
|
+
return /* @__PURE__ */ jsxs(
|
|
8775
|
+
Box,
|
|
8776
|
+
{
|
|
8777
|
+
className: "switch__card",
|
|
8778
|
+
...getVariant("layout.common.components.switchCard"),
|
|
8779
|
+
children: [
|
|
8780
|
+
align === "left" && /* @__PURE__ */ jsx(
|
|
8781
|
+
Switch,
|
|
8782
|
+
{
|
|
8783
|
+
disabled,
|
|
8784
|
+
checked: isSwitched,
|
|
8785
|
+
...switchProps,
|
|
8786
|
+
onChange: handleSwitchChange
|
|
8787
|
+
}
|
|
8788
|
+
),
|
|
8789
|
+
/* @__PURE__ */ jsxs(Box, { className: "label__container", title: label, children: [
|
|
8790
|
+
icon && /* @__PURE__ */ jsx(Icon$1, { name: icon, title: "" }),
|
|
8791
|
+
label
|
|
8792
|
+
] }),
|
|
8793
|
+
(switchedLabel && isSwitched || align === "right" || onClose) && /* @__PURE__ */ jsxs(Box, { className: "switch__container", children: [
|
|
8794
|
+
!notSwitchedLabel && (isSwitched ? getLabel("lblCanUpdate").text : getLabel("lblCannotUpdate").text),
|
|
8795
|
+
align === "right" && /* @__PURE__ */ jsx(
|
|
8796
|
+
Switch,
|
|
8797
|
+
{
|
|
8798
|
+
disabled,
|
|
8799
|
+
checked: isSwitched,
|
|
8800
|
+
...switchProps,
|
|
8801
|
+
onChange: handleSwitchChange,
|
|
8802
|
+
className: "switch",
|
|
8803
|
+
title: isSwitched ? getLabel("lblCanUpdate").text : getLabel("lblCannotUpdate").text
|
|
8804
|
+
}
|
|
8805
|
+
),
|
|
8806
|
+
onClose && !disabled && /* @__PURE__ */ jsx(Close, { disabled, onClick: onClose })
|
|
8807
|
+
] })
|
|
8808
|
+
]
|
|
8809
|
+
}
|
|
8810
|
+
);
|
|
8811
|
+
}
|
|
8812
|
+
);
|
|
8813
|
+
|
|
8814
|
+
const PermissionsList = observer(() => {
|
|
8815
|
+
const controller = usePermissionsContext();
|
|
8816
|
+
const state = controller.permissions;
|
|
8817
|
+
return /* @__PURE__ */ jsxs(Box, { className: "permissions__list", children: [
|
|
8818
|
+
state.users && state.users.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8819
|
+
/* @__PURE__ */ jsx("span", { children: getLabel("sbtUsers").text }),
|
|
8820
|
+
/* @__PURE__ */ jsx(Box, { as: "ul", children: state.users.map((c) => {
|
|
8821
|
+
return /* @__PURE__ */ jsx(Box, { as: "li", children: /* @__PURE__ */ jsx(
|
|
8822
|
+
SwitchCard,
|
|
8823
|
+
{
|
|
8824
|
+
disabled: controller.disabled,
|
|
8825
|
+
label: c.userLogin,
|
|
8826
|
+
align: "right",
|
|
8827
|
+
icon: "User2",
|
|
8828
|
+
onClose: () => controller.onChangeUsers(
|
|
8829
|
+
controller.permissions.users.filter(
|
|
8830
|
+
(s) => s.userId !== c.userId
|
|
8831
|
+
)
|
|
8832
|
+
),
|
|
8833
|
+
onSwitch: (isSwitched) => c.canUpdate = isSwitched,
|
|
8834
|
+
value: c.canUpdate
|
|
8835
|
+
}
|
|
8836
|
+
) }, c.userId);
|
|
8837
|
+
}) })
|
|
8838
|
+
] }),
|
|
8839
|
+
state.pools && state.pools.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8840
|
+
/* @__PURE__ */ jsx("span", { children: getLabel("lblPool").text }),
|
|
8841
|
+
/* @__PURE__ */ jsx(Box, { as: "ul", children: state.pools.map((c) => {
|
|
8842
|
+
return /* @__PURE__ */ jsx(Box, { as: "li", children: /* @__PURE__ */ jsx(
|
|
8843
|
+
SwitchCard,
|
|
8844
|
+
{
|
|
8845
|
+
label: c.poolName,
|
|
8846
|
+
align: "right",
|
|
8847
|
+
icon: "Groups",
|
|
8848
|
+
onClose: () => controller.onChangePools(
|
|
8849
|
+
controller.permissions.pools.filter(
|
|
8850
|
+
(s) => s.poolId !== c.poolId
|
|
8851
|
+
)
|
|
8852
|
+
),
|
|
8853
|
+
onSwitch: (isSwitched) => c.canUpdate = isSwitched,
|
|
8854
|
+
value: c.canUpdate
|
|
8855
|
+
}
|
|
8856
|
+
) }, c.poolName);
|
|
8857
|
+
}) })
|
|
8858
|
+
] })
|
|
8859
|
+
] });
|
|
8860
|
+
});
|
|
8861
|
+
|
|
8862
|
+
const UserModalBtn = observer(() => {
|
|
8863
|
+
const context = usePermissionsContext();
|
|
8864
|
+
return /* @__PURE__ */ jsx(
|
|
8865
|
+
SimpleButton,
|
|
8866
|
+
{
|
|
8867
|
+
disabled: context.disabled,
|
|
8868
|
+
variant: "outline",
|
|
8869
|
+
onClick: () => {
|
|
8870
|
+
makeApiaUsersModal2().openModal({
|
|
8871
|
+
title: window.LBL_ADD_USER
|
|
8872
|
+
}).then((selected) => {
|
|
8873
|
+
context.onChangeUsers(
|
|
8874
|
+
selected.reduce(
|
|
8875
|
+
(acc, c) => {
|
|
8876
|
+
const newItem = {
|
|
8877
|
+
userId: c.row.id,
|
|
8878
|
+
userLogin: String(c.row.cells[0].children),
|
|
8879
|
+
canUpdate: false
|
|
8880
|
+
};
|
|
8881
|
+
if (!acc.some((c2) => c2.userId === newItem.userId)) {
|
|
8882
|
+
acc.push(newItem);
|
|
8883
|
+
}
|
|
8884
|
+
return acc;
|
|
8885
|
+
},
|
|
8886
|
+
[...context.permissions.users]
|
|
8887
|
+
)
|
|
8888
|
+
);
|
|
8889
|
+
});
|
|
8890
|
+
},
|
|
8891
|
+
children: getLabel("btnAddUser").text
|
|
8892
|
+
}
|
|
8893
|
+
);
|
|
8894
|
+
});
|
|
8895
|
+
|
|
8896
|
+
const PoolModalBtn = observer(() => {
|
|
8897
|
+
const context = usePermissionsContext();
|
|
8898
|
+
return /* @__PURE__ */ jsx(
|
|
8899
|
+
SimpleButton,
|
|
8900
|
+
{
|
|
8901
|
+
disabled: context.disabled,
|
|
8902
|
+
variant: "outline",
|
|
8903
|
+
onClick: () => {
|
|
8904
|
+
makeApiaPoolsModals2().openModal({
|
|
8905
|
+
title: window.LBL_ADD_GROUP
|
|
8906
|
+
}).then((selected) => {
|
|
8907
|
+
context.onChangePools(
|
|
8908
|
+
selected.reduce(
|
|
8909
|
+
(acc, c) => {
|
|
8910
|
+
const newItem = {
|
|
8911
|
+
poolId: c.row.id,
|
|
8912
|
+
poolName: String(c.row.cells[0].children),
|
|
8913
|
+
canUpdate: false
|
|
8914
|
+
};
|
|
8915
|
+
if (!acc.some((c2) => c2.poolId === newItem.poolId)) {
|
|
8916
|
+
acc.push(newItem);
|
|
8917
|
+
}
|
|
8918
|
+
return acc;
|
|
8919
|
+
},
|
|
8920
|
+
[...context.permissions.pools]
|
|
8921
|
+
)
|
|
8922
|
+
);
|
|
8923
|
+
});
|
|
8924
|
+
},
|
|
8925
|
+
children: getLabel("btnAddPool").text
|
|
8926
|
+
}
|
|
8927
|
+
);
|
|
8928
|
+
});
|
|
8929
|
+
|
|
8930
|
+
const PermissionsContext = createContext(null);
|
|
8931
|
+
function usePermissionsContext() {
|
|
8932
|
+
return useContext(PermissionsContext);
|
|
8933
|
+
}
|
|
8934
|
+
const Permissions = observer(
|
|
8935
|
+
({
|
|
8936
|
+
everyonePermissionsValue,
|
|
8937
|
+
collapsePermissions,
|
|
8938
|
+
disabled,
|
|
8939
|
+
onChangeEveryonePermissions,
|
|
8940
|
+
onChangeUsers,
|
|
8941
|
+
onChangePools,
|
|
8942
|
+
permissions
|
|
8943
|
+
}) => {
|
|
8944
|
+
return /* @__PURE__ */ jsx(
|
|
8945
|
+
CollapsiblePanel,
|
|
8946
|
+
{
|
|
8947
|
+
label: /* @__PURE__ */ jsx("span", { children: getLabel("lblPer").text }),
|
|
8948
|
+
id: "permissions",
|
|
8949
|
+
collapseIconToRight: true,
|
|
8950
|
+
closedIcon: "ArrowUpThin",
|
|
8951
|
+
openIcon: "ArrowDownThin",
|
|
8952
|
+
className: "uploader__permissions",
|
|
8953
|
+
collapsed: collapsePermissions,
|
|
8954
|
+
children: /* @__PURE__ */ jsx(
|
|
8955
|
+
PermissionsContext.Provider,
|
|
8956
|
+
{
|
|
8957
|
+
value: {
|
|
8958
|
+
onChangeUsers,
|
|
8959
|
+
onChangePools,
|
|
8960
|
+
permissions,
|
|
8961
|
+
disabled
|
|
8962
|
+
},
|
|
8963
|
+
children: /* @__PURE__ */ jsxs(Box, { ...getVariant("layout.common.components.uploader.permissions"), children: [
|
|
8964
|
+
/* @__PURE__ */ jsxs("label", { className: "uploader__permissions_selection", children: [
|
|
8965
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
8966
|
+
/* @__PURE__ */ jsx("span", { children: getLabel("lblTod").text }),
|
|
8967
|
+
/* @__PURE__ */ jsxs(
|
|
8968
|
+
Select,
|
|
8969
|
+
{
|
|
8970
|
+
disabled,
|
|
8971
|
+
onChange: (ev) => {
|
|
8972
|
+
onChangeEveryonePermissions(
|
|
8973
|
+
ev.target.value
|
|
8974
|
+
);
|
|
8975
|
+
},
|
|
8976
|
+
value: everyonePermissionsValue,
|
|
8977
|
+
children: [
|
|
8978
|
+
/* @__PURE__ */ jsx("option", { value: "M", children: getLabel("lblPerMod").text }),
|
|
8979
|
+
/* @__PURE__ */ jsx("option", { value: "R", children: getLabel("lblPerVer").text }),
|
|
8980
|
+
/* @__PURE__ */ jsx("option", { value: "", children: getLabel("lblAccessDenied").text })
|
|
8981
|
+
]
|
|
8982
|
+
}
|
|
8983
|
+
)
|
|
8984
|
+
] }),
|
|
8985
|
+
/* @__PURE__ */ jsx(UserModalBtn, {}),
|
|
8986
|
+
/* @__PURE__ */ jsx(PoolModalBtn, {})
|
|
8987
|
+
] }),
|
|
8988
|
+
/* @__PURE__ */ jsx(PermissionsList, {})
|
|
8989
|
+
] })
|
|
8990
|
+
}
|
|
8991
|
+
)
|
|
8992
|
+
}
|
|
8993
|
+
);
|
|
8994
|
+
}
|
|
8995
|
+
);
|
|
8996
|
+
|
|
8831
8997
|
const TabsContext = React__default.createContext(null);
|
|
8832
8998
|
function useTabsContext() {
|
|
8833
8999
|
return React__default.useContext(TabsContext);
|
|
@@ -11234,5 +11400,5 @@ const _FiltersStore = class _FiltersStore {
|
|
|
11234
11400
|
__publicField(_FiltersStore, "instance", new _FiltersStore());
|
|
11235
11401
|
let FiltersStore = _FiltersStore;
|
|
11236
11402
|
|
|
11237
|
-
export { Accordion, AccordionAside, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, Aside, AsideLoader, AsidePanel, AutoEllipsis, Autocomplete, AutocompleteController, AutogrowTextarea, BaseButton, BodyAside, CalendarModal, Captcha, CenteredHeaderButtons, Checkbox$1 as Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DeadSessionModal, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FavoriteIcon, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingAside, FooterButtons, FooterResponsiveButtons, HamburguerMenu, Header, HeaderButtons, IconButton, IconInput, IconsList, Label, LabelBox, LinearLoader, LinearSpinnerLock, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, index as MDRenderer, Modal, ModalContext, NumberInput, Overlay, Pagination, Parameter, ParameterRender, Parameters, ParametersGroup, ParametersStore, ParametersTable, ProgressBar, RequiredMark, ScreenLocker, ShowResponsive, SimpleButton, SortableList, SortableListItem, Tab, Tabs, TabsContent, TabsController, TabsList, Templater, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, TwoColumns, TwoColumnsList, UnstyledSortableList, UploadHandler, Uploader, WaiTypeAhead, getFieldErrorStyles, getFieldTouchedStyles, importComponent, isFavoriteIcon, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
|
|
11403
|
+
export { Accordion, AccordionAside, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, Aside, AsideLoader, AsidePanel, AutoEllipsis, Autocomplete, AutocompleteController, AutogrowTextarea, BaseButton, BodyAside, CalendarModal, Captcha, CenteredHeaderButtons, Checkbox$1 as Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DeadSessionModal, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FavoriteIcon, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingAside, FooterButtons, FooterResponsiveButtons, HamburguerMenu, Header, HeaderButtons, IconButton, IconInput, IconsList, Label, LabelBox, LinearLoader, LinearSpinnerLock, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, index as MDRenderer, Modal, ModalContext, NumberInput, Overlay, Pagination, Parameter, ParameterRender, Parameters, ParametersGroup, ParametersStore, ParametersTable, Permissions, ProgressBar, RequiredMark, ScreenLocker, ShowResponsive, SimpleButton, SortableList, SortableListItem, SwitchCard, Tab, Tabs, TabsContent, TabsController, TabsList, Templater, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, TwoColumns, TwoColumnsList, UnstyledSortableList, UploadHandler, Uploader, WaiTypeAhead, getFieldErrorStyles, getFieldTouchedStyles, importComponent, isFavoriteIcon, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
|
|
11238
11404
|
//# sourceMappingURL=index.js.map
|