@wcardinal/wcardinal-ui 0.147.0 → 0.148.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.
@@ -137,10 +137,12 @@ var EShapeRuntime = /** @class */ (function () {
137
137
  EShapeRuntime.prototype.onKeyUp = function (shape, e) {
138
138
  if (UtilKeyboardEvent.isActivateKey(e)) {
139
139
  var state = shape.state;
140
- var wasUp = state.isUp;
141
- this.onUp(shape, e);
142
- if (!wasUp && state.isUp) {
143
- this.onClick(shape, e);
140
+ if (state.isPressed) {
141
+ var wasUp = state.isUp;
142
+ this.onUp(shape, e);
143
+ if (!wasUp && state.isUp) {
144
+ this.onClick(shape, e);
145
+ }
144
146
  }
145
147
  }
146
148
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"e-shape-runtime.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,KAAK,EAAY,MAAM,SAAS,CAAC;AAGvD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAIhE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,IAAM,UAAU,GAAG,CAAC,CAAC;AACrB,IAAM,UAAU,GAAG,CAAC,CAAC;AACrB,IAAM,QAAQ,GAAG,CAAC,CAAC;AACnB,IAAM,UAAU,GAAG,CAAC,CAAC;AACrB,IAAM,YAAY,GAAG,EAAE,CAAC;AACxB,IAAM,UAAU,GAAG,EAAE,CAAC;AACtB,IAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,IAAM,UAAU,GAAG,GAAG,CAAC;AACvB,IAAM,MAAM,GAAG,GAAG,CAAC;AACnB,IAAM,KAAK,GAAG,GAAG,CAAC;AAClB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D,IAmQC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { interaction, Point, Renderer } from \"pixi.js\";\nimport InteractionEvent = interaction.InteractionEvent;\nimport InteractionManager = interaction.InteractionManager;\nimport { DApplications } from \"../d-applications\";\nimport { UtilKeyboardEvent } from \"../util/util-keyboard-event\";\nimport { EShapeActionRuntime } from \"./action/e-shape-action-runtime\";\nimport { EShape } from \"./e-shape\";\nimport { EShapeFillLike } from \"./e-shape-fill\";\nimport { EShapeState } from \"./e-shape-state\";\nimport { EShapeStrokeLike } from \"./e-shape-stroke\";\nimport { EShapeTextLike } from \"./e-shape-text\";\nimport { DBaseState } from \"../d-base-state\";\nimport { DBaseStateSet } from \"../d-base-state-set\";\n\nconst POSITION_X = 1;\nconst POSITION_Y = 2;\nconst ROTATION = 4;\nconst COLOR_FILL = 8;\nconst COLOR_STROKE = 16;\nconst COLOR_TEXT = 32;\nconst COLOR_TEXT_OUTLINE = 64;\nconst VISIBILITY = 128;\nconst HEIGHT = 256;\nconst WIDTH = 512;\nconst TEXT = 1024;\nconst CURSOR = 2048;\n\nexport const EShapeRuntimeReset = {\n\tNONE: 0,\n\tPOSITION_X,\n\tPOSITION_Y,\n\tPOSITION: POSITION_X | POSITION_Y,\n\tROTATION,\n\tCOLOR_FILL,\n\tCOLOR_STROKE,\n\tCOLOR_FILL_AND_STROKE: COLOR_FILL | COLOR_STROKE,\n\tCOLOR_TEXT,\n\tCOLOR_TEXT_OUTLINE,\n\tCOLOR: COLOR_FILL | COLOR_STROKE | COLOR_TEXT | COLOR_TEXT_OUTLINE,\n\tVISIBILITY,\n\tHEIGHT,\n\tWIDTH,\n\tSIZE: HEIGHT | WIDTH,\n\tTEXT,\n\tCURSOR\n} as const;\n\nexport type EShapeRuntimeReset = typeof EShapeRuntimeReset[keyof typeof EShapeRuntimeReset];\n\nexport class EShapeRuntime {\n\tx: number;\n\ty: number;\n\tsize: Point;\n\trotation: number;\n\tactions: EShapeActionRuntime[];\n\tfill: EShapeFillLike;\n\tstroke: EShapeStrokeLike;\n\ttext: EShapeTextLike;\n\tcursor: string;\n\n\treset: EShapeRuntimeReset;\n\twritten: EShapeRuntimeReset;\n\n\teffect: number;\n\n\tisStateChanged: boolean;\n\tinteractive: boolean;\n\n\tconstructor(shape: EShape) {\n\t\tconst transform = shape.transform;\n\t\tconst position = transform.position;\n\t\tthis.x = position.x;\n\t\tthis.y = position.y;\n\t\tconst size = shape.size;\n\t\tthis.size = new Point(size.x, size.y);\n\t\tthis.rotation = transform.rotation;\n\t\tthis.actions = [];\n\t\tthis.fill = shape.fill.toObject();\n\t\tthis.stroke = shape.stroke.toObject();\n\t\tthis.text = shape.text.toObject();\n\t\tthis.cursor = shape.cursor;\n\t\tthis.reset = EShapeRuntimeReset.NONE;\n\t\tthis.written = EShapeRuntimeReset.NONE;\n\t\tthis.effect = NaN;\n\t\tthis.isStateChanged = false;\n\t\tthis.interactive = false;\n\t}\n\n\tinitialize(shape: EShape): void {\n\t\tshape.disallowUploadedUpdate();\n\t\tthis.onInitialize(shape);\n\t\tshape.allowUploadedUpdate();\n\t}\n\n\tonInitialize(shape: EShape): void {\n\t\tconst actions = this.actions;\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].initialize(shape, this);\n\t\t}\n\t}\n\n\tisActionable(): boolean {\n\t\treturn 0 < this.actions.length;\n\t}\n\n\tonClick(shape: EShape, e: InteractionEvent | KeyboardEvent): void {\n\t\tconst state = shape.state;\n\t\tif (state.isActionable) {\n\t\t\tstate.isClicked = true;\n\t\t}\n\t}\n\n\tonDblClick(\n\t\tshape: EShape,\n\t\te: MouseEvent | TouchEvent,\n\t\tinteractionManager: InteractionManager\n\t): boolean {\n\t\tconst actions = this.actions;\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].onDblClick(shape, this, e, interactionManager);\n\t\t}\n\t\treturn false;\n\t}\n\n\tonOver(shape: EShape, e: InteractionEvent): void {\n\t\tshape.state.isHovered = true;\n\t}\n\n\tonOut(shape: EShape, e: InteractionEvent): void {\n\t\tshape.state.isHovered = false;\n\t}\n\n\tonDown(shape: EShape, e: InteractionEvent | KeyboardEvent): void {\n\t\t// Actions\n\t\tconst actions = this.actions;\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].onDowning(shape, this, e);\n\t\t}\n\n\t\tif (!shape.state.isDown) {\n\t\t\t// Down / Press\n\t\t\tshape.state.addAll(EShapeState.DOWN, DBaseState.PRESSED);\n\n\t\t\t// Focus and states\n\t\t\tconst layer = DApplications.getLayer(shape);\n\t\t\tif (layer) {\n\t\t\t\t// Focus\n\t\t\t\tconst focusController = layer.getFocusController();\n\t\t\t\tfocusController.focus(focusController.findParent(shape));\n\t\t\t}\n\t\t}\n\n\t\t// Actions\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].onDown(shape, this, e);\n\t\t}\n\t}\n\n\tonUp(shape: EShape, e: InteractionEvent | KeyboardEvent): void {\n\t\tconst state = shape.state;\n\t\tif (!state.isUp) {\n\t\t\tstate.set(EShapeState.UP, DBaseState.PRESSED);\n\t\t}\n\t}\n\n\tonUpOutside(shape: EShape, e: InteractionEvent): void {\n\t\tshape.state.isPressed = false;\n\t}\n\n\tonMove(shape: EShape, e: InteractionEvent): void {\n\t\tconst actions = this.actions;\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].onMove(shape, this, e);\n\t\t}\n\t}\n\n\tonKeyDown(shape: EShape, e: KeyboardEvent): boolean {\n\t\tif (UtilKeyboardEvent.isActivateKey(e)) {\n\t\t\tthis.onDown(shape, e);\n\t\t}\n\t\treturn false;\n\t}\n\n\tonKeyUp(shape: EShape, e: KeyboardEvent): boolean {\n\t\tif (UtilKeyboardEvent.isActivateKey(e)) {\n\t\t\tconst state = shape.state;\n\t\t\tconst wasUp = state.isUp;\n\t\t\tthis.onUp(shape, e);\n\t\t\tif (!wasUp && state.isUp) {\n\t\t\t\tthis.onClick(shape, e);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tonStateChange(shape: EShape, newState: DBaseStateSet, oldState: DBaseStateSet): void {\n\t\tthis.isStateChanged = true;\n\t\tDApplications.update(shape);\n\n\t\tif (newState.isFocused) {\n\t\t\tif (!oldState.isFocused) {\n\t\t\t\tthis.onFocus(shape);\n\t\t\t}\n\t\t} else if (oldState.isFocused) {\n\t\t\tthis.onBlur(shape);\n\t\t}\n\t}\n\n\tonFocus(shape: EShape): void {\n\t\tconst actions = this.actions;\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].onFocus(shape, this);\n\t\t}\n\t}\n\n\tonBlur(shape: EShape): void {\n\t\tconst actions = this.actions;\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].onBlur(shape, this);\n\t\t}\n\t}\n\n\tupdate(shape: EShape, time: number): void {\n\t\tconst data = shape.data;\n\t\tconst isEffectTimeUp = this.effect <= time;\n\t\tif (data.isChanged || this.isStateChanged || isEffectTimeUp) {\n\t\t\tif (isEffectTimeUp) {\n\t\t\t\tthis.effect = NaN;\n\t\t\t}\n\t\t\tshape.disallowUploadedUpdate();\n\t\t\tthis.onUpdate(shape, time);\n\t\t\tshape.allowUploadedUpdate();\n\t\t\tshape.state.removeAll(\n\t\t\t\tEShapeState.CLICKED,\n\t\t\t\tEShapeState.DOWN,\n\t\t\t\tEShapeState.UP,\n\t\t\t\tEShapeState.ACTIVATED,\n\t\t\t\tEShapeState.DEACTIVATED\n\t\t\t);\n\t\t\tthis.isStateChanged = false;\n\t\t\tdata.isChanged = false;\n\t\t}\n\t}\n\n\tonRender(shape: EShape, time: number, renderer: Renderer): void {\n\t\tconst actions = this.actions;\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].onRender(shape, this, time, renderer);\n\t\t}\n\t\tthis.update(shape, time);\n\t}\n\n\tprotected onUpdate(shape: EShape, time: number): void {\n\t\tconst actions = this.actions;\n\t\tif (0 < actions.length) {\n\t\t\tthis.written = EShapeRuntimeReset.NONE;\n\t\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\t\tactions[i].execute(shape, this, time);\n\t\t\t}\n\t\t\tthis.doReset(shape);\n\t\t}\n\t}\n\n\tprotected doReset(shape: EShape): void {\n\t\tconst target = ~this.written & this.reset;\n\t\tif (target !== EShapeRuntimeReset.NONE) {\n\t\t\tif (target & EShapeRuntimeReset.POSITION_X) {\n\t\t\t\tshape.transform.position.x = this.x;\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.POSITION_Y) {\n\t\t\t\tshape.transform.position.y = this.y;\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.VISIBILITY) {\n\t\t\t\tshape.visible = true;\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.COLOR_FILL) {\n\t\t\t\tconst fill = this.fill;\n\t\t\t\tshape.fill.set(undefined, fill.color, fill.alpha);\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.COLOR_STROKE) {\n\t\t\t\tconst stroke = this.stroke;\n\t\t\t\tshape.stroke.set(undefined, stroke.color, stroke.alpha);\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.COLOR_TEXT) {\n\t\t\t\tconst text = this.text;\n\t\t\t\tshape.text.set(undefined, text.color, text.alpha);\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.COLOR_TEXT_OUTLINE) {\n\t\t\t\tconst outline = this.text.outline;\n\t\t\t\tshape.text.outline.set(undefined, outline.color, outline.alpha);\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.HEIGHT) {\n\t\t\t\tshape.size.y = this.size.y;\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.WIDTH) {\n\t\t\t\tshape.size.x = this.size.x;\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.ROTATION) {\n\t\t\t\tshape.transform.rotation = this.rotation;\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.TEXT) {\n\t\t\t\tshape.text.value = this.text.value;\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.CURSOR) {\n\t\t\t\tshape.cursor = this.cursor;\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"e-shape-runtime.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,KAAK,EAAY,MAAM,SAAS,CAAC;AAGvD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAIhE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,IAAM,UAAU,GAAG,CAAC,CAAC;AACrB,IAAM,UAAU,GAAG,CAAC,CAAC;AACrB,IAAM,QAAQ,GAAG,CAAC,CAAC;AACnB,IAAM,UAAU,GAAG,CAAC,CAAC;AACrB,IAAM,YAAY,GAAG,EAAE,CAAC;AACxB,IAAM,UAAU,GAAG,EAAE,CAAC;AACtB,IAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,IAAM,UAAU,GAAG,GAAG,CAAC;AACvB,IAAM,MAAM,GAAG,GAAG,CAAC;AACnB,IAAM,KAAK,GAAG,GAAG,CAAC;AAClB,IAAM,IAAI,GAAG,IAAI,CAAC;AAClB,IAAM,MAAM,GAAG,IAAI,CAAC;AAEpB,MAAM,CAAC,IAAM,kBAAkB,GAAG;IACjC,IAAI,EAAE,CAAC;IACP,UAAU,YAAA;IACV,UAAU,YAAA;IACV,QAAQ,EAAE,UAAU,GAAG,UAAU;IACjC,QAAQ,UAAA;IACR,UAAU,YAAA;IACV,YAAY,cAAA;IACZ,qBAAqB,EAA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AC,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;aAClD;YACD,IAAI,MAAM,GAAG,kBAAkB,CAAC,kBAAkB,EAAE;gBACnD,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;gBAClC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;aAChE;YACD,IAAI,MAAM,GAAG,kBAAkB,CAAC,MAAM,EAAE;gBACvC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;aAC3B;YACD,IAAI,MAAM,GAAG,kBAAkB,CAAC,KAAK,EAAE;gBACtC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;aAC3B;YACD,IAAI,MAAM,GAAG,kBAAkB,CAAC,QAAQ,EAAE;gBACzC,KAAK,CAAC,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;aACzC;YACD,IAAI,MAAM,GAAG,kBAAkB,CAAC,IAAI,EAAE;gBACrC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;aACnC;YACD,IAAI,MAAM,GAAG,kBAAkB,CAAC,MAAM,EAAE;gBACvC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;aAC3B;SACD;IACF,CAAC;IACF,oBAAC;AAAD,CAAC,AArQD,IAqQC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { interaction, Point, Renderer } from \"pixi.js\";\nimport InteractionEvent = interaction.InteractionEvent;\nimport InteractionManager = interaction.InteractionManager;\nimport { DApplications } from \"../d-applications\";\nimport { UtilKeyboardEvent } from \"../util/util-keyboard-event\";\nimport { EShapeActionRuntime } from \"./action/e-shape-action-runtime\";\nimport { EShape } from \"./e-shape\";\nimport { EShapeFillLike } from \"./e-shape-fill\";\nimport { EShapeState } from \"./e-shape-state\";\nimport { EShapeStrokeLike } from \"./e-shape-stroke\";\nimport { EShapeTextLike } from \"./e-shape-text\";\nimport { DBaseState } from \"../d-base-state\";\nimport { DBaseStateSet } from \"../d-base-state-set\";\n\nconst POSITION_X = 1;\nconst POSITION_Y = 2;\nconst ROTATION = 4;\nconst COLOR_FILL = 8;\nconst COLOR_STROKE = 16;\nconst COLOR_TEXT = 32;\nconst COLOR_TEXT_OUTLINE = 64;\nconst VISIBILITY = 128;\nconst HEIGHT = 256;\nconst WIDTH = 512;\nconst TEXT = 1024;\nconst CURSOR = 2048;\n\nexport const EShapeRuntimeReset = {\n\tNONE: 0,\n\tPOSITION_X,\n\tPOSITION_Y,\n\tPOSITION: POSITION_X | POSITION_Y,\n\tROTATION,\n\tCOLOR_FILL,\n\tCOLOR_STROKE,\n\tCOLOR_FILL_AND_STROKE: COLOR_FILL | COLOR_STROKE,\n\tCOLOR_TEXT,\n\tCOLOR_TEXT_OUTLINE,\n\tCOLOR: COLOR_FILL | COLOR_STROKE | COLOR_TEXT | COLOR_TEXT_OUTLINE,\n\tVISIBILITY,\n\tHEIGHT,\n\tWIDTH,\n\tSIZE: HEIGHT | WIDTH,\n\tTEXT,\n\tCURSOR\n} as const;\n\nexport type EShapeRuntimeReset = typeof EShapeRuntimeReset[keyof typeof EShapeRuntimeReset];\n\nexport class EShapeRuntime {\n\tx: number;\n\ty: number;\n\tsize: Point;\n\trotation: number;\n\tactions: EShapeActionRuntime[];\n\tfill: EShapeFillLike;\n\tstroke: EShapeStrokeLike;\n\ttext: EShapeTextLike;\n\tcursor: string;\n\n\treset: EShapeRuntimeReset;\n\twritten: EShapeRuntimeReset;\n\n\teffect: number;\n\n\tisStateChanged: boolean;\n\tinteractive: boolean;\n\n\tconstructor(shape: EShape) {\n\t\tconst transform = shape.transform;\n\t\tconst position = transform.position;\n\t\tthis.x = position.x;\n\t\tthis.y = position.y;\n\t\tconst size = shape.size;\n\t\tthis.size = new Point(size.x, size.y);\n\t\tthis.rotation = transform.rotation;\n\t\tthis.actions = [];\n\t\tthis.fill = shape.fill.toObject();\n\t\tthis.stroke = shape.stroke.toObject();\n\t\tthis.text = shape.text.toObject();\n\t\tthis.cursor = shape.cursor;\n\t\tthis.reset = EShapeRuntimeReset.NONE;\n\t\tthis.written = EShapeRuntimeReset.NONE;\n\t\tthis.effect = NaN;\n\t\tthis.isStateChanged = false;\n\t\tthis.interactive = false;\n\t}\n\n\tinitialize(shape: EShape): void {\n\t\tshape.disallowUploadedUpdate();\n\t\tthis.onInitialize(shape);\n\t\tshape.allowUploadedUpdate();\n\t}\n\n\tonInitialize(shape: EShape): void {\n\t\tconst actions = this.actions;\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].initialize(shape, this);\n\t\t}\n\t}\n\n\tisActionable(): boolean {\n\t\treturn 0 < this.actions.length;\n\t}\n\n\tonClick(shape: EShape, e: InteractionEvent | KeyboardEvent): void {\n\t\tconst state = shape.state;\n\t\tif (state.isActionable) {\n\t\t\tstate.isClicked = true;\n\t\t}\n\t}\n\n\tonDblClick(\n\t\tshape: EShape,\n\t\te: MouseEvent | TouchEvent,\n\t\tinteractionManager: InteractionManager\n\t): boolean {\n\t\tconst actions = this.actions;\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].onDblClick(shape, this, e, interactionManager);\n\t\t}\n\t\treturn false;\n\t}\n\n\tonOver(shape: EShape, e: InteractionEvent): void {\n\t\tshape.state.isHovered = true;\n\t}\n\n\tonOut(shape: EShape, e: InteractionEvent): void {\n\t\tshape.state.isHovered = false;\n\t}\n\n\tonDown(shape: EShape, e: InteractionEvent | KeyboardEvent): void {\n\t\t// Actions\n\t\tconst actions = this.actions;\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].onDowning(shape, this, e);\n\t\t}\n\n\t\tif (!shape.state.isDown) {\n\t\t\t// Down / Press\n\t\t\tshape.state.addAll(EShapeState.DOWN, DBaseState.PRESSED);\n\n\t\t\t// Focus and states\n\t\t\tconst layer = DApplications.getLayer(shape);\n\t\t\tif (layer) {\n\t\t\t\t// Focus\n\t\t\t\tconst focusController = layer.getFocusController();\n\t\t\t\tfocusController.focus(focusController.findParent(shape));\n\t\t\t}\n\t\t}\n\n\t\t// Actions\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].onDown(shape, this, e);\n\t\t}\n\t}\n\n\tonUp(shape: EShape, e: InteractionEvent | KeyboardEvent): void {\n\t\tconst state = shape.state;\n\t\tif (!state.isUp) {\n\t\t\tstate.set(EShapeState.UP, DBaseState.PRESSED);\n\t\t}\n\t}\n\n\tonUpOutside(shape: EShape, e: InteractionEvent): void {\n\t\tshape.state.isPressed = false;\n\t}\n\n\tonMove(shape: EShape, e: InteractionEvent): void {\n\t\tconst actions = this.actions;\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].onMove(shape, this, e);\n\t\t}\n\t}\n\n\tonKeyDown(shape: EShape, e: KeyboardEvent): boolean {\n\t\tif (UtilKeyboardEvent.isActivateKey(e)) {\n\t\t\tthis.onDown(shape, e);\n\t\t}\n\t\treturn false;\n\t}\n\n\tonKeyUp(shape: EShape, e: KeyboardEvent): boolean {\n\t\tif (UtilKeyboardEvent.isActivateKey(e)) {\n\t\t\tconst state = shape.state;\n\t\t\tif (state.isPressed) {\n\t\t\t\tconst wasUp = state.isUp;\n\t\t\t\tthis.onUp(shape, e);\n\t\t\t\tif (!wasUp && state.isUp) {\n\t\t\t\t\tthis.onClick(shape, e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tonStateChange(shape: EShape, newState: DBaseStateSet, oldState: DBaseStateSet): void {\n\t\tthis.isStateChanged = true;\n\t\tDApplications.update(shape);\n\n\t\tif (newState.isFocused) {\n\t\t\tif (!oldState.isFocused) {\n\t\t\t\tthis.onFocus(shape);\n\t\t\t}\n\t\t} else if (oldState.isFocused) {\n\t\t\tthis.onBlur(shape);\n\t\t}\n\t}\n\n\tonFocus(shape: EShape): void {\n\t\tconst actions = this.actions;\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].onFocus(shape, this);\n\t\t}\n\t}\n\n\tonBlur(shape: EShape): void {\n\t\tconst actions = this.actions;\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].onBlur(shape, this);\n\t\t}\n\t}\n\n\tupdate(shape: EShape, time: number): void {\n\t\tconst data = shape.data;\n\t\tconst isEffectTimeUp = this.effect <= time;\n\t\tif (data.isChanged || this.isStateChanged || isEffectTimeUp) {\n\t\t\tif (isEffectTimeUp) {\n\t\t\t\tthis.effect = NaN;\n\t\t\t}\n\t\t\tshape.disallowUploadedUpdate();\n\t\t\tthis.onUpdate(shape, time);\n\t\t\tshape.allowUploadedUpdate();\n\t\t\tshape.state.removeAll(\n\t\t\t\tEShapeState.CLICKED,\n\t\t\t\tEShapeState.DOWN,\n\t\t\t\tEShapeState.UP,\n\t\t\t\tEShapeState.ACTIVATED,\n\t\t\t\tEShapeState.DEACTIVATED\n\t\t\t);\n\t\t\tthis.isStateChanged = false;\n\t\t\tdata.isChanged = false;\n\t\t}\n\t}\n\n\tonRender(shape: EShape, time: number, renderer: Renderer): void {\n\t\tconst actions = this.actions;\n\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\tactions[i].onRender(shape, this, time, renderer);\n\t\t}\n\t\tthis.update(shape, time);\n\t}\n\n\tprotected onUpdate(shape: EShape, time: number): void {\n\t\tconst actions = this.actions;\n\t\tif (0 < actions.length) {\n\t\t\tthis.written = EShapeRuntimeReset.NONE;\n\t\t\tfor (let i = 0, imax = actions.length; i < imax; ++i) {\n\t\t\t\tactions[i].execute(shape, this, time);\n\t\t\t}\n\t\t\tthis.doReset(shape);\n\t\t}\n\t}\n\n\tprotected doReset(shape: EShape): void {\n\t\tconst target = ~this.written & this.reset;\n\t\tif (target !== EShapeRuntimeReset.NONE) {\n\t\t\tif (target & EShapeRuntimeReset.POSITION_X) {\n\t\t\t\tshape.transform.position.x = this.x;\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.POSITION_Y) {\n\t\t\t\tshape.transform.position.y = this.y;\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.VISIBILITY) {\n\t\t\t\tshape.visible = true;\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.COLOR_FILL) {\n\t\t\t\tconst fill = this.fill;\n\t\t\t\tshape.fill.set(undefined, fill.color, fill.alpha);\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.COLOR_STROKE) {\n\t\t\t\tconst stroke = this.stroke;\n\t\t\t\tshape.stroke.set(undefined, stroke.color, stroke.alpha);\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.COLOR_TEXT) {\n\t\t\t\tconst text = this.text;\n\t\t\t\tshape.text.set(undefined, text.color, text.alpha);\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.COLOR_TEXT_OUTLINE) {\n\t\t\t\tconst outline = this.text.outline;\n\t\t\t\tshape.text.outline.set(undefined, outline.color, outline.alpha);\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.HEIGHT) {\n\t\t\t\tshape.size.y = this.size.y;\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.WIDTH) {\n\t\t\t\tshape.size.x = this.size.x;\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.ROTATION) {\n\t\t\t\tshape.transform.rotation = this.rotation;\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.TEXT) {\n\t\t\t\tshape.text.value = this.text.value;\n\t\t\t}\n\t\t\tif (target & EShapeRuntimeReset.CURSOR) {\n\t\t\t\tshape.cursor = this.cursor;\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.147.0
2
+ Winter Cardinal UI v0.148.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.147.0
2
+ Winter Cardinal UI v0.148.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.147.0
2
+ Winter Cardinal UI v0.148.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.147.0
2
+ Winter Cardinal UI v0.148.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.147.0
2
+ Winter Cardinal UI v0.148.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -7514,10 +7514,12 @@ var EShapeRuntime = /** @class */ (function () {
7514
7514
  EShapeRuntime.prototype.onKeyUp = function (shape, e) {
7515
7515
  if (UtilKeyboardEvent.isActivateKey(e)) {
7516
7516
  var state = shape.state;
7517
- var wasUp = state.isUp;
7518
- this.onUp(shape, e);
7519
- if (!wasUp && state.isUp) {
7520
- this.onClick(shape, e);
7517
+ if (state.isPressed) {
7518
+ var wasUp = state.isUp;
7519
+ this.onUp(shape, e);
7520
+ if (!wasUp && state.isUp) {
7521
+ this.onClick(shape, e);
7522
+ }
7521
7523
  }
7522
7524
  }
7523
7525
  return false;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.147.0
2
+ Winter Cardinal UI v0.148.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -7511,10 +7511,12 @@
7511
7511
  EShapeRuntime.prototype.onKeyUp = function (shape, e) {
7512
7512
  if (UtilKeyboardEvent.isActivateKey(e)) {
7513
7513
  var state = shape.state;
7514
- var wasUp = state.isUp;
7515
- this.onUp(shape, e);
7516
- if (!wasUp && state.isUp) {
7517
- this.onClick(shape, e);
7514
+ if (state.isPressed) {
7515
+ var wasUp = state.isUp;
7516
+ this.onUp(shape, e);
7517
+ if (!wasUp && state.isUp) {
7518
+ this.onClick(shape, e);
7519
+ }
7518
7520
  }
7519
7521
  }
7520
7522
  return false;