@refinitiv-ui/elements 5.5.0 → 5.8.1
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 +65 -8
- package/lib/accordion/custom-elements.md +18 -0
- package/lib/accordion/index.d.ts +5 -5
- package/lib/accordion/index.js +8 -11
- package/lib/appstate-bar/custom-elements.md +22 -0
- package/lib/appstate-bar/index.d.ts +5 -5
- package/lib/appstate-bar/index.js +8 -11
- package/lib/autosuggest/custom-elements.json +24 -4
- package/lib/autosuggest/custom-elements.md +54 -0
- package/lib/autosuggest/helpers/types.d.ts +1 -1
- package/lib/autosuggest/helpers/utils.d.ts +2 -2
- package/lib/autosuggest/helpers/utils.js +1 -2
- package/lib/autosuggest/index.d.ts +13 -8
- package/lib/autosuggest/index.js +38 -31
- package/lib/button/custom-elements.json +2 -2
- package/lib/button/custom-elements.md +23 -0
- package/lib/button/index.d.ts +13 -13
- package/lib/button/index.js +41 -31
- package/lib/button-bar/custom-elements.md +9 -0
- package/lib/button-bar/index.d.ts +3 -3
- package/lib/button-bar/index.js +8 -10
- package/lib/calendar/constants.d.ts +22 -0
- package/lib/calendar/constants.js +23 -0
- package/lib/calendar/custom-elements.json +8 -6
- package/lib/calendar/custom-elements.md +35 -0
- package/lib/calendar/index.d.ts +9 -7
- package/lib/calendar/index.js +20 -38
- package/lib/calendar/locales.d.ts +1 -31
- package/lib/calendar/locales.js +0 -104
- package/lib/calendar/types.d.ts +1 -5
- package/lib/calendar/types.js +1 -6
- package/lib/calendar/utils.d.ts +31 -1
- package/lib/calendar/utils.js +104 -2
- package/lib/canvas/custom-elements.json +7 -5
- package/lib/canvas/custom-elements.md +27 -0
- package/lib/canvas/index.d.ts +4 -3
- package/lib/canvas/index.js +8 -10
- package/lib/card/custom-elements.json +3 -1
- package/lib/card/custom-elements.md +24 -0
- package/lib/card/helpers/types.d.ts +1 -1
- package/lib/card/index.d.ts +10 -8
- package/lib/card/index.js +14 -13
- package/lib/chart/custom-elements.json +1 -1
- package/lib/chart/custom-elements.md +16 -0
- package/lib/chart/helpers/index.d.ts +2 -2
- package/lib/chart/helpers/index.js +2 -2
- package/lib/chart/index.d.ts +6 -6
- package/lib/chart/index.js +12 -14
- package/lib/checkbox/custom-elements.json +4 -4
- package/lib/checkbox/custom-elements.md +18 -0
- package/lib/checkbox/index.d.ts +21 -13
- package/lib/checkbox/index.js +56 -31
- package/lib/clock/custom-elements.json +21 -4
- package/lib/clock/custom-elements.md +28 -0
- package/lib/clock/index.d.ts +17 -5
- package/lib/clock/index.js +37 -18
- 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/clock/utils/TickManager.js +2 -2
- package/lib/collapse/custom-elements.md +27 -0
- package/lib/collapse/index.d.ts +7 -7
- package/lib/collapse/index.js +11 -13
- package/lib/color-dialog/custom-elements.json +29 -16
- package/lib/color-dialog/custom-elements.md +39 -0
- package/lib/color-dialog/elements/color-palettes.d.ts +5 -5
- package/lib/color-dialog/elements/color-palettes.js +8 -12
- package/lib/color-dialog/elements/grayscale-palettes.d.ts +5 -5
- package/lib/color-dialog/elements/grayscale-palettes.js +9 -12
- package/lib/color-dialog/elements/palettes.d.ts +3 -3
- package/lib/color-dialog/elements/palettes.js +49 -47
- package/lib/color-dialog/helpers/value-model.js +2 -2
- package/lib/color-dialog/index.d.ts +19 -19
- package/lib/color-dialog/index.js +36 -35
- package/lib/combo-box/custom-elements.json +28 -16
- package/lib/combo-box/custom-elements.md +35 -0
- package/lib/combo-box/helpers/filter.d.ts +4 -4
- package/lib/combo-box/helpers/types.d.ts +2 -2
- package/lib/combo-box/index.d.ts +26 -18
- package/lib/combo-box/index.js +36 -27
- 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 +5 -3
- package/lib/counter/index.js +11 -12
- 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 +25 -14
- package/lib/datetime-picker/index.js +46 -35
- package/lib/datetime-picker/locales.d.ts +1 -1
- package/lib/datetime-picker/locales.js +12 -1
- package/lib/datetime-picker/types.d.ts +1 -1
- package/lib/datetime-picker/utils.js +1 -1
- package/lib/dialog/custom-elements.json +34 -12
- package/lib/dialog/custom-elements.md +47 -0
- package/lib/dialog/index.d.ts +17 -20
- package/lib/dialog/index.js +28 -31
- 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 +44 -116
- package/lib/email-field/index.js +48 -249
- package/lib/events.d.ts +2 -2
- package/lib/events.js +1 -2
- package/lib/flag/custom-elements.md +10 -0
- package/lib/flag/index.d.ts +6 -4
- package/lib/flag/index.js +12 -12
- package/lib/flag/utils/FlagLoader.d.ts +1 -1
- package/lib/flag/utils/FlagLoader.js +1 -1
- package/lib/header/custom-elements.md +18 -0
- package/lib/header/index.d.ts +2 -2
- package/lib/header/index.js +5 -8
- package/lib/heatmap/custom-elements.md +26 -0
- package/lib/heatmap/helpers/color.d.ts +1 -1
- package/lib/heatmap/helpers/color.js +1 -1
- package/lib/heatmap/helpers/text.d.ts +1 -1
- package/lib/heatmap/index.d.ts +7 -7
- package/lib/heatmap/index.js +15 -16
- package/lib/icon/custom-elements.json +6 -4
- package/lib/icon/custom-elements.md +8 -0
- package/lib/icon/index.d.ts +9 -6
- package/lib/icon/index.js +28 -18
- package/lib/icon/utils/IconLoader.d.ts +6 -1
- package/lib/icon/utils/IconLoader.js +24 -17
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/lib/interactive-chart/custom-elements.json +6 -10
- package/lib/interactive-chart/custom-elements.md +31 -0
- package/lib/interactive-chart/helpers/types.d.ts +2 -2
- package/lib/interactive-chart/index.d.ts +11 -8
- package/lib/interactive-chart/index.js +17 -17
- package/lib/item/custom-elements.json +4 -4
- package/lib/item/custom-elements.md +29 -0
- package/lib/item/helpers/types.d.ts +1 -1
- package/lib/item/index.d.ts +18 -8
- package/lib/item/index.js +36 -16
- package/lib/label/custom-elements.md +11 -0
- package/lib/label/index.d.ts +3 -3
- package/lib/label/index.js +12 -20
- package/lib/layout/custom-elements.md +26 -0
- package/lib/layout/index.d.ts +3 -3
- package/lib/layout/index.js +6 -9
- 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 +5 -4
- package/lib/led-gauge/index.js +9 -11
- package/lib/list/custom-elements.json +18 -5
- package/lib/list/custom-elements.md +32 -0
- package/lib/list/helpers/list-renderer.d.ts +2 -2
- package/lib/list/helpers/list-renderer.js +4 -2
- package/lib/list/helpers/types.d.ts +2 -2
- package/lib/list/index.d.ts +27 -10
- package/lib/list/index.js +54 -25
- package/lib/list/renderer.d.ts +2 -2
- package/lib/list/renderer.js +1 -1
- package/lib/loader/custom-elements.md +5 -0
- package/lib/loader/index.js +4 -8
- package/lib/multi-input/custom-elements.json +7 -6
- package/lib/multi-input/custom-elements.md +43 -0
- package/lib/multi-input/helpers/types.d.ts +1 -1
- package/lib/multi-input/index.d.ts +11 -7
- package/lib/multi-input/index.js +20 -17
- package/lib/notification/custom-elements.md +26 -0
- package/lib/notification/elements/notification-tray.d.ts +2 -2
- package/lib/notification/elements/notification-tray.js +6 -9
- package/lib/notification/elements/notification.d.ts +5 -5
- package/lib/notification/elements/notification.js +8 -11
- package/lib/notification/helpers/status.d.ts +1 -1
- package/lib/notification/helpers/status.js +1 -1
- package/lib/notification/helpers/types.d.ts +1 -1
- package/lib/notification/index.d.ts +2 -2
- package/lib/notification/index.js +2 -2
- 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 +96 -51
- package/lib/number-field/index.js +121 -89
- package/lib/overlay/custom-elements.json +26 -13
- package/lib/overlay/custom-elements.md +54 -0
- package/lib/overlay/elements/overlay-backdrop.d.ts +4 -4
- package/lib/overlay/elements/overlay-backdrop.js +6 -9
- package/lib/overlay/elements/overlay-viewport.d.ts +3 -3
- package/lib/overlay/elements/overlay-viewport.js +5 -9
- package/lib/overlay/elements/overlay.d.ts +10 -5
- package/lib/overlay/elements/overlay.js +18 -23
- package/lib/overlay/index.d.ts +2 -2
- package/lib/overlay/index.js +1 -1
- package/lib/overlay/managers/backdrop-manager.d.ts +1 -1
- package/lib/overlay/managers/backdrop-manager.js +2 -2
- package/lib/overlay/managers/close-manager.js +1 -1
- package/lib/overlay/managers/focus-manager.js +2 -2
- package/lib/overlay/managers/interaction-lock-manager.js +2 -2
- package/lib/overlay/managers/viewport-manager.d.ts +2 -2
- package/lib/overlay/managers/viewport-manager.js +6 -2
- package/lib/overlay/managers/zindex-manager.js +1 -1
- package/lib/overlay-menu/custom-elements.json +70 -20
- package/lib/overlay-menu/custom-elements.md +44 -0
- package/lib/overlay-menu/helpers/types.d.ts +3 -3
- package/lib/overlay-menu/index.d.ts +21 -19
- package/lib/overlay-menu/index.js +32 -31
- package/lib/overlay-menu/managers/menu-manager.d.ts +2 -2
- package/lib/overlay-menu/managers/menu-manager.js +3 -3
- package/lib/pagination/custom-elements.md +27 -0
- package/lib/pagination/index.d.ts +8 -8
- package/lib/pagination/index.js +13 -15
- package/lib/panel/custom-elements.md +11 -0
- package/lib/panel/index.d.ts +3 -3
- package/lib/panel/index.js +6 -9
- 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 +43 -94
- package/lib/password-field/index.js +52 -198
- package/lib/pill/custom-elements.json +8 -6
- package/lib/pill/custom-elements.md +22 -0
- package/lib/pill/index.d.ts +5 -5
- package/lib/pill/index.js +9 -11
- package/lib/progress-bar/custom-elements.md +18 -0
- package/lib/progress-bar/index.d.ts +3 -3
- package/lib/progress-bar/index.js +7 -9
- package/lib/radio-button/custom-elements.json +4 -4
- package/lib/radio-button/custom-elements.md +19 -0
- package/lib/radio-button/index.d.ts +25 -8
- package/lib/radio-button/index.js +84 -21
- package/lib/radio-button/radio-button-registry.d.ts +3 -2
- package/lib/radio-button/radio-button-registry.js +57 -4
- package/lib/rating/custom-elements.md +17 -0
- package/lib/rating/index.d.ts +3 -3
- package/lib/rating/index.js +9 -10
- 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 +44 -101
- package/lib/search-field/index.js +50 -220
- package/lib/select/custom-elements.json +5 -4
- package/lib/select/custom-elements.md +24 -0
- package/lib/select/helpers/types.d.ts +1 -1
- package/lib/select/index.d.ts +18 -10
- package/lib/select/index.js +84 -45
- 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 +7 -6
- package/lib/sidebar-layout/index.js +9 -10
- package/lib/slider/custom-elements.json +4 -4
- package/lib/slider/custom-elements.md +28 -0
- package/lib/slider/index.d.ts +4 -4
- package/lib/slider/index.js +9 -10
- package/lib/sparkline/custom-elements.json +4 -4
- package/lib/sparkline/custom-elements.md +16 -0
- package/lib/sparkline/index.d.ts +6 -4
- package/lib/sparkline/index.js +10 -10
- package/lib/swing-gauge/custom-elements.json +5 -3
- package/lib/swing-gauge/custom-elements.md +17 -0
- package/lib/swing-gauge/helpers.d.ts +1 -1
- package/lib/swing-gauge/helpers.js +1 -1
- package/lib/swing-gauge/index.d.ts +9 -7
- package/lib/swing-gauge/index.js +17 -15
- package/lib/tab/custom-elements.json +2 -2
- package/lib/tab/custom-elements.md +22 -0
- package/lib/tab/index.d.ts +5 -5
- package/lib/tab/index.js +9 -12
- package/lib/tab-bar/custom-elements.md +11 -0
- package/lib/tab-bar/index.d.ts +4 -4
- package/lib/tab-bar/index.js +9 -11
- 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 +59 -79
- package/lib/text-field/index.js +99 -158
- 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 +7 -4
- package/lib/time-picker/index.js +15 -14
- package/lib/toggle/custom-elements.json +4 -4
- package/lib/toggle/custom-elements.md +19 -0
- package/lib/toggle/index.d.ts +14 -4
- package/lib/toggle/index.js +31 -12
- package/lib/tooltip/custom-elements.md +14 -0
- package/lib/tooltip/elements/title-tooltip.js +2 -2
- package/lib/tooltip/elements/tooltip-element.d.ts +1 -1
- package/lib/tooltip/helpers/overflow-tooltip.d.ts +1 -1
- package/lib/tooltip/helpers/overflow-tooltip.js +1 -1
- package/lib/tooltip/helpers/renderer.d.ts +1 -1
- package/lib/tooltip/helpers/types.d.ts +1 -1
- package/lib/tooltip/index.d.ts +9 -9
- package/lib/tooltip/index.js +18 -20
- package/lib/tooltip/managers/tooltip-manager.d.ts +2 -2
- package/lib/tooltip/managers/tooltip-manager.js +3 -7
- package/lib/tornado-chart/custom-elements.md +18 -0
- package/lib/tornado-chart/elements/tornado-chart.d.ts +4 -4
- package/lib/tornado-chart/elements/tornado-chart.js +8 -11
- package/lib/tornado-chart/elements/tornado-item.d.ts +5 -5
- package/lib/tornado-chart/elements/tornado-item.js +10 -12
- package/lib/tornado-chart/index.d.ts +2 -2
- package/lib/tornado-chart/index.js +2 -2
- package/lib/tree/custom-elements.json +4 -3
- package/lib/tree/custom-elements.md +32 -0
- package/lib/tree/elements/tree-item.d.ts +4 -4
- package/lib/tree/elements/tree-item.js +10 -13
- package/lib/tree/elements/tree.d.ts +6 -5
- package/lib/tree/elements/tree.js +9 -12
- package/lib/tree/helpers/filter.d.ts +2 -2
- package/lib/tree/helpers/renderer.d.ts +2 -2
- package/lib/tree/helpers/renderer.js +3 -3
- package/lib/tree/helpers/types.d.ts +1 -1
- package/lib/tree/index.d.ts +4 -4
- package/lib/tree/index.js +3 -3
- package/lib/tree/managers/tree-manager.d.ts +22 -10
- package/lib/tree/managers/tree-manager.js +56 -40
- 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/helpers/types.d.ts +2 -2
- package/lib/tree-select/index.d.ts +28 -20
- package/lib/tree-select/index.js +44 -31
- 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.d.ts +1 -0
- package/lib/version.js +1 -0
- package/package.json +298 -15
- package/lib/autosuggest/helpers/const.d.ts +0 -2
- package/lib/autosuggest/helpers/const.js +0 -3
- package/lib/overlay-menu/helpers/uuid.d.ts +0 -7
- package/lib/overlay-menu/helpers/uuid.js +0 -13
|
@@ -1,122 +1,65 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import {
|
|
3
|
-
import '
|
|
2
|
+
import { TemplateResult } from '@refinitiv-ui/core';
|
|
3
|
+
import { TemplateMap } from '@refinitiv-ui/core/lib/directives/template-map.js';
|
|
4
|
+
import '../icon/index.js';
|
|
5
|
+
import { TextField } from '../text-field/index.js';
|
|
6
|
+
import { Translate } from '@refinitiv-ui/translate';
|
|
7
|
+
import '@refinitiv-ui/phrasebook/lib/locale/en/search-field.js';
|
|
4
8
|
/**
|
|
5
9
|
* Form control to get a search input from users.
|
|
6
10
|
*
|
|
7
11
|
* @fires value-changed - Dispatched when value changes
|
|
8
12
|
* @fires error-changed - Dispatched when error state changes
|
|
13
|
+
* @fires icon-click - Dispatched when icon is clicked
|
|
9
14
|
*
|
|
10
|
-
* @attr {
|
|
11
|
-
* @prop {
|
|
15
|
+
* @attr {boolean} disabled - Set disabled state
|
|
16
|
+
* @prop {boolean} [disabled=false] - Set disabled state
|
|
17
|
+
*
|
|
18
|
+
* @attr {boolean} error - Set error state
|
|
19
|
+
* @prop {boolean} [error=false] - Set error state
|
|
20
|
+
*
|
|
21
|
+
* @attr {boolean} icon-has-action - Specify when icon need to be clickable
|
|
22
|
+
* @prop {boolean} [iconHasAction=false] - Specify when icon need to be clickable
|
|
23
|
+
*
|
|
24
|
+
* @attr {number} maxlength - Set character max limit
|
|
25
|
+
* @prop {number | null} [maxLength=null] - Set character max limit
|
|
26
|
+
*
|
|
27
|
+
* @attr {number} minlength - Set character min limit
|
|
28
|
+
* @prop {number | null} [minLength=null] - Set character min limit
|
|
29
|
+
*
|
|
30
|
+
* @prop {string} [pattern=""] - Set regular expression for input validation
|
|
31
|
+
*
|
|
32
|
+
* @attr {string} placeholder - Set placeholder text
|
|
33
|
+
* @prop {string} [placeholder=""] - Set placeholder text
|
|
12
34
|
*
|
|
13
35
|
* @attr {boolean} readonly - Set readonly state
|
|
14
36
|
* @prop {boolean} [readonly=false] - Set readonly state
|
|
15
37
|
*
|
|
16
|
-
* @attr {boolean}
|
|
17
|
-
* @prop {boolean} [
|
|
38
|
+
* @attr {boolean} transparent - Disables all other states and border/background styles.
|
|
39
|
+
* @prop {boolean} [transparent=false] - Disables all other states and border/background styles.
|
|
40
|
+
*
|
|
41
|
+
* @attr {boolean} warning - Set warning state
|
|
42
|
+
* @prop {boolean} [warning=false] - Set warning state
|
|
43
|
+
*
|
|
44
|
+
* @attr {string} value - Input's value
|
|
45
|
+
* @prop {string} [value=""] - Input's value
|
|
18
46
|
*/
|
|
19
|
-
export declare class SearchField extends
|
|
20
|
-
/**
|
|
21
|
-
* Element version number
|
|
22
|
-
* @returns version number
|
|
23
|
-
*/
|
|
24
|
-
static get version(): string;
|
|
25
|
-
/**
|
|
26
|
-
* A `CSSResult` 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(): CSSResult | CSSResult[];
|
|
32
|
-
/**
|
|
33
|
-
* Set regular expression for input validation
|
|
34
|
-
*/
|
|
35
|
-
pattern: string;
|
|
36
|
-
/**
|
|
37
|
-
* Set place holder 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;
|
|
47
|
+
export declare class SearchField extends TextField {
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
50
|
-
* Use with advanced composite elements requiring e.g. multi selection in
|
|
51
|
-
* combo-box when parent container handles element states.
|
|
49
|
+
* Used for translations
|
|
52
50
|
*/
|
|
53
|
-
|
|
51
|
+
protected t: Translate;
|
|
54
52
|
/**
|
|
55
|
-
*
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Set character min limit
|
|
60
|
-
*/
|
|
61
|
-
minLength: number | null;
|
|
62
|
-
/**
|
|
63
|
-
* Specify when icon need to be clickable
|
|
64
|
-
*/
|
|
65
|
-
iconHasAction: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Get native input element from shadow roots
|
|
68
|
-
*/
|
|
69
|
-
private inputElement;
|
|
70
|
-
/**
|
|
71
|
-
* Select the contents of input
|
|
72
|
-
* @returns void
|
|
73
|
-
*/
|
|
74
|
-
select(): void;
|
|
75
|
-
/**
|
|
76
|
-
* A `TemplateResult` that will be used
|
|
77
|
-
* to render the updated internal template.
|
|
78
|
-
* @return Render template
|
|
79
|
-
*/
|
|
80
|
-
protected render(): TemplateResult;
|
|
81
|
-
/**
|
|
82
|
-
* Called when the element’s DOM has been updated and rendered
|
|
83
|
-
* @param changedProperties Properties that has changed
|
|
84
|
-
* @returns {void}
|
|
85
|
-
*/
|
|
86
|
-
protected updated(changedProperties: PropertyValues): void;
|
|
87
|
-
/**
|
|
88
|
-
* Check if input should be re-validated
|
|
89
|
-
* @param changedProperties Properties that has changed
|
|
90
|
-
* @returns True if input should be re-validated
|
|
91
|
-
*/
|
|
92
|
-
private shouldValidateInput;
|
|
93
|
-
/**
|
|
94
|
-
* validate input according `pattern`, `minLength` and `maxLength` properties
|
|
95
|
-
* change state of `error` property according pattern validation
|
|
96
|
-
* @returns {void}
|
|
97
|
-
*/
|
|
98
|
-
private validateInput;
|
|
99
|
-
/**
|
|
100
|
-
* @param error existing state of error
|
|
101
|
-
* @returns true if there is no error and browser is IE11 and minLength more than 0 and value exists
|
|
102
|
-
*/
|
|
103
|
-
private shouldValidateForMinLength;
|
|
104
|
-
/**
|
|
105
|
-
* Check if value is changed
|
|
106
|
-
* @returns {void}
|
|
107
|
-
*/
|
|
108
|
-
private onPossibleValueChange;
|
|
109
|
-
/**
|
|
110
|
-
* Detect `enter` and `space` keydown and fire
|
|
111
|
-
* @param event keydown event
|
|
112
|
-
* @returns {void}
|
|
53
|
+
* Decorate `<input>` element with common properties extended from text-field:
|
|
54
|
+
* type="search" - always `search`
|
|
55
|
+
* @returns template map
|
|
113
56
|
*/
|
|
114
|
-
|
|
57
|
+
protected get decorateInputMap(): TemplateMap;
|
|
115
58
|
/**
|
|
116
|
-
*
|
|
59
|
+
* Renders icon element
|
|
117
60
|
* @returns {void}
|
|
118
61
|
*/
|
|
119
|
-
|
|
62
|
+
protected renderIcon(): TemplateResult | null;
|
|
120
63
|
}
|
|
121
64
|
|
|
122
65
|
declare global {
|
|
@@ -126,7 +69,7 @@ declare global {
|
|
|
126
69
|
|
|
127
70
|
namespace JSX {
|
|
128
71
|
interface IntrinsicElements {
|
|
129
|
-
'ef-search-field': Partial<SearchField> | JSXInterface.
|
|
72
|
+
'ef-search-field': Partial<SearchField> | JSXInterface.HTMLAttributes<SearchField>;
|
|
130
73
|
}
|
|
131
74
|
}
|
|
132
75
|
}
|
|
@@ -1,251 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import '../icon';
|
|
10
|
-
const hasChanged = (newVal, oldVal) => oldVal === undefined ? false : newVal !== oldVal;
|
|
11
|
-
const isIE = (/Trident/g).test(navigator.userAgent);
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html } from '@refinitiv-ui/core';
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
|
|
4
|
+
import { ifDefined } from '@refinitiv-ui/core/lib/directives/if-defined.js';
|
|
5
|
+
import '../icon/index.js';
|
|
6
|
+
import { TextField } from '../text-field/index.js';
|
|
7
|
+
import { translate } from '@refinitiv-ui/translate';
|
|
8
|
+
import '@refinitiv-ui/phrasebook/lib/locale/en/search-field.js';
|
|
12
9
|
/**
|
|
13
10
|
* Form control to get a search input from users.
|
|
14
11
|
*
|
|
15
12
|
* @fires value-changed - Dispatched when value changes
|
|
16
13
|
* @fires error-changed - Dispatched when error state changes
|
|
14
|
+
* @fires icon-click - Dispatched when icon is clicked
|
|
17
15
|
*
|
|
18
|
-
* @attr {
|
|
19
|
-
* @prop {
|
|
16
|
+
* @attr {boolean} disabled - Set disabled state
|
|
17
|
+
* @prop {boolean} [disabled=false] - Set disabled state
|
|
18
|
+
*
|
|
19
|
+
* @attr {boolean} error - Set error state
|
|
20
|
+
* @prop {boolean} [error=false] - Set error state
|
|
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
|
|
20
35
|
*
|
|
21
36
|
* @attr {boolean} readonly - Set readonly state
|
|
22
37
|
* @prop {boolean} [readonly=false] - Set readonly state
|
|
23
38
|
*
|
|
24
|
-
* @attr {boolean}
|
|
25
|
-
* @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
|
|
26
47
|
*/
|
|
27
|
-
let SearchField = class SearchField extends
|
|
28
|
-
constructor() {
|
|
29
|
-
super(...arguments);
|
|
30
|
-
/**
|
|
31
|
-
* Set regular expression for input validation
|
|
32
|
-
*/
|
|
33
|
-
this.pattern = '';
|
|
34
|
-
/**
|
|
35
|
-
* Set place holder text
|
|
36
|
-
*/
|
|
37
|
-
this.placeholder = '';
|
|
38
|
-
/**
|
|
39
|
-
* Set state to error
|
|
40
|
-
*/
|
|
41
|
-
this.error = false;
|
|
42
|
-
/**
|
|
43
|
-
* Set state to warning
|
|
44
|
-
*/
|
|
45
|
-
this.warning = false;
|
|
46
|
-
/**
|
|
47
|
-
* Disables all other states and border/background styles.
|
|
48
|
-
* Use with advanced composite elements requiring e.g. multi selection in
|
|
49
|
-
* combo-box when parent container handles element states.
|
|
50
|
-
*/
|
|
51
|
-
this.transparent = false;
|
|
52
|
-
/**
|
|
53
|
-
* Set character max limit
|
|
54
|
-
*/
|
|
55
|
-
this.maxLength = null;
|
|
56
|
-
/**
|
|
57
|
-
* Set character min limit
|
|
58
|
-
*/
|
|
59
|
-
this.minLength = null;
|
|
60
|
-
/**
|
|
61
|
-
* Specify when icon need to be clickable
|
|
62
|
-
*/
|
|
63
|
-
this.iconHasAction = false;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Element version number
|
|
67
|
-
* @returns version number
|
|
68
|
-
*/
|
|
69
|
-
static get version() {
|
|
70
|
-
return VERSION;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* A `CSSResult` that will be used
|
|
74
|
-
* to style the host, slotted children
|
|
75
|
-
* and the internal template of the element.
|
|
76
|
-
* @return CSS template
|
|
77
|
-
*/
|
|
78
|
-
static get styles() {
|
|
79
|
-
return css `
|
|
80
|
-
:host {
|
|
81
|
-
display: inline-block;
|
|
82
|
-
}
|
|
83
|
-
:host(:focus), :host input:focus {
|
|
84
|
-
outline: none;
|
|
85
|
-
}
|
|
86
|
-
[part=input] {
|
|
87
|
-
font: inherit;
|
|
88
|
-
background: none;
|
|
89
|
-
color: currentColor;
|
|
90
|
-
border: none;
|
|
91
|
-
text-align: inherit;
|
|
92
|
-
}
|
|
93
|
-
:host [part=icon]{
|
|
94
|
-
display: flex;
|
|
95
|
-
outline: none;
|
|
96
|
-
}
|
|
97
|
-
:host([transparent]) {
|
|
98
|
-
background: none !important;
|
|
99
|
-
border: none !important;
|
|
100
|
-
}
|
|
101
|
-
:host([icon-has-action]) [part=icon] {
|
|
102
|
-
cursor: pointer;
|
|
103
|
-
}
|
|
104
|
-
`;
|
|
105
|
-
}
|
|
48
|
+
let SearchField = class SearchField extends TextField {
|
|
106
49
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
50
|
+
* Decorate `<input>` element with common properties extended from text-field:
|
|
51
|
+
* type="search" - always `search`
|
|
52
|
+
* @returns template map
|
|
109
53
|
*/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
this.inputElement.select();
|
|
113
|
-
}
|
|
54
|
+
get decorateInputMap() {
|
|
55
|
+
return Object.assign(Object.assign({}, super.decorateInputMap), { 'type': 'search', 'inputmode': 'search' });
|
|
114
56
|
}
|
|
115
57
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
* @return Render template
|
|
58
|
+
* Renders icon element
|
|
59
|
+
* @returns {void}
|
|
119
60
|
*/
|
|
120
|
-
|
|
61
|
+
renderIcon() {
|
|
121
62
|
return html `
|
|
122
|
-
<input
|
|
123
|
-
type="search"
|
|
124
|
-
part="input"
|
|
125
|
-
?readonly="${this.readonly}"
|
|
126
|
-
?disabled="${this.disabled}"
|
|
127
|
-
placeholder="${ifDefined(this.placeholder || undefined)}"
|
|
128
|
-
maxlength="${ifDefined(this.maxLength || undefined)}"
|
|
129
|
-
minlength="${ifDefined(this.minLength || undefined)}"
|
|
130
|
-
@input="${this.onPossibleValueChange}"
|
|
131
|
-
@change="${this.onPossibleValueChange}"
|
|
132
|
-
pattern="${ifDefined(this.pattern || undefined)}"
|
|
133
|
-
autocomplete="off"
|
|
134
|
-
/>
|
|
135
63
|
<ef-icon
|
|
136
64
|
part="icon"
|
|
65
|
+
role="${ifDefined(this.iconHasAction ? 'button' : undefined)}"
|
|
137
66
|
icon="search"
|
|
67
|
+
aria-label="${this.t('SEARCH')}"
|
|
138
68
|
?readonly="${this.readonly}"
|
|
139
69
|
?disabled="${this.disabled}"
|
|
140
|
-
@tap="${this.
|
|
141
|
-
@keydown="${this.handleKeyDown}"
|
|
70
|
+
@tap="${this.iconClick}"
|
|
142
71
|
tabindex="${ifDefined(this.iconHasAction ? '0' : undefined)}"
|
|
143
72
|
></ef-icon>
|
|
144
73
|
`;
|
|
145
74
|
}
|
|
146
|
-
/**
|
|
147
|
-
* Called when the element’s DOM has been updated and rendered
|
|
148
|
-
* @param changedProperties Properties that has changed
|
|
149
|
-
* @returns {void}
|
|
150
|
-
*/
|
|
151
|
-
updated(changedProperties) {
|
|
152
|
-
super.updated(changedProperties);
|
|
153
|
-
if (this.inputElement.value !== this.value) {
|
|
154
|
-
this.inputElement.value = this.value;
|
|
155
|
-
}
|
|
156
|
-
if (this.shouldValidateInput(changedProperties)) {
|
|
157
|
-
this.validateInput();
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Check if input should be re-validated
|
|
162
|
-
* @param changedProperties Properties that has changed
|
|
163
|
-
* @returns True if input should be re-validated
|
|
164
|
-
*/
|
|
165
|
-
shouldValidateInput(changedProperties) {
|
|
166
|
-
return (changedProperties.has('pattern') || !!(this.pattern && changedProperties.has('value')))
|
|
167
|
-
|| (changedProperties.has('minLength') || !!(this.minLength && changedProperties.has('value')));
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* validate input according `pattern`, `minLength` and `maxLength` properties
|
|
171
|
-
* change state of `error` property according pattern validation
|
|
172
|
-
* @returns {void}
|
|
173
|
-
*/
|
|
174
|
-
validateInput() {
|
|
175
|
-
let error = !this.inputElement.checkValidity();
|
|
176
|
-
if (this.shouldValidateForMinLength(error)) {
|
|
177
|
-
error = !!this.minLength && (this.minLength > this.value.length);
|
|
178
|
-
}
|
|
179
|
-
if (this.error !== error) {
|
|
180
|
-
this.error = error;
|
|
181
|
-
this.notifyPropertyChange('error', this.error);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* @param error existing state of error
|
|
186
|
-
* @returns true if there is no error and browser is IE11 and minLength more than 0 and value exists
|
|
187
|
-
*/
|
|
188
|
-
shouldValidateForMinLength(error) {
|
|
189
|
-
return !!(!error && isIE && this.minLength && !!this.value);
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Check if value is changed
|
|
193
|
-
* @returns {void}
|
|
194
|
-
*/
|
|
195
|
-
onPossibleValueChange() {
|
|
196
|
-
const value = this.inputElement.value;
|
|
197
|
-
this.setValueAndNotify(value);
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Detect `enter` and `space` keydown and fire
|
|
201
|
-
* @param event keydown event
|
|
202
|
-
* @returns {void}
|
|
203
|
-
*/
|
|
204
|
-
handleKeyDown(event) {
|
|
205
|
-
if (event.key === 'Spacebar' || event.key === ' ' || event.key === 'Enter') {
|
|
206
|
-
this.notifyIcon();
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Fire event on icon click
|
|
211
|
-
* @returns {void}
|
|
212
|
-
*/
|
|
213
|
-
notifyIcon() {
|
|
214
|
-
if (this.iconHasAction) {
|
|
215
|
-
/**
|
|
216
|
-
* Dispatched only when element has icon-has-action attribute and icon is clicked
|
|
217
|
-
*/
|
|
218
|
-
this.dispatchEvent(new CustomEvent('icon-click', { bubbles: false }));
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
75
|
};
|
|
222
76
|
__decorate([
|
|
223
|
-
|
|
224
|
-
], SearchField.prototype, "
|
|
225
|
-
__decorate([
|
|
226
|
-
property({ type: String })
|
|
227
|
-
], SearchField.prototype, "placeholder", void 0);
|
|
228
|
-
__decorate([
|
|
229
|
-
property({ type: Boolean, reflect: true })
|
|
230
|
-
], SearchField.prototype, "error", void 0);
|
|
231
|
-
__decorate([
|
|
232
|
-
property({ type: Boolean, reflect: true })
|
|
233
|
-
], SearchField.prototype, "warning", void 0);
|
|
234
|
-
__decorate([
|
|
235
|
-
property({ type: Boolean, reflect: true })
|
|
236
|
-
], SearchField.prototype, "transparent", void 0);
|
|
237
|
-
__decorate([
|
|
238
|
-
property({ type: Number, attribute: 'maxlength', reflect: true })
|
|
239
|
-
], SearchField.prototype, "maxLength", void 0);
|
|
240
|
-
__decorate([
|
|
241
|
-
property({ type: Number, attribute: 'minlength', reflect: true, hasChanged })
|
|
242
|
-
], SearchField.prototype, "minLength", void 0);
|
|
243
|
-
__decorate([
|
|
244
|
-
property({ type: Boolean, reflect: true, attribute: 'icon-has-action' })
|
|
245
|
-
], SearchField.prototype, "iconHasAction", void 0);
|
|
246
|
-
__decorate([
|
|
247
|
-
query('[part="input"]')
|
|
248
|
-
], SearchField.prototype, "inputElement", void 0);
|
|
77
|
+
translate({ scope: 'ef-search-field' })
|
|
78
|
+
], SearchField.prototype, "t", void 0);
|
|
249
79
|
SearchField = __decorate([
|
|
250
80
|
customElement('ef-search-field', {
|
|
251
81
|
alias: 'coral-search-field'
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"name": "disabled",
|
|
34
34
|
"description": "Set disabled state",
|
|
35
35
|
"type": "boolean",
|
|
36
|
-
"default": "
|
|
36
|
+
"default": "false"
|
|
37
37
|
}
|
|
38
38
|
],
|
|
39
39
|
"properties": [
|
|
40
40
|
{
|
|
41
|
-
"name": "label",
|
|
41
|
+
"name": "label (readonly)",
|
|
42
42
|
"description": "Current text content of the selected value",
|
|
43
43
|
"type": "string"
|
|
44
44
|
},
|
|
@@ -78,14 +78,15 @@
|
|
|
78
78
|
{
|
|
79
79
|
"name": "value",
|
|
80
80
|
"description": "Value of the element",
|
|
81
|
-
"type": "string"
|
|
81
|
+
"type": "string",
|
|
82
|
+
"default": "\"\""
|
|
82
83
|
},
|
|
83
84
|
{
|
|
84
85
|
"name": "disabled",
|
|
85
86
|
"attribute": "disabled",
|
|
86
87
|
"description": "Set disabled state",
|
|
87
88
|
"type": "boolean",
|
|
88
|
-
"default": "
|
|
89
|
+
"default": "false"
|
|
89
90
|
}
|
|
90
91
|
],
|
|
91
92
|
"events": [
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# ef-select
|
|
2
|
+
|
|
3
|
+
Expands upon the native select element,
|
|
4
|
+
providing a fully themeable dropdown element.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
| Property | Attribute | Type | Default | Description |
|
|
9
|
+
|--------------------|---------------|----------------------|---------|--------------------------------------------------|
|
|
10
|
+
| `data` | | `SelectData \| null` | null | Construct the menu from data object. Cannot be used with slotted content |
|
|
11
|
+
| `disabled` | `disabled` | `boolean` | false | Set disabled state |
|
|
12
|
+
| `error` | `error` | `boolean` | false | Set state to error |
|
|
13
|
+
| `label (readonly)` | | `string` | | Current text content of the selected value |
|
|
14
|
+
| `opened` | `opened` | `boolean` | false | Toggles the opened state of the list |
|
|
15
|
+
| `placeholder` | `placeholder` | `string` | "" | Placeholder to display when no value is set |
|
|
16
|
+
| `value` | | `string` | "" | Value of the element |
|
|
17
|
+
| `warning` | `warning` | `boolean` | false | Set state to warning |
|
|
18
|
+
|
|
19
|
+
## Events
|
|
20
|
+
|
|
21
|
+
| Event | Description |
|
|
22
|
+
|------------------|-----------------------------------------|
|
|
23
|
+
| `opened-changed` | Fired when the opened property changes. |
|
|
24
|
+
| `value-changed` | Fired when the value property changes. |
|
package/lib/select/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { ControlElement, TemplateResult,
|
|
3
|
-
import '../overlay';
|
|
4
|
-
import '../item';
|
|
5
|
-
import '../icon';
|
|
6
|
-
import { SelectData, SelectDataItem } from './helpers/types';
|
|
7
|
-
export { SelectData, SelectDataItem };
|
|
2
|
+
import { ControlElement, TemplateResult, CSSResultGroup, PropertyValues, MultiValue } from '@refinitiv-ui/core';
|
|
3
|
+
import '../overlay/index.js';
|
|
4
|
+
import '../item/index.js';
|
|
5
|
+
import '../icon/index.js';
|
|
6
|
+
import type { SelectData, SelectDataItem } from './helpers/types';
|
|
7
|
+
export type { SelectData, SelectDataItem };
|
|
8
8
|
/**
|
|
9
9
|
* Expands upon the native select element,
|
|
10
10
|
* providing a fully themeable dropdown element.
|
|
@@ -21,13 +21,14 @@ export declare class Select extends ControlElement implements MultiValue {
|
|
|
21
21
|
* @returns version number
|
|
22
22
|
*/
|
|
23
23
|
static get version(): string;
|
|
24
|
+
protected readonly defaultRole: string | null;
|
|
24
25
|
/**
|
|
25
|
-
* A `
|
|
26
|
+
* A `CSSResultGroup` that will be used
|
|
26
27
|
* to style the host, slotted children
|
|
27
28
|
* and the internal template of the element.
|
|
28
29
|
* @return CSS template
|
|
29
30
|
*/
|
|
30
|
-
static get styles():
|
|
31
|
+
static get styles(): CSSResultGroup;
|
|
31
32
|
private composer;
|
|
32
33
|
private _data;
|
|
33
34
|
private mutationObserver?;
|
|
@@ -79,6 +80,7 @@ export declare class Select extends ControlElement implements MultiValue {
|
|
|
79
80
|
/**
|
|
80
81
|
* Construct the menu from data object. Cannot be used with slotted content
|
|
81
82
|
* @type {SelectData | null}
|
|
83
|
+
* @default null
|
|
82
84
|
*/
|
|
83
85
|
get data(): SelectData | null;
|
|
84
86
|
set data(value: SelectData | null);
|
|
@@ -91,6 +93,7 @@ export declare class Select extends ControlElement implements MultiValue {
|
|
|
91
93
|
/**
|
|
92
94
|
* Value of the element
|
|
93
95
|
* @param value Element value
|
|
96
|
+
* @default -
|
|
94
97
|
*/
|
|
95
98
|
set value(value: string);
|
|
96
99
|
get value(): string;
|
|
@@ -101,6 +104,11 @@ export declare class Select extends ControlElement implements MultiValue {
|
|
|
101
104
|
*/
|
|
102
105
|
get values(): string[];
|
|
103
106
|
private menuEl?;
|
|
107
|
+
/**
|
|
108
|
+
* Called when connected to DOM
|
|
109
|
+
* @returns {void}
|
|
110
|
+
*/
|
|
111
|
+
connectedCallback(): void;
|
|
104
112
|
/**
|
|
105
113
|
* Updates the element
|
|
106
114
|
* @param changedProperties Properties that has changed
|
|
@@ -239,8 +247,8 @@ export declare class Select extends ControlElement implements MultiValue {
|
|
|
239
247
|
*/
|
|
240
248
|
private isValidFilterKey;
|
|
241
249
|
/**
|
|
242
|
-
* Focus and highlight
|
|
243
|
-
* @param direction
|
|
250
|
+
* Focus and highlight element according to specified direction
|
|
251
|
+
* @param direction previous, next, first or last focusable element
|
|
244
252
|
* @returns {void}
|
|
245
253
|
*/
|
|
246
254
|
private focusElement;
|