@refinitiv-ui/elements 5.6.0 → 5.8.2-alpha.0
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.
- package/CHANGELOG.md +51 -0
- package/lib/accordion/custom-elements.md +18 -0
- package/lib/appstate-bar/custom-elements.md +22 -0
- package/lib/autosuggest/custom-elements.json +24 -4
- package/lib/autosuggest/custom-elements.md +54 -0
- package/lib/autosuggest/index.d.ts +4 -0
- package/lib/autosuggest/index.js +4 -0
- package/lib/button/custom-elements.json +2 -2
- package/lib/button/custom-elements.md +23 -0
- package/lib/button-bar/custom-elements.md +9 -0
- package/lib/calendar/custom-elements.json +8 -6
- package/lib/calendar/custom-elements.md +35 -0
- package/lib/calendar/index.d.ts +2 -0
- package/lib/calendar/index.js +2 -0
- package/lib/canvas/custom-elements.json +7 -5
- package/lib/canvas/custom-elements.md +27 -0
- package/lib/canvas/index.d.ts +1 -0
- package/lib/canvas/index.js +1 -0
- package/lib/card/custom-elements.json +3 -1
- package/lib/card/custom-elements.md +24 -0
- package/lib/card/index.d.ts +2 -0
- package/lib/card/index.js +2 -0
- package/lib/chart/custom-elements.json +1 -1
- package/lib/chart/custom-elements.md +16 -0
- package/lib/checkbox/custom-elements.json +12 -8
- package/lib/checkbox/custom-elements.md +18 -0
- package/lib/checkbox/index.d.ts +3 -1
- package/lib/checkbox/index.js +2 -0
- package/lib/clock/custom-elements.json +8 -4
- package/lib/clock/custom-elements.md +28 -0
- package/lib/clock/index.d.ts +2 -0
- package/lib/clock/index.js +2 -0
- package/lib/clock/themes/halo/dark/index.js +1 -1
- package/lib/clock/themes/halo/light/index.js +1 -1
- package/lib/clock/themes/solar/charcoal/index.js +1 -1
- package/lib/clock/themes/solar/pearl/index.js +1 -1
- package/lib/collapse/custom-elements.md +27 -0
- package/lib/color-dialog/custom-elements.json +29 -16
- package/lib/color-dialog/custom-elements.md +39 -0
- package/lib/color-dialog/index.d.ts +8 -8
- package/lib/color-dialog/index.js +8 -8
- package/lib/combo-box/custom-elements.json +28 -16
- package/lib/combo-box/custom-elements.md +35 -0
- package/lib/combo-box/index.d.ts +10 -2
- package/lib/combo-box/index.js +10 -1
- package/lib/combo-box/themes/halo/dark/index.js +1 -1
- package/lib/combo-box/themes/halo/light/index.js +1 -1
- package/lib/combo-box/themes/solar/charcoal/index.js +1 -1
- package/lib/combo-box/themes/solar/pearl/index.js +1 -1
- package/lib/counter/custom-elements.json +8 -4
- package/lib/counter/custom-elements.md +11 -0
- package/lib/counter/index.d.ts +2 -0
- package/lib/counter/index.js +2 -0
- package/lib/datetime-picker/custom-elements.json +52 -23
- package/lib/datetime-picker/custom-elements.md +57 -0
- package/lib/datetime-picker/index.d.ts +15 -4
- package/lib/datetime-picker/index.js +15 -4
- package/lib/dialog/custom-elements.json +34 -12
- package/lib/dialog/custom-elements.md +47 -0
- package/lib/dialog/index.d.ts +7 -10
- package/lib/dialog/index.js +7 -10
- package/lib/email-field/custom-elements.json +81 -94
- package/lib/email-field/custom-elements.md +37 -0
- package/lib/email-field/index.d.ts +43 -115
- package/lib/email-field/index.js +44 -244
- package/lib/flag/custom-elements.md +10 -0
- package/lib/flag/index.d.ts +2 -0
- package/lib/flag/index.js +2 -0
- package/lib/header/custom-elements.md +18 -0
- package/lib/heatmap/custom-elements.md +26 -0
- package/lib/icon/custom-elements.md +8 -0
- package/lib/icon/index.d.ts +2 -0
- package/lib/icon/index.js +2 -0
- package/lib/interactive-chart/custom-elements.json +6 -10
- package/lib/interactive-chart/custom-elements.md +31 -0
- package/lib/interactive-chart/index.d.ts +5 -2
- package/lib/interactive-chart/index.js +5 -2
- package/lib/item/custom-elements.json +4 -4
- package/lib/item/custom-elements.md +29 -0
- package/lib/item/index.d.ts +11 -2
- package/lib/item/index.js +25 -4
- package/lib/label/custom-elements.md +11 -0
- package/lib/layout/custom-elements.md +26 -0
- package/lib/led-gauge/custom-elements.json +4 -4
- package/lib/led-gauge/custom-elements.md +17 -0
- package/lib/led-gauge/index.d.ts +1 -0
- package/lib/led-gauge/index.js +1 -0
- package/lib/list/custom-elements.json +18 -5
- package/lib/list/custom-elements.md +32 -0
- package/lib/list/helpers/list-renderer.js +2 -0
- package/lib/list/index.d.ts +19 -2
- package/lib/list/index.js +34 -1
- package/lib/loader/custom-elements.md +5 -0
- package/lib/multi-input/custom-elements.json +7 -6
- package/lib/multi-input/custom-elements.md +43 -0
- package/lib/multi-input/index.d.ts +4 -0
- package/lib/multi-input/index.js +4 -0
- package/lib/notification/custom-elements.md +26 -0
- package/lib/number-field/custom-elements.json +99 -54
- package/lib/number-field/custom-elements.md +42 -0
- package/lib/number-field/index.d.ts +92 -47
- package/lib/number-field/index.js +113 -80
- package/lib/overlay/custom-elements.json +26 -13
- package/lib/overlay/custom-elements.md +54 -0
- package/lib/overlay/elements/overlay.d.ts +5 -0
- package/lib/overlay-menu/custom-elements.json +70 -20
- package/lib/overlay-menu/custom-elements.md +44 -0
- package/lib/overlay-menu/index.d.ts +13 -11
- package/lib/overlay-menu/index.js +13 -11
- package/lib/pagination/custom-elements.md +27 -0
- package/lib/panel/custom-elements.md +11 -0
- package/lib/password-field/custom-elements.json +62 -67
- package/lib/password-field/custom-elements.md +39 -0
- package/lib/password-field/index.d.ts +42 -94
- package/lib/password-field/index.js +48 -194
- package/lib/pill/custom-elements.json +8 -6
- package/lib/pill/custom-elements.md +22 -0
- package/lib/pill/index.d.ts +1 -1
- package/lib/pill/index.js +1 -1
- package/lib/progress-bar/custom-elements.md +18 -0
- package/lib/radio-button/custom-elements.json +8 -6
- package/lib/radio-button/custom-elements.md +19 -0
- package/lib/radio-button/index.d.ts +6 -5
- package/lib/radio-button/index.js +5 -4
- package/lib/rating/custom-elements.md +17 -0
- package/lib/search-field/custom-elements.json +70 -74
- package/lib/search-field/custom-elements.md +41 -0
- package/lib/search-field/index.d.ts +43 -100
- package/lib/search-field/index.js +46 -215
- package/lib/select/custom-elements.json +5 -4
- package/lib/select/custom-elements.md +24 -0
- package/lib/select/index.d.ts +11 -3
- package/lib/select/index.js +65 -26
- package/lib/sidebar-layout/custom-elements.json +2 -6
- package/lib/sidebar-layout/custom-elements.md +21 -0
- package/lib/sidebar-layout/index.d.ts +2 -1
- package/lib/slider/custom-elements.json +4 -4
- package/lib/slider/custom-elements.md +28 -0
- package/lib/slider/index.d.ts +1 -1
- package/lib/slider/index.js +1 -1
- package/lib/sparkline/custom-elements.json +4 -4
- package/lib/sparkline/custom-elements.md +16 -0
- package/lib/sparkline/index.d.ts +3 -1
- package/lib/sparkline/index.js +2 -0
- package/lib/swing-gauge/custom-elements.json +5 -3
- package/lib/swing-gauge/custom-elements.md +17 -0
- package/lib/swing-gauge/index.d.ts +3 -1
- package/lib/swing-gauge/index.js +3 -1
- package/lib/tab/custom-elements.json +2 -2
- package/lib/tab/custom-elements.md +22 -0
- package/lib/tab-bar/custom-elements.md +11 -0
- package/lib/text-field/custom-elements.json +78 -89
- package/lib/text-field/custom-elements.md +35 -0
- package/lib/text-field/index.d.ts +50 -92
- package/lib/text-field/index.js +81 -230
- package/lib/time-picker/custom-elements.json +4 -4
- package/lib/time-picker/custom-elements.md +28 -0
- package/lib/time-picker/index.d.ts +3 -0
- package/lib/time-picker/index.js +3 -0
- package/lib/toggle/custom-elements.json +8 -6
- package/lib/toggle/custom-elements.md +19 -0
- package/lib/toggle/index.d.ts +2 -1
- package/lib/toggle/index.js +1 -0
- package/lib/tooltip/custom-elements.md +14 -0
- package/lib/tornado-chart/custom-elements.md +18 -0
- package/lib/tree/custom-elements.json +4 -3
- package/lib/tree/custom-elements.md +32 -0
- package/lib/tree/elements/tree.d.ts +1 -0
- package/lib/tree/elements/tree.js +1 -0
- package/lib/tree/managers/tree-manager.d.ts +20 -2
- package/lib/tree/managers/tree-manager.js +55 -28
- package/lib/tree/themes/halo/dark/index.js +1 -1
- package/lib/tree/themes/halo/light/index.js +1 -1
- package/lib/tree/themes/solar/charcoal/index.js +1 -1
- package/lib/tree/themes/solar/pearl/index.js +1 -1
- package/lib/tree-select/custom-elements.json +10 -6
- package/lib/tree-select/custom-elements.md +26 -0
- package/lib/tree-select/index.d.ts +5 -3
- package/lib/tree-select/index.js +3 -2
- package/lib/tree-select/themes/halo/dark/index.js +1 -1
- package/lib/tree-select/themes/halo/light/index.js +1 -1
- package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
- package/lib/tree-select/themes/solar/pearl/index.js +1 -1
- package/lib/version.js +1 -1
- package/package.json +293 -12
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import {
|
|
2
|
+
import { FormFieldElement, html, css, FocusedPropertyKey } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
|
|
4
4
|
import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
|
|
5
5
|
import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
|
|
6
|
-
import { ifDefined } from '@refinitiv-ui/core/lib/directives/if-defined.js';
|
|
7
6
|
import { VERSION } from '../version.js';
|
|
8
7
|
import '../icon/index.js';
|
|
9
8
|
const NUMBER_PATTERN = '^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$';
|
|
@@ -15,27 +14,35 @@ var Direction;
|
|
|
15
14
|
Direction[Direction["Down"] = -1] = "Down";
|
|
16
15
|
})(Direction || (Direction = {}));
|
|
17
16
|
/**
|
|
18
|
-
* Form control element for numbers
|
|
17
|
+
* Form control element for numbers.
|
|
19
18
|
*
|
|
20
19
|
* @fires value-changed - Dispatched when value changes
|
|
21
20
|
* @fires error-changed - Dispatched when error state changes
|
|
22
21
|
*
|
|
23
|
-
* @attr {
|
|
24
|
-
* @prop {
|
|
22
|
+
* @attr {boolean} disabled - Set disabled state
|
|
23
|
+
* @prop {boolean} [disabled=false] - Set disabled state
|
|
24
|
+
*
|
|
25
|
+
* @attr {boolean} error - Set error state
|
|
26
|
+
* @prop {boolean} [error=false] - Set error state
|
|
27
|
+
*
|
|
28
|
+
* @attr {string} placeholder - Set placeholder text
|
|
29
|
+
* @prop {string} [placeholder=""] - Set placeholder text
|
|
25
30
|
*
|
|
26
31
|
* @attr {boolean} readonly - Set readonly state
|
|
27
32
|
* @prop {boolean} [readonly=false] - Set readonly state
|
|
28
33
|
*
|
|
29
|
-
* @attr {boolean}
|
|
30
|
-
* @prop {boolean} [
|
|
34
|
+
* @attr {boolean} transparent - Disables all other states and border/background styles.
|
|
35
|
+
* @prop {boolean} [transparent=false] - Disables all other states and border/background styles.
|
|
36
|
+
*
|
|
37
|
+
* @attr {boolean} warning - Set warning state
|
|
38
|
+
* @prop {boolean} [warning=false] - Set warning state
|
|
39
|
+
*
|
|
40
|
+
* @attr {string} value - Input's value
|
|
41
|
+
* @prop {string} [value=""] - Input's value
|
|
31
42
|
*/
|
|
32
|
-
let NumberField = class NumberField extends
|
|
43
|
+
let NumberField = class NumberField extends FormFieldElement {
|
|
33
44
|
constructor() {
|
|
34
45
|
super(...arguments);
|
|
35
|
-
/**
|
|
36
|
-
* Set placeholder text
|
|
37
|
-
*/
|
|
38
|
-
this.placeholder = null;
|
|
39
46
|
/**
|
|
40
47
|
* Set spinner's visibility
|
|
41
48
|
*/
|
|
@@ -54,18 +61,6 @@ let NumberField = class NumberField extends ControlElement {
|
|
|
54
61
|
* This value must be greater than or equal to the value of the `min` attribute
|
|
55
62
|
*/
|
|
56
63
|
this.max = null;
|
|
57
|
-
/**
|
|
58
|
-
* Set state to transparent
|
|
59
|
-
*/
|
|
60
|
-
this.transparent = false;
|
|
61
|
-
/**
|
|
62
|
-
* Set state to error
|
|
63
|
-
*/
|
|
64
|
-
this.error = false;
|
|
65
|
-
/**
|
|
66
|
-
* Set state to warning
|
|
67
|
-
*/
|
|
68
|
-
this.warning = false;
|
|
69
64
|
this.interimValueState = false; // make sure that internal input field value is updated only on external value change
|
|
70
65
|
}
|
|
71
66
|
/**
|
|
@@ -119,6 +114,7 @@ let NumberField = class NumberField extends ControlElement {
|
|
|
119
114
|
/**
|
|
120
115
|
* The value of the number entered into the input.
|
|
121
116
|
* @param value number-field value
|
|
117
|
+
* @default -
|
|
122
118
|
*/
|
|
123
119
|
set value(value) {
|
|
124
120
|
this.interimValueState = true;
|
|
@@ -231,28 +227,14 @@ let NumberField = class NumberField extends ControlElement {
|
|
|
231
227
|
*/
|
|
232
228
|
get internalValue() {
|
|
233
229
|
// cover the case when value getter is called before first render or in interim state
|
|
234
|
-
return this.interimValueState || !this.
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Get native input value
|
|
238
|
-
* @returns string of input value
|
|
239
|
-
*/
|
|
240
|
-
get inputValue() {
|
|
241
|
-
return this.inputEl.value;
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Set native input value
|
|
245
|
-
* @param value input's value
|
|
246
|
-
*/
|
|
247
|
-
set inputValue(value) {
|
|
248
|
-
this.inputEl.value = value;
|
|
230
|
+
return this.interimValueState || !this.inputElement ? super.value : this.inputValue;
|
|
249
231
|
}
|
|
250
232
|
/**
|
|
251
233
|
* Handles key down input event
|
|
252
234
|
* @param event Key down event object
|
|
253
235
|
* @returns {void}
|
|
254
236
|
*/
|
|
255
|
-
|
|
237
|
+
onInputKeyDown(event) {
|
|
256
238
|
if (this.readonly || this.disabled || event.defaultPrevented) {
|
|
257
239
|
return;
|
|
258
240
|
}
|
|
@@ -309,7 +291,7 @@ let NumberField = class NumberField extends ControlElement {
|
|
|
309
291
|
* @returns {void}
|
|
310
292
|
*/
|
|
311
293
|
/* istanbul ignore next */
|
|
312
|
-
|
|
294
|
+
onBeforeInputChange(event) {
|
|
313
295
|
// The event is not supported in IE11 and old browsers
|
|
314
296
|
// Therefore just try to prevent some of invalid characters to be entered
|
|
315
297
|
// but still do full validation on actual `input` and `change` events
|
|
@@ -317,7 +299,8 @@ let NumberField = class NumberField extends ControlElement {
|
|
|
317
299
|
// cover all insert types, such as type, paste, drag&drop and others
|
|
318
300
|
if (inputType.startsWith('insert')) {
|
|
319
301
|
const data = event.data || '';
|
|
320
|
-
|
|
302
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
303
|
+
const inputEl = this.inputElement;
|
|
321
304
|
const oldInput = this.inputValue;
|
|
322
305
|
// Calculate what could be the new input
|
|
323
306
|
const selectionStart = inputEl.selectionStart || 0;
|
|
@@ -337,6 +320,22 @@ let NumberField = class NumberField extends ControlElement {
|
|
|
337
320
|
}
|
|
338
321
|
}
|
|
339
322
|
}
|
|
323
|
+
/**
|
|
324
|
+
* Runs on input element `input` event
|
|
325
|
+
* @param event `input` event
|
|
326
|
+
* @returns {void}
|
|
327
|
+
*/
|
|
328
|
+
onInputInput(event) {
|
|
329
|
+
this.onNativeInputChange(event);
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Runs on input element `change` event
|
|
333
|
+
* @param event `change` event
|
|
334
|
+
* @returns {void}
|
|
335
|
+
*/
|
|
336
|
+
onInputChange(event) {
|
|
337
|
+
this.onNativeInputChange(event);
|
|
338
|
+
}
|
|
340
339
|
/**
|
|
341
340
|
* Triggers when native input value change with input event or change event
|
|
342
341
|
* @param event Input event
|
|
@@ -346,7 +345,8 @@ let NumberField = class NumberField extends ControlElement {
|
|
|
346
345
|
const currentInput = this.inputValue;
|
|
347
346
|
const inputValue = this.stripeInvalidCharacters(currentInput, this.value, event.data || '');
|
|
348
347
|
if (inputValue !== currentInput) {
|
|
349
|
-
|
|
348
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
349
|
+
const inputEl = this.inputElement;
|
|
350
350
|
// we can only stripe the characters, so try to make the best guess where the cursor should be
|
|
351
351
|
const selectionStart = inputEl.selectionStart || 0;
|
|
352
352
|
const selectionEnd = inputEl.selectionEnd || 0;
|
|
@@ -606,13 +606,60 @@ let NumberField = class NumberField extends ControlElement {
|
|
|
606
606
|
return !hasError;
|
|
607
607
|
}
|
|
608
608
|
/**
|
|
609
|
-
*
|
|
610
|
-
* @
|
|
609
|
+
* @ignore
|
|
610
|
+
* @inheritDoc
|
|
611
611
|
*/
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
612
|
+
/* istanbul ignore next */
|
|
613
|
+
get selectionStart() {
|
|
614
|
+
return null;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* @ignore
|
|
618
|
+
* @inheritDoc
|
|
619
|
+
*/
|
|
620
|
+
/* istanbul ignore next */
|
|
621
|
+
set selectionStart(index) {
|
|
622
|
+
throw new Error('Failed to set the \'selectionStart\' property on \'NumberField\': The element does not support selection.');
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* @ignore
|
|
626
|
+
* @inheritDoc
|
|
627
|
+
*/
|
|
628
|
+
/* istanbul ignore next */
|
|
629
|
+
get selectionEnd() {
|
|
630
|
+
return null;
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* @ignore
|
|
634
|
+
* @inheritDoc
|
|
635
|
+
*/
|
|
636
|
+
/* istanbul ignore next */
|
|
637
|
+
set selectionEnd(index) {
|
|
638
|
+
throw new Error('Failed to set the \'selectionEnd\' property on \'NumberField\': The element does not support selection.');
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* @ignore
|
|
642
|
+
* @inheritDoc
|
|
643
|
+
*/
|
|
644
|
+
/* istanbul ignore next */
|
|
645
|
+
get selectionDirection() {
|
|
646
|
+
return null;
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* @ignore
|
|
650
|
+
* @inheritDoc
|
|
651
|
+
*/
|
|
652
|
+
/* istanbul ignore next */
|
|
653
|
+
set selectionDirection(direction) {
|
|
654
|
+
throw new Error('Failed to set the \'selectionDirection\' property on \'NumberField\': The element does not support selection.');
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* @ignore
|
|
658
|
+
* @inheritDoc
|
|
659
|
+
*/
|
|
660
|
+
/* istanbul ignore next */
|
|
661
|
+
setSelectionRange(startSelection, endSelection, selectionDirection) {
|
|
662
|
+
throw new Error('Failed to execute \'setSelectionRange\' on \'NumberField\': The element does not support selection.');
|
|
616
663
|
}
|
|
617
664
|
/**
|
|
618
665
|
* Renders spinner
|
|
@@ -638,6 +685,21 @@ let NumberField = class NumberField extends ControlElement {
|
|
|
638
685
|
</div>
|
|
639
686
|
`;
|
|
640
687
|
}
|
|
688
|
+
/**
|
|
689
|
+
* Decorate `<input>` element with common properties extended from form field element:
|
|
690
|
+
* type="text" - always `text`
|
|
691
|
+
* part="input" - always "input", used for styling
|
|
692
|
+
* inputmode="decimal" - show decimals keyboard by default
|
|
693
|
+
* pattern="'^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$'" - numbers only
|
|
694
|
+
* role="spinbutton" - number field is actually a spinner
|
|
695
|
+
* aria-valuenow - current value or 0
|
|
696
|
+
* @keydown - Listener for `keydown` event. Runs `this.onInputKeyDown`
|
|
697
|
+
* @beforeinput - Listener for `beforeinput` event. Runs `this.onBeforeInputChange`
|
|
698
|
+
* @returns template map
|
|
699
|
+
*/
|
|
700
|
+
get decorateInputMap() {
|
|
701
|
+
return Object.assign(Object.assign({}, super.decorateInputMap), { 'type': 'text', 'part': 'input', 'inputmode': 'decimal', 'pattern': NUMBER_PATTERN, 'role': 'spinbutton', 'aria-valuenow': `${this.value || 0}`, '@keydown': this.onInputKeyDown, '@beforeinput': this.onBeforeInputChange });
|
|
702
|
+
}
|
|
641
703
|
/**
|
|
642
704
|
* A `TemplateResult` that will be used
|
|
643
705
|
* to render the updated internal template.
|
|
@@ -645,27 +707,10 @@ let NumberField = class NumberField extends ControlElement {
|
|
|
645
707
|
*/
|
|
646
708
|
render() {
|
|
647
709
|
return html `
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
type="text"
|
|
651
|
-
inputmode="decimal"
|
|
652
|
-
pattern="${NUMBER_PATTERN}"
|
|
653
|
-
?readonly=${this.readonly}
|
|
654
|
-
?disabled=${this.disabled}
|
|
655
|
-
placeholder=${ifDefined(this.placeholder ? this.placeholder : undefined)}
|
|
656
|
-
@input="${this.onNativeInputChange}"
|
|
657
|
-
@keydown="${this.onNativeInputKeyDown}"
|
|
658
|
-
@beforeinput="${this.onNativeBeforeInputChange}"
|
|
659
|
-
@change="${this.onNativeInputChange}"
|
|
660
|
-
autocomplete="off"
|
|
661
|
-
>
|
|
662
|
-
${this.noSpinner ? null : this.renderSpinner()}
|
|
663
|
-
`;
|
|
710
|
+
${super.render()}
|
|
711
|
+
${this.noSpinner ? null : this.renderSpinner()}`;
|
|
664
712
|
}
|
|
665
713
|
};
|
|
666
|
-
__decorate([
|
|
667
|
-
property({ type: String, reflect: true })
|
|
668
|
-
], NumberField.prototype, "placeholder", void 0);
|
|
669
714
|
__decorate([
|
|
670
715
|
property({ type: Boolean, attribute: 'no-spinner', reflect: true })
|
|
671
716
|
], NumberField.prototype, "noSpinner", void 0);
|
|
@@ -678,21 +723,9 @@ __decorate([
|
|
|
678
723
|
__decorate([
|
|
679
724
|
property({ type: String, reflect: true })
|
|
680
725
|
], NumberField.prototype, "max", void 0);
|
|
681
|
-
__decorate([
|
|
682
|
-
property({ type: Boolean, reflect: true })
|
|
683
|
-
], NumberField.prototype, "transparent", void 0);
|
|
684
|
-
__decorate([
|
|
685
|
-
property({ type: Boolean, reflect: true })
|
|
686
|
-
], NumberField.prototype, "error", void 0);
|
|
687
|
-
__decorate([
|
|
688
|
-
property({ type: Boolean, reflect: true })
|
|
689
|
-
], NumberField.prototype, "warning", void 0);
|
|
690
726
|
__decorate([
|
|
691
727
|
property({ type: String })
|
|
692
728
|
], NumberField.prototype, "value", null);
|
|
693
|
-
__decorate([
|
|
694
|
-
query('[part=input]')
|
|
695
|
-
], NumberField.prototype, "inputEl", void 0);
|
|
696
729
|
__decorate([
|
|
697
730
|
query('[part=spinner-up]')
|
|
698
731
|
], NumberField.prototype, "spinnerUpEl", void 0);
|
|
@@ -31,23 +31,28 @@
|
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"name": "transition-style",
|
|
34
|
-
"description": "Set the transition style"
|
|
34
|
+
"description": "Set the transition style",
|
|
35
|
+
"type": "TransitionStyle|null|undefined"
|
|
35
36
|
},
|
|
36
37
|
{
|
|
37
38
|
"name": "z-index",
|
|
38
|
-
"description": "Set a preferable z-index to override automatically calculated z-index"
|
|
39
|
+
"description": "Set a preferable z-index to override automatically calculated z-index",
|
|
40
|
+
"type": "number|null|undefined"
|
|
39
41
|
},
|
|
40
42
|
{
|
|
41
43
|
"name": "x",
|
|
42
|
-
"description": "Set a specific x coordinate"
|
|
44
|
+
"description": "Set a specific x coordinate",
|
|
45
|
+
"type": "number|null|undefined"
|
|
43
46
|
},
|
|
44
47
|
{
|
|
45
48
|
"name": "y",
|
|
46
|
-
"description": "Set a specific y coordinate"
|
|
49
|
+
"description": "Set a specific y coordinate",
|
|
50
|
+
"type": "number|null|undefined"
|
|
47
51
|
},
|
|
48
52
|
{
|
|
49
53
|
"name": "position-target",
|
|
50
|
-
"description": "Set the position target as follows:\n- HTMLElement if overlay is position next to the HTML element\n- String containing `top`, `right`, `left`, `bottom`, `center` combinations to position against the screen.\nFor instance: `top left` - put the overlay at `top left` point of the screen; `bottom` - put overlay at `bottom center` point of the screen"
|
|
54
|
+
"description": "Set the position target as follows:\n- HTMLElement if overlay is position next to the HTML element\n- String containing `top`, `right`, `left`, `bottom`, `center` combinations to position against the screen.\nFor instance: `top left` - put the overlay at `top left` point of the screen; `bottom` - put overlay at `bottom center` point of the screen",
|
|
55
|
+
"type": "PositionTarget|null|undefined"
|
|
51
56
|
},
|
|
52
57
|
{
|
|
53
58
|
"name": "horizontal-offset",
|
|
@@ -159,27 +164,32 @@
|
|
|
159
164
|
{
|
|
160
165
|
"name": "transitionStyle",
|
|
161
166
|
"attribute": "transition-style",
|
|
162
|
-
"description": "Set the transition style"
|
|
167
|
+
"description": "Set the transition style",
|
|
168
|
+
"type": "TransitionStyle|null|undefined"
|
|
163
169
|
},
|
|
164
170
|
{
|
|
165
171
|
"name": "zIndex",
|
|
166
172
|
"attribute": "z-index",
|
|
167
|
-
"description": "Set a preferable z-index to override automatically calculated z-index"
|
|
173
|
+
"description": "Set a preferable z-index to override automatically calculated z-index",
|
|
174
|
+
"type": "number|null|undefined"
|
|
168
175
|
},
|
|
169
176
|
{
|
|
170
177
|
"name": "x",
|
|
171
178
|
"attribute": "x",
|
|
172
|
-
"description": "Set a specific x coordinate"
|
|
179
|
+
"description": "Set a specific x coordinate",
|
|
180
|
+
"type": "number|null|undefined"
|
|
173
181
|
},
|
|
174
182
|
{
|
|
175
183
|
"name": "y",
|
|
176
184
|
"attribute": "y",
|
|
177
|
-
"description": "Set a specific y coordinate"
|
|
185
|
+
"description": "Set a specific y coordinate",
|
|
186
|
+
"type": "number|null|undefined"
|
|
178
187
|
},
|
|
179
188
|
{
|
|
180
189
|
"name": "positionTarget",
|
|
181
190
|
"attribute": "position-target",
|
|
182
|
-
"description": "Set the position target as follows:\n- HTMLElement if overlay is position next to the HTML element\n- String containing `top`, `right`, `left`, `bottom`, `center` combinations to position against the screen.\nFor instance: `top left` - put the overlay at `top left` point of the screen; `bottom` - put overlay at `bottom center` point of the screen"
|
|
191
|
+
"description": "Set the position target as follows:\n- HTMLElement if overlay is position next to the HTML element\n- String containing `top`, `right`, `left`, `bottom`, `center` combinations to position against the screen.\nFor instance: `top left` - put the overlay at `top left` point of the screen; `bottom` - put overlay at `bottom center` point of the screen",
|
|
192
|
+
"type": "PositionTarget|null|undefined"
|
|
183
193
|
},
|
|
184
194
|
{
|
|
185
195
|
"name": "horizontalOffset",
|
|
@@ -278,7 +288,7 @@
|
|
|
278
288
|
"type": "{} | undefined"
|
|
279
289
|
},
|
|
280
290
|
{
|
|
281
|
-
"name": "positionTargetConfig",
|
|
291
|
+
"name": "positionTargetConfig (readonly)",
|
|
282
292
|
"description": "Get position target configuration based on positionTarget and fullScreen properties\nUsed for caching and calculations"
|
|
283
293
|
},
|
|
284
294
|
{
|
|
@@ -287,12 +297,12 @@
|
|
|
287
297
|
"default": "\"this\""
|
|
288
298
|
},
|
|
289
299
|
{
|
|
290
|
-
"name": "fullyOpened",
|
|
300
|
+
"name": "fullyOpened (readonly)",
|
|
291
301
|
"description": "Returns true if the overlay is opened and animation is not running.\nReturns false if overlay is closed and animation is not running",
|
|
292
302
|
"type": "boolean"
|
|
293
303
|
},
|
|
294
304
|
{
|
|
295
|
-
"name": "transitioning",
|
|
305
|
+
"name": "transitioning (readonly)",
|
|
296
306
|
"description": "Returns true if overlay is doing opening or closing transition",
|
|
297
307
|
"type": "boolean"
|
|
298
308
|
}
|
|
@@ -313,6 +323,9 @@
|
|
|
313
323
|
{
|
|
314
324
|
"name": "opened-changed",
|
|
315
325
|
"description": "Dispatched when when open attribute changes internally. Prevent default to stop opening/closing pipeline"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"name": "animationiteration"
|
|
316
329
|
}
|
|
317
330
|
],
|
|
318
331
|
"methods": [
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# ef-overlay
|
|
2
|
+
|
|
3
|
+
Element to help building modals, dialogs and other overlay content
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Attribute | Type | Default | Description |
|
|
8
|
+
|-----------------------------------|------------------------------|------------------------------------|---------|--------------------------------------------------|
|
|
9
|
+
| `focusBoundary` | | | "this" | Set focus boundary to restrict tabbing. Default's overlay itself.<br />If external focus is required, set to null |
|
|
10
|
+
| `fullScreen` | `full-screen` | `boolean` | false | Set to true to show overlay in full screen mode |
|
|
11
|
+
| `fullyOpened (readonly)` | | `boolean` | | Returns true if the overlay is opened and animation is not running.<br />Returns false if overlay is closed and animation is not running |
|
|
12
|
+
| `horizontalOffset` | `horizontal-offset` | `number` | 0 | A pixel value that will be added to the position calculated on the horizontal axis.<br />The offset will be applied either to the `left` or `right` depending on the `positionTarget` |
|
|
13
|
+
| `interactiveElements` | | `object` | [] | A list of elements, which are active when overlay is opened<br />Valid only if noInteractionLock is false (default) |
|
|
14
|
+
| `lockPositionTarget` | `lock-position-target` | `boolean` | false | True to lock position target<br />Valid only if noInteractionLock is false (default) |
|
|
15
|
+
| `noAutofocus` | `no-autofocus` | `boolean` | false | Set to true to disable autofocusing the overlay or open |
|
|
16
|
+
| `noCancelOnEscKey` | `no-cancel-on-esc-key` | `boolean` | false | Set to true to disable canceling the overlay with the ESC key |
|
|
17
|
+
| `noCancelOnOutsideClick` | `no-cancel-on-outside-click` | `boolean` | false | Set to true to disable canceling the overlay by clicking outside it |
|
|
18
|
+
| `noFocusManagement` | `no-focus-management` | `boolean` | false | True to not apply focus management.<br />The overlay will not limit Tab behaviour or do auto-focusing |
|
|
19
|
+
| `noInteractionLock` | `no-interaction-lock` | `boolean` | false | Stop preventing user interaction when overlay is visible |
|
|
20
|
+
| `noOverlap` | `no-overlap` | `boolean` | false | True to not overlap positionTarget |
|
|
21
|
+
| `offset` | `offset` | `number` | 0 | A pixel value that will be added to the position calculated on the vertical or horizontal axis.<br />The offset is applied dynamically depending on the `positionTarget` |
|
|
22
|
+
| `opened` | `opened` | `boolean` | false | True if the overlay is currently displayed |
|
|
23
|
+
| `position` | `position` | `{} \| undefined` | | Set position and align against the attach target.<br />Position may contain a single word or a comma separated list to set the priority.<br />Position is not applied if `attachTarget` is not HTML Element.<br />For instance: `[bottom-middle, top-middle]` - default position is bottom-middle, if cannot fit position top-middle;<br />or `[left, right]` - align is not set, set best position on the left or right<br /><br />Position can be: `top`, `right`, `bottom`, `left`, `center`<br />Align can be: `start`, `middle`, `end` |
|
|
24
|
+
| `positionTarget` | `position-target` | `PositionTarget\|null\|undefined` | | Set the position target as follows:<br />- HTMLElement if overlay is position next to the HTML element<br />- String containing `top`, `right`, `left`, `bottom`, `center` combinations to position against the screen.<br />For instance: `top left` - put the overlay at `top left` point of the screen; `bottom` - put overlay at `bottom center` point of the screen |
|
|
25
|
+
| `positionTargetConfig (readonly)` | | | | Get position target configuration based on positionTarget and fullScreen properties<br />Used for caching and calculations |
|
|
26
|
+
| `spacing` | `spacing` | `boolean` | false | True to apply spacing for overlay content |
|
|
27
|
+
| `transitionStyle` | `transition-style` | `TransitionStyle\|null\|undefined` | | Set the transition style |
|
|
28
|
+
| `transitioning (readonly)` | | `boolean` | | Returns true if overlay is doing opening or closing transition |
|
|
29
|
+
| `transparent` | `transparent` | `boolean` | false | True to make overlay background transparent |
|
|
30
|
+
| `verticalOffset` | `vertical-offset` | `number` | 0 | A pixel value that will be added to the position calculated on the vertical axis.<br />The offset will be applied either to the `top` or `bottom` depending on the `positionTarget` |
|
|
31
|
+
| `withBackdrop` | `with-backdrop` | `boolean` | false | True to show backdrop |
|
|
32
|
+
| `withShadow` | `with-shadow` | `boolean` | false | True to add shadow |
|
|
33
|
+
| `x` | `x` | `number\|null\|undefined` | | Set a specific x coordinate |
|
|
34
|
+
| `y` | `y` | `number\|null\|undefined` | | Set a specific y coordinate |
|
|
35
|
+
| `zIndex` | `z-index` | `number\|null\|undefined` | | Set a preferable z-index to override automatically calculated z-index |
|
|
36
|
+
|
|
37
|
+
## Methods
|
|
38
|
+
|
|
39
|
+
| Method | Type | Description |
|
|
40
|
+
|---------------|------------|--------------------------------------------------|
|
|
41
|
+
| `clearCached` | `(): void` | Clear all cached values.<br />Run when external changes occur to styles to re-calculate position. |
|
|
42
|
+
| `fit` | `(): void` | Fit the overlay panel |
|
|
43
|
+
| `refit` | `(): void` | Clear all cached values and fit the overlay.<br />Use this function if any of `maxWidth`, `maxHeight`, `minWidth`, `minHeight`, `height` or `width` changed |
|
|
44
|
+
| `toFront` | `(): void` | Move overlay to front of other overlays |
|
|
45
|
+
|
|
46
|
+
## Events
|
|
47
|
+
|
|
48
|
+
| Event | Description |
|
|
49
|
+
|----------------------|--------------------------------------------------|
|
|
50
|
+
| `animationiteration` | |
|
|
51
|
+
| `closed` | Dispatched when overlay becomes invisible and close animation finishes |
|
|
52
|
+
| `opened` | Dispatched when the overlay becomes visible and the open animation finishes |
|
|
53
|
+
| `opened-changed` | Dispatched when when open attribute changes internally. Prevent default to stop opening/closing pipeline |
|
|
54
|
+
| `refit` | Dispatched when refit algorithm finishes calculations |
|
|
@@ -43,18 +43,22 @@ export declare class Overlay extends ResponsiveElement {
|
|
|
43
43
|
spacing: boolean;
|
|
44
44
|
/**
|
|
45
45
|
* Set the transition style
|
|
46
|
+
* @type {TransitionStyle|null|undefined}
|
|
46
47
|
*/
|
|
47
48
|
transitionStyle: TransitionStyle | NullOrUndefined;
|
|
48
49
|
/**
|
|
49
50
|
* Set a preferable z-index to override automatically calculated z-index
|
|
51
|
+
* @type {number|null|undefined}
|
|
50
52
|
*/
|
|
51
53
|
zIndex: number | NullOrUndefined;
|
|
52
54
|
/**
|
|
53
55
|
* Set a specific x coordinate
|
|
56
|
+
* @type {number|null|undefined}
|
|
54
57
|
*/
|
|
55
58
|
x: number | NullOrUndefined;
|
|
56
59
|
/**
|
|
57
60
|
* Set a specific y coordinate
|
|
61
|
+
* @type {number|null|undefined}
|
|
58
62
|
*/
|
|
59
63
|
y: number | NullOrUndefined;
|
|
60
64
|
/**
|
|
@@ -62,6 +66,7 @@ export declare class Overlay extends ResponsiveElement {
|
|
|
62
66
|
* - HTMLElement if overlay is position next to the HTML element
|
|
63
67
|
* - String containing `top`, `right`, `left`, `bottom`, `center` combinations to position against the screen.
|
|
64
68
|
* For instance: `top left` - put the overlay at `top left` point of the screen; `bottom` - put overlay at `bottom center` point of the screen
|
|
69
|
+
* @type {PositionTarget|null|undefined}
|
|
65
70
|
*/
|
|
66
71
|
positionTarget: HTMLElement | PositionTarget | NullOrUndefined;
|
|
67
72
|
/**
|