@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,982 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /**
3
+ * Angular wrapper for Bryntum Widget
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, DomConfig, KeyMapConfig, MaskConfig, Rectangle, Scroller, ScrollerConfig, TabConfig, TooltipConfig, VueConfig, Widget, WidgetListeners } from '@bryntum/taskboard';
11
+
12
+ import { StringHelper } from '@bryntum/taskboard';
13
+
14
+ export type BryntumWidgetProps = {
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/Widget#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/Widget#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/Widget#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/Widget#config-ariaLabel)
57
+ */
58
+ ariaLabel ? : string
59
+ /**
60
+ * An object where property names with a truthy value indicate which events should bubble up the ownership
61
+ * hierarchy when triggered.
62
+ * ...
63
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-bubbleEvents)
64
+ */
65
+ bubbleEvents ? : object
66
+ /**
67
+ * Set to `false` to not call onXXX method names (e.g. `onShow`, `onClick`), as an easy way to listen for events.
68
+ * ...
69
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-callOnFunctions)
70
+ */
71
+ callOnFunctions ? : boolean
72
+ /**
73
+ * By default, if an event handler throws an exception, the error propagates up the stack and the
74
+ * application state is undefined. Code which follows the event handler will *not* be executed.
75
+ * ...
76
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-catchEventHandlerExceptions)
77
+ */
78
+ catchEventHandlerExceptions ? : boolean
79
+ /**
80
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
81
+ * Set to `true` to centre the Widget in browser viewport space.
82
+ */
83
+ centered ? : boolean
84
+ /**
85
+ * Custom CSS classes to add to element.
86
+ * May be specified as a space separated string, or as an object in which property names
87
+ * with truthy values are used as the class names:
88
+ * ...
89
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-cls)
90
+ */
91
+ cls ? : string|object
92
+ /**
93
+ * Applies the specified color to the widget, by setting the `--b-primary` CSS variable in the widgets
94
+ * `style` block.
95
+ * ...
96
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-color)
97
+ */
98
+ color ? : string
99
+ /**
100
+ * Programmatic control over which column to start in when used in a grid layout.
101
+ */
102
+ column ? : number
103
+ config ? : object
104
+ /**
105
+ * *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).*
106
+ * Element, Widget or Rectangle to which this Widget is constrained.
107
+ */
108
+ constrainTo ? : HTMLElement|Widget|Rectangle
109
+ /**
110
+ * The HTML content that coexists with sibling elements which may have been added to the
111
+ * [contentElement](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#property-contentElement) by plugins and features.
112
+ * When specifying html, this widget's element will also have the [htmlCls](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-htmlCls)
113
+ * class added to its classList, to allow targeted styling.
114
+ */
115
+ content ? : string
116
+ /**
117
+ * Custom CSS classes to add to the [contentElement](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#property-contentElement).
118
+ * May be specified as a space separated string, or as an object in which property names
119
+ * with truthy values are used as the class names:
120
+ * ...
121
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-contentElementCls)
122
+ */
123
+ contentElementCls ? : string|object
124
+ /**
125
+ * When this Widget configuration is used in the Grid's RowExpander feature's `widget` config, provide the
126
+ * field on the expanded record to use for populating this widget's store (if applicable)
127
+ */
128
+ dataField ? : string
129
+ /**
130
+ * Object to apply to elements dataset (each key will be used as a data-attribute on the element)
131
+ */
132
+ dataset ? : Record<string, string>
133
+ /**
134
+ * The name of the property to set when a single value is to be applied to this Widget. Such as when used
135
+ * in a grid WidgetColumn, this is the property to which the column's `field` is applied.
136
+ */
137
+ defaultBindProperty ? : string
138
+ /**
139
+ * Check for CSS compatibility issues when upgrading to v7. Performs the following checks:
140
+ * ...
141
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-detectCSSCompatibilityIssues)
142
+ */
143
+ detectCSSCompatibilityIssues ? : boolean
144
+ /**
145
+ * 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
146
+ * cannot be focused, uses a different rendition (usually greyish) and does not allow selecting its value.
147
+ * ...
148
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-disabled)
149
+ */
150
+ disabled ? : boolean|'inert'
151
+ /**
152
+ * Controls the placement of this widget when it is added to a [panel's ](https://bryntum.com/products/taskboard/docs/api/Core/widget/Panel)
153
+ * [strips collection](https://bryntum.com/products/taskboard/docs/api/Core/widget/Panel#config-strips). Typical values for this config are `'top'`,
154
+ * `'bottom'`, `'left'`, or `'right'`, which cause the widget to be placed on that side of the panel's
155
+ * body. Such widgets are called "edge strips".
156
+ * ...
157
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-dock)
158
+ */
159
+ dock ? : 'top'|'bottom'|'left'|'right'|'start'|'end'|'header'|'pre-header'|object
160
+ /**
161
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
162
+ * Set to `true` to be able to drag a widget freely on the page. Or set to an object with a ´handleSelector´
163
+ * property which controls when a drag should start.
164
+ * ...
165
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-draggable)
166
+ */
167
+ draggable ? : boolean|{
168
+ handleSelector?: string
169
+ }
170
+ /**
171
+ * An object specifying attributes to assign to the root element of this widget.
172
+ * Set `null` value to attribute to remove it.
173
+ * ...
174
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-elementAttributes)
175
+ */
176
+ elementAttributes ? : Record<string, string|null>
177
+ extraData ? : any
178
+ /**
179
+ * 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
180
+ * flexbox layout. This config allows you to set this widget's
181
+ * [flex](https://developer.mozilla.org/en-US/docs/Web/CSS/flex) style.
182
+ * This may be configured as a single number or a `&lt;flex-grow&gt; &lt;flex-shrink&gt; &lt;flex-basis&gt;` format string.
183
+ * numeric-only values are interpreted as the `flex-grow` value.
184
+ */
185
+ flex ? : number|string
186
+ /**
187
+ * Set to `true` to move the widget out of the document flow and position it
188
+ * absolutely in browser viewport space.
189
+ */
190
+ floating ? : boolean
191
+ /**
192
+ * Widget's height, used to set element `style.height`. Either specify a valid height string or a number,
193
+ * which will get 'px' appended. We recommend using CSS as the primary way to control height, but in some
194
+ * cases this config is convenient.
195
+ */
196
+ height ? : string|number
197
+ /**
198
+ * Configure with true to make widget initially hidden.
199
+ */
200
+ hidden ? : boolean
201
+ /**
202
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
203
+ * ...
204
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-hideAnimation)
205
+ */
206
+ hideAnimation ? : boolean|object
207
+ /**
208
+ * The HTML to display initially or a function returning the markup (called at widget construction time).
209
+ * ...
210
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-html)
211
+ * @param {Core.widget.Widget} widget The calling Widget
212
+ * @returns {string}
213
+ */
214
+ html ? : string|((widget: Widget) => string)|DomConfig|DomConfig[]|VueConfig
215
+ /**
216
+ * The CSS class(es) to add when HTML content is being applied to this widget.
217
+ */
218
+ htmlCls ? : string|object
219
+ /**
220
+ * Widget id, if not specified one will be generated. Also used for lookups through Widget.getById
221
+ */
222
+ id ? : string
223
+ /**
224
+ * Determines if the widgets read-only state should be controlled by its parent.
225
+ * ...
226
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-ignoreParentReadOnly)
227
+ */
228
+ ignoreParentReadOnly ? : boolean
229
+ /**
230
+ * 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.
231
+ */
232
+ insertBefore ? : HTMLElement|string
233
+ /**
234
+ * 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.
235
+ */
236
+ insertFirst ? : HTMLElement|string
237
+ /**
238
+ * An object whose keys are the [key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) name
239
+ * and optional modifier prefixes: `'Ctrl+'`, `'Alt+'`, `'Meta+'`, and `'Shift+'` (case-insensitive). The values
240
+ * are the name of the instance method to call when the keystroke is received.
241
+ * ...
242
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-keyMap)
243
+ */
244
+ keyMap ? : Record<string, KeyMapConfig>
245
+ /**
246
+ * The listener set for this object.
247
+ * ...
248
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-listeners)
249
+ */
250
+ listeners ? : WidgetListeners
251
+ /**
252
+ * A class translations of which are used for translating this entity.
253
+ * This is often used when translations of an item are defined on its container class.
254
+ * For example:
255
+ * ...
256
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-localeClass)
257
+ */
258
+ localeClass ? : typeof Base
259
+ /**
260
+ * Set to `false` to disable localization of this object.
261
+ */
262
+ localizable ? : boolean
263
+ /**
264
+ * List of properties which values should be translated automatically upon a locale applying.
265
+ * In case there is a need to localize not typical value (not a String value or a field with re-defined setter/getter),
266
+ * you could use 'localeKey' meta configuration.
267
+ * Example:
268
+ * ...
269
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-localizableProperties)
270
+ */
271
+ localizableProperties ? : string[]
272
+ /**
273
+ * Widget's margin. This may be configured as a single number or a `TRBL` format string.
274
+ * numeric-only values are interpreted as pixels.
275
+ */
276
+ margin ? : number|string
277
+ /**
278
+ * This config object contains the defaults for the [Mask](https://bryntum.com/products/taskboard/docs/api/Core/widget/Mask) created for the
279
+ * [masked](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-masked) config. Any properties specified in the `masked` config will override these
280
+ * values.
281
+ */
282
+ maskDefaults ? : MaskConfig
283
+ /**
284
+ * Set to `true` to apply the default mask to the widget. Alternatively, this can be the mask message or a
285
+ * [Mask](https://bryntum.com/products/taskboard/docs/api/Core/widget/Mask) config object.
286
+ */
287
+ masked ? : boolean|string|MaskConfig
288
+ /**
289
+ * The element's maxHeight. Can be either a String or a Number (which will have 'px' appended). Note that
290
+ * like [height](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-height), *reading* the value will return the numeric value in pixels.
291
+ */
292
+ maxHeight ? : string|number
293
+ /**
294
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
295
+ * ...
296
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-maximizeOnMobile)
297
+ */
298
+ maximizeOnMobile ? : number|string
299
+ /**
300
+ * The elements maxWidth. Can be either a String or a Number (which will have 'px' appended). Note that
301
+ * like [width](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-width), *reading* the value will return the numeric value in pixels.
302
+ */
303
+ maxWidth ? : string|number
304
+ /**
305
+ * The element's minHeight. Can be either a String or a Number (which will have 'px' appended). Note that
306
+ * like [height](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-height), *reading* the value will return the numeric value in pixels.
307
+ */
308
+ minHeight ? : string|number
309
+ /**
310
+ * The elements minWidth. Can be either a String or a Number (which will have 'px' appended). Note that
311
+ * like [width](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-width), *reading* the value will return the numeric value in pixels.
312
+ */
313
+ minWidth ? : string|number
314
+ /**
315
+ * When this is configured as `true` a [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)
316
+ * is used to monitor this element for size changes caused by either style manipulation, or by CSS
317
+ * layout.
318
+ * ...
319
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-monitorResize)
320
+ */
321
+ monitorResize ? : boolean|{
322
+ immediate?: boolean
323
+ }
324
+ /**
325
+ * The owning Widget of this Widget. If this Widget is directly contained (that is, it is one of the
326
+ * [items](https://bryntum.com/products/taskboard/docs/api/Core/widget/Container#property-items) of a Container), this config will be ignored. In this case
327
+ * the owner is <strong>always</strong> the encapsulating Container.
328
+ * ...
329
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-owner)
330
+ */
331
+ owner ? : Widget|any
332
+ /**
333
+ * 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
334
+ * not participate in the standard layout of that widget, and must be positioned relatively to that
335
+ * widget's [contentElement](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#property-contentElement).
336
+ * ...
337
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-positioned)
338
+ */
339
+ positioned ? : boolean
340
+ /**
341
+ * Prevent tooltip from being displayed on touch devices. Useful for example for buttons that display a
342
+ * menu on click etc, since the tooltip would be displayed at the same time.
343
+ */
344
+ preventTooltipOnTouch ? : boolean
345
+ /**
346
+ * Whether this widget is read-only. This is only valid if the widget is an input
347
+ * field, <strong>or contains input fields at any depth</strong>.
348
+ * ...
349
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-readOnly)
350
+ */
351
+ readOnly ? : boolean
352
+ relayStoreEvents ? : boolean
353
+ /**
354
+ * Configure as `true` to have the component display a translucent ripple when its
355
+ * [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
356
+ * current theme supports ripples</em>. Out of the box, only the Material theme supports ripples.
357
+ * ...
358
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-ripple)
359
+ */
360
+ ripple ? : boolean|{
361
+ delegate?: string
362
+ color?: string
363
+ radius?: number
364
+ clip?: string
365
+ }
366
+ /**
367
+ * 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`
368
+ */
369
+ rootElement ? : ShadowRoot|HTMLElement
370
+ /**
371
+ * This may be configured as `true` to make the widget's element use the `direction:rtl` style.
372
+ * ...
373
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-rtl)
374
+ */
375
+ rtl ? : boolean
376
+ /**
377
+ * Specifies whether (and optionally in which axes) a Widget may scroll. `true` means this widget may scroll
378
+ * in both axes. May be an object containing boolean `overflowX` and `overflowY` properties which are
379
+ * applied to CSS style properties `overflowX` and `overflowY`. If they are boolean, they are translated to
380
+ * CSS overflow properties thus:
381
+ * ...
382
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-scrollable)
383
+ */
384
+ scrollable ? : boolean|ScrollerConfig|Scroller
385
+ /**
386
+ * Defines what to do if document is scrolled while Widget is visible (only relevant when floating is set to `true`).
387
+ * Valid values: ´null´: do nothing, ´hide´: hide the widget or ´realign´: realign to the target if possible.
388
+ */
389
+ scrollAction ? : 'hide'|'realign'|null
390
+ /**
391
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
392
+ * ...
393
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-showAnimation)
394
+ */
395
+ showAnimation ? : boolean|object
396
+ /**
397
+ * 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)
398
+ */
399
+ showTooltipWhenDisabled ? : boolean
400
+ /**
401
+ * Programmatic control over how many columns to span when used in a grid layout.
402
+ */
403
+ span ? : number
404
+ /**
405
+ * 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
406
+ * [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
407
+ * this widget:
408
+ * ...
409
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-tab)
410
+ */
411
+ tab ? : boolean|TabConfig
412
+ /**
413
+ * The tag name of this Widget's root element
414
+ */
415
+ tag ? : string
416
+ /**
417
+ * Text alignment: 'left', 'center' or 'right'. Also accepts direction neutral 'start' and 'end'.
418
+ * ...
419
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-textAlign)
420
+ */
421
+ textAlign ? : 'left'|'center'|'right'|'start'|'end'
422
+ /**
423
+ * A title to display for the widget. Only in effect when inside a container that uses it (such as TabPanel)
424
+ */
425
+ title ? : string
426
+ /**
427
+ * Tooltip for the widget, either as a string or as a Tooltip config object.
428
+ * ...
429
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-tooltip)
430
+ */
431
+ tooltip ? : string|TooltipConfig|null
432
+ type ? : 'widget'
433
+ /**
434
+ * Custom CSS class name suffixes to apply to the elements rendered by this widget. This may be specified
435
+ * as a space separated string, an array of strings, or as an object in which property names with truthy
436
+ * values are used as the class names.
437
+ * ...
438
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-ui)
439
+ */
440
+ ui ? : string|object
441
+ /**
442
+ * A widgets weight determines its position among siblings when added to a [Container](https://bryntum.com/products/taskboard/docs/api/Core/widget/Container).
443
+ * Higher weights go further down.
444
+ */
445
+ weight ? : number
446
+ /**
447
+ * Widget's width, used to set element `style.width`. Either specify a valid width string or a number, which
448
+ * will get 'px' appended. We recommend using CSS as the primary way to control width, but in some cases
449
+ * this config is convenient.
450
+ */
451
+ width ? : string|number
452
+ /**
453
+ * The x position for the widget.
454
+ * ...
455
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-x)
456
+ */
457
+ x ? : number
458
+ /**
459
+ * The y position for the widget.
460
+ * ...
461
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-y)
462
+ */
463
+ y ? : number
464
+
465
+ }
466
+
467
+ @Component({
468
+ selector : 'bryntum-widget',
469
+ template : ''
470
+ })
471
+ export class BryntumWidgetComponent implements OnInit, OnDestroy {
472
+
473
+ public static instanceClass = Widget;
474
+
475
+ public static instanceName = 'Widget';
476
+
477
+ private static bryntumEvents: string[] = [
478
+ 'onBeforeDestroy',
479
+ 'onBeforeHide',
480
+ 'onBeforeShow',
481
+ 'onCatchAll',
482
+ 'onDestroy',
483
+ 'onElementCreated',
484
+ 'onFocusIn',
485
+ 'onFocusOut',
486
+ 'onHide',
487
+ 'onPaint',
488
+ 'onReadOnly',
489
+ 'onRecompose',
490
+ 'onResize',
491
+ 'onShow'
492
+ ];
493
+
494
+ private static bryntumFeatureNames: string[] = [
495
+
496
+ ];
497
+
498
+ private static bryntumConfigs: string[] = BryntumWidgetComponent.bryntumFeatureNames.concat([
499
+ 'adopt',
500
+ 'align',
501
+ 'alignSelf',
502
+ 'anchor',
503
+ 'appendTo',
504
+ 'ariaDescription',
505
+ 'ariaLabel',
506
+ 'bubbleEvents',
507
+ 'callOnFunctions',
508
+ 'catchEventHandlerExceptions',
509
+ 'centered',
510
+ 'cls',
511
+ 'color',
512
+ 'column',
513
+ 'config',
514
+ 'constrainTo',
515
+ 'content',
516
+ 'contentElementCls',
517
+ 'dataField',
518
+ 'dataset',
519
+ 'defaultBindProperty',
520
+ 'detectCSSCompatibilityIssues',
521
+ 'disabled',
522
+ 'dock',
523
+ 'draggable',
524
+ 'elementAttributes',
525
+ 'extraData',
526
+ 'flex',
527
+ 'floating',
528
+ 'height',
529
+ 'hidden',
530
+ 'hideAnimation',
531
+ 'html',
532
+ 'htmlCls',
533
+ 'id',
534
+ 'ignoreParentReadOnly',
535
+ 'insertBefore',
536
+ 'insertFirst',
537
+ 'keyMap',
538
+ 'listeners',
539
+ 'localeClass',
540
+ 'localizable',
541
+ 'localizableProperties',
542
+ 'margin',
543
+ 'maskDefaults',
544
+ 'masked',
545
+ 'maxHeight',
546
+ 'maximizeOnMobile',
547
+ 'maxWidth',
548
+ 'minHeight',
549
+ 'minWidth',
550
+ 'monitorResize',
551
+ 'owner',
552
+ 'positioned',
553
+ 'preventTooltipOnTouch',
554
+ 'readOnly',
555
+ 'relayStoreEvents',
556
+ 'ripple',
557
+ 'rootElement',
558
+ 'rtl',
559
+ 'scrollable',
560
+ 'scrollAction',
561
+ 'showAnimation',
562
+ 'showTooltipWhenDisabled',
563
+ 'span',
564
+ 'tab',
565
+ 'tag',
566
+ 'textAlign',
567
+ 'title',
568
+ 'tooltip',
569
+ 'type',
570
+ 'ui',
571
+ 'weight',
572
+ 'width',
573
+ 'x',
574
+ 'y'
575
+ ]);
576
+
577
+ private static bryntumConfigsOnly: string[] = [
578
+ 'adopt',
579
+ 'align',
580
+ 'anchor',
581
+ 'ariaDescription',
582
+ 'ariaLabel',
583
+ 'bubbleEvents',
584
+ 'centered',
585
+ 'color',
586
+ 'config',
587
+ 'constrainTo',
588
+ 'contentElementCls',
589
+ 'dataField',
590
+ 'defaultBindProperty',
591
+ 'detectCSSCompatibilityIssues',
592
+ 'dock',
593
+ 'draggable',
594
+ 'elementAttributes',
595
+ 'floating',
596
+ 'hideAnimation',
597
+ 'htmlCls',
598
+ 'ignoreParentReadOnly',
599
+ 'listeners',
600
+ 'localeClass',
601
+ 'localizable',
602
+ 'localizableProperties',
603
+ 'maskDefaults',
604
+ 'masked',
605
+ 'monitorResize',
606
+ 'owner',
607
+ 'positioned',
608
+ 'preventTooltipOnTouch',
609
+ 'relayStoreEvents',
610
+ 'ripple',
611
+ 'rootElement',
612
+ 'scrollAction',
613
+ 'showAnimation',
614
+ 'showTooltipWhenDisabled',
615
+ 'tab',
616
+ 'tag',
617
+ 'textAlign',
618
+ 'title',
619
+ 'type',
620
+ 'ui',
621
+ 'weight'
622
+ ];
623
+
624
+ private static bryntumProps: string[] = BryntumWidgetComponent.bryntumFeatureNames.concat([
625
+ 'alignSelf',
626
+ 'anchorSize',
627
+ 'appendTo',
628
+ 'callOnFunctions',
629
+ 'catchEventHandlerExceptions',
630
+ 'cls',
631
+ 'column',
632
+ 'content',
633
+ 'dataset',
634
+ 'disabled',
635
+ 'extraData',
636
+ 'flex',
637
+ 'focusVisible',
638
+ 'height',
639
+ 'hidden',
640
+ 'html',
641
+ 'id',
642
+ 'insertBefore',
643
+ 'insertFirst',
644
+ 'keyMap',
645
+ 'margin',
646
+ 'maxHeight',
647
+ 'maximizeOnMobile',
648
+ 'maxWidth',
649
+ 'minHeight',
650
+ 'minWidth',
651
+ 'parent',
652
+ 'readOnly',
653
+ 'rtl',
654
+ 'scrollable',
655
+ 'span',
656
+ 'tooltip',
657
+ 'width',
658
+ 'x',
659
+ 'y'
660
+ ]);
661
+
662
+ private elementRef: ElementRef;
663
+ public instance!: Widget;
664
+
665
+ private bryntumConfig = {
666
+ adopt : undefined,
667
+ appendTo : undefined,
668
+ href : undefined,
669
+ angularComponent : this,
670
+ features : {},
671
+ listeners : {}
672
+ };
673
+
674
+ constructor(element: ElementRef) {
675
+ this.elementRef = element;
676
+ }
677
+
678
+ // Configs only
679
+ @Input() adopt ! : HTMLElement|string;
680
+ @Input() align ! : AlignSpec|string;
681
+ @Input() anchor ! : boolean;
682
+ @Input() ariaDescription ! : string;
683
+ @Input() ariaLabel ! : string;
684
+ @Input() bubbleEvents ! : object;
685
+ @Input() centered ! : boolean;
686
+ @Input() color ! : string;
687
+ @Input() config ! : object;
688
+ @Input() constrainTo ! : HTMLElement|Widget|Rectangle;
689
+ @Input() contentElementCls ! : string|object;
690
+ @Input() dataField ! : string;
691
+ @Input() defaultBindProperty ! : string;
692
+ @Input() detectCSSCompatibilityIssues ! : boolean;
693
+ @Input() dock ! : 'top'|'bottom'|'left'|'right'|'start'|'end'|'header'|'pre-header'|object;
694
+ @Input() draggable ! : boolean|{
695
+ handleSelector?: string
696
+ };
697
+ @Input() elementAttributes ! : Record<string, string|null>;
698
+ @Input() floating ! : boolean;
699
+ @Input() hideAnimation ! : boolean|object;
700
+ @Input() htmlCls ! : string|object;
701
+ @Input() ignoreParentReadOnly ! : boolean;
702
+ @Input() listeners ! : WidgetListeners;
703
+ @Input() localeClass ! : typeof Base;
704
+ @Input() localizable ! : boolean;
705
+ @Input() localizableProperties ! : string[];
706
+ @Input() maskDefaults ! : MaskConfig;
707
+ @Input() masked ! : boolean|string|MaskConfig;
708
+ @Input() monitorResize ! : boolean|{
709
+ immediate?: boolean
710
+ };
711
+ @Input() owner ! : Widget|any;
712
+ @Input() positioned ! : boolean;
713
+ @Input() preventTooltipOnTouch ! : boolean;
714
+ @Input() relayStoreEvents ! : boolean;
715
+ @Input() ripple ! : boolean|{
716
+ delegate?: string
717
+ color?: string
718
+ radius?: number
719
+ clip?: string
720
+ };
721
+ @Input() rootElement ! : ShadowRoot|HTMLElement;
722
+ @Input() scrollAction ! : 'hide'|'realign'|null;
723
+ @Input() showAnimation ! : boolean|object;
724
+ @Input() showTooltipWhenDisabled ! : boolean;
725
+ @Input() tab ! : boolean|TabConfig;
726
+ @Input() tag ! : string;
727
+ @Input() textAlign ! : 'left'|'center'|'right'|'start'|'end';
728
+ @Input() title ! : string;
729
+ @Input() type ! : 'widget';
730
+ @Input() ui ! : string|object;
731
+ @Input() weight ! : number;
732
+
733
+ // Configs and properties
734
+ @Input() alignSelf ! : string;
735
+ @Input() appendTo ! : HTMLElement|string;
736
+ @Input() callOnFunctions ! : boolean;
737
+ @Input() catchEventHandlerExceptions ! : boolean;
738
+ @Input() cls ! : string|object;
739
+ @Input() column ! : number;
740
+ @Input() content ! : string;
741
+ @Input() dataset ! : object|Record<string, string>;
742
+ @Input() disabled ! : boolean|'inert';
743
+ @Input() extraData ! : any;
744
+ @Input() flex ! : number|string;
745
+ @Input() height ! : number|string;
746
+ @Input() hidden ! : boolean;
747
+ @Input() html ! : string|((widget: Widget) => string)|DomConfig|DomConfig[]|VueConfig;
748
+ @Input() id ! : string;
749
+ @Input() insertBefore ! : HTMLElement|string;
750
+ @Input() insertFirst ! : HTMLElement|string;
751
+ @Input() keyMap ! : Record<string, KeyMapConfig>;
752
+ @Input() margin ! : number|string;
753
+ @Input() maxHeight ! : string|number;
754
+ @Input() maximizeOnMobile ! : number|string;
755
+ @Input() maxWidth ! : string|number;
756
+ @Input() minHeight ! : string|number;
757
+ @Input() minWidth ! : string|number;
758
+ @Input() readOnly ! : boolean;
759
+ @Input() rtl ! : boolean;
760
+ @Input() scrollable ! : Scroller|boolean|ScrollerConfig;
761
+ @Input() span ! : number;
762
+ @Input() tooltip ! : string|TooltipConfig|null;
763
+ @Input() width ! : number|string;
764
+ @Input() x ! : number;
765
+ @Input() y ! : number;
766
+
767
+ // Properties only
768
+ @Input() anchorSize ! : number[];
769
+ @Input() focusVisible ! : boolean;
770
+ @Input() parent ! : Widget;
771
+
772
+ // Events emitters
773
+ /**
774
+ * Fires before an object is destroyed.
775
+ * @param {object} event Event object
776
+ * @param {Core.Base} event.source The Object that is being destroyed.
777
+ */
778
+ @Output() onBeforeDestroy: any = new EventEmitter<((event: { source: Base }) => void)|string>();
779
+ /**
780
+ * Triggered before a widget is hidden. Return `false` to prevent the action.
781
+ * @param {object} event Event object
782
+ * @param {Core.widget.Widget} event.source The widget being hidden.
783
+ */
784
+ @Output() onBeforeHide: any = new EventEmitter<((event: { source: Widget }) => Promise<boolean>|boolean|void)|string>();
785
+ /**
786
+ * Triggered before a widget is shown. Return `false` to prevent the action.
787
+ * @param {object} event Event object
788
+ * @param {Core.widget.Widget,any} event.source The widget being shown
789
+ */
790
+ @Output() onBeforeShow: any = new EventEmitter<((event: { source: Widget|any }) => Promise<boolean>|boolean|void)|string>();
791
+ /**
792
+ * Fires when any other event is fired from the object.
793
+ * ...
794
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#event-catchAll)
795
+ * @param {object} event Event object
796
+ * @param {{[key: string]: any, type: string}} event.event The Object that contains event details
797
+ * @param {string} event.event.type The type of the event which is caught by the listener
798
+ */
799
+ @Output() onCatchAll: any = new EventEmitter<((event: {[key: string]: any, type: string}) => void)|string>();
800
+ /**
801
+ * Fires when an object is destroyed.
802
+ * @param {object} event Event object
803
+ * @param {Core.Base} event.source The Object that is being destroyed.
804
+ */
805
+ @Output() onDestroy: any = new EventEmitter<((event: { source: Base }) => void)|string>();
806
+ /**
807
+ * Triggered when a widget's [element](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#property-element) is available.
808
+ * @param {object} event Event object
809
+ * @param {HTMLElement} event.element The Widget's element.
810
+ */
811
+ @Output() onElementCreated: any = new EventEmitter<((event: { element: HTMLElement }) => void)|string>();
812
+ /**
813
+ * Fired when focus enters this Widget.
814
+ * @param {object} event Event object
815
+ * @param {Core.widget.Widget} event.source This Widget
816
+ * @param {HTMLElement} event.fromElement The element which lost focus.
817
+ * @param {HTMLElement} event.toElement The element which gained focus.
818
+ * @param {Core.widget.Widget} event.fromWidget The widget which lost focus.
819
+ * @param {Core.widget.Widget} event.toWidget The widget which gained focus.
820
+ * @param {boolean} event.backwards `true` if the `toElement` is before the `fromElement` in document order.
821
+ */
822
+ @Output() onFocusIn: any = new EventEmitter<((event: { source: Widget, fromElement: HTMLElement, toElement: HTMLElement, fromWidget: Widget, toWidget: Widget, backwards: boolean }) => void)|string>();
823
+ /**
824
+ * Fired when focus exits this Widget's ownership tree. This is different from a `blur` event.
825
+ * focus moving from within this Widget's ownership tree, even if there are floating widgets
826
+ * will not trigger this event. This is when focus exits this widget completely.
827
+ * @param {object} event Event object
828
+ * @param {Core.widget.Widget} event.source This Widget
829
+ * @param {HTMLElement} event.fromElement The element which lost focus.
830
+ * @param {HTMLElement} event.toElement The element which gained focus.
831
+ * @param {Core.widget.Widget} event.fromWidget The widget which lost focus.
832
+ * @param {Core.widget.Widget} event.toWidget The widget which gained focus.
833
+ * @param {boolean} event.backwards `true` if the `toElement` is before the `fromElement` in document order.
834
+ */
835
+ @Output() onFocusOut: any = new EventEmitter<((event: { source: Widget, fromElement: HTMLElement, toElement: HTMLElement, fromWidget: Widget, toWidget: Widget, backwards: boolean }) => void)|string>();
836
+ /**
837
+ * Triggered after a widget was hidden
838
+ * @param {object} event Event object
839
+ * @param {Core.widget.Widget} event.source The widget
840
+ */
841
+ @Output() onHide: any = new EventEmitter<((event: { source: Widget }) => void)|string>();
842
+ /**
843
+ * Triggered when a widget which had been in a non-visible state for any reason
844
+ * achieves visibility.
845
+ * ...
846
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#event-paint)
847
+ * @param {object} event Event object
848
+ * @param {Core.widget.Widget} event.source The widget being painted.
849
+ * @param {boolean} event.firstPaint `true` if this is the first paint.
850
+ */
851
+ @Output() onPaint: any = new EventEmitter<((event: { source: Widget, firstPaint: boolean }) => void)|string>();
852
+ /**
853
+ * Fired when a Widget's read only state is toggled
854
+ * @param {object} event Event object
855
+ * @param {boolean} event.readOnly Read only or not
856
+ */
857
+ @Output() onReadOnly: any = new EventEmitter<((event: { readOnly: boolean }) => void)|string>();
858
+ /**
859
+ * This event is fired after a widget's elements have been synchronized due to a direct or indirect call
860
+ * 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.
861
+ */
862
+ @Output() onRecompose: any = new EventEmitter<(() => void)|string>();
863
+ /**
864
+ * 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`*.
865
+ * @param {object} event Event object
866
+ * @param {Core.widget.Widget} event.source This Widget
867
+ * @param {number} event.width The new width
868
+ * @param {number} event.height The new height
869
+ * @param {number} event.oldWidth The old width
870
+ * @param {number} event.oldHeight The old height
871
+ */
872
+ @Output() onResize: any = new EventEmitter<((event: { source: Widget, width: number, height: number, oldWidth: number, oldHeight: number }) => void)|string>();
873
+ /**
874
+ * Triggered after a widget is shown.
875
+ * @param {object} event Event object
876
+ * @param {Core.widget.Widget} event.source The widget
877
+ */
878
+ @Output() onShow: any = new EventEmitter<((event: { source: Widget }) => void)|string>();
879
+
880
+ /**
881
+ * Create and append the underlying widget
882
+ */
883
+ ngOnInit(): void {
884
+ const
885
+ me = this,
886
+ {
887
+ elementRef,
888
+ bryntumConfig
889
+ } = me,
890
+ {
891
+ instanceClass,
892
+ instanceName,
893
+ bryntumConfigs,
894
+ bryntumEvents
895
+ } = BryntumWidgetComponent;
896
+
897
+ bryntumConfigs.filter(prop => prop in this).forEach(prop => {
898
+ // @ts-ignore
899
+ WrapperHelper.applyPropValue(bryntumConfig, prop, this[prop]);
900
+ if (['features', 'config'].includes(prop)) {
901
+ WrapperHelper.devWarningConfigProp(instanceName, prop);
902
+ }
903
+ });
904
+ // @ts-ignore
905
+ bryntumEvents.filter(event => this[event] && this[event].observers.length > 0).forEach(event => {
906
+ const
907
+ uncapitalize = (str: string) => str.charAt(0).toLowerCase() + str.slice(1),
908
+ eventName = (str: string) => uncapitalize(str.slice(2));
909
+
910
+ // @ts-ignore
911
+ bryntumConfig.listeners[eventName(event)] = e => {
912
+ // @ts-ignore
913
+ me[event].emit(e);
914
+ // EventEmitter does not return values in the normal way, work around it by setting `returnValue` flag
915
+ // in Angular listeners
916
+ return e.returnValue;
917
+ };
918
+ });
919
+
920
+ // If component has no container specified in config then use adopt to Wrapper's element
921
+ const
922
+ containerParam = [
923
+ 'adopt',
924
+ 'appendTo',
925
+ 'insertAfter',
926
+ 'insertBefore'
927
+ // @ts-ignore
928
+ ].find(prop => bryntumConfig[prop]);
929
+ if (!containerParam) {
930
+ if (instanceName === 'Button' || elementRef.nativeElement.getRootNode() instanceof ShadowRoot) {
931
+ // Button should always be <a> or <button> inside owner element
932
+ bryntumConfig.appendTo = elementRef.nativeElement;
933
+ }
934
+ else {
935
+ bryntumConfig.adopt = elementRef.nativeElement;
936
+ }
937
+ }
938
+ else {
939
+ WrapperHelper.devWarningContainer(instanceName, containerParam);
940
+ }
941
+
942
+ // @ts-ignore
943
+ me.instance = instanceName === 'Widget' ? Widget.create(bryntumConfig) : new instanceClass(bryntumConfig);
944
+
945
+ }
946
+
947
+ /**
948
+ * Watch for changes
949
+ * @param changes
950
+ */
951
+ ngOnChanges(changes: SimpleChanges): void {
952
+ const
953
+ { instance } = this,
954
+ { instanceName } = BryntumWidgetComponent;
955
+ if (!instance) {
956
+ return;
957
+ }
958
+ // Iterate over all changes
959
+ Object.entries(changes).forEach(([prop, change]) => {
960
+ const
961
+ newValue = (change as SimpleChange).currentValue,
962
+ { instance } = this,
963
+ { bryntumConfigsOnly, bryntumProps } = BryntumWidgetComponent;
964
+ if (bryntumProps.includes(prop)) {
965
+ WrapperHelper.applyPropValue(instance, prop, newValue, false);
966
+ if (bryntumConfigsOnly.includes(prop)) {
967
+ WrapperHelper.devWarningUpdateProp(instanceName, prop);
968
+ }
969
+ }
970
+ });
971
+ }
972
+
973
+ /**
974
+ * Destroy the component
975
+ */
976
+ ngOnDestroy(): void {
977
+ // @ts-ignore
978
+ if (this.instance && this.instance.destroy) {
979
+ this.instance.destroy();
980
+ }
981
+ }
982
+ }