@apia/util 1.0.1 → 2.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/animate/index.d.ts +4 -0
- package/dist/animate/index.d.ts.map +1 -0
- package/dist/animate/index.js +24 -0
- package/dist/animate/index.js.map +1 -0
- package/dist/array/arrayOrArray.d.ts +4 -0
- package/dist/array/arrayOrArray.d.ts.map +1 -0
- package/dist/array/arrayOrArray.js +8 -0
- package/dist/array/arrayOrArray.js.map +1 -0
- package/dist/array/getIndex.d.ts +14 -0
- package/dist/array/getIndex.d.ts.map +1 -0
- package/dist/array/getIndex.js +12 -0
- package/dist/array/getIndex.js.map +1 -0
- package/dist/crypto/decrypt.d.ts +4 -0
- package/dist/crypto/decrypt.d.ts.map +1 -0
- package/dist/crypto/decrypt.js +16 -0
- package/dist/crypto/decrypt.js.map +1 -0
- package/dist/crypto/encrypt.d.ts +4 -0
- package/dist/crypto/encrypt.d.ts.map +1 -0
- package/dist/crypto/encrypt.js +13 -0
- package/dist/crypto/encrypt.js.map +1 -0
- package/dist/crypto/generateKey.js +11 -0
- package/dist/crypto/generateKey.js.map +1 -0
- package/dist/date/apiaDateToStandarFormat.d.ts +4 -0
- package/dist/date/apiaDateToStandarFormat.d.ts.map +1 -0
- package/dist/date/apiaDateToStandarFormat.js +12 -0
- package/dist/date/apiaDateToStandarFormat.js.map +1 -0
- package/dist/date/dateToApiaFormat.d.ts +4 -0
- package/dist/date/dateToApiaFormat.d.ts.map +1 -0
- package/dist/date/dateToApiaFormat.js +9 -0
- package/dist/date/dateToApiaFormat.js.map +1 -0
- package/dist/date/getDateFormat.d.ts +11 -0
- package/dist/date/getDateFormat.d.ts.map +1 -0
- package/dist/date/getDateFormat.js +20 -0
- package/dist/date/getDateFormat.js.map +1 -0
- package/dist/debug/debugDispatcher.d.ts +32 -0
- package/dist/debug/debugDispatcher.d.ts.map +1 -0
- package/dist/debug/debugDispatcher.js +72 -0
- package/dist/debug/debugDispatcher.js.map +1 -0
- package/dist/debug/shortcutController.d.ts +57 -0
- package/dist/debug/shortcutController.d.ts.map +1 -0
- package/dist/debug/shortcutController.js +152 -0
- package/dist/debug/shortcutController.js.map +1 -0
- package/dist/documents/downloadStringAsDoc.d.ts +8 -0
- package/dist/documents/downloadStringAsDoc.d.ts.map +1 -0
- package/dist/documents/downloadStringAsDoc.js +12 -0
- package/dist/documents/downloadStringAsDoc.js.map +1 -0
- package/dist/documents/downloadUrl.d.ts +20 -0
- package/dist/documents/downloadUrl.d.ts.map +1 -0
- package/dist/documents/downloadUrl.js +18 -0
- package/dist/documents/downloadUrl.js.map +1 -0
- package/dist/documents/openAndReadFile.d.ts +4 -0
- package/dist/documents/openAndReadFile.d.ts.map +1 -0
- package/dist/documents/openAndReadFile.js +29 -0
- package/dist/documents/openAndReadFile.js.map +1 -0
- package/dist/dom/autoDisconnectMutationObserver.d.ts +17 -0
- package/dist/dom/autoDisconnectMutationObserver.d.ts.map +1 -0
- package/dist/dom/autoDisconnectMutationObserver.js +35 -0
- package/dist/dom/autoDisconnectMutationObserver.js.map +1 -0
- package/dist/dom/customEvents.d.ts +40 -0
- package/dist/dom/customEvents.d.ts.map +1 -0
- package/dist/dom/customEvents.js +34 -0
- package/dist/dom/customEvents.js.map +1 -0
- package/dist/dom/enableChildrenFocus.d.ts +18 -0
- package/dist/dom/enableChildrenFocus.d.ts.map +1 -0
- package/dist/dom/enableChildrenFocus.js +26 -0
- package/dist/dom/enableChildrenFocus.js.map +1 -0
- package/dist/dom/findOffsetRelativeToScrollParent.d.ts +7 -0
- package/dist/dom/findOffsetRelativeToScrollParent.d.ts.map +1 -0
- package/dist/dom/findOffsetRelativeToScrollParent.js +19 -0
- package/dist/dom/findOffsetRelativeToScrollParent.js.map +1 -0
- package/dist/dom/findScrollContainer.d.ts +8 -0
- package/dist/dom/findScrollContainer.d.ts.map +1 -0
- package/dist/dom/findScrollContainer.js +9 -0
- package/dist/dom/findScrollContainer.js.map +1 -0
- package/dist/dom/getFocusSelector.d.ts +25 -0
- package/dist/dom/getFocusSelector.d.ts.map +1 -0
- package/dist/dom/getFocusSelector.js +30 -0
- package/dist/dom/getFocusSelector.js.map +1 -0
- package/dist/dom/getSpecificParent.d.ts +23 -0
- package/dist/dom/getSpecificParent.d.ts.map +1 -0
- package/dist/dom/getSpecificParent.js +19 -0
- package/dist/dom/getSpecificParent.js.map +1 -0
- package/dist/dom/isChild.d.ts +13 -0
- package/dist/dom/isChild.d.ts.map +1 -0
- package/dist/dom/isChild.js +8 -0
- package/dist/dom/isChild.js.map +1 -0
- package/dist/dom/scrollParentIntoElement.d.ts +9 -0
- package/dist/dom/scrollParentIntoElement.d.ts.map +1 -0
- package/dist/dom/scrollParentIntoElement.js +24 -0
- package/dist/dom/scrollParentIntoElement.js.map +1 -0
- package/dist/dom/url.d.ts +18 -0
- package/dist/dom/url.d.ts.map +1 -0
- package/dist/dom/url.js +52 -0
- package/dist/dom/url.js.map +1 -0
- package/dist/dom/usePanAndZoom.d.ts +14 -0
- package/dist/dom/usePanAndZoom.d.ts.map +1 -0
- package/dist/dom/usePanAndZoom.js +111 -0
- package/dist/dom/usePanAndZoom.js.map +1 -0
- package/dist/encoding/index.d.ts +8 -0
- package/dist/encoding/index.d.ts.map +1 -0
- package/dist/encoding/index.js +12 -0
- package/dist/encoding/index.js.map +1 -0
- package/dist/events/BouncingEmitter.d.ts +67 -0
- package/dist/events/BouncingEmitter.d.ts.map +1 -0
- package/dist/events/BouncingEmitter.js +72 -0
- package/dist/events/BouncingEmitter.js.map +1 -0
- package/dist/events/EventEmitter.d.ts +47 -0
- package/dist/events/EventEmitter.d.ts.map +1 -0
- package/dist/events/EventEmitter.js +75 -0
- package/dist/events/EventEmitter.js.map +1 -0
- package/dist/events/StatefulEmitter.d.ts +44 -0
- package/dist/events/StatefulEmitter.d.ts.map +1 -0
- package/dist/events/StatefulEmitter.js +57 -0
- package/dist/events/StatefulEmitter.js.map +1 -0
- package/dist/events/types.d.ts +29 -0
- package/dist/events/types.d.ts.map +1 -0
- package/dist/focus/focusController.d.ts +108 -0
- package/dist/focus/focusController.d.ts.map +1 -0
- package/dist/focus/focusController.js +295 -0
- package/dist/focus/focusController.js.map +1 -0
- package/dist/focus/globalFocus.d.ts +24 -0
- package/dist/focus/globalFocus.d.ts.map +1 -0
- package/dist/focus/globalFocus.js +87 -0
- package/dist/focus/globalFocus.js.map +1 -0
- package/dist/history/History.d.ts +81 -0
- package/dist/history/History.d.ts.map +1 -0
- package/dist/history/History.js +122 -0
- package/dist/history/History.js.map +1 -0
- package/dist/hooks/useCombinedRefs.d.ts +18 -0
- package/dist/hooks/useCombinedRefs.d.ts.map +1 -0
- package/dist/hooks/useCombinedRefs.js +20 -0
- package/dist/hooks/useCombinedRefs.js.map +1 -0
- package/dist/hooks/useDebouncedCallback.d.ts +7 -0
- package/dist/hooks/useDebouncedCallback.d.ts.map +1 -0
- package/dist/hooks/useDebouncedCallback.js +21 -0
- package/dist/hooks/useDebouncedCallback.js.map +1 -0
- package/dist/hooks/useLatest.d.ts +13 -0
- package/dist/hooks/useLatest.d.ts.map +1 -0
- package/dist/hooks/useLatest.js +10 -0
- package/dist/hooks/useLatest.js.map +1 -0
- package/dist/hooks/useMount.d.ts +6 -0
- package/dist/hooks/useMount.d.ts.map +1 -0
- package/dist/hooks/useMount.js +14 -0
- package/dist/hooks/useMount.js.map +1 -0
- package/dist/hooks/usePrevious.d.ts +6 -0
- package/dist/hooks/usePrevious.d.ts.map +1 -0
- package/dist/hooks/usePrevious.js +12 -0
- package/dist/hooks/usePrevious.js.map +1 -0
- package/dist/hooks/useShallowMemo.d.ts +9 -0
- package/dist/hooks/useShallowMemo.d.ts.map +1 -0
- package/dist/hooks/useShallowMemo.js +42 -0
- package/dist/hooks/useShallowMemo.js.map +1 -0
- package/dist/hooks/useStateRef.d.ts +10 -0
- package/dist/hooks/useStateRef.d.ts.map +1 -0
- package/dist/hooks/useStateRef.js +11 -0
- package/dist/hooks/useStateRef.js.map +1 -0
- package/dist/hooks/useSubscription.d.ts +31 -0
- package/dist/hooks/useSubscription.d.ts.map +1 -0
- package/dist/hooks/useSubscription.js +21 -0
- package/dist/hooks/useSubscription.js.map +1 -0
- package/dist/hooks/useUnmount.d.ts +4 -0
- package/dist/hooks/useUnmount.d.ts.map +1 -0
- package/dist/hooks/useUnmount.js +10 -0
- package/dist/hooks/useUnmount.js.map +1 -0
- package/dist/hooks/useUpdateEffect.d.ts +10 -0
- package/dist/hooks/useUpdateEffect.d.ts.map +1 -0
- package/dist/hooks/useUpdateEffect.js +16 -0
- package/dist/hooks/useUpdateEffect.js.map +1 -0
- package/dist/imperative/makeImperativeComponent.d.ts +56 -0
- package/dist/imperative/makeImperativeComponent.d.ts.map +1 -0
- package/dist/imperative/makeImperativeComponent.js +48 -0
- package/dist/imperative/makeImperativeComponent.js.map +1 -0
- package/dist/imperative/makeSingleImperativeComponent.d.ts +15 -0
- package/dist/imperative/makeSingleImperativeComponent.d.ts.map +1 -0
- package/dist/imperative/makeSingleImperativeComponent.js +31 -0
- package/dist/imperative/makeSingleImperativeComponent.js.map +1 -0
- package/dist/imperative/types.d.ts +22 -0
- package/dist/imperative/types.d.ts.map +1 -0
- package/dist/imperative/types.js +8 -0
- package/dist/imperative/types.js.map +1 -0
- package/dist/imperative/useImperativeComponentEvents.d.ts +6 -0
- package/dist/imperative/useImperativeComponentEvents.d.ts.map +1 -0
- package/dist/imperative/useImperativeComponentEvents.js +35 -0
- package/dist/imperative/useImperativeComponentEvents.js.map +1 -0
- package/dist/imperative/useImperativeIdentifierContext.d.ts +14 -0
- package/dist/imperative/useImperativeIdentifierContext.d.ts.map +1 -0
- package/dist/imperative/useImperativeIdentifierContext.js +10 -0
- package/dist/imperative/useImperativeIdentifierContext.js.map +1 -0
- package/dist/index.d.ts +69 -1777
- package/dist/index.js +63 -2659
- package/dist/index.js.map +1 -1
- package/dist/labels/formatMessage.d.ts +19 -0
- package/dist/labels/formatMessage.d.ts.map +1 -0
- package/dist/labels/formatMessage.js +13 -0
- package/dist/labels/formatMessage.js.map +1 -0
- package/dist/labels/getLabel.d.ts +34 -0
- package/dist/labels/getLabel.d.ts.map +1 -0
- package/dist/labels/getLabel.js +18 -0
- package/dist/labels/getLabel.js.map +1 -0
- package/dist/number/index.d.ts +29 -0
- package/dist/number/index.d.ts.map +1 -0
- package/dist/number/index.js +43 -0
- package/dist/number/index.js.map +1 -0
- package/dist/objects/getValueByPath.d.ts +23 -0
- package/dist/objects/getValueByPath.d.ts.map +1 -0
- package/dist/objects/getValueByPath.js +19 -0
- package/dist/objects/getValueByPath.js.map +1 -0
- package/dist/objects/setValueByPath.d.ts +33 -0
- package/dist/objects/setValueByPath.d.ts.map +1 -0
- package/dist/objects/setValueByPath.js +35 -0
- package/dist/objects/setValueByPath.js.map +1 -0
- package/dist/propsStore/propsStore.d.ts +42 -0
- package/dist/propsStore/propsStore.d.ts.map +1 -0
- package/dist/propsStore/propsStore.js +157 -0
- package/dist/propsStore/propsStore.js.map +1 -0
- package/dist/propsStore/types.d.ts +24 -0
- package/dist/propsStore/types.d.ts.map +1 -0
- package/dist/propsStore/usePropsSelector.d.ts +67 -0
- package/dist/propsStore/usePropsSelector.d.ts.map +1 -0
- package/dist/propsStore/usePropsSelector.js +92 -0
- package/dist/propsStore/usePropsSelector.js.map +1 -0
- package/dist/screenLock/screenLocker.d.ts +60 -0
- package/dist/screenLock/screenLocker.d.ts.map +1 -0
- package/dist/screenLock/screenLocker.js +95 -0
- package/dist/screenLock/screenLocker.js.map +1 -0
- package/dist/states/useDebouncedState.d.ts +10 -0
- package/dist/states/useDebouncedState.d.ts.map +1 -0
- package/dist/states/useDebouncedState.js +22 -0
- package/dist/states/useDebouncedState.js.map +1 -0
- package/dist/states/useDomState.d.ts +86 -0
- package/dist/states/useDomState.d.ts.map +1 -0
- package/dist/states/useDomState.js +35 -0
- package/dist/states/useDomState.js.map +1 -0
- package/dist/storage/StatefulStore.d.ts +205 -0
- package/dist/storage/StatefulStore.d.ts.map +1 -0
- package/dist/storage/StatefulStore.js +301 -0
- package/dist/storage/StatefulStore.js.map +1 -0
- package/dist/storage/persistentStorage.d.ts +12 -0
- package/dist/storage/persistentStorage.d.ts.map +1 -0
- package/dist/storage/persistentStorage.js +28 -0
- package/dist/storage/persistentStorage.js.map +1 -0
- package/dist/storage/useLocalStorage.d.ts +7 -0
- package/dist/storage/useLocalStorage.d.ts.map +1 -0
- package/dist/storage/useLocalStorage.js +40 -0
- package/dist/storage/useLocalStorage.js.map +1 -0
- package/dist/string/alignment.d.ts +25 -0
- package/dist/string/alignment.d.ts.map +1 -0
- package/dist/string/alignment.js +26 -0
- package/dist/string/alignment.js.map +1 -0
- package/dist/string/ucfirst.d.ts +4 -0
- package/dist/string/ucfirst.d.ts.map +1 -0
- package/dist/string/ucfirst.js +6 -0
- package/dist/string/ucfirst.js.map +1 -0
- package/dist/typeGuards/toBoolean.d.ts +26 -0
- package/dist/typeGuards/toBoolean.d.ts.map +1 -0
- package/dist/typeGuards/toBoolean.js +11 -0
- package/dist/typeGuards/toBoolean.js.map +1 -0
- package/dist/types/apia/common.d.ts +114 -0
- package/dist/types/apia/common.d.ts.map +1 -0
- package/dist/types/apia/date.d.ts +4 -0
- package/dist/types/apia/date.d.ts.map +1 -0
- package/dist/types/apia/forms.d.ts +221 -0
- package/dist/types/apia/forms.d.ts.map +1 -0
- package/dist/types/misc.d.ts +9 -0
- package/dist/types/misc.d.ts.map +1 -0
- package/dist/xml/parseXmlAsync.d.ts +4 -0
- package/dist/xml/parseXmlAsync.d.ts.map +1 -0
- package/dist/xml/parseXmlAsync.js +58 -0
- package/dist/xml/parseXmlAsync.js.map +1 -0
- package/package.json +24 -35
- package/LICENSE.md +0 -21
- package/README.md +0 -18
- package/cleanDist.json +0 -3
- package/entries.json +0 -1
package/dist/index.js
CHANGED
|
@@ -1,2659 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (progress < 1)
|
|
65
|
-
suscription = window.requestAnimationFrame(innerAnimate);
|
|
66
|
-
else
|
|
67
|
-
onFinish == null ? void 0 : onFinish();
|
|
68
|
-
}
|
|
69
|
-
suscription = window.requestAnimationFrame(innerAnimate);
|
|
70
|
-
return () => {
|
|
71
|
-
window.cancelAnimationFrame(suscription);
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function arrayOrArray(o) {
|
|
76
|
-
if (o === void 0)
|
|
77
|
-
return [];
|
|
78
|
-
return Array.isArray(o) ? o : [o];
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function getIndex(arr, conditions, defaultIndex) {
|
|
82
|
-
for (let i = 0; i < conditions.length; i++) {
|
|
83
|
-
if (typeof conditions[i] === "boolean" && conditions[i] || isFunction(conditions[i]) && conditions[i]())
|
|
84
|
-
return arr[i];
|
|
85
|
-
}
|
|
86
|
-
return arr[defaultIndex != null ? defaultIndex : -1];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const generateKey = (salt, passPhrase, keySize, iterationCount) => {
|
|
90
|
-
const key = CryptoJS.PBKDF2(passPhrase, CryptoJS.enc.Hex.parse(salt), {
|
|
91
|
-
keySize: keySize / 32,
|
|
92
|
-
iterations: iterationCount
|
|
93
|
-
});
|
|
94
|
-
return key;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const decrypt = (salt, iv, passPhrase, cipherText, keySize, iterationCount) => {
|
|
98
|
-
const key = generateKey(salt, passPhrase, keySize, iterationCount);
|
|
99
|
-
const cipherParams = CryptoJS.lib.CipherParams.create({
|
|
100
|
-
ciphertext: CryptoJS.enc.Base64.parse(cipherText)
|
|
101
|
-
});
|
|
102
|
-
const decrypted = CryptoJS.AES.decrypt(cipherParams, key, {
|
|
103
|
-
iv: CryptoJS.enc.Hex.parse(iv)
|
|
104
|
-
});
|
|
105
|
-
return decrypted.toString(CryptoJS.enc.Utf8);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
const encrypt = (salt, iv, passPhrase, plainText, keySize, iterationCount) => {
|
|
109
|
-
const key = generateKey(salt, passPhrase, keySize, iterationCount);
|
|
110
|
-
const encrypted = CryptoJS.AES.encrypt(plainText, key, {
|
|
111
|
-
iv: CryptoJS.enc.Hex.parse(iv)
|
|
112
|
-
});
|
|
113
|
-
return encrypted.ciphertext.toString(CryptoJS.enc.Base64);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
dayjs.extend(customParseFormat);
|
|
117
|
-
const DEFAULT_DATE_FORMAT = "DD/MM/YYYY";
|
|
118
|
-
const getDateFormat = () => {
|
|
119
|
-
switch (window.DATE_FORMAT) {
|
|
120
|
-
case "m/d/Y":
|
|
121
|
-
return "MM/DD/YYYY";
|
|
122
|
-
case "d/m/Y":
|
|
123
|
-
return DEFAULT_DATE_FORMAT;
|
|
124
|
-
case "Y/m/d":
|
|
125
|
-
return "YYYY/MM/DD";
|
|
126
|
-
default:
|
|
127
|
-
return "DD/MM/YYYY";
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
function apiaDateToStandarFormat(date) {
|
|
132
|
-
const newDate = dayjs(date, getDateFormat());
|
|
133
|
-
if (!newDate.isValid())
|
|
134
|
-
return "";
|
|
135
|
-
return newDate.format("YYYY-MM-DD");
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function dateToApiaFormat(date) {
|
|
139
|
-
return dayjs(date).format(getDateFormat());
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
let isEnabled = false;
|
|
143
|
-
function isDebugDispatcherEnabled() {
|
|
144
|
-
return isEnabled;
|
|
145
|
-
}
|
|
146
|
-
function enableDebugDispatcher() {
|
|
147
|
-
isEnabled = true;
|
|
148
|
-
}
|
|
149
|
-
const debugDispatcher = new class DDispatcher {
|
|
150
|
-
constructor() {
|
|
151
|
-
this.callbacks = {};
|
|
152
|
-
this.actions = {
|
|
153
|
-
shout: () => {
|
|
154
|
-
console.log(Object.keys(this.callbacks));
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
this.emit = (action, ...parameters) => {
|
|
158
|
-
var _a, _b, _c, _d;
|
|
159
|
-
if (this.actions[action])
|
|
160
|
-
this.actions[action]();
|
|
161
|
-
else {
|
|
162
|
-
if (((_a = this.callbacks[action]) != null ? _a : []).length === 1)
|
|
163
|
-
return (_c = (_b = this.callbacks[action]) == null ? void 0 : _b[0]) == null ? void 0 : _c.call(_b, parameters);
|
|
164
|
-
((_d = this.callbacks[action]) != null ? _d : []).forEach((cb) => {
|
|
165
|
-
return cb(parameters);
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
return null;
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
on(action, cb, help, onlyDevelop = false) {
|
|
172
|
-
if (!isEnabled && onlyDevelop)
|
|
173
|
-
return () => {
|
|
174
|
-
};
|
|
175
|
-
if (Object.keys(this.actions).includes(action))
|
|
176
|
-
throw new Error(
|
|
177
|
-
`The action ${action} is a reserved word for the dispatcher.`
|
|
178
|
-
);
|
|
179
|
-
if (!this.callbacks[action])
|
|
180
|
-
this.callbacks[action] = [];
|
|
181
|
-
const actionMethod = Object.assign(cb, {
|
|
182
|
-
help: () => {
|
|
183
|
-
if (typeof help === "string")
|
|
184
|
-
console.info(help);
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
this.callbacks[action].push(actionMethod);
|
|
188
|
-
this[action] = Object.assign(
|
|
189
|
-
(...props) => {
|
|
190
|
-
this.emit(action, ...props);
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
help: () => {
|
|
194
|
-
if (typeof help === "string")
|
|
195
|
-
console.info(help);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
);
|
|
199
|
-
return () => {
|
|
200
|
-
this.off(action, cb);
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
off(action, cb) {
|
|
204
|
-
this.callbacks[action] = this.callbacks[action].filter((current) => {
|
|
205
|
-
return current !== cb;
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
}();
|
|
209
|
-
window.dd = debugDispatcher;
|
|
210
|
-
window.adt = debugDispatcher;
|
|
211
|
-
|
|
212
|
-
const shortcutController = new class ShortcutController {
|
|
213
|
-
constructor() {
|
|
214
|
-
this.history = [];
|
|
215
|
-
this.candidates = [];
|
|
216
|
-
this.shortcuts = {
|
|
217
|
-
callbacks: [],
|
|
218
|
-
children: [],
|
|
219
|
-
key: { key: "" }
|
|
220
|
-
};
|
|
221
|
-
this.shortcutsStrings = [];
|
|
222
|
-
this.categories = {
|
|
223
|
-
dev: ["shift&D"]
|
|
224
|
-
};
|
|
225
|
-
document.addEventListener("keydown", (ev) => {
|
|
226
|
-
var _a;
|
|
227
|
-
if (((_a = ev.key) == null ? void 0 : _a.length) !== 1 && ev.key !== "Escape")
|
|
228
|
-
return;
|
|
229
|
-
this.candidates = [
|
|
230
|
-
...this.candidates.reduce(
|
|
231
|
-
(accumulated, current) => [
|
|
232
|
-
...accumulated,
|
|
233
|
-
...current.children.filter(
|
|
234
|
-
(child) => child.key.key === ev.key && child.key.altKey === ev.altKey && child.key.ctrlKey === ev.ctrlKey && child.key.shiftKey === ev.shiftKey
|
|
235
|
-
)
|
|
236
|
-
],
|
|
237
|
-
[]
|
|
238
|
-
),
|
|
239
|
-
...this.shortcuts.children.filter(
|
|
240
|
-
(current) => current.key.key === ev.key && current.key.altKey === ev.altKey && current.key.ctrlKey === ev.ctrlKey && current.key.shiftKey === ev.shiftKey
|
|
241
|
-
)
|
|
242
|
-
];
|
|
243
|
-
this.candidates.forEach((current) => {
|
|
244
|
-
var _a2;
|
|
245
|
-
if (current.fireEvenFromInputs || !(!ev.key || ev.key.length > 1 || ["input", "textarea", "select"].includes(
|
|
246
|
-
(_a2 = ev.target.tagName) == null ? void 0 : _a2.toLowerCase()
|
|
247
|
-
))) {
|
|
248
|
-
if (current.callbacks)
|
|
249
|
-
current.callbacks.forEach((cb) => cb(ev));
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
debugDispatcher.on(
|
|
254
|
-
"shortcuts",
|
|
255
|
-
() => {
|
|
256
|
-
console.info(this.shortcutsStrings);
|
|
257
|
-
console.info(this.shortcuts, this.history);
|
|
258
|
-
},
|
|
259
|
-
"Muestra los shortcuts registrados"
|
|
260
|
-
);
|
|
261
|
-
this.on(
|
|
262
|
-
"short".split(""),
|
|
263
|
-
() => {
|
|
264
|
-
this.shortcutsStrings.forEach((shortcut) => console.info(shortcut));
|
|
265
|
-
},
|
|
266
|
-
"dev"
|
|
267
|
-
);
|
|
268
|
-
}
|
|
269
|
-
parseKeyToString(key) {
|
|
270
|
-
if (typeof key === "string")
|
|
271
|
-
return key;
|
|
272
|
-
return `${key.altKey ? "alt&" : ""}${key.ctrlKey ? "ctrl&" : ""}${key.shiftKey ? "shift&" : ""}${key.key}`;
|
|
273
|
-
}
|
|
274
|
-
parseKey(keyString) {
|
|
275
|
-
const elements = keyString.split("&");
|
|
276
|
-
const altKey = elements.includes("alt");
|
|
277
|
-
const ctrlKey = elements.includes("ctrl");
|
|
278
|
-
const shiftKey = elements.includes("shift");
|
|
279
|
-
const key = elements.find(
|
|
280
|
-
(current) => current !== "shift" && current !== "alt" && current !== "ctrl"
|
|
281
|
-
);
|
|
282
|
-
if (!key)
|
|
283
|
-
throw new Error(`parseKey "${keyString}" does not have key.`);
|
|
284
|
-
return {
|
|
285
|
-
key,
|
|
286
|
-
altKey,
|
|
287
|
-
ctrlKey,
|
|
288
|
-
shiftKey
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* Para setear un shorcut se puede pasar un string representativo con la
|
|
293
|
-
* forma:
|
|
294
|
-
*
|
|
295
|
-
* **alt**?&**ctrl**?&**shift**?&**(\w)**
|
|
296
|
-
*
|
|
297
|
-
* Donde: alt? ctrl? shift? implica que cualquiera de esas palabras pueden o
|
|
298
|
-
* no aparecer y (\w) es una letra, símbolo o número.
|
|
299
|
-
*
|
|
300
|
-
* Puede aparecer cualquier tecla de control o no, pero el símbolo o letra
|
|
301
|
-
* debe aparecer.
|
|
302
|
-
*
|
|
303
|
-
* @param category
|
|
304
|
-
* Agrega un prefijo de teclas que se deben presionar antes del shortcut para
|
|
305
|
-
* que funcione, de forma que por ejemplo, todos los shortcuts de la categoría
|
|
306
|
-
* dev serán ejecutados solamente si antes se presionó shift&D
|
|
307
|
-
*
|
|
308
|
-
* @example
|
|
309
|
-
*
|
|
310
|
-
shortcutController.on(['shift&A', 'b', 'ctrl&c', 'alt&d'], (ev) => {
|
|
311
|
-
ev.preventDefault();
|
|
312
|
-
console.log('Abctrl+cd'),
|
|
313
|
-
}); // Este shortcut se ejecuta en desarrollo y producción
|
|
314
|
-
|
|
315
|
-
shortcutController.on('unshortcut'.split(''), (ev) => {
|
|
316
|
-
ev.preventDefault();
|
|
317
|
-
console.log('Abctrl+cd'),
|
|
318
|
-
}, 'dev'); // Este shortcut solo se ejecuta en desarrollo
|
|
319
|
-
*/
|
|
320
|
-
on(keys, callback, category, fireEvenFromInputs) {
|
|
321
|
-
if (category === "dev" && !isDebugDispatcherEnabled())
|
|
322
|
-
return;
|
|
323
|
-
let container = this.shortcuts;
|
|
324
|
-
const actualKeys = category ? [...this.categories[category], ...keys] : keys;
|
|
325
|
-
if (this.shortcutsStrings.includes(
|
|
326
|
-
actualKeys.map((current) => this.parseKeyToString(current)).join("")
|
|
327
|
-
)) {
|
|
328
|
-
console.warn(
|
|
329
|
-
`The shortcut ${actualKeys.map((current) => this.parseKeyToString(current)).join(
|
|
330
|
-
""
|
|
331
|
-
)} is being setted twice. The controller wont register more than one instance but this could be a hint if some unexpected behavior.`
|
|
332
|
-
);
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
335
|
-
for (const key of actualKeys) {
|
|
336
|
-
const actualKey = typeof key === "string" ? this.parseKey(key) : key;
|
|
337
|
-
if (actualKey.key === "")
|
|
338
|
-
throw new Error(`Empty key ('') is not allowed`);
|
|
339
|
-
const keyContainer = container.children.find(
|
|
340
|
-
(current) => current.key.key === actualKey.key || current.key.key === "" && current.key.altKey === actualKey.altKey && current.key.ctrlKey === actualKey.ctrlKey && current.key.shiftKey === actualKey.shiftKey && current.fireEvenFromInputs === fireEvenFromInputs
|
|
341
|
-
);
|
|
342
|
-
if (keyContainer)
|
|
343
|
-
container = keyContainer;
|
|
344
|
-
else {
|
|
345
|
-
const newContainer = {
|
|
346
|
-
callbacks: [],
|
|
347
|
-
children: [],
|
|
348
|
-
key: actualKey,
|
|
349
|
-
fireEvenFromInputs
|
|
350
|
-
};
|
|
351
|
-
container.children.push(newContainer);
|
|
352
|
-
container = newContainer;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
this.shortcutsStrings.push(
|
|
356
|
-
actualKeys.map((current) => this.parseKeyToString(current)).join("")
|
|
357
|
-
);
|
|
358
|
-
container.callbacks.push(callback);
|
|
359
|
-
}
|
|
360
|
-
}();
|
|
361
|
-
|
|
362
|
-
function autoDisconnectMutationObserver(element, callback, conf) {
|
|
363
|
-
var _a;
|
|
364
|
-
let timeoutRegister = -1;
|
|
365
|
-
let isConnected = false;
|
|
366
|
-
function disconnect() {
|
|
367
|
-
if (isConnected) {
|
|
368
|
-
isConnected = false;
|
|
369
|
-
observer.disconnect();
|
|
370
|
-
clearTimeout(timeoutRegister);
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
let shoutCallback;
|
|
374
|
-
const observer = new MutationObserver((...props) => {
|
|
375
|
-
var _a2, _b;
|
|
376
|
-
if (((_a2 = props[0]) == null ? void 0 : _a2[0]) && (props[0][0].removedNodes || props[0][0].addedNodes)) {
|
|
377
|
-
clearTimeout(shoutCallback);
|
|
378
|
-
shoutCallback = setTimeout(callback, 100);
|
|
379
|
-
clearTimeout(timeoutRegister);
|
|
380
|
-
timeoutRegister = setTimeout(
|
|
381
|
-
disconnect,
|
|
382
|
-
(_b = conf == null ? void 0 : conf.timeout) != null ? _b : 100
|
|
383
|
-
);
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
isConnected = true;
|
|
387
|
-
observer.observe(element, { subtree: true, childList: true });
|
|
388
|
-
timeoutRegister = setTimeout(
|
|
389
|
-
disconnect,
|
|
390
|
-
(_a = conf == null ? void 0 : conf.timeout) != null ? _a : 100
|
|
391
|
-
);
|
|
392
|
-
if ((conf == null ? void 0 : conf.runCallbackOnInit) !== false)
|
|
393
|
-
shoutCallback = setTimeout(callback, 100);
|
|
394
|
-
return disconnect;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
var __async$2 = (__this, __arguments, generator) => {
|
|
398
|
-
return new Promise((resolve, reject) => {
|
|
399
|
-
var fulfilled = (value) => {
|
|
400
|
-
try {
|
|
401
|
-
step(generator.next(value));
|
|
402
|
-
} catch (e) {
|
|
403
|
-
reject(e);
|
|
404
|
-
}
|
|
405
|
-
};
|
|
406
|
-
var rejected = (value) => {
|
|
407
|
-
try {
|
|
408
|
-
step(generator.throw(value));
|
|
409
|
-
} catch (e) {
|
|
410
|
-
reject(e);
|
|
411
|
-
}
|
|
412
|
-
};
|
|
413
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
414
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
415
|
-
});
|
|
416
|
-
};
|
|
417
|
-
function defaultGetNameFromResponse(blob) {
|
|
418
|
-
var _a, _b, _c, _d;
|
|
419
|
-
return (_d = (_c = (_b = (_a = blob.headers["content-disposition"]) == null ? void 0 : _a.match) == null ? void 0 : _b.call(
|
|
420
|
-
_a,
|
|
421
|
-
/filename=(?:\\?")?([\w,\s-() ]+(?:\.[A-Za-z]+)?)(?:\\?")?;?/
|
|
422
|
-
)) == null ? void 0 : _c[1]) != null ? _d : "noFileName";
|
|
423
|
-
}
|
|
424
|
-
function downloadUrl(_0) {
|
|
425
|
-
return __async$2(this, arguments, function* (url, secondParameter = defaultGetNameFromResponse) {
|
|
426
|
-
const blob = yield axios.get(url, {
|
|
427
|
-
responseType: "blob"
|
|
428
|
-
});
|
|
429
|
-
const actualFileName = typeof secondParameter === "string" ? secondParameter : secondParameter(blob);
|
|
430
|
-
FileSaver.saveAs(new Blob([blob.data]), actualFileName);
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
const REGEXP_SCROLL_PARENT = /^(visible|hidden)/;
|
|
435
|
-
function findScrollContainer(el) {
|
|
436
|
-
return !(el instanceof HTMLElement) || typeof window.getComputedStyle !== "function" ? null : el.scrollHeight >= el.clientHeight && !REGEXP_SCROLL_PARENT.test(
|
|
437
|
-
window.getComputedStyle(el).overflowY || "visible"
|
|
438
|
-
) ? el : findScrollContainer(el.parentElement) || document.body;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
function findOffsetRelativeToScrollParent(element, which = "Top") {
|
|
442
|
-
const scrollParent = findScrollContainer(element);
|
|
443
|
-
let currentElement = element;
|
|
444
|
-
let offset = 0;
|
|
445
|
-
let offsetParent = currentElement;
|
|
446
|
-
while (currentElement && currentElement !== scrollParent && currentElement !== document.body && offsetParent !== scrollParent) {
|
|
447
|
-
if (offsetParent !== currentElement.offsetParent) {
|
|
448
|
-
offset += currentElement[`offset${which}`];
|
|
449
|
-
offsetParent = currentElement.offsetParent;
|
|
450
|
-
}
|
|
451
|
-
currentElement = currentElement.parentElement;
|
|
452
|
-
}
|
|
453
|
-
return offset;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
const scrollIntervals = {};
|
|
457
|
-
function scrollParentIntoElement(element, fixedOffsetTop = 0, tries = 2, timeout = 100, scrollId = void 0) {
|
|
458
|
-
var _a;
|
|
459
|
-
if (scrollId) {
|
|
460
|
-
clearTimeout(scrollIntervals[scrollId]);
|
|
461
|
-
}
|
|
462
|
-
const scrollParent = findScrollContainer(element);
|
|
463
|
-
const offsetTop = findOffsetRelativeToScrollParent(element);
|
|
464
|
-
if (scrollParent && (scrollParent.scrollTop + fixedOffsetTop > offsetTop || ((_a = scrollParent == null ? void 0 : scrollParent.clientHeight) != null ? _a : Infinity) - fixedOffsetTop < element.getBoundingClientRect().height)) {
|
|
465
|
-
scrollParent.scrollTop = offsetTop - fixedOffsetTop;
|
|
466
|
-
} else if (scrollParent && scrollParent.scrollTop + scrollParent.clientHeight < offsetTop + element.getBoundingClientRect().height) {
|
|
467
|
-
scrollParent.scrollTop = offsetTop;
|
|
468
|
-
}
|
|
469
|
-
if (tries > 0)
|
|
470
|
-
scrollIntervals[scrollId != null ? scrollId : "noId"] = setTimeout(
|
|
471
|
-
() => scrollParentIntoElement(element, fixedOffsetTop, tries - 1, timeout),
|
|
472
|
-
timeout
|
|
473
|
-
);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
function usePanAndZoom(effectiveMargin = { left: 0, bottom: 0, right: 0, top: 0 }, blockZoom = true) {
|
|
477
|
-
const boxRef = useRef(null);
|
|
478
|
-
const elementRef = useRef(null);
|
|
479
|
-
const [isPanning, setIsPanning] = React__default.useState(false);
|
|
480
|
-
const [panningPosition, setPanningPosition] = React__default.useState({ x: 0, y: 0 });
|
|
481
|
-
React__default.useEffect(() => {
|
|
482
|
-
if (blockZoom)
|
|
483
|
-
return;
|
|
484
|
-
const container = boxRef.current;
|
|
485
|
-
const innerElement = elementRef.current;
|
|
486
|
-
const handlePanStart = (ev) => {
|
|
487
|
-
ev.preventDefault();
|
|
488
|
-
setIsPanning(true);
|
|
489
|
-
setPanningPosition({ x: ev.clientX, y: ev.clientY });
|
|
490
|
-
};
|
|
491
|
-
const handlePanEnd = (ev) => {
|
|
492
|
-
ev.preventDefault();
|
|
493
|
-
setIsPanning(false);
|
|
494
|
-
};
|
|
495
|
-
const handlePan = (ev) => {
|
|
496
|
-
if (!innerElement || !container) {
|
|
497
|
-
return;
|
|
498
|
-
}
|
|
499
|
-
if (isPanning) {
|
|
500
|
-
ev.preventDefault();
|
|
501
|
-
ev.stopPropagation();
|
|
502
|
-
const dx = ev.clientX - panningPosition.x;
|
|
503
|
-
const dy = ev.clientY - panningPosition.y;
|
|
504
|
-
container.scrollLeft -= dx;
|
|
505
|
-
container.scrollTop -= dy;
|
|
506
|
-
setPanningPosition({ x: ev.clientX, y: ev.clientY });
|
|
507
|
-
}
|
|
508
|
-
};
|
|
509
|
-
if (container) {
|
|
510
|
-
container.addEventListener("mousedown", handlePanStart);
|
|
511
|
-
container.addEventListener("mouseup", handlePanEnd);
|
|
512
|
-
container.addEventListener("mouseleave", handlePanEnd);
|
|
513
|
-
container.addEventListener("mousemove", handlePan);
|
|
514
|
-
return () => {
|
|
515
|
-
container.removeEventListener("mousedown", handlePanStart);
|
|
516
|
-
container.removeEventListener("mousemove", handlePan);
|
|
517
|
-
container.removeEventListener("mouseup", handlePanEnd);
|
|
518
|
-
container.removeEventListener("mouseleave", handlePanEnd);
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
}, [isPanning, panningPosition]);
|
|
522
|
-
React__default.useEffect(() => {
|
|
523
|
-
if (blockZoom)
|
|
524
|
-
return;
|
|
525
|
-
const container = boxRef.current;
|
|
526
|
-
const innerElement = elementRef.current;
|
|
527
|
-
let newScale = 1;
|
|
528
|
-
const handleZoom = (ev) => {
|
|
529
|
-
ev.preventDefault();
|
|
530
|
-
const newDelta = ev.deltaY;
|
|
531
|
-
const scaleIncrement = 0.1;
|
|
532
|
-
if (newDelta < 0) {
|
|
533
|
-
if (newScale + scaleIncrement >= 2) {
|
|
534
|
-
return;
|
|
535
|
-
}
|
|
536
|
-
newScale += scaleIncrement;
|
|
537
|
-
} else {
|
|
538
|
-
if (newScale - scaleIncrement <= 0.9) {
|
|
539
|
-
return;
|
|
540
|
-
}
|
|
541
|
-
newScale -= scaleIncrement;
|
|
542
|
-
}
|
|
543
|
-
if (!innerElement || !container) {
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
|
-
const containerRect = container.getBoundingClientRect();
|
|
547
|
-
const cursorX = ev.clientX - containerRect.left - effectiveMargin.left;
|
|
548
|
-
const cursorY = ev.clientY - containerRect.top - effectiveMargin.top;
|
|
549
|
-
const cursorXFromCenter = cursorX - containerRect.width / 2;
|
|
550
|
-
const cursorYFromCenter = cursorY - containerRect.height / 2;
|
|
551
|
-
if (newScale <= 1) {
|
|
552
|
-
if (boxRef.current) {
|
|
553
|
-
boxRef.current.style.overflow = "hidden";
|
|
554
|
-
}
|
|
555
|
-
} else {
|
|
556
|
-
if (boxRef.current) {
|
|
557
|
-
boxRef.current.style.overflow = "hidden";
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
innerElement.style.transform = `scale(${newScale})`;
|
|
561
|
-
innerElement.style.transformOrigin = "0px 0px";
|
|
562
|
-
if (newDelta < 0) {
|
|
563
|
-
container.scrollLeft += cursorXFromCenter / (newScale * 2);
|
|
564
|
-
container.scrollTop += cursorYFromCenter / (newScale * 2);
|
|
565
|
-
} else {
|
|
566
|
-
container.scrollLeft -= cursorXFromCenter / (newScale * 2);
|
|
567
|
-
container.scrollTop -= cursorYFromCenter / (newScale * 2);
|
|
568
|
-
}
|
|
569
|
-
};
|
|
570
|
-
if (container) {
|
|
571
|
-
container.addEventListener("wheel", handleZoom);
|
|
572
|
-
return () => {
|
|
573
|
-
container.removeEventListener("wheel", handleZoom);
|
|
574
|
-
};
|
|
575
|
-
}
|
|
576
|
-
}, []);
|
|
577
|
-
return {
|
|
578
|
-
boxRef,
|
|
579
|
-
elementRef
|
|
580
|
-
};
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
const customEvents = {
|
|
584
|
-
/**
|
|
585
|
-
* Indica que un elemento necesita recibir el foco,
|
|
586
|
-
* de esta forma, elementos que no se están mostrando
|
|
587
|
-
* en pantalla (por display:none por ejemplo), pueden
|
|
588
|
-
* indicar a sus ancestros que deben expandirse.
|
|
589
|
-
*/
|
|
590
|
-
focus: "customFocus",
|
|
591
|
-
/**
|
|
592
|
-
* Indica que debe cambiarse el título del modal
|
|
593
|
-
*/
|
|
594
|
-
iframeModalChangeTitle: "iframeModalChangeTitle",
|
|
595
|
-
/**
|
|
596
|
-
* Indica que un iframe modal debe cerrarse
|
|
597
|
-
*/
|
|
598
|
-
iframeModalClose: "iframeModalClose",
|
|
599
|
-
/**
|
|
600
|
-
* Indica que un iframe modal debe cerrarse
|
|
601
|
-
*/
|
|
602
|
-
iframeModalNotify: "iframeModalNotify",
|
|
603
|
-
/**
|
|
604
|
-
* Indica que un modal debe cerrarse
|
|
605
|
-
*/
|
|
606
|
-
modalClose: "modalClose",
|
|
607
|
-
/**
|
|
608
|
-
* Indica que el panel contenedor debe cerrarse porque
|
|
609
|
-
* está vacío
|
|
610
|
-
*/
|
|
611
|
-
hidePanel: "hidePanel",
|
|
612
|
-
showPanel: "showPanel"
|
|
613
|
-
};
|
|
614
|
-
|
|
615
|
-
const cantFocusSelector = [
|
|
616
|
-
"[disabled]",
|
|
617
|
-
'[tabIndex="-1"]',
|
|
618
|
-
'[aria-hidden="true"]',
|
|
619
|
-
"[readonly]",
|
|
620
|
-
"[data-focus-guard]",
|
|
621
|
-
".modal__closeButton"
|
|
622
|
-
].map((current) => `:not(${current})`).join("");
|
|
623
|
-
const focusSelector = [
|
|
624
|
-
"input",
|
|
625
|
-
"textarea",
|
|
626
|
-
"select",
|
|
627
|
-
"a",
|
|
628
|
-
"button:not(.toggleAccordionElement)",
|
|
629
|
-
"[contenteditable]",
|
|
630
|
-
"[tabIndex]",
|
|
631
|
-
'[role="button"]'
|
|
632
|
-
].map((current) => `${current}${cantFocusSelector}`).join(",");
|
|
633
|
-
function getFocusSelector(not) {
|
|
634
|
-
return `input${not != null ? not : ""},
|
|
635
|
-
textarea${not != null ? not : ""},
|
|
636
|
-
select${not != null ? not : ""},
|
|
637
|
-
a${not != null ? not : ""},
|
|
638
|
-
button:not(.toggleAccordionElement)${not != null ? not : ""},
|
|
639
|
-
[contenteditable]${not != null ? not : ""},
|
|
640
|
-
[tabIndex]${not != null ? not : ""}`;
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
function getSpecificParent(element, checkParent) {
|
|
644
|
-
let currentElement = element;
|
|
645
|
-
while (element !== document.documentElement && currentElement) {
|
|
646
|
-
const hasFoundTheParent = checkParent(currentElement);
|
|
647
|
-
if (hasFoundTheParent === null)
|
|
648
|
-
return null;
|
|
649
|
-
if (hasFoundTheParent)
|
|
650
|
-
return currentElement;
|
|
651
|
-
const parent = currentElement.parentElement;
|
|
652
|
-
if (parent)
|
|
653
|
-
currentElement = parent;
|
|
654
|
-
else
|
|
655
|
-
return null;
|
|
656
|
-
}
|
|
657
|
-
return null;
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
function isChild(element, checkParent) {
|
|
661
|
-
return !!getSpecificParent(element, checkParent);
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
var __accessCheck$7 = (obj, member, msg) => {
|
|
665
|
-
if (!member.has(obj))
|
|
666
|
-
throw TypeError("Cannot " + msg);
|
|
667
|
-
};
|
|
668
|
-
var __privateGet$7 = (obj, member, getter) => {
|
|
669
|
-
__accessCheck$7(obj, member, "read from private field");
|
|
670
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
671
|
-
};
|
|
672
|
-
var __privateAdd$7 = (obj, member, value) => {
|
|
673
|
-
if (member.has(obj))
|
|
674
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
675
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
676
|
-
};
|
|
677
|
-
var _parameters;
|
|
678
|
-
class Url {
|
|
679
|
-
constructor(baseUrl, defaultAllowMultiple = true) {
|
|
680
|
-
this.defaultAllowMultiple = defaultAllowMultiple;
|
|
681
|
-
__privateAdd$7(this, _parameters, {});
|
|
682
|
-
const [base, query] = baseUrl.split("?");
|
|
683
|
-
this.base = base;
|
|
684
|
-
query == null ? void 0 : query.split("&").forEach((current) => {
|
|
685
|
-
const [name, ...value] = current.split("=");
|
|
686
|
-
this.addParameter(name, value.join("="));
|
|
687
|
-
});
|
|
688
|
-
}
|
|
689
|
-
addParameter(name, value, allowMultiple) {
|
|
690
|
-
if (allowMultiple === void 0 && !this.defaultAllowMultiple || allowMultiple === false)
|
|
691
|
-
__privateGet$7(this, _parameters)[name] = String(value);
|
|
692
|
-
else
|
|
693
|
-
__privateGet$7(this, _parameters)[name] = __privateGet$7(this, _parameters)[name] ? [...arrayOrArray(__privateGet$7(this, _parameters)[name]), String(value)] : [String(value)];
|
|
694
|
-
}
|
|
695
|
-
addParameters(parameters) {
|
|
696
|
-
parameters.forEach(
|
|
697
|
-
(current) => this.addParameter(current.name, current.value, current.allowMultiple)
|
|
698
|
-
);
|
|
699
|
-
}
|
|
700
|
-
getParameter(name) {
|
|
701
|
-
return __privateGet$7(this, _parameters)[name];
|
|
702
|
-
}
|
|
703
|
-
toString() {
|
|
704
|
-
const parametersArray = Object.entries(__privateGet$7(this, _parameters));
|
|
705
|
-
return `${this.base}${parametersArray.length > 0 ? `?${parametersArray.map(
|
|
706
|
-
([name, value]) => Array.isArray(value) ? value.map((current) => `${name}=${current}`).join("&") : `${name}=${String(value)}`
|
|
707
|
-
).join("&")}` : ""}`;
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
_parameters = new WeakMap();
|
|
711
|
-
|
|
712
|
-
const previousTabIndexLabel = "data-previous-tabindex";
|
|
713
|
-
function disableChildrenFocus(parent) {
|
|
714
|
-
const focusElement = parent.querySelectorAll(focusSelector);
|
|
715
|
-
focusElement.forEach((element) => {
|
|
716
|
-
var _a;
|
|
717
|
-
element.setAttribute(
|
|
718
|
-
previousTabIndexLabel,
|
|
719
|
-
(_a = element.getAttribute("tabindex")) != null ? _a : ""
|
|
720
|
-
);
|
|
721
|
-
element.setAttribute("tabindex", "-1");
|
|
722
|
-
});
|
|
723
|
-
}
|
|
724
|
-
function enableChildrenFocus(parent) {
|
|
725
|
-
const focusElement = parent.querySelectorAll(`[${previousTabIndexLabel}]`);
|
|
726
|
-
focusElement.forEach((element) => {
|
|
727
|
-
var _a;
|
|
728
|
-
element.setAttribute(
|
|
729
|
-
"tabindex",
|
|
730
|
-
(_a = element.getAttribute(previousTabIndexLabel)) != null ? _a : "0"
|
|
731
|
-
);
|
|
732
|
-
element.removeAttribute(previousTabIndexLabel);
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
var __accessCheck$6 = (obj, member, msg) => {
|
|
737
|
-
if (!member.has(obj))
|
|
738
|
-
throw TypeError("Cannot " + msg);
|
|
739
|
-
};
|
|
740
|
-
var __privateGet$6 = (obj, member, getter) => {
|
|
741
|
-
__accessCheck$6(obj, member, "read from private field");
|
|
742
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
743
|
-
};
|
|
744
|
-
var __privateAdd$6 = (obj, member, value) => {
|
|
745
|
-
if (member.has(obj))
|
|
746
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
747
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
748
|
-
};
|
|
749
|
-
var _emitter$1;
|
|
750
|
-
function eventEmitterBaseFunction() {
|
|
751
|
-
const listeners = {};
|
|
752
|
-
return {
|
|
753
|
-
on(key, fn) {
|
|
754
|
-
var _a;
|
|
755
|
-
if (!Array.isArray(listeners[key]))
|
|
756
|
-
listeners[key] = [];
|
|
757
|
-
(_a = listeners[key]) == null ? void 0 : _a.push(fn);
|
|
758
|
-
return () => {
|
|
759
|
-
this.off(key, fn);
|
|
760
|
-
};
|
|
761
|
-
},
|
|
762
|
-
off(key, fn) {
|
|
763
|
-
var _a;
|
|
764
|
-
listeners[key] = ((_a = listeners[key]) != null ? _a : []).filter((cb) => {
|
|
765
|
-
return cb !== fn;
|
|
766
|
-
});
|
|
767
|
-
},
|
|
768
|
-
emit(key, data) {
|
|
769
|
-
var _a;
|
|
770
|
-
((_a = listeners[key]) != null ? _a : []).forEach((fn) => {
|
|
771
|
-
return fn(data);
|
|
772
|
-
});
|
|
773
|
-
}
|
|
774
|
-
};
|
|
775
|
-
}
|
|
776
|
-
class EventEmitter {
|
|
777
|
-
constructor() {
|
|
778
|
-
__privateAdd$6(this, _emitter$1, eventEmitterBaseFunction());
|
|
779
|
-
}
|
|
780
|
-
on(eventName, fn) {
|
|
781
|
-
__privateGet$6(this, _emitter$1).on(eventName, fn);
|
|
782
|
-
return () => {
|
|
783
|
-
__privateGet$6(this, _emitter$1).off(eventName, fn);
|
|
784
|
-
};
|
|
785
|
-
}
|
|
786
|
-
off(eventName, fn) {
|
|
787
|
-
__privateGet$6(this, _emitter$1).off(eventName, fn);
|
|
788
|
-
}
|
|
789
|
-
emit(eventName, params) {
|
|
790
|
-
__privateGet$6(this, _emitter$1).emit(eventName, params);
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
_emitter$1 = new WeakMap();
|
|
794
|
-
|
|
795
|
-
var __accessCheck$5 = (obj, member, msg) => {
|
|
796
|
-
if (!member.has(obj))
|
|
797
|
-
throw TypeError("Cannot " + msg);
|
|
798
|
-
};
|
|
799
|
-
var __privateGet$5 = (obj, member, getter) => {
|
|
800
|
-
__accessCheck$5(obj, member, "read from private field");
|
|
801
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
802
|
-
};
|
|
803
|
-
var __privateAdd$5 = (obj, member, value) => {
|
|
804
|
-
if (member.has(obj))
|
|
805
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
806
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
807
|
-
};
|
|
808
|
-
var __privateMethod$2 = (obj, member, method) => {
|
|
809
|
-
__accessCheck$5(obj, member, "access private method");
|
|
810
|
-
return method;
|
|
811
|
-
};
|
|
812
|
-
var _emitter, _getEventName, getEventName_fn;
|
|
813
|
-
function eventEmitter() {
|
|
814
|
-
const listeners = {};
|
|
815
|
-
return {
|
|
816
|
-
on(key, fn) {
|
|
817
|
-
var _a;
|
|
818
|
-
if (!Array.isArray(listeners[key]))
|
|
819
|
-
listeners[key] = [];
|
|
820
|
-
(_a = listeners[key]) == null ? void 0 : _a.push(fn);
|
|
821
|
-
return () => {
|
|
822
|
-
this.off(key, fn);
|
|
823
|
-
};
|
|
824
|
-
},
|
|
825
|
-
off(key, fn) {
|
|
826
|
-
var _a;
|
|
827
|
-
listeners[key] = ((_a = listeners[key]) != null ? _a : []).filter((cb) => {
|
|
828
|
-
return cb !== fn;
|
|
829
|
-
});
|
|
830
|
-
},
|
|
831
|
-
emit(key, data) {
|
|
832
|
-
var _a;
|
|
833
|
-
((_a = listeners[key]) != null ? _a : []).forEach((fn) => {
|
|
834
|
-
return fn(data);
|
|
835
|
-
});
|
|
836
|
-
}
|
|
837
|
-
};
|
|
838
|
-
}
|
|
839
|
-
class HashedEventEmitter {
|
|
840
|
-
constructor(hashMethod) {
|
|
841
|
-
this.hashMethod = hashMethod;
|
|
842
|
-
__privateAdd$5(this, _getEventName);
|
|
843
|
-
__privateAdd$5(this, _emitter, eventEmitter());
|
|
844
|
-
}
|
|
845
|
-
on(hash, eventName, fn) {
|
|
846
|
-
const actualEventName = __privateMethod$2(this, _getEventName, getEventName_fn).call(this, hash, eventName);
|
|
847
|
-
__privateGet$5(this, _emitter).on(actualEventName, fn);
|
|
848
|
-
return () => {
|
|
849
|
-
__privateGet$5(this, _emitter).off(actualEventName, fn);
|
|
850
|
-
};
|
|
851
|
-
}
|
|
852
|
-
off(hash, eventName, fn) {
|
|
853
|
-
const actualEventName = __privateMethod$2(this, _getEventName, getEventName_fn).call(this, hash, eventName);
|
|
854
|
-
__privateGet$5(this, _emitter).off(actualEventName, fn);
|
|
855
|
-
}
|
|
856
|
-
emit(hash, eventName, params) {
|
|
857
|
-
const actualEventName = __privateMethod$2(this, _getEventName, getEventName_fn).call(this, hash, eventName);
|
|
858
|
-
__privateGet$5(this, _emitter).emit(actualEventName, params);
|
|
859
|
-
__privateGet$5(this, _emitter).emit(eventName, params);
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
_emitter = new WeakMap();
|
|
863
|
-
_getEventName = new WeakSet();
|
|
864
|
-
getEventName_fn = function(hash, eventName) {
|
|
865
|
-
return hash === "*" ? eventName : `${this.hashMethod(hash)}_${eventName}`;
|
|
866
|
-
};
|
|
867
|
-
|
|
868
|
-
var __accessCheck$4 = (obj, member, msg) => {
|
|
869
|
-
if (!member.has(obj))
|
|
870
|
-
throw TypeError("Cannot " + msg);
|
|
871
|
-
};
|
|
872
|
-
var __privateGet$4 = (obj, member, getter) => {
|
|
873
|
-
__accessCheck$4(obj, member, "read from private field");
|
|
874
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
875
|
-
};
|
|
876
|
-
var __privateAdd$4 = (obj, member, value) => {
|
|
877
|
-
if (member.has(obj))
|
|
878
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
879
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
880
|
-
};
|
|
881
|
-
var __privateSet$4 = (obj, member, value, setter) => {
|
|
882
|
-
__accessCheck$4(obj, member, "write to private field");
|
|
883
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
884
|
-
return value;
|
|
885
|
-
};
|
|
886
|
-
var _value;
|
|
887
|
-
class WithEventsValue extends EventEmitter {
|
|
888
|
-
constructor(value) {
|
|
889
|
-
super();
|
|
890
|
-
__privateAdd$4(this, _value, void 0);
|
|
891
|
-
__privateSet$4(this, _value, value);
|
|
892
|
-
}
|
|
893
|
-
get value() {
|
|
894
|
-
return __privateGet$4(this, _value);
|
|
895
|
-
}
|
|
896
|
-
set value(value) {
|
|
897
|
-
__privateSet$4(this, _value, value);
|
|
898
|
-
this.emit("update", value);
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
_value = new WeakMap();
|
|
902
|
-
|
|
903
|
-
var __accessCheck$3 = (obj, member, msg) => {
|
|
904
|
-
if (!member.has(obj))
|
|
905
|
-
throw TypeError("Cannot " + msg);
|
|
906
|
-
};
|
|
907
|
-
var __privateGet$3 = (obj, member, getter) => {
|
|
908
|
-
__accessCheck$3(obj, member, "read from private field");
|
|
909
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
910
|
-
};
|
|
911
|
-
var __privateAdd$3 = (obj, member, value) => {
|
|
912
|
-
if (member.has(obj))
|
|
913
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
914
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
915
|
-
};
|
|
916
|
-
var __privateSet$3 = (obj, member, value, setter) => {
|
|
917
|
-
__accessCheck$3(obj, member, "write to private field");
|
|
918
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
919
|
-
return value;
|
|
920
|
-
};
|
|
921
|
-
var _onFocusCallbacks, _a$2;
|
|
922
|
-
const historySize = 50;
|
|
923
|
-
const globalFocus = new (_a$2 = class {
|
|
924
|
-
constructor() {
|
|
925
|
-
this.focused = [];
|
|
926
|
-
__privateAdd$3(this, _onFocusCallbacks, []);
|
|
927
|
-
debugDispatcher.on(
|
|
928
|
-
"focusHistory",
|
|
929
|
-
() => {
|
|
930
|
-
console.info(this.focused);
|
|
931
|
-
},
|
|
932
|
-
"Muestra el historial de elementos que recibieron foco."
|
|
933
|
-
);
|
|
934
|
-
}
|
|
935
|
-
offFocus(cb) {
|
|
936
|
-
__privateSet$3(this, _onFocusCallbacks, __privateGet$3(this, _onFocusCallbacks).filter(
|
|
937
|
-
(current) => current !== cb
|
|
938
|
-
));
|
|
939
|
-
}
|
|
940
|
-
onFocus(cb) {
|
|
941
|
-
__privateGet$3(this, _onFocusCallbacks).push(cb);
|
|
942
|
-
return () => {
|
|
943
|
-
this.offFocus(cb);
|
|
944
|
-
};
|
|
945
|
-
}
|
|
946
|
-
inDocument(el) {
|
|
947
|
-
return el instanceof Function || el instanceof HTMLElement && el.offsetParent !== null;
|
|
948
|
-
}
|
|
949
|
-
set focus(element) {
|
|
950
|
-
this.focused = this.focused.filter((el) => {
|
|
951
|
-
const existsInDocument = this.inDocument(el) && element !== el;
|
|
952
|
-
return existsInDocument;
|
|
953
|
-
});
|
|
954
|
-
this.focused.unshift(element);
|
|
955
|
-
if (this.focused.length > historySize) {
|
|
956
|
-
this.focused = this.focused.splice(0, historySize);
|
|
957
|
-
}
|
|
958
|
-
__privateGet$3(this, _onFocusCallbacks).forEach((cb) => cb());
|
|
959
|
-
}
|
|
960
|
-
get list() {
|
|
961
|
-
return [...this.focused];
|
|
962
|
-
}
|
|
963
|
-
/**
|
|
964
|
-
* @param querySelector A query selector against which the element should match
|
|
965
|
-
* @returns The last HTMLElement if no querySelector argument provided or else, the last which matches
|
|
966
|
-
* against that query selector.
|
|
967
|
-
* */
|
|
968
|
-
last(querySelector, omit = 0) {
|
|
969
|
-
if (querySelector)
|
|
970
|
-
for (let i = omit; i <= this.focused.length; i++) {
|
|
971
|
-
const storedElement = this.focused[i];
|
|
972
|
-
const element = (
|
|
973
|
-
// eslint-disable-next-line no-nested-ternary
|
|
974
|
-
(storedElement == null ? void 0 : storedElement.id) !== void 0 ? storedElement : isFunction$1(storedElement) ? storedElement(false) : null
|
|
975
|
-
);
|
|
976
|
-
if (element && this.inDocument(element) && element.matches && element.matches(querySelector))
|
|
977
|
-
return element;
|
|
978
|
-
}
|
|
979
|
-
else
|
|
980
|
-
return this.focused[this.focused.length - 1];
|
|
981
|
-
return null;
|
|
982
|
-
}
|
|
983
|
-
}, _onFocusCallbacks = new WeakMap(), _a$2)();
|
|
984
|
-
|
|
985
|
-
var __accessCheck$2 = (obj, member, msg) => {
|
|
986
|
-
if (!member.has(obj))
|
|
987
|
-
throw TypeError("Cannot " + msg);
|
|
988
|
-
};
|
|
989
|
-
var __privateGet$2 = (obj, member, getter) => {
|
|
990
|
-
__accessCheck$2(obj, member, "read from private field");
|
|
991
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
992
|
-
};
|
|
993
|
-
var __privateAdd$2 = (obj, member, value) => {
|
|
994
|
-
if (member.has(obj))
|
|
995
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
996
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
997
|
-
};
|
|
998
|
-
var __privateSet$2 = (obj, member, value, setter) => {
|
|
999
|
-
__accessCheck$2(obj, member, "write to private field");
|
|
1000
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
1001
|
-
return value;
|
|
1002
|
-
};
|
|
1003
|
-
var __privateMethod$1 = (obj, member, method) => {
|
|
1004
|
-
__accessCheck$2(obj, member, "access private method");
|
|
1005
|
-
return method;
|
|
1006
|
-
};
|
|
1007
|
-
var _hasReleasedFirstTime, _wasReleasedFirstTime, _isForced, _locks, _shoutLockState, shoutLockState_fn, _a$1;
|
|
1008
|
-
const screenLocker = new (_a$1 = class extends EventEmitter {
|
|
1009
|
-
constructor() {
|
|
1010
|
-
super();
|
|
1011
|
-
__privateAdd$2(this, _shoutLockState);
|
|
1012
|
-
__privateAdd$2(this, _hasReleasedFirstTime, false);
|
|
1013
|
-
__privateAdd$2(this, _wasReleasedFirstTime, false);
|
|
1014
|
-
__privateAdd$2(this, _isForced, false);
|
|
1015
|
-
__privateAdd$2(this, _locks, {
|
|
1016
|
-
common: false
|
|
1017
|
-
});
|
|
1018
|
-
this.emit("ready");
|
|
1019
|
-
}
|
|
1020
|
-
get hasReleasedFirstTime() {
|
|
1021
|
-
return __privateGet$2(this, _hasReleasedFirstTime);
|
|
1022
|
-
}
|
|
1023
|
-
get isForced() {
|
|
1024
|
-
return __privateGet$2(this, _isForced);
|
|
1025
|
-
}
|
|
1026
|
-
/**
|
|
1027
|
-
* Permite saber si un bloqueo determinado está activo o si la clase tiene
|
|
1028
|
-
* forceLock activo.
|
|
1029
|
-
*/
|
|
1030
|
-
isLocked(lockName = "common") {
|
|
1031
|
-
return __privateGet$2(this, _locks)[lockName] || __privateGet$2(this, _isForced);
|
|
1032
|
-
}
|
|
1033
|
-
lock(lockName = "common") {
|
|
1034
|
-
__privateGet$2(this, _locks)[lockName] = true;
|
|
1035
|
-
__privateMethod$1(this, _shoutLockState, shoutLockState_fn).call(this, lockName);
|
|
1036
|
-
}
|
|
1037
|
-
unlock(lockName = "common") {
|
|
1038
|
-
if (lockName === "common")
|
|
1039
|
-
__privateSet$2(this, _hasReleasedFirstTime, true);
|
|
1040
|
-
__privateGet$2(this, _locks)[lockName] = false;
|
|
1041
|
-
__privateMethod$1(this, _shoutLockState, shoutLockState_fn).call(this, lockName);
|
|
1042
|
-
}
|
|
1043
|
-
force() {
|
|
1044
|
-
__privateSet$2(this, _isForced, true);
|
|
1045
|
-
__privateMethod$1(this, _shoutLockState, shoutLockState_fn).call(this);
|
|
1046
|
-
}
|
|
1047
|
-
releaseForced() {
|
|
1048
|
-
__privateSet$2(this, _isForced, false);
|
|
1049
|
-
__privateMethod$1(this, _shoutLockState, shoutLockState_fn).call(this);
|
|
1050
|
-
}
|
|
1051
|
-
}, _hasReleasedFirstTime = new WeakMap(), _wasReleasedFirstTime = new WeakMap(), _isForced = new WeakMap(), _locks = new WeakMap(), _shoutLockState = new WeakSet(), shoutLockState_fn = function(lockName) {
|
|
1052
|
-
if (__privateGet$2(this, _isForced) || lockName === void 0) {
|
|
1053
|
-
this.emit("forcedStateChange", {
|
|
1054
|
-
isForced: __privateGet$2(this, _isForced),
|
|
1055
|
-
hasReleasedFirstTime: __privateGet$2(this, _hasReleasedFirstTime)
|
|
1056
|
-
});
|
|
1057
|
-
} else {
|
|
1058
|
-
if (lockName === "common" && !__privateGet$2(this, _wasReleasedFirstTime) && __privateGet$2(this, _hasReleasedFirstTime)) {
|
|
1059
|
-
this.emit("releaseForFirstTime");
|
|
1060
|
-
}
|
|
1061
|
-
this.emit("lockStateChange", {
|
|
1062
|
-
lockName,
|
|
1063
|
-
hasReleasedFirstTime: __privateGet$2(this, _hasReleasedFirstTime),
|
|
1064
|
-
isLocked: __privateGet$2(this, _locks)[lockName]
|
|
1065
|
-
});
|
|
1066
|
-
}
|
|
1067
|
-
}, _a$1)();
|
|
1068
|
-
|
|
1069
|
-
function useCombinedRefs(...refs) {
|
|
1070
|
-
const [targetRef, setTargetRef] = React.useState();
|
|
1071
|
-
React.useEffect(() => {
|
|
1072
|
-
refs.forEach((ref) => {
|
|
1073
|
-
if (!ref)
|
|
1074
|
-
return;
|
|
1075
|
-
if (typeof ref === "function") {
|
|
1076
|
-
ref(targetRef);
|
|
1077
|
-
} else {
|
|
1078
|
-
ref.current = targetRef;
|
|
1079
|
-
}
|
|
1080
|
-
});
|
|
1081
|
-
}, [refs, targetRef]);
|
|
1082
|
-
return setTargetRef;
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
const useDebouncedCallback = (callback, { runWhenTriggered, timeout } = { runWhenTriggered: false, timeout: 200 }) => {
|
|
1086
|
-
const timeoutRef = useRef(-1);
|
|
1087
|
-
return useCallback(
|
|
1088
|
-
(...params) => {
|
|
1089
|
-
if (runWhenTriggered)
|
|
1090
|
-
callback(...params);
|
|
1091
|
-
clearTimeout(timeoutRef.current);
|
|
1092
|
-
timeoutRef.current = setTimeout(
|
|
1093
|
-
() => callback(...params),
|
|
1094
|
-
timeout
|
|
1095
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1096
|
-
);
|
|
1097
|
-
},
|
|
1098
|
-
[callback, runWhenTriggered, timeout]
|
|
1099
|
-
);
|
|
1100
|
-
};
|
|
1101
|
-
|
|
1102
|
-
function useLatest(value) {
|
|
1103
|
-
const ref = useRef(value);
|
|
1104
|
-
ref.current = value;
|
|
1105
|
-
return ref;
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
function useMount(effect) {
|
|
1109
|
-
const hasRun = useRef(false);
|
|
1110
|
-
useEffect(() => {
|
|
1111
|
-
if (!hasRun.current) {
|
|
1112
|
-
hasRun.current = true;
|
|
1113
|
-
return effect();
|
|
1114
|
-
}
|
|
1115
|
-
}, []);
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
function useUnmount(unmountCallback) {
|
|
1119
|
-
useEffect(() => {
|
|
1120
|
-
return unmountCallback;
|
|
1121
|
-
}, []);
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
|
-
function usePrevious(value) {
|
|
1125
|
-
const previousValue = useRef(void 0);
|
|
1126
|
-
const currentValue = useRef(void 0);
|
|
1127
|
-
previousValue.current = currentValue.current;
|
|
1128
|
-
currentValue.current = value;
|
|
1129
|
-
return previousValue;
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
function useStateRef(initialState) {
|
|
1133
|
-
const [state, setState] = useState(initialState);
|
|
1134
|
-
const stateRef = useRef(state);
|
|
1135
|
-
stateRef.current = state;
|
|
1136
|
-
return [state, setState, stateRef];
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
function useUpdateEffect(effect, deps) {
|
|
1140
|
-
const hasRunnedForFirstTime = useRef(false);
|
|
1141
|
-
useEffect(() => {
|
|
1142
|
-
if (hasRunnedForFirstTime.current) {
|
|
1143
|
-
return effect();
|
|
1144
|
-
}
|
|
1145
|
-
hasRunnedForFirstTime.current = true;
|
|
1146
|
-
return () => {
|
|
1147
|
-
};
|
|
1148
|
-
}, deps);
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
function shallowEqual(a, b) {
|
|
1152
|
-
if (typeof a !== typeof b)
|
|
1153
|
-
return false;
|
|
1154
|
-
if (typeof a === "object" && a && typeof b === "object" && b) {
|
|
1155
|
-
const aKeys = Object.keys(a);
|
|
1156
|
-
const bKeys = Object.keys(b);
|
|
1157
|
-
if (aKeys.length !== bKeys.length)
|
|
1158
|
-
return false;
|
|
1159
|
-
for (let i = 0; i < aKeys.length; i++) {
|
|
1160
|
-
if (a[aKeys[i]] !== b[bKeys[i]])
|
|
1161
|
-
return false;
|
|
1162
|
-
}
|
|
1163
|
-
} else {
|
|
1164
|
-
if (a !== b)
|
|
1165
|
-
return false;
|
|
1166
|
-
}
|
|
1167
|
-
return true;
|
|
1168
|
-
}
|
|
1169
|
-
function shallowCompareArrays(a, b) {
|
|
1170
|
-
if (a.length !== b.length)
|
|
1171
|
-
return false;
|
|
1172
|
-
for (let i = 0; i < a.length; i++) {
|
|
1173
|
-
const differ = shallowEqual(a, b);
|
|
1174
|
-
if (!differ)
|
|
1175
|
-
return false;
|
|
1176
|
-
}
|
|
1177
|
-
return true;
|
|
1178
|
-
}
|
|
1179
|
-
function useShallowMemo(creator, deps) {
|
|
1180
|
-
var _a;
|
|
1181
|
-
const value = useRef(creator());
|
|
1182
|
-
const previousDeps = usePrevious(deps);
|
|
1183
|
-
if (!shallowEqual((_a = previousDeps.current) != null ? _a : [], deps)) {
|
|
1184
|
-
value.current = creator();
|
|
1185
|
-
}
|
|
1186
|
-
return value.current;
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
var __defProp$6 = Object.defineProperty;
|
|
1190
|
-
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
1191
|
-
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
1192
|
-
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
1193
|
-
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1194
|
-
var __spreadValues$6 = (a, b) => {
|
|
1195
|
-
for (var prop in b || (b = {}))
|
|
1196
|
-
if (__hasOwnProp$6.call(b, prop))
|
|
1197
|
-
__defNormalProp$6(a, prop, b[prop]);
|
|
1198
|
-
if (__getOwnPropSymbols$6)
|
|
1199
|
-
for (var prop of __getOwnPropSymbols$6(b)) {
|
|
1200
|
-
if (__propIsEnum$6.call(b, prop))
|
|
1201
|
-
__defNormalProp$6(a, prop, b[prop]);
|
|
1202
|
-
}
|
|
1203
|
-
return a;
|
|
1204
|
-
};
|
|
1205
|
-
var __accessCheck$1 = (obj, member, msg) => {
|
|
1206
|
-
if (!member.has(obj))
|
|
1207
|
-
throw TypeError("Cannot " + msg);
|
|
1208
|
-
};
|
|
1209
|
-
var __privateGet$1 = (obj, member, getter) => {
|
|
1210
|
-
__accessCheck$1(obj, member, "read from private field");
|
|
1211
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
1212
|
-
};
|
|
1213
|
-
var __privateAdd$1 = (obj, member, value) => {
|
|
1214
|
-
if (member.has(obj))
|
|
1215
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
1216
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1217
|
-
};
|
|
1218
|
-
var __privateSet$1 = (obj, member, value, setter) => {
|
|
1219
|
-
__accessCheck$1(obj, member, "write to private field");
|
|
1220
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
1221
|
-
return value;
|
|
1222
|
-
};
|
|
1223
|
-
var _onUpdateCbs;
|
|
1224
|
-
function upper(s) {
|
|
1225
|
-
return `${s.charAt(0).toUpperCase()}${s.slice(1)}`;
|
|
1226
|
-
}
|
|
1227
|
-
function isUpdater(props) {
|
|
1228
|
-
return typeof props === "function";
|
|
1229
|
-
}
|
|
1230
|
-
class BasicStoredElement {
|
|
1231
|
-
constructor(props) {
|
|
1232
|
-
__privateAdd$1(this, _onUpdateCbs, []);
|
|
1233
|
-
this.props = {};
|
|
1234
|
-
this.shoutUpdates = () => {
|
|
1235
|
-
__privateGet$1(this, _onUpdateCbs).forEach((current) => current());
|
|
1236
|
-
};
|
|
1237
|
-
this.useProps = () => {
|
|
1238
|
-
const [props, setState] = useState(this.props);
|
|
1239
|
-
useMount(() => {
|
|
1240
|
-
setState(__spreadValues$6({}, this.props));
|
|
1241
|
-
return this.onUpdate(() => {
|
|
1242
|
-
setState(__spreadValues$6({}, this.props));
|
|
1243
|
-
});
|
|
1244
|
-
});
|
|
1245
|
-
return props;
|
|
1246
|
-
};
|
|
1247
|
-
this.props = props;
|
|
1248
|
-
}
|
|
1249
|
-
onUpdate(cb) {
|
|
1250
|
-
__privateGet$1(this, _onUpdateCbs).push(cb);
|
|
1251
|
-
return () => {
|
|
1252
|
-
__privateSet$1(this, _onUpdateCbs, __privateGet$1(this, _onUpdateCbs).filter((current) => current !== cb));
|
|
1253
|
-
};
|
|
1254
|
-
}
|
|
1255
|
-
update(newProps) {
|
|
1256
|
-
const actualNewProps = isUpdater(newProps) ? newProps(this.props) : newProps;
|
|
1257
|
-
this.props = __spreadValues$6(__spreadValues$6({}, this.props), actualNewProps);
|
|
1258
|
-
this.shoutUpdates();
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
|
-
_onUpdateCbs = new WeakMap();
|
|
1262
|
-
class People extends BasicStoredElement {
|
|
1263
|
-
getId() {
|
|
1264
|
-
return this.props.name;
|
|
1265
|
-
}
|
|
1266
|
-
}
|
|
1267
|
-
const r = makeStatefulStore({
|
|
1268
|
-
people: People.prototype
|
|
1269
|
-
});
|
|
1270
|
-
r.actions.addPeople;
|
|
1271
|
-
r.actions.emptyPeople;
|
|
1272
|
-
r.actions.removePeople;
|
|
1273
|
-
r.hooks.usePeople;
|
|
1274
|
-
r.hooks.usePeopleById;
|
|
1275
|
-
r.hooks.usePeopleList;
|
|
1276
|
-
r.on.changePeople;
|
|
1277
|
-
r.on.changePeopleAmmount;
|
|
1278
|
-
r.on.changePeopleElement;
|
|
1279
|
-
r.state.getPeople;
|
|
1280
|
-
r.state.getPeopleState;
|
|
1281
|
-
r.state.updatePeople;
|
|
1282
|
-
function makeStatefulStore(entries, initialStates) {
|
|
1283
|
-
const hookUseState = {};
|
|
1284
|
-
const hookUseList = {};
|
|
1285
|
-
const hookUseStateById = {};
|
|
1286
|
-
const suscribeById = {};
|
|
1287
|
-
const suscribeToList = {};
|
|
1288
|
-
const suscribeToListCount = {};
|
|
1289
|
-
const addActions = {};
|
|
1290
|
-
const emptyActions = {};
|
|
1291
|
-
const removeActions = {};
|
|
1292
|
-
const getItemActions = {};
|
|
1293
|
-
const getStateActions = {};
|
|
1294
|
-
const updateItemActions = {};
|
|
1295
|
-
Object.keys(entries).forEach((name) => {
|
|
1296
|
-
const initialStateKey = `${upper(name)}State`;
|
|
1297
|
-
let store = {};
|
|
1298
|
-
const initialState = initialStates == null ? void 0 : initialStates[initialStateKey];
|
|
1299
|
-
initialState == null ? void 0 : initialState.forEach((current) => {
|
|
1300
|
-
store[current.getId()] = current;
|
|
1301
|
-
});
|
|
1302
|
-
let listStateChangeHandlers = [];
|
|
1303
|
-
function shoutListStateChange() {
|
|
1304
|
-
listStateChangeHandlers.forEach((current) => current());
|
|
1305
|
-
}
|
|
1306
|
-
const elementChangeHandlers = {};
|
|
1307
|
-
function shoutListElementChange(id) {
|
|
1308
|
-
var _a;
|
|
1309
|
-
(_a = elementChangeHandlers[id]) == null ? void 0 : _a.forEach((current) => current());
|
|
1310
|
-
}
|
|
1311
|
-
let listCountChangeHandlers = [];
|
|
1312
|
-
function shoutListCountChange() {
|
|
1313
|
-
listCountChangeHandlers.forEach((current) => current());
|
|
1314
|
-
}
|
|
1315
|
-
const onUpdateElementSuscriptions = {};
|
|
1316
|
-
const addKey = `add${upper(name)}`;
|
|
1317
|
-
addActions[addKey] = (newElement) => {
|
|
1318
|
-
let elId = newElement.getId();
|
|
1319
|
-
let lastProps = __spreadValues$6({}, newElement.props);
|
|
1320
|
-
store[elId] = newElement;
|
|
1321
|
-
const suscription = newElement.onUpdate(() => {
|
|
1322
|
-
const id = newElement.getId();
|
|
1323
|
-
if (id !== elId) {
|
|
1324
|
-
if (store[id]) {
|
|
1325
|
-
newElement.update(lastProps);
|
|
1326
|
-
throw new Error(
|
|
1327
|
-
`Cannot set new id ${id} because it already exists`
|
|
1328
|
-
);
|
|
1329
|
-
}
|
|
1330
|
-
delete store[elId];
|
|
1331
|
-
store[id] = newElement;
|
|
1332
|
-
elId = id;
|
|
1333
|
-
lastProps = newElement.props;
|
|
1334
|
-
}
|
|
1335
|
-
shoutListElementChange(id);
|
|
1336
|
-
shoutListStateChange();
|
|
1337
|
-
});
|
|
1338
|
-
onUpdateElementSuscriptions[newElement.getId()] = suscription;
|
|
1339
|
-
shoutListStateChange();
|
|
1340
|
-
shoutListCountChange();
|
|
1341
|
-
shoutListElementChange(elId);
|
|
1342
|
-
};
|
|
1343
|
-
const emptyKey = `empty${upper(name)}`;
|
|
1344
|
-
emptyActions[emptyKey] = () => {
|
|
1345
|
-
Object.values(onUpdateElementSuscriptions).forEach(
|
|
1346
|
-
(current) => current()
|
|
1347
|
-
);
|
|
1348
|
-
store = {};
|
|
1349
|
-
shoutListCountChange();
|
|
1350
|
-
shoutListStateChange();
|
|
1351
|
-
Object.keys(elementChangeHandlers).forEach(
|
|
1352
|
-
(current) => shoutListElementChange(current)
|
|
1353
|
-
);
|
|
1354
|
-
};
|
|
1355
|
-
const removeKey = `remove${upper(name)}`;
|
|
1356
|
-
removeActions[removeKey] = (id) => {
|
|
1357
|
-
var _a;
|
|
1358
|
-
(_a = onUpdateElementSuscriptions[id]) == null ? void 0 : _a.call(onUpdateElementSuscriptions);
|
|
1359
|
-
delete store[id];
|
|
1360
|
-
shoutListCountChange();
|
|
1361
|
-
shoutListStateChange();
|
|
1362
|
-
shoutListElementChange(id);
|
|
1363
|
-
};
|
|
1364
|
-
const getStateKey = `get${upper(name)}State`;
|
|
1365
|
-
getStateActions[getStateKey] = () => {
|
|
1366
|
-
return Object.values(store);
|
|
1367
|
-
};
|
|
1368
|
-
const getState = getStateActions[getStateKey];
|
|
1369
|
-
const getItemKey = `get${upper(name)}`;
|
|
1370
|
-
getItemActions[getItemKey] = (id) => {
|
|
1371
|
-
return store[id];
|
|
1372
|
-
};
|
|
1373
|
-
const updateItemKey = `update${upper(name)}`;
|
|
1374
|
-
updateItemActions[updateItemKey] = (id, newProps) => {
|
|
1375
|
-
store[id].update(newProps);
|
|
1376
|
-
};
|
|
1377
|
-
const hookUseStateKey = `use${upper(name)}`;
|
|
1378
|
-
hookUseState[hookUseStateKey] = () => {
|
|
1379
|
-
const [state2, setState] = useState(getState());
|
|
1380
|
-
useMount(() => {
|
|
1381
|
-
setState(getState());
|
|
1382
|
-
const eventHandler = () => {
|
|
1383
|
-
setState(getState());
|
|
1384
|
-
};
|
|
1385
|
-
listStateChangeHandlers.push(eventHandler);
|
|
1386
|
-
return () => {
|
|
1387
|
-
listStateChangeHandlers = listStateChangeHandlers.filter(
|
|
1388
|
-
(current) => current !== eventHandler
|
|
1389
|
-
);
|
|
1390
|
-
};
|
|
1391
|
-
});
|
|
1392
|
-
return state2;
|
|
1393
|
-
};
|
|
1394
|
-
const hookUseListKey = `use${upper(name)}List`;
|
|
1395
|
-
hookUseList[hookUseListKey] = () => {
|
|
1396
|
-
const [state2, setState] = useState(getState());
|
|
1397
|
-
useMount(() => {
|
|
1398
|
-
setState(getState());
|
|
1399
|
-
const eventHandler = () => {
|
|
1400
|
-
setState(getState());
|
|
1401
|
-
};
|
|
1402
|
-
listCountChangeHandlers.push(eventHandler);
|
|
1403
|
-
return () => {
|
|
1404
|
-
listCountChangeHandlers = listCountChangeHandlers.filter(
|
|
1405
|
-
(current) => current !== eventHandler
|
|
1406
|
-
);
|
|
1407
|
-
};
|
|
1408
|
-
});
|
|
1409
|
-
return state2;
|
|
1410
|
-
};
|
|
1411
|
-
const hookUseStateByIdKey = `use${upper(
|
|
1412
|
-
name
|
|
1413
|
-
)}ById`;
|
|
1414
|
-
hookUseStateById[hookUseStateByIdKey] = (id) => {
|
|
1415
|
-
const [state2, setState] = useState({ obj: store[id] });
|
|
1416
|
-
useMount(() => {
|
|
1417
|
-
setState({ obj: store[id] });
|
|
1418
|
-
const eventHandler = () => {
|
|
1419
|
-
setState({ obj: store[id] });
|
|
1420
|
-
};
|
|
1421
|
-
if (!elementChangeHandlers[id])
|
|
1422
|
-
elementChangeHandlers[id] = [];
|
|
1423
|
-
elementChangeHandlers[id].push(eventHandler);
|
|
1424
|
-
return () => {
|
|
1425
|
-
elementChangeHandlers[id] = elementChangeHandlers[id].filter(
|
|
1426
|
-
(current) => current !== eventHandler
|
|
1427
|
-
);
|
|
1428
|
-
};
|
|
1429
|
-
});
|
|
1430
|
-
return state2.obj;
|
|
1431
|
-
};
|
|
1432
|
-
const onChangeElementKey = `change${upper(
|
|
1433
|
-
name
|
|
1434
|
-
)}Element`;
|
|
1435
|
-
suscribeById[onChangeElementKey] = (id, cb) => {
|
|
1436
|
-
if (!elementChangeHandlers[id])
|
|
1437
|
-
elementChangeHandlers[id] = [];
|
|
1438
|
-
const innerCb = () => {
|
|
1439
|
-
cb(store[id]);
|
|
1440
|
-
};
|
|
1441
|
-
elementChangeHandlers[id].push(innerCb);
|
|
1442
|
-
return () => {
|
|
1443
|
-
elementChangeHandlers[id] = elementChangeHandlers[id].filter(
|
|
1444
|
-
(current) => current !== innerCb
|
|
1445
|
-
);
|
|
1446
|
-
};
|
|
1447
|
-
};
|
|
1448
|
-
const onChangeListKey = `change${upper(
|
|
1449
|
-
name
|
|
1450
|
-
)}`;
|
|
1451
|
-
suscribeToList[onChangeListKey] = (cb) => {
|
|
1452
|
-
const innerCb = () => {
|
|
1453
|
-
cb(getState());
|
|
1454
|
-
};
|
|
1455
|
-
listStateChangeHandlers.push(innerCb);
|
|
1456
|
-
return () => {
|
|
1457
|
-
listStateChangeHandlers = listStateChangeHandlers.filter(
|
|
1458
|
-
(current) => current !== innerCb
|
|
1459
|
-
);
|
|
1460
|
-
};
|
|
1461
|
-
};
|
|
1462
|
-
const onChangeListCountKey = `change${upper(
|
|
1463
|
-
name
|
|
1464
|
-
)}Ammount`;
|
|
1465
|
-
suscribeToListCount[onChangeListCountKey] = (cb) => {
|
|
1466
|
-
const innerCb = () => {
|
|
1467
|
-
cb(getState());
|
|
1468
|
-
};
|
|
1469
|
-
listCountChangeHandlers.push(innerCb);
|
|
1470
|
-
return () => {
|
|
1471
|
-
listCountChangeHandlers = listCountChangeHandlers.filter(
|
|
1472
|
-
(current) => current !== innerCb
|
|
1473
|
-
);
|
|
1474
|
-
};
|
|
1475
|
-
};
|
|
1476
|
-
});
|
|
1477
|
-
const actions = Object.assign(
|
|
1478
|
-
{},
|
|
1479
|
-
addActions,
|
|
1480
|
-
removeActions,
|
|
1481
|
-
emptyActions
|
|
1482
|
-
);
|
|
1483
|
-
const hooks = Object.assign({}, hookUseState, hookUseStateById, hookUseList);
|
|
1484
|
-
const on = Object.assign(
|
|
1485
|
-
{},
|
|
1486
|
-
suscribeById,
|
|
1487
|
-
suscribeToList,
|
|
1488
|
-
suscribeToListCount
|
|
1489
|
-
);
|
|
1490
|
-
const state = Object.assign(
|
|
1491
|
-
{},
|
|
1492
|
-
getStateActions,
|
|
1493
|
-
getItemActions,
|
|
1494
|
-
updateItemActions
|
|
1495
|
-
);
|
|
1496
|
-
return Object.assign(
|
|
1497
|
-
{},
|
|
1498
|
-
{ hooks },
|
|
1499
|
-
{ actions },
|
|
1500
|
-
{ state },
|
|
1501
|
-
{ on }
|
|
1502
|
-
);
|
|
1503
|
-
}
|
|
1504
|
-
|
|
1505
|
-
const persistentStorage = new Proxy(
|
|
1506
|
-
{
|
|
1507
|
-
remove(prop) {
|
|
1508
|
-
localStorage.removeItem(prop);
|
|
1509
|
-
}
|
|
1510
|
-
},
|
|
1511
|
-
{
|
|
1512
|
-
get(_, prop) {
|
|
1513
|
-
try {
|
|
1514
|
-
const value = localStorage.getItem(String(prop));
|
|
1515
|
-
if (!value)
|
|
1516
|
-
return void 0;
|
|
1517
|
-
return JSON.parse(value);
|
|
1518
|
-
} catch (e) {
|
|
1519
|
-
return void 0;
|
|
1520
|
-
}
|
|
1521
|
-
},
|
|
1522
|
-
set(_, prop, value) {
|
|
1523
|
-
localStorage.setItem(String(prop), JSON.stringify(value));
|
|
1524
|
-
return true;
|
|
1525
|
-
}
|
|
1526
|
-
}
|
|
1527
|
-
);
|
|
1528
|
-
window.persistentStorage = persistentStorage;
|
|
1529
|
-
|
|
1530
|
-
const localStorageController = new class LocalSctorageController extends EventEmitter {
|
|
1531
|
-
}();
|
|
1532
|
-
function useLocalStorage(prop, defaultValue) {
|
|
1533
|
-
const actualProp = useMemo(() => prop, []);
|
|
1534
|
-
const storageValue = useMemo(
|
|
1535
|
-
() => localStorage.getItem(actualProp),
|
|
1536
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1537
|
-
[]
|
|
1538
|
-
);
|
|
1539
|
-
const [value, setValue] = useState(
|
|
1540
|
-
storageValue ? JSON.parse(storageValue) : defaultValue
|
|
1541
|
-
);
|
|
1542
|
-
useEffect(() => {
|
|
1543
|
-
setValue(JSON.parse(storageValue));
|
|
1544
|
-
return localStorageController.on("update", (ev) => {
|
|
1545
|
-
if (ev.prop === actualProp) {
|
|
1546
|
-
setValue(ev.value);
|
|
1547
|
-
localStorage.setItem(actualProp, JSON.stringify(ev.value));
|
|
1548
|
-
}
|
|
1549
|
-
});
|
|
1550
|
-
}, []);
|
|
1551
|
-
return [
|
|
1552
|
-
value,
|
|
1553
|
-
useCallback(
|
|
1554
|
-
(newValue) => {
|
|
1555
|
-
localStorageController.emit("update", {
|
|
1556
|
-
prop: actualProp,
|
|
1557
|
-
value: newValue
|
|
1558
|
-
});
|
|
1559
|
-
},
|
|
1560
|
-
[actualProp]
|
|
1561
|
-
)
|
|
1562
|
-
];
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
var __accessCheck = (obj, member, msg) => {
|
|
1566
|
-
if (!member.has(obj))
|
|
1567
|
-
throw TypeError("Cannot " + msg);
|
|
1568
|
-
};
|
|
1569
|
-
var __privateGet = (obj, member, getter) => {
|
|
1570
|
-
__accessCheck(obj, member, "read from private field");
|
|
1571
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
1572
|
-
};
|
|
1573
|
-
var __privateAdd = (obj, member, value) => {
|
|
1574
|
-
if (member.has(obj))
|
|
1575
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
1576
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1577
|
-
};
|
|
1578
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
1579
|
-
__accessCheck(obj, member, "write to private field");
|
|
1580
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
1581
|
-
return value;
|
|
1582
|
-
};
|
|
1583
|
-
var __privateWrapper = (obj, member, setter, getter) => ({
|
|
1584
|
-
set _(value) {
|
|
1585
|
-
__privateSet(obj, member, value, setter);
|
|
1586
|
-
},
|
|
1587
|
-
get _() {
|
|
1588
|
-
return __privateGet(obj, member, getter);
|
|
1589
|
-
}
|
|
1590
|
-
});
|
|
1591
|
-
var __privateMethod = (obj, member, method) => {
|
|
1592
|
-
__accessCheck(obj, member, "access private method");
|
|
1593
|
-
return method;
|
|
1594
|
-
};
|
|
1595
|
-
var __async$1 = (__this, __arguments, generator) => {
|
|
1596
|
-
return new Promise((resolve, reject) => {
|
|
1597
|
-
var fulfilled = (value) => {
|
|
1598
|
-
try {
|
|
1599
|
-
step(generator.next(value));
|
|
1600
|
-
} catch (e) {
|
|
1601
|
-
reject(e);
|
|
1602
|
-
}
|
|
1603
|
-
};
|
|
1604
|
-
var rejected = (value) => {
|
|
1605
|
-
try {
|
|
1606
|
-
step(generator.throw(value));
|
|
1607
|
-
} catch (e) {
|
|
1608
|
-
reject(e);
|
|
1609
|
-
}
|
|
1610
|
-
};
|
|
1611
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
1612
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
1613
|
-
});
|
|
1614
|
-
};
|
|
1615
|
-
var _root, _props, _actualFocusQuery, _currentInstruction, _focusDelay, _focusRetries, _focusTimeout, _isIntervalRunning, _focusQuery, focusQuery_get, _checkInstruction, checkInstruction_fn, _doFocus, doFocus_fn, _resetInterval, resetInterval_fn, _runFocusInterval, runFocusInterval_fn, _a;
|
|
1616
|
-
const notificationsSelector = ".notification";
|
|
1617
|
-
const focus = new (_a = class {
|
|
1618
|
-
constructor(root, props) {
|
|
1619
|
-
__privateAdd(this, _focusQuery);
|
|
1620
|
-
__privateAdd(this, _checkInstruction);
|
|
1621
|
-
__privateAdd(this, _doFocus);
|
|
1622
|
-
__privateAdd(this, _resetInterval);
|
|
1623
|
-
__privateAdd(this, _runFocusInterval);
|
|
1624
|
-
__privateAdd(this, _root, void 0);
|
|
1625
|
-
__privateAdd(this, _props, void 0);
|
|
1626
|
-
this.afterNotificationFocus = void 0;
|
|
1627
|
-
__privateAdd(this, _actualFocusQuery, []);
|
|
1628
|
-
__privateAdd(this, _currentInstruction, 0);
|
|
1629
|
-
__privateAdd(this, _focusDelay, 300);
|
|
1630
|
-
__privateAdd(this, _focusRetries, 3);
|
|
1631
|
-
__privateAdd(this, _focusTimeout, -1);
|
|
1632
|
-
__privateAdd(this, _isIntervalRunning, false);
|
|
1633
|
-
this.focusOnReload = null;
|
|
1634
|
-
__privateSet(this, _root, root);
|
|
1635
|
-
__privateSet(this, _props, props);
|
|
1636
|
-
window.focusStatus = {};
|
|
1637
|
-
globalFocus.onFocus(() => {
|
|
1638
|
-
__privateMethod(this, _resetInterval, resetInterval_fn).call(this);
|
|
1639
|
-
});
|
|
1640
|
-
}
|
|
1641
|
-
/**
|
|
1642
|
-
* Da la instrucción de colocar el foco en el elemento provisto como
|
|
1643
|
-
* parámetro una vez que todas las notificaciones se hayan cerrado. En caso
|
|
1644
|
-
* de no existir notificaciones abiertas, hace foco en el elemento
|
|
1645
|
-
* directamente.
|
|
1646
|
-
*/
|
|
1647
|
-
afterNotifications(element, configuration) {
|
|
1648
|
-
if (!element)
|
|
1649
|
-
return;
|
|
1650
|
-
void this.on(element, configuration);
|
|
1651
|
-
}
|
|
1652
|
-
/**
|
|
1653
|
-
* Da la instrucción de colocar el foco en el elemento provisto como
|
|
1654
|
-
* parámetro luego de recargar la página.
|
|
1655
|
-
*
|
|
1656
|
-
* Los parámetros pasados serán ordenados en orden de importancia priorizando
|
|
1657
|
-
* en el siguiente orden:
|
|
1658
|
-
* - id
|
|
1659
|
-
* - name
|
|
1660
|
-
* - className
|
|
1661
|
-
* - selector
|
|
1662
|
-
*/
|
|
1663
|
-
afterReload({
|
|
1664
|
-
className,
|
|
1665
|
-
id,
|
|
1666
|
-
name,
|
|
1667
|
-
selector
|
|
1668
|
-
}) {
|
|
1669
|
-
persistentStorage.focusOnReload = [
|
|
1670
|
-
id ? `#${id}` : void 0,
|
|
1671
|
-
name ? `[name="${name}"]` : void 0,
|
|
1672
|
-
className ? `.${className}` : void 0,
|
|
1673
|
-
selector
|
|
1674
|
-
].filter((el) => el !== void 0).join(",");
|
|
1675
|
-
}
|
|
1676
|
-
/**
|
|
1677
|
-
* Da la instrucción de colocar el foco el elemento pasado como parámetro.
|
|
1678
|
-
* Se puede pasar también una función que devuelva HTMLElement | false |
|
|
1679
|
-
* null.
|
|
1680
|
-
*
|
|
1681
|
-
* El segundo parámetro del método on es un objeto de tipo
|
|
1682
|
-
* ScrollIntoViewOptions, que permite modificar el comportamiento del scroll
|
|
1683
|
-
* a en el elemento.
|
|
1684
|
-
*
|
|
1685
|
-
* @see TFocusRetriever para más detalles sobre la función como parámetro.
|
|
1686
|
-
*/
|
|
1687
|
-
on(element, configuration) {
|
|
1688
|
-
return __async$1(this, null, function* () {
|
|
1689
|
-
if (element) {
|
|
1690
|
-
const focusElement = {
|
|
1691
|
-
element,
|
|
1692
|
-
configuration
|
|
1693
|
-
};
|
|
1694
|
-
for (let i = 0; i < __privateGet(this, _focusRetries); i++)
|
|
1695
|
-
__privateGet(this, _focusQuery, focusQuery_get).unshift(focusElement);
|
|
1696
|
-
__privateMethod(this, _resetInterval, resetInterval_fn).call(this);
|
|
1697
|
-
return __privateMethod(this, _runFocusInterval, runFocusInterval_fn).call(this, focusElement);
|
|
1698
|
-
}
|
|
1699
|
-
return false;
|
|
1700
|
-
});
|
|
1701
|
-
}
|
|
1702
|
-
restore() {
|
|
1703
|
-
void this.on(
|
|
1704
|
-
globalFocus.last(":not(body), body#tinymce") || document.querySelector(focusSelector)
|
|
1705
|
-
);
|
|
1706
|
-
}
|
|
1707
|
-
init() {
|
|
1708
|
-
var _a2, _b;
|
|
1709
|
-
const modalsObserver = new MutationObserver((mutation) => {
|
|
1710
|
-
if (mutation[0].removedNodes.length === 0)
|
|
1711
|
-
return;
|
|
1712
|
-
this.afterNotifications(
|
|
1713
|
-
globalFocus.last(
|
|
1714
|
-
":not(body):not(.notificationsView *), body#tinymce"
|
|
1715
|
-
)
|
|
1716
|
-
);
|
|
1717
|
-
});
|
|
1718
|
-
const appModalsBox = ((_b = (_a2 = __privateGet(this, _props)) == null ? void 0 : _a2.modalsContainerRetriever) != null ? _b : () => __privateGet(this, _root).querySelector("#AppModals"))();
|
|
1719
|
-
if (appModalsBox)
|
|
1720
|
-
modalsObserver.observe(appModalsBox, { childList: true });
|
|
1721
|
-
screenLocker.on("releaseForFirstTime", () => {
|
|
1722
|
-
if (persistentStorage.focusOnReload)
|
|
1723
|
-
this.focusOnReload = persistentStorage.focusOnReload;
|
|
1724
|
-
persistentStorage.focusOnReload = null;
|
|
1725
|
-
this.afterNotifications(() => {
|
|
1726
|
-
var _a3;
|
|
1727
|
-
if (this.focusOnReload) {
|
|
1728
|
-
const initialFocusElement = document.querySelector(
|
|
1729
|
-
this.focusOnReload
|
|
1730
|
-
);
|
|
1731
|
-
const scrollTop = noNaN(
|
|
1732
|
-
(_a3 = window.CURRENT_TAB) == null ? void 0 : _a3.split(
|
|
1733
|
-
"~"
|
|
1734
|
-
)[1]
|
|
1735
|
-
);
|
|
1736
|
-
if (document.scrollingElement)
|
|
1737
|
-
document.scrollingElement.scrollTop = scrollTop;
|
|
1738
|
-
return initialFocusElement;
|
|
1739
|
-
}
|
|
1740
|
-
return false;
|
|
1741
|
-
});
|
|
1742
|
-
});
|
|
1743
|
-
}
|
|
1744
|
-
}, _root = new WeakMap(), _props = new WeakMap(), _actualFocusQuery = new WeakMap(), _currentInstruction = new WeakMap(), _focusDelay = new WeakMap(), _focusRetries = new WeakMap(), _focusTimeout = new WeakMap(), _isIntervalRunning = new WeakMap(), _focusQuery = new WeakSet(), focusQuery_get = function() {
|
|
1745
|
-
return new Proxy(__privateGet(this, _actualFocusQuery), {
|
|
1746
|
-
get: (target, key) => {
|
|
1747
|
-
if (key in target) {
|
|
1748
|
-
const prop = target[key];
|
|
1749
|
-
if (isFunction$1(prop))
|
|
1750
|
-
return (...props) => {
|
|
1751
|
-
const result = target[key].bind(target, ...props)();
|
|
1752
|
-
return result;
|
|
1753
|
-
};
|
|
1754
|
-
return prop;
|
|
1755
|
-
}
|
|
1756
|
-
return void 0;
|
|
1757
|
-
}
|
|
1758
|
-
});
|
|
1759
|
-
}, _checkInstruction = new WeakSet(), checkInstruction_fn = function(focusCheck) {
|
|
1760
|
-
return focusCheck.currentInstruction === __privateGet(this, _currentInstruction);
|
|
1761
|
-
}, _doFocus = new WeakSet(), doFocus_fn = function(HTMLElement, focusCheck, isLastTry, configuration) {
|
|
1762
|
-
return __async$1(this, null, function* () {
|
|
1763
|
-
if (screenLocker.isLocked("common") && !(configuration == null ? void 0 : configuration.focusEvenWhenScreenLocked)) {
|
|
1764
|
-
return null;
|
|
1765
|
-
}
|
|
1766
|
-
const actualHTMLElement = isFunction$1(HTMLElement) ? HTMLElement(isLastTry) : HTMLElement;
|
|
1767
|
-
if (actualHTMLElement) {
|
|
1768
|
-
if (actualHTMLElement.disabled)
|
|
1769
|
-
return false;
|
|
1770
|
-
actualHTMLElement.focus();
|
|
1771
|
-
return new Promise((resolve) => {
|
|
1772
|
-
if ((configuration == null ? void 0 : configuration.dispatchCustomEvent) !== false) {
|
|
1773
|
-
const customFocusEvent = new CustomEvent(customEvents.focus, {
|
|
1774
|
-
bubbles: true
|
|
1775
|
-
});
|
|
1776
|
-
actualHTMLElement.dispatchEvent(customFocusEvent);
|
|
1777
|
-
}
|
|
1778
|
-
setTimeout(() => {
|
|
1779
|
-
if (!__privateMethod(this, _checkInstruction, checkInstruction_fn).call(this, focusCheck)) {
|
|
1780
|
-
resolve(false);
|
|
1781
|
-
return;
|
|
1782
|
-
}
|
|
1783
|
-
try {
|
|
1784
|
-
if (configuration == null ? void 0 : configuration.scrollIntoViewOptions)
|
|
1785
|
-
actualHTMLElement == null ? void 0 : actualHTMLElement.scrollIntoView(
|
|
1786
|
-
configuration.scrollIntoViewOptions
|
|
1787
|
-
);
|
|
1788
|
-
} catch (e) {
|
|
1789
|
-
console.error(e);
|
|
1790
|
-
}
|
|
1791
|
-
setTimeout(() => {
|
|
1792
|
-
var _a2, _b;
|
|
1793
|
-
if (!__privateMethod(this, _checkInstruction, checkInstruction_fn).call(this, focusCheck)) {
|
|
1794
|
-
resolve(false);
|
|
1795
|
-
} else if (((_a2 = document.activeElement) == null ? void 0 : _a2.tagName) === "IFRAME") {
|
|
1796
|
-
resolve(
|
|
1797
|
-
((_b = document.activeElement.contentDocument) == null ? void 0 : _b.contains(actualHTMLElement)) ? actualHTMLElement : null
|
|
1798
|
-
);
|
|
1799
|
-
} else
|
|
1800
|
-
resolve(
|
|
1801
|
-
document.activeElement === actualHTMLElement ? actualHTMLElement : null
|
|
1802
|
-
);
|
|
1803
|
-
}, 0);
|
|
1804
|
-
}, 0);
|
|
1805
|
-
});
|
|
1806
|
-
}
|
|
1807
|
-
return actualHTMLElement;
|
|
1808
|
-
});
|
|
1809
|
-
}, _resetInterval = new WeakSet(), resetInterval_fn = function() {
|
|
1810
|
-
clearTimeout(__privateGet(this, _focusTimeout));
|
|
1811
|
-
__privateSet(this, _focusTimeout, -1);
|
|
1812
|
-
__privateSet(this, _isIntervalRunning, false);
|
|
1813
|
-
__privateWrapper(this, _currentInstruction)._++;
|
|
1814
|
-
}, _runFocusInterval = new WeakSet(), runFocusInterval_fn = function(focusElement, internalCall) {
|
|
1815
|
-
return __async$1(this, null, function* () {
|
|
1816
|
-
if (!internalCall && (__privateGet(this, _focusTimeout) !== -1 || __privateGet(this, _isIntervalRunning)))
|
|
1817
|
-
return false;
|
|
1818
|
-
const currentInstruction = {
|
|
1819
|
-
currentInstruction: __privateGet(this, _currentInstruction)
|
|
1820
|
-
};
|
|
1821
|
-
__privateSet(this, _isIntervalRunning, true);
|
|
1822
|
-
return new Promise((resolve) => {
|
|
1823
|
-
const resolvePromise = () => __async$1(this, null, function* () {
|
|
1824
|
-
const element = focusElement != null ? focusElement : __privateGet(this, _focusQuery, focusQuery_get).shift();
|
|
1825
|
-
if (element) {
|
|
1826
|
-
const hasFocused = yield __privateMethod(this, _doFocus, doFocus_fn).call(this, element.element, currentInstruction, element !== __privateGet(this, _focusQuery, focusQuery_get)[0], element.configuration);
|
|
1827
|
-
if (!__privateMethod(this, _checkInstruction, checkInstruction_fn).call(this, currentInstruction)) {
|
|
1828
|
-
resolve(false);
|
|
1829
|
-
return;
|
|
1830
|
-
}
|
|
1831
|
-
if (hasFocused !== null && hasFocused !== false) {
|
|
1832
|
-
__privateSet(this, _actualFocusQuery, []);
|
|
1833
|
-
resolve(hasFocused);
|
|
1834
|
-
__privateSet(this, _isIntervalRunning, false);
|
|
1835
|
-
return;
|
|
1836
|
-
}
|
|
1837
|
-
if (hasFocused === false) {
|
|
1838
|
-
__privateSet(this, _actualFocusQuery, __privateGet(this, _actualFocusQuery).filter(
|
|
1839
|
-
(current) => current !== element
|
|
1840
|
-
));
|
|
1841
|
-
}
|
|
1842
|
-
}
|
|
1843
|
-
if (!__privateMethod(this, _checkInstruction, checkInstruction_fn).call(this, currentInstruction)) {
|
|
1844
|
-
resolve(false);
|
|
1845
|
-
return;
|
|
1846
|
-
}
|
|
1847
|
-
if (__privateGet(this, _actualFocusQuery).length > 0) {
|
|
1848
|
-
__privateSet(this, _focusTimeout, setTimeout(() => {
|
|
1849
|
-
const runInterval = () => __async$1(this, null, function* () {
|
|
1850
|
-
const result = yield __privateMethod(this, _runFocusInterval, runFocusInterval_fn).call(this, void 0, true);
|
|
1851
|
-
resolve(result);
|
|
1852
|
-
__privateSet(this, _isIntervalRunning, true);
|
|
1853
|
-
});
|
|
1854
|
-
void runInterval();
|
|
1855
|
-
}, __privateGet(this, _focusDelay)));
|
|
1856
|
-
} else {
|
|
1857
|
-
const lastFocused = globalFocus.last(":not(body)");
|
|
1858
|
-
if (lastFocused) {
|
|
1859
|
-
const result = yield __privateMethod(this, _doFocus, doFocus_fn).call(this, lastFocused, currentInstruction, element !== __privateGet(this, _focusQuery, focusQuery_get)[0], element == null ? void 0 : element.configuration);
|
|
1860
|
-
if (!__privateMethod(this, _checkInstruction, checkInstruction_fn).call(this, currentInstruction)) {
|
|
1861
|
-
resolve(false);
|
|
1862
|
-
return;
|
|
1863
|
-
}
|
|
1864
|
-
if (result)
|
|
1865
|
-
resolve(result);
|
|
1866
|
-
else
|
|
1867
|
-
resolve(false);
|
|
1868
|
-
__privateSet(this, _isIntervalRunning, true);
|
|
1869
|
-
}
|
|
1870
|
-
resolve(false);
|
|
1871
|
-
__privateSet(this, _isIntervalRunning, true);
|
|
1872
|
-
}
|
|
1873
|
-
});
|
|
1874
|
-
void resolvePromise();
|
|
1875
|
-
});
|
|
1876
|
-
});
|
|
1877
|
-
}, _a)(document.getElementById("root"));
|
|
1878
|
-
|
|
1879
|
-
var __defProp$5 = Object.defineProperty;
|
|
1880
|
-
var __defProps$3 = Object.defineProperties;
|
|
1881
|
-
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
1882
|
-
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
1883
|
-
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
1884
|
-
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
1885
|
-
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1886
|
-
var __spreadValues$5 = (a, b) => {
|
|
1887
|
-
for (var prop in b || (b = {}))
|
|
1888
|
-
if (__hasOwnProp$5.call(b, prop))
|
|
1889
|
-
__defNormalProp$5(a, prop, b[prop]);
|
|
1890
|
-
if (__getOwnPropSymbols$5)
|
|
1891
|
-
for (var prop of __getOwnPropSymbols$5(b)) {
|
|
1892
|
-
if (__propIsEnum$5.call(b, prop))
|
|
1893
|
-
__defNormalProp$5(a, prop, b[prop]);
|
|
1894
|
-
}
|
|
1895
|
-
return a;
|
|
1896
|
-
};
|
|
1897
|
-
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
1898
|
-
class History extends EventEmitter {
|
|
1899
|
-
constructor(onCloseWindow, configuration = { maxLength: 100 }) {
|
|
1900
|
-
super();
|
|
1901
|
-
this.configuration = configuration;
|
|
1902
|
-
this.autocloseTimeout = -1;
|
|
1903
|
-
this.currentStep = 0;
|
|
1904
|
-
this.content = [];
|
|
1905
|
-
this.enabled = true;
|
|
1906
|
-
this._isOpen = false;
|
|
1907
|
-
this.timeoutMs = 350;
|
|
1908
|
-
this.closeWindow = () => {
|
|
1909
|
-
if (this._isOpen) {
|
|
1910
|
-
this.onCloseWindow(this.push.bind(this));
|
|
1911
|
-
this._isOpen = false;
|
|
1912
|
-
}
|
|
1913
|
-
};
|
|
1914
|
-
this.getEvent = () => {
|
|
1915
|
-
const stepCount = this.content.length - 1;
|
|
1916
|
-
const event = {
|
|
1917
|
-
content: this.content[this.currentStep],
|
|
1918
|
-
currentStep: this.currentStep,
|
|
1919
|
-
stepCount,
|
|
1920
|
-
hasNext: this.currentStep < stepCount,
|
|
1921
|
-
hasPrevious: this.currentStep >= 0
|
|
1922
|
-
};
|
|
1923
|
-
return event;
|
|
1924
|
-
};
|
|
1925
|
-
this.push = (el) => {
|
|
1926
|
-
this.content = [...this.content.slice(0, this.currentStep + 1), el];
|
|
1927
|
-
this.content = this.content.slice(
|
|
1928
|
-
Math.max(0, this.content.length - this.configuration.maxLength)
|
|
1929
|
-
);
|
|
1930
|
-
this.currentStep = this.content.length - 1;
|
|
1931
|
-
this.shoutStepChange(true);
|
|
1932
|
-
};
|
|
1933
|
-
this.shoutStepChange = (fromPush) => {
|
|
1934
|
-
try {
|
|
1935
|
-
this.emit("stepChange", __spreadProps$3(__spreadValues$5({}, this.getEvent()), { fromPush }));
|
|
1936
|
-
} catch (e) {
|
|
1937
|
-
console.error(e);
|
|
1938
|
-
}
|
|
1939
|
-
};
|
|
1940
|
-
this.hooks = {
|
|
1941
|
-
useCountChange: (onChange) => {
|
|
1942
|
-
useMount(() => {
|
|
1943
|
-
onChange(this.getEvent());
|
|
1944
|
-
this.on("stepChange", () => {
|
|
1945
|
-
onChange(this.getEvent());
|
|
1946
|
-
});
|
|
1947
|
-
});
|
|
1948
|
-
}
|
|
1949
|
-
};
|
|
1950
|
-
this.back = () => {
|
|
1951
|
-
if (this.currentStep >= 0) {
|
|
1952
|
-
this.currentStep -= 1;
|
|
1953
|
-
this.shoutStepChange();
|
|
1954
|
-
}
|
|
1955
|
-
};
|
|
1956
|
-
this.disable = () => {
|
|
1957
|
-
this.enabled = false;
|
|
1958
|
-
};
|
|
1959
|
-
this.enable = () => {
|
|
1960
|
-
this.enabled = true;
|
|
1961
|
-
};
|
|
1962
|
-
this.forward = () => {
|
|
1963
|
-
if (this.currentStep < this.content.length - 1) {
|
|
1964
|
-
this.currentStep += 1;
|
|
1965
|
-
this.shoutStepChange();
|
|
1966
|
-
}
|
|
1967
|
-
};
|
|
1968
|
-
this.openWindow = () => {
|
|
1969
|
-
if (!this.enabled)
|
|
1970
|
-
return;
|
|
1971
|
-
this._isOpen = true;
|
|
1972
|
-
clearTimeout(this.autocloseTimeout);
|
|
1973
|
-
this.autocloseTimeout = setTimeout(() => {
|
|
1974
|
-
this.closeWindow();
|
|
1975
|
-
}, this.timeoutMs);
|
|
1976
|
-
};
|
|
1977
|
-
this.updateConfig = (newConfiguration) => {
|
|
1978
|
-
this.configuration = __spreadValues$5(__spreadValues$5({}, this.configuration), newConfiguration);
|
|
1979
|
-
};
|
|
1980
|
-
this.onCloseWindow = onCloseWindow;
|
|
1981
|
-
}
|
|
1982
|
-
get isOpen() {
|
|
1983
|
-
return this._isOpen;
|
|
1984
|
-
}
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
const ImperativeComponentContext = createContext(
|
|
1988
|
-
{}
|
|
1989
|
-
);
|
|
1990
|
-
|
|
1991
|
-
var __defProp$4 = Object.defineProperty;
|
|
1992
|
-
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
1993
|
-
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
1994
|
-
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
1995
|
-
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1996
|
-
var __spreadValues$4 = (a, b) => {
|
|
1997
|
-
for (var prop in b || (b = {}))
|
|
1998
|
-
if (__hasOwnProp$4.call(b, prop))
|
|
1999
|
-
__defNormalProp$4(a, prop, b[prop]);
|
|
2000
|
-
if (__getOwnPropSymbols$4)
|
|
2001
|
-
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
2002
|
-
if (__propIsEnum$4.call(b, prop))
|
|
2003
|
-
__defNormalProp$4(a, prop, b[prop]);
|
|
2004
|
-
}
|
|
2005
|
-
return a;
|
|
2006
|
-
};
|
|
2007
|
-
var __objRest$1 = (source, exclude) => {
|
|
2008
|
-
var target = {};
|
|
2009
|
-
for (var prop in source)
|
|
2010
|
-
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2011
|
-
target[prop] = source[prop];
|
|
2012
|
-
if (source != null && __getOwnPropSymbols$4)
|
|
2013
|
-
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
2014
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
|
|
2015
|
-
target[prop] = source[prop];
|
|
2016
|
-
}
|
|
2017
|
-
return target;
|
|
2018
|
-
};
|
|
2019
|
-
function makeImperativeComponent() {
|
|
2020
|
-
return function ImperativeComponent({
|
|
2021
|
-
Component,
|
|
2022
|
-
initialState,
|
|
2023
|
-
methods
|
|
2024
|
-
}) {
|
|
2025
|
-
const setStates = {};
|
|
2026
|
-
const actualMethods = {};
|
|
2027
|
-
Object.entries(methods != null ? methods : {}).forEach(([key, method]) => {
|
|
2028
|
-
actualMethods[key] = (id, ...args) => {
|
|
2029
|
-
if (setStates[id])
|
|
2030
|
-
method(setStates[id], ...args);
|
|
2031
|
-
else {
|
|
2032
|
-
console.warn(`The requested id does not exist: ${id}`);
|
|
2033
|
-
}
|
|
2034
|
-
};
|
|
2035
|
-
});
|
|
2036
|
-
const eventsHandlers = {};
|
|
2037
|
-
const fireEvent = (id, ev, args) => {
|
|
2038
|
-
var _a, _b;
|
|
2039
|
-
if (eventsHandlers[id])
|
|
2040
|
-
(_b = (_a = eventsHandlers[id]) == null ? void 0 : _a[ev]) == null ? void 0 : _b.forEach((current) => current.cb(args));
|
|
2041
|
-
else
|
|
2042
|
-
console.warn(`The requested id does not exist: ${id}`);
|
|
2043
|
-
};
|
|
2044
|
-
const ActualComponent = (_a) => {
|
|
2045
|
-
var _b = _a, {
|
|
2046
|
-
id
|
|
2047
|
-
} = _b, props = __objRest$1(_b, [
|
|
2048
|
-
"id"
|
|
2049
|
-
]);
|
|
2050
|
-
const [state, innerSetState] = useState(initialState);
|
|
2051
|
-
setStates[id] = (newState) => innerSetState((current) => __spreadValues$4(__spreadValues$4({}, current), newState));
|
|
2052
|
-
return /* @__PURE__ */ jsx(
|
|
2053
|
-
ImperativeComponentContext.Provider,
|
|
2054
|
-
{
|
|
2055
|
-
value: useMemo(() => ({ id, eventsStore: eventsHandlers }), [id]),
|
|
2056
|
-
children: /* @__PURE__ */ jsx(Component, __spreadValues$4(__spreadValues$4({}, props), state))
|
|
2057
|
-
}
|
|
2058
|
-
);
|
|
2059
|
-
};
|
|
2060
|
-
return [actualMethods, fireEvent, ActualComponent];
|
|
2061
|
-
};
|
|
2062
|
-
}
|
|
2063
|
-
|
|
2064
|
-
var __defProp$3 = Object.defineProperty;
|
|
2065
|
-
var __defProps$2 = Object.defineProperties;
|
|
2066
|
-
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
2067
|
-
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
2068
|
-
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
2069
|
-
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
2070
|
-
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2071
|
-
var __spreadValues$3 = (a, b) => {
|
|
2072
|
-
for (var prop in b || (b = {}))
|
|
2073
|
-
if (__hasOwnProp$3.call(b, prop))
|
|
2074
|
-
__defNormalProp$3(a, prop, b[prop]);
|
|
2075
|
-
if (__getOwnPropSymbols$3)
|
|
2076
|
-
for (var prop of __getOwnPropSymbols$3(b)) {
|
|
2077
|
-
if (__propIsEnum$3.call(b, prop))
|
|
2078
|
-
__defNormalProp$3(a, prop, b[prop]);
|
|
2079
|
-
}
|
|
2080
|
-
return a;
|
|
2081
|
-
};
|
|
2082
|
-
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
2083
|
-
function makeSingleImperativeComponent() {
|
|
2084
|
-
return function SingleImperativeComponent({
|
|
2085
|
-
initialState,
|
|
2086
|
-
methods,
|
|
2087
|
-
Component
|
|
2088
|
-
}) {
|
|
2089
|
-
const id = uniqueId();
|
|
2090
|
-
const [actualMethods, originalFireEvent, ImperativeComponent] = makeImperativeComponent()({
|
|
2091
|
-
initialState,
|
|
2092
|
-
methods,
|
|
2093
|
-
Component
|
|
2094
|
-
});
|
|
2095
|
-
const fireEvent = (ev, args) => originalFireEvent(id, ev, args);
|
|
2096
|
-
const newMethods = {};
|
|
2097
|
-
Object.entries(actualMethods).forEach(([name, method]) => {
|
|
2098
|
-
newMethods[name] = (...args) => method(id, ...args);
|
|
2099
|
-
});
|
|
2100
|
-
return [
|
|
2101
|
-
newMethods,
|
|
2102
|
-
fireEvent,
|
|
2103
|
-
(props) => /* @__PURE__ */ jsx(ImperativeComponent, __spreadProps$2(__spreadValues$3({}, props), { id }))
|
|
2104
|
-
];
|
|
2105
|
-
};
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
function useImperativeComponentContext() {
|
|
2109
|
-
const context = useContext(ImperativeComponentContext);
|
|
2110
|
-
return context;
|
|
2111
|
-
}
|
|
2112
|
-
|
|
2113
|
-
const useImperativeComponentEvents = (handlers) => {
|
|
2114
|
-
const uniqueHookId = useMemo(() => uniqueId$1("hook"), []);
|
|
2115
|
-
const { id, eventsStore } = useImperativeComponentContext();
|
|
2116
|
-
const hasRegistered = useRef(false);
|
|
2117
|
-
const registerEvents = useCallback(() => {
|
|
2118
|
-
Object.entries(handlers).forEach(([name, callback]) => {
|
|
2119
|
-
var _a;
|
|
2120
|
-
if (!eventsStore[id])
|
|
2121
|
-
eventsStore[id] = {};
|
|
2122
|
-
if (!eventsStore[id][name])
|
|
2123
|
-
eventsStore[id][name] = [];
|
|
2124
|
-
(_a = eventsStore[id][name]) == null ? void 0 : _a.push({
|
|
2125
|
-
cb: callback,
|
|
2126
|
-
uniqueHookId
|
|
2127
|
-
});
|
|
2128
|
-
});
|
|
2129
|
-
}, [eventsStore, handlers, id, uniqueHookId]);
|
|
2130
|
-
useEffect(() => {
|
|
2131
|
-
registerEvents();
|
|
2132
|
-
return () => {
|
|
2133
|
-
hasRegistered.current = false;
|
|
2134
|
-
Object.entries(handlers).forEach(([name]) => {
|
|
2135
|
-
var _a;
|
|
2136
|
-
eventsStore[id][name] = ((_a = eventsStore[id][name]) != null ? _a : []).filter((current) => current.uniqueHookId !== uniqueHookId);
|
|
2137
|
-
});
|
|
2138
|
-
};
|
|
2139
|
-
}, [eventsStore, handlers, id, registerEvents, uniqueHookId]);
|
|
2140
|
-
return uniqueHookId;
|
|
2141
|
-
};
|
|
2142
|
-
|
|
2143
|
-
const formatMessage = (str, obj) => {
|
|
2144
|
-
let newStr = str;
|
|
2145
|
-
Object.entries(obj).forEach(([key, value]) => {
|
|
2146
|
-
const placeHolder = `<${key}>`;
|
|
2147
|
-
if (newStr == null ? void 0 : newStr.includes(placeHolder)) {
|
|
2148
|
-
newStr = newStr.replace(placeHolder, value != null ? value : "");
|
|
2149
|
-
}
|
|
2150
|
-
});
|
|
2151
|
-
return newStr;
|
|
2152
|
-
};
|
|
2153
|
-
|
|
2154
|
-
var __defProp$2 = Object.defineProperty;
|
|
2155
|
-
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
2156
|
-
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
2157
|
-
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
2158
|
-
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2159
|
-
var __spreadValues$2 = (a, b) => {
|
|
2160
|
-
for (var prop in b || (b = {}))
|
|
2161
|
-
if (__hasOwnProp$2.call(b, prop))
|
|
2162
|
-
__defNormalProp$2(a, prop, b[prop]);
|
|
2163
|
-
if (__getOwnPropSymbols$2)
|
|
2164
|
-
for (var prop of __getOwnPropSymbols$2(b)) {
|
|
2165
|
-
if (__propIsEnum$2.call(b, prop))
|
|
2166
|
-
__defNormalProp$2(a, prop, b[prop]);
|
|
2167
|
-
}
|
|
2168
|
-
return a;
|
|
2169
|
-
};
|
|
2170
|
-
function getLabel(name, replaceTokens) {
|
|
2171
|
-
var _a;
|
|
2172
|
-
const label = __spreadValues$2({}, (_a = window.labels[name]) != null ? _a : {
|
|
2173
|
-
text: `Not preloaded: ${name}`,
|
|
2174
|
-
tooltip: `Not preloaded: ${name}`
|
|
2175
|
-
});
|
|
2176
|
-
if ((replaceTokens == null ? void 0 : replaceTokens.text) !== void 0)
|
|
2177
|
-
label.text = formatMessage(label.text, replaceTokens.text);
|
|
2178
|
-
if ((replaceTokens == null ? void 0 : replaceTokens.title) !== void 0)
|
|
2179
|
-
label.tooltip = formatMessage(label.tooltip, replaceTokens.title);
|
|
2180
|
-
return label;
|
|
2181
|
-
}
|
|
2182
|
-
|
|
2183
|
-
function getValueByPath(obj, path, separator = ".") {
|
|
2184
|
-
const actualPath = typeof path === "string" ? path.split(separator) : path;
|
|
2185
|
-
if (typeof obj !== "object" || !obj) {
|
|
2186
|
-
if (actualPath.length === 0)
|
|
2187
|
-
return obj;
|
|
2188
|
-
return void 0;
|
|
2189
|
-
}
|
|
2190
|
-
const currentStep = actualPath.shift();
|
|
2191
|
-
if (actualPath.length === 0)
|
|
2192
|
-
return obj[currentStep];
|
|
2193
|
-
return getValueByPath(
|
|
2194
|
-
obj[currentStep],
|
|
2195
|
-
actualPath,
|
|
2196
|
-
separator
|
|
2197
|
-
);
|
|
2198
|
-
}
|
|
2199
|
-
|
|
2200
|
-
function setValueByPath(obj, path, value) {
|
|
2201
|
-
if (path === "")
|
|
2202
|
-
return value;
|
|
2203
|
-
const steps = path.split(".");
|
|
2204
|
-
if (steps.length === 0) {
|
|
2205
|
-
console.warn(`An empty path was provoided ${path}`);
|
|
2206
|
-
return null;
|
|
2207
|
-
}
|
|
2208
|
-
const originalClonedObject = clone(obj != null ? obj : {});
|
|
2209
|
-
let currentObj = originalClonedObject;
|
|
2210
|
-
for (let i = 0; i < steps.length - 1; i++) {
|
|
2211
|
-
if (!currentObj[steps[i]])
|
|
2212
|
-
currentObj[steps[i]] = {};
|
|
2213
|
-
if (typeof currentObj[steps[i]] === "object") {
|
|
2214
|
-
currentObj = currentObj[steps[i]];
|
|
2215
|
-
} else {
|
|
2216
|
-
console.info({
|
|
2217
|
-
originalObject: obj,
|
|
2218
|
-
originalPath: path,
|
|
2219
|
-
currentObj,
|
|
2220
|
-
currentStep: steps[i]
|
|
2221
|
-
});
|
|
2222
|
-
throw new Error(
|
|
2223
|
-
`The provided path ${path} cannot be applied due to it is not an object's path.`
|
|
2224
|
-
);
|
|
2225
|
-
}
|
|
2226
|
-
}
|
|
2227
|
-
currentObj[steps.pop()] = value;
|
|
2228
|
-
return originalClonedObject;
|
|
2229
|
-
}
|
|
2230
|
-
|
|
2231
|
-
const PropsSelectorUndefinedObject = {};
|
|
2232
|
-
const defaultComparator = (a, b) => {
|
|
2233
|
-
return a === b;
|
|
2234
|
-
};
|
|
2235
|
-
function getDefaultSelector() {
|
|
2236
|
-
return (current) => {
|
|
2237
|
-
return current;
|
|
2238
|
-
};
|
|
2239
|
-
}
|
|
2240
|
-
function isPropsConfigurationObject(value) {
|
|
2241
|
-
return typeof value === "object" && value && ("selector" in value || "comparator" in value || "initialValue" in value);
|
|
2242
|
-
}
|
|
2243
|
-
function usePropsSelector(fieldId, par1, par2, par3) {
|
|
2244
|
-
var _a;
|
|
2245
|
-
const selector = React__default.useMemo(
|
|
2246
|
-
() => {
|
|
2247
|
-
return isPropsConfigurationObject(par1) ? par1.selector : par1;
|
|
2248
|
-
},
|
|
2249
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2250
|
-
[]
|
|
2251
|
-
);
|
|
2252
|
-
const comparator = React__default.useMemo(
|
|
2253
|
-
() => {
|
|
2254
|
-
return isPropsConfigurationObject(par1) ? par1.comparator : par2;
|
|
2255
|
-
},
|
|
2256
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2257
|
-
[]
|
|
2258
|
-
);
|
|
2259
|
-
const initialValue = React__default.useMemo(
|
|
2260
|
-
() => {
|
|
2261
|
-
return isPropsConfigurationObject(par1) ? par1.initialValue : void 0;
|
|
2262
|
-
},
|
|
2263
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2264
|
-
[]
|
|
2265
|
-
);
|
|
2266
|
-
const actualPropsStore = React__default.useMemo(
|
|
2267
|
-
() => {
|
|
2268
|
-
var _a2;
|
|
2269
|
-
return (_a2 = par3 != null ? par3 : isPropsConfigurationObject(par1) ? par1.propsStore : propsStore) != null ? _a2 : propsStore;
|
|
2270
|
-
},
|
|
2271
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2272
|
-
[
|
|
2273
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2274
|
-
(_a = par3 != null ? par3 : isPropsConfigurationObject(par1) ? par1.propsStore : propsStore) != null ? _a : propsStore
|
|
2275
|
-
]
|
|
2276
|
-
);
|
|
2277
|
-
const getCurrentProps = React__default.useCallback(() => {
|
|
2278
|
-
const currentProps = actualPropsStore.getFieldProps(fieldId);
|
|
2279
|
-
const willSetInitialValue = currentProps !== void 0 && initialValue !== void 0;
|
|
2280
|
-
if (willSetInitialValue) {
|
|
2281
|
-
actualPropsStore.updateField(
|
|
2282
|
-
fieldId,
|
|
2283
|
-
initialValue
|
|
2284
|
-
);
|
|
2285
|
-
}
|
|
2286
|
-
return (selector != null ? selector : getDefaultSelector())(
|
|
2287
|
-
currentProps != null ? currentProps : PropsSelectorUndefinedObject
|
|
2288
|
-
);
|
|
2289
|
-
}, []);
|
|
2290
|
-
const [props, setProps] = React__default.useState(getCurrentProps);
|
|
2291
|
-
const prevProps = useRef(props);
|
|
2292
|
-
const prevFieldId = useRef(fieldId);
|
|
2293
|
-
React__default.useEffect(() => {
|
|
2294
|
-
const unsuscribe = actualPropsStore.suscribe(
|
|
2295
|
-
fieldId,
|
|
2296
|
-
(newProps, isUrgent) => {
|
|
2297
|
-
const newSelectedProps = (selector != null ? selector : getDefaultSelector())(
|
|
2298
|
-
newProps
|
|
2299
|
-
);
|
|
2300
|
-
if (!(comparator != null ? comparator : defaultComparator)(
|
|
2301
|
-
prevProps.current,
|
|
2302
|
-
newSelectedProps
|
|
2303
|
-
) || prevFieldId.current !== fieldId) {
|
|
2304
|
-
if (isUrgent)
|
|
2305
|
-
setProps(newSelectedProps);
|
|
2306
|
-
else
|
|
2307
|
-
React__default.startTransition(() => {
|
|
2308
|
-
setProps(newSelectedProps);
|
|
2309
|
-
});
|
|
2310
|
-
}
|
|
2311
|
-
prevProps.current = newSelectedProps;
|
|
2312
|
-
}
|
|
2313
|
-
);
|
|
2314
|
-
return () => {
|
|
2315
|
-
unsuscribe();
|
|
2316
|
-
};
|
|
2317
|
-
}, [fieldId, actualPropsStore, selector, comparator]);
|
|
2318
|
-
return props;
|
|
2319
|
-
}
|
|
2320
|
-
|
|
2321
|
-
var __defProp$1 = Object.defineProperty;
|
|
2322
|
-
var __defProps$1 = Object.defineProperties;
|
|
2323
|
-
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
2324
|
-
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
2325
|
-
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
2326
|
-
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
2327
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2328
|
-
var __spreadValues$1 = (a, b) => {
|
|
2329
|
-
for (var prop in b || (b = {}))
|
|
2330
|
-
if (__hasOwnProp$1.call(b, prop))
|
|
2331
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
2332
|
-
if (__getOwnPropSymbols$1)
|
|
2333
|
-
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
2334
|
-
if (__propIsEnum$1.call(b, prop))
|
|
2335
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
2336
|
-
}
|
|
2337
|
-
return a;
|
|
2338
|
-
};
|
|
2339
|
-
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
2340
|
-
const propsLog = "propsLog";
|
|
2341
|
-
class PropsStore {
|
|
2342
|
-
constructor(configuration) {
|
|
2343
|
-
this.configuration = configuration;
|
|
2344
|
-
this.log = persistentStorage[propsLog];
|
|
2345
|
-
this.fields = {};
|
|
2346
|
-
this.suscriptors = {};
|
|
2347
|
-
this.loggers = {
|
|
2348
|
-
propsLog: ([log]) => {
|
|
2349
|
-
this.log = log;
|
|
2350
|
-
persistentStorage[propsLog] = log;
|
|
2351
|
-
},
|
|
2352
|
-
propsStore: ([fieldId]) => {
|
|
2353
|
-
if (fieldId)
|
|
2354
|
-
console.info(this.fields[fieldId]);
|
|
2355
|
-
else
|
|
2356
|
-
console.info(this.fields);
|
|
2357
|
-
},
|
|
2358
|
-
propsSuscriptors: ([fieldId]) => {
|
|
2359
|
-
if (fieldId)
|
|
2360
|
-
console.info(this.suscriptors[fieldId]);
|
|
2361
|
-
else
|
|
2362
|
-
console.info(this.suscriptors);
|
|
2363
|
-
},
|
|
2364
|
-
updateProp: ([fieldId, newProps]) => {
|
|
2365
|
-
this.updateField(fieldId, newProps);
|
|
2366
|
-
}
|
|
2367
|
-
};
|
|
2368
|
-
if (this.configuration) {
|
|
2369
|
-
if (this.configuration.logCommands.propsStore)
|
|
2370
|
-
debugDispatcher.on(
|
|
2371
|
-
this.configuration.logCommands.propsStore,
|
|
2372
|
-
this.loggers.propsStore,
|
|
2373
|
-
"Muestra el contenido actual del propsStore"
|
|
2374
|
-
);
|
|
2375
|
-
if (this.configuration.logCommands.updateProp)
|
|
2376
|
-
debugDispatcher.on(
|
|
2377
|
-
this.configuration.logCommands.updateProp,
|
|
2378
|
-
this.loggers.updateProp,
|
|
2379
|
-
"dd.updateProp(fieldId, newProps). El objeto newProps ser\xE1 mergeado sobre las props actuales"
|
|
2380
|
-
);
|
|
2381
|
-
if (this.configuration.logCommands.propsSuscriptors)
|
|
2382
|
-
debugDispatcher.on(
|
|
2383
|
-
this.configuration.logCommands.propsSuscriptors,
|
|
2384
|
-
this.loggers.propsSuscriptors,
|
|
2385
|
-
"Muestra los suscriptores actuales del propsStore"
|
|
2386
|
-
);
|
|
2387
|
-
if (this.configuration.logCommands.propsLog)
|
|
2388
|
-
debugDispatcher.on(
|
|
2389
|
-
this.configuration.logCommands.propsLog,
|
|
2390
|
-
this.loggers.propsLog,
|
|
2391
|
-
"Si se pasa como true, hace log de las acciones. Si se pasa como trace(fieldId), se hace log de todas las acciones y trace del campo especificado. Si se pasa trace(), hace log y trace de todas las acciones."
|
|
2392
|
-
);
|
|
2393
|
-
}
|
|
2394
|
-
}
|
|
2395
|
-
destructor() {
|
|
2396
|
-
if (this.configuration) {
|
|
2397
|
-
if (this.configuration.logCommands.propsStore)
|
|
2398
|
-
debugDispatcher.off(
|
|
2399
|
-
this.configuration.logCommands.propsStore,
|
|
2400
|
-
this.loggers.propsStore
|
|
2401
|
-
);
|
|
2402
|
-
if (this.configuration.logCommands.updateProp)
|
|
2403
|
-
debugDispatcher.off(
|
|
2404
|
-
this.configuration.logCommands.updateProp,
|
|
2405
|
-
this.loggers.updateProp
|
|
2406
|
-
);
|
|
2407
|
-
if (this.configuration.logCommands.propsSuscriptors)
|
|
2408
|
-
debugDispatcher.off(
|
|
2409
|
-
this.configuration.logCommands.propsSuscriptors,
|
|
2410
|
-
this.loggers.propsSuscriptors
|
|
2411
|
-
);
|
|
2412
|
-
if (this.configuration.logCommands.propsLog)
|
|
2413
|
-
debugDispatcher.off(
|
|
2414
|
-
this.configuration.logCommands.propsLog,
|
|
2415
|
-
this.loggers.propsLog
|
|
2416
|
-
);
|
|
2417
|
-
}
|
|
2418
|
-
}
|
|
2419
|
-
getAllFields() {
|
|
2420
|
-
return cloneDeep(this.fields);
|
|
2421
|
-
}
|
|
2422
|
-
/**
|
|
2423
|
-
* Devuelve los props actuales de un campo.
|
|
2424
|
-
*/
|
|
2425
|
-
getFieldProps(fieldId) {
|
|
2426
|
-
return this.fields[fieldId];
|
|
2427
|
-
}
|
|
2428
|
-
removeField(fieldId) {
|
|
2429
|
-
this.suscriptors[fieldId] = [];
|
|
2430
|
-
delete this.fields[fieldId];
|
|
2431
|
-
if (this.log)
|
|
2432
|
-
console.info(`propsStore: removeNode ${fieldId}`);
|
|
2433
|
-
}
|
|
2434
|
-
/**
|
|
2435
|
-
* Permite establecer un suscriptor que será llamado
|
|
2436
|
-
* cada vez que las props del campo especificado cambien.
|
|
2437
|
-
*/
|
|
2438
|
-
suscribe(fieldId, callback) {
|
|
2439
|
-
var _a;
|
|
2440
|
-
if (!this.suscriptors[fieldId])
|
|
2441
|
-
this.suscriptors[fieldId] = [];
|
|
2442
|
-
this.suscriptors[fieldId].push(callback);
|
|
2443
|
-
callback((_a = this.fields[fieldId]) != null ? _a : PropsSelectorUndefinedObject);
|
|
2444
|
-
return () => {
|
|
2445
|
-
this.suscriptors[fieldId] = this.suscriptors[fieldId].filter(
|
|
2446
|
-
(current) => {
|
|
2447
|
-
return current !== callback;
|
|
2448
|
-
}
|
|
2449
|
-
);
|
|
2450
|
-
};
|
|
2451
|
-
}
|
|
2452
|
-
/**
|
|
2453
|
-
* Actualiza o crea las props de un campo.
|
|
2454
|
-
*
|
|
2455
|
-
* La tercera prop está relacionada
|
|
2456
|
-
*/
|
|
2457
|
-
updateField(fieldId, props, conf) {
|
|
2458
|
-
var _a, _b, _c;
|
|
2459
|
-
if (fieldId === void 0)
|
|
2460
|
-
return;
|
|
2461
|
-
const { noEmit, isUrgent } = conf != null ? conf : {};
|
|
2462
|
-
const newProps = __spreadValues$1(__spreadValues$1({}, this.fields[fieldId]), props);
|
|
2463
|
-
this.fields[fieldId] = newProps;
|
|
2464
|
-
if (this.log === true || this.log === fieldId)
|
|
2465
|
-
console.info({ fieldId, props });
|
|
2466
|
-
if (this.log === "trace")
|
|
2467
|
-
console.trace();
|
|
2468
|
-
else {
|
|
2469
|
-
const logId = typeof this.log === "string" && ((_a = this.log.match(/trace\(([^)]+)\)/)) != null ? _a : [])[1];
|
|
2470
|
-
if (fieldId === logId)
|
|
2471
|
-
console.trace();
|
|
2472
|
-
}
|
|
2473
|
-
if (!noEmit) {
|
|
2474
|
-
(_b = this.suscriptors[fieldId]) == null ? void 0 : _b.forEach((current) => {
|
|
2475
|
-
return current(newProps, isUrgent);
|
|
2476
|
-
});
|
|
2477
|
-
(_c = this.suscriptors.any) == null ? void 0 : _c.forEach((current) => {
|
|
2478
|
-
return current(__spreadProps$1(__spreadValues$1({}, newProps), { fieldId }), isUrgent);
|
|
2479
|
-
});
|
|
2480
|
-
}
|
|
2481
|
-
}
|
|
2482
|
-
}
|
|
2483
|
-
const propsStore = new PropsStore({
|
|
2484
|
-
logCommands: {
|
|
2485
|
-
propsLog: "propsLog",
|
|
2486
|
-
propsStore: "propsStore",
|
|
2487
|
-
propsSuscriptors: "propsSuscriptors",
|
|
2488
|
-
updateProp: "updateProp"
|
|
2489
|
-
}
|
|
2490
|
-
});
|
|
2491
|
-
|
|
2492
|
-
var __defProp = Object.defineProperty;
|
|
2493
|
-
var __defProps = Object.defineProperties;
|
|
2494
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
2495
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
2496
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
2497
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
2498
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2499
|
-
var __spreadValues = (a, b) => {
|
|
2500
|
-
for (var prop in b || (b = {}))
|
|
2501
|
-
if (__hasOwnProp.call(b, prop))
|
|
2502
|
-
__defNormalProp(a, prop, b[prop]);
|
|
2503
|
-
if (__getOwnPropSymbols)
|
|
2504
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
2505
|
-
if (__propIsEnum.call(b, prop))
|
|
2506
|
-
__defNormalProp(a, prop, b[prop]);
|
|
2507
|
-
}
|
|
2508
|
-
return a;
|
|
2509
|
-
};
|
|
2510
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
2511
|
-
var __objRest = (source, exclude) => {
|
|
2512
|
-
var target = {};
|
|
2513
|
-
for (var prop in source)
|
|
2514
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2515
|
-
target[prop] = source[prop];
|
|
2516
|
-
if (source != null && __getOwnPropSymbols)
|
|
2517
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
2518
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
2519
|
-
target[prop] = source[prop];
|
|
2520
|
-
}
|
|
2521
|
-
return target;
|
|
2522
|
-
};
|
|
2523
|
-
function assignProps(el, _a) {
|
|
2524
|
-
var _b = _a, { style } = _b, props = __objRest(_b, ["style"]);
|
|
2525
|
-
if (style) {
|
|
2526
|
-
Object.entries(style).forEach(([name, value]) => {
|
|
2527
|
-
el.style[name] = value;
|
|
2528
|
-
});
|
|
2529
|
-
}
|
|
2530
|
-
Object.assign(el, props);
|
|
2531
|
-
}
|
|
2532
|
-
function useDomState(initialDomProps) {
|
|
2533
|
-
const domProps = React__default.useRef(__spreadProps(__spreadValues({}, initialDomProps != null ? initialDomProps : {}), {
|
|
2534
|
-
ref: React__default.useCallback((el) => {
|
|
2535
|
-
ref.current = el;
|
|
2536
|
-
assignProps(ref.current, domProps.current);
|
|
2537
|
-
}, [])
|
|
2538
|
-
}));
|
|
2539
|
-
const ref = React__default.useRef(null);
|
|
2540
|
-
return {
|
|
2541
|
-
domProps: domProps.current,
|
|
2542
|
-
setDomProps: React__default.useCallback((_a) => {
|
|
2543
|
-
var _b = _a, { style } = _b, newDomProps = __objRest(_b, ["style"]);
|
|
2544
|
-
if (style) {
|
|
2545
|
-
const newStyles = __spreadValues(__spreadValues({}, domProps.current.style), style);
|
|
2546
|
-
domProps.current.style = newStyles;
|
|
2547
|
-
}
|
|
2548
|
-
Object.assign(domProps.current, newDomProps);
|
|
2549
|
-
if (ref.current)
|
|
2550
|
-
assignProps(ref.current, domProps.current);
|
|
2551
|
-
}, [])
|
|
2552
|
-
};
|
|
2553
|
-
}
|
|
2554
|
-
|
|
2555
|
-
function useDebouncedState(timeout, initialState) {
|
|
2556
|
-
const [state, innerSetState] = useState(initialState);
|
|
2557
|
-
const t = useRef(-1);
|
|
2558
|
-
const setState = useCallback(
|
|
2559
|
-
(newState, immediate) => {
|
|
2560
|
-
clearTimeout(t.current);
|
|
2561
|
-
if (immediate)
|
|
2562
|
-
innerSetState(newState);
|
|
2563
|
-
else
|
|
2564
|
-
t.current = setTimeout(() => {
|
|
2565
|
-
innerSetState(newState);
|
|
2566
|
-
}, timeout);
|
|
2567
|
-
},
|
|
2568
|
-
[timeout]
|
|
2569
|
-
);
|
|
2570
|
-
return [state, setState];
|
|
2571
|
-
}
|
|
2572
|
-
|
|
2573
|
-
function ucfirst(word) {
|
|
2574
|
-
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
|
|
2575
|
-
}
|
|
2576
|
-
|
|
2577
|
-
function toBoolean(value) {
|
|
2578
|
-
if (typeof value === "string") {
|
|
2579
|
-
return !["false", ""].includes(value.toLowerCase());
|
|
2580
|
-
}
|
|
2581
|
-
if (Array.isArray(value))
|
|
2582
|
-
return value.length > 0;
|
|
2583
|
-
return !!value;
|
|
2584
|
-
}
|
|
2585
|
-
|
|
2586
|
-
var __async = (__this, __arguments, generator) => {
|
|
2587
|
-
return new Promise((resolve, reject) => {
|
|
2588
|
-
var fulfilled = (value) => {
|
|
2589
|
-
try {
|
|
2590
|
-
step(generator.next(value));
|
|
2591
|
-
} catch (e) {
|
|
2592
|
-
reject(e);
|
|
2593
|
-
}
|
|
2594
|
-
};
|
|
2595
|
-
var rejected = (value) => {
|
|
2596
|
-
try {
|
|
2597
|
-
step(generator.throw(value));
|
|
2598
|
-
} catch (e) {
|
|
2599
|
-
reject(e);
|
|
2600
|
-
}
|
|
2601
|
-
};
|
|
2602
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
2603
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
2604
|
-
});
|
|
2605
|
-
};
|
|
2606
|
-
const processAjaxEventTagNames = (name) => {
|
|
2607
|
-
return name;
|
|
2608
|
-
};
|
|
2609
|
-
const processAjaxEventAttrNames = (name) => {
|
|
2610
|
-
return name;
|
|
2611
|
-
};
|
|
2612
|
-
const processAjaxEventResponse = (value, name) => {
|
|
2613
|
-
if (name === "v" && value === "T")
|
|
2614
|
-
return true;
|
|
2615
|
-
if (name === "v" && value === "F")
|
|
2616
|
-
return false;
|
|
2617
|
-
return value;
|
|
2618
|
-
};
|
|
2619
|
-
const processStringObj = (value, key) => {
|
|
2620
|
-
if (key === "value" && typeof value === "number" && Number.isNaN(value)) {
|
|
2621
|
-
return "";
|
|
2622
|
-
}
|
|
2623
|
-
if (key === "valueType" && typeof value === "string" && value === "null") {
|
|
2624
|
-
return "";
|
|
2625
|
-
}
|
|
2626
|
-
if ((key === "cols" || key === "rows" || key === "x" || key === "y" || key === "length") && typeof value === "string") {
|
|
2627
|
-
return parseNumbers(value);
|
|
2628
|
-
}
|
|
2629
|
-
return value;
|
|
2630
|
-
};
|
|
2631
|
-
const parseXmlAsync = (xml) => __async(void 0, null, function* () {
|
|
2632
|
-
const parser = new xml2js.Parser({
|
|
2633
|
-
trim: true,
|
|
2634
|
-
normalize: true,
|
|
2635
|
-
explicitRoot: false,
|
|
2636
|
-
mergeAttrs: true,
|
|
2637
|
-
explicitArray: false,
|
|
2638
|
-
charkey: "content",
|
|
2639
|
-
attrValueProcessors: [
|
|
2640
|
-
parseBooleans,
|
|
2641
|
-
processStringObj,
|
|
2642
|
-
processAjaxEventResponse
|
|
2643
|
-
],
|
|
2644
|
-
tagNameProcessors: [processAjaxEventTagNames],
|
|
2645
|
-
attrNameProcessors: [processAjaxEventAttrNames]
|
|
2646
|
-
});
|
|
2647
|
-
const result = yield new Promise((resolve, reject) => {
|
|
2648
|
-
parser.parseString(xml, (err, innerResult) => {
|
|
2649
|
-
if (err)
|
|
2650
|
-
reject(err);
|
|
2651
|
-
else {
|
|
2652
|
-
resolve(innerResult);
|
|
2653
|
-
}
|
|
2654
|
-
});
|
|
2655
|
-
});
|
|
2656
|
-
return result;
|
|
2657
|
-
});
|
|
2658
|
-
|
|
2659
|
-
export { BasicStoredElement, EventEmitter, HashedEventEmitter, History, PropsSelectorUndefinedObject, PropsStore, Url, WithEventsValue, addBoundary, animate, apiaDateToStandarFormat, arrayOrArray, autoDisconnectMutationObserver, cantFocusSelector, customEvents, dateToApiaFormat, debugDispatcher, decrypt, disableChildrenFocus, downloadUrl, enableChildrenFocus, enableDebugDispatcher, encrypt, eventEmitterBaseFunction, findOffsetRelativeToScrollParent, findScrollContainer, focus, focusSelector, formatMessage, getDateFormat, getFocusSelector, getIndex, getLabel, getSpecificParent, getValueByPath, globalFocus, isChild, isDebugDispatcherEnabled, isPropsConfigurationObject, makeImperativeComponent, makeSingleImperativeComponent, makeStatefulStore, noNaN, notificationsSelector, parseAsSize, parseXmlAsync, persistentStorage, propsStore, screenLocker, scrollParentIntoElement, setValueByPath, shallowCompareArrays, shallowEqual, shortcutController, toBoolean, ucfirst, useCombinedRefs, useDebouncedCallback, useDebouncedState, useDomState, useImperativeComponentContext, useImperativeComponentEvents, useLatest, useLocalStorage, useMount, usePanAndZoom, usePrevious, usePropsSelector, useShallowMemo, useStateRef, useUnmount, useUpdateEffect };
|
|
1
|
+
export { animate } from './animate/index.js';
|
|
2
|
+
export { decodeHTMLEntities } from './encoding/index.js';
|
|
3
|
+
export { addBoundary, noNaN, parseAsSize } from './number/index.js';
|
|
4
|
+
export { default as arrayOrArray } from './array/arrayOrArray.js';
|
|
5
|
+
export { default as makeImperativeComponent } from './imperative/makeImperativeComponent.js';
|
|
6
|
+
export { default as makeSingleImperativeComponent } from './imperative/makeSingleImperativeComponent.js';
|
|
7
|
+
export { default as useImperativeComponentContext } from './imperative/useImperativeIdentifierContext.js';
|
|
8
|
+
export { getIndex } from './array/getIndex.js';
|
|
9
|
+
export { decrypt } from './crypto/decrypt.js';
|
|
10
|
+
export { encrypt } from './crypto/encrypt.js';
|
|
11
|
+
export { apiaDateToStandarFormat } from './date/apiaDateToStandarFormat.js';
|
|
12
|
+
export { dateToApiaFormat } from './date/dateToApiaFormat.js';
|
|
13
|
+
export { getDateFormat } from './date/getDateFormat.js';
|
|
14
|
+
export { debugDispatcher, isDebugDispatcherEnabled } from './debug/debugDispatcher.js';
|
|
15
|
+
export { shortcutController } from './debug/shortcutController.js';
|
|
16
|
+
export { downloadStringAsDoc } from './documents/downloadStringAsDoc.js';
|
|
17
|
+
export { defaultGetNameFromResponse, downloadUrl } from './documents/downloadUrl.js';
|
|
18
|
+
export { openAndReadFile } from './documents/openAndReadFile.js';
|
|
19
|
+
export { customEvents } from './dom/customEvents.js';
|
|
20
|
+
export { cantFocusSelector, focusSelector, getFocusSelector } from './dom/getFocusSelector.js';
|
|
21
|
+
export { getSpecificParent } from './dom/getSpecificParent.js';
|
|
22
|
+
export { isChild } from './dom/isChild.js';
|
|
23
|
+
export { Url } from './dom/url.js';
|
|
24
|
+
export { disableChildrenFocus, enableChildrenFocus } from './dom/enableChildrenFocus.js';
|
|
25
|
+
export { autoDisconnectMutationObserver } from './dom/autoDisconnectMutationObserver.js';
|
|
26
|
+
export { findOffsetRelativeToScrollParent } from './dom/findOffsetRelativeToScrollParent.js';
|
|
27
|
+
export { findScrollContainer } from './dom/findScrollContainer.js';
|
|
28
|
+
export { scrollParentIntoElement } from './dom/scrollParentIntoElement.js';
|
|
29
|
+
export { usePanAndZoom } from './dom/usePanAndZoom.js';
|
|
30
|
+
export { BouncingEmitter } from './events/BouncingEmitter.js';
|
|
31
|
+
export { EventEmitter } from './events/EventEmitter.js';
|
|
32
|
+
export { StatefulEmitter, isSetter } from './events/StatefulEmitter.js';
|
|
33
|
+
export { focus, notificationsSelector } from './focus/focusController.js';
|
|
34
|
+
export { globalFocus } from './focus/globalFocus.js';
|
|
35
|
+
export { History } from './history/History.js';
|
|
36
|
+
export { useCombinedRefs } from './hooks/useCombinedRefs.js';
|
|
37
|
+
export { useDebouncedCallback } from './hooks/useDebouncedCallback.js';
|
|
38
|
+
export { useLatest } from './hooks/useLatest.js';
|
|
39
|
+
export { useMount } from './hooks/useMount.js';
|
|
40
|
+
export { useUnmount } from './hooks/useUnmount.js';
|
|
41
|
+
export { usePrevious } from './hooks/usePrevious.js';
|
|
42
|
+
export { useStateRef } from './hooks/useStateRef.js';
|
|
43
|
+
export { useSubscription } from './hooks/useSubscription.js';
|
|
44
|
+
export { useUpdateEffect } from './hooks/useUpdateEffect.js';
|
|
45
|
+
export { shallowCompareArrays, shallowEqual, useShallowMemo } from './hooks/useShallowMemo.js';
|
|
46
|
+
export { default as useImperativeComponentEvents } from './imperative/useImperativeComponentEvents.js';
|
|
47
|
+
export { getLabel } from './labels/getLabel.js';
|
|
48
|
+
export { formatMessage } from './labels/formatMessage.js';
|
|
49
|
+
export { getValueByPath } from './objects/getValueByPath.js';
|
|
50
|
+
export { setValueByPath } from './objects/setValueByPath.js';
|
|
51
|
+
export { PropsSelectorUndefinedObject, PropsStore, propsStore } from './propsStore/propsStore.js';
|
|
52
|
+
export { isPropsConfigurationObject, usePropsSelector } from './propsStore/usePropsSelector.js';
|
|
53
|
+
export { useDomState } from './states/useDomState.js';
|
|
54
|
+
export { useDebouncedState } from './states/useDebouncedState.js';
|
|
55
|
+
export { screenLocker } from './screenLock/screenLocker.js';
|
|
56
|
+
export { default as persistentStorage } from './storage/persistentStorage.js';
|
|
57
|
+
export { useLocalStorage } from './storage/useLocalStorage.js';
|
|
58
|
+
export { BasicStoredElement, makeStatefulStore } from './storage/StatefulStore.js';
|
|
59
|
+
export { alignment } from './string/alignment.js';
|
|
60
|
+
export { ucfirst } from './string/ucfirst.js';
|
|
61
|
+
export { toBoolean } from './typeGuards/toBoolean.js';
|
|
62
|
+
export { parseXmlAsync } from './xml/parseXmlAsync.js';
|
|
63
|
+
//# sourceMappingURL=index.js.map
|