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