@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,140 +1,68 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { PropertyValues } from '@refinitiv-ui/core';
|
|
3
3
|
import '../icon/index.js';
|
|
4
|
+
import { TextField } from '../text-field/index.js';
|
|
5
|
+
import { TemplateMap } from '@refinitiv-ui/core/lib/directives/template-map.js';
|
|
4
6
|
/**
|
|
5
|
-
* A form control element for email
|
|
7
|
+
* A form control element for email.
|
|
6
8
|
*
|
|
7
9
|
* @fires value-changed - Dispatched when value changes
|
|
8
10
|
* @fires error-changed - Dispatched when error state changes
|
|
11
|
+
* @fires icon-click - Dispatched when icon is clicked
|
|
9
12
|
*
|
|
10
|
-
* @attr {
|
|
11
|
-
* @prop {
|
|
13
|
+
* @attr {boolean} disabled - Set disabled state
|
|
14
|
+
* @prop {boolean} [disabled=false] - Set disabled state
|
|
15
|
+
*
|
|
16
|
+
* @attr {boolean} error - Set error state
|
|
17
|
+
* @prop {boolean} [error=false] - Set error state
|
|
18
|
+
*
|
|
19
|
+
* @attr {string} icon - Specify icon to display in input. Value can be icon name
|
|
20
|
+
* @prop {string | null} [icon=null] - Specify icon to display in input. Value can be icon name
|
|
21
|
+
*
|
|
22
|
+
* @attr {boolean} icon-has-action - Specify when icon need to be clickable
|
|
23
|
+
* @prop {boolean} [iconHasAction=false] - Specify when icon need to be clickable
|
|
24
|
+
*
|
|
25
|
+
* @attr {number} maxlength - Set character max limit
|
|
26
|
+
* @prop {number | null} [maxLength=null] - Set character max limit
|
|
27
|
+
*
|
|
28
|
+
* @attr {number} minlength - Set character min limit
|
|
29
|
+
* @prop {number | null} [minLength=null] - Set character min limit
|
|
30
|
+
*
|
|
31
|
+
* @prop {string} [pattern=""] - Set regular expression for input validation
|
|
32
|
+
*
|
|
33
|
+
* @attr {string} placeholder - Set placeholder text
|
|
34
|
+
* @prop {string} [placeholder=""] - Set placeholder text
|
|
12
35
|
*
|
|
13
36
|
* @attr {boolean} readonly - Set readonly state
|
|
14
37
|
* @prop {boolean} [readonly=false] - Set readonly state
|
|
15
38
|
*
|
|
16
|
-
* @attr {boolean}
|
|
17
|
-
* @prop {boolean} [
|
|
39
|
+
* @attr {boolean} transparent - Disables all other states and border/background styles.
|
|
40
|
+
* @prop {boolean} [transparent=false] - Disables all other states and border/background styles.
|
|
41
|
+
*
|
|
42
|
+
* @attr {boolean} warning - Set warning state
|
|
43
|
+
* @prop {boolean} [warning=false] - Set warning state
|
|
44
|
+
*
|
|
45
|
+
* @attr {string} value - Input's value
|
|
46
|
+
* @prop {string} [value=""] - Input's value
|
|
18
47
|
*/
|
|
19
|
-
export declare class EmailField extends
|
|
20
|
-
/**
|
|
21
|
-
* Element version number
|
|
22
|
-
* @returns version number
|
|
23
|
-
*/
|
|
24
|
-
static get version(): string;
|
|
25
|
-
/**
|
|
26
|
-
* A `CSSResultGroup` that will be used
|
|
27
|
-
* to style the host, slotted children
|
|
28
|
-
* and the internal template of the element.
|
|
29
|
-
* @return CSS template
|
|
30
|
-
*/
|
|
31
|
-
static get styles(): CSSResultGroup;
|
|
32
|
-
/**
|
|
33
|
-
* Set regular expression for input validation
|
|
34
|
-
*/
|
|
35
|
-
pattern: string;
|
|
36
|
-
/**
|
|
37
|
-
* Set placeholder text
|
|
38
|
-
*/
|
|
39
|
-
placeholder: string;
|
|
40
|
-
/**
|
|
41
|
-
* Set state to error
|
|
42
|
-
*/
|
|
43
|
-
error: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Set state to warning
|
|
46
|
-
*/
|
|
47
|
-
warning: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Disables all other states and border/background styles.
|
|
50
|
-
* Use with advanced composite elements requiring e.g. multi selection in
|
|
51
|
-
* combo-box when parent container handles element states.
|
|
52
|
-
*/
|
|
53
|
-
transparent: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Set character max limit
|
|
56
|
-
*/
|
|
57
|
-
maxLength: number | null;
|
|
58
|
-
/**
|
|
59
|
-
* Set character min limit
|
|
60
|
-
*/
|
|
61
|
-
minLength: number | null;
|
|
48
|
+
export declare class EmailField extends TextField {
|
|
62
49
|
/**
|
|
63
50
|
* Set to multiple mode, allows multiple emails in a single input
|
|
64
51
|
*/
|
|
65
52
|
multiple: boolean;
|
|
66
53
|
/**
|
|
67
|
-
*
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
* Specify when icon need to be clickable
|
|
72
|
-
*/
|
|
73
|
-
iconHasAction: boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Get native input element from shadow roots
|
|
54
|
+
* Decorate `<input>` element with common properties extended from text-field:
|
|
55
|
+
* type="email" - always `email`
|
|
56
|
+
* multiple - defined if supports multiple emails
|
|
57
|
+
* @returns template map
|
|
76
58
|
*/
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Select the contents of input
|
|
80
|
-
* @returns {void}
|
|
81
|
-
*/
|
|
82
|
-
select(): void;
|
|
83
|
-
/**
|
|
84
|
-
* Called when the element’s DOM has been updated and rendered
|
|
85
|
-
* @param changedProperties Properties that has changed
|
|
86
|
-
* @returns {void}
|
|
87
|
-
*/
|
|
88
|
-
protected updated(changedProperties: PropertyValues): void;
|
|
59
|
+
protected get decorateInputMap(): TemplateMap;
|
|
89
60
|
/**
|
|
90
61
|
* Check if input should be re-validated
|
|
91
62
|
* @param changedProperties Properties that has changed
|
|
92
63
|
* @returns True if input should be re-validated
|
|
93
64
|
*/
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Check if value is changed and fire event
|
|
97
|
-
* @returns {void}
|
|
98
|
-
*/
|
|
99
|
-
private onPossibleValueChange;
|
|
100
|
-
/**
|
|
101
|
-
* Validate input according `pattern`, `minLength` and `maxLength` properties
|
|
102
|
-
* change state of `error` property according pattern validation
|
|
103
|
-
* @returns {void}
|
|
104
|
-
*/
|
|
105
|
-
private validateInput;
|
|
106
|
-
/**
|
|
107
|
-
* @param error existing state of error
|
|
108
|
-
* @returns true if there is no error and browser is IE11 and minLength more than 0 and value exists
|
|
109
|
-
*/
|
|
110
|
-
private shouldValidateForMinLength;
|
|
111
|
-
/**
|
|
112
|
-
* Detect `enter` and `space` keydown and fire
|
|
113
|
-
* @param event keydown event
|
|
114
|
-
* @returns {void}
|
|
115
|
-
*/
|
|
116
|
-
private handleKeyDown;
|
|
117
|
-
/**
|
|
118
|
-
* Process internal icon click and fire `icon-click` event
|
|
119
|
-
* @returns {void}
|
|
120
|
-
*/
|
|
121
|
-
private iconClick;
|
|
122
|
-
/**
|
|
123
|
-
* Fire event on `icon` click
|
|
124
|
-
* @returns {void}
|
|
125
|
-
*/
|
|
126
|
-
private notifyIcon;
|
|
127
|
-
/**
|
|
128
|
-
* Renders icon element if property present
|
|
129
|
-
* @returns {TemplateResult | null} Template result
|
|
130
|
-
*/
|
|
131
|
-
private renderIcon;
|
|
132
|
-
/**
|
|
133
|
-
* A `TemplateResult` that will be used
|
|
134
|
-
* to render the updated internal template.
|
|
135
|
-
* @return {TemplateResult} Render template
|
|
136
|
-
*/
|
|
137
|
-
protected render(): TemplateResult;
|
|
65
|
+
protected shouldValidateInput(changedProperties: PropertyValues): boolean;
|
|
138
66
|
}
|
|
139
67
|
|
|
140
68
|
declare global {
|
|
@@ -144,7 +72,7 @@ declare global {
|
|
|
144
72
|
|
|
145
73
|
namespace JSX {
|
|
146
74
|
interface IntrinsicElements {
|
|
147
|
-
'ef-email-field': Partial<EmailField> | JSXInterface.
|
|
75
|
+
'ef-email-field': Partial<EmailField> | JSXInterface.HTMLAttributes<EmailField>;
|
|
148
76
|
}
|
|
149
77
|
}
|
|
150
78
|
}
|
package/lib/email-field/index.js
CHANGED
|
@@ -1,283 +1,83 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { ControlElement, css, html } from '@refinitiv-ui/core';
|
|
3
2
|
import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
|
|
4
3
|
import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
|
|
5
|
-
import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
|
|
6
|
-
import { ifDefined } from '@refinitiv-ui/core/lib/directives/if-defined.js';
|
|
7
|
-
import { VERSION } from '../version.js';
|
|
8
|
-
import { isIE } from '@refinitiv-ui/utils/lib/browser.js';
|
|
9
4
|
import '../icon/index.js';
|
|
10
|
-
|
|
5
|
+
import { TextField } from '../text-field/index.js';
|
|
11
6
|
/**
|
|
12
|
-
* A form control element for email
|
|
7
|
+
* A form control element for email.
|
|
13
8
|
*
|
|
14
9
|
* @fires value-changed - Dispatched when value changes
|
|
15
10
|
* @fires error-changed - Dispatched when error state changes
|
|
11
|
+
* @fires icon-click - Dispatched when icon is clicked
|
|
16
12
|
*
|
|
17
|
-
* @attr {
|
|
18
|
-
* @prop {
|
|
13
|
+
* @attr {boolean} disabled - Set disabled state
|
|
14
|
+
* @prop {boolean} [disabled=false] - Set disabled state
|
|
15
|
+
*
|
|
16
|
+
* @attr {boolean} error - Set error state
|
|
17
|
+
* @prop {boolean} [error=false] - Set error state
|
|
18
|
+
*
|
|
19
|
+
* @attr {string} icon - Specify icon to display in input. Value can be icon name
|
|
20
|
+
* @prop {string | null} [icon=null] - Specify icon to display in input. Value can be icon name
|
|
21
|
+
*
|
|
22
|
+
* @attr {boolean} icon-has-action - Specify when icon need to be clickable
|
|
23
|
+
* @prop {boolean} [iconHasAction=false] - Specify when icon need to be clickable
|
|
24
|
+
*
|
|
25
|
+
* @attr {number} maxlength - Set character max limit
|
|
26
|
+
* @prop {number | null} [maxLength=null] - Set character max limit
|
|
27
|
+
*
|
|
28
|
+
* @attr {number} minlength - Set character min limit
|
|
29
|
+
* @prop {number | null} [minLength=null] - Set character min limit
|
|
30
|
+
*
|
|
31
|
+
* @prop {string} [pattern=""] - Set regular expression for input validation
|
|
32
|
+
*
|
|
33
|
+
* @attr {string} placeholder - Set placeholder text
|
|
34
|
+
* @prop {string} [placeholder=""] - Set placeholder text
|
|
19
35
|
*
|
|
20
36
|
* @attr {boolean} readonly - Set readonly state
|
|
21
37
|
* @prop {boolean} [readonly=false] - Set readonly state
|
|
22
38
|
*
|
|
23
|
-
* @attr {boolean}
|
|
24
|
-
* @prop {boolean} [
|
|
39
|
+
* @attr {boolean} transparent - Disables all other states and border/background styles.
|
|
40
|
+
* @prop {boolean} [transparent=false] - Disables all other states and border/background styles.
|
|
41
|
+
*
|
|
42
|
+
* @attr {boolean} warning - Set warning state
|
|
43
|
+
* @prop {boolean} [warning=false] - Set warning state
|
|
44
|
+
*
|
|
45
|
+
* @attr {string} value - Input's value
|
|
46
|
+
* @prop {string} [value=""] - Input's value
|
|
25
47
|
*/
|
|
26
|
-
let EmailField = class EmailField extends
|
|
48
|
+
let EmailField = class EmailField extends TextField {
|
|
27
49
|
constructor() {
|
|
28
50
|
super(...arguments);
|
|
29
|
-
/**
|
|
30
|
-
* Set regular expression for input validation
|
|
31
|
-
*/
|
|
32
|
-
this.pattern = '';
|
|
33
|
-
/**
|
|
34
|
-
* Set placeholder text
|
|
35
|
-
*/
|
|
36
|
-
this.placeholder = '';
|
|
37
|
-
/**
|
|
38
|
-
* Set state to error
|
|
39
|
-
*/
|
|
40
|
-
this.error = false;
|
|
41
|
-
/**
|
|
42
|
-
* Set state to warning
|
|
43
|
-
*/
|
|
44
|
-
this.warning = false;
|
|
45
|
-
/**
|
|
46
|
-
* Disables all other states and border/background styles.
|
|
47
|
-
* Use with advanced composite elements requiring e.g. multi selection in
|
|
48
|
-
* combo-box when parent container handles element states.
|
|
49
|
-
*/
|
|
50
|
-
this.transparent = false;
|
|
51
|
-
/**
|
|
52
|
-
* Set character max limit
|
|
53
|
-
*/
|
|
54
|
-
this.maxLength = null;
|
|
55
|
-
/**
|
|
56
|
-
* Set character min limit
|
|
57
|
-
*/
|
|
58
|
-
this.minLength = null;
|
|
59
51
|
/**
|
|
60
52
|
* Set to multiple mode, allows multiple emails in a single input
|
|
61
53
|
*/
|
|
62
54
|
this.multiple = false;
|
|
63
|
-
/**
|
|
64
|
-
* Specify icon to display in input. Value can be icon name
|
|
65
|
-
*/
|
|
66
|
-
this.icon = '';
|
|
67
|
-
/**
|
|
68
|
-
* Specify when icon need to be clickable
|
|
69
|
-
*/
|
|
70
|
-
this.iconHasAction = false;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Element version number
|
|
74
|
-
* @returns version number
|
|
75
|
-
*/
|
|
76
|
-
static get version() {
|
|
77
|
-
return VERSION;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* A `CSSResultGroup` that will be used
|
|
81
|
-
* to style the host, slotted children
|
|
82
|
-
* and the internal template of the element.
|
|
83
|
-
* @return CSS template
|
|
84
|
-
*/
|
|
85
|
-
static get styles() {
|
|
86
|
-
return css `
|
|
87
|
-
:host {
|
|
88
|
-
display: inline-block;
|
|
89
|
-
}
|
|
90
|
-
:host(:focus), :host input:focus {
|
|
91
|
-
outline: none;
|
|
92
|
-
}
|
|
93
|
-
[part=input] {
|
|
94
|
-
font: inherit;
|
|
95
|
-
background: none;
|
|
96
|
-
color: currentColor;
|
|
97
|
-
border: none;
|
|
98
|
-
text-align: inherit;
|
|
99
|
-
}
|
|
100
|
-
:host [part=icon]{
|
|
101
|
-
display: flex;
|
|
102
|
-
outline: none;
|
|
103
|
-
}
|
|
104
|
-
:host([transparent]) {
|
|
105
|
-
background: none !important;
|
|
106
|
-
border: none !important;
|
|
107
|
-
}
|
|
108
|
-
:host([icon][icon-has-action]) [part=icon] {
|
|
109
|
-
cursor: pointer;
|
|
110
|
-
}
|
|
111
|
-
`;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Select the contents of input
|
|
115
|
-
* @returns {void}
|
|
116
|
-
*/
|
|
117
|
-
/* istanbul ignore next */
|
|
118
|
-
select() {
|
|
119
|
-
if (!this.disabled && !this.readonly) {
|
|
120
|
-
this.inputElement.select();
|
|
121
|
-
}
|
|
122
55
|
}
|
|
123
56
|
/**
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
57
|
+
* Decorate `<input>` element with common properties extended from text-field:
|
|
58
|
+
* type="email" - always `email`
|
|
59
|
+
* multiple - defined if supports multiple emails
|
|
60
|
+
* @returns template map
|
|
127
61
|
*/
|
|
128
|
-
|
|
129
|
-
super.
|
|
130
|
-
if (this.inputElement.value !== this.value) {
|
|
131
|
-
this.inputElement.value = this.value;
|
|
132
|
-
}
|
|
133
|
-
if (this.shouldValidateInput(changedProperties)) {
|
|
134
|
-
this.validateInput();
|
|
135
|
-
}
|
|
62
|
+
get decorateInputMap() {
|
|
63
|
+
return Object.assign(Object.assign({}, super.decorateInputMap), { 'type': 'email', 'inputmode': 'email', 'multiple': this.multiple });
|
|
136
64
|
}
|
|
137
65
|
/**
|
|
138
66
|
* Check if input should be re-validated
|
|
139
67
|
* @param changedProperties Properties that has changed
|
|
140
68
|
* @returns True if input should be re-validated
|
|
141
69
|
*/
|
|
70
|
+
/* istanbul ignore next */
|
|
142
71
|
shouldValidateInput(changedProperties) {
|
|
72
|
+
// TODO: This validation should be refactored
|
|
143
73
|
return changedProperties.has('value')
|
|
144
|
-
|| changedProperties.has('
|
|
145
|
-
||
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Check if value is changed and fire event
|
|
149
|
-
* @returns {void}
|
|
150
|
-
*/
|
|
151
|
-
onPossibleValueChange() {
|
|
152
|
-
const value = this.inputElement.value;
|
|
153
|
-
this.setValueAndNotify(value);
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Validate input according `pattern`, `minLength` and `maxLength` properties
|
|
157
|
-
* change state of `error` property according pattern validation
|
|
158
|
-
* @returns {void}
|
|
159
|
-
*/
|
|
160
|
-
validateInput() {
|
|
161
|
-
let error = !this.inputElement.checkValidity();
|
|
162
|
-
if (this.shouldValidateForMinLength(error)) {
|
|
163
|
-
error = !!this.minLength && (this.minLength > this.value.length);
|
|
164
|
-
}
|
|
165
|
-
if (this.error !== error) {
|
|
166
|
-
this.error = error;
|
|
167
|
-
this.notifyPropertyChange('error', this.error);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* @param error existing state of error
|
|
172
|
-
* @returns true if there is no error and browser is IE11 and minLength more than 0 and value exists
|
|
173
|
-
*/
|
|
174
|
-
shouldValidateForMinLength(error) {
|
|
175
|
-
return !!(!error && isIE && this.minLength && !!this.value);
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Detect `enter` and `space` keydown and fire
|
|
179
|
-
* @param event keydown event
|
|
180
|
-
* @returns {void}
|
|
181
|
-
*/
|
|
182
|
-
handleKeyDown(event) {
|
|
183
|
-
if (event.key === 'Spacebar' || event.key === ' ' || event.key === 'Enter') {
|
|
184
|
-
this.notifyIcon();
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Process internal icon click and fire `icon-click` event
|
|
189
|
-
* @returns {void}
|
|
190
|
-
*/
|
|
191
|
-
iconClick() {
|
|
192
|
-
this.notifyIcon();
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Fire event on `icon` click
|
|
196
|
-
* @returns {void}
|
|
197
|
-
*/
|
|
198
|
-
notifyIcon() {
|
|
199
|
-
if (this.iconHasAction) {
|
|
200
|
-
/**
|
|
201
|
-
* Dispatched only when element has icon-has-action attribute and icon is clicked
|
|
202
|
-
*/
|
|
203
|
-
this.dispatchEvent(new CustomEvent('icon-click', { bubbles: false }));
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Renders icon element if property present
|
|
208
|
-
* @returns {TemplateResult | null} Template result
|
|
209
|
-
*/
|
|
210
|
-
renderIcon() {
|
|
211
|
-
return this.icon ? html `
|
|
212
|
-
<ef-icon
|
|
213
|
-
part="icon"
|
|
214
|
-
icon="${this.icon}"
|
|
215
|
-
?readonly="${this.readonly}"
|
|
216
|
-
?disabled="${this.disabled}"
|
|
217
|
-
@tap="${this.iconClick}"
|
|
218
|
-
@keydown="${this.handleKeyDown}"
|
|
219
|
-
tabindex="${ifDefined(this.iconHasAction ? '0' : undefined)}"
|
|
220
|
-
></ef-icon>
|
|
221
|
-
` : null;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* A `TemplateResult` that will be used
|
|
225
|
-
* to render the updated internal template.
|
|
226
|
-
* @return {TemplateResult} Render template
|
|
227
|
-
*/
|
|
228
|
-
render() {
|
|
229
|
-
return html `
|
|
230
|
-
<input
|
|
231
|
-
type="email"
|
|
232
|
-
part="input"
|
|
233
|
-
?readonly="${this.readonly}"
|
|
234
|
-
?disabled="${this.disabled}"
|
|
235
|
-
placeholder="${ifDefined(this.placeholder || undefined)}"
|
|
236
|
-
maxlength="${ifDefined(this.maxLength || undefined)}"
|
|
237
|
-
minlength="${ifDefined(this.minLength || undefined)}"
|
|
238
|
-
@input="${this.onPossibleValueChange}"
|
|
239
|
-
@change="${this.onPossibleValueChange}"
|
|
240
|
-
pattern="${ifDefined(this.pattern || undefined)}"
|
|
241
|
-
?multiple="${this.multiple}"
|
|
242
|
-
autocomplete="off"
|
|
243
|
-
/>
|
|
244
|
-
${this.renderIcon()}
|
|
245
|
-
`;
|
|
74
|
+
|| changedProperties.has('multiple')
|
|
75
|
+
|| super.shouldValidateInput(changedProperties);
|
|
246
76
|
}
|
|
247
77
|
};
|
|
248
|
-
__decorate([
|
|
249
|
-
property({ type: String, hasChanged })
|
|
250
|
-
], EmailField.prototype, "pattern", void 0);
|
|
251
|
-
__decorate([
|
|
252
|
-
property({ type: String })
|
|
253
|
-
], EmailField.prototype, "placeholder", void 0);
|
|
254
|
-
__decorate([
|
|
255
|
-
property({ type: Boolean, reflect: true })
|
|
256
|
-
], EmailField.prototype, "error", void 0);
|
|
257
|
-
__decorate([
|
|
258
|
-
property({ type: Boolean, reflect: true })
|
|
259
|
-
], EmailField.prototype, "warning", void 0);
|
|
260
|
-
__decorate([
|
|
261
|
-
property({ type: Boolean, reflect: true })
|
|
262
|
-
], EmailField.prototype, "transparent", void 0);
|
|
263
|
-
__decorate([
|
|
264
|
-
property({ type: Number, attribute: 'maxlength', reflect: true })
|
|
265
|
-
], EmailField.prototype, "maxLength", void 0);
|
|
266
|
-
__decorate([
|
|
267
|
-
property({ type: Number, attribute: 'minlength', reflect: true })
|
|
268
|
-
], EmailField.prototype, "minLength", void 0);
|
|
269
78
|
__decorate([
|
|
270
79
|
property({ type: Boolean, reflect: true })
|
|
271
80
|
], EmailField.prototype, "multiple", void 0);
|
|
272
|
-
__decorate([
|
|
273
|
-
property({ type: String, reflect: true })
|
|
274
|
-
], EmailField.prototype, "icon", void 0);
|
|
275
|
-
__decorate([
|
|
276
|
-
property({ type: Boolean, reflect: true, attribute: 'icon-has-action' })
|
|
277
|
-
], EmailField.prototype, "iconHasAction", void 0);
|
|
278
|
-
__decorate([
|
|
279
|
-
query('[part="input"]', true)
|
|
280
|
-
], EmailField.prototype, "inputElement", void 0);
|
|
281
81
|
EmailField = __decorate([
|
|
282
82
|
customElement('ef-email-field', {
|
|
283
83
|
alias: 'coral-email-field'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# ef-flag
|
|
2
|
+
|
|
3
|
+
Provides a collection of flags.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Attribute | Type | Default | Description |
|
|
8
|
+
|----------|-----------|------------------|---------|---------------------------------|
|
|
9
|
+
| `flag` | `flag` | `string \| null` | null | Name of a known flag to render. |
|
|
10
|
+
| `src` | `src` | `string \| null` | null | Src location of an svg flag. |
|
package/lib/flag/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export declare class Flag extends BasicElement {
|
|
|
25
25
|
/**
|
|
26
26
|
* Name of a known flag to render.
|
|
27
27
|
* @example gb
|
|
28
|
+
* @default null
|
|
28
29
|
*/
|
|
29
30
|
get flag(): string | null;
|
|
30
31
|
set flag(value: string | null);
|
|
@@ -32,6 +33,7 @@ export declare class Flag extends BasicElement {
|
|
|
32
33
|
/**
|
|
33
34
|
* Src location of an svg flag.
|
|
34
35
|
* @example https://cdn.io/flags/gb.svg
|
|
36
|
+
* @default null
|
|
35
37
|
*/
|
|
36
38
|
get src(): string | null;
|
|
37
39
|
set src(value: string | null);
|
package/lib/flag/index.js
CHANGED
|
@@ -53,6 +53,7 @@ let Flag = class Flag extends BasicElement {
|
|
|
53
53
|
/**
|
|
54
54
|
* Name of a known flag to render.
|
|
55
55
|
* @example gb
|
|
56
|
+
* @default null
|
|
56
57
|
*/
|
|
57
58
|
get flag() {
|
|
58
59
|
return this._flag;
|
|
@@ -66,6 +67,7 @@ let Flag = class Flag extends BasicElement {
|
|
|
66
67
|
/**
|
|
67
68
|
* Src location of an svg flag.
|
|
68
69
|
* @example https://cdn.io/flags/gb.svg
|
|
70
|
+
* @default null
|
|
69
71
|
*/
|
|
70
72
|
get src() {
|
|
71
73
|
return this._src;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# ef-header
|
|
2
|
+
|
|
3
|
+
Use to identify and separate different sections of a page.
|
|
4
|
+
Headers helps to organize the page layout content into
|
|
5
|
+
a sensible hierarchy and improve the user experience.
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
| Property | Attribute | Type | Default | Description |
|
|
10
|
+
|----------|-----------|---------------------|---------|------------------------------|
|
|
11
|
+
| `level` | `level` | `"1" \| "2" \| "3"` | "2" | Use level styling from theme |
|
|
12
|
+
|
|
13
|
+
## Slots
|
|
14
|
+
|
|
15
|
+
| Name | Description |
|
|
16
|
+
|---------|--------------------------------------------------|
|
|
17
|
+
| `left` | Slot to add custom contents to the left side of header e.g. ef-icon, ef-checkbox |
|
|
18
|
+
| `right` | Slot to add custom contents to the right side of header e.g. ef-icon, ef-checkbox |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# ef-heatmap
|
|
2
|
+
|
|
3
|
+
A graphical representation of data where the individual
|
|
4
|
+
values contained in a matrix are represented as colors
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
| Property | Attribute | Type | Default | Description |
|
|
9
|
+
|-------------------|----------------|--------------------------|---------|--------------------------------------------------|
|
|
10
|
+
| `axisHidden` | `axis-hidden` | `boolean` | false | Hide all axes |
|
|
11
|
+
| `blend` | `blend` | `boolean` | false | Enable cell color blending |
|
|
12
|
+
| `config` | `config` | `HeatmapConfig` | null | Heatmap configuration options. |
|
|
13
|
+
| `labelHidden` | `label-hidden` | `boolean` | false | Hide all labels in the cells |
|
|
14
|
+
| `labelWidth` | `label-width` | `number` | 0 | Number of maximum label width that cell can paint in pixel.<br />e.g. label-width: 30px; cell label hides when text length reaches 30px. |
|
|
15
|
+
| `maxPoint` | `max-point` | `number` | 1 | Maximum point of the cell coloring |
|
|
16
|
+
| `midPoint` | `mid-point` | `number` | 0 | Middle point of the cell coloring |
|
|
17
|
+
| `minPoint` | `min-point` | `number` | -1 | Minimum point of the cell coloring |
|
|
18
|
+
| `renderCallback` | | `HeatmapRenderCallback` | | Render callback function use for custom cell properties.<br />Accepts custom label, foreground and background color |
|
|
19
|
+
| `saturation` | `saturation` | `number` | 0.4 | Cell minimum color saturation, value can be from 0 - 1 |
|
|
20
|
+
| `tooltipCallback` | | `HeatmapTooltipCallback` | | A callback function that allows tooltip rendering on cell hover |
|
|
21
|
+
|
|
22
|
+
## Methods
|
|
23
|
+
|
|
24
|
+
| Method | Type | Description |
|
|
25
|
+
|----------------------|---------------------|--------------------------------------------------|
|
|
26
|
+
| `getCellDataAtEvent` | `(event: any): any` | Returns data of interactive cell<br /><br />**event**: an event that occur while the user interacting with element |
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# ef-icon
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Property | Attribute | Type | Default | Description |
|
|
6
|
+
|----------|-----------|------------------|---------|--------------------------------------------------|
|
|
7
|
+
| `icon` | `icon` | `string \| null` | null | Name of a known icon to render or URL of SVG icon. |
|
|
8
|
+
| `src` | `src` | `string \| null` | null | Src location of an svg icon. |
|
package/lib/icon/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare class Icon extends BasicElement {
|
|
|
18
18
|
/**
|
|
19
19
|
* Name of a known icon to render or URL of SVG icon.
|
|
20
20
|
* @example heart | https://cdn.io/icons/heart.svg
|
|
21
|
+
* @default null
|
|
21
22
|
*/
|
|
22
23
|
get icon(): string | null;
|
|
23
24
|
set icon(value: string | null);
|
|
@@ -26,6 +27,7 @@ export declare class Icon extends BasicElement {
|
|
|
26
27
|
* Src location of an svg icon.
|
|
27
28
|
* @example https://cdn.io/icons/heart.svg
|
|
28
29
|
* @deprecated Use `icon` instead
|
|
30
|
+
* @default null
|
|
29
31
|
*/
|
|
30
32
|
get src(): string | null;
|
|
31
33
|
set src(value: string | null);
|
package/lib/icon/index.js
CHANGED
|
@@ -50,6 +50,7 @@ let Icon = class Icon extends BasicElement {
|
|
|
50
50
|
/**
|
|
51
51
|
* Name of a known icon to render or URL of SVG icon.
|
|
52
52
|
* @example heart | https://cdn.io/icons/heart.svg
|
|
53
|
+
* @default null
|
|
53
54
|
*/
|
|
54
55
|
get icon() {
|
|
55
56
|
return this._icon;
|
|
@@ -66,6 +67,7 @@ let Icon = class Icon extends BasicElement {
|
|
|
66
67
|
* Src location of an svg icon.
|
|
67
68
|
* @example https://cdn.io/icons/heart.svg
|
|
68
69
|
* @deprecated Use `icon` instead
|
|
70
|
+
* @default null
|
|
69
71
|
*/
|
|
70
72
|
get src() {
|
|
71
73
|
return this._src;
|
|
@@ -24,8 +24,9 @@
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"name": "legend-style",
|
|
27
|
-
"description": "Set legend style i.e. `horizontal`, `vertical
|
|
28
|
-
"type": "\"vertical\" | \"horizontal\""
|
|
27
|
+
"description": "Set legend style i.e. `horizontal`, `vertical`.",
|
|
28
|
+
"type": "\"vertical\" | \"horizontal\"",
|
|
29
|
+
"default": "\"vertical\""
|
|
29
30
|
}
|
|
30
31
|
],
|
|
31
32
|
"properties": [
|
|
@@ -52,14 +53,9 @@
|
|
|
52
53
|
{
|
|
53
54
|
"name": "legendStyle",
|
|
54
55
|
"attribute": "legend-style",
|
|
55
|
-
"description": "Set legend style i.e. `horizontal`, `vertical
|
|
56
|
-
"type": "\"vertical\" | \"horizontal\""
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
"name": "seriesList",
|
|
60
|
-
"description": "Array of series instances in chart",
|
|
61
|
-
"type": "object",
|
|
62
|
-
"default": "[]"
|
|
56
|
+
"description": "Set legend style i.e. `horizontal`, `vertical`.",
|
|
57
|
+
"type": "\"vertical\" | \"horizontal\"",
|
|
58
|
+
"default": "\"vertical\""
|
|
63
59
|
}
|
|
64
60
|
],
|
|
65
61
|
"events": [
|