@apia/util 4.0.44 → 4.0.45
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 +29 -81
- package/dist/index.js +10 -88
- 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,29 @@ 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;
|
|
880
876
|
}
|
|
881
|
-
interface
|
|
877
|
+
interface TNotificationMessage {
|
|
882
878
|
onClose?: string;
|
|
883
879
|
sysMessages?: {
|
|
884
|
-
message:
|
|
880
|
+
message: TMessage | TMessage[];
|
|
885
881
|
};
|
|
886
882
|
sysExceptions?: {
|
|
887
|
-
exception:
|
|
883
|
+
exception: TMessage | TMessage[];
|
|
888
884
|
};
|
|
889
885
|
exceptions?: {
|
|
890
|
-
exception:
|
|
886
|
+
exception: TMessage | TMessage[];
|
|
891
887
|
};
|
|
892
|
-
actions?: T__LEGACY_SERVER__ApiaActions;
|
|
893
888
|
}
|
|
894
889
|
|
|
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
890
|
type TAttribute = {
|
|
908
891
|
name: string;
|
|
909
892
|
value: string;
|
|
@@ -925,7 +908,6 @@ type TBehavior = TWithAttributes & {
|
|
|
925
908
|
hasDynamicStructure: boolean;
|
|
926
909
|
showAdditionalInfo: boolean;
|
|
927
910
|
};
|
|
928
|
-
type TSortType = 'ASC' | 'DESC' | 'NONE';
|
|
929
911
|
type TColumn = TWithAttributes & TWithStylesModifiers & {
|
|
930
912
|
className: string;
|
|
931
913
|
hideFromAccordion: boolean;
|
|
@@ -935,7 +917,7 @@ type TColumn = TWithAttributes & TWithStylesModifiers & {
|
|
|
935
917
|
name: string;
|
|
936
918
|
showAsAdditional: boolean;
|
|
937
919
|
showInAccordionTitle: boolean;
|
|
938
|
-
sortType:
|
|
920
|
+
sortType: 'ASC' | 'DESC' | 'NONE';
|
|
939
921
|
title: string;
|
|
940
922
|
tooltip: string;
|
|
941
923
|
width: string;
|
|
@@ -1400,14 +1382,6 @@ declare function useImperativeComponentContext<Events extends TMap = TMap>(): {
|
|
|
1400
1382
|
eventsStore: TEventsHandlers<Events>;
|
|
1401
1383
|
};
|
|
1402
1384
|
|
|
1403
|
-
interface ILabelsContainer {
|
|
1404
|
-
labels: {
|
|
1405
|
-
[key: string]: {
|
|
1406
|
-
text: string;
|
|
1407
|
-
title: string;
|
|
1408
|
-
};
|
|
1409
|
-
};
|
|
1410
|
-
}
|
|
1411
1385
|
/**
|
|
1412
1386
|
* Dado un nombre de etiqueta, devuelve el texto que esa etiqueta contiene en
|
|
1413
1387
|
* el idioma actual. En este momento, lo único que hace realmente esta función
|
|
@@ -2101,31 +2075,5 @@ declare class TasksQueue {
|
|
|
2101
2075
|
run<T>(task: Task<T>): Promise<T | undefined>;
|
|
2102
2076
|
}
|
|
2103
2077
|
|
|
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 };
|
|
2078
|
+
export { AudioRecorder, type AudioRecorderState, BasicStoredElement, BouncingEmitter, type Callback, ClassNameBuilder, type DebounceOptions, type DeepReadonly, type DownloadStringAsDocProps, EventEmitter, History, type IOnFocusConfiguration, type IParameter, type ISetBoundary, type IStatesSource, Locker, type Map, Mutex, 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
2079
|
//# 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 ?? ""},
|
|
@@ -2517,8 +2505,8 @@ function getLabel(name, replaceTokens, outerWindow) {
|
|
|
2517
2505
|
const actualWindow = outerWindow ?? window;
|
|
2518
2506
|
const label = {
|
|
2519
2507
|
...actualWindow.labels[name] ?? {
|
|
2520
|
-
text:
|
|
2521
|
-
title:
|
|
2508
|
+
text: `Not preloaded: ${name}`,
|
|
2509
|
+
title: `Not preloaded: ${name}`
|
|
2522
2510
|
}
|
|
2523
2511
|
};
|
|
2524
2512
|
if (replaceTokens?.text !== void 0)
|
|
@@ -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
|