@bryntum/taskboard-angular 7.1.1 → 7.1.2

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 (76) hide show
  1. package/README.md +230 -15
  2. package/package.json +1 -1
  3. package/src/lib/bryntum-button-group.component.ts +1213 -0
  4. package/src/lib/bryntum-button.component.ts +1190 -0
  5. package/src/lib/bryntum-chat-panel.component.ts +1435 -0
  6. package/src/lib/bryntum-checkbox-group.component.ts +1478 -0
  7. package/src/lib/bryntum-checkbox.component.ts +1333 -0
  8. package/src/lib/bryntum-chip-view.component.ts +1225 -0
  9. package/src/lib/bryntum-code-editor.component.ts +1419 -0
  10. package/src/lib/bryntum-color-field.component.ts +1334 -0
  11. package/src/lib/bryntum-column-combo.component.ts +1645 -0
  12. package/src/lib/bryntum-column-filter-field.component.ts +1360 -0
  13. package/src/lib/bryntum-column-picker-button.component.ts +1200 -0
  14. package/src/lib/bryntum-column-scroll-button.component.ts +1200 -0
  15. package/src/lib/bryntum-combo.component.ts +1634 -0
  16. package/src/lib/bryntum-container.component.ts +1166 -0
  17. package/src/lib/bryntum-date-field.component.ts +1413 -0
  18. package/src/lib/bryntum-date-picker.component.ts +1756 -0
  19. package/src/lib/bryntum-date-range-field.component.ts +1417 -0
  20. package/src/lib/bryntum-date-time-field.component.ts +1261 -0
  21. package/src/lib/bryntum-demo-code-editor.component.ts +1441 -0
  22. package/src/lib/bryntum-demo-header.component.ts +141 -0
  23. package/src/lib/bryntum-display-field.component.ts +1308 -0
  24. package/src/lib/bryntum-duration-field.component.ts +1390 -0
  25. package/src/lib/bryntum-editor.component.ts +1343 -0
  26. package/src/lib/bryntum-field-filter-picker-group.component.ts +1308 -0
  27. package/src/lib/bryntum-field-filter-picker.component.ts +1272 -0
  28. package/src/lib/bryntum-field-set.component.ts +1408 -0
  29. package/src/lib/bryntum-file-field.component.ts +1313 -0
  30. package/src/lib/bryntum-file-picker.component.ts +1199 -0
  31. package/src/lib/bryntum-filter-field.component.ts +1367 -0
  32. package/src/lib/bryntum-fullscreen-button.component.ts +53 -0
  33. package/src/lib/bryntum-hint.component.ts +1506 -0
  34. package/src/lib/bryntum-label.component.ts +989 -0
  35. package/src/lib/bryntum-list.component.ts +1196 -0
  36. package/src/lib/bryntum-menu.component.ts +1520 -0
  37. package/src/lib/bryntum-month-picker.component.ts +1400 -0
  38. package/src/lib/bryntum-number-field.component.ts +1368 -0
  39. package/src/lib/bryntum-paging-toolbar.component.ts +1243 -0
  40. package/src/lib/bryntum-panel.component.ts +1377 -0
  41. package/src/lib/bryntum-password-field.component.ts +1296 -0
  42. package/src/lib/bryntum-project-combo.component.ts +1648 -0
  43. package/src/lib/bryntum-radio-group.component.ts +1446 -0
  44. package/src/lib/bryntum-radio.component.ts +1333 -0
  45. package/src/lib/bryntum-resources-combo.component.ts +1644 -0
  46. package/src/lib/bryntum-scheduler-project-combo.component.ts +1638 -0
  47. package/src/lib/bryntum-slide-toggle.component.ts +1333 -0
  48. package/src/lib/bryntum-slider.component.ts +1112 -0
  49. package/src/lib/bryntum-splitter.component.ts +1025 -0
  50. package/src/lib/bryntum-swimlane-combo.component.ts +1644 -0
  51. package/src/lib/bryntum-swimlane-filter-field.component.ts +1377 -0
  52. package/src/lib/bryntum-swimlane-picker-button.component.ts +1200 -0
  53. package/src/lib/bryntum-swimlane-scroll-button.component.ts +1200 -0
  54. package/src/lib/bryntum-tab-panel.component.ts +1441 -0
  55. package/src/lib/bryntum-tag-combo.component.ts +1651 -0
  56. package/src/lib/bryntum-task-board-base.component.ts +2388 -0
  57. package/src/lib/bryntum-task-board-field-filter-picker-group.component.ts +1316 -0
  58. package/src/lib/bryntum-task-board-field-filter-picker.component.ts +1254 -0
  59. package/src/lib/bryntum-task-board-project-model.component.ts +1026 -0
  60. package/src/lib/bryntum-task-board.component.ts +2392 -0
  61. package/src/lib/bryntum-task-color-combo.component.ts +1334 -0
  62. package/src/lib/bryntum-task-filter-field.component.ts +1377 -0
  63. package/src/lib/bryntum-text-area-field.component.ts +1312 -0
  64. package/src/lib/bryntum-text-area-picker-field.component.ts +1343 -0
  65. package/src/lib/bryntum-text-field.component.ts +1321 -0
  66. package/src/lib/bryntum-time-field.component.ts +1388 -0
  67. package/src/lib/bryntum-time-picker.component.ts +1207 -0
  68. package/src/lib/bryntum-todo-list-field.component.ts +1318 -0
  69. package/src/lib/bryntum-toolbar.component.ts +1234 -0
  70. package/src/lib/bryntum-undo-redo.component.ts +1179 -0
  71. package/src/lib/bryntum-widget.component.ts +982 -0
  72. package/src/lib/bryntum-year-picker.component.ts +1423 -0
  73. package/src/lib/bryntum-zoom-slider.component.ts +1122 -0
  74. package/src/lib/taskboard.module.ts +232 -0
  75. package/src/lib/wrapper.helper.ts +89 -0
  76. package/src/public-api.ts +77 -0
@@ -0,0 +1,1190 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /**
3
+ * Angular wrapper for Bryntum Button
4
+ */
5
+
6
+ import { Component, ElementRef, EventEmitter, Output, Input, SimpleChange, SimpleChanges, OnDestroy, OnInit } from '@angular/core';
7
+
8
+ import WrapperHelper from './wrapper.helper';
9
+
10
+ import { AlignSpec, Base, Button, ButtonListeners, ContainerItemConfig, DomConfig, KeyMapConfig, MaskConfig, Menu, MenuConfig, MenuItemEntry, PopupConfig, Rectangle, Scroller, ScrollerConfig, TabConfig, TooltipConfig, VueConfig, Widget } from '@bryntum/taskboard';
11
+
12
+ import { StringHelper } from '@bryntum/taskboard';
13
+
14
+ export type BryntumButtonProps = {
15
+ // Configs
16
+ /**
17
+ * Element (or element id) to adopt as this Widget's encapsulating element. The widget's
18
+ * content will be placed inside this element.
19
+ * ...
20
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-adopt)
21
+ */
22
+ adopt ? : HTMLElement|string
23
+ /**
24
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
25
+ * ...
26
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-align)
27
+ */
28
+ align ? : AlignSpec|string
29
+ /**
30
+ * When this widget is a child of a [Container](https://bryntum.com/products/taskboard/docs/api/Core/widget/Container), it will by default be participating in a
31
+ * flexbox layout. This config allows you to set this widget's
32
+ * [align-self](https://developer.mozilla.org/en-US/docs/Web/CSS/align-self) style.
33
+ */
34
+ alignSelf ? : string
35
+ /**
36
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating) and being shown through [showBy](#Core/widget/Widget#function-showBy).*
37
+ * `true` to show a connector arrow pointing to the align target.
38
+ */
39
+ anchor ? : boolean
40
+ /**
41
+ * Element (or the id of an element) to append this widget's element to. Can be configured, or set once at
42
+ * runtime. To access the element of a rendered widget, see [element](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#property-element).
43
+ */
44
+ appendTo ? : HTMLElement|string
45
+ /**
46
+ * A localizable string (May contain `'L{}'` tokens which resolve in the locale file) to inject
47
+ * into an element which will be linked using the `aria-describedby` attribute.
48
+ * ...
49
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-ariaDescription)
50
+ */
51
+ ariaDescription ? : string
52
+ /**
53
+ * A localizable string (May contain `'L{}'` tokens which resolve in the locale file) to inject as
54
+ * the `aria-label` attribute.
55
+ * ...
56
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-ariaLabel)
57
+ */
58
+ ariaLabel ? : string
59
+ /**
60
+ * Initial text to show in badge.
61
+ */
62
+ badge ? : string
63
+ /**
64
+ * The button behavioral type, will be applied as a `type` attribute to this button's element.
65
+ */
66
+ behaviorType ? : 'button'|'submit'|'reset'
67
+ /**
68
+ * An object where property names with a truthy value indicate which events should bubble up the ownership
69
+ * hierarchy when triggered.
70
+ * ...
71
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-bubbleEvents)
72
+ */
73
+ bubbleEvents ? : object
74
+ /**
75
+ * Set to `false` to not call onXXX method names (e.g. `onShow`, `onClick`), as an easy way to listen for events.
76
+ * ...
77
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-callOnFunctions)
78
+ */
79
+ callOnFunctions ? : boolean
80
+ /**
81
+ * By default, if an event handler throws an exception, the error propagates up the stack and the
82
+ * application state is undefined. Code which follows the event handler will *not* be executed.
83
+ * ...
84
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-catchEventHandlerExceptions)
85
+ */
86
+ catchEventHandlerExceptions ? : boolean
87
+ /**
88
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
89
+ * Set to `true` to centre the Widget in browser viewport space.
90
+ */
91
+ centered ? : boolean
92
+ /**
93
+ * Custom CSS classes to add to element.
94
+ * May be specified as a space separated string, or as an object in which property names
95
+ * with truthy values are used as the class names:
96
+ * ...
97
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-cls)
98
+ */
99
+ cls ? : string|object
100
+ /**
101
+ * Applies the specified color to the widget, by setting the `--b-primary` CSS variable in the widgets
102
+ * `style` block.
103
+ * ...
104
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-color)
105
+ */
106
+ color ? : string
107
+ /**
108
+ * Programmatic control over which column to start in when used in a grid layout.
109
+ */
110
+ column ? : number
111
+ config ? : object
112
+ /**
113
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating) or [positioned](#Core/widget/Widget#config-positioned).*
114
+ * Element, Widget or Rectangle to which this Widget is constrained.
115
+ */
116
+ constrainTo ? : HTMLElement|Widget|Rectangle
117
+ /**
118
+ * The HTML content that coexists with sibling elements which may have been added to the
119
+ * [contentElement](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#property-contentElement) by plugins and features.
120
+ * When specifying html, this widget's element will also have the [htmlCls](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-htmlCls)
121
+ * class added to its classList, to allow targeted styling.
122
+ */
123
+ content ? : string
124
+ /**
125
+ * Custom CSS classes to add to the [contentElement](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#property-contentElement).
126
+ * May be specified as a space separated string, or as an object in which property names
127
+ * with truthy values are used as the class names:
128
+ * ...
129
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-contentElementCls)
130
+ */
131
+ contentElementCls ? : string|object
132
+ /**
133
+ * When this Widget configuration is used in the Grid's RowExpander feature's `widget` config, provide the
134
+ * field on the expanded record to use for populating this widget's store (if applicable)
135
+ */
136
+ dataField ? : string
137
+ /**
138
+ * Object to apply to elements dataset (each key will be used as a data-attribute on the element)
139
+ */
140
+ dataset ? : Record<string, string>
141
+ /**
142
+ * The name of the property to set when a single value is to be applied to this Widget. Such as when used
143
+ * in a grid WidgetColumn, this is the property to which the column's `field` is applied.
144
+ */
145
+ defaultBindProperty ? : string
146
+ /**
147
+ * Check for CSS compatibility issues when upgrading to v7. Performs the following checks:
148
+ * ...
149
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-detectCSSCompatibilityIssues)
150
+ */
151
+ detectCSSCompatibilityIssues ? : boolean
152
+ /**
153
+ * Disable or enable the widget. It is similar to [readOnly](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-readOnly) except a disabled widget
154
+ * cannot be focused, uses a different rendition (usually greyish) and does not allow selecting its value.
155
+ * ...
156
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-disabled)
157
+ */
158
+ disabled ? : boolean|'inert'
159
+ /**
160
+ * Controls the placement of this widget when it is added to a [panel's ](https://bryntum.com/products/taskboard/docs/api/Core/widget/Panel)
161
+ * [strips collection](https://bryntum.com/products/taskboard/docs/api/Core/widget/Panel#config-strips). Typical values for this config are `'top'`,
162
+ * `'bottom'`, `'left'`, or `'right'`, which cause the widget to be placed on that side of the panel's
163
+ * body. Such widgets are called "edge strips".
164
+ * ...
165
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-dock)
166
+ */
167
+ dock ? : 'top'|'bottom'|'left'|'right'|'start'|'end'|'header'|'pre-header'|object
168
+ /**
169
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
170
+ * Set to `true` to be able to drag a widget freely on the page. Or set to an object with a ´handleSelector´
171
+ * property which controls when a drag should start.
172
+ * ...
173
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-draggable)
174
+ */
175
+ draggable ? : boolean|{
176
+ handleSelector?: string
177
+ }
178
+ /**
179
+ * An object specifying attributes to assign to the root element of this widget.
180
+ * Set `null` value to attribute to remove it.
181
+ * ...
182
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-elementAttributes)
183
+ */
184
+ elementAttributes ? : Record<string, string|null>
185
+ extraData ? : any
186
+ /**
187
+ * When this widget is a child of a [Container](https://bryntum.com/products/taskboard/docs/api/Core/widget/Container), it will by default be participating in a
188
+ * flexbox layout. This config allows you to set this widget's
189
+ * [flex](https://developer.mozilla.org/en-US/docs/Web/CSS/flex) style.
190
+ * This may be configured as a single number or a `&lt;flex-grow&gt; &lt;flex-shrink&gt; &lt;flex-basis&gt;` format string.
191
+ * numeric-only values are interpreted as the `flex-grow` value.
192
+ */
193
+ flex ? : number|string
194
+ /**
195
+ * Set to `true` to move the widget out of the document flow and position it
196
+ * absolutely in browser viewport space.
197
+ */
198
+ floating ? : boolean
199
+ /**
200
+ * Widget's height, used to set element `style.height`. Either specify a valid height string or a number,
201
+ * which will get 'px' appended. We recommend using CSS as the primary way to control height, but in some
202
+ * cases this config is convenient.
203
+ */
204
+ height ? : string|number
205
+ /**
206
+ * Configure with true to make widget initially hidden.
207
+ */
208
+ hidden ? : boolean
209
+ /**
210
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
211
+ * ...
212
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-hideAnimation)
213
+ */
214
+ hideAnimation ? : boolean|object
215
+ /**
216
+ * If provided, turns the button into a link.
217
+ * ...
218
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-href)
219
+ */
220
+ href ? : string
221
+ /**
222
+ * The HTML to display initially or a function returning the markup (called at widget construction time).
223
+ * ...
224
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-html)
225
+ * @param {Core.widget.Widget} widget The calling Widget
226
+ * @returns {string}
227
+ */
228
+ html ? : string|((widget: Widget) => string)|DomConfig|DomConfig[]|VueConfig
229
+ /**
230
+ * The CSS class(es) to add when HTML content is being applied to this widget.
231
+ */
232
+ htmlCls ? : string|object
233
+ /**
234
+ * Button icon class, a developer-defined CSS class string which results in the desired icon.
235
+ * ...
236
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-icon)
237
+ */
238
+ icon ? : string
239
+ /**
240
+ * Button icon alignment. May be `'start'` or `'end'`. Defaults to `'start'`
241
+ */
242
+ iconAlign ? : 'start'|'end'
243
+ /**
244
+ * Widget id, if not specified one will be generated. Also used for lookups through Widget.getById
245
+ */
246
+ id ? : string
247
+ /**
248
+ * Determines if the widgets read-only state should be controlled by its parent.
249
+ * ...
250
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-ignoreParentReadOnly)
251
+ */
252
+ ignoreParentReadOnly ? : boolean
253
+ /**
254
+ * Element (or element id) to insert this widget before. If provided, [appendTo](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-appendTo) config is ignored.
255
+ */
256
+ insertBefore ? : HTMLElement|string
257
+ /**
258
+ * Element (or element id) to append this widget element to, as a first child. If provided, [appendTo](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-appendTo) config is ignored.
259
+ */
260
+ insertFirst ? : HTMLElement|string
261
+ /**
262
+ * An object whose keys are the [key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) name
263
+ * and optional modifier prefixes: `'Ctrl+'`, `'Alt+'`, `'Meta+'`, and `'Shift+'` (case-insensitive). The values
264
+ * are the name of the instance method to call when the keystroke is received.
265
+ * ...
266
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-keyMap)
267
+ */
268
+ keyMap ? : Record<string, KeyMapConfig>
269
+ /**
270
+ * The listener set for this object.
271
+ * ...
272
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-listeners)
273
+ */
274
+ listeners ? : ButtonListeners
275
+ /**
276
+ * A class translations of which are used for translating this entity.
277
+ * This is often used when translations of an item are defined on its container class.
278
+ * For example:
279
+ * ...
280
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-localeClass)
281
+ */
282
+ localeClass ? : typeof Base
283
+ /**
284
+ * Set to `false` to disable localization of this object.
285
+ */
286
+ localizable ? : boolean
287
+ /**
288
+ * List of properties which values should be translated automatically upon a locale applying.
289
+ * In case there is a need to localize not typical value (not a String value or a field with re-defined setter/getter),
290
+ * you could use 'localeKey' meta configuration.
291
+ * Example:
292
+ * ...
293
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-localizableProperties)
294
+ */
295
+ localizableProperties ? : string[]
296
+ /**
297
+ * Widget's margin. This may be configured as a single number or a `TRBL` format string.
298
+ * numeric-only values are interpreted as pixels.
299
+ */
300
+ margin ? : number|string
301
+ /**
302
+ * This config object contains the defaults for the [Mask](https://bryntum.com/products/taskboard/docs/api/Core/widget/Mask) created for the
303
+ * [masked](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-masked) config. Any properties specified in the `masked` config will override these
304
+ * values.
305
+ */
306
+ maskDefaults ? : MaskConfig
307
+ /**
308
+ * Set to `true` to apply the default mask to the widget. Alternatively, this can be the mask message or a
309
+ * [Mask](https://bryntum.com/products/taskboard/docs/api/Core/widget/Mask) config object.
310
+ */
311
+ masked ? : boolean|string|MaskConfig
312
+ /**
313
+ * The element's maxHeight. Can be either a String or a Number (which will have 'px' appended). Note that
314
+ * like [height](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-height), *reading* the value will return the numeric value in pixels.
315
+ */
316
+ maxHeight ? : string|number
317
+ /**
318
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
319
+ * ...
320
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-maximizeOnMobile)
321
+ */
322
+ maximizeOnMobile ? : number|string
323
+ /**
324
+ * The elements maxWidth. Can be either a String or a Number (which will have 'px' appended). Note that
325
+ * like [width](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-width), *reading* the value will return the numeric value in pixels.
326
+ */
327
+ maxWidth ? : string|number
328
+ /**
329
+ * A submenu configuration object, or an array of MenuItem configuration objects from which to create a
330
+ * submenu which is shown when this button is pressed.
331
+ * ...
332
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-menu)
333
+ */
334
+ menu ? : Record<string, MenuItemEntry|ContainerItemConfig>|(MenuItemEntry|ContainerItemConfig)[]|MenuConfig|PopupConfig
335
+ /**
336
+ * The menu icon class to show when the button has a menu. Set to `null` to not show a menu icon.
337
+ * ...
338
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-menuIcon)
339
+ */
340
+ menuIcon ? : string
341
+ /**
342
+ * The element's minHeight. Can be either a String or a Number (which will have 'px' appended). Note that
343
+ * like [height](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-height), *reading* the value will return the numeric value in pixels.
344
+ */
345
+ minHeight ? : string|number
346
+ /**
347
+ * The elements minWidth. Can be either a String or a Number (which will have 'px' appended). Note that
348
+ * like [width](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-width), *reading* the value will return the numeric value in pixels.
349
+ */
350
+ minWidth ? : string|number
351
+ /**
352
+ * When this is configured as `true` a [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)
353
+ * is used to monitor this element for size changes caused by either style manipulation, or by CSS
354
+ * layout.
355
+ * ...
356
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-monitorResize)
357
+ */
358
+ monitorResize ? : boolean|{
359
+ immediate?: boolean
360
+ }
361
+ /**
362
+ * The owning Widget of this Widget. If this Widget is directly contained (that is, it is one of the
363
+ * [items](https://bryntum.com/products/taskboard/docs/api/Core/widget/Container#property-items) of a Container), this config will be ignored. In this case
364
+ * the owner is <strong>always</strong> the encapsulating Container.
365
+ * ...
366
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-owner)
367
+ */
368
+ owner ? : Widget|any
369
+ /**
370
+ * Set to `true` when a widget is rendered into another widget's [contentElement](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#property-contentElement), but must
371
+ * not participate in the standard layout of that widget, and must be positioned relatively to that
372
+ * widget's [contentElement](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#property-contentElement).
373
+ * ...
374
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-positioned)
375
+ */
376
+ positioned ? : boolean
377
+ /**
378
+ * Initially pressed or not. Only applies with `toggleable = true`.
379
+ * ...
380
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-pressed)
381
+ */
382
+ pressed ? : boolean
383
+ /**
384
+ * A CSS class to add to the pressed state of the button. A `b-pressed` CSS class is always added,
385
+ * when a button is pressed.
386
+ */
387
+ pressedCls ? : string
388
+ /**
389
+ * Icon class for the buttons pressed state, a developer-defined CSS class string which results in the
390
+ * desired icon. Only applies to toggle buttons
391
+ * ...
392
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-pressedIcon)
393
+ */
394
+ pressedIcon ? : string
395
+ /**
396
+ * Prevent tooltip from being displayed on touch devices. Useful for example for buttons that display a
397
+ * menu on click etc, since the tooltip would be displayed at the same time.
398
+ */
399
+ preventTooltipOnTouch ? : boolean
400
+ /**
401
+ * Whether this widget is read-only. This is only valid if the widget is an input
402
+ * field, <strong>or contains input fields at any depth</strong>.
403
+ * ...
404
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-readOnly)
405
+ */
406
+ readOnly ? : boolean
407
+ relayStoreEvents ? : boolean
408
+ /**
409
+ * Predefined style to use for the button. Possible values are:
410
+ * ...
411
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-rendition)
412
+ */
413
+ rendition ? : 'elevated'|'filled'|'tonal'|'outlined'|'text'|string
414
+ /**
415
+ * Configure as `true` to have the component display a translucent ripple when its
416
+ * [focusElement](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#property-focusElement), or [element](#Core/widget/Widget#property-element) is tapped <em>if the
417
+ * current theme supports ripples</em>. Out of the box, only the Material theme supports ripples.
418
+ * ...
419
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-ripple)
420
+ */
421
+ ripple ? : boolean|{
422
+ delegate?: string
423
+ color?: string
424
+ radius?: number
425
+ clip?: string
426
+ }
427
+ /**
428
+ * If you are rendering this widget to a shadow root inside a web component, set this config to the shadowRoot. If not inside a web component, set it to `document.body`
429
+ */
430
+ rootElement ? : ShadowRoot|HTMLElement
431
+ /**
432
+ * This may be configured as `true` to make the widget's element use the `direction:rtl` style.
433
+ * ...
434
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-rtl)
435
+ */
436
+ rtl ? : boolean
437
+ /**
438
+ * Specifies whether (and optionally in which axes) a Widget may scroll. `true` means this widget may scroll
439
+ * in both axes. May be an object containing boolean `overflowX` and `overflowY` properties which are
440
+ * applied to CSS style properties `overflowX` and `overflowY`. If they are boolean, they are translated to
441
+ * CSS overflow properties thus:
442
+ * ...
443
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-scrollable)
444
+ */
445
+ scrollable ? : boolean|ScrollerConfig|Scroller
446
+ /**
447
+ * Defines what to do if document is scrolled while Widget is visible (only relevant when floating is set to `true`).
448
+ * Valid values: ´null´: do nothing, ´hide´: hide the widget or ´realign´: realign to the target if possible.
449
+ */
450
+ scrollAction ? : 'hide'|'realign'|null
451
+ /**
452
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
453
+ * ...
454
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-showAnimation)
455
+ */
456
+ showAnimation ? : boolean|object
457
+ /**
458
+ * Set to `false` to not show the tooltip when this widget is [disabled](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#property-disabled)
459
+ */
460
+ showTooltipWhenDisabled ? : boolean
461
+ /**
462
+ * Programmatic control over how many columns to span when used in a grid layout.
463
+ */
464
+ span ? : number
465
+ /**
466
+ * Set to `true` to create a split button. A split button has a main action and a dropdown arrow to show a menu.
467
+ * ...
468
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-split)
469
+ */
470
+ split ? : boolean|'mouseover'|'hover'
471
+ /**
472
+ * Set to `true` to perform action on clicking the button if it's already pressed
473
+ * and belongs to a [toggleGroup](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-toggleGroup).
474
+ */
475
+ supportsPressedClick ? : boolean
476
+ /**
477
+ * A configuration for the [tab](https://bryntum.com/products/taskboard/docs/api/Core/widget/Tab) created for this widget when it is placed in a
478
+ * [TabPanel](https://bryntum.com/products/taskboard/docs/api/Core/widget/TabPanel). For example, this config can be used to control the icon of the `tab` for
479
+ * this widget:
480
+ * ...
481
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-tab)
482
+ */
483
+ tab ? : boolean|TabConfig
484
+ /**
485
+ * The tab index of the button, or `null` for natural tab order (recommended). Setting to `0` is equivalent
486
+ * to natural tab order, but is unnecessary for buttons since they are naturally tabbable (i.e., accessible
487
+ * via the TAB key). Setting to `-1` disables tabbability but allows for focus to be set to the element
488
+ * programmatically.
489
+ * ...
490
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-tabIndex)
491
+ */
492
+ tabIndex ? : number
493
+ /**
494
+ * The tag name of this Widget's root element
495
+ */
496
+ tag ? : string
497
+ /**
498
+ * The `target` attribute for the [href](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-href) config
499
+ */
500
+ target ? : string
501
+ /**
502
+ * The button's text. You can also supply a [DomConfig](https://bryntum.com/products/taskboard/docs/api/Core/helper/DomHelper#typedef-DomConfig) or an array of DomConfigs for complex button
503
+ * content.
504
+ */
505
+ text ? : string|DomConfig|DomConfig[]
506
+ /**
507
+ * Text alignment: 'left', 'center' or 'right'. Also accepts direction neutral 'start' and 'end'.
508
+ * ...
509
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-textAlign)
510
+ */
511
+ textAlign ? : 'left'|'center'|'right'|'start'|'end'
512
+ /**
513
+ * A title to display for the widget. Only in effect when inside a container that uses it (such as TabPanel)
514
+ */
515
+ title ? : string
516
+ /**
517
+ * Enabled toggling of the button (stays pressed when pressed).
518
+ */
519
+ toggleable ? : boolean
520
+ /**
521
+ * Indicates that this button is part of a group where only one button can be pressed. Assigning a value
522
+ * also sets `toggleable` to `true`.
523
+ * ...
524
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-toggleGroup)
525
+ */
526
+ toggleGroup ? : string
527
+ /**
528
+ * Tooltip for the widget, either as a string or as a Tooltip config object.
529
+ * ...
530
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-tooltip)
531
+ */
532
+ tooltip ? : string|TooltipConfig|null
533
+ type ? : 'button'
534
+ /**
535
+ * Custom CSS class name suffixes to apply to the elements rendered by this widget. This may be specified
536
+ * as a space separated string, an array of strings, or as an object in which property names with truthy
537
+ * values are used as the class names.
538
+ * ...
539
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-ui)
540
+ */
541
+ ui ? : string|object
542
+ /**
543
+ * A widgets weight determines its position among siblings when added to a [Container](https://bryntum.com/products/taskboard/docs/api/Core/widget/Container).
544
+ * Higher weights go further down.
545
+ */
546
+ weight ? : number
547
+ /**
548
+ * Widget's width, used to set element `style.width`. Either specify a valid width string or a number, which
549
+ * will get 'px' appended. We recommend using CSS as the primary way to control width, but in some cases
550
+ * this config is convenient.
551
+ */
552
+ width ? : string|number
553
+ /**
554
+ * The x position for the widget.
555
+ * ...
556
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-x)
557
+ */
558
+ x ? : number
559
+ /**
560
+ * The y position for the widget.
561
+ * ...
562
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-y)
563
+ */
564
+ y ? : number
565
+
566
+ }
567
+
568
+ @Component({
569
+ selector : 'bryntum-button',
570
+ template : ''
571
+ })
572
+ export class BryntumButtonComponent implements OnInit, OnDestroy {
573
+
574
+ public static instanceClass = Button;
575
+
576
+ public static instanceName = 'Button';
577
+
578
+ private static bryntumEvents: string[] = [
579
+ 'onAction',
580
+ 'onBeforeDestroy',
581
+ 'onBeforeHide',
582
+ 'onBeforeShow',
583
+ 'onBeforeShowMenu',
584
+ 'onBeforeToggle',
585
+ 'onCatchAll',
586
+ 'onClick',
587
+ 'onDestroy',
588
+ 'onElementCreated',
589
+ 'onFocusIn',
590
+ 'onFocusOut',
591
+ 'onHide',
592
+ 'onPaint',
593
+ 'onReadOnly',
594
+ 'onRecompose',
595
+ 'onResize',
596
+ 'onShow',
597
+ 'onToggle'
598
+ ];
599
+
600
+ private static bryntumFeatureNames: string[] = [
601
+
602
+ ];
603
+
604
+ private static bryntumConfigs: string[] = BryntumButtonComponent.bryntumFeatureNames.concat([
605
+ 'adopt',
606
+ 'align',
607
+ 'alignSelf',
608
+ 'anchor',
609
+ 'appendTo',
610
+ 'ariaDescription',
611
+ 'ariaLabel',
612
+ 'badge',
613
+ 'behaviorType',
614
+ 'bubbleEvents',
615
+ 'callOnFunctions',
616
+ 'catchEventHandlerExceptions',
617
+ 'centered',
618
+ 'cls',
619
+ 'color',
620
+ 'column',
621
+ 'config',
622
+ 'constrainTo',
623
+ 'content',
624
+ 'contentElementCls',
625
+ 'dataField',
626
+ 'dataset',
627
+ 'defaultBindProperty',
628
+ 'detectCSSCompatibilityIssues',
629
+ 'disabled',
630
+ 'dock',
631
+ 'draggable',
632
+ 'elementAttributes',
633
+ 'extraData',
634
+ 'flex',
635
+ 'floating',
636
+ 'height',
637
+ 'hidden',
638
+ 'hideAnimation',
639
+ 'href',
640
+ 'html',
641
+ 'htmlCls',
642
+ 'icon',
643
+ 'iconAlign',
644
+ 'id',
645
+ 'ignoreParentReadOnly',
646
+ 'insertBefore',
647
+ 'insertFirst',
648
+ 'keyMap',
649
+ 'listeners',
650
+ 'localeClass',
651
+ 'localizable',
652
+ 'localizableProperties',
653
+ 'margin',
654
+ 'maskDefaults',
655
+ 'masked',
656
+ 'maxHeight',
657
+ 'maximizeOnMobile',
658
+ 'maxWidth',
659
+ 'menu',
660
+ 'menuIcon',
661
+ 'minHeight',
662
+ 'minWidth',
663
+ 'monitorResize',
664
+ 'owner',
665
+ 'positioned',
666
+ 'pressed',
667
+ 'pressedCls',
668
+ 'pressedIcon',
669
+ 'preventTooltipOnTouch',
670
+ 'readOnly',
671
+ 'relayStoreEvents',
672
+ 'rendition',
673
+ 'ripple',
674
+ 'rootElement',
675
+ 'rtl',
676
+ 'scrollable',
677
+ 'scrollAction',
678
+ 'showAnimation',
679
+ 'showTooltipWhenDisabled',
680
+ 'span',
681
+ 'split',
682
+ 'supportsPressedClick',
683
+ 'tab',
684
+ 'tabIndex',
685
+ 'tag',
686
+ 'target',
687
+ 'text',
688
+ 'textAlign',
689
+ 'title',
690
+ 'toggleable',
691
+ 'toggleGroup',
692
+ 'tooltip',
693
+ 'type',
694
+ 'ui',
695
+ 'weight',
696
+ 'width',
697
+ 'x',
698
+ 'y'
699
+ ]);
700
+
701
+ private static bryntumConfigsOnly: string[] = [
702
+ 'adopt',
703
+ 'align',
704
+ 'anchor',
705
+ 'ariaDescription',
706
+ 'ariaLabel',
707
+ 'bubbleEvents',
708
+ 'centered',
709
+ 'color',
710
+ 'config',
711
+ 'constrainTo',
712
+ 'contentElementCls',
713
+ 'dataField',
714
+ 'defaultBindProperty',
715
+ 'detectCSSCompatibilityIssues',
716
+ 'dock',
717
+ 'draggable',
718
+ 'elementAttributes',
719
+ 'floating',
720
+ 'hideAnimation',
721
+ 'htmlCls',
722
+ 'ignoreParentReadOnly',
723
+ 'listeners',
724
+ 'localeClass',
725
+ 'localizable',
726
+ 'localizableProperties',
727
+ 'maskDefaults',
728
+ 'masked',
729
+ 'monitorResize',
730
+ 'owner',
731
+ 'positioned',
732
+ 'preventTooltipOnTouch',
733
+ 'relayStoreEvents',
734
+ 'ripple',
735
+ 'rootElement',
736
+ 'scrollAction',
737
+ 'showAnimation',
738
+ 'showTooltipWhenDisabled',
739
+ 'supportsPressedClick',
740
+ 'tab',
741
+ 'tag',
742
+ 'textAlign',
743
+ 'title',
744
+ 'type',
745
+ 'ui',
746
+ 'weight'
747
+ ];
748
+
749
+ private static bryntumProps: string[] = BryntumButtonComponent.bryntumFeatureNames.concat([
750
+ 'alignSelf',
751
+ 'anchorSize',
752
+ 'appendTo',
753
+ 'badge',
754
+ 'behaviorType',
755
+ 'callOnFunctions',
756
+ 'catchEventHandlerExceptions',
757
+ 'cls',
758
+ 'column',
759
+ 'content',
760
+ 'dataset',
761
+ 'disabled',
762
+ 'extraData',
763
+ 'flex',
764
+ 'focusVisible',
765
+ 'height',
766
+ 'hidden',
767
+ 'href',
768
+ 'html',
769
+ 'icon',
770
+ 'iconAlign',
771
+ 'id',
772
+ 'insertBefore',
773
+ 'insertFirst',
774
+ 'keyMap',
775
+ 'margin',
776
+ 'maxHeight',
777
+ 'maximizeOnMobile',
778
+ 'maxWidth',
779
+ 'menu',
780
+ 'menuIcon',
781
+ 'minHeight',
782
+ 'minWidth',
783
+ 'parent',
784
+ 'pressed',
785
+ 'pressedCls',
786
+ 'pressedIcon',
787
+ 'readOnly',
788
+ 'rendition',
789
+ 'rtl',
790
+ 'scrollable',
791
+ 'span',
792
+ 'split',
793
+ 'tabIndex',
794
+ 'target',
795
+ 'text',
796
+ 'toggleable',
797
+ 'toggleGroup',
798
+ 'tooltip',
799
+ 'width',
800
+ 'x',
801
+ 'y'
802
+ ]);
803
+
804
+ private elementRef: ElementRef;
805
+ public instance!: Button;
806
+
807
+ private bryntumConfig = {
808
+ adopt : undefined,
809
+ appendTo : undefined,
810
+ href : undefined,
811
+ angularComponent : this,
812
+ features : {},
813
+ listeners : {}
814
+ };
815
+
816
+ constructor(element: ElementRef) {
817
+ this.elementRef = element;
818
+ }
819
+
820
+ // Configs only
821
+ @Input() adopt ! : HTMLElement|string;
822
+ @Input() align ! : AlignSpec|string;
823
+ @Input() anchor ! : boolean;
824
+ @Input() ariaDescription ! : string;
825
+ @Input() ariaLabel ! : string;
826
+ @Input() bubbleEvents ! : object;
827
+ @Input() centered ! : boolean;
828
+ @Input() color ! : string;
829
+ @Input() config ! : object;
830
+ @Input() constrainTo ! : HTMLElement|Widget|Rectangle;
831
+ @Input() contentElementCls ! : string|object;
832
+ @Input() dataField ! : string;
833
+ @Input() defaultBindProperty ! : string;
834
+ @Input() detectCSSCompatibilityIssues ! : boolean;
835
+ @Input() dock ! : 'top'|'bottom'|'left'|'right'|'start'|'end'|'header'|'pre-header'|object;
836
+ @Input() draggable ! : boolean|{
837
+ handleSelector?: string
838
+ };
839
+ @Input() elementAttributes ! : Record<string, string|null>;
840
+ @Input() floating ! : boolean;
841
+ @Input() hideAnimation ! : boolean|object;
842
+ @Input() htmlCls ! : string|object;
843
+ @Input() ignoreParentReadOnly ! : boolean;
844
+ @Input() listeners ! : ButtonListeners;
845
+ @Input() localeClass ! : typeof Base;
846
+ @Input() localizable ! : boolean;
847
+ @Input() localizableProperties ! : string[];
848
+ @Input() maskDefaults ! : MaskConfig;
849
+ @Input() masked ! : boolean|string|MaskConfig;
850
+ @Input() monitorResize ! : boolean|{
851
+ immediate?: boolean
852
+ };
853
+ @Input() owner ! : Widget|any;
854
+ @Input() positioned ! : boolean;
855
+ @Input() preventTooltipOnTouch ! : boolean;
856
+ @Input() relayStoreEvents ! : boolean;
857
+ @Input() ripple ! : boolean|{
858
+ delegate?: string
859
+ color?: string
860
+ radius?: number
861
+ clip?: string
862
+ };
863
+ @Input() rootElement ! : ShadowRoot|HTMLElement;
864
+ @Input() scrollAction ! : 'hide'|'realign'|null;
865
+ @Input() showAnimation ! : boolean|object;
866
+ @Input() showTooltipWhenDisabled ! : boolean;
867
+ @Input() supportsPressedClick ! : boolean;
868
+ @Input() tab ! : boolean|TabConfig;
869
+ @Input() tag ! : string;
870
+ @Input() textAlign ! : 'left'|'center'|'right'|'start'|'end';
871
+ @Input() title ! : string;
872
+ @Input() type ! : 'button';
873
+ @Input() ui ! : string|object;
874
+ @Input() weight ! : number;
875
+
876
+ // Configs and properties
877
+ @Input() alignSelf ! : string;
878
+ @Input() appendTo ! : HTMLElement|string;
879
+ @Input() badge ! : string;
880
+ @Input() behaviorType ! : 'button'|'submit'|'reset';
881
+ @Input() callOnFunctions ! : boolean;
882
+ @Input() catchEventHandlerExceptions ! : boolean;
883
+ @Input() cls ! : string|object;
884
+ @Input() column ! : number;
885
+ @Input() content ! : string;
886
+ @Input() dataset ! : object|Record<string, string>;
887
+ @Input() disabled ! : boolean|'inert';
888
+ @Input() extraData ! : any;
889
+ @Input() flex ! : number|string;
890
+ @Input() height ! : number|string;
891
+ @Input() hidden ! : boolean;
892
+ @Input() href ! : string;
893
+ @Input() html ! : string|((widget: Widget) => string)|DomConfig|DomConfig[]|VueConfig;
894
+ @Input() icon ! : string;
895
+ @Input() iconAlign ! : 'start'|'end';
896
+ @Input() id ! : string;
897
+ @Input() insertBefore ! : HTMLElement|string;
898
+ @Input() insertFirst ! : HTMLElement|string;
899
+ @Input() keyMap ! : Record<string, KeyMapConfig>;
900
+ @Input() margin ! : number|string;
901
+ @Input() maxHeight ! : string|number;
902
+ @Input() maximizeOnMobile ! : number|string;
903
+ @Input() maxWidth ! : string|number;
904
+ @Input() menu ! : Widget|Record<string, MenuItemEntry|ContainerItemConfig>|(MenuItemEntry|ContainerItemConfig)[]|MenuConfig|PopupConfig;
905
+ @Input() menuIcon ! : string;
906
+ @Input() minHeight ! : string|number;
907
+ @Input() minWidth ! : string|number;
908
+ @Input() pressed ! : boolean;
909
+ @Input() pressedCls ! : string;
910
+ @Input() pressedIcon ! : string;
911
+ @Input() readOnly ! : boolean;
912
+ @Input() rendition ! : 'elevated'|'filled'|'tonal'|'outlined'|'text'|string;
913
+ @Input() rtl ! : boolean;
914
+ @Input() scrollable ! : Scroller|boolean|ScrollerConfig;
915
+ @Input() span ! : number;
916
+ @Input() split ! : boolean|'mouseover'|'hover';
917
+ @Input() tabIndex ! : number;
918
+ @Input() target ! : string;
919
+ @Input() text ! : string|DomConfig|DomConfig[];
920
+ @Input() toggleable ! : boolean;
921
+ @Input() toggleGroup ! : string;
922
+ @Input() tooltip ! : string|TooltipConfig|null;
923
+ @Input() width ! : number|string;
924
+ @Input() x ! : number;
925
+ @Input() y ! : number;
926
+
927
+ // Properties only
928
+ @Input() anchorSize ! : number[];
929
+ @Input() focusVisible ! : boolean;
930
+ @Input() parent ! : Widget;
931
+
932
+ // Events emitters
933
+ /**
934
+ * Fires when the default action is performed (the button is clicked)
935
+ * @param {object} event Event object
936
+ * @param {Core.widget.Button} event.source The button
937
+ * @param {Event} event.event DEPRECATED - Use domEvent instead.
938
+ * @param {Event} event.domEvent The triggering DOM event. Using the `pointerType` property of this event can help determine if it was a mouse, touch or pen action.
939
+ */
940
+ @Output() onAction: any = new EventEmitter<((event: { source: Button, event: Event, domEvent: Event }) => void)|string>();
941
+ /**
942
+ * Fires before an object is destroyed.
943
+ * @param {object} event Event object
944
+ * @param {Core.Base} event.source The Object that is being destroyed.
945
+ */
946
+ @Output() onBeforeDestroy: any = new EventEmitter<((event: { source: Base }) => void)|string>();
947
+ /**
948
+ * Triggered before a widget is hidden. Return `false` to prevent the action.
949
+ * @param {object} event Event object
950
+ * @param {Core.widget.Widget} event.source The widget being hidden.
951
+ */
952
+ @Output() onBeforeHide: any = new EventEmitter<((event: { source: Widget }) => Promise<boolean>|boolean|void)|string>();
953
+ /**
954
+ * Triggered before a widget is shown. Return `false` to prevent the action.
955
+ * @param {object} event Event object
956
+ * @param {Core.widget.Widget,any} event.source The widget being shown
957
+ */
958
+ @Output() onBeforeShow: any = new EventEmitter<((event: { source: Widget|any }) => Promise<boolean>|boolean|void)|string>();
959
+ /**
960
+ * This event is triggered when the button's menu is about to be shown.
961
+ * @param {object} event Event object
962
+ * @param {Core.widget.Button} event.source This Button instance.
963
+ * @param {Core.widget.Menu} event.menu This button's menu instance.
964
+ * @param {boolean} event.userAction `true` if the toggle was triggered by a user action (click), `false` if it was triggered programmatically.
965
+ * @param {Event} event.domEvent The original DOM event that triggered the action, if any. Using the `pointerType` property of this event can help determine if it was a mouse, touch or pen action.
966
+ */
967
+ @Output() onBeforeShowMenu: any = new EventEmitter<((event: { source: Button, menu: Menu, userAction: boolean, domEvent: Event }) => Promise<boolean>|boolean|void)|string>();
968
+ /**
969
+ * Fires before the button is toggled (the [pressed](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#property-pressed) state is changed). If the button is part of
970
+ * a [toggleGroup](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-toggleGroup) and you need to process the pressed button only, consider using
971
+ * [click](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#event-click) event or [action](#Core/widget/Button#event-action) event.
972
+ * Return `false` to prevent the toggle to the new pressed state.
973
+ * @param {object} event Event object
974
+ * @param {Core.widget.Button} event.source Toggled button
975
+ * @param {boolean} event.pressed New pressed state
976
+ * @param {boolean} event.userAction `true` if the toggle was triggered by a user action (click), `false` if it was triggered programmatically.
977
+ * @param {Event} event.domEvent The original DOM event that triggered the action, if any. Using the `pointerType` property of this event can help determine if it was a mouse, touch or pen action.
978
+ */
979
+ @Output() onBeforeToggle: any = new EventEmitter<((event: { source: Button, pressed: boolean, userAction: boolean, domEvent: Event }) => Promise<boolean>|boolean|void)|string>();
980
+ /**
981
+ * Fires when any other event is fired from the object.
982
+ * ...
983
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#event-catchAll)
984
+ * @param {object} event Event object
985
+ * @param {{[key: string]: any, type: string}} event.event The Object that contains event details
986
+ * @param {string} event.event.type The type of the event which is caught by the listener
987
+ */
988
+ @Output() onCatchAll: any = new EventEmitter<((event: {[key: string]: any, type: string}) => void)|string>();
989
+ /**
990
+ * Fires when the button is clicked
991
+ * @param {object} event Event object
992
+ * @param {Core.widget.Button} event.source The button
993
+ * @param {Event} event.event DEPRECATED - Use domEvent instead.
994
+ * @param {Event} event.domEvent The triggering DOM event. Using the `pointerType` property of this event can help determine if it was a mouse, touch or pen action.
995
+ */
996
+ @Output() onClick: any = new EventEmitter<((event: { source: Button, event: Event, domEvent: Event }) => void)|string>();
997
+ /**
998
+ * Fires when an object is destroyed.
999
+ * @param {object} event Event object
1000
+ * @param {Core.Base} event.source The Object that is being destroyed.
1001
+ */
1002
+ @Output() onDestroy: any = new EventEmitter<((event: { source: Base }) => void)|string>();
1003
+ /**
1004
+ * Triggered when a widget's [element](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#property-element) is available.
1005
+ * @param {object} event Event object
1006
+ * @param {HTMLElement} event.element The Widget's element.
1007
+ */
1008
+ @Output() onElementCreated: any = new EventEmitter<((event: { element: HTMLElement }) => void)|string>();
1009
+ /**
1010
+ * Fired when focus enters this Widget.
1011
+ * @param {object} event Event object
1012
+ * @param {Core.widget.Widget} event.source This Widget
1013
+ * @param {HTMLElement} event.fromElement The element which lost focus.
1014
+ * @param {HTMLElement} event.toElement The element which gained focus.
1015
+ * @param {Core.widget.Widget} event.fromWidget The widget which lost focus.
1016
+ * @param {Core.widget.Widget} event.toWidget The widget which gained focus.
1017
+ * @param {boolean} event.backwards `true` if the `toElement` is before the `fromElement` in document order.
1018
+ */
1019
+ @Output() onFocusIn: any = new EventEmitter<((event: { source: Widget, fromElement: HTMLElement, toElement: HTMLElement, fromWidget: Widget, toWidget: Widget, backwards: boolean }) => void)|string>();
1020
+ /**
1021
+ * Fired when focus exits this Widget's ownership tree. This is different from a `blur` event.
1022
+ * focus moving from within this Widget's ownership tree, even if there are floating widgets
1023
+ * will not trigger this event. This is when focus exits this widget completely.
1024
+ * @param {object} event Event object
1025
+ * @param {Core.widget.Widget} event.source This Widget
1026
+ * @param {HTMLElement} event.fromElement The element which lost focus.
1027
+ * @param {HTMLElement} event.toElement The element which gained focus.
1028
+ * @param {Core.widget.Widget} event.fromWidget The widget which lost focus.
1029
+ * @param {Core.widget.Widget} event.toWidget The widget which gained focus.
1030
+ * @param {boolean} event.backwards `true` if the `toElement` is before the `fromElement` in document order.
1031
+ */
1032
+ @Output() onFocusOut: any = new EventEmitter<((event: { source: Widget, fromElement: HTMLElement, toElement: HTMLElement, fromWidget: Widget, toWidget: Widget, backwards: boolean }) => void)|string>();
1033
+ /**
1034
+ * Triggered after a widget was hidden
1035
+ * @param {object} event Event object
1036
+ * @param {Core.widget.Widget} event.source The widget
1037
+ */
1038
+ @Output() onHide: any = new EventEmitter<((event: { source: Widget }) => void)|string>();
1039
+ /**
1040
+ * Triggered when a widget which had been in a non-visible state for any reason
1041
+ * achieves visibility.
1042
+ * ...
1043
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#event-paint)
1044
+ * @param {object} event Event object
1045
+ * @param {Core.widget.Widget} event.source The widget being painted.
1046
+ * @param {boolean} event.firstPaint `true` if this is the first paint.
1047
+ */
1048
+ @Output() onPaint: any = new EventEmitter<((event: { source: Widget, firstPaint: boolean }) => void)|string>();
1049
+ /**
1050
+ * Fired when a Widget's read only state is toggled
1051
+ * @param {object} event Event object
1052
+ * @param {boolean} event.readOnly Read only or not
1053
+ */
1054
+ @Output() onReadOnly: any = new EventEmitter<((event: { readOnly: boolean }) => void)|string>();
1055
+ /**
1056
+ * This event is fired after a widget's elements have been synchronized due to a direct or indirect call
1057
+ * to [recompose](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#function-recompose), if this results in some change to the widget's rendered DOM elements.
1058
+ */
1059
+ @Output() onRecompose: any = new EventEmitter<(() => void)|string>();
1060
+ /**
1061
+ * Fired when the encapsulating element of a Widget resizes *only when [monitorResize](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-monitorResize) is `true`*.
1062
+ * @param {object} event Event object
1063
+ * @param {Core.widget.Widget} event.source This Widget
1064
+ * @param {number} event.width The new width
1065
+ * @param {number} event.height The new height
1066
+ * @param {number} event.oldWidth The old width
1067
+ * @param {number} event.oldHeight The old height
1068
+ */
1069
+ @Output() onResize: any = new EventEmitter<((event: { source: Widget, width: number, height: number, oldWidth: number, oldHeight: number }) => void)|string>();
1070
+ /**
1071
+ * Triggered after a widget is shown.
1072
+ * @param {object} event Event object
1073
+ * @param {Core.widget.Widget} event.source The widget
1074
+ */
1075
+ @Output() onShow: any = new EventEmitter<((event: { source: Widget }) => void)|string>();
1076
+ /**
1077
+ * Fires when the button is toggled via a UI interaction (the [pressed](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#property-pressed) state is changed). If the button is part of a
1078
+ * [toggleGroup](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#config-toggleGroup) and you need to process the pressed button only, consider using
1079
+ * [click](https://bryntum.com/products/taskboard/docs/api/Core/widget/Button#event-click) event or [action](#Core/widget/Button#event-action) event.
1080
+ * @param {object} event Event object
1081
+ * @param {Core.widget.Button} event.source Toggled button
1082
+ * @param {boolean} event.pressed New pressed state
1083
+ * @param {boolean} event.userAction `true` if the toggle was triggered by a user action (click), `false` if it was triggered programmatically.
1084
+ * @param {Event} event.domEvent The original DOM event that triggered the action, if any. Using the `pointerType` property of this event can help determine if it was a mouse, touch or pen action.
1085
+ */
1086
+ @Output() onToggle: any = new EventEmitter<((event: { source: Button, pressed: boolean, userAction: boolean, domEvent: Event }) => void)|string>();
1087
+
1088
+ /**
1089
+ * Create and append the underlying widget
1090
+ */
1091
+ ngOnInit(): void {
1092
+ const
1093
+ me = this,
1094
+ {
1095
+ elementRef,
1096
+ bryntumConfig
1097
+ } = me,
1098
+ {
1099
+ instanceClass,
1100
+ instanceName,
1101
+ bryntumConfigs,
1102
+ bryntumEvents
1103
+ } = BryntumButtonComponent;
1104
+
1105
+ bryntumConfigs.filter(prop => prop in this).forEach(prop => {
1106
+ // @ts-ignore
1107
+ WrapperHelper.applyPropValue(bryntumConfig, prop, this[prop]);
1108
+ if (['features', 'config'].includes(prop)) {
1109
+ WrapperHelper.devWarningConfigProp(instanceName, prop);
1110
+ }
1111
+ });
1112
+ // @ts-ignore
1113
+ bryntumEvents.filter(event => this[event] && this[event].observers.length > 0).forEach(event => {
1114
+ const
1115
+ uncapitalize = (str: string) => str.charAt(0).toLowerCase() + str.slice(1),
1116
+ eventName = (str: string) => uncapitalize(str.slice(2));
1117
+
1118
+ // @ts-ignore
1119
+ bryntumConfig.listeners[eventName(event)] = e => {
1120
+ // @ts-ignore
1121
+ me[event].emit(e);
1122
+ // EventEmitter does not return values in the normal way, work around it by setting `returnValue` flag
1123
+ // in Angular listeners
1124
+ return e.returnValue;
1125
+ };
1126
+ });
1127
+
1128
+ // If component has no container specified in config then use adopt to Wrapper's element
1129
+ const
1130
+ containerParam = [
1131
+ 'adopt',
1132
+ 'appendTo',
1133
+ 'insertAfter',
1134
+ 'insertBefore'
1135
+ // @ts-ignore
1136
+ ].find(prop => bryntumConfig[prop]);
1137
+ if (!containerParam) {
1138
+ if (instanceName === 'Button' || elementRef.nativeElement.getRootNode() instanceof ShadowRoot) {
1139
+ // Button should always be <a> or <button> inside owner element
1140
+ bryntumConfig.appendTo = elementRef.nativeElement;
1141
+ }
1142
+ else {
1143
+ bryntumConfig.adopt = elementRef.nativeElement;
1144
+ }
1145
+ }
1146
+ else {
1147
+ WrapperHelper.devWarningContainer(instanceName, containerParam);
1148
+ }
1149
+
1150
+ // @ts-ignore
1151
+ me.instance = instanceName === 'Widget' ? Widget.create(bryntumConfig) : new instanceClass(bryntumConfig);
1152
+
1153
+ }
1154
+
1155
+ /**
1156
+ * Watch for changes
1157
+ * @param changes
1158
+ */
1159
+ ngOnChanges(changes: SimpleChanges): void {
1160
+ const
1161
+ { instance } = this,
1162
+ { instanceName } = BryntumButtonComponent;
1163
+ if (!instance) {
1164
+ return;
1165
+ }
1166
+ // Iterate over all changes
1167
+ Object.entries(changes).forEach(([prop, change]) => {
1168
+ const
1169
+ newValue = (change as SimpleChange).currentValue,
1170
+ { instance } = this,
1171
+ { bryntumConfigsOnly, bryntumProps } = BryntumButtonComponent;
1172
+ if (bryntumProps.includes(prop)) {
1173
+ WrapperHelper.applyPropValue(instance, prop, newValue, false);
1174
+ if (bryntumConfigsOnly.includes(prop)) {
1175
+ WrapperHelper.devWarningUpdateProp(instanceName, prop);
1176
+ }
1177
+ }
1178
+ });
1179
+ }
1180
+
1181
+ /**
1182
+ * Destroy the component
1183
+ */
1184
+ ngOnDestroy(): void {
1185
+ // @ts-ignore
1186
+ if (this.instance && this.instance.destroy) {
1187
+ this.instance.destroy();
1188
+ }
1189
+ }
1190
+ }