@wcardinal/wcardinal-ui 0.200.3 → 0.201.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.
Files changed (26) hide show
  1. package/dist/types/wcardinal/ui/{d-controller-default-command.d.ts → d-controller-command-impl.d.ts} +1 -1
  2. package/dist/types/wcardinal/ui/{d-controller-default-focus.d.ts → d-controller-focus-impl.d.ts} +1 -1
  3. package/dist/types/wcardinal/ui/index.d.ts +2 -2
  4. package/dist/wcardinal/ui/d-application.js +2 -2
  5. package/dist/wcardinal/ui/d-application.js.map +1 -1
  6. package/dist/wcardinal/ui/d-base.js +2 -2
  7. package/dist/wcardinal/ui/d-base.js.map +1 -1
  8. package/dist/wcardinal/ui/{d-controller-default-command.js → d-controller-command-impl.js} +24 -24
  9. package/dist/wcardinal/ui/d-controller-command-impl.js.map +1 -0
  10. package/dist/wcardinal/ui/{d-controller-default-focus.js → d-controller-focus-impl.js} +20 -18
  11. package/dist/wcardinal/ui/d-controller-focus-impl.js.map +1 -0
  12. package/dist/wcardinal/ui/d-controllers.js +2 -2
  13. package/dist/wcardinal/ui/d-controllers.js.map +1 -1
  14. package/dist/wcardinal/ui/index.js +2 -2
  15. package/dist/wcardinal/ui/index.js.map +1 -1
  16. package/dist/wcardinal-ui-theme-dark.js +1 -1
  17. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  18. package/dist/wcardinal-ui-theme-white.js +1 -1
  19. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  20. package/dist/wcardinal-ui.cjs.js +47 -45
  21. package/dist/wcardinal-ui.js +47 -45
  22. package/dist/wcardinal-ui.min.js +2 -2
  23. package/dist/wcardinal-ui.min.js.map +1 -1
  24. package/package.json +1 -1
  25. package/dist/wcardinal/ui/d-controller-default-command.js.map +0 -1
  26. package/dist/wcardinal/ui/d-controller-default-focus.js.map +0 -1
@@ -3,7 +3,7 @@ import { DCommand } from "./d-command";
3
3
  import { DCommandRedo } from "./d-command-redo";
4
4
  import { DCommandUndo } from "./d-command-undo";
5
5
  import { DControllerCommand } from "./d-controller-command";
6
- export declare class DControllerDefaultCommand extends utils.EventEmitter implements DControllerCommand {
6
+ export declare class DControllerCommandImpl extends utils.EventEmitter implements DControllerCommand {
7
7
  protected _position: number;
8
8
  protected _done: DCommand[];
9
9
  protected _waiting: DCommand[];
@@ -1,5 +1,5 @@
1
1
  import { DControllerFocus, DFocusable, DFocusableContainer, DFocusableMightBe } from "./d-controller-focus";
2
- export declare class DControllerDefaultFocus implements DControllerFocus {
2
+ export declare class DControllerFocusImpl implements DControllerFocus {
3
3
  private _focused;
4
4
  focus(focusable: DFocusable | null): DFocusable | null;
5
5
  blur(focusable: DFocusable | null): DFocusable | null;
@@ -175,10 +175,10 @@ export * from "./d-command-save";
175
175
  export * from "./d-command-undo";
176
176
  export * from "./d-command";
177
177
  export * from "./d-content";
178
+ export * from "./d-controller-command-impl";
178
179
  export * from "./d-controller-command";
179
- export * from "./d-controller-default-command";
180
- export * from "./d-controller-default-focus";
181
180
  export * from "./d-controller-document";
181
+ export * from "./d-controller-focus-impl";
182
182
  export * from "./d-controller-focus";
183
183
  export * from "./d-controller-keyboard";
184
184
  export * from "./d-controllers";
@@ -6,7 +6,7 @@ import { Renderer } from "pixi.js";
6
6
  import { DApplicationLayer } from "./d-application-layer";
7
7
  import { DApplicationLayerOptions } from "./d-application-layer-options";
8
8
  import { DApplications } from "./d-applications";
9
- import { DControllerDefaultFocus } from "./d-controller-default-focus";
9
+ import { DControllerFocusImpl } from "./d-controller-focus-impl";
10
10
  import { isString } from "./util/is-string";
11
11
  var DApplication = /** @class */ (function () {
12
12
  function DApplication(options) {
@@ -83,7 +83,7 @@ var DApplication = /** @class */ (function () {
83
83
  };
84
84
  DApplication.prototype.getFocusController = function () {
85
85
  if (this._focus == null) {
86
- this._focus = new DControllerDefaultFocus();
86
+ this._focus = new DControllerFocusImpl();
87
87
  }
88
88
  return this._focus;
89
89
  };
@@ -1 +1 @@
1
- {"version":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AAI,CAAC,KAAK,CAAC;YACxB,IAAI,CAAC,MAAM,EAAE,CAAC;YAEd,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC9B,IAAI,OAAO,EAAE;gBACZ,OAAO,CAAC,MAAM,EAAE,CAAC;aACjB;SACD;aAAM;YACN,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;SAC3B;IACF,CAAC;IACF,mBAAC;AAAD,CAAC,AA1LD,IA0LC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Container, Renderer } from \"pixi.js\";\nimport { DApplicationLayer } from \"./d-application-layer\";\nimport { DApplicationLayerOptions } from \"./d-application-layer-options\";\nimport { DApplicationLike } from \"./d-application-like\";\nimport { DApplications } from \"./d-applications\";\nimport { DControllerDefaultFocus } from \"./d-controller-default-focus\";\nimport { DControllerFocus } from \"./d-controller-focus\";\nimport { DPaddingLike } from \"./d-padding\";\nimport { isString } from \"./util/is-string\";\n\nexport interface DApplicationBackgroundOptions {\n\tcolor?: number;\n}\n\nexport interface DApplicationOptions {\n\t/**\n\t * A root element selector or a root element.\n\t * `HTMLCanvasElement` and other DOM elements are created in this element.\n\t * The default root element is `document.body`.\n\t */\n\troot?: string | HTMLElement;\n\n\t/**\n\t * Padding settings.\n\t */\n\tpadding?: number | DPaddingLike;\n\n\t/**\n\t * A canvas width.\n\t */\n\twidth?: number;\n\n\t/**\n\t * A canvas height.\n\t */\n\theight?: number;\n\n\t/**\n\t * A background setting.\n\t */\n\tbackground?: DApplicationBackgroundOptions;\n\n\t/**\n\t * An antialias setting.\n\t */\n\tantialias?: boolean;\n\n\t/**\n\t * A resolution.\n\t * The default value is `devicePixelRatio`.\n\t */\n\tresolution?: number;\n\n\t/**\n\t * An overlay layer setting.\n\t * The overlay layer is used by modal UI elements including DDialog\n\t * to provide the better interoperability with DOM-based UI elements\n\t * and WebGL-based UI elements.\n\t * However, an extra layer requires extra memory.\n\t * Set to true to enable the overlay layer.\n\t * The default value is false.\n\t */\n\toverlay?: boolean;\n}\n\nexport class DApplication implements DApplicationLike {\n\tprotected _options?: DApplicationOptions;\n\tprotected _root: HTMLElement;\n\tprotected _base: DApplicationLayer;\n\tprotected _overlay?: DApplicationLayer;\n\tprotected _resolution: number;\n\tprotected _isOverlayEnabled: boolean;\n\tprotected _focus?: DControllerFocus;\n\n\tconstructor(options?: DApplicationOptions) {\n\t\tDApplications.add(this);\n\n\t\t// Root\n\t\tconst root = this.toRootElement(options);\n\t\tthis._root = root;\n\t\tthis.initFocusHandling(root);\n\n\t\t// Resolution\n\t\tconst resolution = options?.resolution ?? window.devicePixelRatio ?? 1;\n\t\tthis._resolution = resolution;\n\n\t\t// Remove the accessibility plugin\n\t\tdelete (Renderer as any).__plugins.accessibility;\n\n\t\t// Options\n\t\tthis._options = options;\n\n\t\t// Base layer\n\t\tconst base = this.newLayerBase(options);\n\t\tthis._base = base;\n\n\t\t// Overlay layer\n\t\tthis._isOverlayEnabled = !!options?.overlay;\n\t\tif (!this._isOverlayEnabled) {\n\t\t\tthis._overlay = base;\n\t\t}\n\t}\n\n\tget stage(): Container {\n\t\treturn this._base.stage;\n\t}\n\n\tgetRootElement(): HTMLElement {\n\t\treturn this._root;\n\t}\n\n\tgetResolution(): number {\n\t\treturn this._resolution;\n\t}\n\n\tprotected toRootElement(options?: DApplicationOptions): HTMLElement {\n\t\tconst root = options?.root;\n\t\tif (root != null) {\n\t\t\tif (isString(root)) {\n\t\t\t\tconst found = document.querySelector<HTMLElement>(root);\n\t\t\t\tif (found) {\n\t\t\t\t\treturn found;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn root;\n\t\t\t}\n\t\t}\n\t\treturn document.body;\n\t}\n\n\tprotected toLayerBaseOptions(options?: DApplicationOptions): DApplicationLayerOptions {\n\t\tconst root = this._root;\n\t\tconst resolution = this._resolution;\n\t\tif (options) {\n\t\t\treturn new DApplicationLayerOptions({\n\t\t\t\troot,\n\t\t\t\tpadding: options.padding,\n\t\t\t\twidth: options.width,\n\t\t\t\theight: options.height,\n\t\t\t\tbackground: options.background,\n\t\t\t\tresolution,\n\t\t\t\tantialias: options.antialias,\n\t\t\t\toverlay: false\n\t\t\t});\n\t\t}\n\t\treturn new DApplicationLayerOptions({\n\t\t\troot,\n\t\t\tresolution,\n\t\t\toverlay: false\n\t\t});\n\t}\n\n\tgetFocusController(): DControllerFocus {\n\t\tif (this._focus == null) {\n\t\t\tthis._focus = new DControllerDefaultFocus();\n\t\t}\n\t\treturn this._focus;\n\t}\n\n\tprotected initFocusHandling(root: HTMLElement): void {\n\t\tlet hasFocus = false;\n\t\tconst onFocus = (): void => {\n\t\t\thasFocus = true;\n\t\t};\n\t\tconst onBlured = (): void => {\n\t\t\tif (!hasFocus) {\n\t\t\t\tthis.getFocusController().clear();\n\t\t\t}\n\t\t};\n\t\tconst onBlur = (): void => {\n\t\t\thasFocus = false;\n\t\t\tsetTimeout(onBlured, 0);\n\t\t};\n\t\troot.addEventListener(\"focus\", onFocus, true);\n\t\troot.addEventListener(\"blur\", onBlur, true);\n\t}\n\n\tprotected newLayerBase(options?: DApplicationOptions): DApplicationLayer {\n\t\treturn new DApplicationLayer(this, this.toLayerBaseOptions(options));\n\t}\n\n\tgetLayerBase(): DApplicationLayer {\n\t\treturn this._base;\n\t}\n\n\tprotected toLayerOverlayOptions(options?: DApplicationOptions): DApplicationLayerOptions {\n\t\tconst root = this._root;\n\t\tconst resolution = this._resolution;\n\t\tif (options) {\n\t\t\treturn new DApplicationLayerOptions({\n\t\t\t\troot,\n\t\t\t\tpadding: options.padding,\n\t\t\t\twidth: options.width,\n\t\t\t\theight: options.height,\n\t\t\t\tbackground: {\n\t\t\t\t\tcolor: null\n\t\t\t\t},\n\t\t\t\tresolution,\n\t\t\t\tantialias: options.antialias,\n\t\t\t\toverlay: true\n\t\t\t});\n\t\t}\n\t\treturn new DApplicationLayerOptions({\n\t\t\troot,\n\t\t\tresolution,\n\t\t\toverlay: true\n\t\t});\n\t}\n\n\tprotected newLayerOverlay(options?: DApplicationOptions): DApplicationLayer {\n\t\treturn new DApplicationLayer(this, this.toLayerOverlayOptions(options));\n\t}\n\n\tgetLayerOverlay(): DApplicationLayer {\n\t\tif (this._isOverlayEnabled) {\n\t\t\tif (this._overlay == null) {\n\t\t\t\tthis._overlay = this.newLayerOverlay(this._options);\n\t\t\t}\n\t\t\treturn this._overlay;\n\t\t} else {\n\t\t\treturn this._base;\n\t\t}\n\t}\n\n\tupdate(): void {\n\t\tif (this._isOverlayEnabled) {\n\t\t\tconst base = this._base;\n\t\t\tbase.update();\n\n\t\t\tconst overlay = this._overlay;\n\t\t\tif (overlay) {\n\t\t\t\toverlay.update();\n\t\t\t}\n\t\t} else {\n\t\t\treturn this._base.update();\n\t\t}\n\t}\n\n\trender(): void {\n\t\tif (this._isOverlayEnabled) {\n\t\t\tconst base = this._base;\n\t\t\tbase.render();\n\n\t\t\tconst overlay = this._overlay;\n\t\t\tif (overlay) {\n\t\t\t\toverlay.render();\n\t\t\t}\n\t\t} else {\n\t\t\treturn this._base.render();\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-application.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-application.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAa,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGjE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAyD5C;IASC,sBAAY,OAA6B;;QACxC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAExB,OAAO;QACP,IAAM,IAAI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,sCAAe,GAAf;QACC,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC3B,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE;gBAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aACpD;YACD,OAAO,IAAI,CAAC,QAAQ,CAAC;SACrB;aAAM;YACN,OAAO,IAAI,CAAC,KAAK,CAAC;SAClB;IACF,CAAC;IAED,6BAAM,GAAN;QACC,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC3B,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;YACxB,IAAI,CAAC,MAAM,EAAE,CAAC;YAEd,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC9B,IAAI,OAAO,EAAE;gBACZ,OAAO,CAAC,MAAM,EAAE,CAAC;aACjB;SACD;aAAM;YACN,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;SAC3B;IACF,CAAC;IAED,6BAAM,GAAN;QACC,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC3B,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;YACxB,IAAI,CAAC,MAAM,EAAE,CAAC;YAEd,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC9B,IAAI,OAAO,EAAE;gBACZ,OAAO,CAAC,MAAM,EAAE,CAAC;aACjB;SACD;aAAM;YACN,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;SAC3B;IACF,CAAC;IACF,mBAAC;AAAD,CAAC,AA1LD,IA0LC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Container, Renderer } from \"pixi.js\";\nimport { DApplicationLayer } from \"./d-application-layer\";\nimport { DApplicationLayerOptions } from \"./d-application-layer-options\";\nimport { DApplicationLike } from \"./d-application-like\";\nimport { DApplications } from \"./d-applications\";\nimport { DControllerFocusImpl } from \"./d-controller-focus-impl\";\nimport { DControllerFocus } from \"./d-controller-focus\";\nimport { DPaddingLike } from \"./d-padding\";\nimport { isString } from \"./util/is-string\";\n\nexport interface DApplicationBackgroundOptions {\n\tcolor?: number;\n}\n\nexport interface DApplicationOptions {\n\t/**\n\t * A root element selector or a root element.\n\t * `HTMLCanvasElement` and other DOM elements are created in this element.\n\t * The default root element is `document.body`.\n\t */\n\troot?: string | HTMLElement;\n\n\t/**\n\t * Padding settings.\n\t */\n\tpadding?: number | DPaddingLike;\n\n\t/**\n\t * A canvas width.\n\t */\n\twidth?: number;\n\n\t/**\n\t * A canvas height.\n\t */\n\theight?: number;\n\n\t/**\n\t * A background setting.\n\t */\n\tbackground?: DApplicationBackgroundOptions;\n\n\t/**\n\t * An antialias setting.\n\t */\n\tantialias?: boolean;\n\n\t/**\n\t * A resolution.\n\t * The default value is `devicePixelRatio`.\n\t */\n\tresolution?: number;\n\n\t/**\n\t * An overlay layer setting.\n\t * The overlay layer is used by modal UI elements including DDialog\n\t * to provide the better interoperability with DOM-based UI elements\n\t * and WebGL-based UI elements.\n\t * However, an extra layer requires extra memory.\n\t * Set to true to enable the overlay layer.\n\t * The default value is false.\n\t */\n\toverlay?: boolean;\n}\n\nexport class DApplication implements DApplicationLike {\n\tprotected _options?: DApplicationOptions;\n\tprotected _root: HTMLElement;\n\tprotected _base: DApplicationLayer;\n\tprotected _overlay?: DApplicationLayer;\n\tprotected _resolution: number;\n\tprotected _isOverlayEnabled: boolean;\n\tprotected _focus?: DControllerFocus;\n\n\tconstructor(options?: DApplicationOptions) {\n\t\tDApplications.add(this);\n\n\t\t// Root\n\t\tconst root = this.toRootElement(options);\n\t\tthis._root = root;\n\t\tthis.initFocusHandling(root);\n\n\t\t// Resolution\n\t\tconst resolution = options?.resolution ?? window.devicePixelRatio ?? 1;\n\t\tthis._resolution = resolution;\n\n\t\t// Remove the accessibility plugin\n\t\tdelete (Renderer as any).__plugins.accessibility;\n\n\t\t// Options\n\t\tthis._options = options;\n\n\t\t// Base layer\n\t\tconst base = this.newLayerBase(options);\n\t\tthis._base = base;\n\n\t\t// Overlay layer\n\t\tthis._isOverlayEnabled = !!options?.overlay;\n\t\tif (!this._isOverlayEnabled) {\n\t\t\tthis._overlay = base;\n\t\t}\n\t}\n\n\tget stage(): Container {\n\t\treturn this._base.stage;\n\t}\n\n\tgetRootElement(): HTMLElement {\n\t\treturn this._root;\n\t}\n\n\tgetResolution(): number {\n\t\treturn this._resolution;\n\t}\n\n\tprotected toRootElement(options?: DApplicationOptions): HTMLElement {\n\t\tconst root = options?.root;\n\t\tif (root != null) {\n\t\t\tif (isString(root)) {\n\t\t\t\tconst found = document.querySelector<HTMLElement>(root);\n\t\t\t\tif (found) {\n\t\t\t\t\treturn found;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn root;\n\t\t\t}\n\t\t}\n\t\treturn document.body;\n\t}\n\n\tprotected toLayerBaseOptions(options?: DApplicationOptions): DApplicationLayerOptions {\n\t\tconst root = this._root;\n\t\tconst resolution = this._resolution;\n\t\tif (options) {\n\t\t\treturn new DApplicationLayerOptions({\n\t\t\t\troot,\n\t\t\t\tpadding: options.padding,\n\t\t\t\twidth: options.width,\n\t\t\t\theight: options.height,\n\t\t\t\tbackground: options.background,\n\t\t\t\tresolution,\n\t\t\t\tantialias: options.antialias,\n\t\t\t\toverlay: false\n\t\t\t});\n\t\t}\n\t\treturn new DApplicationLayerOptions({\n\t\t\troot,\n\t\t\tresolution,\n\t\t\toverlay: false\n\t\t});\n\t}\n\n\tgetFocusController(): DControllerFocus {\n\t\tif (this._focus == null) {\n\t\t\tthis._focus = new DControllerFocusImpl();\n\t\t}\n\t\treturn this._focus;\n\t}\n\n\tprotected initFocusHandling(root: HTMLElement): void {\n\t\tlet hasFocus = false;\n\t\tconst onFocus = (): void => {\n\t\t\thasFocus = true;\n\t\t};\n\t\tconst onBlured = (): void => {\n\t\t\tif (!hasFocus) {\n\t\t\t\tthis.getFocusController().clear();\n\t\t\t}\n\t\t};\n\t\tconst onBlur = (): void => {\n\t\t\thasFocus = false;\n\t\t\tsetTimeout(onBlured, 0);\n\t\t};\n\t\troot.addEventListener(\"focus\", onFocus, true);\n\t\troot.addEventListener(\"blur\", onBlur, true);\n\t}\n\n\tprotected newLayerBase(options?: DApplicationOptions): DApplicationLayer {\n\t\treturn new DApplicationLayer(this, this.toLayerBaseOptions(options));\n\t}\n\n\tgetLayerBase(): DApplicationLayer {\n\t\treturn this._base;\n\t}\n\n\tprotected toLayerOverlayOptions(options?: DApplicationOptions): DApplicationLayerOptions {\n\t\tconst root = this._root;\n\t\tconst resolution = this._resolution;\n\t\tif (options) {\n\t\t\treturn new DApplicationLayerOptions({\n\t\t\t\troot,\n\t\t\t\tpadding: options.padding,\n\t\t\t\twidth: options.width,\n\t\t\t\theight: options.height,\n\t\t\t\tbackground: {\n\t\t\t\t\tcolor: null\n\t\t\t\t},\n\t\t\t\tresolution,\n\t\t\t\tantialias: options.antialias,\n\t\t\t\toverlay: true\n\t\t\t});\n\t\t}\n\t\treturn new DApplicationLayerOptions({\n\t\t\troot,\n\t\t\tresolution,\n\t\t\toverlay: true\n\t\t});\n\t}\n\n\tprotected newLayerOverlay(options?: DApplicationOptions): DApplicationLayer {\n\t\treturn new DApplicationLayer(this, this.toLayerOverlayOptions(options));\n\t}\n\n\tgetLayerOverlay(): DApplicationLayer {\n\t\tif (this._isOverlayEnabled) {\n\t\t\tif (this._overlay == null) {\n\t\t\t\tthis._overlay = this.newLayerOverlay(this._options);\n\t\t\t}\n\t\t\treturn this._overlay;\n\t\t} else {\n\t\t\treturn this._base;\n\t\t}\n\t}\n\n\tupdate(): void {\n\t\tif (this._isOverlayEnabled) {\n\t\t\tconst base = this._base;\n\t\t\tbase.update();\n\n\t\t\tconst overlay = this._overlay;\n\t\t\tif (overlay) {\n\t\t\t\toverlay.update();\n\t\t\t}\n\t\t} else {\n\t\t\treturn this._base.update();\n\t\t}\n\t}\n\n\trender(): void {\n\t\tif (this._isOverlayEnabled) {\n\t\t\tconst base = this._base;\n\t\t\tbase.render();\n\n\t\t\tconst overlay = this._overlay;\n\t\t\tif (overlay) {\n\t\t\t\toverlay.render();\n\t\t\t}\n\t\t} else {\n\t\t\treturn this._base.render();\n\t\t}\n\t}\n}\n"]}
@@ -1065,9 +1065,9 @@ var DBase = /** @class */ (function (_super) {
1065
1065
  if (target === this) {
1066
1066
  return true;
1067
1067
  }
1068
- else if (target != null && !(target instanceof DBase)) {
1068
+ else if (target != null && !(target instanceof DBase && target.interactive)) {
1069
1069
  var parent_5 = target.parent;
1070
- while (parent_5 != null && !(parent_5 instanceof DBase)) {
1070
+ while (parent_5 != null && !(parent_5 instanceof DBase && parent_5.interactive)) {
1071
1071
  parent_5 = parent_5.parent;
1072
1072
  }
1073
1073
  return parent_5 === this;
@@ -1 +1 @@
1
- {"version":3,"file":"d-base.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EACN,SAAS,EAGT,KAAK,EAKL,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAOjF,OAAO,E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,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACtB;QACD,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QAEpB,EAAE;QACF,iBAAM,OAAO,WAAE,CAAC;IACjB,CAAC;IA5uCgB,yBAAmB,GAAU,IAAI,KAAK,EAAE,CAAC;IA6uC3D,YAAC;CAAA,AAjvCD,CAGU,SAAS,GA8uClB;SAjvCY,KAAK","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n\tContainer,\n\tDisplayObject,\n\tinteraction,\n\tPoint,\n\tRectangle,\n\tRenderer,\n\tTexture,\n\tTransform\n} from \"pixi.js\";\nimport InteractionEvent = interaction.InteractionEvent;\nimport InteractionManager = interaction.InteractionManager;\nimport { DApplications } from \"./d-applications\";\nimport { DBackgroundStateAware } from \"./d-background\";\nimport { DBaseBackground } from \"./d-base-background\";\nimport { DBaseBorder } from \"./d-base-border\";\nimport { DBaseCorner } from \"./d-base-corner\";\nimport { DBaseInteractive } from \"./d-base-interactive\";\nimport { DBaseOutline } from \"./d-base-outline\";\nimport { DBasePadding } from \"./d-base-padding\";\nimport { DBasePoint } from \"./d-base-point\";\nimport { DBaseReflowableImpl } from \"./d-base-reflowable-impl\";\nimport { DBaseStateSet } from \"./d-base-state-set\";\nimport { DBaseStateSetImplObservable } from \"./d-base-state-set-impl-observable\";\nimport { DBorderStateAware } from \"./d-border\";\nimport { DBorderMask } from \"./d-border-mask\";\nimport { DCoordinatePosition, DCoordinateSize } from \"./d-coordinate\";\nimport { DCorner } from \"./d-corner\";\nimport { DCornerMask } from \"./d-corner-mask\";\nimport { DThemeFont } from \"./d-font\";\nimport { DLayoutClearType } from \"./d-layout-clear-type\";\nimport { DOutline } from \"./d-outline\";\nimport { DPadding } from \"./d-padding\";\nimport { DScalarFunctions } from \"./d-scalar-functions\";\nimport { DScalarSet } from \"./d-scalar-set\";\nimport { DShadow } from \"./d-shadow\";\nimport { DStateAwareOrValueMightBe } from \"./d-state-aware\";\nimport { DThemes } from \"./theme/d-themes\";\nimport { isFunction } from \"./util/is-function\";\nimport { isNumber } from \"./util/is-number\";\nimport { isString } from \"./util/is-string\";\nimport { UtilKeyboardEvent, UtilKeyboardEventShortcut } from \"./util/util-keyboard-event\";\nimport { UtilPointerEvent } from \"./util/util-pointer-event\";\nimport { UtilWheelEventDeltas } from \"./util/util-wheel-event\";\nimport { DBaseAutoSet } from \"./d-base-auto-set\";\nimport { toEnum } from \"./util/to-enum\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { DBaseSnippetContainer } from \"./d-base-snippet-container\";\nimport { DBaseReflowableContainer } from \"./d-base-reflowable-container\";\n\n/**\n * {@link DBase} padding options.\n */\nexport interface DBasePaddingOptions {\n\t/** A top padding */\n\ttop?: number;\n\n\t/** A right padding */\n\tright?: number;\n\n\t/** A bottom padding */\n\tbottom?: number;\n\n\t/** A left padding */\n\tleft?: number;\n}\n\n/**\n * {@link DBase} corner options.\n */\nexport interface DBaseCornerOptions {\n\t/** A radius */\n\tradius?: number;\n\n\t/** Masked corners get unrounded. */\n\tmask?: keyof typeof DCornerMask | DCornerMask;\n}\n\n/**\n * {@link DBase} events.\n */\nexport interface DBaseEvents<EMITTER> {\n\t/**\n\t * Triggered when an initialization is finished.\n\t *\n\t * on( \"init\", ( emitter ) => {} )\n\t *\n\t * @param emitter an emitter\n\t */\n\tinit(emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when added to a container.\n\t *\n\t * @param container a container added to\n\t */\n\tadded(container: Container): void;\n\n\t/**\n\t * Triggered when removed from a container.\n\t *\n\t * @param container a container removed from\n\t */\n\tremoved(container: Container): void;\n\n\t/**\n\t * Triggered when moved.\n\t *\n\t * @param newX a new x\n\t * @param newY a new y\n\t * @param oldX an old x\n\t * @param oldY an old y\n\t * @param emitter an emitter\n\t */\n\tmove(newX: number, newY: number, oldX: number, oldY: number, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when resized.\n\t *\n\t * @param newWidth a new width\n\t * @param newHeight a new height\n\t * @param oldWidth an old width\n\t * @param oldHeight an old height\n\t * @param emitter an emitter\n\t */\n\tresize(\n\t\tnewWidth: number,\n\t\tnewHeight: number,\n\t\toldWidth: number,\n\t\toldHeight: number,\n\t\temitter: EMITTER\n\t): void;\n\n\t/**\n\t * Triggered when scaled.\n\t *\n\t * @param newX a new x\n\t * @param newY a new y\n\t * @param oldX an old x\n\t * @param oldY an old y\n\t * @param emitter an emitter\n\t */\n\tscale(newX: number, newY: number, oldX: number, oldY: number, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when skewed.\n\t *\n\t * @param newX a new x\n\t * @param newY a new y\n\t * @param oldX an old x\n\t * @param oldY an old y\n\t * @param emitter an emitter\n\t */\n\tskew(newX: number, newY: number, oldX: number, oldY: number, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a state is changed.\n\t *\n\t * @param newState a new state\n\t * @param oldState an old state\n\t * @param emitter an emitter\n\t */\n\tstatechange(newState: DBaseStateSet, oldState: DBaseStateSet, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a wheel moves.\n\t *\n\t * @param e a wheel event\n\t * @param deltas wheel move amounts\n\t * @param global a point wheel moved\n\t * @param emitter an emitter\n\t */\n\twheel(e: WheelEvent, deltas: UtilWheelEventDeltas, global: Point, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a key gets down.\n\t *\n\t * @param e a keyboard event\n\t * @param emitter an emitter\n\t */\n\tkeydown(e: KeyboardEvent, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a key gets up.\n\t *\n\t * @param e a keyboard event\n\t * @param emitter an emitter\n\t */\n\tkeyup(e: KeyboardEvent, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a pointer gets on an emitter.\n\t *\n\t * @param e an interaction event.\n\t * @param emitter an emitter\n\t */\n\tover(e: InteractionEvent, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a pointer gets out of an emitter.\n\t *\n\t * @param e an interaction event\n\t * @param emitter an emitter\n\t */\n\tout(e: InteractionEvent, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a pointer gets down on an emitter.\n\t *\n\t * @param e an interaction event.\n\t * @param emitter an emitter\n\t */\n\tdown(e: InteractionEvent, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a pointer gets up on an emitter.\n\t *\n\t * @param e an interaction event\n\t * @param emitter an emitter\n\t */\n\tup(e: InteractionEvent, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when an emitter is double clicked.\n\t *\n\t * @param e an event\n\t * @param interactionManager an interaction manager\n\t * @param emitter an emitter\n\t */\n\tdblclick(\n\t\te: MouseEvent | TouchEvent,\n\t\tinteractionManager: InteractionManager,\n\t\temitter: EMITTER\n\t): void;\n}\n\n/**\n * {@link DBase} \"on\" options.\n */\nexport interface DBaseOnOptions<EMITTER> extends Partial<DBaseEvents<EMITTER>>, DOnOptions {}\n\n/**\n * {@link DBase} background options.\n */\nexport interface DBaseBackgroundOptions {\n\t/**\n\t * A color code or a function returning a color code.\n\t * If a computed value is undefined, falls back to the theme color.\n\t * If a computed value is null, a background is not rendered.\n\t */\n\tcolor?: DStateAwareOrValueMightBe<number | null>;\n\n\t/**\n\t * An alpha or a function returning an alpha.\n\t * If a computed value is undefined, falls back to an background alpha of a theme.\n\t */\n\talpha?: DStateAwareOrValueMightBe<number>;\n}\n\n/**\n * {@link DBase} border options.\n */\nexport interface DBaseBorderOptions {\n\t/**\n\t * A color code or a function returning a color code.\n\t * If a computed value is undefined, falls back to the theme color.\n\t * If a computed value is null, a background is not rendered.\n\t */\n\tcolor?: DStateAwareOrValueMightBe<number | null>;\n\n\t/**\n\t * An alpha or a function returning an alpha.\n\t * If a computed value is undefined, falls back to a border alpha of a theme.\n\t */\n\talpha?: DStateAwareOrValueMightBe<number>;\n\n\t/**\n\t * A width or a function returning a width.\n\t * If a computed value is undefined, falls back to a border width of a theme.\n\t */\n\twidth?: DStateAwareOrValueMightBe<number>;\n\n\t/**\n\t * An align or a function returning an align.\n\t * If a computed value is undefined, falls back to a border align of a theme.\n\t * If an align is 0, a border is rendered completely inside of a {@link DBase}.\n\t * If an align is 1, a border is rendered completely outside of a {@link DBase}.\n\t */\n\talign?: DStateAwareOrValueMightBe<number>;\n\n\t/** Masked borders get removed. */\n\tmask?: DStateAwareOrValueMightBe<DBorderMask> | keyof typeof DBorderMask;\n}\n\n/**\n * {@link DBase} outline optons.\n */\nexport interface DBaseOutlineOptions {\n\t/**\n\t * A color code or a function returning a color code.\n\t * If a computed value is undefined, falls back to the theme color.\n\t * If a computed value is null, a background is not rendered.\n\t */\n\tcolor?: DStateAwareOrValueMightBe<number | null>;\n\n\t/**\n\t * An alpha or a function returning an alpha.\n\t * If a computed value is undefined, falls back to an outline alpha of a theme.\n\t */\n\talpha?: DStateAwareOrValueMightBe<number>;\n\n\t/**\n\t * A width or a function returning a width.\n\t * If a computed value is undefined, falls back to an outline width of a theme.\n\t */\n\twidth?: DStateAwareOrValueMightBe<number>;\n\n\t/**\n\t * An offset or a function returning an offset.\n\t * If a computed value is undefined, falls back to an outline align of a theme.\n\t * A outline moves to outside when an offset gets larger.\n\t */\n\toffset?: DStateAwareOrValueMightBe<number>;\n\n\t/**\n\t * An align or a function returning an align.\n\t * If a computed value is undefined, falls back to an outline align of a theme.\n\t * If an align is 0, an outline is rendered completely inside.\n\t * If an align is 1, an outline is rendered completely outside.\n\t */\n\talign?: DStateAwareOrValueMightBe<number>;\n\n\t/** Masked outlines get removed. */\n\tmask?: DStateAwareOrValueMightBe<DBorderMask> | keyof typeof DBorderMask;\n}\n\nexport type DBaseShadow = \"NONE\" | \"WEAK\" | \"DEFAULT\" | DShadow;\n\n/**\n * {@link DBase} options.\n */\nexport interface DBaseOptions<THEME extends DThemeBase = DThemeBase, EMITTER = any> {\n\t/**\n\t * A parent.\n\t *\n\t * In the case of UI classes which pop up (e.g., {@link DDialog} and {@link DMenu}),\n\t * if multiple application instances are there, better to set\n\t * this to an `application.stage` so that they pick a right application.\n\t * By default, they assume the last created application is\n\t * the one they belong to at the time when they are created.\n\t */\n\tparent?: Container;\n\n\t/** Children. */\n\tchildren?: Array<DisplayObject | null>;\n\n\t/** A name. */\n\tname?: string;\n\n\t/**\n\t * One of the followings:\n\t * * A X position\n\t * * A position keyword\n\t * * A position expression (Parsed by {@link DScalarExpression})\n\t * * A function returning a X position ({@link DScalarFunction})\n\t * * An object returning a X position ({@link DScalar})\n\t */\n\tx?: DCoordinatePosition;\n\n\t/**\n\t * One of the followings:\n\t * * A Y position\n\t * * A position keyword\n\t * * A position expresion (Parsed by {@link DScalarExpression})\n\t * * A function returning a Y position ({@link DScalarFunction})\n\t * * An object returning a Y position ({@link DScalar})\n\t */\n\ty?: DCoordinatePosition;\n\n\t/**\n\t * One of the followings:\n\t * * A width\n\t * * A size keyword\n\t * * A size expression (Parsed by {@link DScalarExpression})\n\t * * A function returning a width ({@link DScalarFunction})\n\t * * An object returning a width ({@link DScalar})\n\t */\n\twidth?: DCoordinateSize;\n\n\t/**\n\t * One of the followings:\n\t * * A height\n\t * * A size keyword\n\t * * A size expression (Parsed by {@link DScalarExpression})\n\t * * A function returning a hight ({@link DScalarFunction})\n\t * * An object returning a hight ({@link DScalar})\n\t */\n\theight?: DCoordinateSize;\n\n\t/**\n\t * A visibility.\n\t * Set to true to make {@link DBase} visible.\n\t * Set to false to make {@link DBase} invisible.\n\t * The default values is true.\n\t */\n\tvisible?: boolean;\n\n\t/** A default state. */\n\tstate?: string | string[];\n\n\t/** An interactivity option. */\n\tinteractive?: keyof typeof DBaseInteractive | DBaseInteractive;\n\n\t/** A padding options. */\n\tpadding?: number | DBasePaddingOptions;\n\n\t/** A corner options. */\n\tcorner?: number | DBaseCornerOptions;\n\n\t/** A theme or a theme name. */\n\ttheme?: THEME | string;\n\n\t/**\n\t * Mappings of event names and event handlers.\n\t */\n\ton?: DBaseOnOptions<EMITTER>;\n\n\t/**\n\t * A weight used by {@link DLayoutVertical} and {@link DLayoutHorizontal}.\n\t */\n\tweight?: number;\n\n\t/** A tooltip text. */\n\ttitle?: string;\n\n\t/** A shortcut option. */\n\tshortcut?: string | UtilKeyboardEventShortcut;\n\n\t/** A shortcut options. */\n\tshortcuts?: Array<string | UtilKeyboardEventShortcut>;\n\n\t/** A background options. */\n\tbackground?: DBaseBackgroundOptions;\n\n\t/** A border options. */\n\tborder?: DBaseBorderOptions;\n\n\t/** An outline options. */\n\toutline?: DBaseOutlineOptions;\n\n\t/** A shadow. */\n\tshadow?: DBaseShadow | null;\n\n\t/** A clear type used by {@link DLayoutVertical} and {@link DLayoutHorizontal}. */\n\tclear?: keyof typeof DLayoutClearType | DLayoutClearType;\n\n\t/** A cursor shape. */\n\tcursor?: DStateAwareOrValueMightBe<string>;\n}\n\n/**\n * {@link DBase} theme.\n */\nexport interface DThemeBase extends DThemeFont {\n\t/**\n\t * Returns a X coordinate.\n\t */\n\tgetX(): DCoordinatePosition;\n\n\t/**\n\t * Returns a Y coordinate.\n\t */\n\tgetY(): DCoordinatePosition;\n\n\t/**\n\t * Returns a height.\n\t */\n\tgetHeight(): DCoordinateSize;\n\n\t/**\n\t * Returns a width.\n\t */\n\tgetWidth(): DCoordinateSize;\n\n\t/**\n\t * Returns a background color.\n\t * If the color is null, backgrounds are not be rendered.\n\t *\n\t * @param state a state\n\t */\n\tgetBackgroundColor(state: DBaseStateSet): number | null;\n\n\t/**\n\t * Returns a background alpha.\n\t *\n\t * @param state a state\n\t */\n\tgetBackgroundAlpha(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns a background texture.\n\t */\n\tgetBackgroundTexture(): Texture;\n\n\t/**\n\t * Returns a border color.\n\t * If the color is null, borders are not be rendered.\n\t *\n\t * @param state a state\n\t */\n\tgetBorderColor(state: DBaseStateSet): number | null;\n\n\t/**\n\t * Returns a border alpha.\n\t *\n\t * @param state a state\n\t */\n\tgetBorderAlpha(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns a border width.\n\t *\n\t * @param state a state\n\t */\n\tgetBorderWidth(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns a border align.\n\t *\n\t * @param state a state\n\t */\n\tgetBorderAlign(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns a border mask.\n\t *\n\t * @param state a mask\n\t */\n\tgetBorderMask(state: DBaseStateSet): DBorderMask;\n\n\t/**\n\t * Returns a border texture.\n\t */\n\tgetBorderTexture(): Texture;\n\n\t/**\n\t * Returns a left padding.\n\t */\n\tgetPaddingLeft(): number;\n\n\t/**\n\t * Returns a right padding.\n\t */\n\tgetPaddingRight(): number;\n\n\t/**\n\t * Returns a top padding.\n\t */\n\tgetPaddingTop(): number;\n\n\t/**\n\t * Returns a bottom padding.\n\t */\n\tgetPaddingBottom(): number;\n\n\t/**\n\t * Returns a corner radius.\n\t */\n\tgetCornerRadius(): number;\n\n\t/**\n\t * Returns a corner mask.\n\t */\n\tgetCornerMask(): DCornerMask;\n\n\t/**\n\t * Returns an outline color.\n\t * If the color is null, outlines are not be rendered.\n\t *\n\t * @param state a state\n\t */\n\tgetOutlineColor(state: DBaseStateSet): number | null;\n\n\t/**\n\t * Returns an outline alpha.\n\t *\n\t * @param state a state\n\t */\n\tgetOutlineAlpha(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns an outline width.\n\t *\n\t * @param state a state\n\t */\n\tgetOutlineWidth(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns an outline offset.\n\t *\n\t * @param state a state\n\t */\n\tgetOutlineOffset(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns an outline align.\n\t *\n\t * @param state a state\n\t */\n\tgetOutlineAlign(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns an outline mask.\n\t *\n\t * @param state a state\n\t */\n\tgetOutlineMask(state: DBaseStateSet): DBorderMask;\n\n\t/**\n\t * Returns a shadow.\n\t * If a shadow is null, no shadow is rendered.\n\t */\n\tgetShadow(): DShadow | null;\n\n\t/**\n\t * Returns an interactivity.\n\t */\n\tgetInteractive(): DBaseInteractive;\n\n\t/**\n\t * Returns true if focusable.\n\t */\n\tnewState(state: DBaseStateSet): void;\n\n\t/**\n\t * Returns a tooltip text.\n\t */\n\tgetTitle(): string;\n\n\t/**\n\t * Returns a clear type.\n\t * A clear type is for layout classes including {@link DLayoutVertical}.\n\t */\n\tgetClearType(): DLayoutClearType;\n\n\t/**\n\t * Returns a weight.\n\t * Weights are for layout classes including {@link DLayoutVertical}.\n\t * If a weight is less than or equals to zero, layout classes are supposed not to change a width / height.\n\t */\n\tgetWeight(): number;\n\n\t/**\n\t * Creates a new shadow.\n\t */\n\tnewShadow(): DShadow | null;\n\n\t/**\n\t * Creates a new weak shadow.\n\t */\n\tnewShadowWeak(): DShadow | null;\n\n\t/**\n\t * Returns a cursor.\n\t */\n\tgetCursor(state: DBaseStateSet): string;\n}\n\nconst toTheme = <THEME extends DThemeBase>(options?: DBaseOptions<THEME>): THEME | undefined => {\n\tconst theme = options?.theme;\n\tif (theme) {\n\t\tif (isString(theme)) {\n\t\t\treturn DThemes.getInstance().get(theme);\n\t\t}\n\t\treturn theme;\n\t}\n};\n\nexport interface DRefitable {\n\treadonly width: number;\n\treadonly height: number;\n}\n\nconst toShortcuts = <THEME extends DThemeBase>(\n\toptions?: DBaseOptions<THEME>\n): UtilKeyboardEventShortcut[] | undefined => {\n\tif (options) {\n\t\tconst shortcut = options.shortcut;\n\t\tconst shortcuts = options.shortcuts;\n\t\tif (shortcuts != null || shortcut != null) {\n\t\t\tconst result: UtilKeyboardEventShortcut[] = [];\n\t\t\tif (shortcut != null) {\n\t\t\t\tresult.push(UtilKeyboardEvent.toShortcut(shortcut));\n\t\t\t}\n\t\t\tif (shortcuts != null) {\n\t\t\t\tfor (let i = 0, imax = shortcuts.length; i < imax; ++i) {\n\t\t\t\t\tUtilKeyboardEvent.toShortcut(shortcuts[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\treturn undefined;\n};\n\n/**\n * A base class for UI classes.\n * See {@link DBaseEvents} for event details.\n */\nexport class DBase<\n\tTHEME extends DThemeBase = DThemeBase,\n\tOPTIONS extends DBaseOptions<THEME> = DBaseOptions<THEME>\n> extends Container {\n\tprotected static WORK_CONTAINS_POINT: Point = new Point();\n\n\tprivate _state: DBaseStateSet;\n\tprivate _theme: THEME;\n\tprotected _options: OPTIONS | undefined;\n\tprivate _width: number;\n\tprivate _height: number;\n\tprotected _padding: DPadding;\n\tprotected _corner: DCorner;\n\tprivate _scalarSet: DScalarSet;\n\tprotected _auto: DBaseAutoSet;\n\tprivate _isDirty: boolean;\n\tprivate _hasDirty: boolean;\n\tprivate _isHierarchyDirty: boolean;\n\tprivate _shadow: DShadow | null;\n\tprivate _onShadowUpdateBound: () => void;\n\tprivate _weight: number;\n\tprivate _position: DBasePoint;\n\tprivate _scale: DBasePoint;\n\tprivate _skew: DBasePoint;\n\tprotected _title: string;\n\tprotected _background: DBackgroundStateAware;\n\tprotected _border: DBorderStateAware;\n\tprotected _outline: DOutline;\n\tprotected _clearType: DLayoutClearType;\n\tprotected _shortcuts?: UtilKeyboardEventShortcut[];\n\tprotected _snippet: DBaseSnippetContainer;\n\tprotected _reflowable: DBaseReflowableContainer;\n\tprotected _lastDownPoint?: Point;\n\tprotected _cursor?: DStateAwareOrValueMightBe<string>;\n\n\tconstructor(options?: OPTIONS) {\n\t\tsuper();\n\n\t\t// Transform\n\t\tconst transform: Transform = this.transform;\n\t\tthis._position = new DBasePoint(transform.position, (newX, newY, oldX, oldY): void => {\n\t\t\tthis.onMove(newX, newY, oldX, oldY);\n\t\t});\n\t\tthis._scale = new DBasePoint(transform.scale, (newX, newY, oldX, oldY): void => {\n\t\t\tthis.onScale(newX, newY, oldX, oldY);\n\t\t});\n\t\tthis._skew = new DBasePoint(transform.skew, (newX, newY, oldX, oldY): void => {\n\t\t\tthis.onSkew(newX, newY, oldX, oldY);\n\t\t});\n\n\t\t//\n\t\tthis._options = options;\n\t\tconst scalarSet: DScalarSet = (this._scalarSet = {});\n\t\tthis._auto = new DBaseAutoSet();\n\t\tthis._isDirty = true;\n\t\tthis._hasDirty = false;\n\t\tthis._isHierarchyDirty = false;\n\t\tthis._shadow = null;\n\t\tthis.name = options?.name ?? \"\";\n\t\tconst theme = toTheme(options) || this.getThemeDefault();\n\t\tthis._theme = theme;\n\t\tthis._snippet = new DBaseSnippetContainer(this);\n\t\tthis._reflowable = new DBaseReflowableContainer();\n\t\tthis._clearType = toEnum(options?.clear ?? theme.getClearType(), DLayoutClearType);\n\t\tthis._padding = new DBasePadding(theme, options, (): void => {\n\t\t\tthis.toParentResized();\n\t\t\tthis.toHierarchyDirty();\n\t\t\tDApplications.update(this);\n\t\t});\n\t\tconst toDirtyAndUpdate = (): void => {\n\t\t\tthis.toDirty();\n\t\t\tDApplications.update(this);\n\t\t};\n\t\tthis._background = new DBaseBackground(theme, options, toDirtyAndUpdate);\n\t\tthis._border = new DBaseBorder(theme, options, toDirtyAndUpdate);\n\t\tthis._outline = new DBaseOutline(theme, options, toDirtyAndUpdate);\n\t\tthis._corner = new DBaseCorner(theme, options, toDirtyAndUpdate);\n\n\t\t// X\n\t\tconst position = transform.position;\n\t\tconst x = options?.x ?? theme.getX();\n\t\tif (isNumber(x)) {\n\t\t\tposition.x = x;\n\t\t} else {\n\t\t\tposition.x = 0;\n\t\t\tscalarSet.x = DScalarFunctions.position(x);\n\t\t}\n\n\t\t// Y\n\t\tconst y = options?.y ?? theme.getY();\n\t\tif (isNumber(y)) {\n\t\t\tposition.y = y;\n\t\t} else {\n\t\t\tposition.y = 0;\n\t\t\tscalarSet.y = DScalarFunctions.position(y);\n\t\t}\n\n\t\t// Width\n\t\tconst width = options?.width ?? theme.getWidth();\n\t\tif (!this._auto.width.from(width)) {\n\t\t\tif (isNumber(width)) {\n\t\t\t\tthis._width = width;\n\t\t\t} else {\n\t\t\t\tthis._width = 100;\n\t\t\t\tscalarSet.width = DScalarFunctions.size(width);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._width = 100;\n\t\t}\n\n\t\t// Height\n\t\tconst height = options?.height ?? theme.getHeight();\n\t\tif (!this._auto.height.from(height)) {\n\t\t\tif (isNumber(height)) {\n\t\t\t\tthis._height = height;\n\t\t\t} else {\n\t\t\t\tthis._height = 100;\n\t\t\t\tscalarSet.height = DScalarFunctions.size(height);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._height = 100;\n\t\t}\n\n\t\t// Visibility\n\t\tconst visible = options?.visible;\n\t\tif (visible != null) {\n\t\t\tthis.visible = visible;\n\t\t}\n\n\t\t// State\n\t\tthis._state = new DBaseStateSetImplObservable((newState, oldState): void => {\n\t\t\tthis.onStateChange(newState, oldState);\n\t\t});\n\n\t\t// Interactive\n\t\tconst interactive = toEnum(\n\t\t\toptions?.interactive ?? theme.getInteractive(),\n\t\t\tDBaseInteractive\n\t\t);\n\t\tthis.interactive = !!(interactive & DBaseInteractive.SELF);\n\t\tthis.interactiveChildren = !!(interactive & DBaseInteractive.CHILDREN);\n\n\t\t// Events\n\t\tconst on = options?.on;\n\t\tif (on) {\n\t\t\tfor (const name in on) {\n\t\t\t\tconst handler = on[name];\n\t\t\t\tif (handler) {\n\t\t\t\t\tthis.on(name, handler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Title\n\t\tthis._title = options?.title ?? theme.getTitle();\n\n\t\t// Weight\n\t\tthis._weight = options?.weight ?? theme.getWeight();\n\n\t\t// Reflowable\n\t\tthis.initReflowable();\n\n\t\t// Shadow\n\t\tthis._onShadowUpdateBound = (): void => {\n\t\t\tDApplications.update(this);\n\t\t};\n\t\tlet shadow = options?.shadow;\n\t\tif (shadow === undefined) {\n\t\t\tshadow = theme.getShadow();\n\t\t}\n\t\tif (shadow) {\n\t\t\tif (isString(shadow)) {\n\t\t\t\tswitch (shadow) {\n\t\t\t\t\tcase \"WEAK\":\n\t\t\t\t\t\tthis.shadow = theme.newShadowWeak();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"DEFAULT\":\n\t\t\t\t\t\tthis.shadow = theme.newShadow();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.shadow = shadow;\n\t\t\t}\n\t\t}\n\n\t\t// Event handlers\n\t\tthis.on(UtilPointerEvent.over, (e: InteractionEvent): void => {\n\t\t\tthis.onOver(e);\n\t\t});\n\n\t\tthis.on(UtilPointerEvent.out, (e: InteractionEvent): void => {\n\t\t\tthis.onOut(e);\n\t\t});\n\n\t\tthis.on(UtilPointerEvent.down, (e: InteractionEvent): void => {\n\t\t\tthis.onDown(e);\n\t\t});\n\n\t\tthis.on(UtilPointerEvent.up, (e: InteractionEvent): void => {\n\t\t\tthis.onUp(e);\n\t\t});\n\n\t\t// Children change detection\n\t\tthis.on(\"added\", (): void => {\n\t\t\tthis.toParentResized();\n\t\t\tif (this.isDirty() || this.hasDirty()) {\n\t\t\t\tthis.toParentHasDirty();\n\t\t\t}\n\t\t\tif (this._isHierarchyDirty) {\n\t\t\t\tthis.toParentHierarchyDirty();\n\t\t\t}\n\t\t\tconst newParent = this.parent;\n\t\t\tif (newParent instanceof DBase) {\n\t\t\t\tthis.state.parent = newParent.state;\n\t\t\t}\n\t\t\tDApplications.update(this);\n\t\t});\n\n\t\tthis.on(\"removed\", (): void => {\n\t\t\tthis.blur(true);\n\t\t\tthis.state.parent = null;\n\t\t\tDApplications.update(this);\n\t\t});\n\n\t\t// Shortcut\n\t\tconst shortcuts = toShortcuts(options);\n\t\tthis._shortcuts = shortcuts;\n\t\tif (shortcuts != null) {\n\t\t\tconst onShortcutBound = (e: KeyboardEvent): void => {\n\t\t\t\tthis.onShortcut(e);\n\t\t\t};\n\t\t\tfor (let i = 0, imax = shortcuts.length; i < imax; ++i) {\n\t\t\t\tUtilKeyboardEvent.on(this, shortcuts[i], onShortcutBound);\n\t\t\t}\n\t\t}\n\n\t\t// Other initialization\n\t\tthis.init(options);\n\n\t\t// State Override\n\t\ttheme.newState(this._state);\n\t\tconst state = options?.state;\n\t\tif (state != null) {\n\t\t\tif (isString(state)) {\n\t\t\t\tthis._state.add(state);\n\t\t\t} else {\n\t\t\t\tthis._state.addAll(state);\n\t\t\t}\n\t\t}\n\n\t\t// Parent\n\t\tconst parent = options?.parent;\n\t\tif (parent != null) {\n\t\t\tparent.addChild(this);\n\t\t}\n\n\t\t// Children\n\t\tconst children = options?.children;\n\t\tif (children != null) {\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tif (child != null) {\n\t\t\t\t\tthis.addChild(child);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Cursor\n\t\tconst cursor = options?.cursor;\n\t\tthis._cursor = cursor;\n\t\tthis.cursor = this.toCursor(cursor, this._state);\n\n\t\t// Done\n\t\tthis.emit(\"init\", this);\n\t}\n\n\tprotected toCursor(\n\t\tcursor: DStateAwareOrValueMightBe<string> | undefined,\n\t\tstate: DBaseStateSet\n\t): string {\n\t\tif (cursor) {\n\t\t\tif (isFunction(cursor)) {\n\t\t\t\tconst result = cursor(state);\n\t\t\t\tif (result !== undefined) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t} else if (cursor !== undefined) {\n\t\t\t\treturn cursor;\n\t\t\t}\n\t\t}\n\t\treturn this.theme.getCursor(state);\n\t}\n\n\tget snippet(): DBaseSnippetContainer {\n\t\treturn this._snippet;\n\t}\n\n\tget reflowable(): DBaseReflowableContainer {\n\t\treturn this._reflowable;\n\t}\n\n\tprotected initReflowable(): void {\n\t\tnew DBaseReflowableImpl(this);\n\t}\n\n\tprotected onChildrenChange(): void {\n\t\tthis.toHierarchyDirty();\n\t\tsuper.onChildrenChange();\n\t}\n\n\tprotected onShortcut(e: KeyboardEvent): void {\n\t\t// DO NOTHING\n\t}\n\n\tprotected init(options?: OPTIONS): void {\n\t\t// OTHER INITIALIZATIONS BEFORE `parent.addChild( this )`\n\t}\n\n\tget weight(): number {\n\t\treturn this._weight;\n\t}\n\n\tprotected onMove(newX: number, newY: number, oldX: number, oldY: number): void {\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tif (child instanceof DBase) {\n\t\t\t\tchild.onParentMove(newX, newY, oldX, oldY);\n\t\t\t}\n\t\t}\n\t\tDApplications.update(this);\n\t\tthis.emit(\"move\", newX, newY, oldX, oldY, this);\n\t}\n\n\tresize(width?: number, height?: number): boolean {\n\t\tconst oldWidth = this._width;\n\t\tconst oldHeight = this._height;\n\t\tconst newWidth = width != null ? width : oldWidth;\n\t\tconst newHeight = height != null ? height : oldHeight;\n\t\tconst isWidthChanged = oldWidth !== newWidth;\n\t\tconst isHeightChanged = oldHeight !== newHeight;\n\t\tif (isWidthChanged) {\n\t\t\tthis._width = newWidth;\n\t\t}\n\t\tif (isHeightChanged) {\n\t\t\tthis._height = newHeight;\n\t\t}\n\t\tconst isChanged = isWidthChanged || isHeightChanged;\n\t\tif (isChanged) {\n\t\t\tthis.onResize(newWidth, newHeight, oldWidth, oldHeight);\n\t\t}\n\t\tif (isWidthChanged) {\n\t\t\tconst scalarSet = this._scalarSet;\n\t\t\tif (scalarSet.x != null) {\n\t\t\t\tconst position = this._position;\n\t\t\t\tconst parent = this.getParentOfSize();\n\t\t\t\tif (parent) {\n\t\t\t\t\tthis._position.x = scalarSet.x(\n\t\t\t\t\t\tparent.width,\n\t\t\t\t\t\tnewWidth,\n\t\t\t\t\t\tparent.padding.getLeft(),\n\t\t\t\t\t\tposition.x\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isHeightChanged) {\n\t\t\tconst scalarSet = this._scalarSet;\n\t\t\tif (scalarSet.y != null) {\n\t\t\t\tconst position = this._position;\n\t\t\t\tconst parent = this.getParentOfSize();\n\t\t\t\tif (parent) {\n\t\t\t\t\tthis._position.y = scalarSet.y(\n\t\t\t\t\t\tparent.height,\n\t\t\t\t\t\tnewHeight,\n\t\t\t\t\t\tparent.padding.getTop(),\n\t\t\t\t\t\tposition.y\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn isChanged;\n\t}\n\n\tgetClearType(): DLayoutClearType {\n\t\treturn this._clearType;\n\t}\n\n\tonResize(newWidth: number, newHeight: number, oldWidth: number, oldHeight: number): void {\n\t\tthis.toDirty();\n\t\tthis.toHierarchyDirty();\n\n\t\tconst padding = this._padding;\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tif (child instanceof DBase) {\n\t\t\t\tchild.onParentResize(newWidth, newHeight, padding);\n\t\t\t}\n\t\t}\n\n\t\tDApplications.update(this);\n\t\tthis.emit(\"resize\", newWidth, newHeight, oldWidth, oldHeight, this);\n\t}\n\n\tprotected onScale(newX: number, newY: number, oldX: number, oldY: number): void {\n\t\tDApplications.update(this);\n\t\tthis.emit(\"scale\", newX, newY, oldX, oldY, this);\n\t}\n\n\tprotected onSkew(newX: number, newY: number, oldX: number, oldY: number): void {\n\t\tDApplications.update(this);\n\t\tthis.emit(\"skew\", newX, newY, oldX, oldY, this);\n\t}\n\n\tget type(): string {\n\t\treturn this.getType();\n\t}\n\n\t// @ts-ignore\n\tget x(): number {\n\t\treturn this._position.x;\n\t}\n\n\tset x(x: DCoordinatePosition) {\n\t\tthis.setX(x);\n\t}\n\n\tgetX(): DCoordinatePosition {\n\t\tconst scalarSet = this._scalarSet;\n\t\tif (scalarSet.x != null) {\n\t\t\treturn scalarSet.x;\n\t\t} else {\n\t\t\treturn this._position.x;\n\t\t}\n\t}\n\n\tsetX(x: DCoordinatePosition): void {\n\t\tconst scalarSet = this._scalarSet;\n\t\tif (isNumber(x)) {\n\t\t\tconst position = this._position;\n\t\t\tif (position.x !== x) {\n\t\t\t\tscalarSet.x = undefined;\n\t\t\t\tposition.x = x;\n\t\t\t} else {\n\t\t\t\tif (scalarSet.x !== undefined) {\n\t\t\t\t\tscalarSet.x = undefined;\n\t\t\t\t\tthis.toParentResized();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst scalar = DScalarFunctions.position(x);\n\t\t\tif (scalarSet.x !== scalar) {\n\t\t\t\tscalarSet.x = scalar;\n\t\t\t\tthis.toParentResized();\n\t\t\t}\n\t\t}\n\t}\n\n\t// @ts-ignore\n\tget y(): number {\n\t\treturn this._position.y;\n\t}\n\n\tset y(y: DCoordinatePosition) {\n\t\tthis.setY(y);\n\t}\n\n\tgetY(): DCoordinatePosition {\n\t\tconst scalarSet = this._scalarSet;\n\t\tif (scalarSet.y != null) {\n\t\t\treturn scalarSet.y;\n\t\t} else {\n\t\t\treturn this._position.y;\n\t\t}\n\t}\n\n\tsetY(y: DCoordinatePosition): void {\n\t\tconst scalarSet = this._scalarSet;\n\t\tif (isNumber(y)) {\n\t\t\tconst position = this._position;\n\t\t\tif (position.y !== y) {\n\t\t\t\tscalarSet.y = undefined;\n\t\t\t\tposition.y = y;\n\t\t\t} else {\n\t\t\t\tif (scalarSet.y !== undefined) {\n\t\t\t\t\tscalarSet.y = undefined;\n\t\t\t\t\tthis.toParentResized();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst scalar = DScalarFunctions.position(y);\n\t\t\tif (scalarSet.y !== scalar) {\n\t\t\t\tscalarSet.y = scalar;\n\t\t\t\tthis.toParentResized();\n\t\t\t}\n\t\t}\n\t}\n\n\t// @ts-ignore\n\tget width(): number {\n\t\treturn this._width;\n\t}\n\n\tset width(width: DCoordinateSize) {\n\t\tthis.setWidth(width);\n\t}\n\n\tgetWidth(): DCoordinateSize {\n\t\treturn this._auto.width.toCoordinate(this._scalarSet.width || this._width);\n\t}\n\n\tsetWidth(width: DCoordinateSize): void {\n\t\tconst auto = this._auto.width;\n\t\tconst isOn = auto.isOn;\n\t\tconst isAuto = auto.from(width);\n\t\tif (auto.isOn !== isOn) {\n\t\t\tthis.toHierarchyDirty();\n\t\t\tDApplications.update(this);\n\t\t}\n\t\tif (!isAuto) {\n\t\t\tconst scalarSet = this._scalarSet;\n\t\t\tif (isNumber(width)) {\n\t\t\t\tconst oldWidth = this._width;\n\t\t\t\tif (oldWidth !== width) {\n\t\t\t\t\tscalarSet.width = undefined;\n\t\t\t\t\tthis._width = width;\n\t\t\t\t\tconst height = this._height;\n\t\t\t\t\tthis.onResize(width, height, oldWidth, height);\n\n\t\t\t\t\tif (scalarSet.x != null) {\n\t\t\t\t\t\tconst position = this._position;\n\t\t\t\t\t\tconst parent = this.getParentOfSize();\n\t\t\t\t\t\tif (parent) {\n\t\t\t\t\t\t\tposition.x = scalarSet.x(\n\t\t\t\t\t\t\t\tparent.width,\n\t\t\t\t\t\t\t\twidth,\n\t\t\t\t\t\t\t\tparent.padding.getLeft(),\n\t\t\t\t\t\t\t\tposition.x\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (scalarSet.width !== undefined) {\n\t\t\t\t\t\tscalarSet.width = undefined;\n\t\t\t\t\t\tthis.toParentResized();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst scalar = DScalarFunctions.size(width);\n\t\t\t\tif (scalarSet.width !== scalar) {\n\t\t\t\t\tscalarSet.width = scalar;\n\t\t\t\t\tthis.toParentResized();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// @ts-ignore\n\tget height(): number {\n\t\treturn this._height;\n\t}\n\n\tset height(height: DCoordinateSize) {\n\t\tthis.setHeight(height);\n\t}\n\n\tgetHeight(): DCoordinateSize {\n\t\treturn this._auto.height.toCoordinate(this._scalarSet.height || this._height);\n\t}\n\n\tsetHeight(height: DCoordinateSize): void {\n\t\tconst auto = this._auto.height;\n\t\tconst isOn = auto.isOn;\n\t\tconst isAuto = auto.from(height);\n\t\tif (auto.isOn !== isOn) {\n\t\t\tthis.toHierarchyDirty();\n\t\t\tDApplications.update(this);\n\t\t}\n\t\tif (!isAuto) {\n\t\t\tconst scalarSet = this._scalarSet;\n\t\t\tif (isNumber(height)) {\n\t\t\t\tconst oldHeight = this._height;\n\t\t\t\tif (oldHeight !== height) {\n\t\t\t\t\tscalarSet.height = undefined;\n\t\t\t\t\tthis._height = height;\n\t\t\t\t\tconst width = this._width;\n\t\t\t\t\tthis.onResize(width, height, width, oldHeight);\n\n\t\t\t\t\tif (scalarSet.y != null) {\n\t\t\t\t\t\tconst position = this._position;\n\t\t\t\t\t\tconst parent = this.getParentOfSize();\n\t\t\t\t\t\tif (parent) {\n\t\t\t\t\t\t\tposition.y = scalarSet.y(\n\t\t\t\t\t\t\t\tparent.height,\n\t\t\t\t\t\t\t\theight,\n\t\t\t\t\t\t\t\tparent.padding.getTop(),\n\t\t\t\t\t\t\t\tposition.y\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (scalarSet.height !== undefined) {\n\t\t\t\t\t\tscalarSet.height = undefined;\n\t\t\t\t\t\tthis.toParentResized();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst scalar = DScalarFunctions.size(height);\n\t\t\t\tif (scalarSet.height !== scalar) {\n\t\t\t\t\tscalarSet.height = scalar;\n\t\t\t\t\tthis.toParentResized();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// @ts-ignore\n\tget position(): DBasePoint {\n\t\treturn this._position;\n\t}\n\n\t// @ts-ignore\n\tget scale(): DBasePoint {\n\t\treturn this._scale;\n\t}\n\n\t// @ts-ignore\n\tget skew(): DBasePoint {\n\t\treturn this._skew;\n\t}\n\n\tget padding(): DPadding {\n\t\treturn this._padding;\n\t}\n\n\tget corner(): DCorner {\n\t\treturn this._corner;\n\t}\n\n\tget background(): DBackgroundStateAware {\n\t\treturn this._background;\n\t}\n\n\tget border(): DBorderStateAware {\n\t\treturn this._border;\n\t}\n\n\tget outline(): DOutline {\n\t\treturn this._outline;\n\t}\n\n\tget unsafe(): Transform {\n\t\treturn this.transform;\n\t}\n\n\tget title(): string {\n\t\treturn this._title;\n\t}\n\n\tset title(title: string) {\n\t\tif (this._title !== title) {\n\t\t\tthis._title = title;\n\t\t\tif (this.state.isHovered) {\n\t\t\t\tthis.applyTitle();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected applyTitle(): void {\n\t\tconst layer = DApplications.getLayer(this);\n\t\tif (layer) {\n\t\t\tlayer.view.title = this._title;\n\t\t}\n\t}\n\n\tshow(): this {\n\t\tif (!this.visible) {\n\t\t\tthis.visible = true;\n\t\t\tthis.toParentHierarchyDirty();\n\t\t\tDApplications.update(this);\n\t\t}\n\t\treturn this;\n\t}\n\n\tisShown(): boolean {\n\t\treturn this.visible;\n\t}\n\n\thide(): this {\n\t\tif (this.visible) {\n\t\t\tthis.visible = false;\n\t\t\tthis.toParentHierarchyDirty();\n\t\t\tthis.blur(true);\n\t\t\tDApplications.update(this);\n\t\t}\n\t\treturn this;\n\t}\n\n\tisHidden(): boolean {\n\t\treturn !this.visible;\n\t}\n\n\ttoDirty(): boolean {\n\t\tif (!this._isDirty) {\n\t\t\tthis._isDirty = true;\n\t\t\tthis.toParentHasDirty();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\ttoHasDirty(): boolean {\n\t\tif (!this._hasDirty) {\n\t\t\tthis._hasDirty = true;\n\t\t\tthis.toParentHasDirty();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\ttoParentHasDirty(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent instanceof DBase) {\n\t\t\tparent.toHasDirty();\n\t\t}\n\t}\n\n\ttoHierarchyDirty(): boolean {\n\t\tif (!this._isHierarchyDirty) {\n\t\t\tthis._isHierarchyDirty = true;\n\t\t\tthis.onHierarchyDirty();\n\t\t\tthis.toParentHierarchyDirty();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\ttoParentHierarchyDirty(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent instanceof DBase) {\n\t\t\tparent.toHierarchyDirty();\n\t\t}\n\t}\n\n\tisHierarchyDirty(): boolean {\n\t\treturn this._isHierarchyDirty;\n\t}\n\n\tprotected onHierarchyDirty(): void {\n\t\t// DO NOTHING\n\t}\n\n\tisDirty(): boolean {\n\t\treturn this._isDirty;\n\t}\n\n\thasDirty(): boolean {\n\t\treturn this._hasDirty;\n\t}\n\n\tprotected setFocused(isFocused: boolean): this {\n\t\tif (this.state.isFocused !== isFocused) {\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer) {\n\t\t\t\tlayer.getFocusController().set(this, isFocused);\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tfocus(): this {\n\t\treturn this.setFocused(true);\n\t}\n\n\tblur(recursively?: boolean): this {\n\t\tif (recursively) {\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer) {\n\t\t\t\tconst focusController = layer.getFocusController();\n\t\t\t\tconst focused = focusController.get();\n\t\t\t\tif (focused instanceof DBase) {\n\t\t\t\t\tlet current: Container = focused;\n\t\t\t\t\twhile (current) {\n\t\t\t\t\t\tif (current === this) {\n\t\t\t\t\t\t\tfocused.setFocused(false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrent = current.parent;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.setFocused(false);\n\t\t}\n\t\treturn this;\n\t}\n\n\tprotected onStateChange(newState: DBaseStateSet, oldState: DBaseStateSet): void {\n\t\tthis.toDirty();\n\t\tDApplications.update(this);\n\t\tthis.emit(\"statechange\", newState, oldState, this);\n\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tif (child instanceof DBase) {\n\t\t\t\tchild.state.onParentChange(newState, oldState);\n\t\t\t}\n\t\t}\n\n\t\tif (newState.isFocused) {\n\t\t\tif (!oldState.isFocused) {\n\t\t\t\tthis.onFocus();\n\t\t\t}\n\t\t} else if (oldState.isFocused) {\n\t\t\tthis.onBlur();\n\t\t}\n\n\t\tthis.cursor = this.toCursor(this._cursor, newState);\n\t}\n\n\tprotected onChildFocus(focused: DBase): void {\n\t\tconst parent = this.parent;\n\t\tif (parent instanceof DBase) {\n\t\t\tparent.onChildFocus(focused);\n\t\t}\n\t}\n\n\tprotected onFocus(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent instanceof DBase) {\n\t\t\tparent.onChildFocus(this);\n\t\t}\n\t}\n\n\tprotected onChildBlur(blured: DBase): void {\n\t\tconst parent = this.parent;\n\t\tif (parent instanceof DBase) {\n\t\t\tparent.onChildBlur(blured);\n\t\t}\n\t}\n\n\tprotected onBlur(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent instanceof DBase) {\n\t\t\tparent.onChildBlur(this);\n\t\t}\n\t}\n\n\tget state(): DBaseStateSet {\n\t\treturn this._state;\n\t}\n\n\tget options(): OPTIONS | undefined {\n\t\treturn this._options;\n\t}\n\n\tget theme(): THEME {\n\t\treturn this._theme;\n\t}\n\n\tset theme(theme: THEME) {\n\t\tconst result = this._theme;\n\t\tif (result !== theme) {\n\t\t\tthis._theme = theme;\n\t\t\tthis._padding.setTheme(theme);\n\t\t\tthis._background.setTheme(theme);\n\t\t\tthis._border.setTheme(theme);\n\t\t\tthis._outline.setTheme(theme);\n\t\t\tthis._corner.setTheme(theme);\n\t\t\tthis.toDirty();\n\t\t\tDApplications.update(this);\n\t\t}\n\t}\n\n\treflow(): void {\n\t\tconst isDirty = this._isDirty;\n\t\tif (isDirty) {\n\t\t\tthis.onReflow();\n\t\t\tthis._isDirty = false;\n\t\t}\n\n\t\tconst hasDirty = this._hasDirty;\n\t\tconst isHierarchyDirty = this._isHierarchyDirty;\n\t\tif (hasDirty || isHierarchyDirty) {\n\t\t\tthis._hasDirty = false;\n\t\t\tthis._isHierarchyDirty = false;\n\n\t\t\tconst children = this.children;\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tif (child instanceof DBase) {\n\t\t\t\t\tchild.reflow();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (isDirty || hasDirty || isHierarchyDirty) {\n\t\t\tthis.onRefit();\n\t\t}\n\t}\n\n\tprotected onRefit(): void {\n\t\tconst auto = this._auto;\n\t\tconst isWidthAuto = auto.width.isOn;\n\t\tconst isHeightAuto = auto.height.isOn;\n\t\tif (isWidthAuto && isHeightAuto) {\n\t\t\tlet width = 0;\n\t\t\tlet height = 0;\n\t\t\tconst children = this.children;\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tif (child.visible) {\n\t\t\t\t\tif (this.hasRefitableWidth(child)) {\n\t\t\t\t\t\twidth = Math.max(width, child.x + child.width);\n\t\t\t\t\t}\n\t\t\t\t\tif (this.hasRefitableHeight(child)) {\n\t\t\t\t\t\theight = Math.max(height, child.y + child.height);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst padding = this.padding;\n\t\t\tthis.resize(width + padding.getRight(), height + padding.getBottom());\n\t\t} else if (isWidthAuto) {\n\t\t\tlet width = 0;\n\t\t\tconst children = this.children;\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tif (child.visible && this.hasRefitableWidth(child)) {\n\t\t\t\t\twidth = Math.max(width, child.x + child.width);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.resize(width + this.padding.getRight(), undefined);\n\t\t} else if (isHeightAuto) {\n\t\t\tlet height = 0;\n\t\t\tconst children = this.children;\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tif (child.visible && this.hasRefitableHeight(child)) {\n\t\t\t\t\theight = Math.max(height, child.y + child.height);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.resize(undefined, height + this.padding.getBottom());\n\t\t}\n\t}\n\n\tprotected isRefitable(target: any): target is DRefitable {\n\t\treturn target instanceof DBase;\n\t}\n\n\tprotected hasRefitableHeight(target: any): target is DRefitable {\n\t\treturn (\n\t\t\tthis.isRefitable(target) && !(target instanceof DBase && isFunction(target.getHeight()))\n\t\t);\n\t}\n\n\tprotected hasRefitableWidth(target: any): target is DBase<any, any> {\n\t\treturn (\n\t\t\tthis.isRefitable(target) && !(target instanceof DBase && isFunction(target.getWidth()))\n\t\t);\n\t}\n\n\tprotected onReflow(): void {\n\t\tthis._reflowable.onReflow(this, this._width, this._height);\n\t}\n\n\tget shadow(): DShadow | null {\n\t\treturn this._shadow;\n\t}\n\n\tset shadow(shadow: DShadow | null) {\n\t\tconst previous = this._shadow;\n\t\tif (previous !== shadow) {\n\t\t\tconst reflowable = this._reflowable;\n\t\t\tconst snippet = this._snippet;\n\t\t\tconst onShadowUpdateBound = this._onShadowUpdateBound;\n\t\t\tif (previous != null) {\n\t\t\t\tprevious.off(\"update\", onShadowUpdateBound);\n\t\t\t\treflowable.remove(previous);\n\t\t\t\tsnippet.remove(previous, true);\n\t\t\t}\n\n\t\t\tthis._shadow = shadow;\n\t\t\tif (shadow != null) {\n\t\t\t\tshadow.on(\"update\", onShadowUpdateBound);\n\t\t\t\treflowable.add(shadow);\n\t\t\t\tsnippet.addAt(shadow, true, 0);\n\t\t\t}\n\n\t\t\tDApplications.update(this);\n\t\t}\n\t}\n\n\tprotected toParentResized(): void {\n\t\tconst parent = this.getParentOfSize();\n\t\tif (parent) {\n\t\t\tthis.onParentResize(parent.width, parent.height, parent.padding);\n\t\t}\n\t}\n\n\tprotected getParentOfSize(): { width: number; height: number; padding: DPadding } | null {\n\t\tconst parent = this.parent;\n\t\tif (parent instanceof DBase) {\n\t\t\treturn parent;\n\t\t} else {\n\t\t\treturn DApplications.getLayer(this);\n\t\t}\n\t}\n\n\t/**\n\t * Called when a parent resized.\n\t *\n\t * @param parentWidth a parent's local width\n\t * @param parentHeight a parent's local height\n\t */\n\tonParentResize(parentWidth: number, parentHeight: number, parentPadding: DPadding): void {\n\t\tconst scalarSet = this._scalarSet;\n\t\tconst position = this.transform.position;\n\t\tconst x = position.x;\n\t\tconst y = position.y;\n\t\tconst width = this._width;\n\t\tconst height = this._height;\n\n\t\t// Width & height\n\t\tconst paddingWidth = parentPadding.getLeft() + parentPadding.getRight();\n\t\tconst paddingHeight = parentPadding.getTop() + parentPadding.getBottom();\n\t\tconst newWidth =\n\t\t\tscalarSet.width != null\n\t\t\t\t? scalarSet.width(parentWidth, width, paddingWidth, width)\n\t\t\t\t: width;\n\t\tconst newHeight =\n\t\t\tscalarSet.height != null\n\t\t\t\t? scalarSet.height(parentHeight, height, paddingHeight, height)\n\t\t\t\t: height;\n\t\tthis.resize(newWidth, newHeight);\n\n\t\t// X & Y\n\t\tconst newX =\n\t\t\tscalarSet.x != null\n\t\t\t\t? scalarSet.x(parentWidth, this._width, parentPadding.getLeft(), x)\n\t\t\t\t: x;\n\t\tconst newY =\n\t\t\tscalarSet.y != null\n\t\t\t\t? scalarSet.y(parentHeight, this._height, parentPadding.getTop(), y)\n\t\t\t\t: y;\n\t\tthis.position.set(newX, newY);\n\t}\n\n\t/**\n\t * Called when a parent moved.\n\t *\n\t * @param newX a new parent's local x position\n\t * @param newY a new parent's local y position\n\t * @param oldX an old parent's local x position\n\t * @param oldY an old parent's local y position\n\t */\n\tprotected onParentMove(newX: number, newY: number, oldX: number, oldY: number): void {\n\t\t// DO NOTHING\n\t}\n\n\t// Wheel\n\tonWheel(e: WheelEvent, deltas: UtilWheelEventDeltas, global: Point): boolean {\n\t\tthis.emit(\"wheel\", e, deltas, global, this);\n\t\treturn false;\n\t}\n\n\t// Keydown\n\tonKeyDown(e: KeyboardEvent): boolean {\n\t\tthis.emit(\"keydown\", e, this);\n\t\treturn false;\n\t}\n\n\tonKeyUp(e: KeyboardEvent): boolean {\n\t\tthis.emit(\"keyup\", e, this);\n\t\treturn false;\n\t}\n\n\t// Down\n\tprotected isEventTarget(e: InteractionEvent): boolean {\n\t\tconst target = e.target;\n\t\tif (target === this) {\n\t\t\treturn true;\n\t\t} else if (target != null && !(target instanceof DBase)) {\n\t\t\tlet parent = target.parent;\n\t\t\twhile (parent != null && !(parent instanceof DBase)) {\n\t\t\t\tparent = parent.parent;\n\t\t\t}\n\t\t\treturn parent === this;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected onDown(e: InteractionEvent): void {\n\t\tif (this.isEventTarget(e)) {\n\t\t\tthis.onDownThis(e);\n\t\t}\n\t\tthis.emit(\"down\", e, this);\n\t}\n\n\tprotected onDownThis(e: InteractionEvent): void {\n\t\tconst oe = e.data.originalEvent;\n\t\tif (\"touches\" in oe) {\n\t\t\tconst lastDownPoint = this._lastDownPoint || new Point();\n\t\t\tthis._lastDownPoint = lastDownPoint;\n\t\t\tlastDownPoint.copyFrom(e.data.global);\n\t\t} else {\n\t\t\tthis.focusOnClosest();\n\t\t}\n\t}\n\n\tprotected onUp(e: InteractionEvent): void {\n\t\tif (this.isEventTarget(e)) {\n\t\t\tthis.onUpThis(e);\n\t\t}\n\t\tthis.emit(\"up\", e, this);\n\t}\n\n\tprotected onUpThis(e: InteractionEvent): void {\n\t\tconst oe = e.data.originalEvent;\n\t\tif (\"touches\" in oe) {\n\t\t\tconst lastDownPoint = this._lastDownPoint;\n\t\t\tif (lastDownPoint) {\n\t\t\t\tconst global = e.data.global;\n\t\t\t\tconst dx = Math.abs(global.x - lastDownPoint.x);\n\t\t\t\tconst dy = Math.abs(global.y - lastDownPoint.y);\n\t\t\t\tconst threshold = UtilPointerEvent.CLICK_DISTANCE_THRESHOLD;\n\t\t\t\tif (dx < threshold && dy < threshold) {\n\t\t\t\t\tthis.focusOnClosest();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected focusOnClosest(): void {\n\t\tconst layer = DApplications.getLayer(this);\n\t\tif (layer) {\n\t\t\tconst focusController = layer.getFocusController();\n\t\t\tfocusController.focus(focusController.findParent(this));\n\t\t}\n\t}\n\n\t// Over\n\tprotected onOver(e: InteractionEvent): void {\n\t\t// Update the hover state\n\t\tthis.state.isHovered = true;\n\n\t\t// Update the title\n\t\tif (e.target === this) {\n\t\t\tthis.applyTitle();\n\t\t}\n\n\t\t// Event\n\t\tthis.emit(\"over\", e, this);\n\t}\n\n\t// Out\n\tprotected onOut(e: InteractionEvent): void {\n\t\t// Update the hover state\n\t\tthis.state.isHovered = false;\n\n\t\t// Event\n\t\tthis.emit(\"out\", e, this);\n\t}\n\n\t// Double click\n\tonDblClick(e: MouseEvent | TouchEvent, interactionManager: InteractionManager): boolean {\n\t\tthis.emit(\"dblclick\", e, interactionManager, this);\n\t\treturn false;\n\t}\n\n\t//\n\trender(renderer: Renderer): void {\n\t\tif (this.visible && 0 < this.worldAlpha && this.renderable) {\n\t\t\tconst snippet = this._snippet;\n\t\t\tsnippet.render(renderer, true);\n\t\t\tsuper.render(renderer);\n\t\t\tsnippet.render(renderer, false);\n\t\t}\n\t}\n\n\t//\n\tprotected getThemeDefault(): THEME {\n\t\treturn DThemes.getInstance().get(this.getType());\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DBase\";\n\t}\n\n\t//\n\tprotected _calculateBounds(): void {\n\t\tconst worldTransform = this.transform.worldTransform;\n\t\tconst bounds = this._bounds;\n\n\t\tconst work = DBase.WORK_CONTAINS_POINT;\n\t\twork.set(0, 0);\n\t\tworldTransform.apply(work, work);\n\t\tbounds.addPoint(work);\n\n\t\twork.set(this._width, this._height);\n\t\tworldTransform.apply(work, work);\n\t\tbounds.addPoint(work);\n\n\t\tsuper._calculateBounds();\n\t}\n\n\tcontainsPoint(point: Point): boolean {\n\t\treturn (\n\t\t\tthis.containsGlobalPoint(point) ||\n\t\t\tthis.containsLocalPoint(\n\t\t\t\tthis.worldTransform.applyInverse(point, DBase.WORK_CONTAINS_POINT)\n\t\t\t)\n\t\t);\n\t}\n\n\tprotected containsGlobalPoint(point: Point): boolean {\n\t\treturn false;\n\t}\n\n\tprotected containsLocalPoint(point: Point): boolean {\n\t\tconst x = point.x;\n\t\tconst y = point.y;\n\t\tconst w = this._width;\n\t\tconst h = this._height;\n\t\treturn 0 <= x && x <= w && 0 <= y && y <= h;\n\t}\n\n\t/**\n\t * Returns a clipping rect.\n\t *\n\t * @param result a clipping rect\n\t */\n\tgetClippingRect(target: unknown, result: Rectangle): void {\n\t\tresult.x = 0;\n\t\tresult.y = 0;\n\t\tresult.width = this._width;\n\t\tresult.height = this._height;\n\t}\n\n\tdestroy(): void {\n\t\t// Layout\n\t\tconst scalarSet = this._scalarSet;\n\t\tscalarSet.x = null;\n\t\tscalarSet.y = null;\n\t\tscalarSet.width = null;\n\t\tscalarSet.height = null;\n\n\t\t// Shadow\n\t\tconst shadow = this._shadow;\n\t\tif (shadow) {\n\t\t\tthis._shadow = null;\n\t\t\tshadow.destroy();\n\t\t}\n\n\t\t// Children\n\t\tconst children = this.children;\n\t\tfor (let i = children.length - 1; 0 <= i; --i) {\n\t\t\tchildren[i].destroy();\n\t\t}\n\t\tchildren.length = 0;\n\n\t\t//\n\t\tsuper.destroy();\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-base.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EACN,SAAS,EAGT,KAAK,EAKL,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,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AO,EAAE,CAAC;SACjB;QAED,WAAW;QACX,IAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE;YAC9C,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACtB;QACD,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QAEpB,EAAE;QACF,iBAAM,OAAO,WAAE,CAAC;IACjB,CAAC;IA5uCgB,yBAAmB,GAAU,IAAI,KAAK,EAAE,CAAC;IA6uC3D,YAAC;CAAA,AAjvCD,CAGU,SAAS,GA8uClB;SAjvCY,KAAK","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n\tContainer,\n\tDisplayObject,\n\tinteraction,\n\tPoint,\n\tRectangle,\n\tRenderer,\n\tTexture,\n\tTransform\n} from \"pixi.js\";\nimport InteractionEvent = interaction.InteractionEvent;\nimport InteractionManager = interaction.InteractionManager;\nimport { DApplications } from \"./d-applications\";\nimport { DBackgroundStateAware } from \"./d-background\";\nimport { DBaseBackground } from \"./d-base-background\";\nimport { DBaseBorder } from \"./d-base-border\";\nimport { DBaseCorner } from \"./d-base-corner\";\nimport { DBaseInteractive } from \"./d-base-interactive\";\nimport { DBaseOutline } from \"./d-base-outline\";\nimport { DBasePadding } from \"./d-base-padding\";\nimport { DBasePoint } from \"./d-base-point\";\nimport { DBaseReflowableImpl } from \"./d-base-reflowable-impl\";\nimport { DBaseStateSet } from \"./d-base-state-set\";\nimport { DBaseStateSetImplObservable } from \"./d-base-state-set-impl-observable\";\nimport { DBorderStateAware } from \"./d-border\";\nimport { DBorderMask } from \"./d-border-mask\";\nimport { DCoordinatePosition, DCoordinateSize } from \"./d-coordinate\";\nimport { DCorner } from \"./d-corner\";\nimport { DCornerMask } from \"./d-corner-mask\";\nimport { DThemeFont } from \"./d-font\";\nimport { DLayoutClearType } from \"./d-layout-clear-type\";\nimport { DOutline } from \"./d-outline\";\nimport { DPadding } from \"./d-padding\";\nimport { DScalarFunctions } from \"./d-scalar-functions\";\nimport { DScalarSet } from \"./d-scalar-set\";\nimport { DShadow } from \"./d-shadow\";\nimport { DStateAwareOrValueMightBe } from \"./d-state-aware\";\nimport { DThemes } from \"./theme/d-themes\";\nimport { isFunction } from \"./util/is-function\";\nimport { isNumber } from \"./util/is-number\";\nimport { isString } from \"./util/is-string\";\nimport { UtilKeyboardEvent, UtilKeyboardEventShortcut } from \"./util/util-keyboard-event\";\nimport { UtilPointerEvent } from \"./util/util-pointer-event\";\nimport { UtilWheelEventDeltas } from \"./util/util-wheel-event\";\nimport { DBaseAutoSet } from \"./d-base-auto-set\";\nimport { toEnum } from \"./util/to-enum\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { DBaseSnippetContainer } from \"./d-base-snippet-container\";\nimport { DBaseReflowableContainer } from \"./d-base-reflowable-container\";\n\n/**\n * {@link DBase} padding options.\n */\nexport interface DBasePaddingOptions {\n\t/** A top padding */\n\ttop?: number;\n\n\t/** A right padding */\n\tright?: number;\n\n\t/** A bottom padding */\n\tbottom?: number;\n\n\t/** A left padding */\n\tleft?: number;\n}\n\n/**\n * {@link DBase} corner options.\n */\nexport interface DBaseCornerOptions {\n\t/** A radius */\n\tradius?: number;\n\n\t/** Masked corners get unrounded. */\n\tmask?: keyof typeof DCornerMask | DCornerMask;\n}\n\n/**\n * {@link DBase} events.\n */\nexport interface DBaseEvents<EMITTER> {\n\t/**\n\t * Triggered when an initialization is finished.\n\t *\n\t * on( \"init\", ( emitter ) => {} )\n\t *\n\t * @param emitter an emitter\n\t */\n\tinit(emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when added to a container.\n\t *\n\t * @param container a container added to\n\t */\n\tadded(container: Container): void;\n\n\t/**\n\t * Triggered when removed from a container.\n\t *\n\t * @param container a container removed from\n\t */\n\tremoved(container: Container): void;\n\n\t/**\n\t * Triggered when moved.\n\t *\n\t * @param newX a new x\n\t * @param newY a new y\n\t * @param oldX an old x\n\t * @param oldY an old y\n\t * @param emitter an emitter\n\t */\n\tmove(newX: number, newY: number, oldX: number, oldY: number, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when resized.\n\t *\n\t * @param newWidth a new width\n\t * @param newHeight a new height\n\t * @param oldWidth an old width\n\t * @param oldHeight an old height\n\t * @param emitter an emitter\n\t */\n\tresize(\n\t\tnewWidth: number,\n\t\tnewHeight: number,\n\t\toldWidth: number,\n\t\toldHeight: number,\n\t\temitter: EMITTER\n\t): void;\n\n\t/**\n\t * Triggered when scaled.\n\t *\n\t * @param newX a new x\n\t * @param newY a new y\n\t * @param oldX an old x\n\t * @param oldY an old y\n\t * @param emitter an emitter\n\t */\n\tscale(newX: number, newY: number, oldX: number, oldY: number, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when skewed.\n\t *\n\t * @param newX a new x\n\t * @param newY a new y\n\t * @param oldX an old x\n\t * @param oldY an old y\n\t * @param emitter an emitter\n\t */\n\tskew(newX: number, newY: number, oldX: number, oldY: number, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a state is changed.\n\t *\n\t * @param newState a new state\n\t * @param oldState an old state\n\t * @param emitter an emitter\n\t */\n\tstatechange(newState: DBaseStateSet, oldState: DBaseStateSet, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a wheel moves.\n\t *\n\t * @param e a wheel event\n\t * @param deltas wheel move amounts\n\t * @param global a point wheel moved\n\t * @param emitter an emitter\n\t */\n\twheel(e: WheelEvent, deltas: UtilWheelEventDeltas, global: Point, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a key gets down.\n\t *\n\t * @param e a keyboard event\n\t * @param emitter an emitter\n\t */\n\tkeydown(e: KeyboardEvent, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a key gets up.\n\t *\n\t * @param e a keyboard event\n\t * @param emitter an emitter\n\t */\n\tkeyup(e: KeyboardEvent, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a pointer gets on an emitter.\n\t *\n\t * @param e an interaction event.\n\t * @param emitter an emitter\n\t */\n\tover(e: InteractionEvent, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a pointer gets out of an emitter.\n\t *\n\t * @param e an interaction event\n\t * @param emitter an emitter\n\t */\n\tout(e: InteractionEvent, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a pointer gets down on an emitter.\n\t *\n\t * @param e an interaction event.\n\t * @param emitter an emitter\n\t */\n\tdown(e: InteractionEvent, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a pointer gets up on an emitter.\n\t *\n\t * @param e an interaction event\n\t * @param emitter an emitter\n\t */\n\tup(e: InteractionEvent, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when an emitter is double clicked.\n\t *\n\t * @param e an event\n\t * @param interactionManager an interaction manager\n\t * @param emitter an emitter\n\t */\n\tdblclick(\n\t\te: MouseEvent | TouchEvent,\n\t\tinteractionManager: InteractionManager,\n\t\temitter: EMITTER\n\t): void;\n}\n\n/**\n * {@link DBase} \"on\" options.\n */\nexport interface DBaseOnOptions<EMITTER> extends Partial<DBaseEvents<EMITTER>>, DOnOptions {}\n\n/**\n * {@link DBase} background options.\n */\nexport interface DBaseBackgroundOptions {\n\t/**\n\t * A color code or a function returning a color code.\n\t * If a computed value is undefined, falls back to the theme color.\n\t * If a computed value is null, a background is not rendered.\n\t */\n\tcolor?: DStateAwareOrValueMightBe<number | null>;\n\n\t/**\n\t * An alpha or a function returning an alpha.\n\t * If a computed value is undefined, falls back to an background alpha of a theme.\n\t */\n\talpha?: DStateAwareOrValueMightBe<number>;\n}\n\n/**\n * {@link DBase} border options.\n */\nexport interface DBaseBorderOptions {\n\t/**\n\t * A color code or a function returning a color code.\n\t * If a computed value is undefined, falls back to the theme color.\n\t * If a computed value is null, a background is not rendered.\n\t */\n\tcolor?: DStateAwareOrValueMightBe<number | null>;\n\n\t/**\n\t * An alpha or a function returning an alpha.\n\t * If a computed value is undefined, falls back to a border alpha of a theme.\n\t */\n\talpha?: DStateAwareOrValueMightBe<number>;\n\n\t/**\n\t * A width or a function returning a width.\n\t * If a computed value is undefined, falls back to a border width of a theme.\n\t */\n\twidth?: DStateAwareOrValueMightBe<number>;\n\n\t/**\n\t * An align or a function returning an align.\n\t * If a computed value is undefined, falls back to a border align of a theme.\n\t * If an align is 0, a border is rendered completely inside of a {@link DBase}.\n\t * If an align is 1, a border is rendered completely outside of a {@link DBase}.\n\t */\n\talign?: DStateAwareOrValueMightBe<number>;\n\n\t/** Masked borders get removed. */\n\tmask?: DStateAwareOrValueMightBe<DBorderMask> | keyof typeof DBorderMask;\n}\n\n/**\n * {@link DBase} outline optons.\n */\nexport interface DBaseOutlineOptions {\n\t/**\n\t * A color code or a function returning a color code.\n\t * If a computed value is undefined, falls back to the theme color.\n\t * If a computed value is null, a background is not rendered.\n\t */\n\tcolor?: DStateAwareOrValueMightBe<number | null>;\n\n\t/**\n\t * An alpha or a function returning an alpha.\n\t * If a computed value is undefined, falls back to an outline alpha of a theme.\n\t */\n\talpha?: DStateAwareOrValueMightBe<number>;\n\n\t/**\n\t * A width or a function returning a width.\n\t * If a computed value is undefined, falls back to an outline width of a theme.\n\t */\n\twidth?: DStateAwareOrValueMightBe<number>;\n\n\t/**\n\t * An offset or a function returning an offset.\n\t * If a computed value is undefined, falls back to an outline align of a theme.\n\t * A outline moves to outside when an offset gets larger.\n\t */\n\toffset?: DStateAwareOrValueMightBe<number>;\n\n\t/**\n\t * An align or a function returning an align.\n\t * If a computed value is undefined, falls back to an outline align of a theme.\n\t * If an align is 0, an outline is rendered completely inside.\n\t * If an align is 1, an outline is rendered completely outside.\n\t */\n\talign?: DStateAwareOrValueMightBe<number>;\n\n\t/** Masked outlines get removed. */\n\tmask?: DStateAwareOrValueMightBe<DBorderMask> | keyof typeof DBorderMask;\n}\n\nexport type DBaseShadow = \"NONE\" | \"WEAK\" | \"DEFAULT\" | DShadow;\n\n/**\n * {@link DBase} options.\n */\nexport interface DBaseOptions<THEME extends DThemeBase = DThemeBase, EMITTER = any> {\n\t/**\n\t * A parent.\n\t *\n\t * In the case of UI classes which pop up (e.g., {@link DDialog} and {@link DMenu}),\n\t * if multiple application instances are there, better to set\n\t * this to an `application.stage` so that they pick a right application.\n\t * By default, they assume the last created application is\n\t * the one they belong to at the time when they are created.\n\t */\n\tparent?: Container;\n\n\t/** Children. */\n\tchildren?: Array<DisplayObject | null>;\n\n\t/** A name. */\n\tname?: string;\n\n\t/**\n\t * One of the followings:\n\t * * A X position\n\t * * A position keyword\n\t * * A position expression (Parsed by {@link DScalarExpression})\n\t * * A function returning a X position ({@link DScalarFunction})\n\t * * An object returning a X position ({@link DScalar})\n\t */\n\tx?: DCoordinatePosition;\n\n\t/**\n\t * One of the followings:\n\t * * A Y position\n\t * * A position keyword\n\t * * A position expresion (Parsed by {@link DScalarExpression})\n\t * * A function returning a Y position ({@link DScalarFunction})\n\t * * An object returning a Y position ({@link DScalar})\n\t */\n\ty?: DCoordinatePosition;\n\n\t/**\n\t * One of the followings:\n\t * * A width\n\t * * A size keyword\n\t * * A size expression (Parsed by {@link DScalarExpression})\n\t * * A function returning a width ({@link DScalarFunction})\n\t * * An object returning a width ({@link DScalar})\n\t */\n\twidth?: DCoordinateSize;\n\n\t/**\n\t * One of the followings:\n\t * * A height\n\t * * A size keyword\n\t * * A size expression (Parsed by {@link DScalarExpression})\n\t * * A function returning a hight ({@link DScalarFunction})\n\t * * An object returning a hight ({@link DScalar})\n\t */\n\theight?: DCoordinateSize;\n\n\t/**\n\t * A visibility.\n\t * Set to true to make {@link DBase} visible.\n\t * Set to false to make {@link DBase} invisible.\n\t * The default values is true.\n\t */\n\tvisible?: boolean;\n\n\t/** A default state. */\n\tstate?: string | string[];\n\n\t/** An interactivity option. */\n\tinteractive?: keyof typeof DBaseInteractive | DBaseInteractive;\n\n\t/** A padding options. */\n\tpadding?: number | DBasePaddingOptions;\n\n\t/** A corner options. */\n\tcorner?: number | DBaseCornerOptions;\n\n\t/** A theme or a theme name. */\n\ttheme?: THEME | string;\n\n\t/**\n\t * Mappings of event names and event handlers.\n\t */\n\ton?: DBaseOnOptions<EMITTER>;\n\n\t/**\n\t * A weight used by {@link DLayoutVertical} and {@link DLayoutHorizontal}.\n\t */\n\tweight?: number;\n\n\t/** A tooltip text. */\n\ttitle?: string;\n\n\t/** A shortcut option. */\n\tshortcut?: string | UtilKeyboardEventShortcut;\n\n\t/** A shortcut options. */\n\tshortcuts?: Array<string | UtilKeyboardEventShortcut>;\n\n\t/** A background options. */\n\tbackground?: DBaseBackgroundOptions;\n\n\t/** A border options. */\n\tborder?: DBaseBorderOptions;\n\n\t/** An outline options. */\n\toutline?: DBaseOutlineOptions;\n\n\t/** A shadow. */\n\tshadow?: DBaseShadow | null;\n\n\t/** A clear type used by {@link DLayoutVertical} and {@link DLayoutHorizontal}. */\n\tclear?: keyof typeof DLayoutClearType | DLayoutClearType;\n\n\t/** A cursor shape. */\n\tcursor?: DStateAwareOrValueMightBe<string>;\n}\n\n/**\n * {@link DBase} theme.\n */\nexport interface DThemeBase extends DThemeFont {\n\t/**\n\t * Returns a X coordinate.\n\t */\n\tgetX(): DCoordinatePosition;\n\n\t/**\n\t * Returns a Y coordinate.\n\t */\n\tgetY(): DCoordinatePosition;\n\n\t/**\n\t * Returns a height.\n\t */\n\tgetHeight(): DCoordinateSize;\n\n\t/**\n\t * Returns a width.\n\t */\n\tgetWidth(): DCoordinateSize;\n\n\t/**\n\t * Returns a background color.\n\t * If the color is null, backgrounds are not be rendered.\n\t *\n\t * @param state a state\n\t */\n\tgetBackgroundColor(state: DBaseStateSet): number | null;\n\n\t/**\n\t * Returns a background alpha.\n\t *\n\t * @param state a state\n\t */\n\tgetBackgroundAlpha(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns a background texture.\n\t */\n\tgetBackgroundTexture(): Texture;\n\n\t/**\n\t * Returns a border color.\n\t * If the color is null, borders are not be rendered.\n\t *\n\t * @param state a state\n\t */\n\tgetBorderColor(state: DBaseStateSet): number | null;\n\n\t/**\n\t * Returns a border alpha.\n\t *\n\t * @param state a state\n\t */\n\tgetBorderAlpha(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns a border width.\n\t *\n\t * @param state a state\n\t */\n\tgetBorderWidth(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns a border align.\n\t *\n\t * @param state a state\n\t */\n\tgetBorderAlign(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns a border mask.\n\t *\n\t * @param state a mask\n\t */\n\tgetBorderMask(state: DBaseStateSet): DBorderMask;\n\n\t/**\n\t * Returns a border texture.\n\t */\n\tgetBorderTexture(): Texture;\n\n\t/**\n\t * Returns a left padding.\n\t */\n\tgetPaddingLeft(): number;\n\n\t/**\n\t * Returns a right padding.\n\t */\n\tgetPaddingRight(): number;\n\n\t/**\n\t * Returns a top padding.\n\t */\n\tgetPaddingTop(): number;\n\n\t/**\n\t * Returns a bottom padding.\n\t */\n\tgetPaddingBottom(): number;\n\n\t/**\n\t * Returns a corner radius.\n\t */\n\tgetCornerRadius(): number;\n\n\t/**\n\t * Returns a corner mask.\n\t */\n\tgetCornerMask(): DCornerMask;\n\n\t/**\n\t * Returns an outline color.\n\t * If the color is null, outlines are not be rendered.\n\t *\n\t * @param state a state\n\t */\n\tgetOutlineColor(state: DBaseStateSet): number | null;\n\n\t/**\n\t * Returns an outline alpha.\n\t *\n\t * @param state a state\n\t */\n\tgetOutlineAlpha(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns an outline width.\n\t *\n\t * @param state a state\n\t */\n\tgetOutlineWidth(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns an outline offset.\n\t *\n\t * @param state a state\n\t */\n\tgetOutlineOffset(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns an outline align.\n\t *\n\t * @param state a state\n\t */\n\tgetOutlineAlign(state: DBaseStateSet): number;\n\n\t/**\n\t * Returns an outline mask.\n\t *\n\t * @param state a state\n\t */\n\tgetOutlineMask(state: DBaseStateSet): DBorderMask;\n\n\t/**\n\t * Returns a shadow.\n\t * If a shadow is null, no shadow is rendered.\n\t */\n\tgetShadow(): DShadow | null;\n\n\t/**\n\t * Returns an interactivity.\n\t */\n\tgetInteractive(): DBaseInteractive;\n\n\t/**\n\t * Returns true if focusable.\n\t */\n\tnewState(state: DBaseStateSet): void;\n\n\t/**\n\t * Returns a tooltip text.\n\t */\n\tgetTitle(): string;\n\n\t/**\n\t * Returns a clear type.\n\t * A clear type is for layout classes including {@link DLayoutVertical}.\n\t */\n\tgetClearType(): DLayoutClearType;\n\n\t/**\n\t * Returns a weight.\n\t * Weights are for layout classes including {@link DLayoutVertical}.\n\t * If a weight is less than or equals to zero, layout classes are supposed not to change a width / height.\n\t */\n\tgetWeight(): number;\n\n\t/**\n\t * Creates a new shadow.\n\t */\n\tnewShadow(): DShadow | null;\n\n\t/**\n\t * Creates a new weak shadow.\n\t */\n\tnewShadowWeak(): DShadow | null;\n\n\t/**\n\t * Returns a cursor.\n\t */\n\tgetCursor(state: DBaseStateSet): string;\n}\n\nconst toTheme = <THEME extends DThemeBase>(options?: DBaseOptions<THEME>): THEME | undefined => {\n\tconst theme = options?.theme;\n\tif (theme) {\n\t\tif (isString(theme)) {\n\t\t\treturn DThemes.getInstance().get(theme);\n\t\t}\n\t\treturn theme;\n\t}\n};\n\nexport interface DRefitable {\n\treadonly width: number;\n\treadonly height: number;\n}\n\nconst toShortcuts = <THEME extends DThemeBase>(\n\toptions?: DBaseOptions<THEME>\n): UtilKeyboardEventShortcut[] | undefined => {\n\tif (options) {\n\t\tconst shortcut = options.shortcut;\n\t\tconst shortcuts = options.shortcuts;\n\t\tif (shortcuts != null || shortcut != null) {\n\t\t\tconst result: UtilKeyboardEventShortcut[] = [];\n\t\t\tif (shortcut != null) {\n\t\t\t\tresult.push(UtilKeyboardEvent.toShortcut(shortcut));\n\t\t\t}\n\t\t\tif (shortcuts != null) {\n\t\t\t\tfor (let i = 0, imax = shortcuts.length; i < imax; ++i) {\n\t\t\t\t\tUtilKeyboardEvent.toShortcut(shortcuts[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\treturn undefined;\n};\n\n/**\n * A base class for UI classes.\n * See {@link DBaseEvents} for event details.\n */\nexport class DBase<\n\tTHEME extends DThemeBase = DThemeBase,\n\tOPTIONS extends DBaseOptions<THEME> = DBaseOptions<THEME>\n> extends Container {\n\tprotected static WORK_CONTAINS_POINT: Point = new Point();\n\n\tprivate _state: DBaseStateSet;\n\tprivate _theme: THEME;\n\tprotected _options: OPTIONS | undefined;\n\tprivate _width: number;\n\tprivate _height: number;\n\tprotected _padding: DPadding;\n\tprotected _corner: DCorner;\n\tprivate _scalarSet: DScalarSet;\n\tprotected _auto: DBaseAutoSet;\n\tprivate _isDirty: boolean;\n\tprivate _hasDirty: boolean;\n\tprivate _isHierarchyDirty: boolean;\n\tprivate _shadow: DShadow | null;\n\tprivate _onShadowUpdateBound: () => void;\n\tprivate _weight: number;\n\tprivate _position: DBasePoint;\n\tprivate _scale: DBasePoint;\n\tprivate _skew: DBasePoint;\n\tprotected _title: string;\n\tprotected _background: DBackgroundStateAware;\n\tprotected _border: DBorderStateAware;\n\tprotected _outline: DOutline;\n\tprotected _clearType: DLayoutClearType;\n\tprotected _shortcuts?: UtilKeyboardEventShortcut[];\n\tprotected _snippet: DBaseSnippetContainer;\n\tprotected _reflowable: DBaseReflowableContainer;\n\tprotected _lastDownPoint?: Point;\n\tprotected _cursor?: DStateAwareOrValueMightBe<string>;\n\n\tconstructor(options?: OPTIONS) {\n\t\tsuper();\n\n\t\t// Transform\n\t\tconst transform: Transform = this.transform;\n\t\tthis._position = new DBasePoint(transform.position, (newX, newY, oldX, oldY): void => {\n\t\t\tthis.onMove(newX, newY, oldX, oldY);\n\t\t});\n\t\tthis._scale = new DBasePoint(transform.scale, (newX, newY, oldX, oldY): void => {\n\t\t\tthis.onScale(newX, newY, oldX, oldY);\n\t\t});\n\t\tthis._skew = new DBasePoint(transform.skew, (newX, newY, oldX, oldY): void => {\n\t\t\tthis.onSkew(newX, newY, oldX, oldY);\n\t\t});\n\n\t\t//\n\t\tthis._options = options;\n\t\tconst scalarSet: DScalarSet = (this._scalarSet = {});\n\t\tthis._auto = new DBaseAutoSet();\n\t\tthis._isDirty = true;\n\t\tthis._hasDirty = false;\n\t\tthis._isHierarchyDirty = false;\n\t\tthis._shadow = null;\n\t\tthis.name = options?.name ?? \"\";\n\t\tconst theme = toTheme(options) || this.getThemeDefault();\n\t\tthis._theme = theme;\n\t\tthis._snippet = new DBaseSnippetContainer(this);\n\t\tthis._reflowable = new DBaseReflowableContainer();\n\t\tthis._clearType = toEnum(options?.clear ?? theme.getClearType(), DLayoutClearType);\n\t\tthis._padding = new DBasePadding(theme, options, (): void => {\n\t\t\tthis.toParentResized();\n\t\t\tthis.toHierarchyDirty();\n\t\t\tDApplications.update(this);\n\t\t});\n\t\tconst toDirtyAndUpdate = (): void => {\n\t\t\tthis.toDirty();\n\t\t\tDApplications.update(this);\n\t\t};\n\t\tthis._background = new DBaseBackground(theme, options, toDirtyAndUpdate);\n\t\tthis._border = new DBaseBorder(theme, options, toDirtyAndUpdate);\n\t\tthis._outline = new DBaseOutline(theme, options, toDirtyAndUpdate);\n\t\tthis._corner = new DBaseCorner(theme, options, toDirtyAndUpdate);\n\n\t\t// X\n\t\tconst position = transform.position;\n\t\tconst x = options?.x ?? theme.getX();\n\t\tif (isNumber(x)) {\n\t\t\tposition.x = x;\n\t\t} else {\n\t\t\tposition.x = 0;\n\t\t\tscalarSet.x = DScalarFunctions.position(x);\n\t\t}\n\n\t\t// Y\n\t\tconst y = options?.y ?? theme.getY();\n\t\tif (isNumber(y)) {\n\t\t\tposition.y = y;\n\t\t} else {\n\t\t\tposition.y = 0;\n\t\t\tscalarSet.y = DScalarFunctions.position(y);\n\t\t}\n\n\t\t// Width\n\t\tconst width = options?.width ?? theme.getWidth();\n\t\tif (!this._auto.width.from(width)) {\n\t\t\tif (isNumber(width)) {\n\t\t\t\tthis._width = width;\n\t\t\t} else {\n\t\t\t\tthis._width = 100;\n\t\t\t\tscalarSet.width = DScalarFunctions.size(width);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._width = 100;\n\t\t}\n\n\t\t// Height\n\t\tconst height = options?.height ?? theme.getHeight();\n\t\tif (!this._auto.height.from(height)) {\n\t\t\tif (isNumber(height)) {\n\t\t\t\tthis._height = height;\n\t\t\t} else {\n\t\t\t\tthis._height = 100;\n\t\t\t\tscalarSet.height = DScalarFunctions.size(height);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._height = 100;\n\t\t}\n\n\t\t// Visibility\n\t\tconst visible = options?.visible;\n\t\tif (visible != null) {\n\t\t\tthis.visible = visible;\n\t\t}\n\n\t\t// State\n\t\tthis._state = new DBaseStateSetImplObservable((newState, oldState): void => {\n\t\t\tthis.onStateChange(newState, oldState);\n\t\t});\n\n\t\t// Interactive\n\t\tconst interactive = toEnum(\n\t\t\toptions?.interactive ?? theme.getInteractive(),\n\t\t\tDBaseInteractive\n\t\t);\n\t\tthis.interactive = !!(interactive & DBaseInteractive.SELF);\n\t\tthis.interactiveChildren = !!(interactive & DBaseInteractive.CHILDREN);\n\n\t\t// Events\n\t\tconst on = options?.on;\n\t\tif (on) {\n\t\t\tfor (const name in on) {\n\t\t\t\tconst handler = on[name];\n\t\t\t\tif (handler) {\n\t\t\t\t\tthis.on(name, handler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Title\n\t\tthis._title = options?.title ?? theme.getTitle();\n\n\t\t// Weight\n\t\tthis._weight = options?.weight ?? theme.getWeight();\n\n\t\t// Reflowable\n\t\tthis.initReflowable();\n\n\t\t// Shadow\n\t\tthis._onShadowUpdateBound = (): void => {\n\t\t\tDApplications.update(this);\n\t\t};\n\t\tlet shadow = options?.shadow;\n\t\tif (shadow === undefined) {\n\t\t\tshadow = theme.getShadow();\n\t\t}\n\t\tif (shadow) {\n\t\t\tif (isString(shadow)) {\n\t\t\t\tswitch (shadow) {\n\t\t\t\t\tcase \"WEAK\":\n\t\t\t\t\t\tthis.shadow = theme.newShadowWeak();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"DEFAULT\":\n\t\t\t\t\t\tthis.shadow = theme.newShadow();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.shadow = shadow;\n\t\t\t}\n\t\t}\n\n\t\t// Event handlers\n\t\tthis.on(UtilPointerEvent.over, (e: InteractionEvent): void => {\n\t\t\tthis.onOver(e);\n\t\t});\n\n\t\tthis.on(UtilPointerEvent.out, (e: InteractionEvent): void => {\n\t\t\tthis.onOut(e);\n\t\t});\n\n\t\tthis.on(UtilPointerEvent.down, (e: InteractionEvent): void => {\n\t\t\tthis.onDown(e);\n\t\t});\n\n\t\tthis.on(UtilPointerEvent.up, (e: InteractionEvent): void => {\n\t\t\tthis.onUp(e);\n\t\t});\n\n\t\t// Children change detection\n\t\tthis.on(\"added\", (): void => {\n\t\t\tthis.toParentResized();\n\t\t\tif (this.isDirty() || this.hasDirty()) {\n\t\t\t\tthis.toParentHasDirty();\n\t\t\t}\n\t\t\tif (this._isHierarchyDirty) {\n\t\t\t\tthis.toParentHierarchyDirty();\n\t\t\t}\n\t\t\tconst newParent = this.parent;\n\t\t\tif (newParent instanceof DBase) {\n\t\t\t\tthis.state.parent = newParent.state;\n\t\t\t}\n\t\t\tDApplications.update(this);\n\t\t});\n\n\t\tthis.on(\"removed\", (): void => {\n\t\t\tthis.blur(true);\n\t\t\tthis.state.parent = null;\n\t\t\tDApplications.update(this);\n\t\t});\n\n\t\t// Shortcut\n\t\tconst shortcuts = toShortcuts(options);\n\t\tthis._shortcuts = shortcuts;\n\t\tif (shortcuts != null) {\n\t\t\tconst onShortcutBound = (e: KeyboardEvent): void => {\n\t\t\t\tthis.onShortcut(e);\n\t\t\t};\n\t\t\tfor (let i = 0, imax = shortcuts.length; i < imax; ++i) {\n\t\t\t\tUtilKeyboardEvent.on(this, shortcuts[i], onShortcutBound);\n\t\t\t}\n\t\t}\n\n\t\t// Other initialization\n\t\tthis.init(options);\n\n\t\t// State Override\n\t\ttheme.newState(this._state);\n\t\tconst state = options?.state;\n\t\tif (state != null) {\n\t\t\tif (isString(state)) {\n\t\t\t\tthis._state.add(state);\n\t\t\t} else {\n\t\t\t\tthis._state.addAll(state);\n\t\t\t}\n\t\t}\n\n\t\t// Parent\n\t\tconst parent = options?.parent;\n\t\tif (parent != null) {\n\t\t\tparent.addChild(this);\n\t\t}\n\n\t\t// Children\n\t\tconst children = options?.children;\n\t\tif (children != null) {\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tif (child != null) {\n\t\t\t\t\tthis.addChild(child);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Cursor\n\t\tconst cursor = options?.cursor;\n\t\tthis._cursor = cursor;\n\t\tthis.cursor = this.toCursor(cursor, this._state);\n\n\t\t// Done\n\t\tthis.emit(\"init\", this);\n\t}\n\n\tprotected toCursor(\n\t\tcursor: DStateAwareOrValueMightBe<string> | undefined,\n\t\tstate: DBaseStateSet\n\t): string {\n\t\tif (cursor) {\n\t\t\tif (isFunction(cursor)) {\n\t\t\t\tconst result = cursor(state);\n\t\t\t\tif (result !== undefined) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t} else if (cursor !== undefined) {\n\t\t\t\treturn cursor;\n\t\t\t}\n\t\t}\n\t\treturn this.theme.getCursor(state);\n\t}\n\n\tget snippet(): DBaseSnippetContainer {\n\t\treturn this._snippet;\n\t}\n\n\tget reflowable(): DBaseReflowableContainer {\n\t\treturn this._reflowable;\n\t}\n\n\tprotected initReflowable(): void {\n\t\tnew DBaseReflowableImpl(this);\n\t}\n\n\tprotected onChildrenChange(): void {\n\t\tthis.toHierarchyDirty();\n\t\tsuper.onChildrenChange();\n\t}\n\n\tprotected onShortcut(e: KeyboardEvent): void {\n\t\t// DO NOTHING\n\t}\n\n\tprotected init(options?: OPTIONS): void {\n\t\t// OTHER INITIALIZATIONS BEFORE `parent.addChild( this )`\n\t}\n\n\tget weight(): number {\n\t\treturn this._weight;\n\t}\n\n\tprotected onMove(newX: number, newY: number, oldX: number, oldY: number): void {\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tif (child instanceof DBase) {\n\t\t\t\tchild.onParentMove(newX, newY, oldX, oldY);\n\t\t\t}\n\t\t}\n\t\tDApplications.update(this);\n\t\tthis.emit(\"move\", newX, newY, oldX, oldY, this);\n\t}\n\n\tresize(width?: number, height?: number): boolean {\n\t\tconst oldWidth = this._width;\n\t\tconst oldHeight = this._height;\n\t\tconst newWidth = width != null ? width : oldWidth;\n\t\tconst newHeight = height != null ? height : oldHeight;\n\t\tconst isWidthChanged = oldWidth !== newWidth;\n\t\tconst isHeightChanged = oldHeight !== newHeight;\n\t\tif (isWidthChanged) {\n\t\t\tthis._width = newWidth;\n\t\t}\n\t\tif (isHeightChanged) {\n\t\t\tthis._height = newHeight;\n\t\t}\n\t\tconst isChanged = isWidthChanged || isHeightChanged;\n\t\tif (isChanged) {\n\t\t\tthis.onResize(newWidth, newHeight, oldWidth, oldHeight);\n\t\t}\n\t\tif (isWidthChanged) {\n\t\t\tconst scalarSet = this._scalarSet;\n\t\t\tif (scalarSet.x != null) {\n\t\t\t\tconst position = this._position;\n\t\t\t\tconst parent = this.getParentOfSize();\n\t\t\t\tif (parent) {\n\t\t\t\t\tthis._position.x = scalarSet.x(\n\t\t\t\t\t\tparent.width,\n\t\t\t\t\t\tnewWidth,\n\t\t\t\t\t\tparent.padding.getLeft(),\n\t\t\t\t\t\tposition.x\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isHeightChanged) {\n\t\t\tconst scalarSet = this._scalarSet;\n\t\t\tif (scalarSet.y != null) {\n\t\t\t\tconst position = this._position;\n\t\t\t\tconst parent = this.getParentOfSize();\n\t\t\t\tif (parent) {\n\t\t\t\t\tthis._position.y = scalarSet.y(\n\t\t\t\t\t\tparent.height,\n\t\t\t\t\t\tnewHeight,\n\t\t\t\t\t\tparent.padding.getTop(),\n\t\t\t\t\t\tposition.y\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn isChanged;\n\t}\n\n\tgetClearType(): DLayoutClearType {\n\t\treturn this._clearType;\n\t}\n\n\tonResize(newWidth: number, newHeight: number, oldWidth: number, oldHeight: number): void {\n\t\tthis.toDirty();\n\t\tthis.toHierarchyDirty();\n\n\t\tconst padding = this._padding;\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tif (child instanceof DBase) {\n\t\t\t\tchild.onParentResize(newWidth, newHeight, padding);\n\t\t\t}\n\t\t}\n\n\t\tDApplications.update(this);\n\t\tthis.emit(\"resize\", newWidth, newHeight, oldWidth, oldHeight, this);\n\t}\n\n\tprotected onScale(newX: number, newY: number, oldX: number, oldY: number): void {\n\t\tDApplications.update(this);\n\t\tthis.emit(\"scale\", newX, newY, oldX, oldY, this);\n\t}\n\n\tprotected onSkew(newX: number, newY: number, oldX: number, oldY: number): void {\n\t\tDApplications.update(this);\n\t\tthis.emit(\"skew\", newX, newY, oldX, oldY, this);\n\t}\n\n\tget type(): string {\n\t\treturn this.getType();\n\t}\n\n\t// @ts-ignore\n\tget x(): number {\n\t\treturn this._position.x;\n\t}\n\n\tset x(x: DCoordinatePosition) {\n\t\tthis.setX(x);\n\t}\n\n\tgetX(): DCoordinatePosition {\n\t\tconst scalarSet = this._scalarSet;\n\t\tif (scalarSet.x != null) {\n\t\t\treturn scalarSet.x;\n\t\t} else {\n\t\t\treturn this._position.x;\n\t\t}\n\t}\n\n\tsetX(x: DCoordinatePosition): void {\n\t\tconst scalarSet = this._scalarSet;\n\t\tif (isNumber(x)) {\n\t\t\tconst position = this._position;\n\t\t\tif (position.x !== x) {\n\t\t\t\tscalarSet.x = undefined;\n\t\t\t\tposition.x = x;\n\t\t\t} else {\n\t\t\t\tif (scalarSet.x !== undefined) {\n\t\t\t\t\tscalarSet.x = undefined;\n\t\t\t\t\tthis.toParentResized();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst scalar = DScalarFunctions.position(x);\n\t\t\tif (scalarSet.x !== scalar) {\n\t\t\t\tscalarSet.x = scalar;\n\t\t\t\tthis.toParentResized();\n\t\t\t}\n\t\t}\n\t}\n\n\t// @ts-ignore\n\tget y(): number {\n\t\treturn this._position.y;\n\t}\n\n\tset y(y: DCoordinatePosition) {\n\t\tthis.setY(y);\n\t}\n\n\tgetY(): DCoordinatePosition {\n\t\tconst scalarSet = this._scalarSet;\n\t\tif (scalarSet.y != null) {\n\t\t\treturn scalarSet.y;\n\t\t} else {\n\t\t\treturn this._position.y;\n\t\t}\n\t}\n\n\tsetY(y: DCoordinatePosition): void {\n\t\tconst scalarSet = this._scalarSet;\n\t\tif (isNumber(y)) {\n\t\t\tconst position = this._position;\n\t\t\tif (position.y !== y) {\n\t\t\t\tscalarSet.y = undefined;\n\t\t\t\tposition.y = y;\n\t\t\t} else {\n\t\t\t\tif (scalarSet.y !== undefined) {\n\t\t\t\t\tscalarSet.y = undefined;\n\t\t\t\t\tthis.toParentResized();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst scalar = DScalarFunctions.position(y);\n\t\t\tif (scalarSet.y !== scalar) {\n\t\t\t\tscalarSet.y = scalar;\n\t\t\t\tthis.toParentResized();\n\t\t\t}\n\t\t}\n\t}\n\n\t// @ts-ignore\n\tget width(): number {\n\t\treturn this._width;\n\t}\n\n\tset width(width: DCoordinateSize) {\n\t\tthis.setWidth(width);\n\t}\n\n\tgetWidth(): DCoordinateSize {\n\t\treturn this._auto.width.toCoordinate(this._scalarSet.width || this._width);\n\t}\n\n\tsetWidth(width: DCoordinateSize): void {\n\t\tconst auto = this._auto.width;\n\t\tconst isOn = auto.isOn;\n\t\tconst isAuto = auto.from(width);\n\t\tif (auto.isOn !== isOn) {\n\t\t\tthis.toHierarchyDirty();\n\t\t\tDApplications.update(this);\n\t\t}\n\t\tif (!isAuto) {\n\t\t\tconst scalarSet = this._scalarSet;\n\t\t\tif (isNumber(width)) {\n\t\t\t\tconst oldWidth = this._width;\n\t\t\t\tif (oldWidth !== width) {\n\t\t\t\t\tscalarSet.width = undefined;\n\t\t\t\t\tthis._width = width;\n\t\t\t\t\tconst height = this._height;\n\t\t\t\t\tthis.onResize(width, height, oldWidth, height);\n\n\t\t\t\t\tif (scalarSet.x != null) {\n\t\t\t\t\t\tconst position = this._position;\n\t\t\t\t\t\tconst parent = this.getParentOfSize();\n\t\t\t\t\t\tif (parent) {\n\t\t\t\t\t\t\tposition.x = scalarSet.x(\n\t\t\t\t\t\t\t\tparent.width,\n\t\t\t\t\t\t\t\twidth,\n\t\t\t\t\t\t\t\tparent.padding.getLeft(),\n\t\t\t\t\t\t\t\tposition.x\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (scalarSet.width !== undefined) {\n\t\t\t\t\t\tscalarSet.width = undefined;\n\t\t\t\t\t\tthis.toParentResized();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst scalar = DScalarFunctions.size(width);\n\t\t\t\tif (scalarSet.width !== scalar) {\n\t\t\t\t\tscalarSet.width = scalar;\n\t\t\t\t\tthis.toParentResized();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// @ts-ignore\n\tget height(): number {\n\t\treturn this._height;\n\t}\n\n\tset height(height: DCoordinateSize) {\n\t\tthis.setHeight(height);\n\t}\n\n\tgetHeight(): DCoordinateSize {\n\t\treturn this._auto.height.toCoordinate(this._scalarSet.height || this._height);\n\t}\n\n\tsetHeight(height: DCoordinateSize): void {\n\t\tconst auto = this._auto.height;\n\t\tconst isOn = auto.isOn;\n\t\tconst isAuto = auto.from(height);\n\t\tif (auto.isOn !== isOn) {\n\t\t\tthis.toHierarchyDirty();\n\t\t\tDApplications.update(this);\n\t\t}\n\t\tif (!isAuto) {\n\t\t\tconst scalarSet = this._scalarSet;\n\t\t\tif (isNumber(height)) {\n\t\t\t\tconst oldHeight = this._height;\n\t\t\t\tif (oldHeight !== height) {\n\t\t\t\t\tscalarSet.height = undefined;\n\t\t\t\t\tthis._height = height;\n\t\t\t\t\tconst width = this._width;\n\t\t\t\t\tthis.onResize(width, height, width, oldHeight);\n\n\t\t\t\t\tif (scalarSet.y != null) {\n\t\t\t\t\t\tconst position = this._position;\n\t\t\t\t\t\tconst parent = this.getParentOfSize();\n\t\t\t\t\t\tif (parent) {\n\t\t\t\t\t\t\tposition.y = scalarSet.y(\n\t\t\t\t\t\t\t\tparent.height,\n\t\t\t\t\t\t\t\theight,\n\t\t\t\t\t\t\t\tparent.padding.getTop(),\n\t\t\t\t\t\t\t\tposition.y\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (scalarSet.height !== undefined) {\n\t\t\t\t\t\tscalarSet.height = undefined;\n\t\t\t\t\t\tthis.toParentResized();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst scalar = DScalarFunctions.size(height);\n\t\t\t\tif (scalarSet.height !== scalar) {\n\t\t\t\t\tscalarSet.height = scalar;\n\t\t\t\t\tthis.toParentResized();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// @ts-ignore\n\tget position(): DBasePoint {\n\t\treturn this._position;\n\t}\n\n\t// @ts-ignore\n\tget scale(): DBasePoint {\n\t\treturn this._scale;\n\t}\n\n\t// @ts-ignore\n\tget skew(): DBasePoint {\n\t\treturn this._skew;\n\t}\n\n\tget padding(): DPadding {\n\t\treturn this._padding;\n\t}\n\n\tget corner(): DCorner {\n\t\treturn this._corner;\n\t}\n\n\tget background(): DBackgroundStateAware {\n\t\treturn this._background;\n\t}\n\n\tget border(): DBorderStateAware {\n\t\treturn this._border;\n\t}\n\n\tget outline(): DOutline {\n\t\treturn this._outline;\n\t}\n\n\tget unsafe(): Transform {\n\t\treturn this.transform;\n\t}\n\n\tget title(): string {\n\t\treturn this._title;\n\t}\n\n\tset title(title: string) {\n\t\tif (this._title !== title) {\n\t\t\tthis._title = title;\n\t\t\tif (this.state.isHovered) {\n\t\t\t\tthis.applyTitle();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected applyTitle(): void {\n\t\tconst layer = DApplications.getLayer(this);\n\t\tif (layer) {\n\t\t\tlayer.view.title = this._title;\n\t\t}\n\t}\n\n\tshow(): this {\n\t\tif (!this.visible) {\n\t\t\tthis.visible = true;\n\t\t\tthis.toParentHierarchyDirty();\n\t\t\tDApplications.update(this);\n\t\t}\n\t\treturn this;\n\t}\n\n\tisShown(): boolean {\n\t\treturn this.visible;\n\t}\n\n\thide(): this {\n\t\tif (this.visible) {\n\t\t\tthis.visible = false;\n\t\t\tthis.toParentHierarchyDirty();\n\t\t\tthis.blur(true);\n\t\t\tDApplications.update(this);\n\t\t}\n\t\treturn this;\n\t}\n\n\tisHidden(): boolean {\n\t\treturn !this.visible;\n\t}\n\n\ttoDirty(): boolean {\n\t\tif (!this._isDirty) {\n\t\t\tthis._isDirty = true;\n\t\t\tthis.toParentHasDirty();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\ttoHasDirty(): boolean {\n\t\tif (!this._hasDirty) {\n\t\t\tthis._hasDirty = true;\n\t\t\tthis.toParentHasDirty();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\ttoParentHasDirty(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent instanceof DBase) {\n\t\t\tparent.toHasDirty();\n\t\t}\n\t}\n\n\ttoHierarchyDirty(): boolean {\n\t\tif (!this._isHierarchyDirty) {\n\t\t\tthis._isHierarchyDirty = true;\n\t\t\tthis.onHierarchyDirty();\n\t\t\tthis.toParentHierarchyDirty();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\ttoParentHierarchyDirty(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent instanceof DBase) {\n\t\t\tparent.toHierarchyDirty();\n\t\t}\n\t}\n\n\tisHierarchyDirty(): boolean {\n\t\treturn this._isHierarchyDirty;\n\t}\n\n\tprotected onHierarchyDirty(): void {\n\t\t// DO NOTHING\n\t}\n\n\tisDirty(): boolean {\n\t\treturn this._isDirty;\n\t}\n\n\thasDirty(): boolean {\n\t\treturn this._hasDirty;\n\t}\n\n\tprotected setFocused(isFocused: boolean): this {\n\t\tif (this.state.isFocused !== isFocused) {\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer) {\n\t\t\t\tlayer.getFocusController().set(this, isFocused);\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tfocus(): this {\n\t\treturn this.setFocused(true);\n\t}\n\n\tblur(recursively?: boolean): this {\n\t\tif (recursively) {\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer) {\n\t\t\t\tconst focusController = layer.getFocusController();\n\t\t\t\tconst focused = focusController.get();\n\t\t\t\tif (focused instanceof DBase) {\n\t\t\t\t\tlet current: Container = focused;\n\t\t\t\t\twhile (current) {\n\t\t\t\t\t\tif (current === this) {\n\t\t\t\t\t\t\tfocused.setFocused(false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrent = current.parent;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.setFocused(false);\n\t\t}\n\t\treturn this;\n\t}\n\n\tprotected onStateChange(newState: DBaseStateSet, oldState: DBaseStateSet): void {\n\t\tthis.toDirty();\n\t\tDApplications.update(this);\n\t\tthis.emit(\"statechange\", newState, oldState, this);\n\n\t\tconst children = this.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tif (child instanceof DBase) {\n\t\t\t\tchild.state.onParentChange(newState, oldState);\n\t\t\t}\n\t\t}\n\n\t\tif (newState.isFocused) {\n\t\t\tif (!oldState.isFocused) {\n\t\t\t\tthis.onFocus();\n\t\t\t}\n\t\t} else if (oldState.isFocused) {\n\t\t\tthis.onBlur();\n\t\t}\n\n\t\tthis.cursor = this.toCursor(this._cursor, newState);\n\t}\n\n\tprotected onChildFocus(focused: DBase): void {\n\t\tconst parent = this.parent;\n\t\tif (parent instanceof DBase) {\n\t\t\tparent.onChildFocus(focused);\n\t\t}\n\t}\n\n\tprotected onFocus(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent instanceof DBase) {\n\t\t\tparent.onChildFocus(this);\n\t\t}\n\t}\n\n\tprotected onChildBlur(blured: DBase): void {\n\t\tconst parent = this.parent;\n\t\tif (parent instanceof DBase) {\n\t\t\tparent.onChildBlur(blured);\n\t\t}\n\t}\n\n\tprotected onBlur(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent instanceof DBase) {\n\t\t\tparent.onChildBlur(this);\n\t\t}\n\t}\n\n\tget state(): DBaseStateSet {\n\t\treturn this._state;\n\t}\n\n\tget options(): OPTIONS | undefined {\n\t\treturn this._options;\n\t}\n\n\tget theme(): THEME {\n\t\treturn this._theme;\n\t}\n\n\tset theme(theme: THEME) {\n\t\tconst result = this._theme;\n\t\tif (result !== theme) {\n\t\t\tthis._theme = theme;\n\t\t\tthis._padding.setTheme(theme);\n\t\t\tthis._background.setTheme(theme);\n\t\t\tthis._border.setTheme(theme);\n\t\t\tthis._outline.setTheme(theme);\n\t\t\tthis._corner.setTheme(theme);\n\t\t\tthis.toDirty();\n\t\t\tDApplications.update(this);\n\t\t}\n\t}\n\n\treflow(): void {\n\t\tconst isDirty = this._isDirty;\n\t\tif (isDirty) {\n\t\t\tthis.onReflow();\n\t\t\tthis._isDirty = false;\n\t\t}\n\n\t\tconst hasDirty = this._hasDirty;\n\t\tconst isHierarchyDirty = this._isHierarchyDirty;\n\t\tif (hasDirty || isHierarchyDirty) {\n\t\t\tthis._hasDirty = false;\n\t\t\tthis._isHierarchyDirty = false;\n\n\t\t\tconst children = this.children;\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tif (child instanceof DBase) {\n\t\t\t\t\tchild.reflow();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (isDirty || hasDirty || isHierarchyDirty) {\n\t\t\tthis.onRefit();\n\t\t}\n\t}\n\n\tprotected onRefit(): void {\n\t\tconst auto = this._auto;\n\t\tconst isWidthAuto = auto.width.isOn;\n\t\tconst isHeightAuto = auto.height.isOn;\n\t\tif (isWidthAuto && isHeightAuto) {\n\t\t\tlet width = 0;\n\t\t\tlet height = 0;\n\t\t\tconst children = this.children;\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tif (child.visible) {\n\t\t\t\t\tif (this.hasRefitableWidth(child)) {\n\t\t\t\t\t\twidth = Math.max(width, child.x + child.width);\n\t\t\t\t\t}\n\t\t\t\t\tif (this.hasRefitableHeight(child)) {\n\t\t\t\t\t\theight = Math.max(height, child.y + child.height);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst padding = this.padding;\n\t\t\tthis.resize(width + padding.getRight(), height + padding.getBottom());\n\t\t} else if (isWidthAuto) {\n\t\t\tlet width = 0;\n\t\t\tconst children = this.children;\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tif (child.visible && this.hasRefitableWidth(child)) {\n\t\t\t\t\twidth = Math.max(width, child.x + child.width);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.resize(width + this.padding.getRight(), undefined);\n\t\t} else if (isHeightAuto) {\n\t\t\tlet height = 0;\n\t\t\tconst children = this.children;\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tif (child.visible && this.hasRefitableHeight(child)) {\n\t\t\t\t\theight = Math.max(height, child.y + child.height);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.resize(undefined, height + this.padding.getBottom());\n\t\t}\n\t}\n\n\tprotected isRefitable(target: any): target is DRefitable {\n\t\treturn target instanceof DBase;\n\t}\n\n\tprotected hasRefitableHeight(target: any): target is DRefitable {\n\t\treturn (\n\t\t\tthis.isRefitable(target) && !(target instanceof DBase && isFunction(target.getHeight()))\n\t\t);\n\t}\n\n\tprotected hasRefitableWidth(target: any): target is DBase<any, any> {\n\t\treturn (\n\t\t\tthis.isRefitable(target) && !(target instanceof DBase && isFunction(target.getWidth()))\n\t\t);\n\t}\n\n\tprotected onReflow(): void {\n\t\tthis._reflowable.onReflow(this, this._width, this._height);\n\t}\n\n\tget shadow(): DShadow | null {\n\t\treturn this._shadow;\n\t}\n\n\tset shadow(shadow: DShadow | null) {\n\t\tconst previous = this._shadow;\n\t\tif (previous !== shadow) {\n\t\t\tconst reflowable = this._reflowable;\n\t\t\tconst snippet = this._snippet;\n\t\t\tconst onShadowUpdateBound = this._onShadowUpdateBound;\n\t\t\tif (previous != null) {\n\t\t\t\tprevious.off(\"update\", onShadowUpdateBound);\n\t\t\t\treflowable.remove(previous);\n\t\t\t\tsnippet.remove(previous, true);\n\t\t\t}\n\n\t\t\tthis._shadow = shadow;\n\t\t\tif (shadow != null) {\n\t\t\t\tshadow.on(\"update\", onShadowUpdateBound);\n\t\t\t\treflowable.add(shadow);\n\t\t\t\tsnippet.addAt(shadow, true, 0);\n\t\t\t}\n\n\t\t\tDApplications.update(this);\n\t\t}\n\t}\n\n\tprotected toParentResized(): void {\n\t\tconst parent = this.getParentOfSize();\n\t\tif (parent) {\n\t\t\tthis.onParentResize(parent.width, parent.height, parent.padding);\n\t\t}\n\t}\n\n\tprotected getParentOfSize(): { width: number; height: number; padding: DPadding } | null {\n\t\tconst parent = this.parent;\n\t\tif (parent instanceof DBase) {\n\t\t\treturn parent;\n\t\t} else {\n\t\t\treturn DApplications.getLayer(this);\n\t\t}\n\t}\n\n\t/**\n\t * Called when a parent resized.\n\t *\n\t * @param parentWidth a parent's local width\n\t * @param parentHeight a parent's local height\n\t */\n\tonParentResize(parentWidth: number, parentHeight: number, parentPadding: DPadding): void {\n\t\tconst scalarSet = this._scalarSet;\n\t\tconst position = this.transform.position;\n\t\tconst x = position.x;\n\t\tconst y = position.y;\n\t\tconst width = this._width;\n\t\tconst height = this._height;\n\n\t\t// Width & height\n\t\tconst paddingWidth = parentPadding.getLeft() + parentPadding.getRight();\n\t\tconst paddingHeight = parentPadding.getTop() + parentPadding.getBottom();\n\t\tconst newWidth =\n\t\t\tscalarSet.width != null\n\t\t\t\t? scalarSet.width(parentWidth, width, paddingWidth, width)\n\t\t\t\t: width;\n\t\tconst newHeight =\n\t\t\tscalarSet.height != null\n\t\t\t\t? scalarSet.height(parentHeight, height, paddingHeight, height)\n\t\t\t\t: height;\n\t\tthis.resize(newWidth, newHeight);\n\n\t\t// X & Y\n\t\tconst newX =\n\t\t\tscalarSet.x != null\n\t\t\t\t? scalarSet.x(parentWidth, this._width, parentPadding.getLeft(), x)\n\t\t\t\t: x;\n\t\tconst newY =\n\t\t\tscalarSet.y != null\n\t\t\t\t? scalarSet.y(parentHeight, this._height, parentPadding.getTop(), y)\n\t\t\t\t: y;\n\t\tthis.position.set(newX, newY);\n\t}\n\n\t/**\n\t * Called when a parent moved.\n\t *\n\t * @param newX a new parent's local x position\n\t * @param newY a new parent's local y position\n\t * @param oldX an old parent's local x position\n\t * @param oldY an old parent's local y position\n\t */\n\tprotected onParentMove(newX: number, newY: number, oldX: number, oldY: number): void {\n\t\t// DO NOTHING\n\t}\n\n\t// Wheel\n\tonWheel(e: WheelEvent, deltas: UtilWheelEventDeltas, global: Point): boolean {\n\t\tthis.emit(\"wheel\", e, deltas, global, this);\n\t\treturn false;\n\t}\n\n\t// Keydown\n\tonKeyDown(e: KeyboardEvent): boolean {\n\t\tthis.emit(\"keydown\", e, this);\n\t\treturn false;\n\t}\n\n\tonKeyUp(e: KeyboardEvent): boolean {\n\t\tthis.emit(\"keyup\", e, this);\n\t\treturn false;\n\t}\n\n\t// Down\n\tprotected isEventTarget(e: InteractionEvent): boolean {\n\t\tconst target = e.target;\n\t\tif (target === this) {\n\t\t\treturn true;\n\t\t} else if (target != null && !(target instanceof DBase && target.interactive)) {\n\t\t\tlet parent = target.parent;\n\t\t\twhile (parent != null && !(parent instanceof DBase && parent.interactive)) {\n\t\t\t\tparent = parent.parent;\n\t\t\t}\n\t\t\treturn parent === this;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected onDown(e: InteractionEvent): void {\n\t\tif (this.isEventTarget(e)) {\n\t\t\tthis.onDownThis(e);\n\t\t}\n\t\tthis.emit(\"down\", e, this);\n\t}\n\n\tprotected onDownThis(e: InteractionEvent): void {\n\t\tconst oe = e.data.originalEvent;\n\t\tif (\"touches\" in oe) {\n\t\t\tconst lastDownPoint = this._lastDownPoint || new Point();\n\t\t\tthis._lastDownPoint = lastDownPoint;\n\t\t\tlastDownPoint.copyFrom(e.data.global);\n\t\t} else {\n\t\t\tthis.focusOnClosest();\n\t\t}\n\t}\n\n\tprotected onUp(e: InteractionEvent): void {\n\t\tif (this.isEventTarget(e)) {\n\t\t\tthis.onUpThis(e);\n\t\t}\n\t\tthis.emit(\"up\", e, this);\n\t}\n\n\tprotected onUpThis(e: InteractionEvent): void {\n\t\tconst oe = e.data.originalEvent;\n\t\tif (\"touches\" in oe) {\n\t\t\tconst lastDownPoint = this._lastDownPoint;\n\t\t\tif (lastDownPoint) {\n\t\t\t\tconst global = e.data.global;\n\t\t\t\tconst dx = Math.abs(global.x - lastDownPoint.x);\n\t\t\t\tconst dy = Math.abs(global.y - lastDownPoint.y);\n\t\t\t\tconst threshold = UtilPointerEvent.CLICK_DISTANCE_THRESHOLD;\n\t\t\t\tif (dx < threshold && dy < threshold) {\n\t\t\t\t\tthis.focusOnClosest();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected focusOnClosest(): void {\n\t\tconst layer = DApplications.getLayer(this);\n\t\tif (layer) {\n\t\t\tconst focusController = layer.getFocusController();\n\t\t\tfocusController.focus(focusController.findParent(this));\n\t\t}\n\t}\n\n\t// Over\n\tprotected onOver(e: InteractionEvent): void {\n\t\t// Update the hover state\n\t\tthis.state.isHovered = true;\n\n\t\t// Update the title\n\t\tif (e.target === this) {\n\t\t\tthis.applyTitle();\n\t\t}\n\n\t\t// Event\n\t\tthis.emit(\"over\", e, this);\n\t}\n\n\t// Out\n\tprotected onOut(e: InteractionEvent): void {\n\t\t// Update the hover state\n\t\tthis.state.isHovered = false;\n\n\t\t// Event\n\t\tthis.emit(\"out\", e, this);\n\t}\n\n\t// Double click\n\tonDblClick(e: MouseEvent | TouchEvent, interactionManager: InteractionManager): boolean {\n\t\tthis.emit(\"dblclick\", e, interactionManager, this);\n\t\treturn false;\n\t}\n\n\t//\n\trender(renderer: Renderer): void {\n\t\tif (this.visible && 0 < this.worldAlpha && this.renderable) {\n\t\t\tconst snippet = this._snippet;\n\t\t\tsnippet.render(renderer, true);\n\t\t\tsuper.render(renderer);\n\t\t\tsnippet.render(renderer, false);\n\t\t}\n\t}\n\n\t//\n\tprotected getThemeDefault(): THEME {\n\t\treturn DThemes.getInstance().get(this.getType());\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DBase\";\n\t}\n\n\t//\n\tprotected _calculateBounds(): void {\n\t\tconst worldTransform = this.transform.worldTransform;\n\t\tconst bounds = this._bounds;\n\n\t\tconst work = DBase.WORK_CONTAINS_POINT;\n\t\twork.set(0, 0);\n\t\tworldTransform.apply(work, work);\n\t\tbounds.addPoint(work);\n\n\t\twork.set(this._width, this._height);\n\t\tworldTransform.apply(work, work);\n\t\tbounds.addPoint(work);\n\n\t\tsuper._calculateBounds();\n\t}\n\n\tcontainsPoint(point: Point): boolean {\n\t\treturn (\n\t\t\tthis.containsGlobalPoint(point) ||\n\t\t\tthis.containsLocalPoint(\n\t\t\t\tthis.worldTransform.applyInverse(point, DBase.WORK_CONTAINS_POINT)\n\t\t\t)\n\t\t);\n\t}\n\n\tprotected containsGlobalPoint(point: Point): boolean {\n\t\treturn false;\n\t}\n\n\tprotected containsLocalPoint(point: Point): boolean {\n\t\tconst x = point.x;\n\t\tconst y = point.y;\n\t\tconst w = this._width;\n\t\tconst h = this._height;\n\t\treturn 0 <= x && x <= w && 0 <= y && y <= h;\n\t}\n\n\t/**\n\t * Returns a clipping rect.\n\t *\n\t * @param result a clipping rect\n\t */\n\tgetClippingRect(target: unknown, result: Rectangle): void {\n\t\tresult.x = 0;\n\t\tresult.y = 0;\n\t\tresult.width = this._width;\n\t\tresult.height = this._height;\n\t}\n\n\tdestroy(): void {\n\t\t// Layout\n\t\tconst scalarSet = this._scalarSet;\n\t\tscalarSet.x = null;\n\t\tscalarSet.y = null;\n\t\tscalarSet.width = null;\n\t\tscalarSet.height = null;\n\n\t\t// Shadow\n\t\tconst shadow = this._shadow;\n\t\tif (shadow) {\n\t\t\tthis._shadow = null;\n\t\t\tshadow.destroy();\n\t\t}\n\n\t\t// Children\n\t\tconst children = this.children;\n\t\tfor (let i = children.length - 1; 0 <= i; --i) {\n\t\t\tchildren[i].destroy();\n\t\t}\n\t\tchildren.length = 0;\n\n\t\t//\n\t\tsuper.destroy();\n\t}\n}\n"]}