@refinitiv-ui/elements 5.3.4 → 5.8.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 +89 -0
- 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 +9 -13
- package/lib/color-dialog/elements/grayscale-palettes.d.ts +5 -5
- package/lib/color-dialog/elements/grayscale-palettes.js +10 -13
- package/lib/color-dialog/elements/palettes.d.ts +10 -3
- package/lib/color-dialog/elements/palettes.js +58 -45
- package/lib/color-dialog/helpers/color-helpers.d.ts +7 -53
- package/lib/color-dialog/helpers/color-helpers.js +12 -109
- package/lib/color-dialog/helpers/value-model.d.ts +1 -1
- package/lib/color-dialog/helpers/value-model.js +18 -16
- package/lib/color-dialog/index.d.ts +19 -19
- package/lib/color-dialog/index.js +47 -45
- 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/themes/solar/charcoal/index.js +1 -1
- package/lib/datetime-picker/themes/solar/pearl/index.js +1 -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/email-field/themes/solar/charcoal/index.js +1 -1
- package/lib/email-field/themes/solar/pearl/index.js +1 -1
- 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/multi-input/themes/solar/charcoal/index.js +1 -1
- package/lib/multi-input/themes/solar/pearl/index.js +1 -1
- 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/number-field/themes/solar/charcoal/index.js +1 -1
- package/lib/number-field/themes/solar/pearl/index.js +1 -1
- 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 +27 -28
- 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 +26 -19
- package/lib/overlay-menu/index.js +47 -33
- 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/password-field/themes/solar/charcoal/index.js +1 -1
- package/lib/password-field/themes/solar/pearl/index.js +1 -1
- 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/search-field/themes/solar/charcoal/index.js +1 -1
- package/lib/search-field/themes/solar/pearl/index.js +1 -1
- 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/themes/solar/charcoal/index.js +1 -1
- package/lib/tab/themes/solar/pearl/index.js +1 -1
- 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/tab-bar/themes/solar/charcoal/index.js +1 -1
- package/lib/tab-bar/themes/solar/pearl/index.js +1 -1
- 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/text-field/themes/solar/charcoal/index.js +1 -1
- package/lib/text-field/themes/solar/pearl/index.js +1 -1
- 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/time-picker/themes/solar/charcoal/index.js +1 -1
- package/lib/time-picker/themes/solar/pearl/index.js +1 -1
- 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 +17 -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 +51 -5
- package/lib/tree/elements/tree.js +138 -11
- package/lib/tree/helpers/filter.d.ts +8 -0
- package/lib/tree/helpers/filter.js +33 -0
- package/lib/tree/helpers/renderer.d.ts +2 -2
- package/lib/tree/helpers/renderer.js +3 -3
- package/lib/tree/helpers/types.d.ts +9 -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 +32 -28
- package/lib/tree-select/index.js +54 -44
- 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
package/lib/text-field/index.js
CHANGED
|
@@ -1,63 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import '../
|
|
10
|
-
import { registerOverflowTooltip } from '../tooltip';
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { FormFieldElement, css, html } from '@refinitiv-ui/core';
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
|
|
5
|
+
import { ifDefined } from '@refinitiv-ui/core/lib/directives/if-defined.js';
|
|
6
|
+
import { VERSION } from '../version.js';
|
|
7
|
+
import { isIE } from '@refinitiv-ui/utils/lib/browser.js';
|
|
8
|
+
import '../icon/index.js';
|
|
9
|
+
import { registerOverflowTooltip } from '../tooltip/index.js';
|
|
11
10
|
const hasChanged = (newVal, oldVal) => oldVal === undefined ? false : newVal !== oldVal;
|
|
12
|
-
const isIE = (/Trident/g).test(navigator.userAgent);
|
|
13
11
|
/**
|
|
14
|
-
* Form control element for text
|
|
12
|
+
* Form control element for text.
|
|
15
13
|
*
|
|
16
14
|
* @fires value-changed - Dispatched when value changes
|
|
17
15
|
* @fires error-changed - Dispatched when error state changes
|
|
16
|
+
* @fires icon-click - Dispatched when icon is clicked
|
|
18
17
|
*
|
|
19
|
-
* @attr {
|
|
20
|
-
* @prop {
|
|
18
|
+
* @attr {boolean} disabled - Set disabled state
|
|
19
|
+
* @prop {boolean} [disabled=false] - Set disabled state
|
|
20
|
+
*
|
|
21
|
+
* @attr {boolean} error - Set error state
|
|
22
|
+
* @prop {boolean} [error=false] - Set error state
|
|
23
|
+
*
|
|
24
|
+
* @attr {string} placeholder - Set placeholder text
|
|
25
|
+
* @prop {string} [placeholder=""] - Set placeholder text
|
|
21
26
|
*
|
|
22
27
|
* @attr {boolean} readonly - Set readonly state
|
|
23
28
|
* @prop {boolean} [readonly=false] - Set readonly state
|
|
24
29
|
*
|
|
25
|
-
* @attr {boolean}
|
|
26
|
-
* @prop {boolean} [
|
|
30
|
+
* @attr {boolean} transparent - Disables all other states and border/background styles.
|
|
31
|
+
* @prop {boolean} [transparent=false] - Disables all other states and border/background styles.
|
|
32
|
+
*
|
|
33
|
+
* @attr {boolean} warning - Set warning state
|
|
34
|
+
* @prop {boolean} [warning=false] - Set warning state
|
|
35
|
+
*
|
|
36
|
+
* @attr {string} value - Input's value
|
|
37
|
+
* @prop {string} [value=""] - Input's value
|
|
27
38
|
*/
|
|
28
|
-
let TextField = class TextField extends
|
|
39
|
+
let TextField = class TextField extends FormFieldElement {
|
|
29
40
|
constructor() {
|
|
30
41
|
super(...arguments);
|
|
31
42
|
/**
|
|
32
43
|
* Set regular expression for input validation
|
|
33
44
|
*/
|
|
34
45
|
this.pattern = '';
|
|
35
|
-
/**
|
|
36
|
-
* Set place holder text
|
|
37
|
-
*/
|
|
38
|
-
this.placeholder = '';
|
|
39
|
-
/**
|
|
40
|
-
* Set state to error
|
|
41
|
-
*/
|
|
42
|
-
this.error = false;
|
|
43
|
-
/**
|
|
44
|
-
* Set state to warning
|
|
45
|
-
*/
|
|
46
|
-
this.warning = false;
|
|
47
46
|
/**
|
|
48
47
|
* Specify icon to display in input. Value can be icon name
|
|
49
48
|
*/
|
|
50
|
-
this.icon =
|
|
49
|
+
this.icon = null;
|
|
51
50
|
/**
|
|
52
51
|
* Specify when icon need to be clickable
|
|
53
52
|
*/
|
|
54
53
|
this.iconHasAction = false;
|
|
55
|
-
/**
|
|
56
|
-
* Disables all other states and border/background styles.
|
|
57
|
-
* Use with advanced composite elements requiring e.g. multi selection in
|
|
58
|
-
* combo-box when parent container handles element states.
|
|
59
|
-
*/
|
|
60
|
-
this.transparent = false;
|
|
61
54
|
/**
|
|
62
55
|
* Set character max limit
|
|
63
56
|
*/
|
|
@@ -75,8 +68,9 @@ let TextField = class TextField extends ControlElement {
|
|
|
75
68
|
return VERSION;
|
|
76
69
|
}
|
|
77
70
|
/**
|
|
78
|
-
*
|
|
71
|
+
* A `CSSResultGroup` that will be used to style the host,
|
|
79
72
|
* slotted children and the internal template of the element.
|
|
73
|
+
* @returns CSS template
|
|
80
74
|
*/
|
|
81
75
|
static get styles() {
|
|
82
76
|
return css `
|
|
@@ -107,42 +101,6 @@ let TextField = class TextField extends ControlElement {
|
|
|
107
101
|
}
|
|
108
102
|
`;
|
|
109
103
|
}
|
|
110
|
-
/**
|
|
111
|
-
* Selection start index
|
|
112
|
-
*/
|
|
113
|
-
get selectionStart() {
|
|
114
|
-
return this.inputElement.selectionStart;
|
|
115
|
-
}
|
|
116
|
-
set selectionStart(index) {
|
|
117
|
-
this.inputElement.selectionStart = index;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Selection end index
|
|
121
|
-
*/
|
|
122
|
-
get selectionEnd() {
|
|
123
|
-
return this.inputElement.selectionEnd;
|
|
124
|
-
}
|
|
125
|
-
set selectionEnd(index) {
|
|
126
|
-
this.inputElement.selectionEnd = index;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Select the contents of input
|
|
130
|
-
* @returns void
|
|
131
|
-
*/
|
|
132
|
-
select() {
|
|
133
|
-
if (!this.disabled && !this.readonly) {
|
|
134
|
-
this.inputElement.select();
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Set the selection range
|
|
139
|
-
* @param startSelection Start of selection
|
|
140
|
-
* @param endSelection End of the selection
|
|
141
|
-
* @returns {void}
|
|
142
|
-
*/
|
|
143
|
-
setSelectionRange(startSelection, endSelection) {
|
|
144
|
-
this.inputElement.setSelectionRange(startSelection, endSelection);
|
|
145
|
-
}
|
|
146
104
|
/**
|
|
147
105
|
* Called after the component is first rendered
|
|
148
106
|
* @param changedProperties Properties which have changed
|
|
@@ -150,7 +108,9 @@ let TextField = class TextField extends ControlElement {
|
|
|
150
108
|
*/
|
|
151
109
|
firstUpdated(changedProperties) {
|
|
152
110
|
super.firstUpdated(changedProperties);
|
|
153
|
-
|
|
111
|
+
if (this.inputElement) {
|
|
112
|
+
registerOverflowTooltip(this.inputElement, () => this.value);
|
|
113
|
+
}
|
|
154
114
|
}
|
|
155
115
|
/**
|
|
156
116
|
* Called when the element’s DOM has been updated and rendered
|
|
@@ -159,8 +119,8 @@ let TextField = class TextField extends ControlElement {
|
|
|
159
119
|
*/
|
|
160
120
|
updated(changedProperties) {
|
|
161
121
|
super.updated(changedProperties);
|
|
162
|
-
if (this.
|
|
163
|
-
this.
|
|
122
|
+
if (this.inputValue !== this.value) {
|
|
123
|
+
this.inputValue = this.value;
|
|
164
124
|
}
|
|
165
125
|
if (this.shouldValidateInput(changedProperties)) {
|
|
166
126
|
this.validateInput();
|
|
@@ -171,146 +131,127 @@ let TextField = class TextField extends ControlElement {
|
|
|
171
131
|
* @param changedProperties Properties that has changed
|
|
172
132
|
* @returns True if input should be re-validated
|
|
173
133
|
*/
|
|
134
|
+
/* istanbul ignore next */
|
|
174
135
|
shouldValidateInput(changedProperties) {
|
|
136
|
+
// TODO: This validation should be refactored
|
|
175
137
|
return (changedProperties.has('pattern') || !!(this.pattern && changedProperties.has('value')))
|
|
176
|
-
|| (changedProperties.has('minLength') || !!(this.minLength && changedProperties.has('value')))
|
|
138
|
+
|| (changedProperties.has('minLength') || !!(this.minLength && changedProperties.has('value')))
|
|
139
|
+
|| (changedProperties.has('maxLength') || !!(this.maxLength && changedProperties.has('value')));
|
|
177
140
|
}
|
|
178
141
|
/**
|
|
179
|
-
*
|
|
142
|
+
* Runs on input element `input` event
|
|
143
|
+
* @param event `input` event
|
|
180
144
|
* @returns {void}
|
|
181
145
|
*/
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
<ef-icon
|
|
185
|
-
part="icon"
|
|
186
|
-
icon="${this.icon}"
|
|
187
|
-
?readonly="${this.readonly}"
|
|
188
|
-
?disabled="${this.disabled}"
|
|
189
|
-
@tap="${this.iconClick}"
|
|
190
|
-
@keydown="${this.handleKeyDown}"
|
|
191
|
-
tabindex="${ifDefined(this.iconHasAction ? '0' : undefined)}"
|
|
192
|
-
></ef-icon>
|
|
193
|
-
` : null;
|
|
146
|
+
onInputInput(event) {
|
|
147
|
+
this.onPossibleValueChange(event);
|
|
194
148
|
}
|
|
195
149
|
/**
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
* @
|
|
150
|
+
* Runs on input element `change` event
|
|
151
|
+
* @param event `change` event
|
|
152
|
+
* @returns {void}
|
|
199
153
|
*/
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
<input
|
|
203
|
-
type="text"
|
|
204
|
-
part="input"
|
|
205
|
-
?readonly="${this.readonly}"
|
|
206
|
-
?disabled="${this.disabled}"
|
|
207
|
-
placeholder="${ifDefined(this.placeholder || undefined)}"
|
|
208
|
-
maxlength="${ifDefined(this.maxLength || undefined)}"
|
|
209
|
-
minlength="${ifDefined(this.minLength || undefined)}"
|
|
210
|
-
@input="${this.onPossibleValueChange}"
|
|
211
|
-
@change="${this.onPossibleValueChange}"
|
|
212
|
-
pattern="${ifDefined(this.pattern || undefined)}"
|
|
213
|
-
autocomplete="off"
|
|
214
|
-
/>
|
|
215
|
-
${this.renderIcon()}
|
|
216
|
-
`;
|
|
154
|
+
onInputChange(event) {
|
|
155
|
+
this.onPossibleValueChange(event);
|
|
217
156
|
}
|
|
218
157
|
/**
|
|
219
|
-
*
|
|
158
|
+
* Check if value is changed and fire event
|
|
220
159
|
* @returns {void}
|
|
221
160
|
*/
|
|
222
|
-
|
|
223
|
-
|
|
161
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
162
|
+
onPossibleValueChange(event) {
|
|
163
|
+
var _a;
|
|
164
|
+
const value = ((_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
224
165
|
this.setValueAndNotify(value);
|
|
225
166
|
}
|
|
226
167
|
/**
|
|
227
|
-
*
|
|
168
|
+
* Validate input according `pattern`, `minLength` and `maxLength` properties
|
|
228
169
|
* change state of `error` property according pattern validation
|
|
229
|
-
* @returns void
|
|
170
|
+
* @returns {void}
|
|
230
171
|
*/
|
|
231
172
|
validateInput() {
|
|
232
|
-
|
|
173
|
+
var _a;
|
|
174
|
+
let error = !((_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.checkValidity());
|
|
175
|
+
/* istanbul ignore next */
|
|
233
176
|
if (this.shouldValidateForMinLength(error)) {
|
|
234
177
|
error = !!this.minLength && (this.minLength > this.value.length);
|
|
235
178
|
}
|
|
236
|
-
|
|
237
|
-
this.error = error;
|
|
238
|
-
this.notifyPropertyChange('error', this.error);
|
|
239
|
-
}
|
|
179
|
+
this.notifyErrorChange(error);
|
|
240
180
|
}
|
|
241
181
|
/**
|
|
242
182
|
* @param error existing state of error
|
|
243
183
|
* @returns true if there is no error and browser is IE11 and minLength more than 0 and value exists
|
|
244
184
|
*/
|
|
185
|
+
/* istanbul ignore next */
|
|
245
186
|
shouldValidateForMinLength(error) {
|
|
246
187
|
return !!(!error && isIE && this.minLength && !!this.value);
|
|
247
188
|
}
|
|
248
189
|
/**
|
|
249
|
-
*
|
|
250
|
-
* @param event keydown event
|
|
190
|
+
* Fires event on `icon` click
|
|
251
191
|
* @returns {void}
|
|
252
192
|
*/
|
|
253
|
-
|
|
254
|
-
if (
|
|
255
|
-
this.
|
|
193
|
+
iconClick() {
|
|
194
|
+
if (this.iconHasAction && !this.disabled) {
|
|
195
|
+
this.dispatchEvent(new CustomEvent('icon-click', { bubbles: false }));
|
|
256
196
|
}
|
|
257
197
|
}
|
|
258
198
|
/**
|
|
259
|
-
*
|
|
260
|
-
*
|
|
199
|
+
* Decorate `<input>` element with common properties extended from form field element:
|
|
200
|
+
* type="text" - always `text`
|
|
201
|
+
* part="input" - always "input", used for styling
|
|
202
|
+
* maxlength - calculated from `this.maxLength`
|
|
203
|
+
* minlength - calculated from `this.minLength`
|
|
204
|
+
* pattern - calculated from `this.pattern`
|
|
205
|
+
* @returns template map
|
|
261
206
|
*/
|
|
262
|
-
|
|
263
|
-
|
|
207
|
+
get decorateInputMap() {
|
|
208
|
+
return Object.assign(Object.assign({}, super.decorateInputMap), { 'type': 'text', 'part': 'input', 'maxlength': this.maxLength, 'minlength': this.minLength, 'pattern': this.pattern || null });
|
|
264
209
|
}
|
|
265
210
|
/**
|
|
266
|
-
*
|
|
211
|
+
* Renders icon element if property present
|
|
267
212
|
* @returns {void}
|
|
268
213
|
*/
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
214
|
+
renderIcon() {
|
|
215
|
+
return this.icon ? html `
|
|
216
|
+
<ef-icon
|
|
217
|
+
role="${ifDefined(this.iconHasAction ? 'button' : undefined)}"
|
|
218
|
+
part="icon"
|
|
219
|
+
icon="${this.icon}"
|
|
220
|
+
aria-label="${ifDefined(this.iconHasAction ? this.icon : undefined)}"
|
|
221
|
+
?readonly="${this.readonly}"
|
|
222
|
+
?disabled="${this.disabled}"
|
|
223
|
+
@tap="${this.iconClick}"
|
|
224
|
+
tabindex="${ifDefined(this.iconHasAction ? '0' : undefined)}"
|
|
225
|
+
></ef-icon>
|
|
226
|
+
` : null;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* A `TemplateResult` that will be used
|
|
230
|
+
* to render the updated internal template.
|
|
231
|
+
* @return Render template
|
|
232
|
+
*/
|
|
233
|
+
render() {
|
|
234
|
+
return html `
|
|
235
|
+
${super.render()}
|
|
236
|
+
${this.renderIcon()}
|
|
237
|
+
`;
|
|
276
238
|
}
|
|
277
239
|
};
|
|
278
240
|
__decorate([
|
|
279
241
|
property({ type: String, hasChanged })
|
|
280
242
|
], TextField.prototype, "pattern", void 0);
|
|
281
|
-
__decorate([
|
|
282
|
-
property({ type: String })
|
|
283
|
-
], TextField.prototype, "placeholder", void 0);
|
|
284
|
-
__decorate([
|
|
285
|
-
property({ type: Boolean, reflect: true })
|
|
286
|
-
], TextField.prototype, "error", void 0);
|
|
287
|
-
__decorate([
|
|
288
|
-
property({ type: Boolean, reflect: true })
|
|
289
|
-
], TextField.prototype, "warning", void 0);
|
|
290
243
|
__decorate([
|
|
291
244
|
property({ type: String, reflect: true })
|
|
292
245
|
], TextField.prototype, "icon", void 0);
|
|
293
246
|
__decorate([
|
|
294
247
|
property({ type: Boolean, reflect: true, attribute: 'icon-has-action' })
|
|
295
248
|
], TextField.prototype, "iconHasAction", void 0);
|
|
296
|
-
__decorate([
|
|
297
|
-
property({ type: Boolean, reflect: true })
|
|
298
|
-
], TextField.prototype, "transparent", void 0);
|
|
299
249
|
__decorate([
|
|
300
250
|
property({ type: Number, attribute: 'maxlength', reflect: true })
|
|
301
251
|
], TextField.prototype, "maxLength", void 0);
|
|
302
252
|
__decorate([
|
|
303
253
|
property({ type: Number, attribute: 'minlength', reflect: true, hasChanged })
|
|
304
254
|
], TextField.prototype, "minLength", void 0);
|
|
305
|
-
__decorate([
|
|
306
|
-
query('[part="input"]')
|
|
307
|
-
], TextField.prototype, "inputElement", void 0);
|
|
308
|
-
__decorate([
|
|
309
|
-
property({ type: Number, attribute: false })
|
|
310
|
-
], TextField.prototype, "selectionStart", null);
|
|
311
|
-
__decorate([
|
|
312
|
-
property({ type: Number, attribute: false })
|
|
313
|
-
], TextField.prototype, "selectionEnd", null);
|
|
314
255
|
TextField = __decorate([
|
|
315
256
|
customElement('ef-text-field', {
|
|
316
257
|
alias: 'coral-text-field'
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/lib/icon/themes/solar/charcoal';
|
|
2
2
|
|
|
3
|
-
elf.customStyles.define('ef-text-field', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;width:140px;max-width:100%;padding:0 5px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#c2c2c2;border-radius:0;text-overflow:ellipsis;background-color:#000;border:1px solid #4a4a52}:host([type=number]){padding-right:0}:host([error]),:host([error][warning]){border:1px solid #f5475b}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(194,194,194,.6);border:1px solid rgba(245,71,91,.6)}:host ::-ms-clear{display:none}:host [part=input]{color:inherit;padding:0;margin:0;flex:1 1 auto;min-width:0;width:100%;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis;touch-action:manipulation}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:invalid{box-shadow:none}:host [part=icon]{color:#e2e2e2;min-width:1em}:host([disabled]) [part=input]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host([disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6)}:host([readonly]){border:1px solid rgba(74,74,82,.6)}:host(:not([focused]):not(:focus):hover){border:1px solid #77777d}:host([warning]){background-color:#000;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(194,194,194,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#000;border:1px solid #f5475b}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(245,71,91,.6);color:rgba(194,194,194,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(245,71,91,.6)}:host([error]:not([focused]):not(:focus):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):hover){border:1px solid #f87584}:host([highlight]){background-color:#1b252f;border:1px solid #4a4a52}:host([highlight][disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6);background-color:rgba(27,37,47,.6)}:host([highlight][readonly]){border:1px solid rgba(74,74,82,.6)}:host([highlight]:not([focused]):not(:focus):hover){border:1px solid #77777d}:host([indirect]){color:#0fd;background-color:#000;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,255,221,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):hover){border:1px solid #a7a45a}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#f93;border-style:dotted}:host([disabled]) [part=input]::-webkit-input-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]::-moz-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]:-ms-input-placeholder{color:rgba(102,101,112,.6)}');
|
|
3
|
+
elf.customStyles.define('ef-text-field', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;width:140px;max-width:100%;padding:0 5px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#c2c2c2;border-radius:0;text-overflow:ellipsis;background-color:#000;border:1px solid #4a4a52}:host([type=number]){padding-right:0}:host([error]),:host([error][warning]){border:1px solid #f5475b}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(194,194,194,.6);border:1px solid rgba(245,71,91,.6)}:host ::-ms-clear{display:none}:host [part=input]{color:inherit;padding:0;margin:0;flex:1 1 auto;min-width:0;width:100%;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis;touch-action:manipulation}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:invalid{box-shadow:none}:host [part=icon]{color:#e2e2e2;min-width:1em}:host([disabled]) [part=input]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host([disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6)}:host([readonly]){border:1px solid rgba(74,74,82,.6)}:host(:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #77777d}:host([warning]){background-color:#000;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(194,194,194,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#000;border:1px solid #f5475b}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(245,71,91,.6);color:rgba(194,194,194,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(245,71,91,.6)}:host([error]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #f87584}:host([highlight]){background-color:#1b252f;border:1px solid #4a4a52}:host([highlight][disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6);background-color:rgba(27,37,47,.6)}:host([highlight][readonly]){border:1px solid rgba(74,74,82,.6)}:host([highlight]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #77777d}:host([indirect]){color:#0fd;background-color:#000;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,255,221,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #a7a45a}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#f93;border-style:dotted}:host([disabled]) [part=input]::-webkit-input-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]::-moz-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]:-ms-input-placeholder{color:rgba(102,101,112,.6)}');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/lib/icon/themes/solar/pearl';
|
|
2
2
|
|
|
3
|
-
elf.customStyles.define('ef-text-field', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;width:140px;max-width:100%;padding:0 5px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#484848;border-radius:0;text-overflow:ellipsis;background-color:#fff;border:1px solid #a9afba}:host([type=number]){padding-right:0}:host([error]),:host([error][warning]){border:1px solid #d94255}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(72,72,72,.6);border:1px solid rgba(217,66,85,.6)}:host ::-ms-clear{display:none}:host [part=input]{color:inherit;padding:0;margin:0;flex:1 1 auto;min-width:0;width:100%;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis;touch-action:manipulation}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:invalid{box-shadow:none}:host [part=icon]{color:#acafb5;min-width:1em}:host([disabled]) [part=input]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host([disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6)}:host([readonly]){border:1px solid rgba(169,175,186,.6)}:host(:not([focused]):not(:focus):hover){border:1px solid #bfc3cb}:host([warning]){background-color:#fff;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(72,72,72,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#fff;border:1px solid #d94255}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(217,66,85,.6);color:rgba(72,72,72,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(217,66,85,.6)}:host([error]:not([focused]):not(:focus):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):hover){border:1px solid #e37180}:host([highlight]){background-color:#b0ffff;border:1px solid #a9afba}:host([highlight][disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6);background-color:rgba(176,255,255,.6)}:host([highlight][readonly]){border:1px solid rgba(169,175,186,.6)}:host([highlight]:not([focused]):not(:focus):hover){border:1px solid #bfc3cb}:host([indirect]){color:#009494;background-color:#effefe;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,148,148,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):hover){border:1px solid #a7a45a}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#ffb266;border-style:dotted}:host([disabled]) [part=input]::-webkit-input-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]::-moz-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]:-ms-input-placeholder{color:rgba(102,101,112,.6)}');
|
|
3
|
+
elf.customStyles.define('ef-text-field', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;width:140px;max-width:100%;padding:0 5px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#484848;border-radius:0;text-overflow:ellipsis;background-color:#fff;border:1px solid #a9afba}:host([type=number]){padding-right:0}:host([error]),:host([error][warning]){border:1px solid #d94255}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(72,72,72,.6);border:1px solid rgba(217,66,85,.6)}:host ::-ms-clear{display:none}:host [part=input]{color:inherit;padding:0;margin:0;flex:1 1 auto;min-width:0;width:100%;height:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-overflow:ellipsis;touch-action:manipulation}:host [part=input]::-webkit-clear-button,:host [part=input]::-webkit-inner-spin-button,:host [part=input]::-webkit-search-cancel-button,:host [part=input]::-webkit-search-decoration{-webkit-appearance:none}:host [part=input]:invalid{box-shadow:none}:host [part=icon]{color:#acafb5;min-width:1em}:host([disabled]) [part=input]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host([disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6)}:host([readonly]){border:1px solid rgba(169,175,186,.6)}:host(:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #bfc3cb}:host([warning]){background-color:#fff;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(72,72,72,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#fff;border:1px solid #d94255}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(217,66,85,.6);color:rgba(72,72,72,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(217,66,85,.6)}:host([error]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #e37180}:host([highlight]){background-color:#b0ffff;border:1px solid #a9afba}:host([highlight][disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6);background-color:rgba(176,255,255,.6)}:host([highlight][readonly]){border:1px solid rgba(169,175,186,.6)}:host([highlight]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #bfc3cb}:host([indirect]){color:#009494;background-color:#effefe;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,148,148,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #a7a45a}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#ffb266;border-style:dotted}:host([disabled]) [part=input]::-webkit-input-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]::-moz-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]:-ms-input-placeholder{color:rgba(102,101,112,.6)}');
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"name": "readonly",
|
|
43
43
|
"description": "Set readonly state",
|
|
44
44
|
"type": "boolean",
|
|
45
|
-
"default": "
|
|
45
|
+
"default": "false"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"name": "disabled",
|
|
49
49
|
"description": "Set disabled state",
|
|
50
50
|
"type": "boolean",
|
|
51
|
-
"default": "
|
|
51
|
+
"default": "false"
|
|
52
52
|
}
|
|
53
53
|
],
|
|
54
54
|
"properties": [
|
|
@@ -96,14 +96,14 @@
|
|
|
96
96
|
"attribute": "readonly",
|
|
97
97
|
"description": "Set readonly state",
|
|
98
98
|
"type": "boolean",
|
|
99
|
-
"default": "
|
|
99
|
+
"default": "false"
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"name": "disabled",
|
|
103
103
|
"attribute": "disabled",
|
|
104
104
|
"description": "Set disabled state",
|
|
105
105
|
"type": "boolean",
|
|
106
|
-
"default": "
|
|
106
|
+
"default": "false"
|
|
107
107
|
}
|
|
108
108
|
],
|
|
109
109
|
"events": [
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# ef-time-picker
|
|
2
|
+
|
|
3
|
+
Control the time input
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Attribute | Type | Default | Description |
|
|
8
|
+
|---------------|----------------|------------------|---------|--------------------------------------------------|
|
|
9
|
+
| `amPm` | `am-pm` | `boolean` | false | Toggles 12hr time display |
|
|
10
|
+
| `disabled` | `disabled` | `boolean` | false | Set disabled state |
|
|
11
|
+
| `hours` | `hours` | `number \| null` | null | Hours time segment in 24hr format |
|
|
12
|
+
| `minutes` | `minutes` | `number \| null` | null | Minutes time segment |
|
|
13
|
+
| `readonly` | `readonly` | `boolean` | false | Set readonly state |
|
|
14
|
+
| `seconds` | `seconds` | `number \| null` | null | Seconds time segment |
|
|
15
|
+
| `showSeconds` | `show-seconds` | `boolean` | false | Flag to show seconds time segment in display.<br />Seconds are automatically shown when `hh:mm:ss` time format is provided as a value. |
|
|
16
|
+
| `value` | `value` | `string` | "" | Value of the element |
|
|
17
|
+
|
|
18
|
+
## Methods
|
|
19
|
+
|
|
20
|
+
| Method | Type | Description |
|
|
21
|
+
|----------|------------|-------------------------|
|
|
22
|
+
| `toggle` | `(): void` | Toggles the AM/PM state |
|
|
23
|
+
|
|
24
|
+
## Events
|
|
25
|
+
|
|
26
|
+
| Event | Description |
|
|
27
|
+
|-----------------|-------------------------------|
|
|
28
|
+
| `value-changed` | Dispatched when value changes |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { ControlElement, TemplateResult,
|
|
3
|
-
import '../number-field';
|
|
2
|
+
import { ControlElement, TemplateResult, CSSResultGroup, PropertyValues } from '@refinitiv-ui/core';
|
|
3
|
+
import '../number-field/index.js';
|
|
4
4
|
declare enum Segment {
|
|
5
5
|
HOURS = "hours",
|
|
6
6
|
MINUTES = "minutes",
|
|
@@ -43,6 +43,7 @@ export declare class TimePicker extends ControlElement {
|
|
|
43
43
|
/**
|
|
44
44
|
* Hours time segment in 24hr format
|
|
45
45
|
* @param hours hours value
|
|
46
|
+
* @default null
|
|
46
47
|
* @returns {void}
|
|
47
48
|
*/
|
|
48
49
|
set hours(hours: number | null);
|
|
@@ -54,6 +55,7 @@ export declare class TimePicker extends ControlElement {
|
|
|
54
55
|
/**
|
|
55
56
|
* Minutes time segment
|
|
56
57
|
* @param minutes minutes value
|
|
58
|
+
* @default null
|
|
57
59
|
* @returns {void}
|
|
58
60
|
*/
|
|
59
61
|
set minutes(minutes: number | null);
|
|
@@ -65,6 +67,7 @@ export declare class TimePicker extends ControlElement {
|
|
|
65
67
|
/**
|
|
66
68
|
* Seconds time segment
|
|
67
69
|
* @param seconds seconds value
|
|
70
|
+
* @default null
|
|
68
71
|
* @returns {void}
|
|
69
72
|
*/
|
|
70
73
|
set seconds(seconds: number | null);
|
|
@@ -331,12 +334,12 @@ export declare class TimePicker extends ControlElement {
|
|
|
331
334
|
*/
|
|
332
335
|
toggle(): void;
|
|
333
336
|
/**
|
|
334
|
-
* A `
|
|
337
|
+
* A `CSSResultGroup` that will be used
|
|
335
338
|
* to style the host, slotted children
|
|
336
339
|
* and the internal template of the element.
|
|
337
340
|
* @returns CSS template
|
|
338
341
|
*/
|
|
339
|
-
static get styles():
|
|
342
|
+
static get styles(): CSSResultGroup;
|
|
340
343
|
/**
|
|
341
344
|
* Template for Seconds Segment
|
|
342
345
|
*
|
package/lib/time-picker/index.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import {
|
|
8
|
-
import '../number-field';
|
|
9
|
-
import { isValidTime, toTimeSegment, TimeFormat, getFormat, format, isAM, isPM, MILLISECONDS_IN_SECOND, MILLISECONDS_IN_MINUTE, MILLISECONDS_IN_HOUR, addOffset, padNumber } from '@refinitiv-ui/utils';
|
|
10
|
-
import { VERSION } from '../';
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { ControlElement, html, css } from '@refinitiv-ui/core';
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
|
|
5
|
+
import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
|
|
6
|
+
import { VERSION } from '../version.js';
|
|
7
|
+
import { isValidTime, toTimeSegment, TimeFormat, getFormat, format, isAM, isPM, MILLISECONDS_IN_SECOND, MILLISECONDS_IN_MINUTE, MILLISECONDS_IN_HOUR, addOffset, padNumber } from '@refinitiv-ui/utils/lib/date.js';
|
|
8
|
+
import '../number-field/index.js';
|
|
11
9
|
var Segment;
|
|
12
10
|
(function (Segment) {
|
|
13
11
|
Segment["HOURS"] = "hours";
|
|
@@ -129,6 +127,7 @@ let TimePicker = class TimePicker extends ControlElement {
|
|
|
129
127
|
/**
|
|
130
128
|
* Hours time segment in 24hr format
|
|
131
129
|
* @param hours hours value
|
|
130
|
+
* @default null
|
|
132
131
|
* @returns {void}
|
|
133
132
|
*/
|
|
134
133
|
set hours(hours) {
|
|
@@ -138,7 +137,7 @@ let TimePicker = class TimePicker extends ControlElement {
|
|
|
138
137
|
}
|
|
139
138
|
this._hours = this.validUnit(hours, MIN_UNIT, MAX_HOURS, oldHours);
|
|
140
139
|
if (this._hours !== oldHours) {
|
|
141
|
-
|
|
140
|
+
this.requestUpdate('hours', oldHours);
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
143
|
/**
|
|
@@ -151,6 +150,7 @@ let TimePicker = class TimePicker extends ControlElement {
|
|
|
151
150
|
/**
|
|
152
151
|
* Minutes time segment
|
|
153
152
|
* @param minutes minutes value
|
|
153
|
+
* @default null
|
|
154
154
|
* @returns {void}
|
|
155
155
|
*/
|
|
156
156
|
set minutes(minutes) {
|
|
@@ -160,7 +160,7 @@ let TimePicker = class TimePicker extends ControlElement {
|
|
|
160
160
|
}
|
|
161
161
|
this._minutes = this.validUnit(minutes, MIN_UNIT, MAX_MINUTES, oldMinutes);
|
|
162
162
|
if (this._minutes !== oldMinutes) {
|
|
163
|
-
|
|
163
|
+
this.requestUpdate('minutes', oldMinutes);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
/**
|
|
@@ -173,6 +173,7 @@ let TimePicker = class TimePicker extends ControlElement {
|
|
|
173
173
|
/**
|
|
174
174
|
* Seconds time segment
|
|
175
175
|
* @param seconds seconds value
|
|
176
|
+
* @default null
|
|
176
177
|
* @returns {void}
|
|
177
178
|
*/
|
|
178
179
|
set seconds(seconds) {
|
|
@@ -182,7 +183,7 @@ let TimePicker = class TimePicker extends ControlElement {
|
|
|
182
183
|
}
|
|
183
184
|
this._seconds = this.validUnit(seconds, MIN_UNIT, MAX_SECONDS, oldSeconds);
|
|
184
185
|
if (this._seconds !== oldSeconds) {
|
|
185
|
-
|
|
186
|
+
this.requestUpdate('seconds', oldSeconds);
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
189
|
/**
|
|
@@ -632,7 +633,7 @@ let TimePicker = class TimePicker extends ControlElement {
|
|
|
632
633
|
}
|
|
633
634
|
}
|
|
634
635
|
/**
|
|
635
|
-
* A `
|
|
636
|
+
* A `CSSResultGroup` that will be used
|
|
636
637
|
* to style the host, slotted children
|
|
637
638
|
* and the internal template of the element.
|
|
638
639
|
* @returns CSS template
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/lib/number-field/themes/solar/charcoal';
|
|
2
2
|
import '@refinitiv-ui/elements/lib/icon/themes/solar/charcoal';
|
|
3
3
|
|
|
4
|
-
elf.customStyles.define('ef-time-picker', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;max-width:100%;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#c2c2c2;border-radius:0;text-overflow:ellipsis;width:auto;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;background-color:#000;border:1px solid #4a4a52;padding:0}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#f93;border-style:dotted}:host [part=input]{margin:0;text-align:center;padding:0;color:inherit;width:25px}:host [part=divider]::before{content:\':\'}:host [part=toggle]{width:20px;display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;outline:0;cursor:pointer;touch-action:manipulation;font-size:70%;line-height:1}:host [part=input],:host [part=toggle]{height:100%;position:relative}:host [part=input]:focus::after,:host [part=input][focused]::after,:host [part=toggle]:focus::after,:host [part=toggle][focused]::after{content:\'\';border-right:8px solid transparent;border-bottom:4px solid #f93;border-left:8px solid transparent;position:absolute;content:\'\';border:none;left:calc(50% - 7px);bottom:-1px;width:14px;height:1px;background:#f93}:host [part=toggle-item]{opacity:.5}:host [part=toggle-item][active]{opacity:1}:host([disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6)}:host([readonly]){border:1px solid rgba(74,74,82,.6)}:host(:not([focused]):not(:focus):hover){border:1px solid #77777d}:host([warning]){background-color:#000;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(194,194,194,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#000;border:1px solid #f5475b}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(245,71,91,.6);color:rgba(194,194,194,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(245,71,91,.6)}:host([error]:not([focused]):not(:focus):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):hover){border:1px solid #f87584}:host([highlight]){background-color:#1b252f;border:1px solid #4a4a52}:host([highlight][disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6);background-color:rgba(27,37,47,.6)}:host([highlight][readonly]){border:1px solid rgba(74,74,82,.6)}:host([highlight]:not([focused]):not(:focus):hover){border:1px solid #77777d}:host([indirect]){color:#0fd;background-color:#000;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,255,221,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):hover){border:1px solid #a7a45a}');
|
|
4
|
+
elf.customStyles.define('ef-time-picker', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;max-width:100%;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#c2c2c2;border-radius:0;text-overflow:ellipsis;width:auto;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;background-color:#000;border:1px solid #4a4a52;padding:0}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#f93;border-style:dotted}:host [part=input]{margin:0;text-align:center;padding:0;color:inherit;width:25px}:host [part=divider]::before{content:\':\'}:host [part=toggle]{width:20px;display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;outline:0;cursor:pointer;touch-action:manipulation;font-size:70%;line-height:1}:host [part=input],:host [part=toggle]{height:100%;position:relative}:host [part=input]:focus::after,:host [part=input][focused]::after,:host [part=toggle]:focus::after,:host [part=toggle][focused]::after{content:\'\';border-right:8px solid transparent;border-bottom:4px solid #f93;border-left:8px solid transparent;position:absolute;content:\'\';border:none;left:calc(50% - 7px);bottom:-1px;width:14px;height:1px;background:#f93}:host [part=toggle-item]{opacity:.5}:host [part=toggle-item][active]{opacity:1}:host([disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6)}:host([readonly]){border:1px solid rgba(74,74,82,.6)}:host(:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #77777d}:host([warning]){background-color:#000;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(194,194,194,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#000;border:1px solid #f5475b}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(245,71,91,.6);color:rgba(194,194,194,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(245,71,91,.6)}:host([error]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #f87584}:host([highlight]){background-color:#1b252f;border:1px solid #4a4a52}:host([highlight][disabled]){border:1px solid rgba(74,74,82,.6);color:rgba(194,194,194,.6);background-color:rgba(27,37,47,.6)}:host([highlight][readonly]){border:1px solid rgba(74,74,82,.6)}:host([highlight]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #77777d}:host([indirect]){color:#0fd;background-color:#000;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,255,221,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #a7a45a}');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/lib/number-field/themes/solar/pearl';
|
|
2
2
|
import '@refinitiv-ui/elements/lib/icon/themes/solar/pearl';
|
|
3
3
|
|
|
4
|
-
elf.customStyles.define('ef-time-picker', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;max-width:100%;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#484848;border-radius:0;text-overflow:ellipsis;width:auto;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;background-color:#fff;border:1px solid #a9afba;padding:0}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#ffb266;border-style:dotted}:host [part=input]{margin:0;text-align:center;padding:0;color:inherit;width:25px}:host [part=divider]::before{content:\':\'}:host [part=toggle]{width:20px;display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;outline:0;cursor:pointer;touch-action:manipulation;font-size:70%;line-height:1}:host [part=input],:host [part=toggle]{height:100%;position:relative}:host [part=input]:focus::after,:host [part=input][focused]::after,:host [part=toggle]:focus::after,:host [part=toggle][focused]::after{content:\'\';border-right:8px solid transparent;border-bottom:4px solid #ffb266;border-left:8px solid transparent;position:absolute;content:\'\';border:none;left:calc(50% - 7px);bottom:-1px;width:14px;height:1px;background:#ffb266}:host [part=toggle-item]{opacity:.5}:host [part=toggle-item][active]{opacity:1}:host([disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6)}:host([readonly]){border:1px solid rgba(169,175,186,.6)}:host(:not([focused]):not(:focus):hover){border:1px solid #bfc3cb}:host([warning]){background-color:#fff;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(72,72,72,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#fff;border:1px solid #d94255}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(217,66,85,.6);color:rgba(72,72,72,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(217,66,85,.6)}:host([error]:not([focused]):not(:focus):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):hover){border:1px solid #e37180}:host([highlight]){background-color:#b0ffff;border:1px solid #a9afba}:host([highlight][disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6);background-color:rgba(176,255,255,.6)}:host([highlight][readonly]){border:1px solid rgba(169,175,186,.6)}:host([highlight]:not([focused]):not(:focus):hover){border:1px solid #bfc3cb}:host([indirect]){color:#009494;background-color:#effefe;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,148,148,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):hover){border:1px solid #a7a45a}');
|
|
4
|
+
elf.customStyles.define('ef-time-picker', ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13rem;font-weight:400;height:23px;max-width:100%;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#484848;border-radius:0;text-overflow:ellipsis;width:auto;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;background-color:#fff;border:1px solid #a9afba;padding:0}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#ffb266;border-style:dotted}:host [part=input]{margin:0;text-align:center;padding:0;color:inherit;width:25px}:host [part=divider]::before{content:\':\'}:host [part=toggle]{width:20px;display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;outline:0;cursor:pointer;touch-action:manipulation;font-size:70%;line-height:1}:host [part=input],:host [part=toggle]{height:100%;position:relative}:host [part=input]:focus::after,:host [part=input][focused]::after,:host [part=toggle]:focus::after,:host [part=toggle][focused]::after{content:\'\';border-right:8px solid transparent;border-bottom:4px solid #ffb266;border-left:8px solid transparent;position:absolute;content:\'\';border:none;left:calc(50% - 7px);bottom:-1px;width:14px;height:1px;background:#ffb266}:host [part=toggle-item]{opacity:.5}:host [part=toggle-item][active]{opacity:1}:host([disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6)}:host([readonly]){border:1px solid rgba(169,175,186,.6)}:host(:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #bfc3cb}:host([warning]){background-color:#fff;border:1px solid #f93}:host([warning][disabled]){border:1px solid rgba(255,153,51,.6);color:rgba(72,72,72,.6)}:host([warning][readonly]){border:1px solid rgba(255,153,51,.6)}:host([warning]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #ffb366}:host([error]),:host([error][warning]:not([focused])){background-color:#fff;border:1px solid #d94255}:host([error][disabled]),:host([error][warning]:not([focused])[disabled]){border:1px solid rgba(217,66,85,.6);color:rgba(72,72,72,.6)}:host([error][readonly]),:host([error][warning]:not([focused])[readonly]){border:1px solid rgba(217,66,85,.6)}:host([error]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover),:host([error][warning]:not([focused]):not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #e37180}:host([highlight]){background-color:#b0ffff;border:1px solid #a9afba}:host([highlight][disabled]){border:1px solid rgba(169,175,186,.6);color:rgba(72,72,72,.6);background-color:rgba(176,255,255,.6)}:host([highlight][readonly]){border:1px solid rgba(169,175,186,.6)}:host([highlight]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #bfc3cb}:host([indirect]){color:#009494;background-color:#effefe;border:1px solid #898623}:host([indirect][disabled]){border:1px solid rgba(137,134,35,.6);color:rgba(0,148,148,.6)}:host([indirect][readonly]){border:1px solid rgba(137,134,35,.6)}:host([indirect]:not([focused]):not(:focus):not([disabled]):not([readonly]):hover){border:1px solid #a7a45a}');
|