@wcardinal/wcardinal-ui 0.320.0 → 0.321.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.
@@ -50,7 +50,7 @@ var DButtonGroup = /** @class */ (function (_super) {
50
50
  set: function (newActive) {
51
51
  if ((newActive == null || newActive.isToggle) && this._active !== newActive) {
52
52
  var oldActive = this._active;
53
- this._active = null;
53
+ this._active = newActive;
54
54
  var buttons = this._buttons;
55
55
  for (var i = 0, imax = buttons.length; i < imax; ++i) {
56
56
  var button = buttons[i];
@@ -1 +1 @@
1
- {"version":3,"file":"d-button-group.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-button-group.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AA8BhC;IAGU,gCAAkB;IAM3B,sBAAY,OAAiB;QAA7B,YACC,iBAAO,SAqBP;QAnBA,KAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,KAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,KAAI,CAAC,cAAc,GAAG,UAAC,MAAc;YACpC,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACtB,CAAC,CAAC;QAEF,SAAS;QACT,IAAM,EAAE,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,EAAE,CAAC;QACvB,IAAI,EAAE,IAAI,IAAI,EAAE;YACf,KAAK,IAAM,MAAI,IAAI,EAAE,EAAE;gBACtB,IAAM,OAAO,GAAG,EAAE,CAAC,MAAI,CAAC,CAAC;gBACzB,IAAI,OAAO,EAAE;oBACZ,KAAI,CAAC,EAAE,CAAC,MAAI,EAAE,OAAO,CAAC,CAAC;iBACvB;aACD;SACD;QAED,OAAO;QACP,KAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAI,CAAC,CAAC;;IACzB,CAAC;IAED,0BAAG,GAAH,UAAI,MAAc;QACjB,IAAM,OAAO,G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BAAI,GAAJ,UAAK,QAA4C;QAChD,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACrD,IAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,QAAQ,CAAC,MAAM,CAAC,KAAK,KAAK,EAAE;gBAC/B,MAAM;aACN;SACD;IACF,CAAC;IAED,8BAAO,GAAP;QACC,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACrD,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;SACnC;QACD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IACzB,CAAC;IAED,6BAAM,GAAN;QACC,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACrD,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC;SACpC;QACD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,8BAAO,GAAP;QACC,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;IACF,mBAAC;AAAD,CAAC,AAlID,CAGU,KAAK,CAAC,YAAY,GA+H3B","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { utils } from \"pixi.js\";\nimport { DButtonBase } from \"./d-button-base\";\nimport { DOnOptions } from \"./d-on-options\";\n\n/**\n * {@link DButtonGroup} events.\n */\nexport interface DButtonGroupEvents<BUTTON, EMITTER> {\n\t/**\n\t * Triggered when the active button is changed.\n\t *\n\t * @param emitter an emitter\n\t */\n\tactive(newActive: BUTTON | null, oldActive: BUTTON | null, emitter: EMITTER): void;\n}\n\n/**\n * {@link DButtonGroup} \"on\" options.\n */\nexport interface DButtonGroupOnOptions<BUTTON, EMITTER>\n\textends Partial<DButtonGroupEvents<BUTTON, EMITTER>>,\n\t\tDOnOptions {}\n\nexport interface DButtonGroupOptions<\n\tBUTTON extends DButtonBase<any, any, any> = DButtonBase<any, any, any>,\n\tEMITTER = any\n> {\n\ton?: DButtonGroupOnOptions<BUTTON, EMITTER>;\n}\n\nexport class DButtonGroup<\n\tBUTTON extends DButtonBase<any, any, any> = DButtonBase<any, any, any>,\n\tOPTIONS extends DButtonGroupOptions<BUTTON> = DButtonGroupOptions<BUTTON>\n> extends utils.EventEmitter {\n\tprotected _buttons: BUTTON[];\n\tprotected _active: BUTTON | null;\n\tprotected _onActiveBound: (button: BUTTON) => void;\n\tprotected _isEnabled?: boolean;\n\n\tconstructor(options?: OPTIONS) {\n\t\tsuper();\n\n\t\tthis._buttons = [];\n\t\tthis._active = null;\n\t\tthis._onActiveBound = (button: BUTTON): void => {\n\t\t\tthis.active = button;\n\t\t};\n\n\t\t// Events\n\t\tconst on = options?.on;\n\t\tif (on != null) {\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// Done\n\t\tthis.emit(\"init\", this);\n\t}\n\n\tadd(button: BUTTON): void {\n\t\tconst buttons = this._buttons;\n\t\tconst index = buttons.indexOf(button);\n\t\tif (index < 0) {\n\t\t\tthis._buttons.push(button);\n\t\t\tbutton.isGrouped = true;\n\t\t\tconst isEnabled = this._isEnabled;\n\t\t\tif (isEnabled != null) {\n\t\t\t\tbutton.state.isEnabled = isEnabled;\n\t\t\t}\n\t\t\tbutton.on(\"active\", this._onActiveBound);\n\t\t\tif (button.state.isActive) {\n\t\t\t\tthis.active = button;\n\t\t\t}\n\t\t}\n\t}\n\n\tget active(): BUTTON | null {\n\t\treturn this._active;\n\t}\n\n\tset active(newActive: BUTTON | null) {\n\t\tif ((newActive == null || newActive.isToggle) && this._active !== newActive) {\n\t\t\tconst oldActive = this._active;\n\t\t\tthis._active = null;\n\t\t\tconst buttons = this._buttons;\n\t\t\tfor (let i = 0, imax = buttons.length; i < imax; ++i) {\n\t\t\t\tconst button = buttons[i];\n\t\t\t\tif (button !== newActive && button.isToggle && button.state.isActive) {\n\t\t\t\t\tbutton.toggle();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.emit(\"active\", newActive, oldActive, this);\n\t\t}\n\t}\n\n\tremove(button: BUTTON): void {\n\t\tconst buttons = this._buttons;\n\t\tconst index = buttons.indexOf(button);\n\t\tif (0 <= index) {\n\t\t\tbuttons.splice(index, 1);\n\t\t\tbutton.isGrouped = false;\n\t\t\tbutton.off(\"active\", this._onActiveBound);\n\t\t\tif (this._active === button) {\n\t\t\t\tthis.active = null;\n\t\t\t}\n\t\t}\n\t}\n\n\tcontains(button: BUTTON): boolean {\n\t\tconst buttons = this._buttons;\n\t\tconst index = buttons.indexOf(button);\n\t\treturn 0 <= index;\n\t}\n\n\tclear(): void {\n\t\tconst buttons = this._buttons;\n\t\tfor (let i = 0, imax = buttons.length; i < imax; ++i) {\n\t\t\tbuttons[i].isGrouped = false;\n\t\t}\n\t\tbuttons.length = 0;\n\t\tthis.active = null;\n\t}\n\n\tsize(): number {\n\t\treturn this._buttons.length;\n\t}\n\n\teach(iteratee: (button: BUTTON) => boolean | void): void {\n\t\tconst buttons = this._buttons;\n\t\tfor (let i = 0, imax = buttons.length; i < imax; ++i) {\n\t\t\tconst button = buttons[i];\n\t\t\tif (iteratee(button) === false) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tdisable(): void {\n\t\tconst buttons = this._buttons;\n\t\tfor (let i = 0, imax = buttons.length; i < imax; ++i) {\n\t\t\tbuttons[i].state.isDisabled = true;\n\t\t}\n\t\tthis._isEnabled = false;\n\t}\n\n\tenable(): void {\n\t\tconst buttons = this._buttons;\n\t\tfor (let i = 0, imax = buttons.length; i < imax; ++i) {\n\t\t\tbuttons[i].state.isDisabled = false;\n\t\t}\n\t\tthis._isEnabled = true;\n\t}\n\n\tdestroy(): void {\n\t\tthis.clear();\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-button-group.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-button-group.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AA8BhC;IAGU,gCAAkB;IAM3B,sBAAY,OAAiB;QAA7B,YACC,iBAAO,SAqBP;QAnBA,KAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,KAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,KAAI,CAAC,cAAc,GAAG,UAAC,MAAc;YACpC,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACtB,CAAC,CAAC;QAEF,SAAS;QACT,IAAM,EAAE,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,EAAE,CAAC;QACvB,IAAI,EAAE,IAAI,IAAI,EAAE;YACf,KAAK,IAAM,MAAI,IAAI,EAAE,EAAE;gBACtB,IAAM,OAAO,GAAG,EAAE,CAAC,MAAI,CAAC,CAAC;gBACzB,IAAI,OAAO,EAAE;oBACZ,KAAI,CAAC,EAAE,CAAC,MAAI,EAAE,OAAO,CAAC,CAAC;iBACvB;aACD;SACD;QAED,OAAO;QACP,KAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAI,CAAC,CAAC;;IACzB,CAAC;IAED,0BAAG,GAAH,UAAI,MAAc;QACjB,IAAM,OAAO,GAAG,IAAI,C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,UAAK,QAA4C;QAChD,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACrD,IAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,QAAQ,CAAC,MAAM,CAAC,KAAK,KAAK,EAAE;gBAC/B,MAAM;aACN;SACD;IACF,CAAC;IAED,8BAAO,GAAP;QACC,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACrD,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;SACnC;QACD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IACzB,CAAC;IAED,6BAAM,GAAN;QACC,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACrD,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC;SACpC;QACD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,8BAAO,GAAP;QACC,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;IACF,mBAAC;AAAD,CAAC,AAlID,CAGU,KAAK,CAAC,YAAY,GA+H3B","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { utils } from \"pixi.js\";\nimport { DButtonBase } from \"./d-button-base\";\nimport { DOnOptions } from \"./d-on-options\";\n\n/**\n * {@link DButtonGroup} events.\n */\nexport interface DButtonGroupEvents<BUTTON, EMITTER> {\n\t/**\n\t * Triggered when the active button is changed.\n\t *\n\t * @param emitter an emitter\n\t */\n\tactive(newActive: BUTTON | null, oldActive: BUTTON | null, emitter: EMITTER): void;\n}\n\n/**\n * {@link DButtonGroup} \"on\" options.\n */\nexport interface DButtonGroupOnOptions<BUTTON, EMITTER>\n\textends Partial<DButtonGroupEvents<BUTTON, EMITTER>>,\n\t\tDOnOptions {}\n\nexport interface DButtonGroupOptions<\n\tBUTTON extends DButtonBase<any, any, any> = DButtonBase<any, any, any>,\n\tEMITTER = any\n> {\n\ton?: DButtonGroupOnOptions<BUTTON, EMITTER>;\n}\n\nexport class DButtonGroup<\n\tBUTTON extends DButtonBase<any, any, any> = DButtonBase<any, any, any>,\n\tOPTIONS extends DButtonGroupOptions<BUTTON> = DButtonGroupOptions<BUTTON>\n> extends utils.EventEmitter {\n\tprotected _buttons: BUTTON[];\n\tprotected _active: BUTTON | null;\n\tprotected _onActiveBound: (button: BUTTON) => void;\n\tprotected _isEnabled?: boolean;\n\n\tconstructor(options?: OPTIONS) {\n\t\tsuper();\n\n\t\tthis._buttons = [];\n\t\tthis._active = null;\n\t\tthis._onActiveBound = (button: BUTTON): void => {\n\t\t\tthis.active = button;\n\t\t};\n\n\t\t// Events\n\t\tconst on = options?.on;\n\t\tif (on != null) {\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// Done\n\t\tthis.emit(\"init\", this);\n\t}\n\n\tadd(button: BUTTON): void {\n\t\tconst buttons = this._buttons;\n\t\tconst index = buttons.indexOf(button);\n\t\tif (index < 0) {\n\t\t\tthis._buttons.push(button);\n\t\t\tbutton.isGrouped = true;\n\t\t\tconst isEnabled = this._isEnabled;\n\t\t\tif (isEnabled != null) {\n\t\t\t\tbutton.state.isEnabled = isEnabled;\n\t\t\t}\n\t\t\tbutton.on(\"active\", this._onActiveBound);\n\t\t\tif (button.state.isActive) {\n\t\t\t\tthis.active = button;\n\t\t\t}\n\t\t}\n\t}\n\n\tget active(): BUTTON | null {\n\t\treturn this._active;\n\t}\n\n\tset active(newActive: BUTTON | null) {\n\t\tif ((newActive == null || newActive.isToggle) && this._active !== newActive) {\n\t\t\tconst oldActive = this._active;\n\t\t\tthis._active = newActive;\n\t\t\tconst buttons = this._buttons;\n\t\t\tfor (let i = 0, imax = buttons.length; i < imax; ++i) {\n\t\t\t\tconst button = buttons[i];\n\t\t\t\tif (button !== newActive && button.isToggle && button.state.isActive) {\n\t\t\t\t\tbutton.toggle();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.emit(\"active\", newActive, oldActive, this);\n\t\t}\n\t}\n\n\tremove(button: BUTTON): void {\n\t\tconst buttons = this._buttons;\n\t\tconst index = buttons.indexOf(button);\n\t\tif (0 <= index) {\n\t\t\tbuttons.splice(index, 1);\n\t\t\tbutton.isGrouped = false;\n\t\t\tbutton.off(\"active\", this._onActiveBound);\n\t\t\tif (this._active === button) {\n\t\t\t\tthis.active = null;\n\t\t\t}\n\t\t}\n\t}\n\n\tcontains(button: BUTTON): boolean {\n\t\tconst buttons = this._buttons;\n\t\tconst index = buttons.indexOf(button);\n\t\treturn 0 <= index;\n\t}\n\n\tclear(): void {\n\t\tconst buttons = this._buttons;\n\t\tfor (let i = 0, imax = buttons.length; i < imax; ++i) {\n\t\t\tbuttons[i].isGrouped = false;\n\t\t}\n\t\tbuttons.length = 0;\n\t\tthis.active = null;\n\t}\n\n\tsize(): number {\n\t\treturn this._buttons.length;\n\t}\n\n\teach(iteratee: (button: BUTTON) => boolean | void): void {\n\t\tconst buttons = this._buttons;\n\t\tfor (let i = 0, imax = buttons.length; i < imax; ++i) {\n\t\t\tconst button = buttons[i];\n\t\t\tif (iteratee(button) === false) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tdisable(): void {\n\t\tconst buttons = this._buttons;\n\t\tfor (let i = 0, imax = buttons.length; i < imax; ++i) {\n\t\t\tbuttons[i].state.isDisabled = true;\n\t\t}\n\t\tthis._isEnabled = false;\n\t}\n\n\tenable(): void {\n\t\tconst buttons = this._buttons;\n\t\tfor (let i = 0, imax = buttons.length; i < imax; ++i) {\n\t\t\tbuttons[i].state.isDisabled = false;\n\t\t}\n\t\tthis._isEnabled = true;\n\t}\n\n\tdestroy(): void {\n\t\tthis.clear();\n\t}\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.320.0
2
+ Winter Cardinal UI v0.321.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.320.0
2
+ Winter Cardinal UI v0.321.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.320.0
2
+ Winter Cardinal UI v0.321.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.320.0
2
+ Winter Cardinal UI v0.321.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.320.0
2
+ Winter Cardinal UI v0.321.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -30233,7 +30233,7 @@ var DButtonGroup = /** @class */ (function (_super) {
30233
30233
  set: function (newActive) {
30234
30234
  if ((newActive == null || newActive.isToggle) && this._active !== newActive) {
30235
30235
  var oldActive = this._active;
30236
- this._active = null;
30236
+ this._active = newActive;
30237
30237
  var buttons = this._buttons;
30238
30238
  for (var i = 0, imax = buttons.length; i < imax; ++i) {
30239
30239
  var button = buttons[i];
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.320.0
2
+ Winter Cardinal UI v0.321.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -30230,7 +30230,7 @@
30230
30230
  set: function (newActive) {
30231
30231
  if ((newActive == null || newActive.isToggle) && this._active !== newActive) {
30232
30232
  var oldActive = this._active;
30233
- this._active = null;
30233
+ this._active = newActive;
30234
30234
  var buttons = this._buttons;
30235
30235
  for (var i = 0, imax = buttons.length; i < imax; ++i) {
30236
30236
  var button = buttons[i];