@telia-ace/widget-types-grid 1.0.21 → 1.0.22
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 +5 -5
- package/README.md +3 -3
- package/dist/component-platform-factory.d.ts +13 -13
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{render.7937414f.js → render.20e0f363.js} +1 -1
- package/dist/render.20e0f363.js.map +1 -0
- package/dist/services.d.ts +7 -7
- package/dist/site-provider.d.ts +5 -5
- package/dist/ui/animated-view.d.ts +6 -6
- package/dist/ui/component.d.ts +16 -16
- package/dist/ui/detached-component.d.ts +7 -7
- package/dist/ui/determine-slide-direction.d.ts +26 -26
- package/dist/ui/html-element-handlers.d.ts +18 -18
- package/dist/ui/index.d.ts +6 -6
- package/dist/ui/not-found.d.ts +6 -6
- package/dist/ui/prepare-dom.d.ts +20 -20
- package/dist/ui/render.d.ts +3 -3
- package/dist/ui/resolvable-component.d.ts +7 -7
- package/dist/ui/styles.d.ts +17 -17
- package/dist/ui/switch.d.ts +11 -11
- package/dist/ui/unmount.d.ts +2 -2
- package/dist/ui/use-component-node-properties.d.ts +3 -3
- package/dist/ui/use-router.d.ts +4 -4
- package/dist/ui/view-outlet.d.ts +32 -32
- package/dist/ui/view.d.ts +6 -6
- package/dist/ui/wrapper.d.ts +7 -7
- package/dist/unmount.b0816844.js.map +1 -1
- package/dist/widget.d.ts +54 -54
- package/package.json +2 -2
- package/dist/render.7937414f.js.map +0 -1
package/dist/ui/component.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ComponentNode } from '@telia-ace/widget-core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
declare type Props = {
|
|
4
|
-
className?: string;
|
|
5
|
-
isTabbing?: boolean;
|
|
6
|
-
id: string;
|
|
7
|
-
branch: string;
|
|
8
|
-
node?: ComponentNode;
|
|
9
|
-
ariaLabel?: string;
|
|
10
|
-
tabIndex?: number;
|
|
11
|
-
context?: {
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
declare const Component: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;
|
|
16
|
-
export default Component;
|
|
1
|
+
import { ComponentNode } from '@telia-ace/widget-core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
className?: string;
|
|
5
|
+
isTabbing?: boolean;
|
|
6
|
+
id: string;
|
|
7
|
+
branch: string;
|
|
8
|
+
node?: ComponentNode;
|
|
9
|
+
ariaLabel?: string;
|
|
10
|
+
tabIndex?: number;
|
|
11
|
+
context?: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
declare const Component: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;
|
|
16
|
+
export default Component;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ComponentNode, ComponentPlatform } from '@telia-ace/widget-core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
declare type Props = {
|
|
4
|
-
builder: (components: ComponentPlatform) => Promise<ComponentNode>;
|
|
5
|
-
};
|
|
6
|
-
declare const DetachedComponent: React.FC<Props>;
|
|
7
|
-
export default DetachedComponent;
|
|
1
|
+
import { ComponentNode, ComponentPlatform } from '@telia-ace/widget-core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
builder: (components: ComponentPlatform) => Promise<ComponentNode>;
|
|
5
|
+
};
|
|
6
|
+
declare const DetachedComponent: React.FC<Props>;
|
|
7
|
+
export default DetachedComponent;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export declare enum SlideDirection {
|
|
2
|
-
back = "back",
|
|
3
|
-
forth = "forth"
|
|
4
|
-
}
|
|
5
|
-
export interface RouteStructure {
|
|
6
|
-
name: string;
|
|
7
|
-
children: RouteStructure[];
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Recursively find the parents of a nested route
|
|
11
|
-
* @param routeName Name of route to find
|
|
12
|
-
* @param routes Routes to look in
|
|
13
|
-
* @param trail Trail of parents
|
|
14
|
-
* @param level Level of the array currently looking in
|
|
15
|
-
*/
|
|
16
|
-
export declare const findParentRoutes: (routeName: string, routes: RouteStructure[], trail?: string[], level?: number) => string[] | null;
|
|
17
|
-
/**
|
|
18
|
-
* Determine if the sliding animation should back or forth
|
|
19
|
-
* @param currentRouteName Name of current route
|
|
20
|
-
* @param nextRouteName Name of route to transition to
|
|
21
|
-
* @param routeRanking Hierarchical route ranking for the widget
|
|
22
|
-
*/
|
|
23
|
-
export declare const determineSlideDirection: (currentRouteName: string, nextRouteName: string, routeRanking: RouteRanking) => SlideDirection;
|
|
24
|
-
export declare type RouteRanking = {
|
|
25
|
-
[key: string]: number;
|
|
26
|
-
};
|
|
1
|
+
export declare enum SlideDirection {
|
|
2
|
+
back = "back",
|
|
3
|
+
forth = "forth"
|
|
4
|
+
}
|
|
5
|
+
export interface RouteStructure {
|
|
6
|
+
name: string;
|
|
7
|
+
children: RouteStructure[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Recursively find the parents of a nested route
|
|
11
|
+
* @param routeName Name of route to find
|
|
12
|
+
* @param routes Routes to look in
|
|
13
|
+
* @param trail Trail of parents
|
|
14
|
+
* @param level Level of the array currently looking in
|
|
15
|
+
*/
|
|
16
|
+
export declare const findParentRoutes: (routeName: string, routes: RouteStructure[], trail?: string[], level?: number) => string[] | null;
|
|
17
|
+
/**
|
|
18
|
+
* Determine if the sliding animation should back or forth
|
|
19
|
+
* @param currentRouteName Name of current route
|
|
20
|
+
* @param nextRouteName Name of route to transition to
|
|
21
|
+
* @param routeRanking Hierarchical route ranking for the widget
|
|
22
|
+
*/
|
|
23
|
+
export declare const determineSlideDirection: (currentRouteName: string, nextRouteName: string, routeRanking: RouteRanking) => SlideDirection;
|
|
24
|
+
export declare type RouteRanking = {
|
|
25
|
+
[key: string]: number;
|
|
26
|
+
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export declare const renderSymbol: (symbol?: {
|
|
2
|
-
type: string;
|
|
3
|
-
content: string;
|
|
4
|
-
} | undefined) => string | undefined;
|
|
5
|
-
export declare type TriggerElementOptions = {
|
|
6
|
-
symbol?: {
|
|
7
|
-
type: string;
|
|
8
|
-
content: string;
|
|
9
|
-
};
|
|
10
|
-
widgetName: string;
|
|
11
|
-
label?: string;
|
|
12
|
-
ariaLabel?: string;
|
|
13
|
-
tooltip?: string;
|
|
14
|
-
};
|
|
15
|
-
export declare function createTriggerElement(element: HTMLElement, options: TriggerElementOptions): () => void;
|
|
16
|
-
export declare function setInactive(elements: HTMLElement | HTMLElement[], title?: string): void;
|
|
17
|
-
export declare function setLoading(elements: HTMLElement | HTMLElement[]): void;
|
|
18
|
-
export declare function setActive(elements: HTMLElement | HTMLElement[], title?: string): void;
|
|
1
|
+
export declare const renderSymbol: (symbol?: {
|
|
2
|
+
type: string;
|
|
3
|
+
content: string;
|
|
4
|
+
} | undefined) => string | undefined;
|
|
5
|
+
export declare type TriggerElementOptions = {
|
|
6
|
+
symbol?: {
|
|
7
|
+
type: string;
|
|
8
|
+
content: string;
|
|
9
|
+
};
|
|
10
|
+
widgetName: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
tooltip?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function createTriggerElement(element: HTMLElement, options: TriggerElementOptions): () => void;
|
|
16
|
+
export declare function setInactive(elements: HTMLElement | HTMLElement[], title?: string): void;
|
|
17
|
+
export declare function setLoading(elements: HTMLElement | HTMLElement[]): void;
|
|
18
|
+
export declare function setActive(elements: HTMLElement | HTMLElement[], title?: string): void;
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default as AnimatedView } from './animated-view';
|
|
2
|
-
export { default as Component } from './component';
|
|
3
|
-
export { prepareDOMElements, TriggerType } from './prepare-dom';
|
|
4
|
-
export { default as ResolvableComponent } from './resolvable-component';
|
|
5
|
-
export { default as View } from './view';
|
|
6
|
-
export { default as Wrapper } from './wrapper';
|
|
1
|
+
export { default as AnimatedView } from './animated-view';
|
|
2
|
+
export { default as Component } from './component';
|
|
3
|
+
export { prepareDOMElements, TriggerType } from './prepare-dom';
|
|
4
|
+
export { default as ResolvableComponent } from './resolvable-component';
|
|
5
|
+
export { default as View } from './view';
|
|
6
|
+
export { default as Wrapper } from './wrapper';
|
package/dist/ui/not-found.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare type Props = {
|
|
3
|
-
showSearch?: boolean;
|
|
4
|
-
};
|
|
5
|
-
declare const NotFound: React.FC<Props>;
|
|
6
|
-
export default NotFound;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type Props = {
|
|
3
|
+
showSearch?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const NotFound: React.FC<Props>;
|
|
6
|
+
export default NotFound;
|
package/dist/ui/prepare-dom.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ViewOutletOptions } from './view-outlet';
|
|
2
|
-
declare enum ProvidedElements {
|
|
3
|
-
None = "none",
|
|
4
|
-
WidgetDOM = "widgetDOM",
|
|
5
|
-
TriggerDOM = "triggerDOM",
|
|
6
|
-
Both = "both"
|
|
7
|
-
}
|
|
8
|
-
export declare enum TriggerType {
|
|
9
|
-
Inline = "inline",
|
|
10
|
-
Link = "link",
|
|
11
|
-
Badge = "badge",
|
|
12
|
-
Unsupported = "unsupported"
|
|
13
|
-
}
|
|
14
|
-
export declare const determineProvidedElements: (widgetDOMElement?: HTMLElement | undefined, triggerDOMElement?: HTMLElement | undefined) => ProvidedElements;
|
|
15
|
-
export declare const determineTriggerType: (triggerDefinition?: any) => TriggerType;
|
|
16
|
-
declare type PrepareDOMElementsOutput = ViewOutletOptions & {
|
|
17
|
-
callback?: () => void;
|
|
18
|
-
};
|
|
19
|
-
export declare const prepareDOMElements: (name: string, providedWidgetElement?: HTMLElement | undefined, providedTriggerElement?: HTMLElement | undefined, triggerDefinition?: any, waitWithReplace?: boolean) => PrepareDOMElementsOutput;
|
|
20
|
-
export {};
|
|
1
|
+
import { ViewOutletOptions } from './view-outlet';
|
|
2
|
+
declare enum ProvidedElements {
|
|
3
|
+
None = "none",
|
|
4
|
+
WidgetDOM = "widgetDOM",
|
|
5
|
+
TriggerDOM = "triggerDOM",
|
|
6
|
+
Both = "both"
|
|
7
|
+
}
|
|
8
|
+
export declare enum TriggerType {
|
|
9
|
+
Inline = "inline",
|
|
10
|
+
Link = "link",
|
|
11
|
+
Badge = "badge",
|
|
12
|
+
Unsupported = "unsupported"
|
|
13
|
+
}
|
|
14
|
+
export declare const determineProvidedElements: (widgetDOMElement?: HTMLElement | undefined, triggerDOMElement?: HTMLElement | undefined) => ProvidedElements;
|
|
15
|
+
export declare const determineTriggerType: (triggerDefinition?: any) => TriggerType;
|
|
16
|
+
declare type PrepareDOMElementsOutput = ViewOutletOptions & {
|
|
17
|
+
callback?: () => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const prepareDOMElements: (name: string, providedWidgetElement?: HTMLElement | undefined, providedTriggerElement?: HTMLElement | undefined, triggerDefinition?: any, waitWithReplace?: boolean) => PrepareDOMElementsOutput;
|
|
20
|
+
export {};
|
package/dist/ui/render.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Container } from '@webprovisions/platform';
|
|
2
|
-
declare const _default: (container: Container, element: HTMLElement) => void;
|
|
3
|
-
export default _default;
|
|
1
|
+
import { Container } from '@webprovisions/platform';
|
|
2
|
+
declare const _default: (container: Container, element: HTMLElement) => void;
|
|
3
|
+
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare type Props = {
|
|
3
|
-
role?: string;
|
|
4
|
-
className?: string;
|
|
5
|
-
};
|
|
6
|
-
declare const ResolvableComponent: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;
|
|
7
|
-
export default ResolvableComponent;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type Props = {
|
|
3
|
+
role?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const ResolvableComponent: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;
|
|
7
|
+
export default ResolvableComponent;
|
package/dist/ui/styles.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const styling: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
|
|
3
|
-
'data-width': number;
|
|
4
|
-
'data-indent': number;
|
|
5
|
-
}, import("styled-components").DefaultTheme>>;
|
|
6
|
-
export declare const StyledView: import("styled-components").StyledComponent<import("react").FC<{
|
|
7
|
-
className?: string | undefined;
|
|
8
|
-
}>, import("styled-components").DefaultTheme, {
|
|
9
|
-
'data-width': number;
|
|
10
|
-
'data-indent': number;
|
|
11
|
-
}, never>;
|
|
12
|
-
export declare const StyledAnimatedView: import("styled-components").StyledComponent<import("react").FC<{
|
|
13
|
-
className?: string | undefined;
|
|
14
|
-
}>, import("styled-components").DefaultTheme, {
|
|
15
|
-
'data-width': number;
|
|
16
|
-
'data-indent': number;
|
|
17
|
-
}, never>;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const styling: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
|
|
3
|
+
'data-width': number;
|
|
4
|
+
'data-indent': number;
|
|
5
|
+
}, import("styled-components").DefaultTheme>>;
|
|
6
|
+
export declare const StyledView: import("styled-components").StyledComponent<import("react").FC<{
|
|
7
|
+
className?: string | undefined;
|
|
8
|
+
}>, import("styled-components").DefaultTheme, {
|
|
9
|
+
'data-width': number;
|
|
10
|
+
'data-indent': number;
|
|
11
|
+
}, never>;
|
|
12
|
+
export declare const StyledAnimatedView: import("styled-components").StyledComponent<import("react").FC<{
|
|
13
|
+
className?: string | undefined;
|
|
14
|
+
}>, import("styled-components").DefaultTheme, {
|
|
15
|
+
'data-width': number;
|
|
16
|
+
'data-indent': number;
|
|
17
|
+
}, never>;
|
package/dist/ui/switch.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ViewDefinition } from '@telia-ace/widget-core';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
declare type Props = {
|
|
4
|
-
location?: any;
|
|
5
|
-
views: {
|
|
6
|
-
[key: string]: ViewDefinition;
|
|
7
|
-
};
|
|
8
|
-
render: (viewName: string) => JSX.Element | null;
|
|
9
|
-
};
|
|
10
|
-
declare const Switch: React.FC<Props>;
|
|
11
|
-
export default Switch;
|
|
1
|
+
import { ViewDefinition } from '@telia-ace/widget-core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
location?: any;
|
|
5
|
+
views: {
|
|
6
|
+
[key: string]: ViewDefinition;
|
|
7
|
+
};
|
|
8
|
+
render: (viewName: string) => JSX.Element | null;
|
|
9
|
+
};
|
|
10
|
+
declare const Switch: React.FC<Props>;
|
|
11
|
+
export default Switch;
|
package/dist/ui/unmount.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (element: HTMLElement) => boolean;
|
|
2
|
-
export default _default;
|
|
1
|
+
declare const _default: (element: HTMLElement) => boolean;
|
|
2
|
+
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ComponentNodeProperties } from '@telia-ace/widget-core';
|
|
2
|
-
declare const _default: (id: string) => ComponentNodeProperties;
|
|
3
|
-
export default _default;
|
|
1
|
+
import { ComponentNodeProperties } from '@telia-ace/widget-core';
|
|
2
|
+
declare const _default: (id: string) => ComponentNodeProperties;
|
|
3
|
+
export default _default;
|
package/dist/ui/use-router.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RoutingService } from '@telia-ace/widget-routing';
|
|
2
|
-
import { Container } from '@webprovisions/platform';
|
|
3
|
-
declare const _default: (container: Container) => RoutingService | null;
|
|
4
|
-
export default _default;
|
|
1
|
+
import { RoutingService } from '@telia-ace/widget-routing';
|
|
2
|
+
import { Container } from '@webprovisions/platform';
|
|
3
|
+
declare const _default: (container: Container) => RoutingService | null;
|
|
4
|
+
export default _default;
|
package/dist/ui/view-outlet.d.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { Symbol } from '@telia-ace/widget-ui';
|
|
2
|
-
import { Container } from '@webprovisions/platform';
|
|
3
|
-
import { TriggerType } from './prepare-dom';
|
|
4
|
-
export declare type BadgeOptions = {
|
|
5
|
-
symbol?: Symbol;
|
|
6
|
-
label?: string;
|
|
7
|
-
ariaLabel?: string;
|
|
8
|
-
openTooltip?: string;
|
|
9
|
-
closedTooltip?: string;
|
|
10
|
-
};
|
|
11
|
-
export declare type ViewOutletOptions = {
|
|
12
|
-
widgetDOMElement: HTMLElement;
|
|
13
|
-
triggerDOMElement?: HTMLElement;
|
|
14
|
-
triggerOptions?: BadgeOptions | boolean;
|
|
15
|
-
triggerType: TriggerType;
|
|
16
|
-
cachedOriginals: {
|
|
17
|
-
widgetDOMElement?: Node;
|
|
18
|
-
triggerDOMElement?: Node;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export declare class ViewOutlet {
|
|
22
|
-
options: ViewOutletOptions;
|
|
23
|
-
container: Container;
|
|
24
|
-
private unsubscribe;
|
|
25
|
-
constructor(container: Container, options: ViewOutletOptions);
|
|
26
|
-
/**
|
|
27
|
-
* Renders the view outlet to the DOM.
|
|
28
|
-
*/
|
|
29
|
-
render(): Promise<void>;
|
|
30
|
-
renderBadge(options: BadgeOptions): void;
|
|
31
|
-
dispose(): Promise<void>;
|
|
32
|
-
}
|
|
1
|
+
import { Symbol } from '@telia-ace/widget-ui';
|
|
2
|
+
import { Container } from '@webprovisions/platform';
|
|
3
|
+
import { TriggerType } from './prepare-dom';
|
|
4
|
+
export declare type BadgeOptions = {
|
|
5
|
+
symbol?: Symbol;
|
|
6
|
+
label?: string;
|
|
7
|
+
ariaLabel?: string;
|
|
8
|
+
openTooltip?: string;
|
|
9
|
+
closedTooltip?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare type ViewOutletOptions = {
|
|
12
|
+
widgetDOMElement: HTMLElement;
|
|
13
|
+
triggerDOMElement?: HTMLElement;
|
|
14
|
+
triggerOptions?: BadgeOptions | boolean;
|
|
15
|
+
triggerType: TriggerType;
|
|
16
|
+
cachedOriginals: {
|
|
17
|
+
widgetDOMElement?: Node;
|
|
18
|
+
triggerDOMElement?: Node;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare class ViewOutlet {
|
|
22
|
+
options: ViewOutletOptions;
|
|
23
|
+
container: Container;
|
|
24
|
+
private unsubscribe;
|
|
25
|
+
constructor(container: Container, options: ViewOutletOptions);
|
|
26
|
+
/**
|
|
27
|
+
* Renders the view outlet to the DOM.
|
|
28
|
+
*/
|
|
29
|
+
render(): Promise<void>;
|
|
30
|
+
renderBadge(options: BadgeOptions): void;
|
|
31
|
+
dispose(): Promise<void>;
|
|
32
|
+
}
|
package/dist/ui/view.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare type Props = {
|
|
3
|
-
className?: string;
|
|
4
|
-
};
|
|
5
|
-
declare const View: React.FC<Props>;
|
|
6
|
-
export default View;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type Props = {
|
|
3
|
+
className?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const View: React.FC<Props>;
|
|
6
|
+
export default View;
|
package/dist/ui/wrapper.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Container } from '@webprovisions/platform';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
declare type Props = {
|
|
4
|
-
container: Container;
|
|
5
|
-
};
|
|
6
|
-
declare const Wrapper: React.SFC<Props>;
|
|
7
|
-
export default Wrapper;
|
|
1
|
+
import { Container } from '@webprovisions/platform';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
container: Container;
|
|
5
|
+
};
|
|
6
|
+
declare const Wrapper: React.SFC<Props>;
|
|
7
|
+
export default Wrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unmount.b0816844.js","sources":["../src/ui/unmount.tsx"],"sourcesContent":["import { unmountComponentAtNode } from 'react-dom';\
|
|
1
|
+
{"version":3,"file":"unmount.b0816844.js","sources":["../src/ui/unmount.tsx"],"sourcesContent":["import { unmountComponentAtNode } from 'react-dom';\n\nexport default (element: HTMLElement) => unmountComponentAtNode(element);\n"],"names":[],"mappings":";AAEA,MAAA,IAAe,CAAC,MAAyB,EAAuB,CAAO;"}
|
package/dist/widget.d.ts
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { WidgetRenderState, WidgetSettings } from '@telia-ace/widget-core';
|
|
2
|
-
import { BootstrappingActivationData } from '@webprovisions/bootstrapping';
|
|
3
|
-
import { Container, EventSubscriptionCancellation, WidgetType } from '@webprovisions/platform';
|
|
4
|
-
import { ViewOutlet } from '././ui/view-outlet';
|
|
5
|
-
export declare enum InitialRenderState {
|
|
6
|
-
Open = "open",
|
|
7
|
-
Closed = "closed",
|
|
8
|
-
Hidden = "hidden",
|
|
9
|
-
Storage = "storage"
|
|
10
|
-
}
|
|
11
|
-
export declare type RenderData = {
|
|
12
|
-
widgetDOMElement?: HTMLElement;
|
|
13
|
-
triggerDOMElement?: HTMLElement;
|
|
14
|
-
key?: string;
|
|
15
|
-
open?: boolean;
|
|
16
|
-
withRenderState?: InitialRenderState;
|
|
17
|
-
};
|
|
18
|
-
export declare type AttachData = {
|
|
19
|
-
widgetDOMElement?: HTMLElement;
|
|
20
|
-
triggerDOMElement?: HTMLElement;
|
|
21
|
-
key?: string;
|
|
22
|
-
withRenderState?: InitialRenderState;
|
|
23
|
-
};
|
|
24
|
-
export default class Widget extends WidgetType {
|
|
25
|
-
outlets: Map<string, ViewOutlet>;
|
|
26
|
-
activated: Promise<void> | undefined;
|
|
27
|
-
subs: EventSubscriptionCancellation[];
|
|
28
|
-
constructor(container: Container);
|
|
29
|
-
handleBootstrapping: (activationData: BootstrappingActivationData) => void;
|
|
30
|
-
initialize(): Promise<void>;
|
|
31
|
-
attach(attachData?: AttachData): any;
|
|
32
|
-
detach(key?: string): void;
|
|
33
|
-
private triggerStateIfApplicable;
|
|
34
|
-
private getOrCreateViewOutlet;
|
|
35
|
-
render(renderData?: RenderData): any;
|
|
36
|
-
activate(data?: any): void;
|
|
37
|
-
setSettings(fn: (settings: WidgetSettings) => Promise<Partial<WidgetSettings>>): Promise<WidgetSettings>;
|
|
38
|
-
clearSettings(): Promise<void>;
|
|
39
|
-
action({ action, value }: {
|
|
40
|
-
action: string;
|
|
41
|
-
value?: any;
|
|
42
|
-
}): Promise<void>;
|
|
43
|
-
renderState(): Promise<WidgetRenderState>;
|
|
44
|
-
hide(): Promise<void>;
|
|
45
|
-
open(): Promise<void>;
|
|
46
|
-
close(): Promise<void>;
|
|
47
|
-
show(): Promise<void>;
|
|
48
|
-
private onAction;
|
|
49
|
-
private setRenderState;
|
|
50
|
-
private onOpen;
|
|
51
|
-
private onClose;
|
|
52
|
-
private setTriggerState;
|
|
53
|
-
deactivate(): Promise<void[]>;
|
|
54
|
-
}
|
|
1
|
+
import { WidgetRenderState, WidgetSettings } from '@telia-ace/widget-core';
|
|
2
|
+
import { BootstrappingActivationData } from '@webprovisions/bootstrapping';
|
|
3
|
+
import { Container, EventSubscriptionCancellation, WidgetType } from '@webprovisions/platform';
|
|
4
|
+
import { ViewOutlet } from '././ui/view-outlet';
|
|
5
|
+
export declare enum InitialRenderState {
|
|
6
|
+
Open = "open",
|
|
7
|
+
Closed = "closed",
|
|
8
|
+
Hidden = "hidden",
|
|
9
|
+
Storage = "storage"
|
|
10
|
+
}
|
|
11
|
+
export declare type RenderData = {
|
|
12
|
+
widgetDOMElement?: HTMLElement;
|
|
13
|
+
triggerDOMElement?: HTMLElement;
|
|
14
|
+
key?: string;
|
|
15
|
+
open?: boolean;
|
|
16
|
+
withRenderState?: InitialRenderState;
|
|
17
|
+
};
|
|
18
|
+
export declare type AttachData = {
|
|
19
|
+
widgetDOMElement?: HTMLElement;
|
|
20
|
+
triggerDOMElement?: HTMLElement;
|
|
21
|
+
key?: string;
|
|
22
|
+
withRenderState?: InitialRenderState;
|
|
23
|
+
};
|
|
24
|
+
export default class Widget extends WidgetType {
|
|
25
|
+
outlets: Map<string, ViewOutlet>;
|
|
26
|
+
activated: Promise<void> | undefined;
|
|
27
|
+
subs: EventSubscriptionCancellation[];
|
|
28
|
+
constructor(container: Container);
|
|
29
|
+
handleBootstrapping: (activationData: BootstrappingActivationData) => void;
|
|
30
|
+
initialize(): Promise<void>;
|
|
31
|
+
attach(attachData?: AttachData): any;
|
|
32
|
+
detach(key?: string): void;
|
|
33
|
+
private triggerStateIfApplicable;
|
|
34
|
+
private getOrCreateViewOutlet;
|
|
35
|
+
render(renderData?: RenderData): any;
|
|
36
|
+
activate(data?: any): void;
|
|
37
|
+
setSettings(fn: (settings: WidgetSettings) => Promise<Partial<WidgetSettings>>): Promise<WidgetSettings>;
|
|
38
|
+
clearSettings(): Promise<void>;
|
|
39
|
+
action({ action, value }: {
|
|
40
|
+
action: string;
|
|
41
|
+
value?: any;
|
|
42
|
+
}): Promise<void>;
|
|
43
|
+
renderState(): Promise<WidgetRenderState>;
|
|
44
|
+
hide(): Promise<void>;
|
|
45
|
+
open(): Promise<void>;
|
|
46
|
+
close(): Promise<void>;
|
|
47
|
+
show(): Promise<void>;
|
|
48
|
+
private onAction;
|
|
49
|
+
private setRenderState;
|
|
50
|
+
private onOpen;
|
|
51
|
+
private onClose;
|
|
52
|
+
private setTriggerState;
|
|
53
|
+
deactivate(): Promise<void[]>;
|
|
54
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/widget-types-grid",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"description": "Type definition for Grid widget.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"@types/react-transition-group": "^4.4.4",
|
|
51
51
|
"@types/styled-components": "^5.1.7"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "3392f807f18c67896fbcbbef9527e496c26adadf"
|
|
54
54
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render.7937414f.js","sources":["../src/ui/use-router.ts","../src/ui/wrapper.tsx","../src/ui/render.tsx"],"sourcesContent":["import { RoutingService } from '@telia-ace/widget-routing';\r\nimport { useIsMounted } from '@telia-ace/widget-ui';\r\nimport { Container } from '@webprovisions/platform';\r\nimport { useEffect, useState } from 'react';\r\n\r\nexport default (container: Container): RoutingService | null => {\r\n const [router, setRouter] = useState<RoutingService | null>(null);\r\n const isMounted = useIsMounted();\r\n\r\n useEffect(() => {\r\n container.getAsync('router').then((router: RoutingService) => {\r\n if (isMounted.current) {\r\n setRouter(router);\r\n }\r\n });\r\n }, [container, isMounted]);\r\n\r\n return router;\r\n};\r\n","import { ContainerContext, RoutingContext, useComponentPlatform } from '@telia-ace/widget-ui';\r\nimport { appendClassNames } from '@telia-ace/widget-utilities';\r\nimport { Container } from '@webprovisions/platform';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { Router } from 'react-router-dom';\r\nimport Component from './component';\r\nimport useRouter from './use-router';\r\n\r\nconst keyNavigationKeys = ['Tab', 'ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft'];\r\n\r\ntype Props = {\r\n container: Container;\r\n};\r\n\r\nconst Wrapper: React.SFC<Props> = ({ container }) => {\r\n const components = useComponentPlatform(container);\r\n const router = useRouter(container);\r\n const env = container.get('$environment');\r\n const [isTabbing, setIsTabbing] = useState(env?.container.get('isTabbing') || false);\r\n const [entry, setEntry] = useState<string | null>(null);\r\n\r\n useEffect(() => {\r\n const keydown = (event: KeyboardEvent) => {\r\n if (keyNavigationKeys.indexOf(event.key) > -1) {\r\n if (!isTabbing) {\r\n env?.container.register('isTabbing', true);\r\n }\r\n setIsTabbing(true);\r\n }\r\n };\r\n const click = (event: any) => {\r\n if (event.screenX === 0 && event.screenY === 0) {\r\n return;\r\n }\r\n if (isTabbing) {\r\n env?.container.register('isTabbing', false);\r\n }\r\n setIsTabbing(false);\r\n };\r\n window.addEventListener('keydown', keydown);\r\n window.addEventListener('click', click);\r\n return () => {\r\n window.removeEventListener('keydown', keydown);\r\n window.removeEventListener('click', click);\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (components) {\r\n setEntry(components.nodes.root.children.default[0].id || null);\r\n const unsubscribe = components.events.subscribe(\r\n 'components:root-children-changed',\r\n (event, { node }) => {\r\n if (node.parent && node.parent.type === 'root') {\r\n const entry = node.parent.children.default[0].id;\r\n setEntry(entry);\r\n }\r\n }\r\n );\r\n\r\n return unsubscribe;\r\n }\r\n }, [components]);\r\n\r\n if (!router || !router.history || !components) {\r\n return null;\r\n }\r\n\r\n if (!entry) {\r\n return null;\r\n }\r\n\r\n return (\r\n <Router history={router.history}>\r\n <ContainerContext.Provider value={container}>\r\n <RoutingContext.Provider value={router}>\r\n <Component\r\n className={appendClassNames([isTabbing, 'humany-is-tabbing'])}\r\n isTabbing={isTabbing}\r\n id={entry}\r\n branch=\"default\"\r\n />\r\n </RoutingContext.Provider>\r\n </ContainerContext.Provider>\r\n </Router>\r\n );\r\n};\r\n\r\nexport default Wrapper;\r\n","import { Container } from '@webprovisions/platform';\r\nimport React from 'react';\r\nimport { render } from 'react-dom';\r\nimport Wrapper from './wrapper';\r\n\r\nexport default (container: Container, element: HTMLElement) =>\r\n render(<Wrapper container={container} />, element);\r\n"],"names":["render","Wrapper"],"mappings":";;;;;;;;;;;;;;AAKA,MAAe,IAAA,CAAC,MAAgD;AAC5D,QAAM,CAAC,GAAQ,KAAa,EAAgC,IAAI,GAC1D,IAAY;AAElB,WAAU,MAAM;AACZ,MAAU,SAAS,QAAQ,EAAE,KAAK,CAAC,MAA2B;AAC1D,MAAI,EAAU,WACV,EAAU,CAAM;AAAA,IACpB,CACH;AAAA,EAAA,GACF,CAAC,GAAW,CAAS,CAAC,GAElB;AACX,GCVM,IAAoB,CAAC,OAAO,aAAa,WAAW,cAAc,WAAW,GAM7E,IAA4B,CAAC,EAAE,mBAAgB;AAC3C,QAAA,IAAa,EAAqB,CAAS,GAC3C,IAAS,EAAU,CAAS,GAC5B,IAAM,EAAU,IAAI,cAAc,GAClC,CAAC,GAAW,KAAgB,EAAS,wBAAK,UAAU,IAAI,iBAAgB,EAAK,GAC7E,CAAC,GAAO,KAAY,EAAwB,IAAI;AAiDtD,SA/CA,EAAU,MAAM;AACN,UAAA,IAAU,CAAC,MAAyB;AACtC,MAAI,EAAkB,QAAQ,EAAM,GAAG,IAAI,MAClC,MACI,eAAA,UAAU,SAAS,aAAa,KAEzC,EAAa,EAAI;AAAA,IACrB,GAEE,IAAQ,CAAC,MAAe;AAC1B,MAAI,EAAM,YAAY,KAAK,EAAM,YAAY,KAGzC,MACK,gBAAA,UAAU,SAAS,aAAa,MAEzC,EAAa,EAAK;AAAA,IAAA;AAEf,kBAAA,iBAAiB,WAAW,CAAO,GACnC,OAAA,iBAAiB,SAAS,CAAK,GAC/B,MAAM;AACF,aAAA,oBAAoB,WAAW,CAAO,GACtC,OAAA,oBAAoB,SAAS,CAAK;AAAA,IAAA;AAAA,EAEjD,GAAG,CAAE,CAAA,GAEL,EAAU,MAAM;AACZ,QAAI;AACA,eAAS,EAAW,MAAM,KAAK,SAAS,QAAQ,GAAG,MAAM,IAAI,GACzC,EAAW,OAAO,UAClC,oCACA,CAAC,GAAO,EAAE,cAAW;AACjB,YAAI,EAAK,UAAU,EAAK,OAAO,SAAS,QAAQ;AAC5C,gBAAM,IAAQ,EAAK,OAAO,SAAS,QAAQ,GAAG;AAC9C,YAAS,CAAK;AAAA,QAClB;AAAA,MAAA,CAER;AAAA,EAGJ,GACD,CAAC,CAAU,CAAC,GAEX,CAAC,KAAU,CAAC,EAAO,WAAW,CAAC,KAI/B,CAAC,IACM,OAIN,kBAAA,cAAA,GAAA;AAAA,IAAO,SAAS,EAAO;AAAA,EACpB,GAAA,kBAAA,cAAC,EAAiB,UAAjB;AAAA,IAA0B,OAAO;AAAA,EAC9B,GAAA,kBAAA,cAAC,EAAe,UAAf;AAAA,IAAwB,OAAO;AAAA,EAAA,GAC3B,kBAAA,cAAA,GAAA;AAAA,IACG,WAAW,EAAiB,CAAC,GAAW,mBAAmB,CAAC;AAAA,IAC5D;AAAA,IACA,IAAI;AAAA,IACJ,QAAO;AAAA,EAAA,CACX,CACJ,CACJ,CACJ;AAER,GAEA,IAAe,GCnFf,IAAe,CAAC,GAAsB,MAClCA,EAAQ,kBAAA,cAAAC,GAAA;AAAA,EAAQ;AAAA,CAAsB,GAAI,CAAO;"}
|