@apia/util 4.0.44 → 4.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +46 -73
- package/dist/index.js +8 -86
- package/dist/index.js.map +1 -1
- package/package.json +3 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { SetStateAction, Dispatch, EffectCallback, MutableRefObject, DependencyList, FC, HTMLAttributes
|
|
2
|
+
import React__default, { SetStateAction, Dispatch, EffectCallback, MutableRefObject, DependencyList, FC, HTMLAttributes } from 'react';
|
|
3
3
|
import { AxiosResponse } from 'axios';
|
|
4
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
4
|
|
|
6
5
|
declare function animate(duration: number, callback: (progress: number) => unknown, onFinish?: () => unknown): () => void;
|
|
7
6
|
|
|
@@ -40,7 +39,7 @@ declare function uniqueId(prefix?: string): string;
|
|
|
40
39
|
|
|
41
40
|
declare function apiaDateToStandarFormat(date: string): string;
|
|
42
41
|
|
|
43
|
-
declare function dateToApiaFormat(date: string | Date): string
|
|
42
|
+
declare function dateToApiaFormat(date: string | Date): string;
|
|
44
43
|
|
|
45
44
|
type TDateFormat = 'DD/MM/YYYY' | 'MM/DD/YYYY' | 'YYYY/MM/DD';
|
|
46
45
|
|
|
@@ -51,8 +50,6 @@ declare global {
|
|
|
51
50
|
}
|
|
52
51
|
declare const getDateFormat: (format?: string) => TDateFormat;
|
|
53
52
|
|
|
54
|
-
declare function dateFromApiaFormat(str: string): Date | null;
|
|
55
|
-
|
|
56
53
|
declare global {
|
|
57
54
|
const VERSION: string;
|
|
58
55
|
const COMMITHASH: string;
|
|
@@ -776,18 +773,18 @@ type TApiaFilter = {
|
|
|
776
773
|
isRange?: boolean;
|
|
777
774
|
};
|
|
778
775
|
|
|
779
|
-
interface
|
|
776
|
+
interface TApiaAction {
|
|
780
777
|
toDo?: string;
|
|
781
778
|
param: string | string[];
|
|
782
779
|
}
|
|
783
|
-
interface
|
|
784
|
-
action:
|
|
780
|
+
interface TApiaActions {
|
|
781
|
+
action: TApiaAction | TApiaAction[];
|
|
785
782
|
}
|
|
786
|
-
interface
|
|
783
|
+
interface TApiaMessage {
|
|
787
784
|
text: string;
|
|
788
785
|
label?: string;
|
|
789
786
|
}
|
|
790
|
-
type
|
|
787
|
+
type TApiaComplexCell = {
|
|
791
788
|
label: string;
|
|
792
789
|
classToAdd?: string;
|
|
793
790
|
isHTML?: boolean;
|
|
@@ -795,8 +792,8 @@ type T__LEGACY_SERVER__ApiaComplexCell = {
|
|
|
795
792
|
forceTitle?: string;
|
|
796
793
|
[key: string]: unknown;
|
|
797
794
|
};
|
|
798
|
-
type
|
|
799
|
-
type
|
|
795
|
+
type TApiaCellDefinition = TApiaComplexCell | string;
|
|
796
|
+
type TApiaRowDefinition = {
|
|
800
797
|
'data-selected'?: boolean;
|
|
801
798
|
selected?: boolean;
|
|
802
799
|
dblclic: boolean;
|
|
@@ -809,11 +806,11 @@ type T__LEGACY_SERVER__ApiaRowDefinition = {
|
|
|
809
806
|
docLock?: boolean;
|
|
810
807
|
uneditableTR?: boolean;
|
|
811
808
|
isLocked?: boolean;
|
|
812
|
-
cell:
|
|
809
|
+
cell: TApiaCellDefinition | TApiaCellDefinition[];
|
|
813
810
|
boldType?: boolean;
|
|
814
811
|
'expired-doc': true;
|
|
815
812
|
};
|
|
816
|
-
type
|
|
813
|
+
type TApiaFunctionPageInfo = {
|
|
817
814
|
amount: string;
|
|
818
815
|
currentPage: string;
|
|
819
816
|
hasMore: boolean;
|
|
@@ -825,30 +822,30 @@ type T__LEGACY_SERVER__ApiaFunctionPageInfo = {
|
|
|
825
822
|
orderType: 'desc' | '';
|
|
826
823
|
orderCol: number;
|
|
827
824
|
};
|
|
828
|
-
type
|
|
825
|
+
type TApiaSystemMessageObj<Structure = Record<string, unknown>> = Structure & {
|
|
829
826
|
onClose?: string;
|
|
830
827
|
sysMessages?: {
|
|
831
|
-
message:
|
|
828
|
+
message: TApiaMessage | TApiaMessage[];
|
|
832
829
|
};
|
|
833
830
|
sysExceptions?: {
|
|
834
|
-
exception:
|
|
831
|
+
exception: TApiaMessage | TApiaMessage[];
|
|
835
832
|
};
|
|
836
833
|
exceptions?: {
|
|
837
|
-
exception:
|
|
834
|
+
exception: TApiaMessage | TApiaMessage[];
|
|
838
835
|
};
|
|
839
|
-
actions?:
|
|
836
|
+
actions?: TApiaActions;
|
|
840
837
|
code?: unknown;
|
|
841
838
|
load?: Structure;
|
|
842
839
|
};
|
|
843
|
-
type
|
|
840
|
+
type TApiaTableFunction = {
|
|
844
841
|
result: {
|
|
845
|
-
pageInfo:
|
|
842
|
+
pageInfo: TApiaFunctionPageInfo;
|
|
846
843
|
table?: {
|
|
847
|
-
row:
|
|
844
|
+
row: TApiaRowDefinition | TApiaRowDefinition[];
|
|
848
845
|
};
|
|
849
846
|
};
|
|
850
847
|
};
|
|
851
|
-
type
|
|
848
|
+
type TApiaFunction<T = TApiaTableFunction, HasMessages = true> = HasMessages extends true ? {
|
|
852
849
|
function: {
|
|
853
850
|
dropLastMessage?: boolean;
|
|
854
851
|
name: string;
|
|
@@ -859,7 +856,7 @@ type T__LEGACY_SERVER__ApiaFunction<T = T__LEGACY_SERVER__ApiaTableFunction, Has
|
|
|
859
856
|
name: string;
|
|
860
857
|
} & T;
|
|
861
858
|
};
|
|
862
|
-
type
|
|
859
|
+
type TApiaLoadText = {
|
|
863
860
|
text: {
|
|
864
861
|
closeAll: boolean;
|
|
865
862
|
title: string;
|
|
@@ -867,43 +864,31 @@ type T__LEGACY_SERVER__ApiaLoadText = {
|
|
|
867
864
|
content: string;
|
|
868
865
|
};
|
|
869
866
|
};
|
|
870
|
-
type
|
|
867
|
+
type TApiaLoad<T extends Record<string, unknown> = TApiaLoadForm> = {
|
|
871
868
|
canClose: boolean;
|
|
872
869
|
type: string;
|
|
873
870
|
} & T;
|
|
874
|
-
interface
|
|
871
|
+
interface TMessage {
|
|
875
872
|
text: string;
|
|
876
873
|
content?: string;
|
|
877
874
|
title?: string;
|
|
878
|
-
stack?: string;
|
|
879
875
|
type?: string;
|
|
876
|
+
stack?: string;
|
|
880
877
|
}
|
|
881
|
-
interface
|
|
878
|
+
interface TNotificationMessage {
|
|
882
879
|
onClose?: string;
|
|
883
880
|
sysMessages?: {
|
|
884
|
-
message:
|
|
881
|
+
message: TMessage | TMessage[];
|
|
885
882
|
};
|
|
886
883
|
sysExceptions?: {
|
|
887
|
-
exception:
|
|
884
|
+
exception: TMessage | TMessage[];
|
|
888
885
|
};
|
|
889
886
|
exceptions?: {
|
|
890
|
-
exception:
|
|
887
|
+
exception: TMessage | TMessage[];
|
|
891
888
|
};
|
|
892
|
-
actions?:
|
|
889
|
+
actions?: TApiaActions;
|
|
893
890
|
}
|
|
894
891
|
|
|
895
|
-
type NotificationIcon = string;
|
|
896
|
-
type NotificationType = 'info' | 'error' | 'success' | 'warning';
|
|
897
|
-
type NotificationDefinition = {
|
|
898
|
-
icon?: NotificationIcon;
|
|
899
|
-
id?: string | number;
|
|
900
|
-
isOpen?: boolean;
|
|
901
|
-
message: string;
|
|
902
|
-
stackTrace?: string;
|
|
903
|
-
title?: string;
|
|
904
|
-
type?: NotificationType;
|
|
905
|
-
};
|
|
906
|
-
|
|
907
892
|
type TAttribute = {
|
|
908
893
|
name: string;
|
|
909
894
|
value: string;
|
|
@@ -925,7 +910,6 @@ type TBehavior = TWithAttributes & {
|
|
|
925
910
|
hasDynamicStructure: boolean;
|
|
926
911
|
showAdditionalInfo: boolean;
|
|
927
912
|
};
|
|
928
|
-
type TSortType = 'ASC' | 'DESC' | 'NONE';
|
|
929
913
|
type TColumn = TWithAttributes & TWithStylesModifiers & {
|
|
930
914
|
className: string;
|
|
931
915
|
hideFromAccordion: boolean;
|
|
@@ -935,7 +919,7 @@ type TColumn = TWithAttributes & TWithStylesModifiers & {
|
|
|
935
919
|
name: string;
|
|
936
920
|
showAsAdditional: boolean;
|
|
937
921
|
showInAccordionTitle: boolean;
|
|
938
|
-
sortType:
|
|
922
|
+
sortType: 'ASC' | 'DESC' | 'NONE';
|
|
939
923
|
title: string;
|
|
940
924
|
tooltip: string;
|
|
941
925
|
width: string;
|
|
@@ -1014,6 +998,18 @@ interface IStatesSource {
|
|
|
1014
998
|
isLight: boolean;
|
|
1015
999
|
}
|
|
1016
1000
|
|
|
1001
|
+
type NotificationIcon = string;
|
|
1002
|
+
type NotificationType = 'info' | 'error' | 'success' | 'warning' | 'modal';
|
|
1003
|
+
type NotificationDefinition = {
|
|
1004
|
+
icon?: NotificationIcon;
|
|
1005
|
+
id?: string | number;
|
|
1006
|
+
isOpen?: boolean;
|
|
1007
|
+
message: string;
|
|
1008
|
+
stackTrace?: string;
|
|
1009
|
+
title?: string;
|
|
1010
|
+
type?: NotificationType;
|
|
1011
|
+
};
|
|
1012
|
+
|
|
1017
1013
|
type TId = string | number;
|
|
1018
1014
|
type TModify<T, R> = Omit<T, keyof R> & R;
|
|
1019
1015
|
type TMap$1<T> = Record<string | number, T>;
|
|
@@ -1419,6 +1415,9 @@ interface ILabelsContainer {
|
|
|
1419
1415
|
*
|
|
1420
1416
|
* Permite el pasaje de tokens para el reemplazo automático de los mismos.
|
|
1421
1417
|
*
|
|
1418
|
+
* @param outerWindow - En librerías que puedan trabajar tanto en Browser como en Node es requerido pasar el window como parámetro para evitar que la función vaya directamente al window.
|
|
1419
|
+
*
|
|
1420
|
+
*
|
|
1422
1421
|
* @example
|
|
1423
1422
|
*
|
|
1424
1423
|
* // Suponemos la etiqueta msgUsu = { text: 'Usuario <TOK1>', title: 'Usuario <TOK1>' }
|
|
@@ -2101,31 +2100,5 @@ declare class TasksQueue {
|
|
|
2101
2100
|
run<T>(task: Task<T>): Promise<T | undefined>;
|
|
2102
2101
|
}
|
|
2103
2102
|
|
|
2104
|
-
|
|
2105
|
-
route: string;
|
|
2106
|
-
constructor();
|
|
2107
|
-
set(path: string): void;
|
|
2108
|
-
Context: ({ children }: {
|
|
2109
|
-
children: ReactNode;
|
|
2110
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
2111
|
-
Route: (({ children, path }: {
|
|
2112
|
-
children: ReactNode;
|
|
2113
|
-
path: string;
|
|
2114
|
-
}) => react_jsx_runtime.JSX.Element | null) & {
|
|
2115
|
-
displayName: string;
|
|
2116
|
-
};
|
|
2117
|
-
}
|
|
2118
|
-
|
|
2119
|
-
declare const RouterContext: React.Context<Router | null>;
|
|
2120
|
-
declare const RouteContext: React.Context<{
|
|
2121
|
-
path: string;
|
|
2122
|
-
params: Record<string, string>;
|
|
2123
|
-
} | null>;
|
|
2124
|
-
declare function useRouter(): Router;
|
|
2125
|
-
declare function useRoute(): {
|
|
2126
|
-
path: string;
|
|
2127
|
-
params: Record<string, string>;
|
|
2128
|
-
};
|
|
2129
|
-
|
|
2130
|
-
export { AudioRecorder, type AudioRecorderState, BasicStoredElement, BouncingEmitter, type Callback, ClassNameBuilder, type DebounceOptions, type DeepReadonly, type DownloadStringAsDocProps, EventEmitter, History, type ILabelsContainer, type IOnFocusConfiguration, type IParameter, type ISetBoundary, type IStatesSource, Locker, type Map, Mutex, type NotificationDefinition, type NotificationIcon, type NotificationType, PropsSelectorUndefinedObject, PropsStore, RouteContext, Router, RouterContext, ScrollLocker, Semaphore, StatefulEmitter, type StatefulStoreUpdateProps, type StatefulStoreUpdater, type TActionBehavior, type TActionSource, type TApiaFieldPropsObj, type TApiaFilter, type TApiaFilterOption, type TApiaFilterValue, type TApiaFormButton, type TApiaFormElement, type TApiaFormElementOption, type TApiaLoadForm, type TApiaMultiplePossibleValue, type TApiaPossibleValue, type TApiaRadioPossibleValue, type TApiaSelectPossibleValue, type TAttribute, type TBasicAction, type TBehavior, type TCallback, type TCell, type TColumn, type TDateFormat, type TDispatchCallback, type TDownloadUrlOptions, type TFieldEvent, type TFieldScriptEvent, type TFieldScriptEvents, type TFieldServerEvent, type TFieldServerEvents, type TFilter, type TFncParams, type TFocusRetriever, type THistoryCount, type THistoryStep, type THistoryStepChange, type TId, type TKey, type TLoadStructure, type TMap$1 as TMap, type TModify, type TOption, type TPropsComparator, type TPropsConfiguration, type TPropsSelector, type TRefresh, type TRequireOnlyOne, type TRow, type TShortcutBranch, type TSortType, type TState, type TStateIcon, type TUpdateFieldConfiguration, type TWithAlignment, type TWithAttributes, type TWithOptions, type TWithStylesModifiers, type T__LEGACY_SERVER__ApiaAction, type T__LEGACY_SERVER__ApiaActions, type T__LEGACY_SERVER__ApiaCellDefinition, type T__LEGACY_SERVER__ApiaComplexCell, type T__LEGACY_SERVER__ApiaFunction, type T__LEGACY_SERVER__ApiaFunctionPageInfo, type T__LEGACY_SERVER__ApiaLoad, type T__LEGACY_SERVER__ApiaLoadText, type T__LEGACY_SERVER__ApiaMessage, type T__LEGACY_SERVER__ApiaRowDefinition, type T__LEGACY_SERVER__ApiaSystemMessageObj, type T__LEGACY_SERVER__ApiaTableFunction, type T__LEGACY_SERVER__Message, type T__LEGACY_SERVER__MessagesPayload, type Task, TasksQueue, type ThrottleOptions, type UnSubscriber, Url, addBoundary, alignment, animate, apiaDateToStandarFormat, arrayOrArray, autoDisconnectMutationObserver, awaitTime, cantFocusSelector, cloneDeep, customEvents, dateFromApiaFormat, dateToApiaFormat, debugDispatcher, decodeBase64ToUtf8, decodeHTMLEntities, decrypt, deepEqual, defaultGetNameFromResponse, disableChildrenFocus, downloadStringAsDoc, downloadUrl, enableChildrenFocus, encodeStrToBase64Utf8, encrypt, findOffsetRelativeToScrollParent, findScrollContainer, focus, focusSelector, formatMessage, freezeDeep, getDateFormat, getFocusSelector, getIndex, getJSObjFromXML, getLabel, getSpecificParent, getValueByPath, globalFocus, globals, isChild, isDebugDispatcherEnabled, isFocusable, isPropsConfigurationObject, isSetter, isTrue, makeImperativeComponent, makeSingleImperativeComponent, makeStatefulStore, noNaN, notificationsSelector, openAndReadFile, openAndReadFiles, parseAsSize, parseXMLRequestResponse, parseXmlAsync, persistentStorage, postNavigation, propsStore, screenLocker, scrollParentIntoElement, setValueByPath, shallowCompareArrays, shallowEqual, shortcutController, toBoolean, ucfirst, uniqueId, useCombinedRefs, useDebouncedCallback, useDebouncedState, useDomState, useImperativeComponentContext, useImperativeComponentEvents, useIntermediateValue, useLatest, useLocalStorage, useMatchScrollDirection, useMount, useMountTransition, usePanAndZoom, usePrevious, usePropsSelector, useRoute, useRouter, useShallowMemo, useStateRef, useSubscription, useUnmount, useUpdateEffect, useWhyUpdated };
|
|
2103
|
+
export { AudioRecorder, type AudioRecorderState, BasicStoredElement, BouncingEmitter, type Callback, ClassNameBuilder, type DebounceOptions, type DeepReadonly, type DownloadStringAsDocProps, EventEmitter, History, type ILabelsContainer, type IOnFocusConfiguration, type IParameter, type ISetBoundary, type IStatesSource, Locker, type Map, Mutex, type NotificationDefinition, type NotificationIcon, type NotificationType, PropsSelectorUndefinedObject, PropsStore, ScrollLocker, Semaphore, StatefulEmitter, type StatefulStoreUpdateProps, type StatefulStoreUpdater, type TActionBehavior, type TActionSource, type TApiaAction, type TApiaActions, type TApiaCellDefinition, type TApiaComplexCell, type TApiaFieldPropsObj, type TApiaFilter, type TApiaFilterOption, type TApiaFilterValue, type TApiaFormButton, type TApiaFormElement, type TApiaFormElementOption, type TApiaFunction, type TApiaFunctionPageInfo, type TApiaLoad, type TApiaLoadForm, type TApiaLoadText, type TApiaMessage, type TApiaMultiplePossibleValue, type TApiaPossibleValue, type TApiaRadioPossibleValue, type TApiaRowDefinition, type TApiaSelectPossibleValue, type TApiaSystemMessageObj, type TApiaTableFunction, type TAttribute, type TBasicAction, type TBehavior, type TCallback, type TCell, type TColumn, type TDateFormat, type TDispatchCallback, type TDownloadUrlOptions, type TFieldEvent, type TFieldScriptEvent, type TFieldScriptEvents, type TFieldServerEvent, type TFieldServerEvents, type TFilter, type TFncParams, type TFocusRetriever, type THistoryCount, type THistoryStep, type THistoryStepChange, type TId, type TKey, type TLoadStructure, type TMap$1 as TMap, type TMessage, type TModify, type TNotificationMessage, type TOption, type TPropsComparator, type TPropsConfiguration, type TPropsSelector, type TRefresh, type TRequireOnlyOne, type TRow, type TShortcutBranch, type TState, type TStateIcon, type TUpdateFieldConfiguration, type TWithAlignment, type TWithAttributes, type TWithOptions, type TWithStylesModifiers, type Task, TasksQueue, type ThrottleOptions, type UnSubscriber, Url, addBoundary, alignment, animate, apiaDateToStandarFormat, arrayOrArray, autoDisconnectMutationObserver, awaitTime, cantFocusSelector, cloneDeep, customEvents, dateToApiaFormat, debugDispatcher, decodeBase64ToUtf8, decodeHTMLEntities, decrypt, deepEqual, defaultGetNameFromResponse, disableChildrenFocus, downloadStringAsDoc, downloadUrl, enableChildrenFocus, encodeStrToBase64Utf8, encrypt, findOffsetRelativeToScrollParent, findScrollContainer, focus, focusSelector, formatMessage, freezeDeep, getDateFormat, getFocusSelector, getIndex, getJSObjFromXML, getLabel, getSpecificParent, getValueByPath, globalFocus, globals, isChild, isDebugDispatcherEnabled, isFocusable, isPropsConfigurationObject, isSetter, isTrue, makeImperativeComponent, makeSingleImperativeComponent, makeStatefulStore, noNaN, notificationsSelector, openAndReadFile, openAndReadFiles, parseAsSize, parseXMLRequestResponse, parseXmlAsync, persistentStorage, postNavigation, propsStore, screenLocker, scrollParentIntoElement, setValueByPath, shallowCompareArrays, shallowEqual, shortcutController, toBoolean, ucfirst, uniqueId, useCombinedRefs, useDebouncedCallback, useDebouncedState, useDomState, useImperativeComponentContext, useImperativeComponentEvents, useIntermediateValue, useLatest, useLocalStorage, useMatchScrollDirection, useMount, useMountTransition, usePanAndZoom, usePrevious, usePropsSelector, useShallowMemo, useStateRef, useSubscription, useUnmount, useUpdateEffect, useWhyUpdated };
|
|
2131
2104
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,6 @@ import clone from 'lodash-es/clone';
|
|
|
12
12
|
import cloneDeep$1 from 'lodash-es/cloneDeep';
|
|
13
13
|
import xml2js from 'xml2js';
|
|
14
14
|
import { parseBooleans, parseNumbers } from 'xml2js/lib/processors';
|
|
15
|
-
import { observer } from 'mobx-react-lite';
|
|
16
15
|
|
|
17
16
|
function getWindow() {
|
|
18
17
|
return globalThis;
|
|
@@ -233,18 +232,7 @@ function apiaDateToStandarFormat(date) {
|
|
|
233
232
|
}
|
|
234
233
|
|
|
235
234
|
function dateToApiaFormat(date) {
|
|
236
|
-
|
|
237
|
-
if (!parsed.isValid()) {
|
|
238
|
-
return void 0;
|
|
239
|
-
}
|
|
240
|
-
return parsed.format(getDateFormat());
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
function dateFromApiaFormat(str) {
|
|
244
|
-
const newDate = dayjs(str, getDateFormat());
|
|
245
|
-
if (!newDate.isValid())
|
|
246
|
-
return null;
|
|
247
|
-
return newDate.toDate();
|
|
235
|
+
return dayjs(date).format(getDateFormat());
|
|
248
236
|
}
|
|
249
237
|
|
|
250
238
|
const globals = {
|
|
@@ -877,7 +865,7 @@ const focusSelector = [
|
|
|
877
865
|
"[tabIndex]",
|
|
878
866
|
'[role="button"]'
|
|
879
867
|
].map((current) => `${current}${cantFocusSelector}`).join(",");
|
|
880
|
-
function getFocusSelector(not
|
|
868
|
+
function getFocusSelector(not) {
|
|
881
869
|
return `input${not ?? ""},
|
|
882
870
|
textarea${not ?? ""},
|
|
883
871
|
select${not ?? ""},
|
|
@@ -2556,26 +2544,16 @@ function setValueByPath(obj, path, value) {
|
|
|
2556
2544
|
const originalClonedObject = clone(obj ?? {});
|
|
2557
2545
|
let currentObj = originalClonedObject;
|
|
2558
2546
|
for (let i = 0; i < steps.length - 1; i++) {
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
if (
|
|
2562
|
-
|
|
2563
|
-
const index = Number.parseInt(match[2]);
|
|
2564
|
-
if (!currentObj[varName])
|
|
2565
|
-
currentObj[varName] = [];
|
|
2566
|
-
currentObj = currentObj[varName];
|
|
2567
|
-
key = index;
|
|
2568
|
-
}
|
|
2569
|
-
if (!currentObj[key])
|
|
2570
|
-
currentObj[key] = {};
|
|
2571
|
-
if (typeof currentObj[key] === "object") {
|
|
2572
|
-
currentObj = currentObj[key];
|
|
2547
|
+
if (!currentObj[steps[i]])
|
|
2548
|
+
currentObj[steps[i]] = {};
|
|
2549
|
+
if (typeof currentObj[steps[i]] === "object") {
|
|
2550
|
+
currentObj = currentObj[steps[i]];
|
|
2573
2551
|
} else {
|
|
2574
2552
|
console.info({
|
|
2575
2553
|
originalObject: obj,
|
|
2576
2554
|
originalPath: path,
|
|
2577
2555
|
currentObj,
|
|
2578
|
-
currentStep:
|
|
2556
|
+
currentStep: steps[i]
|
|
2579
2557
|
});
|
|
2580
2558
|
throw new Error(
|
|
2581
2559
|
`The provided path ${path} cannot be applied due to it is not an object's path.`
|
|
@@ -3103,61 +3081,5 @@ const postNavigation = (url, data) => {
|
|
|
3103
3081
|
form.submit();
|
|
3104
3082
|
};
|
|
3105
3083
|
|
|
3106
|
-
|
|
3107
|
-
const RouteContext = createContext(null);
|
|
3108
|
-
function useRouter() {
|
|
3109
|
-
return useContext(RouterContext);
|
|
3110
|
-
}
|
|
3111
|
-
function useRoute() {
|
|
3112
|
-
return useContext(RouteContext);
|
|
3113
|
-
}
|
|
3114
|
-
|
|
3115
|
-
function parseRoute(route, path) {
|
|
3116
|
-
const keys = [];
|
|
3117
|
-
const escaped = route.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
|
|
3118
|
-
const pattern = escaped.replace(/\\:([a-zA-Z0-9_]+)/g, (_, key) => {
|
|
3119
|
-
keys.push(key);
|
|
3120
|
-
return "([^/]+)";
|
|
3121
|
-
});
|
|
3122
|
-
const regex = new RegExp(`^${pattern}\\/?$`);
|
|
3123
|
-
const match = path.match(regex);
|
|
3124
|
-
if (!match)
|
|
3125
|
-
return null;
|
|
3126
|
-
const result = {};
|
|
3127
|
-
keys.forEach((key, i) => {
|
|
3128
|
-
result[key] = decodeURIComponent(match[i + 1]);
|
|
3129
|
-
});
|
|
3130
|
-
return result;
|
|
3131
|
-
}
|
|
3132
|
-
|
|
3133
|
-
class Router {
|
|
3134
|
-
constructor() {
|
|
3135
|
-
this.route = "";
|
|
3136
|
-
this.Context = ({ children }) => /* @__PURE__ */ jsx(RouterContext.Provider, { value: this, children });
|
|
3137
|
-
this.Route = observer(
|
|
3138
|
-
({ children, path }) => {
|
|
3139
|
-
const res = parseRoute(path, this.route);
|
|
3140
|
-
if (!res) {
|
|
3141
|
-
return null;
|
|
3142
|
-
}
|
|
3143
|
-
return /* @__PURE__ */ jsx(
|
|
3144
|
-
RouteContext.Provider,
|
|
3145
|
-
{
|
|
3146
|
-
value: {
|
|
3147
|
-
params: res,
|
|
3148
|
-
path
|
|
3149
|
-
},
|
|
3150
|
-
children
|
|
3151
|
-
}
|
|
3152
|
-
);
|
|
3153
|
-
}
|
|
3154
|
-
);
|
|
3155
|
-
makeAutoObservable(this);
|
|
3156
|
-
}
|
|
3157
|
-
set(path) {
|
|
3158
|
-
this.route = path;
|
|
3159
|
-
}
|
|
3160
|
-
}
|
|
3161
|
-
|
|
3162
|
-
export { AudioRecorder, BasicStoredElement, BouncingEmitter, ClassNameBuilder, EventEmitter, History, Locker, Mutex, PropsSelectorUndefinedObject, PropsStore, RouteContext, Router, RouterContext, ScrollLocker, Semaphore, StatefulEmitter, TasksQueue, Url, addBoundary, alignment, animate, apiaDateToStandarFormat, arrayOrArray, autoDisconnectMutationObserver, awaitTime, cantFocusSelector, cloneDeep, customEvents, dateFromApiaFormat, dateToApiaFormat, debugDispatcher, decodeBase64ToUtf8, decodeHTMLEntities, decrypt, deepEqual, defaultGetNameFromResponse, disableChildrenFocus, downloadStringAsDoc, downloadUrl, enableChildrenFocus, encodeStrToBase64Utf8, encrypt, findOffsetRelativeToScrollParent, findScrollContainer, focus, focusSelector, formatMessage, freezeDeep, getDateFormat, getFocusSelector, getIndex, getJSObjFromXML, getLabel, getSpecificParent, getValueByPath, globalFocus, globals, isChild, isDebugDispatcherEnabled, isFocusable, isPropsConfigurationObject, isSetter, isTrue, makeImperativeComponent, makeSingleImperativeComponent, makeStatefulStore, noNaN, notificationsSelector, openAndReadFile, openAndReadFiles, parseAsSize, parseXMLRequestResponse, parseXmlAsync, persistentStorage, postNavigation, propsStore, screenLocker, scrollParentIntoElement, setValueByPath, shallowCompareArrays, shallowEqual, shortcutController, toBoolean, ucfirst, uniqueId, useCombinedRefs, useDebouncedCallback, useDebouncedState, useDomState, useImperativeComponentContext, useImperativeComponentEvents, useIntermediateValue, useLatest, useLocalStorage, useMatchScrollDirection, useMount, useMountTransition, usePanAndZoom, usePrevious, usePropsSelector, useRoute, useRouter, useShallowMemo, useStateRef, useSubscription, useUnmount, useUpdateEffect, useWhyUpdated };
|
|
3084
|
+
export { AudioRecorder, BasicStoredElement, BouncingEmitter, ClassNameBuilder, EventEmitter, History, Locker, Mutex, PropsSelectorUndefinedObject, PropsStore, ScrollLocker, Semaphore, StatefulEmitter, TasksQueue, Url, addBoundary, alignment, animate, apiaDateToStandarFormat, arrayOrArray, autoDisconnectMutationObserver, awaitTime, cantFocusSelector, cloneDeep, customEvents, dateToApiaFormat, debugDispatcher, decodeBase64ToUtf8, decodeHTMLEntities, decrypt, deepEqual, defaultGetNameFromResponse, disableChildrenFocus, downloadStringAsDoc, downloadUrl, enableChildrenFocus, encodeStrToBase64Utf8, encrypt, findOffsetRelativeToScrollParent, findScrollContainer, focus, focusSelector, formatMessage, freezeDeep, getDateFormat, getFocusSelector, getIndex, getJSObjFromXML, getLabel, getSpecificParent, getValueByPath, globalFocus, globals, isChild, isDebugDispatcherEnabled, isFocusable, isPropsConfigurationObject, isSetter, isTrue, makeImperativeComponent, makeSingleImperativeComponent, makeStatefulStore, noNaN, notificationsSelector, openAndReadFile, openAndReadFiles, parseAsSize, parseXMLRequestResponse, parseXmlAsync, persistentStorage, postNavigation, propsStore, screenLocker, scrollParentIntoElement, setValueByPath, shallowCompareArrays, shallowEqual, shortcutController, toBoolean, ucfirst, uniqueId, useCombinedRefs, useDebouncedCallback, useDebouncedState, useDomState, useImperativeComponentContext, useImperativeComponentEvents, useIntermediateValue, useLatest, useLocalStorage, useMatchScrollDirection, useMount, useMountTransition, usePanAndZoom, usePrevious, usePropsSelector, useShallowMemo, useStateRef, useSubscription, useUnmount, useUpdateEffect, useWhyUpdated };
|
|
3163
3085
|
//# sourceMappingURL=index.js.map
|