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