@wcardinal/wcardinal-ui 0.142.0 → 0.143.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/types/wcardinal/ui/d-button-link.d.ts +2 -2
- package/dist/types/wcardinal/ui/d-link.d.ts +23 -12
- package/dist/types/wcardinal/ui/d-list-data-selection.d.ts +2 -2
- package/dist/types/wcardinal/ui/d-list-item-accessor-impl.d.ts +3 -1
- package/dist/types/wcardinal/ui/d-list-item-accessor.d.ts +19 -4
- package/dist/types/wcardinal/ui/d-list-item.d.ts +7 -2
- package/dist/types/wcardinal/ui/d-menu-item-link.d.ts +2 -2
- package/dist/types/wcardinal/ui/d-table-body-cell-link.d.ts +2 -2
- package/dist/types/wcardinal/ui/d-table-body-cell-tree.d.ts +2 -2
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-button-link.d.ts +0 -3
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-link.d.ts +12 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-menu-item-link.d.ts +3 -3
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-table-body-cell-link.d.ts +3 -3
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-table-body-cell-tree.d.ts +0 -3
- package/dist/types/wcardinal/ui/theme/dark/index.d.ts +3 -2
- package/dist/types/wcardinal/ui/theme/dark/load/index.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/dark/load/load-theme-dark-link.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-button-link.d.ts +0 -3
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-link.d.ts +12 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-menu-item-link.d.ts +3 -3
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-table-body-cell-link.d.ts +3 -3
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-table-body-cell-tree.d.ts +0 -3
- package/dist/types/wcardinal/ui/theme/white/index.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/white/load/index.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/white/load/load-theme-white-link.d.ts +1 -0
- package/dist/wcardinal/ui/d-button-link.js +1 -1
- package/dist/wcardinal/ui/d-button-link.js.map +1 -1
- package/dist/wcardinal/ui/d-link.js +58 -25
- package/dist/wcardinal/ui/d-link.js.map +1 -1
- package/dist/wcardinal/ui/d-list-data-selection.js.map +1 -1
- package/dist/wcardinal/ui/d-list-item-accessor-impl.js +22 -0
- package/dist/wcardinal/ui/d-list-item-accessor-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-list-item-accessor.js.map +1 -1
- package/dist/wcardinal/ui/d-list-item.js +50 -8
- package/dist/wcardinal/ui/d-list-item.js.map +1 -1
- package/dist/wcardinal/ui/d-menu-item-link.js +1 -1
- package/dist/wcardinal/ui/d-menu-item-link.js.map +1 -1
- package/dist/wcardinal/ui/d-table-body-cell-link.js +1 -1
- package/dist/wcardinal/ui/d-table-body-cell-link.js.map +1 -1
- package/dist/wcardinal/ui/d-table-body-cell-tree.js +1 -1
- package/dist/wcardinal/ui/d-table-body-cell-tree.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-button-link.js +0 -5
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-button-link.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-link.js +53 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-link.js.map +1 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-menu-item-link.js +5 -7
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-menu-item-link.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-body-cell-link.js +5 -7
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-body-cell-link.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-body-cell-tree.js +0 -5
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-body-cell-tree.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/index.js +3 -2
- package/dist/wcardinal/ui/theme/dark/index.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/load/index.js +1 -0
- package/dist/wcardinal/ui/theme/dark/load/index.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-all.js +2 -0
- package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-all.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-link.js +10 -0
- package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-link.js.map +1 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-button-link.js +0 -5
- package/dist/wcardinal/ui/theme/white/d-theme-white-button-link.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-link.js +53 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-link.js.map +1 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-menu-item-link.js +5 -7
- package/dist/wcardinal/ui/theme/white/d-theme-white-menu-item-link.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-table-body-cell-link.js +5 -7
- package/dist/wcardinal/ui/theme/white/d-theme-white-table-body-cell-link.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-table-body-cell-tree.js +0 -5
- package/dist/wcardinal/ui/theme/white/d-theme-white-table-body-cell-tree.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/index.js +1 -0
- package/dist/wcardinal/ui/theme/white/index.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/load/index.js +1 -0
- package/dist/wcardinal/ui/theme/white/load/index.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/load/load-theme-white-all.js +2 -0
- package/dist/wcardinal/ui/theme/white/load/load-theme-white-all.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/load/load-theme-white-link.js +10 -0
- package/dist/wcardinal/ui/theme/white/load/load-theme-white-link.js.map +1 -0
- package/dist/wcardinal-ui-theme-dark.js +74 -77
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white.js +72 -75
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
- package/dist/wcardinal-ui.cjs.js +271 -182
- package/dist/wcardinal-ui.js +133 -38
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-links.d.ts +0 -12
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-links.d.ts +0 -12
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-links.js +0 -55
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-links.js.map +0 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-links.js +0 -55
- package/dist/wcardinal/ui/theme/white/d-theme-white-links.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { interaction } from "pixi.js";
|
|
2
2
|
import { DButtonBase, DButtonBaseOptions, DThemeButtonBase } from "./d-button-base";
|
|
3
3
|
import { DButtonBaseWhen } from "./d-button-base-when";
|
|
4
|
-
import { DLink, DLinkOptions
|
|
4
|
+
import { DLink, DLinkOptions } from "./d-link";
|
|
5
5
|
export interface DButtonLinkOptions<VALUE = unknown, THEME extends DThemeButtonLink<VALUE> = DThemeButtonLink<VALUE>> extends DButtonBaseOptions<VALUE, THEME>, DLinkOptions {
|
|
6
6
|
}
|
|
7
|
-
export interface DThemeButtonLink<VALUE = unknown> extends DThemeButtonBase<VALUE
|
|
7
|
+
export interface DThemeButtonLink<VALUE = unknown> extends DThemeButtonBase<VALUE> {
|
|
8
8
|
}
|
|
9
9
|
export declare class DButtonLink<VALUE = unknown, THEME extends DThemeButtonLink<VALUE> = DThemeButtonLink<VALUE>, OPTIONS extends DButtonLinkOptions<VALUE, THEME> = DButtonLinkOptions<VALUE, THEME>> extends DButtonBase<VALUE, THEME, OPTIONS> {
|
|
10
10
|
protected _link: DLink;
|
|
@@ -1,38 +1,48 @@
|
|
|
1
|
-
import { interaction } from "pixi.js";
|
|
1
|
+
import { DisplayObject, interaction, Texture } from "pixi.js";
|
|
2
2
|
import InteractionEvent = interaction.InteractionEvent;
|
|
3
3
|
import { DBase } from "./d-base";
|
|
4
4
|
import { DLinkMenu } from "./d-link-menu";
|
|
5
5
|
import { DLinkMenuItemId } from "./d-link-menu-item-id";
|
|
6
6
|
import { DLinkTarget } from "./d-link-target";
|
|
7
7
|
import { DMenu, DMenuOptions } from "./d-menu";
|
|
8
|
-
|
|
8
|
+
import { DBaseStateSet } from "./d-base-state-set";
|
|
9
|
+
export declare type DLinkUrlValue = string | null | undefined;
|
|
10
|
+
export declare type DLinkUrlMaker = () => DLinkUrlValue | Promise<DLinkUrlValue>;
|
|
11
|
+
export declare type DLinkTargetValue = DLinkTarget | null | undefined | keyof typeof DLinkTarget;
|
|
9
12
|
export declare type DLinkChecker = () => boolean | Promise<boolean>;
|
|
10
13
|
export interface DLinkOptions {
|
|
11
|
-
url?:
|
|
12
|
-
target?:
|
|
14
|
+
url?: DLinkUrlValue | DLinkUrlMaker;
|
|
15
|
+
target?: DLinkTargetValue;
|
|
13
16
|
checker?: DLinkChecker;
|
|
14
17
|
menu?: DMenuOptions<DLinkMenuItemId> | DMenu<DLinkMenuItemId>;
|
|
15
18
|
}
|
|
16
19
|
export interface DThemeLink {
|
|
17
|
-
|
|
20
|
+
getImageSource(state: DBaseStateSet): Texture | DisplayObject | null;
|
|
21
|
+
getMenuOptions(): DMenuOptions<DLinkMenuItemId>;
|
|
18
22
|
}
|
|
19
23
|
export declare class DLink {
|
|
20
24
|
protected static ANCHOR_ELEMENT?: HTMLAnchorElement;
|
|
21
|
-
protected
|
|
25
|
+
protected static MENU?: DLinkMenu;
|
|
26
|
+
protected _options?: DLinkOptions;
|
|
27
|
+
protected _url: DLinkUrlValue | DLinkUrlMaker;
|
|
22
28
|
protected _target: DLinkTarget;
|
|
23
29
|
protected _checker?: DLinkChecker;
|
|
24
|
-
protected _menu
|
|
25
|
-
protected _theme: DThemeLink;
|
|
30
|
+
protected _menu?: DLinkMenu;
|
|
26
31
|
protected _isEnabled: boolean;
|
|
27
|
-
constructor(
|
|
32
|
+
constructor(options?: DLinkOptions);
|
|
28
33
|
get enable(): boolean;
|
|
29
34
|
set enable(enable: boolean);
|
|
30
|
-
get url():
|
|
31
|
-
set url(url:
|
|
35
|
+
get url(): DLinkUrlValue | DLinkUrlMaker;
|
|
36
|
+
set url(url: DLinkUrlValue | DLinkUrlMaker);
|
|
32
37
|
get target(): DLinkTarget;
|
|
38
|
+
set target(target: DLinkTargetValue);
|
|
39
|
+
get checker(): DLinkChecker | undefined;
|
|
40
|
+
set checker(checker: DLinkChecker | undefined);
|
|
33
41
|
get menu(): DLinkMenu;
|
|
34
|
-
protected
|
|
42
|
+
protected newMenu(): DLinkMenu;
|
|
43
|
+
protected toStringifiedUrl(target: DLinkUrlValue | DLinkUrlMaker, onResolved: (url: string) => void): void;
|
|
35
44
|
protected toNormalizedUrl(url: string): string;
|
|
45
|
+
protected toNormalizedTarget(target: DLinkTargetValue): DLinkTarget;
|
|
36
46
|
/**
|
|
37
47
|
* Copys the URL to the clipboard.
|
|
38
48
|
*/
|
|
@@ -64,4 +74,5 @@ export declare class DLink {
|
|
|
64
74
|
*/
|
|
65
75
|
inNewWindow(e?: InteractionEvent | KeyboardEvent | MouseEvent | TouchEvent): boolean;
|
|
66
76
|
add(base: DBase, onSelect: (e: InteractionEvent) => void): void;
|
|
77
|
+
onClick(base: DBase, isSimulated: boolean): boolean;
|
|
67
78
|
}
|
|
@@ -76,14 +76,14 @@ export interface DListDataSelection<ITEM> extends utils.EventEmitter {
|
|
|
76
76
|
*/
|
|
77
77
|
clear(): void;
|
|
78
78
|
/**
|
|
79
|
-
* Clears all the
|
|
79
|
+
* Clears all the existing items and adds the given item.
|
|
80
80
|
*
|
|
81
81
|
* @param target an item to be added
|
|
82
82
|
* @returns true if the selection is changed
|
|
83
83
|
*/
|
|
84
84
|
clearAndAdd(target: ITEM): boolean;
|
|
85
85
|
/**
|
|
86
|
-
* Clears the
|
|
86
|
+
* Clears the existing items and add all the given items.
|
|
87
87
|
*
|
|
88
88
|
* @param targets items to be added
|
|
89
89
|
* @returns true if the selection is changed
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { DListItemAccessor, DListItemAccessorOptions, DListItemToId, DListItemToImage, DListItemToLabel, DListItemToTitle } from "./d-list-item-accessor";
|
|
1
|
+
import { DListItemAccessor, DListItemAccessorLink, DListItemAccessorOptions, DListItemToId, DListItemToImage, DListItemToLabel, DListItemToTitle } from "./d-list-item-accessor";
|
|
2
2
|
export declare class DListItemAccessorImpl<VALUE> implements DListItemAccessor<VALUE> {
|
|
3
3
|
toLabel: DListItemToLabel<VALUE>;
|
|
4
4
|
toTitle: DListItemToTitle<VALUE>;
|
|
5
5
|
toImage: DListItemToImage<VALUE>;
|
|
6
6
|
toId?: DListItemToId<VALUE>;
|
|
7
|
+
link?: DListItemAccessorLink<VALUE>;
|
|
7
8
|
constructor(options?: DListItemAccessorOptions<VALUE>);
|
|
9
|
+
protected toLink(options?: DListItemAccessorOptions<VALUE>): DListItemAccessorLink<VALUE> | undefined;
|
|
8
10
|
}
|
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
import { DisplayObject, Texture } from "pixi.js";
|
|
2
|
-
|
|
3
|
-
export declare type
|
|
4
|
-
export declare type
|
|
5
|
-
export declare type
|
|
2
|
+
import { DLinkTargetValue, DLinkUrlValue } from "./d-link";
|
|
3
|
+
export declare type DListItemToLabel<VALUE> = (value: VALUE) => string | undefined;
|
|
4
|
+
export declare type DListItemToTitle<VALUE> = (value: VALUE) => string | undefined;
|
|
5
|
+
export declare type DListItemToImage<VALUE> = (value: VALUE) => DisplayObject | Texture | null | undefined;
|
|
6
|
+
export declare type DListItemToId<VALUE> = (value: VALUE) => unknown;
|
|
7
|
+
export declare type DListItemToLinkUrl<VALUE> = (value: VALUE) => DLinkUrlValue | Promise<DLinkUrlValue>;
|
|
8
|
+
export declare type DListItemLinkChecker<VALUE> = (value: VALUE) => boolean | Promise<boolean>;
|
|
9
|
+
export interface DListItemAccessorLinkOptions<VALUE> {
|
|
10
|
+
toUrl?: DListItemToLinkUrl<VALUE>;
|
|
11
|
+
target?: DLinkTargetValue;
|
|
12
|
+
checker?: DListItemLinkChecker<VALUE>;
|
|
13
|
+
}
|
|
14
|
+
export interface DListItemAccessorLink<VALUE> {
|
|
15
|
+
toUrl: DListItemToLinkUrl<VALUE>;
|
|
16
|
+
target: DLinkTargetValue;
|
|
17
|
+
checker?: DListItemLinkChecker<VALUE>;
|
|
18
|
+
}
|
|
6
19
|
export interface DListItemAccessorOptions<VALUE> {
|
|
7
20
|
toLabel?: DListItemToLabel<VALUE>;
|
|
8
21
|
toTitle?: DListItemToTitle<VALUE>;
|
|
9
22
|
toImage?: DListItemToImage<VALUE>;
|
|
10
23
|
toId?: DListItemToId<VALUE>;
|
|
24
|
+
link?: DListItemAccessorLinkOptions<VALUE>;
|
|
11
25
|
}
|
|
12
26
|
export interface DListItemAccessor<VALUE> {
|
|
13
27
|
toLabel: DListItemToLabel<VALUE>;
|
|
14
28
|
toTitle: DListItemToTitle<VALUE>;
|
|
15
29
|
toImage: DListItemToImage<VALUE>;
|
|
16
30
|
toId?: DListItemToId<VALUE>;
|
|
31
|
+
link?: DListItemAccessorLink<VALUE>;
|
|
17
32
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { interaction } from "pixi.js";
|
|
2
2
|
import { DImageBase, DImageBaseEvents, DImageBaseOptions, DThemeImageBase } from "./d-image-base";
|
|
3
|
+
import { DLink, DLinkChecker, DLinkOptions, DLinkUrlMaker } from "./d-link";
|
|
3
4
|
import { DListData } from "./d-list-data";
|
|
5
|
+
import { DListItemAccessorLink, DListItemLinkChecker, DListItemToLinkUrl } from "./d-list-item-accessor";
|
|
4
6
|
import { DOnOptions } from "./d-on-options";
|
|
5
7
|
/**
|
|
6
8
|
* {@link DListItem} events.
|
|
@@ -40,9 +42,12 @@ export declare class DListItem<VALUE = unknown, THEME extends DThemeListItem = D
|
|
|
40
42
|
protected _data: DListData<VALUE>;
|
|
41
43
|
protected _value?: VALUE;
|
|
42
44
|
protected _index?: number;
|
|
45
|
+
protected _link?: DLink;
|
|
43
46
|
constructor(data: DListData<VALUE>, options?: OPTIONS);
|
|
44
|
-
protected
|
|
45
|
-
protected
|
|
47
|
+
protected initOnClick(data: DListData<VALUE>, options?: OPTIONS): void;
|
|
48
|
+
protected toLinkOptions(accessor: DListItemAccessorLink<VALUE>): DLinkOptions;
|
|
49
|
+
protected toLinkUrl(toUrl: DListItemToLinkUrl<VALUE>): DLinkUrlMaker;
|
|
50
|
+
protected toLinkChecker(checker?: DListItemLinkChecker<VALUE>): DLinkChecker | undefined;
|
|
46
51
|
get value(): VALUE | undefined;
|
|
47
52
|
get index(): number | undefined;
|
|
48
53
|
protected onSelect(e: interaction.InteractionEvent | KeyboardEvent | MouseEvent | TouchEvent | undefined, value: VALUE): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { interaction } from "pixi.js";
|
|
2
|
-
import { DLink, DLinkChecker, DLinkOptions, DLinkUrlMaker
|
|
2
|
+
import { DLink, DLinkChecker, DLinkOptions, DLinkUrlMaker } from "./d-link";
|
|
3
3
|
import { DLinkMenuItemId } from "./d-link-menu-item-id";
|
|
4
4
|
import { DLinkTarget } from "./d-link-target";
|
|
5
5
|
import { DMenu, DMenuOptions } from "./d-menu";
|
|
@@ -12,7 +12,7 @@ export interface DMenuItemLinkOptions<VALUE = unknown, THEME extends DThemeMenuI
|
|
|
12
12
|
checker?: DMenuItemLinkChecker;
|
|
13
13
|
menu?: DMenuOptions<DLinkMenuItemId> | DMenu<DLinkMenuItemId>;
|
|
14
14
|
}
|
|
15
|
-
export interface DThemeMenuItemLink extends DThemeMenuItemText
|
|
15
|
+
export interface DThemeMenuItemLink extends DThemeMenuItemText {
|
|
16
16
|
}
|
|
17
17
|
export declare class DMenuItemLink<VALUE = unknown, THEME extends DThemeMenuItemLink = DThemeMenuItemLink, OPTIONS extends DMenuItemLinkOptions<VALUE, THEME> = DMenuItemLinkOptions<VALUE, THEME>> extends DMenuItemText<VALUE, THEME, OPTIONS> {
|
|
18
18
|
protected _link: DLink;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { interaction } from "pixi.js";
|
|
2
2
|
import { DButtonBaseWhen } from "./d-button-base-when";
|
|
3
|
-
import { DLink, DLinkChecker, DLinkOptions, DLinkUrlMaker
|
|
3
|
+
import { DLink, DLinkChecker, DLinkOptions, DLinkUrlMaker } from "./d-link";
|
|
4
4
|
import { DLinkMenuItemId } from "./d-link-menu-item-id";
|
|
5
5
|
import { DLinkTarget } from "./d-link-target";
|
|
6
6
|
import { DMenu, DMenuOptions } from "./d-menu";
|
|
@@ -18,7 +18,7 @@ export interface DTableBodyCellLinkLinkOptions<ROW, VALUE> {
|
|
|
18
18
|
export interface DTableBodyCellLinkOptions<ROW, VALUE = unknown, THEME extends DThemeTableBodyCellLink<VALUE> = DThemeTableBodyCellLink<VALUE>> extends DTableBodyCellButtonOptions<ROW, VALUE, THEME> {
|
|
19
19
|
link?: DTableBodyCellLinkLinkOptions<ROW, VALUE>;
|
|
20
20
|
}
|
|
21
|
-
export interface DThemeTableBodyCellLink<VALUE = unknown> extends DThemeTableBodyCellButton<VALUE
|
|
21
|
+
export interface DThemeTableBodyCellLink<VALUE = unknown> extends DThemeTableBodyCellButton<VALUE> {
|
|
22
22
|
}
|
|
23
23
|
export declare const toLinkOptions: <ROW, VALUE>(cell: DTableBodyCell<ROW, VALUE | null>, options?: DTableBodyCellLinkLinkOptions<ROW, VALUE> | undefined) => DLinkOptions | undefined;
|
|
24
24
|
export declare const toUrl: <ROW, VALUE>(cell: DTableBodyCell<ROW, VALUE | null>, url?: string | DTableBodyCellLinkUrlMaker<ROW, VALUE> | undefined) => string | DLinkUrlMaker | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { interaction, Point } from "pixi.js";
|
|
2
2
|
import { DBasePaddingAdjustable } from "./d-base-padding-adjustable";
|
|
3
3
|
import { DButtonBaseWhen } from "./d-button-base-when";
|
|
4
|
-
import { DLink
|
|
4
|
+
import { DLink } from "./d-link";
|
|
5
5
|
import { DTableBodyCellButton, DTableBodyCellButtonOptions, DThemeTableBodyCellButton } from "./d-table-body-cell-button";
|
|
6
6
|
import { DTableBodyCellLinkLinkOptions } from "./d-table-body-cell-link";
|
|
7
7
|
import { DTableColumn } from "./d-table-column";
|
|
@@ -9,7 +9,7 @@ import { DTableBodyCellOnChange } from "./d-table-body-cell";
|
|
|
9
9
|
export interface DTableBodyCellTreeOptions<ROW, VALUE = unknown, THEME extends DThemeTableBodyCellTree<VALUE> = DThemeTableBodyCellTree<VALUE>> extends DTableBodyCellButtonOptions<ROW, VALUE, THEME> {
|
|
10
10
|
link?: DTableBodyCellLinkLinkOptions<ROW, VALUE>;
|
|
11
11
|
}
|
|
12
|
-
export interface DThemeTableBodyCellTree<VALUE = unknown> extends DThemeTableBodyCellButton<VALUE
|
|
12
|
+
export interface DThemeTableBodyCellTree<VALUE = unknown> extends DThemeTableBodyCellButton<VALUE> {
|
|
13
13
|
getLevelPadding(level: number): number;
|
|
14
14
|
}
|
|
15
15
|
export declare class DTableBodyCellTree<ROW, VALUE = unknown, THEME extends DThemeTableBodyCellTree<VALUE> = DThemeTableBodyCellTree<VALUE>, OPTIONS extends DTableBodyCellTreeOptions<ROW, VALUE, THEME> = DTableBodyCellTreeOptions<ROW, VALUE, THEME>> extends DTableBodyCellButton<ROW, VALUE, THEME, OPTIONS> {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { DThemeButtonLink } from "../../d-button-link";
|
|
2
|
-
import { DLinkMenuItemId } from "../../d-link-menu-item-id";
|
|
3
|
-
import { DMenuOptions } from "../../d-menu";
|
|
4
2
|
import { DThemeDarkButtonAmbient } from "./d-theme-dark-button-ambient";
|
|
5
3
|
export declare class DThemeDarkButtonLink<VALUE = unknown> extends DThemeDarkButtonAmbient<VALUE> implements DThemeButtonLink<VALUE> {
|
|
6
|
-
getLinkMenuOptions(): DMenuOptions<DLinkMenuItemId>;
|
|
7
4
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DisplayObject, Texture } from "pixi.js";
|
|
2
|
+
import { DThemeLink } from "../..";
|
|
3
|
+
import { DBaseStateSet } from "../../d-base-state-set";
|
|
4
|
+
import { DLinkMenuItemId } from "../../d-link-menu-item-id";
|
|
5
|
+
import { DMenuOptions } from "../../d-menu";
|
|
6
|
+
export declare class DThemeDarkLink implements DThemeLink {
|
|
7
|
+
getImageSource(state: DBaseStateSet): Texture | DisplayObject | null;
|
|
8
|
+
getMenuOptions(): DMenuOptions<DLinkMenuItemId>;
|
|
9
|
+
protected getLabelOpenLink(): string;
|
|
10
|
+
protected getLabelOpenLinkInNewWindow(): string;
|
|
11
|
+
protected getLabelCopyLinkAddress(): string;
|
|
12
|
+
}
|
|
@@ -2,14 +2,14 @@ import { DisplayObject, Texture } from "pixi.js";
|
|
|
2
2
|
import { DAlignHorizontal } from "../../d-align-horizontal";
|
|
3
3
|
import { DAlignWith } from "../../d-align-with";
|
|
4
4
|
import { DBaseStateSet } from "../../d-base-state-set";
|
|
5
|
-
import {
|
|
6
|
-
import { DMenuOptions } from "../../d-menu";
|
|
5
|
+
import { DThemeLink } from "../../d-link";
|
|
7
6
|
import { DThemeMenuItemLink } from "../../d-menu-item-link";
|
|
8
7
|
import { DThemeDarkMenuItemText } from "./d-theme-dark-menu-item-text";
|
|
9
8
|
export declare class DThemeDarkMenuItemLink extends DThemeDarkMenuItemText implements DThemeMenuItemLink {
|
|
9
|
+
protected _link: DThemeLink;
|
|
10
|
+
constructor();
|
|
10
11
|
getImageSource(state: DBaseStateSet): Texture | DisplayObject | null;
|
|
11
12
|
getImageTintAlpha(state: DBaseStateSet): number;
|
|
12
13
|
getImageAlignWith(): DAlignWith;
|
|
13
14
|
getImageAlignHorizontal(): DAlignHorizontal;
|
|
14
|
-
getLinkMenuOptions(): DMenuOptions<DLinkMenuItemId>;
|
|
15
15
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DisplayObject, Texture } from "pixi.js";
|
|
2
2
|
import { DBaseStateSet } from "../../d-base-state-set";
|
|
3
|
-
import {
|
|
4
|
-
import { DMenuOptions } from "../../d-menu";
|
|
3
|
+
import { DThemeLink } from "../../d-link";
|
|
5
4
|
import { DThemeTableBodyCellLink } from "../../d-table-body-cell-link";
|
|
6
5
|
import { DThemeDarkTableBodyCellButton } from "./d-theme-dark-table-body-cell-button";
|
|
7
6
|
export declare class DThemeDarkTableBodyCellLink extends DThemeDarkTableBodyCellButton implements DThemeTableBodyCellLink {
|
|
7
|
+
protected _link: DThemeLink;
|
|
8
|
+
constructor();
|
|
8
9
|
getImageTintColor(state: DBaseStateSet): number | null;
|
|
9
10
|
getImageSource(state: DBaseStateSet): Texture | DisplayObject | null;
|
|
10
|
-
getLinkMenuOptions(): DMenuOptions<DLinkMenuItemId>;
|
|
11
11
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { DisplayObject, Texture } from "pixi.js";
|
|
2
2
|
import { DAlignWith } from "../../d-align-with";
|
|
3
3
|
import { DBaseStateSet } from "../../d-base-state-set";
|
|
4
|
-
import { DLinkMenuItemId } from "../../d-link-menu-item-id";
|
|
5
|
-
import { DMenuOptions } from "../../d-menu";
|
|
6
4
|
import { DThemeTableBodyCellTree } from "../../d-table-body-cell-tree";
|
|
7
5
|
import { DThemeDarkTableBodyCellButton } from "./d-theme-dark-table-body-cell-button";
|
|
8
6
|
export declare class DThemeDarkTableBodyCellTree extends DThemeDarkTableBodyCellButton implements DThemeTableBodyCellTree {
|
|
@@ -12,5 +10,4 @@ export declare class DThemeDarkTableBodyCellTree extends DThemeDarkTableBodyCell
|
|
|
12
10
|
getImageSource(state: DBaseStateSet): Texture | DisplayObject | null;
|
|
13
11
|
getImageTintColor(state: DBaseStateSet): number | null;
|
|
14
12
|
getImageTintAlpha(state: DBaseStateSet): number;
|
|
15
|
-
getLinkMenuOptions(): DMenuOptions<DLinkMenuItemId>;
|
|
16
13
|
}
|
|
@@ -64,6 +64,8 @@ export * from "./d-theme-dark-dialog-select-list";
|
|
|
64
64
|
export * from "./d-theme-dark-dialog-select-list-item";
|
|
65
65
|
export * from "./d-theme-dark-dialog-time";
|
|
66
66
|
export * from "./d-theme-dark-dropdown";
|
|
67
|
+
export * from "./d-theme-dark-expandable";
|
|
68
|
+
export * from "./d-theme-dark-expandable-header";
|
|
67
69
|
export * from "./d-theme-dark-font";
|
|
68
70
|
export * from "./d-theme-dark-html-element";
|
|
69
71
|
export * from "./d-theme-dark-image";
|
|
@@ -85,8 +87,7 @@ export * from "./d-theme-dark-layout-horizontal";
|
|
|
85
87
|
export * from "./d-theme-dark-layout-space";
|
|
86
88
|
export * from "./d-theme-dark-layout-vertical";
|
|
87
89
|
export * from "./d-theme-dark-layout";
|
|
88
|
-
export * from "./d-theme-dark-
|
|
89
|
-
export * from "./d-theme-dark-expandable-header";
|
|
90
|
+
export * from "./d-theme-dark-link";
|
|
90
91
|
export * from "./d-theme-dark-list-item-ambient";
|
|
91
92
|
export * from "./d-theme-dark-list-item";
|
|
92
93
|
export * from "./d-theme-dark-list-items";
|
|
@@ -55,6 +55,7 @@ export * from "./load-theme-dark-input-search";
|
|
|
55
55
|
export * from "./load-theme-dark-input-text-area";
|
|
56
56
|
export * from "./load-theme-dark-input-text";
|
|
57
57
|
export * from "./load-theme-dark-layout";
|
|
58
|
+
export * from "./load-theme-dark-link";
|
|
58
59
|
export * from "./load-theme-dark-list";
|
|
59
60
|
export * from "./load-theme-dark-tree";
|
|
60
61
|
export * from "./load-theme-dark-menu";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loadThemeDarkLink: () => void;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { DThemeButtonLink } from "../../d-button-link";
|
|
2
|
-
import { DLinkMenuItemId } from "../../d-link-menu-item-id";
|
|
3
|
-
import { DMenuOptions } from "../../d-menu";
|
|
4
2
|
import { DThemeWhiteButtonAmbient } from "./d-theme-white-button-ambient";
|
|
5
3
|
export declare class DThemeWhiteButtonLink<VALUE = unknown> extends DThemeWhiteButtonAmbient<VALUE> implements DThemeButtonLink<VALUE> {
|
|
6
|
-
getLinkMenuOptions(): DMenuOptions<DLinkMenuItemId>;
|
|
7
4
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DisplayObject, Texture } from "pixi.js";
|
|
2
|
+
import { DBaseStateSet } from "../../d-base-state-set";
|
|
3
|
+
import { DThemeLink } from "../../d-link";
|
|
4
|
+
import { DLinkMenuItemId } from "../../d-link-menu-item-id";
|
|
5
|
+
import { DMenuOptions } from "../../d-menu";
|
|
6
|
+
export declare class DThemeWhiteLink implements DThemeLink {
|
|
7
|
+
getImageSource(state: DBaseStateSet): Texture | DisplayObject | null;
|
|
8
|
+
getMenuOptions(): DMenuOptions<DLinkMenuItemId>;
|
|
9
|
+
protected getLabelOpenLink(): string;
|
|
10
|
+
protected getLabelOpenInNewWindow(): string;
|
|
11
|
+
protected getOpenCopyLinkAddress(): string;
|
|
12
|
+
}
|
|
@@ -2,14 +2,14 @@ import { DisplayObject, Texture } from "pixi.js";
|
|
|
2
2
|
import { DAlignHorizontal } from "../../d-align-horizontal";
|
|
3
3
|
import { DAlignWith } from "../../d-align-with";
|
|
4
4
|
import { DBaseStateSet } from "../../d-base-state-set";
|
|
5
|
-
import {
|
|
6
|
-
import { DMenuOptions } from "../../d-menu";
|
|
5
|
+
import { DThemeLink } from "../../d-link";
|
|
7
6
|
import { DThemeMenuItemLink } from "../../d-menu-item-link";
|
|
8
7
|
import { DThemeWhiteMenuItemText } from "./d-theme-white-menu-item-text";
|
|
9
8
|
export declare class DThemeWhiteMenuItemLink extends DThemeWhiteMenuItemText implements DThemeMenuItemLink {
|
|
9
|
+
protected _link: DThemeLink;
|
|
10
|
+
constructor();
|
|
10
11
|
getImageSource(state: DBaseStateSet): Texture | DisplayObject | null;
|
|
11
12
|
getImageTintAlpha(state: DBaseStateSet): number;
|
|
12
13
|
getImageAlignWith(): DAlignWith;
|
|
13
14
|
getImageAlignHorizontal(): DAlignHorizontal;
|
|
14
|
-
getLinkMenuOptions(): DMenuOptions<DLinkMenuItemId>;
|
|
15
15
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DisplayObject, Texture } from "pixi.js";
|
|
2
2
|
import { DBaseStateSet } from "../../d-base-state-set";
|
|
3
|
-
import {
|
|
4
|
-
import { DMenuOptions } from "../../d-menu";
|
|
3
|
+
import { DThemeLink } from "../../d-link";
|
|
5
4
|
import { DThemeTableBodyCellLink } from "../../d-table-body-cell-link";
|
|
6
5
|
import { DThemeWhiteTableBodyCellButton } from "./d-theme-white-table-body-cell-button";
|
|
7
6
|
export declare class DThemeWhiteTableBodyCellLink extends DThemeWhiteTableBodyCellButton implements DThemeTableBodyCellLink {
|
|
7
|
+
protected _link: DThemeLink;
|
|
8
|
+
constructor();
|
|
8
9
|
getImageTintColor(state: DBaseStateSet): number | null;
|
|
9
10
|
getImageSource(state: DBaseStateSet): Texture | DisplayObject | null;
|
|
10
|
-
getLinkMenuOptions(): DMenuOptions<DLinkMenuItemId>;
|
|
11
11
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { DisplayObject, Texture } from "pixi.js";
|
|
2
2
|
import { DAlignWith } from "../../d-align-with";
|
|
3
3
|
import { DBaseStateSet } from "../../d-base-state-set";
|
|
4
|
-
import { DLinkMenuItemId } from "../../d-link-menu-item-id";
|
|
5
|
-
import { DMenuOptions } from "../../d-menu";
|
|
6
4
|
import { DThemeTableBodyCellTree } from "../../d-table-body-cell-tree";
|
|
7
5
|
import { DThemeWhiteTableBodyCellButton } from "./d-theme-white-table-body-cell-button";
|
|
8
6
|
export declare class DThemeWhiteTableBodyCellTree extends DThemeWhiteTableBodyCellButton implements DThemeTableBodyCellTree {
|
|
@@ -12,5 +10,4 @@ export declare class DThemeWhiteTableBodyCellTree extends DThemeWhiteTableBodyCe
|
|
|
12
10
|
getImageSource(state: DBaseStateSet): Texture | DisplayObject | null;
|
|
13
11
|
getImageTintColor(state: DBaseStateSet): number | null;
|
|
14
12
|
getImageTintAlpha(state: DBaseStateSet): number;
|
|
15
|
-
getLinkMenuOptions(): DMenuOptions<DLinkMenuItemId>;
|
|
16
13
|
}
|
|
@@ -87,6 +87,7 @@ export * from "./d-theme-white-layout-horizontal";
|
|
|
87
87
|
export * from "./d-theme-white-layout-space";
|
|
88
88
|
export * from "./d-theme-white-layout-vertical";
|
|
89
89
|
export * from "./d-theme-white-layout";
|
|
90
|
+
export * from "./d-theme-white-link";
|
|
90
91
|
export * from "./d-theme-white-list-item-ambient";
|
|
91
92
|
export * from "./d-theme-white-list-item";
|
|
92
93
|
export * from "./d-theme-white-list-items";
|
|
@@ -53,6 +53,7 @@ export * from "./load-theme-white-input-search";
|
|
|
53
53
|
export * from "./load-theme-white-input-text-area";
|
|
54
54
|
export * from "./load-theme-white-input-text";
|
|
55
55
|
export * from "./load-theme-white-layout";
|
|
56
|
+
export * from "./load-theme-white-link";
|
|
56
57
|
export * from "./load-theme-white-list";
|
|
57
58
|
export * from "./load-theme-white-tree";
|
|
58
59
|
export * from "./load-theme-white-menu-bar";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loadThemeWhiteLink: () => void;
|
|
@@ -13,7 +13,7 @@ var DButtonLink = /** @class */ (function (_super) {
|
|
|
13
13
|
}
|
|
14
14
|
DButtonLink.prototype.initOnClick = function (when, theme, options) {
|
|
15
15
|
var _this = this;
|
|
16
|
-
var link = new DLink(
|
|
16
|
+
var link = new DLink(options);
|
|
17
17
|
this._link = link;
|
|
18
18
|
link.add(this, function (e) {
|
|
19
19
|
if (when === DButtonBaseWhen.CLICKED) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-button-link.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-button-link.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,WAAW,EAAwC,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"d-button-link.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-button-link.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,WAAW,EAAwC,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAgB,MAAM,UAAU,CAAC;AAU/C;IAIU,+BAAkC;IAJ5C;;IAmCA,CAAC;IA5BU,iCAAW,GAArB,UAAsB,IAAqB,EAAE,KAAY,EAAE,OAAiB;QAA5E,iBAQC;QAPA,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,UAAC,CAA+B;YAC9C,IAAI,IAAI,KAAK,eAAe,CAAC,OAAO,EAAE;gBACrC,KAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;aAChB;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,sBAAI,6BAAI;aAAR;YACC,OAAO,IAAI,CAAC,KAAK,CAAC;QACnB,CAAC;;;OAAA;IAES,gCAAU,GAApB,UACC,CAA0E;QAE1E,iBAAM,UAAU,YAAC,CAAC,CAAC,CAAC;QACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,0BAAI,GAAJ,UAAK,WAAoB;QACxB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9B,CAAC;IAES,6BAAO,GAAjB;QACC,OAAO,aAAa,CAAC;IACtB,CAAC;IACF,kBAAC;AAAD,CAAC,AAnCD,CAIU,WAAW,GA+BpB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { interaction } from \"pixi.js\";\nimport { DButtonBase, DButtonBaseOptions, DThemeButtonBase } from \"./d-button-base\";\nimport { DButtonBaseWhen } from \"./d-button-base-when\";\nimport { DLink, DLinkOptions } from \"./d-link\";\n\nexport interface DButtonLinkOptions<\n\tVALUE = unknown,\n\tTHEME extends DThemeButtonLink<VALUE> = DThemeButtonLink<VALUE>\n> extends DButtonBaseOptions<VALUE, THEME>,\n\t\tDLinkOptions {}\n\nexport interface DThemeButtonLink<VALUE = unknown> extends DThemeButtonBase<VALUE> {}\n\nexport class DButtonLink<\n\tVALUE = unknown,\n\tTHEME extends DThemeButtonLink<VALUE> = DThemeButtonLink<VALUE>,\n\tOPTIONS extends DButtonLinkOptions<VALUE, THEME> = DButtonLinkOptions<VALUE, THEME>\n> extends DButtonBase<VALUE, THEME, OPTIONS> {\n\tprotected _link!: DLink;\n\n\tprotected initOnClick(when: DButtonBaseWhen, theme: THEME, options?: OPTIONS): void {\n\t\tconst link = new DLink(options);\n\t\tthis._link = link;\n\t\tlink.add(this, (e: interaction.InteractionEvent): void => {\n\t\t\tif (when === DButtonBaseWhen.CLICKED) {\n\t\t\t\tthis.onClick(e);\n\t\t\t}\n\t\t});\n\t}\n\n\tget link(): DLink {\n\t\treturn this._link;\n\t}\n\n\tprotected onActivate(\n\t\te?: interaction.InteractionEvent | KeyboardEvent | MouseEvent | TouchEvent\n\t): void {\n\t\tsuper.onActivate(e);\n\t\tthis._link.open(e);\n\t}\n\n\topen(inNewWindow: boolean): void {\n\t\tthis._link.open(inNewWindow);\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DButtonLink\";\n\t}\n}\n"]}
|
|
@@ -11,15 +11,14 @@ import { isString } from "./util/is-string";
|
|
|
11
11
|
import { toEnum } from "./util/to-enum";
|
|
12
12
|
import { UtilClipboard } from "./util/util-clipboard";
|
|
13
13
|
import { UtilPointerEvent } from "./util/util-pointer-event";
|
|
14
|
+
import { DThemes } from "./theme/d-themes";
|
|
14
15
|
var DLink = /** @class */ (function () {
|
|
15
|
-
function DLink(
|
|
16
|
-
|
|
17
|
-
this._url =
|
|
18
|
-
this._target =
|
|
16
|
+
function DLink(options) {
|
|
17
|
+
this._options = options;
|
|
18
|
+
this._url = options === null || options === void 0 ? void 0 : options.url;
|
|
19
|
+
this._target = this.toNormalizedTarget(options === null || options === void 0 ? void 0 : options.target);
|
|
19
20
|
this._checker = options === null || options === void 0 ? void 0 : options.checker;
|
|
20
|
-
this._theme = theme;
|
|
21
21
|
this._isEnabled = true;
|
|
22
|
-
this._menu = new DLinkMenu(this, (_c = options === null || options === void 0 ? void 0 : options.menu) !== null && _c !== void 0 ? _c : theme.getLinkMenuOptions());
|
|
23
22
|
}
|
|
24
23
|
Object.defineProperty(DLink.prototype, "enable", {
|
|
25
24
|
get: function () {
|
|
@@ -45,16 +44,49 @@ var DLink = /** @class */ (function () {
|
|
|
45
44
|
get: function () {
|
|
46
45
|
return this._target;
|
|
47
46
|
},
|
|
47
|
+
set: function (target) {
|
|
48
|
+
this._target = this.toNormalizedTarget(target);
|
|
49
|
+
},
|
|
50
|
+
enumerable: false,
|
|
51
|
+
configurable: true
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(DLink.prototype, "checker", {
|
|
54
|
+
get: function () {
|
|
55
|
+
return this._checker;
|
|
56
|
+
},
|
|
57
|
+
set: function (checker) {
|
|
58
|
+
this._checker = checker;
|
|
59
|
+
},
|
|
48
60
|
enumerable: false,
|
|
49
61
|
configurable: true
|
|
50
62
|
});
|
|
51
63
|
Object.defineProperty(DLink.prototype, "menu", {
|
|
52
64
|
get: function () {
|
|
53
|
-
|
|
65
|
+
var result = this._menu;
|
|
66
|
+
if (result == null) {
|
|
67
|
+
result = this.newMenu();
|
|
68
|
+
this._menu = result;
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
54
71
|
},
|
|
55
72
|
enumerable: false,
|
|
56
73
|
configurable: true
|
|
57
74
|
});
|
|
75
|
+
DLink.prototype.newMenu = function () {
|
|
76
|
+
var options = this._options;
|
|
77
|
+
if (options) {
|
|
78
|
+
var menu = options.menu;
|
|
79
|
+
if (menu) {
|
|
80
|
+
return new DLinkMenu(this, menu);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
var result = DLink.MENU;
|
|
84
|
+
if (result == null) {
|
|
85
|
+
result = new DLinkMenu(this, DThemes.getInstance().get("DLink").getMenuOptions());
|
|
86
|
+
DLink.MENU = result;
|
|
87
|
+
}
|
|
88
|
+
return result;
|
|
89
|
+
};
|
|
58
90
|
DLink.prototype.toStringifiedUrl = function (target, onResolved) {
|
|
59
91
|
var url = isFunction(target) ? target() : target;
|
|
60
92
|
if (url != null) {
|
|
@@ -76,6 +108,9 @@ var DLink = /** @class */ (function () {
|
|
|
76
108
|
a.href = url;
|
|
77
109
|
return a.href;
|
|
78
110
|
};
|
|
111
|
+
DLink.prototype.toNormalizedTarget = function (target) {
|
|
112
|
+
return toEnum(target !== null && target !== void 0 ? target : DLinkTarget.AUTO, DLinkTarget);
|
|
113
|
+
};
|
|
79
114
|
/**
|
|
80
115
|
* Copys the URL to the clipboard.
|
|
81
116
|
*/
|
|
@@ -164,28 +199,26 @@ var DLink = /** @class */ (function () {
|
|
|
164
199
|
};
|
|
165
200
|
DLink.prototype.add = function (base, onSelect) {
|
|
166
201
|
var _this = this;
|
|
167
|
-
|
|
168
|
-
if (_this.
|
|
202
|
+
UtilPointerEvent.onClick(base, function (e, isSimulated) {
|
|
203
|
+
if (!_this.onClick(base, isSimulated)) {
|
|
169
204
|
onSelect(e);
|
|
170
205
|
}
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (
|
|
178
|
-
|
|
179
|
-
if (menu.enable) {
|
|
180
|
-
if (_this._isEnabled && base.state.isActionable) {
|
|
181
|
-
menu.open(base);
|
|
182
|
-
}
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
DLink.prototype.onClick = function (base, isSimulated) {
|
|
209
|
+
if (this._target === DLinkTarget.AUTO && isSimulated) {
|
|
210
|
+
var menu = this.menu;
|
|
211
|
+
if (menu.enable) {
|
|
212
|
+
if (this._isEnabled && base.state.isActionable) {
|
|
213
|
+
menu.open(base);
|
|
185
214
|
}
|
|
186
|
-
|
|
187
|
-
}
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (this._isEnabled && base.state.isActionable) {
|
|
219
|
+
return false;
|
|
188
220
|
}
|
|
221
|
+
return true;
|
|
189
222
|
};
|
|
190
223
|
return DLink;
|
|
191
224
|
}());
|