@telia-ace/widget-utilities 1.0.3 → 1.0.5-next.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/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
- Copyright © 2021, Telia Company AB. All rights reserved.
2
-
3
- THIS PACKAGE AND CONTAINING SOFTWARE IS PART OF
4
- THE HUMANY SERVICE. BY USING THIS SOFTWARE YOU
5
- AGREE TO THE FOLLOWING TERMS AND CONDITIONS:
1
+ Copyright © 2021, Telia Company AB. All rights reserved.
2
+
3
+ THIS PACKAGE AND CONTAINING SOFTWARE IS PART OF
4
+ THE HUMANY SERVICE. BY USING THIS SOFTWARE YOU
5
+ AGREE TO THE FOLLOWING TERMS AND CONDITIONS:
6
6
  http://www.humany.com/legal
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # `@telia-ace/widget-utilities`
2
-
3
- Utilities used internally by ACE Widget packages.
1
+ # `@telia-ace/widget-utilities`
2
+
3
+ Utilities used internally by ACE Widget packages.
@@ -1,6 +1,6 @@
1
- declare type ArgumentHandler = string | [boolean, string | string[]] | undefined;
2
- export declare function uniqueClassArray(classNames: string[]): string[];
3
- export declare function append(className1?: string, className2?: string): string;
4
- export declare function handleFunctionArgument(expression: boolean, classes: string | string[]): string | undefined;
5
- export default function appendClassNames(...args: ArgumentHandler[]): string;
6
- export {};
1
+ declare type ArgumentHandler = string | [boolean, string | string[]] | undefined;
2
+ export declare function uniqueClassArray(classNames: string[]): string[];
3
+ export declare function append(className1?: string, className2?: string): string;
4
+ export declare function handleFunctionArgument(expression: boolean, classes: string | string[]): string | undefined;
5
+ export default function appendClassNames(...args: ArgumentHandler[]): string;
6
+ export {};
package/dist/batch.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare type BatchFunction<T> = (acc: T) => T;
2
- export declare type Batch<T> = (fn: BatchFunction<T>) => Promise<T>;
3
- declare const createBatch: <T>(delay: number, createFallback: () => T) => Batch<T>;
4
- export default createBatch;
1
+ export declare type BatchFunction<T> = (acc: T) => T;
2
+ export declare type Batch<T> = (fn: BatchFunction<T>) => Promise<T>;
3
+ declare const createBatch: <T>(delay: number, createFallback: () => T) => Batch<T>;
4
+ export default createBatch;
@@ -1 +1 @@
1
- export default function camilize(obj: any): any;
1
+ export default function camilize(obj: any): any;
@@ -1,14 +1,14 @@
1
- import { Container } from '@webprovisions/platform';
2
- declare type Item = {
3
- id: string;
4
- items?: Item[];
5
- title: string;
6
- symbol?: any;
7
- };
8
- declare type ChildParentStructure = {
9
- [key: number]: string;
10
- };
11
- export declare function categoryTrail(id: string, items: Item[], ids?: string[], structure?: ChildParentStructure): string[];
12
- export declare const getCategoryTrailAsObjects: (trail: string[], categories: Item[]) => Map<string, Item>;
13
- export declare const buildCategoryTrail: (routeName: string, categoryIds: string | string[], container: Container, dataType?: 'guide-categories' | 'contact-method-categories') => Promise<any[]>;
14
- export {};
1
+ import { Container } from '@webprovisions/platform';
2
+ declare type Item = {
3
+ id: string;
4
+ items?: Item[];
5
+ title: string;
6
+ symbol?: any;
7
+ };
8
+ declare type ChildParentStructure = {
9
+ [key: number]: string;
10
+ };
11
+ export declare function categoryTrail(id: string, items: Item[], ids?: string[], structure?: ChildParentStructure): string[];
12
+ export declare const getCategoryTrailAsObjects: (trail: string[], categories: Item[]) => Map<string, Item>;
13
+ export declare const buildCategoryTrail: (routeName: string, categoryIds: string | string[], container: Container, dataType?: 'guide-categories' | 'contact-method-categories') => Promise<any[]>;
14
+ export {};
@@ -1,21 +1,21 @@
1
- export declare type Input = {
2
- phrase?: string;
3
- category?: ParamValue;
4
- guideCategory?: ParamValue;
5
- contactCategory?: ParamValue;
6
- take?: number;
7
- connectionKey?: string;
8
- id?: string;
9
- uriName?: string;
10
- sorting?: string;
11
- tag?: string;
12
- tagId?: string | number;
13
- tagTitle?: string;
14
- } & {
15
- [key: string]: ParamValue;
16
- };
17
- export declare type ParamValue = string | number | any;
18
- export declare type Params = {
19
- [key: string]: ParamValue;
20
- };
21
- export default function createParams(args?: Input): Params;
1
+ export declare type Input = {
2
+ phrase?: string;
3
+ category?: ParamValue;
4
+ guideCategory?: ParamValue;
5
+ contactCategory?: ParamValue;
6
+ take?: number;
7
+ connectionKey?: string;
8
+ id?: string;
9
+ uriName?: string;
10
+ sorting?: string;
11
+ tag?: string;
12
+ tagId?: string | number;
13
+ tagTitle?: string;
14
+ } & {
15
+ [key: string]: ParamValue;
16
+ };
17
+ export declare type ParamValue = string | number | any;
18
+ export declare type Params = {
19
+ [key: string]: ParamValue;
20
+ };
21
+ export default function createParams(args?: Input): Params;
@@ -1,2 +1,2 @@
1
- declare const dataURItoBlob: (dataURI: string) => Blob;
2
- export default dataURItoBlob;
1
+ declare const dataURItoBlob: (dataURI: string) => Blob;
2
+ export default dataURItoBlob;
package/dist/debug.d.ts CHANGED
@@ -1,52 +1,52 @@
1
- /**
2
- * Checks if process.env.NODE_ENV === 'production'
3
- * and passes arguments to console.warn().
4
- */
5
- export declare function debugLog(...args: any[]): false | void;
6
- /**
7
- * Simple internal log-handler
8
- */
9
- export declare class Logger {
10
- private keys;
11
- private lookup;
12
- /**
13
- * Passes args to console.log
14
- */
15
- static log: (...args: any[]) => void;
16
- /**
17
- * Passes args to console.warn
18
- */
19
- static warn: (...args: any[]) => void;
20
- /**
21
- * Passes args to console.error
22
- */
23
- static error: (...args: any[]) => void;
24
- /**
25
- * Passes args to console.info
26
- */
27
- static info: (...args: any[]) => void;
28
- /**
29
- * Checks if key already has been logged.
30
- * If not, passes following args to console.log
31
- * and stores key in logged messages.
32
- */
33
- log: (key: string, ...args: any[]) => void;
34
- /**
35
- * Checks if key already has been logged.
36
- * If not, passes following args to console.warn
37
- * and stores key in logged messages.
38
- */
39
- warn: (key: string, ...args: any[]) => void;
40
- /**
41
- * Checks if key already has been logged.
42
- * If not, passes following args to console.error
43
- * and stores key in logged messages.
44
- */
45
- error: (key: string, ...args: any[]) => void;
46
- /**
47
- * Checks if key already has been logged.
48
- * If not, passes following args to console.info
49
- * and stores key in logged messages.
50
- */
51
- info: (key: string, ...args: any[]) => void;
52
- }
1
+ /**
2
+ * Checks if process.env.NODE_ENV === 'production'
3
+ * and passes arguments to console.warn().
4
+ */
5
+ export declare function debugLog(...args: any[]): false | void;
6
+ /**
7
+ * Simple internal log-handler
8
+ */
9
+ export declare class Logger {
10
+ private keys;
11
+ private lookup;
12
+ /**
13
+ * Passes args to console.log
14
+ */
15
+ static log: (...args: any[]) => void;
16
+ /**
17
+ * Passes args to console.warn
18
+ */
19
+ static warn: (...args: any[]) => void;
20
+ /**
21
+ * Passes args to console.error
22
+ */
23
+ static error: (...args: any[]) => void;
24
+ /**
25
+ * Passes args to console.info
26
+ */
27
+ static info: (...args: any[]) => void;
28
+ /**
29
+ * Checks if key already has been logged.
30
+ * If not, passes following args to console.log
31
+ * and stores key in logged messages.
32
+ */
33
+ log: (key: string, ...args: any[]) => void;
34
+ /**
35
+ * Checks if key already has been logged.
36
+ * If not, passes following args to console.warn
37
+ * and stores key in logged messages.
38
+ */
39
+ warn: (key: string, ...args: any[]) => void;
40
+ /**
41
+ * Checks if key already has been logged.
42
+ * If not, passes following args to console.error
43
+ * and stores key in logged messages.
44
+ */
45
+ error: (key: string, ...args: any[]) => void;
46
+ /**
47
+ * Checks if key already has been logged.
48
+ * If not, passes following args to console.info
49
+ * and stores key in logged messages.
50
+ */
51
+ info: (key: string, ...args: any[]) => void;
52
+ }
@@ -1,2 +1,2 @@
1
- declare const deepClone: <Type>(data: Type) => Type;
2
- export default deepClone;
1
+ declare const deepClone: <Type>(data: Type) => Type;
2
+ export default deepClone;
@@ -1,9 +1,9 @@
1
- declare const _default: (implementation: any) => null | undefined;
2
- /**
3
- * Looks for stored widgets on the implementation in localStorage
4
- * and adds a trigger link to the DOM.
5
- *
6
- * TODO: A more robust version have been discussed, where the storageService is added to the
7
- * implementation instead of the widget.
8
- */
9
- export default _default;
1
+ /**
2
+ * Looks for stored widgets on the implementation in localStorage
3
+ * and adds a trigger link to the DOM.
4
+ *
5
+ * TODO: A more robust version have been discussed, where the storageService is added to the
6
+ * implementation instead of the widget.
7
+ */
8
+ declare const _default: (implementation: any) => null | undefined;
9
+ export default _default;
@@ -1,6 +1,6 @@
1
- /**
2
- * Find a category by it's ID
3
- * @param id Id of category to find
4
- */
5
- declare const findCategoryById: (id: string, categories: any) => any;
6
- export default findCategoryById;
1
+ /**
2
+ * Find a category by it's ID
3
+ * @param id Id of category to find
4
+ */
5
+ declare const findCategoryById: (id: string, categories: any) => any;
6
+ export default findCategoryById;
@@ -1,2 +1,2 @@
1
- declare const _default: (date: any, includeTime?: boolean) => string;
2
- export default _default;
1
+ declare const _default: (date: any, includeTime?: boolean) => string;
2
+ export default _default;
@@ -1,2 +1,2 @@
1
- declare const formatUrl: (url: string) => string;
2
- export default formatUrl;
1
+ declare const formatUrl: (url: string) => string;
2
+ export default formatUrl;
@@ -1 +1 @@
1
- export default function getCookie(cookieName: string): string | null;
1
+ export default function getCookie(cookieName: string): string | null;
@@ -1,2 +1,2 @@
1
- export declare function checkForEmptyCategories(items: any[], v?: boolean): boolean;
2
- export default function hasNonEmptyCategories(items: any[], v?: boolean): boolean;
1
+ export declare function checkForEmptyCategories(items: any[], v?: boolean): boolean;
2
+ export default function hasNonEmptyCategories(items: any[], v?: boolean): boolean;
package/dist/hash.d.ts CHANGED
@@ -1 +1 @@
1
- export default function (s: string): string;
1
+ export default function (s: string): string;
@@ -1,7 +1,7 @@
1
- declare const _default: (parent: HTMLElement | Window, child: Element | null) => boolean;
2
- /**
3
- * Checks whether or not the passed child is a descendant
4
- * of the passed parent.
5
- * Will return true if falsey parent or child.
6
- */
7
- export default _default;
1
+ /**
2
+ * Checks whether or not the passed child is a descendant
3
+ * of the passed parent.
4
+ * Will return true if falsey parent or child.
5
+ */
6
+ declare const _default: (parent: HTMLElement | Window, child: Element | null) => boolean;
7
+ export default _default;
package/dist/index.d.ts CHANGED
@@ -1,27 +1,27 @@
1
- export { default as appendClassNames } from './append-class-names';
2
- export { default as createBatch } from './batch';
3
- export type { Batch, BatchFunction } from './batch';
4
- export { default as camilize } from './camilize';
5
- export { buildCategoryTrail, categoryTrail, getCategoryTrailAsObjects } from './category-trail';
6
- export { default as createParams } from './create-params';
7
- export type { Params, ParamValue } from './create-params';
8
- export { default as dataURItoBlob } from './data-uri-to-blob';
9
- export { debugLog, Logger } from './debug';
10
- export { default as deepClone } from './deep-clone';
11
- export { default as findAndActivateStoredWidgets } from './find-and-activate-stored-widgets';
12
- export { default as findCategoryById } from './find-category-by-id';
13
- export { default as formatDate } from './format-date';
14
- export { default as formatUrl } from './format-url';
15
- export { default as getCookie } from './get-cookie';
16
- export { default as hash } from './hash';
17
- export { default as htmlParentContains } from './html-parent-contains';
18
- export { default as kebabCase } from './kebab-case';
19
- export { default as lock } from './lock';
20
- export { default as mergeDeep } from './merge-deep';
21
- export { default as notifyDataLoaded } from './notify-data-loaded';
22
- export { default as removeNullAndUndefinedValues } from './remove-null-and-undefined-values';
23
- export { default as setCookie } from './set-cookie';
24
- export { default as shallowCompare } from './shallow-compare';
25
- export { default as uuid } from './uuid';
26
- export { default as WaitFor } from './wait-for';
27
- export type { WaitForOptions } from './wait-for';
1
+ export { default as appendClassNames } from './append-class-names';
2
+ export { default as createBatch } from './batch';
3
+ export type { Batch, BatchFunction } from './batch';
4
+ export { default as camilize } from './camilize';
5
+ export { buildCategoryTrail, categoryTrail, getCategoryTrailAsObjects } from './category-trail';
6
+ export { default as createParams } from './create-params';
7
+ export type { Params, ParamValue } from './create-params';
8
+ export { default as dataURItoBlob } from './data-uri-to-blob';
9
+ export { debugLog, Logger } from './debug';
10
+ export { default as deepClone } from './deep-clone';
11
+ export { default as findAndActivateStoredWidgets } from './find-and-activate-stored-widgets';
12
+ export { default as findCategoryById } from './find-category-by-id';
13
+ export { default as formatDate } from './format-date';
14
+ export { default as formatUrl } from './format-url';
15
+ export { default as getCookie } from './get-cookie';
16
+ export { default as hash } from './hash';
17
+ export { default as htmlParentContains } from './html-parent-contains';
18
+ export { default as kebabCase } from './kebab-case';
19
+ export { default as lock } from './lock';
20
+ export { default as mergeDeep } from './merge-deep';
21
+ export { default as notifyDataLoaded } from './notify-data-loaded';
22
+ export { default as removeNullAndUndefinedValues } from './remove-null-and-undefined-values';
23
+ export { default as setCookie } from './set-cookie';
24
+ export { default as shallowCompare } from './shallow-compare';
25
+ export { default as uuid } from './uuid';
26
+ export { default as WaitFor } from './wait-for';
27
+ export type { WaitForOptions } from './wait-for';