@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,1333 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /**
3
+ * Angular wrapper for Bryntum SlideToggle
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, Checkbox, ContainerItemConfig, DomConfig, Field, FieldContainer, FieldContainerConfig, FieldTriggerConfig, KeyMapConfig, MaskConfig, Rectangle, Scroller, SlideToggle, SlideToggleListeners, TabConfig, TooltipConfig, VueConfig, Widget } from '@bryntum/taskboard';
11
+
12
+ import { StringHelper } from '@bryntum/taskboard';
13
+
14
+ export type BryntumSlideToggleProps = {
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/SlideToggle#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/SlideToggle#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/SlideToggle#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/SlideToggle#config-ariaLabel)
57
+ */
58
+ ariaLabel ? : string
59
+ /**
60
+ * Specify `true` to automatically [collapse](https://bryntum.com/products/taskboard/docs/api/Core/widget/FieldContainer#config-collapsed) the field's
61
+ * [container](https://bryntum.com/products/taskboard/docs/api/Core/widget/Checkbox#config-container) when the field is not [checked](#Core/widget/Checkbox#property-checked).
62
+ * ...
63
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-autoCollapse)
64
+ * @returns {boolean}
65
+ */
66
+ autoCollapse ? : boolean|(() => boolean)
67
+ /**
68
+ * Sets the native `autocomplete` property of the underlying input element. For more information, please refer to
69
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
70
+ */
71
+ autoComplete ? : string
72
+ /**
73
+ * Specify `true` to auto select field contents on focus
74
+ */
75
+ autoSelect ? : boolean
76
+ /**
77
+ * Initial text to show in badge.
78
+ */
79
+ badge ? : string
80
+ /**
81
+ * An object where property names with a truthy value indicate which events should bubble up the ownership
82
+ * hierarchy when triggered.
83
+ * ...
84
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-bubbleEvents)
85
+ */
86
+ bubbleEvents ? : object
87
+ /**
88
+ * Set to `false` to not call onXXX method names (e.g. `onShow`, `onClick`), as an easy way to listen for events.
89
+ * ...
90
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-callOnFunctions)
91
+ */
92
+ callOnFunctions ? : boolean
93
+ /**
94
+ * By default, if an event handler throws an exception, the error propagates up the stack and the
95
+ * application state is undefined. Code which follows the event handler will *not* be executed.
96
+ * ...
97
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-catchEventHandlerExceptions)
98
+ */
99
+ catchEventHandlerExceptions ? : boolean
100
+ /**
101
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
102
+ * Set to `true` to centre the Widget in browser viewport space.
103
+ */
104
+ centered ? : boolean
105
+ /**
106
+ * The checked state. The same as `value`.
107
+ */
108
+ checked ? : boolean
109
+ /**
110
+ * The value to provide for this widget in [values](https://bryntum.com/products/taskboard/docs/api/Core/widget/Container#property-values) when it is
111
+ * [checked](https://bryntum.com/products/taskboard/docs/api/Core/widget/Checkbox#property-checked).
112
+ * A value of `undefined` will cause this widget not to include its value when checked.
113
+ */
114
+ checkedValue ? : any
115
+ /**
116
+ * Custom CSS classes to add to element.
117
+ * May be specified as a space separated string, or as an object in which property names
118
+ * with truthy values are used as the class names:
119
+ * ...
120
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-cls)
121
+ */
122
+ cls ? : string|object
123
+ /**
124
+ * Checkbox color, must have match in CSS
125
+ */
126
+ color ? : string
127
+ /**
128
+ * Programmatic control over which column to start in when used in a grid layout.
129
+ */
130
+ column ? : number
131
+ config ? : object
132
+ /**
133
+ * *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).*
134
+ * Element, Widget or Rectangle to which this Widget is constrained.
135
+ */
136
+ constrainTo ? : HTMLElement|Widget|Rectangle
137
+ /**
138
+ * The configuration for additional items associated to this field. This is typically used to add contextual
139
+ * fields related to a [checkbox](https://bryntum.com/products/taskboard/docs/api/Core/widget/Checkbox) or [radio button](#Core/widget/Radio). See
140
+ * these classes for examples of nested fields.
141
+ * ...
142
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-container)
143
+ */
144
+ container ? : Record<string, ContainerItemConfig>|ContainerItemConfig[]|FieldContainerConfig|FieldContainer
145
+ /**
146
+ * The config controls how the value of nested items are handled when a parent container gets or sets its
147
+ * [values](https://bryntum.com/products/taskboard/docs/api/Core/widget/Container#property-values).
148
+ * ...
149
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-containValues)
150
+ * @param {Core.widget.Field} field Field instance
151
+ * @returns {boolean}
152
+ */
153
+ containValues ? : boolean|string|((field: Field) => boolean)
154
+ /**
155
+ * Custom CSS classes to add to the [contentElement](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#property-contentElement).
156
+ * May be specified as a space separated string, or as an object in which property names
157
+ * with truthy values are used as the class names:
158
+ * ...
159
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-contentElementCls)
160
+ */
161
+ contentElementCls ? : string|object
162
+ /**
163
+ * When this Widget configuration is used in the Grid's RowExpander feature's `widget` config, provide the
164
+ * field on the expanded record to use for populating this widget's store (if applicable)
165
+ */
166
+ dataField ? : string
167
+ /**
168
+ * Object to apply to elements dataset (each key will be used as a data-attribute on the element)
169
+ */
170
+ dataset ? : Record<string, string>
171
+ /**
172
+ * The name of the property to set when a single value is to be applied to this Widget. Such as when used
173
+ * in a grid WidgetColumn, this is the property to which the column's `field` is applied.
174
+ */
175
+ defaultBindProperty ? : string
176
+ /**
177
+ * Check for CSS compatibility issues when upgrading to v7. Performs the following checks:
178
+ * ...
179
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-detectCSSCompatibilityIssues)
180
+ */
181
+ detectCSSCompatibilityIssues ? : boolean
182
+ /**
183
+ * 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
184
+ * cannot be focused, uses a different rendition (usually greyish) and does not allow selecting its value.
185
+ * ...
186
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-disabled)
187
+ */
188
+ disabled ? : boolean|'inert'
189
+ /**
190
+ * Controls the placement of this widget when it is added to a [panel's ](https://bryntum.com/products/taskboard/docs/api/Core/widget/Panel)
191
+ * [strips collection](https://bryntum.com/products/taskboard/docs/api/Core/widget/Panel#config-strips). Typical values for this config are `'top'`,
192
+ * `'bottom'`, `'left'`, or `'right'`, which cause the widget to be placed on that side of the panel's
193
+ * body. Such widgets are called "edge strips".
194
+ * ...
195
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-dock)
196
+ */
197
+ dock ? : 'top'|'bottom'|'left'|'right'|'start'|'end'|'header'|'pre-header'|object
198
+ /**
199
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
200
+ * Set to `true` to be able to drag a widget freely on the page. Or set to an object with a ´handleSelector´
201
+ * property which controls when a drag should start.
202
+ * ...
203
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-draggable)
204
+ */
205
+ draggable ? : boolean|{
206
+ handleSelector?: string
207
+ }
208
+ /**
209
+ * An object specifying attributes to assign to the root element of this widget.
210
+ * Set `null` value to attribute to remove it.
211
+ * ...
212
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-elementAttributes)
213
+ */
214
+ elementAttributes ? : Record<string, string|null>
215
+ extraData ? : any
216
+ /**
217
+ * 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
218
+ * flexbox layout. This config allows you to set this widget's
219
+ * [flex](https://developer.mozilla.org/en-US/docs/Web/CSS/flex) style.
220
+ * This may be configured as a single number or a `&lt;flex-grow&gt; &lt;flex-shrink&gt; &lt;flex-basis&gt;` format string.
221
+ * numeric-only values are interpreted as the `flex-grow` value.
222
+ */
223
+ flex ? : number|string
224
+ /**
225
+ * Set to `true` to move the widget out of the document flow and position it
226
+ * absolutely in browser viewport space.
227
+ */
228
+ floating ? : boolean
229
+ /**
230
+ * Widget's height, used to set element `style.height`. Either specify a valid height string or a number,
231
+ * which will get 'px' appended. We recommend using CSS as the primary way to control height, but in some
232
+ * cases this config is convenient.
233
+ */
234
+ height ? : string|number
235
+ /**
236
+ * Configure with true to make widget initially hidden.
237
+ */
238
+ hidden ? : boolean
239
+ /**
240
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
241
+ * ...
242
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-hideAnimation)
243
+ */
244
+ hideAnimation ? : boolean|object
245
+ /**
246
+ * Specify `true` to highlight field after external value changes
247
+ */
248
+ highlightExternalChange ? : boolean
249
+ /**
250
+ * An optional string to display inside the input field as an overlay. This can be useful for displaying
251
+ * a field's units.
252
+ * ...
253
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-hint)
254
+ * @param {object} data A data object
255
+ * @param {Core.widget.Field} data.source A reference to the field instance
256
+ * @param {any} data.value The current value of the field
257
+ * @returns {string}
258
+ */
259
+ hint ? : string|((data: { source: Field, value: any }) => string)
260
+ /**
261
+ * This config is similar to [hint](https://bryntum.com/products/taskboard/docs/api/Core/widget/Field#config-hint) except that this config is used to display HTML content.
262
+ * Since this can allow malicious content to be executed, be sure not to include user-entered data or to
263
+ * encode such data (see [encodeHtml](https://bryntum.com/products/taskboard/docs/api/Core/helper/StringHelper#function-encodeHtml-static)).
264
+ * ...
265
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-hintHtml)
266
+ * @param {object} data A data object
267
+ * @param {Core.widget.Field} data.source A reference to the field instance
268
+ * @param {any} data.value The current value of the field
269
+ * @returns {string}
270
+ */
271
+ hintHtml ? : string|((data: { source: Field, value: any }) => string)
272
+ /**
273
+ * Widget id, if not specified one will be generated. Also used for lookups through Widget.getById
274
+ */
275
+ id ? : string
276
+ /**
277
+ * Determines if the widgets read-only state should be controlled by its parent.
278
+ * ...
279
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-ignoreParentReadOnly)
280
+ */
281
+ ignoreParentReadOnly ? : boolean
282
+ /**
283
+ * Set this config to `true` to always display items horizontally along with this field. This assigns an
284
+ * [hbox](https://bryntum.com/products/taskboard/docs/api/Core/widget/layout/Box) as the [layout](#Core/widget/Container#config-layout) to the
285
+ * [container](https://bryntum.com/products/taskboard/docs/api/Core/widget/Field#config-container).
286
+ * ...
287
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-inline)
288
+ */
289
+ inline ? : boolean
290
+ /**
291
+ * Text alignment for the input field.
292
+ */
293
+ inputAlign ? : string
294
+ /**
295
+ * Sets custom attributes of the underlying input element. For more information, please refer to
296
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes)
297
+ */
298
+ inputAttributes ? : Record<string, string>
299
+ /**
300
+ * If you need to use something else than a default `input` element, as the input element, provide the tag
301
+ * name here. Please note that this is used for advanced usage only, for example when using WebComponents
302
+ * (custom elements), and that the configured element must fulfil the same contract as a regular input
303
+ * element.
304
+ */
305
+ inputTag ? : string
306
+ /**
307
+ * Sets the `type` attribute of the underlying input element (password, hidden, date, color, etc.).
308
+ */
309
+ inputType ? : string
310
+ /**
311
+ * The width to apply to the `.b-field-inner` element, which encompasses the `input` element and any
312
+ * triggers. If a number is specified, `px` will be used.
313
+ */
314
+ inputWidth ? : string|number
315
+ /**
316
+ * 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.
317
+ */
318
+ insertBefore ? : HTMLElement|string
319
+ /**
320
+ * 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.
321
+ */
322
+ insertFirst ? : HTMLElement|string
323
+ /**
324
+ * An object whose keys are the [key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) name
325
+ * and optional modifier prefixes: `'Ctrl+'`, `'Alt+'`, `'Meta+'`, and `'Shift+'` (case-insensitive). The values
326
+ * are the name of the instance method to call when the keystroke is received.
327
+ * ...
328
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-keyMap)
329
+ */
330
+ keyMap ? : Record<string, KeyMapConfig>
331
+ /**
332
+ * The delay in milliseconds to wait after the last keystroke before triggering a change event.
333
+ * Set to 0 to not trigger change events from keystrokes (listen for input event instead to have
334
+ * immediate feedback, change will still be triggered on blur).
335
+ * ...
336
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-keyStrokeChangeDelay)
337
+ */
338
+ keyStrokeChangeDelay ? : number
339
+ /**
340
+ * Label, prepended to field
341
+ */
342
+ label ? : string
343
+ /**
344
+ * CSS class name or class names to add to any configured [label](https://bryntum.com/products/taskboard/docs/api/Core/widget/mixin/Labelable#config-label)
345
+ */
346
+ labelCls ? : string|object
347
+ /**
348
+ * Label position, either 'before' the field or 'above' the field
349
+ * ...
350
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-labelPosition)
351
+ */
352
+ labelPosition ? : 'before'|'above'|null
353
+ /**
354
+ * The labels to add either before or after the input field.
355
+ * Each label may have the following properties:
356
+ * ...
357
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-labels)
358
+ */
359
+ labels ? : object[]
360
+ /**
361
+ * The width to apply to the `&lt;label&gt;` element. If a number is specified, `px` will be used.
362
+ */
363
+ labelWidth ? : string|number
364
+ /**
365
+ * The listener set for this object.
366
+ * ...
367
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-listeners)
368
+ */
369
+ listeners ? : SlideToggleListeners
370
+ /**
371
+ * A class translations of which are used for translating this entity.
372
+ * This is often used when translations of an item are defined on its container class.
373
+ * For example:
374
+ * ...
375
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-localeClass)
376
+ */
377
+ localeClass ? : typeof Base
378
+ /**
379
+ * Set to `false` to disable localization of this object.
380
+ */
381
+ localizable ? : boolean
382
+ /**
383
+ * List of properties which values should be translated automatically upon a locale applying.
384
+ * In case there is a need to localize not typical value (not a String value or a field with re-defined setter/getter),
385
+ * you could use 'localeKey' meta configuration.
386
+ * Example:
387
+ * ...
388
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-localizableProperties)
389
+ */
390
+ localizableProperties ? : string[]
391
+ /**
392
+ * Widget's margin. This may be configured as a single number or a `TRBL` format string.
393
+ * numeric-only values are interpreted as pixels.
394
+ */
395
+ margin ? : number|string
396
+ /**
397
+ * This config object contains the defaults for the [Mask](https://bryntum.com/products/taskboard/docs/api/Core/widget/Mask) created for the
398
+ * [masked](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-masked) config. Any properties specified in the `masked` config will override these
399
+ * values.
400
+ */
401
+ maskDefaults ? : MaskConfig
402
+ /**
403
+ * Set to `true` to apply the default mask to the widget. Alternatively, this can be the mask message or a
404
+ * [Mask](https://bryntum.com/products/taskboard/docs/api/Core/widget/Mask) config object.
405
+ */
406
+ masked ? : boolean|string|MaskConfig
407
+ /**
408
+ * The element's maxHeight. Can be either a String or a Number (which will have 'px' appended). Note that
409
+ * like [height](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-height), *reading* the value will return the numeric value in pixels.
410
+ */
411
+ maxHeight ? : string|number
412
+ /**
413
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
414
+ * ...
415
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-maximizeOnMobile)
416
+ */
417
+ maximizeOnMobile ? : number|string
418
+ /**
419
+ * The elements maxWidth. Can be either a String or a Number (which will have 'px' appended). Note that
420
+ * like [width](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-width), *reading* the value will return the numeric value in pixels.
421
+ */
422
+ maxWidth ? : string|number
423
+ /**
424
+ * The element's minHeight. Can be either a String or a Number (which will have 'px' appended). Note that
425
+ * like [height](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-height), *reading* the value will return the numeric value in pixels.
426
+ */
427
+ minHeight ? : string|number
428
+ /**
429
+ * The elements minWidth. Can be either a String or a Number (which will have 'px' appended). Note that
430
+ * like [width](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-width), *reading* the value will return the numeric value in pixels.
431
+ */
432
+ minWidth ? : string|number
433
+ /**
434
+ * When this is configured as `true` a [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)
435
+ * is used to monitor this element for size changes caused by either style manipulation, or by CSS
436
+ * layout.
437
+ * ...
438
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-monitorResize)
439
+ */
440
+ monitorResize ? : boolean|{
441
+ immediate?: boolean
442
+ }
443
+ /**
444
+ * Name of the field which is used as a key to get/set values from/to the field.
445
+ * Used prior to [ref](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-ref) and [id](#Core/widget/Widget#config-id) in
446
+ * [Container.values](https://bryntum.com/products/taskboard/docs/api/Core/widget/Container#property-values).
447
+ * ...
448
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-name)
449
+ */
450
+ name ? : string
451
+ /**
452
+ * The owning Widget of this Widget. If this Widget is directly contained (that is, it is one of the
453
+ * [items](https://bryntum.com/products/taskboard/docs/api/Core/widget/Container#property-items) of a Container), this config will be ignored. In this case
454
+ * the owner is <strong>always</strong> the encapsulating Container.
455
+ * ...
456
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-owner)
457
+ */
458
+ owner ? : Widget|any
459
+ /**
460
+ * 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
461
+ * not participate in the standard layout of that widget, and must be positioned relatively to that
462
+ * widget's [contentElement](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#property-contentElement).
463
+ * ...
464
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-positioned)
465
+ */
466
+ positioned ? : boolean
467
+ /**
468
+ * Prevent tooltip from being displayed on touch devices. Useful for example for buttons that display a
469
+ * menu on click etc, since the tooltip would be displayed at the same time.
470
+ */
471
+ preventTooltipOnTouch ? : boolean
472
+ /**
473
+ * Makes the field unmodifiable by user action. The input area is not editable, and triggers
474
+ * are unresponsive.
475
+ * ...
476
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-readOnly)
477
+ */
478
+ readOnly ? : boolean
479
+ relayStoreEvents ? : boolean
480
+ /**
481
+ * Configure as `true` to indicate that a `null` field value is to be marked as invalid. This will
482
+ * optionally append a * to the field label if [showRequiredIndicator](https://bryntum.com/products/taskboard/docs/api/Core/widget/Field#property-showRequiredIndicator) is set.
483
+ */
484
+ required ? : boolean
485
+ /**
486
+ * If this field is not [readOnly](https://bryntum.com/products/taskboard/docs/api/Core/widget/Field#config-readOnly), then setting this option means that pressing
487
+ * the `ESCAPE` key after editing the field will revert the field to the value it had when
488
+ * the user focused the field. If the field is *not* changed from when focused, the [clearable](https://bryntum.com/products/taskboard/docs/api/Core/widget/Field#config-clearable)
489
+ * behaviour will be activated.
490
+ */
491
+ revertOnEscape ? : boolean
492
+ /**
493
+ * Configure as `true` to have the component display a translucent ripple when its
494
+ * [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
495
+ * current theme supports ripples</em>. Out of the box, only the Material theme supports ripples.
496
+ * ...
497
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-ripple)
498
+ */
499
+ ripple ? : boolean|{
500
+ delegate?: string
501
+ color?: string
502
+ radius?: number
503
+ clip?: string
504
+ }
505
+ /**
506
+ * 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`
507
+ */
508
+ rootElement ? : ShadowRoot|HTMLElement
509
+ /**
510
+ * This may be configured as `true` to make the widget's element use the `direction:rtl` style.
511
+ * ...
512
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-rtl)
513
+ */
514
+ rtl ? : boolean
515
+ /**
516
+ * Defines what to do if document is scrolled while Widget is visible (only relevant when floating is set to `true`).
517
+ * Valid values: ´null´: do nothing, ´hide´: hide the widget or ´realign´: realign to the target if possible.
518
+ */
519
+ scrollAction ? : 'hide'|'realign'|null
520
+ /**
521
+ * *Only valid if this Widget is [floating](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#config-floating).*
522
+ * ...
523
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-showAnimation)
524
+ */
525
+ showAnimation ? : boolean|object
526
+ /**
527
+ * `true` to automatically display a * after the label for this field when it is [required](https://bryntum.com/products/taskboard/docs/api/Core/widget/Field#property-required).
528
+ */
529
+ showRequiredIndicator ? : string
530
+ /**
531
+ * 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)
532
+ */
533
+ showTooltipWhenDisabled ? : boolean
534
+ /**
535
+ * Set to `true`, completely bypasses validation logic (could be userful if your field is not `editable`
536
+ * to the user).
537
+ */
538
+ skipValidation ? : boolean
539
+ /**
540
+ * Programmatic control over how many columns to span when used in a grid layout.
541
+ */
542
+ span ? : number
543
+ /**
544
+ * Sets the native `spellcheck` property of the underlying input element. For more information, please refer to
545
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck)
546
+ */
547
+ spellCheck ? : boolean
548
+ /**
549
+ * 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
550
+ * [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
551
+ * this widget:
552
+ * ...
553
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-tab)
554
+ */
555
+ tab ? : boolean|TabConfig
556
+ /**
557
+ * The tab index of the input field or fields, or `null` for natural tab order (recommended). Setting to `0`
558
+ * is equivalent to natural tab order, but is unnecessary for fields since they are naturally tabbable
559
+ * (i.e., accessible via the TAB key). Setting to `-1` disables tabbability but allows for focus to be set
560
+ * to the element programmatically.
561
+ * ...
562
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-tabIndex)
563
+ */
564
+ tabIndex ? : number
565
+ /**
566
+ * Text to display on checkbox label
567
+ */
568
+ text ? : string
569
+ /**
570
+ * Text alignment: 'left', 'center' or 'right'. Also accepts direction neutral 'start' and 'end'.
571
+ * ...
572
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-textAlign)
573
+ */
574
+ textAlign ? : 'left'|'center'|'right'|'start'|'end'
575
+ /**
576
+ * A title to display for the widget. Only in effect when inside a container that uses it (such as TabPanel)
577
+ */
578
+ title ? : string
579
+ /**
580
+ * Tooltip for the widget, either as a string or as a Tooltip config object.
581
+ * ...
582
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-tooltip)
583
+ */
584
+ tooltip ? : string|TooltipConfig|null
585
+ /**
586
+ * The triggers to add either before or after the input field. Each property name is the reference by which
587
+ * an instantiated Trigger Widget may be retrieved from the live `triggers` property.
588
+ * ...
589
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-triggers)
590
+ */
591
+ triggers ? : Record<string, FieldTriggerConfig>|Record<string, Widget>
592
+ type ? : 'slidetoggle'
593
+ /**
594
+ * Custom CSS class name suffixes to apply to the elements rendered by this widget. This may be specified
595
+ * as a space separated string, an array of strings, or as an object in which property names with truthy
596
+ * values are used as the class names.
597
+ * ...
598
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-ui)
599
+ */
600
+ ui ? : string|object
601
+ /**
602
+ * The value to provide for this widget in [values](https://bryntum.com/products/taskboard/docs/api/Core/widget/Container#property-values) when it is not
603
+ * [checked](https://bryntum.com/products/taskboard/docs/api/Core/widget/Checkbox#property-checked).
604
+ * ...
605
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-uncheckedValue)
606
+ */
607
+ uncheckedValue ? : any
608
+ /**
609
+ * Set to `false` to not highlight a field as invalid while typing, to instead show it on ENTER key press
610
+ * or similar.
611
+ */
612
+ validateOnInput ? : boolean
613
+ /**
614
+ * The value of the checkbox. This is the same as `checked`.
615
+ */
616
+ value ? : boolean
617
+ /**
618
+ * A widgets weight determines its position among siblings when added to a [Container](https://bryntum.com/products/taskboard/docs/api/Core/widget/Container).
619
+ * Higher weights go further down.
620
+ */
621
+ weight ? : number
622
+ /**
623
+ * Widget's width, used to set element `style.width`. Either specify a valid width string or a number, which
624
+ * will get 'px' appended. We recommend using CSS as the primary way to control width, but in some cases
625
+ * this config is convenient.
626
+ */
627
+ width ? : string|number
628
+ /**
629
+ * The x position for the widget.
630
+ * ...
631
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-x)
632
+ */
633
+ x ? : number
634
+ /**
635
+ * The y position for the widget.
636
+ * ...
637
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#config-y)
638
+ */
639
+ y ? : number
640
+
641
+ }
642
+
643
+ @Component({
644
+ selector : 'bryntum-slide-toggle',
645
+ template : ''
646
+ })
647
+ export class BryntumSlideToggleComponent implements OnInit, OnDestroy {
648
+
649
+ public static instanceClass = SlideToggle;
650
+
651
+ public static instanceName = 'SlideToggle';
652
+
653
+ private static bryntumEvents: string[] = [
654
+ 'onAction',
655
+ 'onBeforeChange',
656
+ 'onBeforeDestroy',
657
+ 'onBeforeHide',
658
+ 'onBeforeShow',
659
+ 'onCatchAll',
660
+ 'onChange',
661
+ 'onClear',
662
+ 'onClick',
663
+ 'onDestroy',
664
+ 'onElementCreated',
665
+ 'onFocusIn',
666
+ 'onFocusOut',
667
+ 'onHide',
668
+ 'onInput',
669
+ 'onPaint',
670
+ 'onReadOnly',
671
+ 'onRecompose',
672
+ 'onResize',
673
+ 'onShow',
674
+ 'onTrigger'
675
+ ];
676
+
677
+ private static bryntumFeatureNames: string[] = [
678
+
679
+ ];
680
+
681
+ private static bryntumConfigs: string[] = BryntumSlideToggleComponent.bryntumFeatureNames.concat([
682
+ 'adopt',
683
+ 'align',
684
+ 'alignSelf',
685
+ 'anchor',
686
+ 'appendTo',
687
+ 'ariaDescription',
688
+ 'ariaLabel',
689
+ 'autoCollapse',
690
+ 'autoComplete',
691
+ 'autoSelect',
692
+ 'badge',
693
+ 'bubbleEvents',
694
+ 'callOnFunctions',
695
+ 'catchEventHandlerExceptions',
696
+ 'centered',
697
+ 'checked',
698
+ 'checkedValue',
699
+ 'cls',
700
+ 'color',
701
+ 'column',
702
+ 'config',
703
+ 'constrainTo',
704
+ 'container',
705
+ 'containValues',
706
+ 'contentElementCls',
707
+ 'dataField',
708
+ 'dataset',
709
+ 'defaultBindProperty',
710
+ 'detectCSSCompatibilityIssues',
711
+ 'disabled',
712
+ 'dock',
713
+ 'draggable',
714
+ 'elementAttributes',
715
+ 'extraData',
716
+ 'flex',
717
+ 'floating',
718
+ 'height',
719
+ 'hidden',
720
+ 'hideAnimation',
721
+ 'highlightExternalChange',
722
+ 'hint',
723
+ 'hintHtml',
724
+ 'id',
725
+ 'ignoreParentReadOnly',
726
+ 'inline',
727
+ 'inputAlign',
728
+ 'inputAttributes',
729
+ 'inputTag',
730
+ 'inputType',
731
+ 'inputWidth',
732
+ 'insertBefore',
733
+ 'insertFirst',
734
+ 'keyMap',
735
+ 'keyStrokeChangeDelay',
736
+ 'label',
737
+ 'labelCls',
738
+ 'labelPosition',
739
+ 'labels',
740
+ 'labelWidth',
741
+ 'listeners',
742
+ 'localeClass',
743
+ 'localizable',
744
+ 'localizableProperties',
745
+ 'margin',
746
+ 'maskDefaults',
747
+ 'masked',
748
+ 'maxHeight',
749
+ 'maximizeOnMobile',
750
+ 'maxWidth',
751
+ 'minHeight',
752
+ 'minWidth',
753
+ 'monitorResize',
754
+ 'name',
755
+ 'owner',
756
+ 'positioned',
757
+ 'preventTooltipOnTouch',
758
+ 'readOnly',
759
+ 'relayStoreEvents',
760
+ 'required',
761
+ 'revertOnEscape',
762
+ 'ripple',
763
+ 'rootElement',
764
+ 'rtl',
765
+ 'scrollAction',
766
+ 'showAnimation',
767
+ 'showRequiredIndicator',
768
+ 'showTooltipWhenDisabled',
769
+ 'skipValidation',
770
+ 'span',
771
+ 'spellCheck',
772
+ 'tab',
773
+ 'tabIndex',
774
+ 'text',
775
+ 'textAlign',
776
+ 'title',
777
+ 'tooltip',
778
+ 'triggers',
779
+ 'type',
780
+ 'ui',
781
+ 'uncheckedValue',
782
+ 'validateOnInput',
783
+ 'value',
784
+ 'weight',
785
+ 'width',
786
+ 'x',
787
+ 'y'
788
+ ]);
789
+
790
+ private static bryntumConfigsOnly: string[] = [
791
+ 'adopt',
792
+ 'align',
793
+ 'anchor',
794
+ 'ariaDescription',
795
+ 'ariaLabel',
796
+ 'autoCollapse',
797
+ 'autoComplete',
798
+ 'autoSelect',
799
+ 'bubbleEvents',
800
+ 'centered',
801
+ 'checkedValue',
802
+ 'color',
803
+ 'config',
804
+ 'constrainTo',
805
+ 'container',
806
+ 'containValues',
807
+ 'contentElementCls',
808
+ 'dataField',
809
+ 'defaultBindProperty',
810
+ 'detectCSSCompatibilityIssues',
811
+ 'dock',
812
+ 'draggable',
813
+ 'elementAttributes',
814
+ 'floating',
815
+ 'hideAnimation',
816
+ 'highlightExternalChange',
817
+ 'hint',
818
+ 'hintHtml',
819
+ 'ignoreParentReadOnly',
820
+ 'inline',
821
+ 'inputAlign',
822
+ 'inputAttributes',
823
+ 'inputTag',
824
+ 'inputType',
825
+ 'inputWidth',
826
+ 'keyStrokeChangeDelay',
827
+ 'labelCls',
828
+ 'labelPosition',
829
+ 'labels',
830
+ 'labelWidth',
831
+ 'listeners',
832
+ 'localeClass',
833
+ 'localizable',
834
+ 'localizableProperties',
835
+ 'maskDefaults',
836
+ 'masked',
837
+ 'monitorResize',
838
+ 'owner',
839
+ 'positioned',
840
+ 'preventTooltipOnTouch',
841
+ 'relayStoreEvents',
842
+ 'revertOnEscape',
843
+ 'ripple',
844
+ 'rootElement',
845
+ 'scrollAction',
846
+ 'showAnimation',
847
+ 'showTooltipWhenDisabled',
848
+ 'skipValidation',
849
+ 'spellCheck',
850
+ 'tab',
851
+ 'tabIndex',
852
+ 'text',
853
+ 'textAlign',
854
+ 'title',
855
+ 'type',
856
+ 'ui',
857
+ 'uncheckedValue',
858
+ 'validateOnInput',
859
+ 'weight'
860
+ ];
861
+
862
+ private static bryntumProps: string[] = BryntumSlideToggleComponent.bryntumFeatureNames.concat([
863
+ 'alignSelf',
864
+ 'anchorSize',
865
+ 'appendTo',
866
+ 'badge',
867
+ 'callOnFunctions',
868
+ 'catchEventHandlerExceptions',
869
+ 'checked',
870
+ 'cls',
871
+ 'column',
872
+ 'content',
873
+ 'dataset',
874
+ 'disabled',
875
+ 'editable',
876
+ 'extraData',
877
+ 'flex',
878
+ 'focusVisible',
879
+ 'height',
880
+ 'hidden',
881
+ 'html',
882
+ 'id',
883
+ 'input',
884
+ 'insertBefore',
885
+ 'insertFirst',
886
+ 'keyMap',
887
+ 'label',
888
+ 'margin',
889
+ 'maxHeight',
890
+ 'maximizeOnMobile',
891
+ 'maxWidth',
892
+ 'minHeight',
893
+ 'minWidth',
894
+ 'name',
895
+ 'parent',
896
+ 'placeholder',
897
+ 'readOnly',
898
+ 'required',
899
+ 'rtl',
900
+ 'scrollable',
901
+ 'showRequiredIndicator',
902
+ 'span',
903
+ 'tooltip',
904
+ 'triggers',
905
+ 'value',
906
+ 'width',
907
+ 'x',
908
+ 'y'
909
+ ]);
910
+
911
+ private elementRef: ElementRef;
912
+ public instance!: SlideToggle;
913
+
914
+ private bryntumConfig = {
915
+ adopt : undefined,
916
+ appendTo : undefined,
917
+ href : undefined,
918
+ angularComponent : this,
919
+ features : {},
920
+ listeners : {}
921
+ };
922
+
923
+ constructor(element: ElementRef) {
924
+ this.elementRef = element;
925
+ }
926
+
927
+ // Configs only
928
+ @Input() adopt ! : HTMLElement|string;
929
+ @Input() align ! : AlignSpec|string;
930
+ @Input() anchor ! : boolean;
931
+ @Input() ariaDescription ! : string;
932
+ @Input() ariaLabel ! : string;
933
+ @Input() autoCollapse ! : boolean|(() => boolean);
934
+ @Input() autoComplete ! : string;
935
+ @Input() autoSelect ! : boolean;
936
+ @Input() bubbleEvents ! : object;
937
+ @Input() centered ! : boolean;
938
+ @Input() checkedValue ! : any;
939
+ @Input() color ! : string;
940
+ @Input() config ! : object;
941
+ @Input() constrainTo ! : HTMLElement|Widget|Rectangle;
942
+ @Input() container ! : Record<string, ContainerItemConfig>|ContainerItemConfig[]|FieldContainerConfig|FieldContainer;
943
+ @Input() containValues ! : boolean|string|((field: Field) => boolean);
944
+ @Input() contentElementCls ! : string|object;
945
+ @Input() dataField ! : string;
946
+ @Input() defaultBindProperty ! : string;
947
+ @Input() detectCSSCompatibilityIssues ! : boolean;
948
+ @Input() dock ! : 'top'|'bottom'|'left'|'right'|'start'|'end'|'header'|'pre-header'|object;
949
+ @Input() draggable ! : boolean|{
950
+ handleSelector?: string
951
+ };
952
+ @Input() elementAttributes ! : Record<string, string|null>;
953
+ @Input() floating ! : boolean;
954
+ @Input() hideAnimation ! : boolean|object;
955
+ @Input() highlightExternalChange ! : boolean;
956
+ @Input() hint ! : string|((data: { source: Field, value: any }) => string);
957
+ @Input() hintHtml ! : string|((data: { source: Field, value: any }) => string);
958
+ @Input() ignoreParentReadOnly ! : boolean;
959
+ @Input() inline ! : boolean;
960
+ @Input() inputAlign ! : string;
961
+ @Input() inputAttributes ! : Record<string, string>;
962
+ @Input() inputTag ! : string;
963
+ @Input() inputType ! : string;
964
+ @Input() inputWidth ! : string|number;
965
+ @Input() keyStrokeChangeDelay ! : number;
966
+ @Input() labelCls ! : string|object;
967
+ @Input() labelPosition ! : 'before'|'above'|null;
968
+ @Input() labels ! : object[];
969
+ @Input() labelWidth ! : string|number;
970
+ @Input() listeners ! : SlideToggleListeners;
971
+ @Input() localeClass ! : typeof Base;
972
+ @Input() localizable ! : boolean;
973
+ @Input() localizableProperties ! : string[];
974
+ @Input() maskDefaults ! : MaskConfig;
975
+ @Input() masked ! : boolean|string|MaskConfig;
976
+ @Input() monitorResize ! : boolean|{
977
+ immediate?: boolean
978
+ };
979
+ @Input() owner ! : Widget|any;
980
+ @Input() positioned ! : boolean;
981
+ @Input() preventTooltipOnTouch ! : boolean;
982
+ @Input() relayStoreEvents ! : boolean;
983
+ @Input() revertOnEscape ! : boolean;
984
+ @Input() ripple ! : boolean|{
985
+ delegate?: string
986
+ color?: string
987
+ radius?: number
988
+ clip?: string
989
+ };
990
+ @Input() rootElement ! : ShadowRoot|HTMLElement;
991
+ @Input() scrollAction ! : 'hide'|'realign'|null;
992
+ @Input() showAnimation ! : boolean|object;
993
+ @Input() showTooltipWhenDisabled ! : boolean;
994
+ @Input() skipValidation ! : boolean;
995
+ @Input() spellCheck ! : boolean;
996
+ @Input() tab ! : boolean|TabConfig;
997
+ @Input() tabIndex ! : number;
998
+ @Input() text ! : string;
999
+ @Input() textAlign ! : 'left'|'center'|'right'|'start'|'end';
1000
+ @Input() title ! : string;
1001
+ @Input() type ! : 'slidetoggle';
1002
+ @Input() ui ! : string|object;
1003
+ @Input() uncheckedValue ! : any;
1004
+ @Input() validateOnInput ! : boolean;
1005
+ @Input() weight ! : number;
1006
+
1007
+ // Configs and properties
1008
+ @Input() alignSelf ! : string;
1009
+ @Input() appendTo ! : HTMLElement|string;
1010
+ @Input() badge ! : string;
1011
+ @Input() callOnFunctions ! : boolean;
1012
+ @Input() catchEventHandlerExceptions ! : boolean;
1013
+ @Input() checked ! : boolean;
1014
+ @Input() cls ! : string|object;
1015
+ @Input() column ! : number;
1016
+ @Input() dataset ! : object|Record<string, string>;
1017
+ @Input() disabled ! : boolean|'inert';
1018
+ @Input() extraData ! : any;
1019
+ @Input() flex ! : number|string;
1020
+ @Input() height ! : number|string;
1021
+ @Input() hidden ! : boolean;
1022
+ @Input() id ! : string;
1023
+ @Input() insertBefore ! : HTMLElement|string;
1024
+ @Input() insertFirst ! : HTMLElement|string;
1025
+ @Input() keyMap ! : Record<string, KeyMapConfig>;
1026
+ @Input() label ! : string;
1027
+ @Input() margin ! : number|string;
1028
+ @Input() maxHeight ! : string|number;
1029
+ @Input() maximizeOnMobile ! : number|string;
1030
+ @Input() maxWidth ! : string|number;
1031
+ @Input() minHeight ! : string|number;
1032
+ @Input() minWidth ! : string|number;
1033
+ @Input() name ! : string;
1034
+ @Input() readOnly ! : boolean;
1035
+ @Input() required ! : boolean;
1036
+ @Input() rtl ! : boolean;
1037
+ @Input() showRequiredIndicator ! : string;
1038
+ @Input() span ! : number;
1039
+ @Input() tooltip ! : string|TooltipConfig|null;
1040
+ @Input() triggers ! : Record<string, FieldTriggerConfig>|Record<string, Widget>;
1041
+ @Input() value ! : boolean;
1042
+ @Input() width ! : number|string;
1043
+ @Input() x ! : number;
1044
+ @Input() y ! : number;
1045
+
1046
+ // Properties only
1047
+ @Input() anchorSize ! : number[];
1048
+ @Input() content ! : string;
1049
+ @Input() editable ! : boolean;
1050
+ @Input() focusVisible ! : boolean;
1051
+ @Input() html ! : string|((widget: Widget) => string)|DomConfig|DomConfig[]|VueConfig;
1052
+ @Input() input ! : HTMLElement;
1053
+ @Input() parent ! : Widget;
1054
+ @Input() placeholder ! : string;
1055
+ @Input() scrollable ! : Scroller;
1056
+
1057
+ // Events emitters
1058
+ /**
1059
+ * User performed the default action (toggled the checkbox)
1060
+ * @param {object} event Event object
1061
+ * @param {Core.widget.Checkbox} event.source Checkbox
1062
+ * @param {boolean} event.checked Checked state (=value)
1063
+ * @param {boolean} event.value This field's value
1064
+ * @param {boolean} event.valid True if this field is in a valid state
1065
+ * @param {boolean} event.oldValue This field's previous value
1066
+ * @param {boolean} event.userAction Triggered by user taking an action (`true`) or by setting a value (`false`)
1067
+ * @param {Event} event.event The triggering DOM event if any
1068
+ */
1069
+ @Output() onAction: any = new EventEmitter<((event: { source: Checkbox, checked: boolean, value: boolean, valid: boolean, oldValue: boolean, userAction: boolean, event: Event }) => void)|string>();
1070
+ /**
1071
+ * Fired before checkbox is toggled. Returning false from a listener prevents the checkbox from being toggled.
1072
+ * @param {object} event Event object
1073
+ * @param {Core.widget.Checkbox} event.source Checkbox
1074
+ * @param {boolean} event.checked Checked state (=value)
1075
+ * @param {boolean} event.value This field's value
1076
+ * @param {boolean} event.oldValue This field's previous value
1077
+ * @param {boolean} event.userAction Triggered by user taking an action (`true`) or by setting a value (`false`)
1078
+ * @param {boolean} event.valid True if this field is in a valid state.
1079
+ * @param {Event} event.event The triggering DOM event if any
1080
+ */
1081
+ @Output() onBeforeChange: any = new EventEmitter<((event: { source: Checkbox, checked: boolean, value: boolean, oldValue: boolean, userAction: boolean, valid: boolean, event: Event }) => Promise<boolean>|boolean|void)|string>();
1082
+ /**
1083
+ * Fires before an object is destroyed.
1084
+ * @param {object} event Event object
1085
+ * @param {Core.Base} event.source The Object that is being destroyed.
1086
+ */
1087
+ @Output() onBeforeDestroy: any = new EventEmitter<((event: { source: Base }) => void)|string>();
1088
+ /**
1089
+ * Triggered before a widget is hidden. Return `false` to prevent the action.
1090
+ * @param {object} event Event object
1091
+ * @param {Core.widget.Widget} event.source The widget being hidden.
1092
+ */
1093
+ @Output() onBeforeHide: any = new EventEmitter<((event: { source: Widget }) => Promise<boolean>|boolean|void)|string>();
1094
+ /**
1095
+ * Triggered before a widget is shown. Return `false` to prevent the action.
1096
+ * @param {object} event Event object
1097
+ * @param {Core.widget.Widget,any} event.source The widget being shown
1098
+ */
1099
+ @Output() onBeforeShow: any = new EventEmitter<((event: { source: Widget|any }) => Promise<boolean>|boolean|void)|string>();
1100
+ /**
1101
+ * Fires when any other event is fired from the object.
1102
+ * ...
1103
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#event-catchAll)
1104
+ * @param {object} event Event object
1105
+ * @param {{[key: string]: any, type: string}} event.event The Object that contains event details
1106
+ * @param {string} event.event.type The type of the event which is caught by the listener
1107
+ */
1108
+ @Output() onCatchAll: any = new EventEmitter<((event: {[key: string]: any, type: string}) => void)|string>();
1109
+ /**
1110
+ * Fired when checkbox is toggled
1111
+ * @param {object} event Event object
1112
+ * @param {Core.widget.Checkbox} event.source Checkbox
1113
+ * @param {boolean} event.checked Checked state (=value)
1114
+ * @param {boolean} event.value This field's value
1115
+ * @param {boolean} event.oldValue This field's previous value
1116
+ * @param {boolean} event.userAction Triggered by user taking an action (`true`) or by setting a value (`false`)
1117
+ * @param {boolean} event.valid True if this field is in a valid state.
1118
+ * @param {Event} event.event The triggering DOM event if any
1119
+ */
1120
+ @Output() onChange: any = new EventEmitter<((event: { source: Checkbox, checked: boolean, value: boolean, oldValue: boolean, userAction: boolean, valid: boolean, event: Event }) => void)|string>();
1121
+ /**
1122
+ * Fired when this field is [cleared](https://bryntum.com/products/taskboard/docs/api/Core/widget/Field#function-clear).
1123
+ * ...
1124
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#event-clear)
1125
+ * @param {object} event Event object
1126
+ * @param {Core.widget.Field,any} event.source This Field
1127
+ */
1128
+ @Output() onClear: any = new EventEmitter<((event: { source: Field|any }) => void)|string>();
1129
+ /**
1130
+ * Fires when the checkbox is clicked
1131
+ * @param {object} event Event object
1132
+ * @param {Core.widget.Checkbox} event.source The checkbox
1133
+ * @param {Event} event.event DOM event
1134
+ */
1135
+ @Output() onClick: any = new EventEmitter<((event: { source: Checkbox, event: Event }) => void)|string>();
1136
+ /**
1137
+ * Fires when an object is destroyed.
1138
+ * @param {object} event Event object
1139
+ * @param {Core.Base} event.source The Object that is being destroyed.
1140
+ */
1141
+ @Output() onDestroy: any = new EventEmitter<((event: { source: Base }) => void)|string>();
1142
+ /**
1143
+ * Triggered when a widget's [element](https://bryntum.com/products/taskboard/docs/api/Core/widget/Widget#property-element) is available.
1144
+ * @param {object} event Event object
1145
+ * @param {HTMLElement} event.element The Widget's element.
1146
+ */
1147
+ @Output() onElementCreated: any = new EventEmitter<((event: { element: HTMLElement }) => void)|string>();
1148
+ /**
1149
+ * Fired when focus enters this Widget.
1150
+ * @param {object} event Event object
1151
+ * @param {Core.widget.Widget} event.source This Widget
1152
+ * @param {HTMLElement} event.fromElement The element which lost focus.
1153
+ * @param {HTMLElement} event.toElement The element which gained focus.
1154
+ * @param {Core.widget.Widget} event.fromWidget The widget which lost focus.
1155
+ * @param {Core.widget.Widget} event.toWidget The widget which gained focus.
1156
+ * @param {boolean} event.backwards `true` if the `toElement` is before the `fromElement` in document order.
1157
+ */
1158
+ @Output() onFocusIn: any = new EventEmitter<((event: { source: Widget, fromElement: HTMLElement, toElement: HTMLElement, fromWidget: Widget, toWidget: Widget, backwards: boolean }) => void)|string>();
1159
+ /**
1160
+ * Fired when focus exits this Widget's ownership tree. This is different from a `blur` event.
1161
+ * focus moving from within this Widget's ownership tree, even if there are floating widgets
1162
+ * will not trigger this event. This is when focus exits this widget completely.
1163
+ * @param {object} event Event object
1164
+ * @param {Core.widget.Widget} event.source This Widget
1165
+ * @param {HTMLElement} event.fromElement The element which lost focus.
1166
+ * @param {HTMLElement} event.toElement The element which gained focus.
1167
+ * @param {Core.widget.Widget} event.fromWidget The widget which lost focus.
1168
+ * @param {Core.widget.Widget} event.toWidget The widget which gained focus.
1169
+ * @param {boolean} event.backwards `true` if the `toElement` is before the `fromElement` in document order.
1170
+ */
1171
+ @Output() onFocusOut: any = new EventEmitter<((event: { source: Widget, fromElement: HTMLElement, toElement: HTMLElement, fromWidget: Widget, toWidget: Widget, backwards: boolean }) => void)|string>();
1172
+ /**
1173
+ * Triggered after a widget was hidden
1174
+ * @param {object} event Event object
1175
+ * @param {Core.widget.Widget} event.source The widget
1176
+ */
1177
+ @Output() onHide: any = new EventEmitter<((event: { source: Widget }) => void)|string>();
1178
+ /**
1179
+ * Fired when the user types into this field.
1180
+ * @param {object} event Event object
1181
+ * @param {Core.widget.Field,any} event.source This field
1182
+ * @param {string,number,boolean,any} event.value This field's value
1183
+ * @param {Event} event.event The triggering DOM event
1184
+ */
1185
+ @Output() onInput: any = new EventEmitter<((event: { source: Field|any, value: string|number|boolean|any, event: Event }) => void)|string>();
1186
+ /**
1187
+ * Triggered when a widget which had been in a non-visible state for any reason
1188
+ * achieves visibility.
1189
+ * ...
1190
+ * [View online docs...](https://bryntum.com/products/taskboard/docs/api/Core/widget/SlideToggle#event-paint)
1191
+ * @param {object} event Event object
1192
+ * @param {Core.widget.Widget} event.source The widget being painted.
1193
+ * @param {boolean} event.firstPaint `true` if this is the first paint.
1194
+ */
1195
+ @Output() onPaint: any = new EventEmitter<((event: { source: Widget, firstPaint: boolean }) => void)|string>();
1196
+ /**
1197
+ * Fired when a Widget's read only state is toggled
1198
+ * @param {object} event Event object
1199
+ * @param {boolean} event.readOnly Read only or not
1200
+ */
1201
+ @Output() onReadOnly: any = new EventEmitter<((event: { readOnly: boolean }) => void)|string>();
1202
+ /**
1203
+ * This event is fired after a widget's elements have been synchronized due to a direct or indirect call
1204
+ * 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.
1205
+ */
1206
+ @Output() onRecompose: any = new EventEmitter<(() => void)|string>();
1207
+ /**
1208
+ * 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`*.
1209
+ * @param {object} event Event object
1210
+ * @param {Core.widget.Widget} event.source This Widget
1211
+ * @param {number} event.width The new width
1212
+ * @param {number} event.height The new height
1213
+ * @param {number} event.oldWidth The old width
1214
+ * @param {number} event.oldHeight The old height
1215
+ */
1216
+ @Output() onResize: any = new EventEmitter<((event: { source: Widget, width: number, height: number, oldWidth: number, oldHeight: number }) => void)|string>();
1217
+ /**
1218
+ * Triggered after a widget is shown.
1219
+ * @param {object} event Event object
1220
+ * @param {Core.widget.Widget} event.source The widget
1221
+ */
1222
+ @Output() onShow: any = new EventEmitter<((event: { source: Widget }) => void)|string>();
1223
+ /**
1224
+ * User clicked one of this field's [triggers](https://bryntum.com/products/taskboard/docs/api/Core/widget/Field#property-triggers)
1225
+ * @param {object} event Event object
1226
+ * @param {Core.widget.Field,any} event.source This field
1227
+ * @param {Core.widget.Widget} event.trigger The trigger activated by click or touch tap.
1228
+ */
1229
+ @Output() onTrigger: any = new EventEmitter<((event: { source: Field|any, trigger: Widget }) => void)|string>();
1230
+
1231
+ /**
1232
+ * Create and append the underlying widget
1233
+ */
1234
+ ngOnInit(): void {
1235
+ const
1236
+ me = this,
1237
+ {
1238
+ elementRef,
1239
+ bryntumConfig
1240
+ } = me,
1241
+ {
1242
+ instanceClass,
1243
+ instanceName,
1244
+ bryntumConfigs,
1245
+ bryntumEvents
1246
+ } = BryntumSlideToggleComponent;
1247
+
1248
+ bryntumConfigs.filter(prop => prop in this).forEach(prop => {
1249
+ // @ts-ignore
1250
+ WrapperHelper.applyPropValue(bryntumConfig, prop, this[prop]);
1251
+ if (['features', 'config'].includes(prop)) {
1252
+ WrapperHelper.devWarningConfigProp(instanceName, prop);
1253
+ }
1254
+ });
1255
+ // @ts-ignore
1256
+ bryntumEvents.filter(event => this[event] && this[event].observers.length > 0).forEach(event => {
1257
+ const
1258
+ uncapitalize = (str: string) => str.charAt(0).toLowerCase() + str.slice(1),
1259
+ eventName = (str: string) => uncapitalize(str.slice(2));
1260
+
1261
+ // @ts-ignore
1262
+ bryntumConfig.listeners[eventName(event)] = e => {
1263
+ // @ts-ignore
1264
+ me[event].emit(e);
1265
+ // EventEmitter does not return values in the normal way, work around it by setting `returnValue` flag
1266
+ // in Angular listeners
1267
+ return e.returnValue;
1268
+ };
1269
+ });
1270
+
1271
+ // If component has no container specified in config then use adopt to Wrapper's element
1272
+ const
1273
+ containerParam = [
1274
+ 'adopt',
1275
+ 'appendTo',
1276
+ 'insertAfter',
1277
+ 'insertBefore'
1278
+ // @ts-ignore
1279
+ ].find(prop => bryntumConfig[prop]);
1280
+ if (!containerParam) {
1281
+ if (instanceName === 'Button' || elementRef.nativeElement.getRootNode() instanceof ShadowRoot) {
1282
+ // Button should always be <a> or <button> inside owner element
1283
+ bryntumConfig.appendTo = elementRef.nativeElement;
1284
+ }
1285
+ else {
1286
+ bryntumConfig.adopt = elementRef.nativeElement;
1287
+ }
1288
+ }
1289
+ else {
1290
+ WrapperHelper.devWarningContainer(instanceName, containerParam);
1291
+ }
1292
+
1293
+ // @ts-ignore
1294
+ me.instance = instanceName === 'Widget' ? Widget.create(bryntumConfig) : new instanceClass(bryntumConfig);
1295
+
1296
+ }
1297
+
1298
+ /**
1299
+ * Watch for changes
1300
+ * @param changes
1301
+ */
1302
+ ngOnChanges(changes: SimpleChanges): void {
1303
+ const
1304
+ { instance } = this,
1305
+ { instanceName } = BryntumSlideToggleComponent;
1306
+ if (!instance) {
1307
+ return;
1308
+ }
1309
+ // Iterate over all changes
1310
+ Object.entries(changes).forEach(([prop, change]) => {
1311
+ const
1312
+ newValue = (change as SimpleChange).currentValue,
1313
+ { instance } = this,
1314
+ { bryntumConfigsOnly, bryntumProps } = BryntumSlideToggleComponent;
1315
+ if (bryntumProps.includes(prop)) {
1316
+ WrapperHelper.applyPropValue(instance, prop, newValue, false);
1317
+ if (bryntumConfigsOnly.includes(prop)) {
1318
+ WrapperHelper.devWarningUpdateProp(instanceName, prop);
1319
+ }
1320
+ }
1321
+ });
1322
+ }
1323
+
1324
+ /**
1325
+ * Destroy the component
1326
+ */
1327
+ ngOnDestroy(): void {
1328
+ // @ts-ignore
1329
+ if (this.instance && this.instance.destroy) {
1330
+ this.instance.destroy();
1331
+ }
1332
+ }
1333
+ }