x4js 1.5.16 → 1.5.18

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 (75) hide show
  1. package/lib/cjs/app_sockets.js +74 -0
  2. package/lib/cjs/index.js +1 -0
  3. package/lib/cjs/treeview.js +27 -12
  4. package/lib/cjs/version.js +1 -1
  5. package/lib/esm/app_sockets.js +70 -0
  6. package/lib/esm/index.mjs +1 -0
  7. package/lib/esm/treeview.js +26 -12
  8. package/lib/esm/version.js +1 -1
  9. package/lib/{src/version.ts → types/app_sockets.d.ts} +29 -30
  10. package/lib/types/index.d.ts +1 -0
  11. package/lib/types/treeview.d.ts +5 -2
  12. package/lib/types/version.d.ts +1 -1
  13. package/package.json +1 -4
  14. package/lib/src/MIT-license.md +0 -14
  15. package/lib/src/action.ts +0 -88
  16. package/lib/src/alpha.jpg +0 -0
  17. package/lib/src/application.ts +0 -251
  18. package/lib/src/autocomplete.ts +0 -197
  19. package/lib/src/base64.ts +0 -166
  20. package/lib/src/base_component.ts +0 -152
  21. package/lib/src/button.ts +0 -355
  22. package/lib/src/calendar.ts +0 -328
  23. package/lib/src/canvas.ts +0 -505
  24. package/lib/src/cardview.ts +0 -227
  25. package/lib/src/checkbox.ts +0 -188
  26. package/lib/src/color.ts +0 -752
  27. package/lib/src/colorpicker.ts +0 -1639
  28. package/lib/src/combobox.ts +0 -465
  29. package/lib/src/component.ts +0 -2329
  30. package/lib/src/datastore.ts +0 -1322
  31. package/lib/src/dialog.ts +0 -656
  32. package/lib/src/dom_events.ts +0 -315
  33. package/lib/src/drag_manager.ts +0 -199
  34. package/lib/src/drawtext.ts +0 -355
  35. package/lib/src/fileupload.ts +0 -213
  36. package/lib/src/form.ts +0 -375
  37. package/lib/src/formatters.ts +0 -105
  38. package/lib/src/gridview.ts +0 -1185
  39. package/lib/src/i18n.ts +0 -346
  40. package/lib/src/icon.ts +0 -335
  41. package/lib/src/image.ts +0 -204
  42. package/lib/src/index.ts +0 -88
  43. package/lib/src/input.ts +0 -249
  44. package/lib/src/label.ts +0 -128
  45. package/lib/src/layout.ts +0 -430
  46. package/lib/src/link.ts +0 -86
  47. package/lib/src/listview.ts +0 -765
  48. package/lib/src/md5.ts +0 -438
  49. package/lib/src/menu.ts +0 -425
  50. package/lib/src/messagebox.ts +0 -224
  51. package/lib/src/panel.ts +0 -86
  52. package/lib/src/popup.ts +0 -494
  53. package/lib/src/property_editor.ts +0 -337
  54. package/lib/src/radiobtn.ts +0 -197
  55. package/lib/src/rating.ts +0 -135
  56. package/lib/src/request.ts +0 -300
  57. package/lib/src/router.ts +0 -185
  58. package/lib/src/settings.ts +0 -77
  59. package/lib/src/sidebarview.ts +0 -103
  60. package/lib/src/spreadsheet.ts +0 -1449
  61. package/lib/src/styles.ts +0 -343
  62. package/lib/src/svgcomponent.ts +0 -577
  63. package/lib/src/tabbar.ts +0 -151
  64. package/lib/src/tabview.ts +0 -110
  65. package/lib/src/textarea.ts +0 -235
  66. package/lib/src/textedit.ts +0 -544
  67. package/lib/src/toaster.ts +0 -80
  68. package/lib/src/tools.ts +0 -1473
  69. package/lib/src/tooltips.ts +0 -191
  70. package/lib/src/treeview.ts +0 -696
  71. package/lib/src/x4.less +0 -2243
  72. package/lib/src/x4dom.ts +0 -57
  73. package/lib/src/x4events.ts +0 -585
  74. package/lib/src/x4react.ts +0 -90
  75. package/lib/x4.css +0 -1780
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ /**
3
+ * ___ ___ __
4
+ * \ \/ / / _
5
+ * \ / /_| |_
6
+ * / \____ _|
7
+ * /__/\__\ |_|
8
+ *
9
+ * @file app_sockets.ts
10
+ * @author Etienne Cochard
11
+ *
12
+ * Copyright (c) 2019-2022 R-libre ingenierie
13
+ *
14
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ * of this software and associated documentation files (the "Software"), to deal
16
+ * in the Software without restriction, including without limitation the rights
17
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
18
+ * of the Software, and to permit persons to whom the Software is furnished to do so,
19
+ * subject to the following conditions:
20
+ * The above copyright notice and this permission notice shall be included in all copies
21
+ * or substantial portions of the Software.
22
+ *
23
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
24
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
25
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
28
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
+ **/
30
+ Object.defineProperty(exports, "__esModule", { value: true });
31
+ exports.setupWSMessaging = void 0;
32
+ const application_1 = require("./application");
33
+ /**
34
+ * WEB SOCKETS
35
+ *
36
+ * les messages reçus par l'application sont retransmis au websocket.
37
+ * comme ça, tous les clients connectés sur le serveur recevront une copie du message.
38
+ * ca permet de mettre a jour les clients dynamiquement
39
+ *
40
+ */
41
+ const msg_sent = Symbol('msg_sent');
42
+ function setupWSMessaging(closeCB) {
43
+ const protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
44
+ const sockets = new WebSocket(`${protocol}${window.location.hostname}:${window.location.port}`, 'messaging');
45
+ const app = application_1.Application.instance();
46
+ // pour tous les messages recus par l'application
47
+ // on transmet aux autres
48
+ app.on('global', (e) => {
49
+ if (e[msg_sent]) {
50
+ return;
51
+ }
52
+ sockets.send(JSON.stringify({
53
+ msg: e.msg,
54
+ params: e.params,
55
+ }));
56
+ });
57
+ // reception d'un message
58
+ sockets.onmessage = (e) => {
59
+ if (e.data != 'ping') {
60
+ const message = JSON.parse(e.data);
61
+ message[msg_sent] = true;
62
+ app.signal('global', message);
63
+ }
64
+ };
65
+ // perte du socket
66
+ sockets.onclose = (ev) => {
67
+ console.log('websocket closed:', ev);
68
+ closeCB();
69
+ };
70
+ sockets.onerror = (ev) => {
71
+ console.log('websocket error:', ev);
72
+ };
73
+ }
74
+ exports.setupWSMessaging = setupWSMessaging;
package/lib/cjs/index.js CHANGED
@@ -99,4 +99,5 @@ __exportStar(require("./tooltips"), exports);
99
99
  __exportStar(require("./treeview"), exports);
100
100
  __exportStar(require("./x4events"), exports);
101
101
  __exportStar(require("./x4react"), exports);
102
+ __exportStar(require("./app_sockets"), exports);
102
103
  __exportStar(require("./version"), exports);
@@ -297,21 +297,36 @@ class TreeView extends layout_1.VLayout {
297
297
  this.select(id, false);
298
298
  }
299
299
  /**
300
- * idem selection = xx but with a notification
301
- * @param id
300
+ * care, component should have been created, to select an item at startup,
301
+ * use something like
302
+ * componentCreated( ) {
303
+ * mytree.select( id );
304
+ * }
302
305
  */
303
- select(id, notify = false) {
304
- if (id === null || id === undefined) {
305
- this._selectItem(null, null);
306
+ select(id, notify = true) {
307
+ var _a;
308
+ if ((_a = this.m_selection) === null || _a === void 0 ? void 0 : _a.el) {
309
+ this.m_selection.el.removeClass('selected');
306
310
  }
307
- else {
308
- if (isFunction(this.m_props.items)) {
309
- this.m_defer_sel = id;
311
+ this.m_selection = null;
312
+ if (id !== undefined) {
313
+ const { node: sel } = this._getNode(id);
314
+ if (sel) {
315
+ this.m_selection = {
316
+ id: id,
317
+ el: sel
318
+ };
319
+ sel.addClass('selected');
320
+ sel.scrollIntoView();
321
+ if (notify) {
322
+ let nd = sel.getData('node');
323
+ this.emit('selectionchange', (0, x4events_1.EvSelectionChange)(nd));
324
+ }
310
325
  }
311
- else {
312
- let item = this.m_props.items.find((item) => item.id == id);
313
- let citem = this._findItemWithId(item.id);
314
- this._selectItem(item, citem, notify);
326
+ }
327
+ else {
328
+ if (notify) {
329
+ this.emit('selectionchange', (0, x4events_1.EvSelectionChange)(null));
315
330
  }
316
331
  }
317
332
  }
@@ -29,4 +29,4 @@
29
29
  **/
30
30
  Object.defineProperty(exports, "__esModule", { value: true });
31
31
  exports.x4js_version = void 0;
32
- exports.x4js_version = "1.5.16";
32
+ exports.x4js_version = "1.5.18";
@@ -0,0 +1,70 @@
1
+ /**
2
+ * ___ ___ __
3
+ * \ \/ / / _
4
+ * \ / /_| |_
5
+ * / \____ _|
6
+ * /__/\__\ |_|
7
+ *
8
+ * @file app_sockets.ts
9
+ * @author Etienne Cochard
10
+ *
11
+ * Copyright (c) 2019-2022 R-libre ingenierie
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ * of this software and associated documentation files (the "Software"), to deal
15
+ * in the Software without restriction, including without limitation the rights
16
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
17
+ * of the Software, and to permit persons to whom the Software is furnished to do so,
18
+ * subject to the following conditions:
19
+ * The above copyright notice and this permission notice shall be included in all copies
20
+ * or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
23
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
+ **/
29
+ import { Application } from "./application";
30
+ /**
31
+ * WEB SOCKETS
32
+ *
33
+ * les messages reçus par l'application sont retransmis au websocket.
34
+ * comme ça, tous les clients connectés sur le serveur recevront une copie du message.
35
+ * ca permet de mettre a jour les clients dynamiquement
36
+ *
37
+ */
38
+ const msg_sent = Symbol('msg_sent');
39
+ export function setupWSMessaging(closeCB) {
40
+ const protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
41
+ const sockets = new WebSocket(`${protocol}${window.location.hostname}:${window.location.port}`, 'messaging');
42
+ const app = Application.instance();
43
+ // pour tous les messages recus par l'application
44
+ // on transmet aux autres
45
+ app.on('global', (e) => {
46
+ if (e[msg_sent]) {
47
+ return;
48
+ }
49
+ sockets.send(JSON.stringify({
50
+ msg: e.msg,
51
+ params: e.params,
52
+ }));
53
+ });
54
+ // reception d'un message
55
+ sockets.onmessage = (e) => {
56
+ if (e.data != 'ping') {
57
+ const message = JSON.parse(e.data);
58
+ message[msg_sent] = true;
59
+ app.signal('global', message);
60
+ }
61
+ };
62
+ // perte du socket
63
+ sockets.onclose = (ev) => {
64
+ console.log('websocket closed:', ev);
65
+ closeCB();
66
+ };
67
+ sockets.onerror = (ev) => {
68
+ console.log('websocket error:', ev);
69
+ };
70
+ }
package/lib/esm/index.mjs CHANGED
@@ -83,4 +83,5 @@ export * from "./tooltips";
83
83
  export * from "./treeview";
84
84
  export * from "./x4events";
85
85
  export * from "./x4react";
86
+ export * from "./app_sockets";
86
87
  export * from "./version";
@@ -293,21 +293,35 @@ export class TreeView extends VLayout {
293
293
  this.select(id, false);
294
294
  }
295
295
  /**
296
- * idem selection = xx but with a notification
297
- * @param id
296
+ * care, component should have been created, to select an item at startup,
297
+ * use something like
298
+ * componentCreated( ) {
299
+ * mytree.select( id );
300
+ * }
298
301
  */
299
- select(id, notify = false) {
300
- if (id === null || id === undefined) {
301
- this._selectItem(null, null);
302
+ select(id, notify = true) {
303
+ if (this.m_selection?.el) {
304
+ this.m_selection.el.removeClass('selected');
302
305
  }
303
- else {
304
- if (isFunction(this.m_props.items)) {
305
- this.m_defer_sel = id;
306
+ this.m_selection = null;
307
+ if (id !== undefined) {
308
+ const { node: sel } = this._getNode(id);
309
+ if (sel) {
310
+ this.m_selection = {
311
+ id: id,
312
+ el: sel
313
+ };
314
+ sel.addClass('selected');
315
+ sel.scrollIntoView();
316
+ if (notify) {
317
+ let nd = sel.getData('node');
318
+ this.emit('selectionchange', EvSelectionChange(nd));
319
+ }
306
320
  }
307
- else {
308
- let item = this.m_props.items.find((item) => item.id == id);
309
- let citem = this._findItemWithId(item.id);
310
- this._selectItem(item, citem, notify);
321
+ }
322
+ else {
323
+ if (notify) {
324
+ this.emit('selectionchange', EvSelectionChange(null));
311
325
  }
312
326
  }
313
327
  }
@@ -26,4 +26,4 @@
26
26
  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
27
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
28
  **/
29
- export const x4js_version = "1.5.16";
29
+ export const x4js_version = "1.5.18";
@@ -1,30 +1,29 @@
1
- /**
2
- * ___ ___ __
3
- * \ \_/ / / _
4
- * \ / /_| |_
5
- * / _ \____ _|
6
- * /__/ \__\ |_|
7
- *
8
- * @file version.ts
9
- * @author Etienne Cochard
10
- *
11
- * Copyright (c) 2019-2022 R-libre ingenierie
12
- *
13
- * Permission is hereby granted, free of charge, to any person obtaining a copy
14
- * of this software and associated documentation files (the "Software"), to deal
15
- * in the Software without restriction, including without limitation the rights
16
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
17
- * of the Software, and to permit persons to whom the Software is furnished to do so,
18
- * subject to the following conditions:
19
- * The above copyright notice and this permission notice shall be included in all copies
20
- * or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
23
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
- **/
29
-
30
- export const x4js_version = "1.5.16";
1
+ /**
2
+ * ___ ___ __
3
+ * \ \/ / / _
4
+ * \ / /_| |_
5
+ * / \____ _|
6
+ * /__/\__\ |_|
7
+ *
8
+ * @file app_sockets.ts
9
+ * @author Etienne Cochard
10
+ *
11
+ * Copyright (c) 2019-2022 R-libre ingenierie
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ * of this software and associated documentation files (the "Software"), to deal
15
+ * in the Software without restriction, including without limitation the rights
16
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
17
+ * of the Software, and to permit persons to whom the Software is furnished to do so,
18
+ * subject to the following conditions:
19
+ * The above copyright notice and this permission notice shall be included in all copies
20
+ * or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
23
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
+ **/
29
+ export declare function setupWSMessaging(closeCB: () => void): void;
@@ -80,4 +80,5 @@ export * from "./tooltips";
80
80
  export * from "./treeview";
81
81
  export * from "./x4events";
82
82
  export * from "./x4react";
83
+ export * from "./app_sockets";
83
84
  export * from "./version";
@@ -106,8 +106,11 @@ export declare class TreeView extends VLayout<TreeViewProps, TreeViewEventMap> {
106
106
  ensureVisible(id: any): void;
107
107
  set selection(id: any);
108
108
  /**
109
- * idem selection = xx but with a notification
110
- * @param id
109
+ * care, component should have been created, to select an item at startup,
110
+ * use something like
111
+ * componentCreated( ) {
112
+ * mytree.select( id );
113
+ * }
111
114
  */
112
115
  select(id: any, notify?: boolean): void;
113
116
  private _getNode;
@@ -26,4 +26,4 @@
26
26
  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
27
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
28
  **/
29
- export declare const x4js_version = "1.5.16";
29
+ export declare const x4js_version = "1.5.18";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x4js",
3
- "version": "1.5.16",
3
+ "version": "1.5.18",
4
4
  "description": "X4js core files",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -42,8 +42,5 @@
42
42
  "default": "./lib/cjs/index.js"
43
43
  }
44
44
  }
45
- },
46
- "dependencies": {
47
- "typescript": "^4.9.3"
48
45
  }
49
46
  }
@@ -1,14 +0,0 @@
1
- # MIT LICENSE #
2
-
3
- **Copyright (c) 2019-2022 R-libre ingenierie**
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
- of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
-
9
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
-
11
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
12
- PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
13
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
-
package/lib/src/action.ts DELETED
@@ -1,88 +0,0 @@
1
- /**
2
- * ___ ___ __
3
- * \ \/ / / _
4
- * \ / /_| |_
5
- * / \____ _|
6
- * /__/\__\ |_|
7
- *
8
- * @file action.ts
9
- * @author Etienne Cochard
10
- *
11
- * Copyright (c) 2019-2022 R-libre ingenierie
12
- *
13
- * Permission is hereby granted, free of charge, to any person obtaining a copy
14
- * of this software and associated documentation files (the "Software"), to deal
15
- * in the Software without restriction, including without limitation the rights
16
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
17
- * of the Software, and to permit persons to whom the Software is furnished to do so,
18
- * subject to the following conditions:
19
- * The above copyright notice and this permission notice shall be included in all copies
20
- * or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
23
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24
- * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
- **/
29
-
30
- import { BasicEvent, EvChange } from './x4events'
31
- import { BaseComponent, BaseComponentEventMap, BaseComponentProps } from './base_component'
32
- import { IconID } from "./icon"
33
- import { EventHandler } from './component';
34
-
35
- //TODO: implement all
36
-
37
-
38
- export interface EvAction extends BasicEvent {
39
- }
40
-
41
- export function EvAction( source: Action ) {
42
- return BasicEvent<EvAction>({source});
43
- }
44
-
45
- interface ActionEventMap extends BaseComponentEventMap {
46
- run: EvAction;
47
- change: EvChange;
48
- }
49
-
50
- interface ActionProps extends BaseComponentProps<ActionEventMap> {
51
- id?: any;
52
- text?: string;
53
- icon?: IconID;
54
- disabled?: boolean;
55
- hidden?: boolean;
56
- checked?: boolean;
57
-
58
- run: EventHandler<EvAction>;
59
- change?: EventHandler<EvChange>;
60
- }
61
-
62
- export class Action extends BaseComponent<ActionProps,ActionEventMap> {
63
-
64
- constructor( props: ActionProps ) {
65
- super( props );
66
-
67
- this.mapPropEvents( props, "run" );
68
- }
69
-
70
- get props( ) {
71
- return this.m_props;
72
- }
73
-
74
- set text( t: string ) {
75
- this.m_props.text = t;
76
- this.emit( "change", EvChange(this) );
77
- }
78
-
79
- set icon( i: IconID ) {
80
- this.m_props.icon = i;
81
- this.emit( "change", EvChange(this) );
82
- }
83
-
84
- fire( ) {
85
- this.emit( "run", EvAction(this) );
86
- }
87
- }
88
-
package/lib/src/alpha.jpg DELETED
Binary file