@apia/util 4.0.44 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -893,7 +893,7 @@ interface T__LEGACY_SERVER__MessagesPayload {
893
893
  }
894
894
 
895
895
  type NotificationIcon = string;
896
- type NotificationType = 'info' | 'error' | 'success' | 'warning';
896
+ type NotificationType = 'info' | 'error' | 'success' | 'warning' | 'modal';
897
897
  type NotificationDefinition = {
898
898
  icon?: NotificationIcon;
899
899
  id?: string | number;
@@ -1419,6 +1419,9 @@ interface ILabelsContainer {
1419
1419
  *
1420
1420
  * Permite el pasaje de tokens para el reemplazo automático de los mismos.
1421
1421
  *
1422
+ * @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.
1423
+ *
1424
+ *
1422
1425
  * @example
1423
1426
  *
1424
1427
  * // Suponemos la etiqueta msgUsu = { text: 'Usuario <TOK1>', title: 'Usuario <TOK1>' }
@@ -1543,6 +1546,11 @@ type DeepReadonly<T> = Readonly<T extends object ? {
1543
1546
  } : T>;
1544
1547
  declare function freezeDeep<T>(o: T): DeepReadonly<T>;
1545
1548
 
1549
+ /**
1550
+ * Given the objects `src` and `target`, copies and overrides all properties from src to target.
1551
+ */
1552
+ declare function mergeDeep(src: any, target: any): void;
1553
+
1546
1554
  type TProperties = Record<string, unknown>;
1547
1555
  type TPropsSuscriptor<PropsType extends Record<string, unknown> = TProperties> = (props: PropsType, urgent?: boolean) => unknown;
1548
1556
  type TPropsSelector<Selected = any, PropsType = TProperties> = (props: PropsType) => Selected;
@@ -2127,5 +2135,5 @@ declare function useRoute(): {
2127
2135
  params: Record<string, string>;
2128
2136
  };
2129
2137
 
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 };
2138
+ 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, mergeDeep, 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 };
2131
2139
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -2620,6 +2620,39 @@ function freezeDeep(o) {
2620
2620
  return typeof o === "object" && o ? Object.freeze(o) : o;
2621
2621
  }
2622
2622
 
2623
+ function isMergeable(el) {
2624
+ return typeof el === "object" && el !== null;
2625
+ }
2626
+ function mergeDeep(src, target) {
2627
+ if (!isMergeable(src) || !isMergeable(target)) {
2628
+ throw new Error("src and target parameters must be objects");
2629
+ }
2630
+ for (const key of Object.keys(src)) {
2631
+ if (isMergeable(src[key])) {
2632
+ if (!isMergeable(target[key])) {
2633
+ target[key] = {};
2634
+ }
2635
+ mergeDeep(src[key], target[key]);
2636
+ } else if (Array.isArray(src[key])) {
2637
+ if (!Array.isArray(target[key])) {
2638
+ target[key] = [];
2639
+ }
2640
+ for (let i = 0; i < src[key].length; i++) {
2641
+ if (isMergeable(src[key][i])) {
2642
+ if (!isMergeable(target[key][i])) {
2643
+ target[key][i] = {};
2644
+ }
2645
+ mergeDeep(src[key][i], target[key][i]);
2646
+ } else {
2647
+ target[key][i] = src[key][i];
2648
+ }
2649
+ }
2650
+ } else {
2651
+ target[key] = src[key];
2652
+ }
2653
+ }
2654
+ }
2655
+
2623
2656
  const propsLog = "propsLog";
2624
2657
  const PropsSelectorUndefinedObject = {};
2625
2658
  class PropsStore {
@@ -3159,5 +3192,5 @@ class Router {
3159
3192
  }
3160
3193
  }
3161
3194
 
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 };
3195
+ 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, mergeDeep, 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 };
3163
3196
  //# sourceMappingURL=index.js.map