@refinitiv-ui/elements 7.0.0-next.0 → 7.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +115 -0
- package/cli.mjs +21 -0
- package/lib/accordion/index.js +1 -10
- package/lib/appstate-bar/custom-elements.json +2 -2
- package/lib/appstate-bar/custom-elements.md +4 -4
- package/lib/appstate-bar/index.d.ts +2 -2
- package/lib/appstate-bar/index.js +2 -8
- package/lib/appstate-bar/themes/halo/dark/index.js +1 -1
- package/lib/appstate-bar/themes/halo/light/index.js +1 -1
- package/lib/appstate-bar/themes/solar/charcoal/index.js +1 -1
- package/lib/appstate-bar/themes/solar/pearl/index.js +1 -1
- package/lib/autosuggest/custom-elements.json +8 -8
- package/lib/autosuggest/custom-elements.md +8 -8
- package/lib/autosuggest/helpers/types.d.ts +18 -18
- package/lib/autosuggest/index.d.ts +9 -32
- package/lib/autosuggest/index.js +112 -187
- package/lib/autosuggest/themes/halo/dark/index.js +1 -1
- package/lib/autosuggest/themes/halo/light/index.js +1 -1
- package/lib/autosuggest/themes/solar/charcoal/index.js +1 -1
- package/lib/autosuggest/themes/solar/pearl/index.js +1 -1
- package/lib/button/custom-elements.json +1 -1
- package/lib/button/custom-elements.md +1 -1
- package/lib/button/index.d.ts +1 -1
- package/lib/button/index.js +1 -1
- package/lib/button/themes/halo/dark/index.js +2 -1
- package/lib/button/themes/halo/light/index.js +2 -1
- package/lib/button/themes/solar/charcoal/index.js +2 -1
- package/lib/button/themes/solar/pearl/index.js +2 -1
- package/lib/button-bar/index.js +0 -5
- package/lib/calendar/custom-elements.json +2 -2
- package/lib/calendar/custom-elements.md +4 -4
- package/lib/calendar/index.d.ts +9 -2
- package/lib/calendar/index.js +27 -29
- package/lib/calendar/themes/halo/dark/index.js +1 -1
- package/lib/calendar/themes/halo/light/index.js +1 -1
- package/lib/calendar/themes/solar/charcoal/index.js +1 -1
- package/lib/calendar/themes/solar/pearl/index.js +1 -1
- package/lib/calendar/types.d.ts +5 -5
- package/lib/calendar/utils.d.ts +2 -13
- package/lib/calendar/utils.js +2 -20
- package/lib/canvas/custom-elements.json +1 -1
- package/lib/canvas/custom-elements.md +1 -1
- package/lib/canvas/index.d.ts +1 -1
- package/lib/canvas/index.js +10 -9
- package/lib/card/custom-elements.json +1 -1
- package/lib/card/custom-elements.md +3 -3
- package/lib/card/helpers/types.d.ts +1 -1
- package/lib/card/index.d.ts +2 -1
- package/lib/card/index.js +5 -4
- package/lib/card/themes/halo/dark/index.js +1 -1
- package/lib/card/themes/halo/light/index.js +1 -1
- package/lib/card/themes/solar/charcoal/index.js +1 -1
- package/lib/card/themes/solar/pearl/index.js +1 -1
- package/lib/chart/bare.d.ts +1 -0
- package/lib/chart/bare.js +1 -0
- package/lib/chart/custom-elements.json +10 -5
- package/lib/chart/custom-elements.md +9 -8
- package/lib/chart/elements/chart.d.ts +182 -0
- package/lib/chart/elements/chart.js +509 -0
- package/lib/chart/helpers/index.d.ts +1 -1
- package/lib/chart/helpers/index.js +1 -1
- package/lib/chart/helpers/merge.d.ts +3 -3
- package/lib/chart/helpers/merge.js +1 -1
- package/lib/chart/helpers/types.d.ts +1 -66
- package/lib/chart/index.d.ts +1 -192
- package/lib/chart/index.js +5 -485
- package/lib/chart/plugins/doughnut-center-label.d.ts +22 -3
- package/lib/chart/plugins/doughnut-center-label.js +62 -51
- package/lib/chart/plugins/index.d.ts +1 -0
- package/lib/chart/plugins/index.js +1 -0
- package/lib/chart/themes/halo/dark/index.js +1 -1
- package/lib/chart/themes/halo/light/index.js +1 -1
- package/lib/chart/themes/solar/charcoal/index.js +1 -1
- package/lib/chart/themes/solar/pearl/index.js +1 -1
- package/lib/checkbox/custom-elements.json +1 -1
- package/lib/checkbox/custom-elements.md +3 -3
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/checkbox/index.js +1 -2
- package/lib/checkbox/themes/halo/dark/index.js +1 -1
- package/lib/checkbox/themes/halo/light/index.js +1 -1
- package/lib/checkbox/themes/solar/charcoal/index.js +1 -1
- package/lib/checkbox/themes/solar/pearl/index.js +1 -1
- package/lib/clock/custom-elements.json +2 -2
- package/lib/clock/custom-elements.md +2 -2
- package/lib/clock/index.d.ts +2 -2
- package/lib/clock/index.js +2 -6
- package/lib/clock/utils/TickManager.d.ts +1 -1
- package/lib/collapse/custom-elements.json +1 -1
- package/lib/collapse/custom-elements.md +3 -3
- package/lib/collapse/index.d.ts +7 -1
- package/lib/collapse/index.js +27 -30
- package/lib/collapse/themes/halo/dark/index.js +1 -1
- package/lib/collapse/themes/halo/light/index.js +1 -1
- package/lib/collapse/themes/solar/charcoal/index.js +1 -1
- package/lib/collapse/themes/solar/pearl/index.js +1 -1
- package/lib/color-dialog/custom-elements.json +2 -2
- package/lib/color-dialog/custom-elements.md +4 -4
- package/lib/color-dialog/helpers/value-model.js +4 -5
- package/lib/color-dialog/index.d.ts +4 -4
- package/lib/color-dialog/index.js +4 -4
- package/lib/color-picker/custom-elements.json +1 -1
- package/lib/color-picker/custom-elements.md +3 -3
- package/lib/color-picker/index.d.ts +1 -1
- package/lib/color-picker/index.js +3 -5
- package/lib/combo-box/custom-elements.json +3 -6
- package/lib/combo-box/custom-elements.md +5 -6
- package/lib/combo-box/helpers/types.d.ts +2 -2
- package/lib/combo-box/index.d.ts +3 -12
- package/lib/combo-box/index.js +15 -30
- package/lib/combo-box/themes/halo/dark/index.js +2 -1
- package/lib/combo-box/themes/halo/light/index.js +2 -1
- package/lib/combo-box/themes/solar/charcoal/index.js +2 -1
- package/lib/combo-box/themes/solar/pearl/index.js +2 -1
- package/lib/counter/themes/halo/dark/index.js +2 -1
- package/lib/counter/themes/halo/light/index.js +2 -1
- package/lib/counter/themes/solar/charcoal/index.js +2 -1
- package/lib/counter/themes/solar/pearl/index.js +2 -1
- package/lib/datetime-field/index.d.ts +2 -2
- package/lib/datetime-field/index.js +7 -12
- package/lib/datetime-field/types.d.ts +3 -3
- package/lib/datetime-field/utils.d.ts +2 -2
- package/lib/datetime-field/utils.js +2 -2
- package/lib/datetime-picker/custom-elements.json +4 -4
- package/lib/datetime-picker/custom-elements.md +4 -4
- package/lib/datetime-picker/index.d.ts +4 -4
- package/lib/datetime-picker/index.js +9 -13
- package/lib/datetime-picker/themes/halo/dark/index.js +2 -1
- package/lib/datetime-picker/themes/halo/light/index.js +2 -1
- package/lib/datetime-picker/themes/solar/charcoal/index.js +2 -1
- package/lib/datetime-picker/themes/solar/pearl/index.js +2 -1
- package/lib/datetime-picker/types.d.ts +1 -1
- package/lib/dialog/custom-elements.json +2 -13
- package/lib/dialog/custom-elements.md +4 -5
- package/lib/dialog/index.d.ts +11 -43
- package/lib/dialog/index.js +21 -80
- package/lib/dialog/themes/halo/dark/index.js +1 -1
- package/lib/dialog/themes/halo/light/index.js +1 -1
- package/lib/dialog/themes/solar/charcoal/index.js +1 -1
- package/lib/dialog/themes/solar/pearl/index.js +1 -1
- package/lib/email-field/custom-elements.json +3 -3
- package/lib/email-field/custom-elements.md +5 -5
- package/lib/email-field/index.d.ts +3 -3
- package/lib/email-field/index.js +5 -4
- package/lib/email-field/themes/halo/dark/index.js +2 -1
- package/lib/email-field/themes/halo/light/index.js +2 -1
- package/lib/email-field/themes/solar/charcoal/index.js +2 -1
- package/lib/email-field/themes/solar/pearl/index.js +2 -1
- package/lib/events.d.ts +13 -13
- package/lib/flag/custom-elements.json +2 -14
- package/lib/flag/custom-elements.md +3 -6
- package/lib/flag/index.d.ts +21 -9
- package/lib/flag/index.js +43 -24
- package/lib/header/themes/halo/dark/index.js +1 -1
- package/lib/header/themes/halo/light/index.js +1 -1
- package/lib/header/themes/solar/charcoal/index.js +1 -1
- package/lib/header/themes/solar/pearl/index.js +1 -1
- package/lib/heatmap/helpers/color.js +2 -1
- package/lib/heatmap/helpers/text.d.ts +1 -1
- package/lib/heatmap/helpers/text.js +1 -1
- package/lib/heatmap/helpers/types.d.ts +7 -7
- package/lib/heatmap/index.js +156 -140
- package/lib/icon/custom-elements.json +0 -13
- package/lib/icon/custom-elements.md +0 -1
- package/lib/icon/index.d.ts +20 -2
- package/lib/icon/index.js +41 -14
- package/lib/icon/themes/halo/dark/index.js +1 -1
- package/lib/icon/themes/halo/light/index.js +1 -1
- package/lib/icon/themes/solar/charcoal/index.js +1 -1
- package/lib/icon/themes/solar/pearl/index.js +1 -1
- package/lib/interactive-chart/custom-elements.json +1 -1
- package/lib/interactive-chart/custom-elements.md +3 -3
- package/lib/interactive-chart/helpers/merge.d.ts +2 -2
- package/lib/interactive-chart/helpers/types.d.ts +7 -7
- package/lib/interactive-chart/index.d.ts +1 -1
- package/lib/interactive-chart/index.js +5 -3
- package/lib/item/custom-elements.json +4 -4
- package/lib/item/custom-elements.md +2 -2
- package/lib/item/helpers/types.d.ts +2 -2
- package/lib/item/index.d.ts +2 -1
- package/lib/item/index.js +2 -1
- package/lib/item/themes/halo/dark/index.js +1 -1
- package/lib/item/themes/halo/light/index.js +1 -1
- package/lib/item/themes/solar/charcoal/index.js +1 -1
- package/lib/item/themes/solar/pearl/index.js +1 -1
- package/lib/label/index.js +9 -34
- package/lib/layout/index.js +0 -13
- package/lib/led-gauge/index.js +7 -7
- package/lib/list/custom-elements.json +1 -1
- package/lib/list/custom-elements.md +3 -3
- package/lib/list/elements/list.d.ts +1 -1
- package/lib/list/elements/list.js +4 -8
- package/lib/list/helpers/renderer.d.ts +0 -4
- package/lib/list/helpers/renderer.js +5 -5
- package/lib/list/helpers/types.d.ts +1 -1
- package/lib/list/themes/halo/dark/index.js +2 -2
- package/lib/list/themes/halo/light/index.js +2 -2
- package/lib/list/themes/solar/charcoal/index.js +2 -2
- package/lib/list/themes/solar/pearl/index.js +2 -2
- package/lib/multi-input/custom-elements.json +5 -5
- package/lib/multi-input/custom-elements.md +5 -5
- package/lib/multi-input/helpers/types.d.ts +3 -3
- package/lib/multi-input/index.d.ts +5 -17
- package/lib/multi-input/index.js +8 -21
- package/lib/multi-input/themes/halo/dark/index.js +1 -1
- package/lib/multi-input/themes/halo/light/index.js +1 -1
- 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.json +2 -2
- package/lib/notification/custom-elements.md +4 -4
- package/lib/notification/elements/notification.d.ts +2 -2
- package/lib/notification/elements/notification.js +2 -2
- package/lib/notification/helpers/types.d.ts +2 -2
- package/lib/number-field/custom-elements.json +2 -2
- package/lib/number-field/custom-elements.md +4 -4
- package/lib/number-field/index.d.ts +4 -4
- package/lib/number-field/index.js +24 -19
- package/lib/number-field/themes/halo/dark/index.js +2 -1
- package/lib/number-field/themes/halo/light/index.js +2 -1
- package/lib/number-field/themes/solar/charcoal/index.js +2 -1
- package/lib/number-field/themes/solar/pearl/index.js +2 -1
- package/lib/overlay/custom-elements.json +6 -9
- package/lib/overlay/custom-elements.md +7 -8
- package/lib/overlay/elements/overlay-backdrop.d.ts +1 -8
- package/lib/overlay/elements/overlay-backdrop.js +3 -13
- package/lib/overlay/elements/overlay-viewport.d.ts +1 -8
- package/lib/overlay/elements/overlay-viewport.js +3 -13
- package/lib/overlay/elements/overlay.d.ts +7 -15
- package/lib/overlay/elements/overlay.js +13 -55
- package/lib/overlay/helpers/types.d.ts +13 -13
- package/lib/overlay/managers/close-manager.d.ts +1 -1
- package/lib/overlay/managers/close-manager.js +6 -4
- package/lib/overlay/managers/focus-manager.js +2 -1
- package/lib/overlay/managers/interaction-lock-manager.js +1 -1
- package/lib/overlay/managers/viewport-manager.js +3 -0
- package/lib/overlay/managers/zindex-manager.d.ts +1 -1
- package/lib/overlay/managers/zindex-manager.js +1 -1
- package/lib/overlay/themes/halo/dark/index.js +1 -1
- package/lib/overlay/themes/halo/light/index.js +1 -1
- package/lib/overlay/themes/solar/charcoal/index.js +1 -1
- package/lib/overlay/themes/solar/pearl/index.js +1 -1
- package/lib/overlay-menu/custom-elements.json +2 -2
- package/lib/overlay-menu/custom-elements.md +2 -2
- package/lib/overlay-menu/helpers/types.d.ts +2 -2
- package/lib/overlay-menu/index.d.ts +2 -2
- package/lib/overlay-menu/index.js +36 -42
- package/lib/overlay-menu/managers/menu-manager.d.ts +0 -1
- package/lib/overlay-menu/managers/menu-manager.js +1 -5
- package/lib/overlay-menu/themes/halo/dark/index.js +1 -1
- package/lib/overlay-menu/themes/halo/light/index.js +1 -1
- package/lib/overlay-menu/themes/solar/charcoal/index.js +1 -1
- package/lib/overlay-menu/themes/solar/pearl/index.js +1 -1
- package/lib/pagination/custom-elements.json +1 -1
- package/lib/pagination/custom-elements.md +3 -3
- package/lib/pagination/index.d.ts +1 -2
- package/lib/pagination/index.js +3 -7
- package/lib/pagination/themes/halo/dark/index.js +1 -1
- package/lib/pagination/themes/halo/light/index.js +1 -1
- package/lib/pagination/themes/solar/charcoal/index.js +1 -1
- package/lib/pagination/themes/solar/pearl/index.js +1 -1
- package/lib/password-field/custom-elements.json +2 -6
- package/lib/password-field/custom-elements.md +4 -5
- package/lib/password-field/index.d.ts +2 -3
- package/lib/password-field/index.js +2 -3
- package/lib/password-field/themes/halo/dark/index.js +2 -1
- package/lib/password-field/themes/halo/light/index.js +2 -1
- package/lib/password-field/themes/solar/charcoal/index.js +2 -1
- package/lib/password-field/themes/solar/pearl/index.js +2 -1
- package/lib/pill/custom-elements.json +1 -1
- package/lib/pill/custom-elements.md +3 -3
- package/lib/pill/index.d.ts +1 -1
- package/lib/pill/index.js +2 -2
- package/lib/pill/themes/halo/dark/index.js +2 -1
- package/lib/pill/themes/halo/light/index.js +2 -1
- package/lib/pill/themes/solar/charcoal/index.js +2 -1
- package/lib/pill/themes/solar/pearl/index.js +2 -1
- package/lib/radio-button/custom-elements.json +1 -1
- package/lib/radio-button/custom-elements.md +3 -3
- package/lib/radio-button/index.d.ts +1 -1
- package/lib/radio-button/index.js +1 -6
- package/lib/radio-button/themes/halo/dark/index.js +1 -1
- package/lib/radio-button/themes/halo/light/index.js +1 -1
- package/lib/radio-button/themes/solar/charcoal/index.js +1 -1
- package/lib/radio-button/themes/solar/pearl/index.js +1 -1
- package/lib/rating/custom-elements.json +1 -1
- package/lib/rating/custom-elements.md +3 -3
- package/lib/rating/index.d.ts +1 -1
- package/lib/rating/index.js +1 -5
- package/lib/search-field/custom-elements.json +3 -3
- package/lib/search-field/custom-elements.md +5 -5
- package/lib/search-field/index.d.ts +3 -3
- package/lib/search-field/index.js +6 -7
- package/lib/search-field/themes/halo/dark/index.js +2 -1
- package/lib/search-field/themes/halo/light/index.js +2 -1
- package/lib/search-field/themes/solar/charcoal/index.js +2 -1
- package/lib/search-field/themes/solar/pearl/index.js +2 -1
- package/lib/select/custom-elements.json +2 -2
- package/lib/select/custom-elements.md +4 -4
- package/lib/select/helpers/types.d.ts +2 -2
- package/lib/select/index.d.ts +2 -2
- package/lib/select/index.js +15 -20
- package/lib/select/themes/halo/dark/index.js +2 -1
- package/lib/select/themes/halo/light/index.js +2 -1
- package/lib/select/themes/solar/charcoal/index.js +2 -1
- package/lib/select/themes/solar/pearl/index.js +2 -1
- package/lib/sidebar-layout/index.js +2 -3
- package/lib/sidebar-layout/themes/halo/dark/index.js +1 -1
- package/lib/sidebar-layout/themes/halo/light/index.js +1 -1
- package/lib/sidebar-layout/themes/solar/charcoal/index.js +1 -1
- package/lib/sidebar-layout/themes/solar/pearl/index.js +1 -1
- package/lib/slider/custom-elements.json +3 -3
- package/lib/slider/custom-elements.md +5 -5
- package/lib/slider/index.d.ts +3 -3
- package/lib/slider/index.js +117 -111
- package/lib/swing-gauge/types.d.ts +1 -1
- package/lib/tab/custom-elements.json +1 -1
- package/lib/tab/custom-elements.md +3 -3
- package/lib/tab/index.d.ts +1 -1
- package/lib/tab/index.js +1 -1
- package/lib/tab/themes/halo/dark/index.js +1 -1
- package/lib/tab/themes/halo/light/index.js +1 -1
- 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.json +1 -1
- package/lib/tab-bar/custom-elements.md +3 -3
- package/lib/tab-bar/index.d.ts +1 -1
- package/lib/tab-bar/index.js +1 -5
- package/lib/tab-bar/themes/halo/dark/index.js +1 -1
- package/lib/tab-bar/themes/halo/light/index.js +1 -1
- package/lib/text-field/custom-elements.json +3 -3
- package/lib/text-field/custom-elements.md +5 -5
- package/lib/text-field/index.d.ts +4 -10
- package/lib/text-field/index.js +11 -26
- package/lib/text-field/themes/halo/dark/index.js +2 -1
- package/lib/text-field/themes/halo/light/index.js +2 -1
- package/lib/text-field/themes/solar/charcoal/index.js +2 -1
- package/lib/text-field/themes/solar/pearl/index.js +2 -1
- package/lib/time-picker/custom-elements.json +1 -1
- package/lib/time-picker/custom-elements.md +3 -3
- package/lib/time-picker/index.d.ts +1 -1
- package/lib/time-picker/index.js +19 -20
- package/lib/time-picker/themes/halo/dark/index.js +2 -1
- package/lib/time-picker/themes/halo/light/index.js +2 -1
- package/lib/time-picker/themes/solar/charcoal/index.js +2 -1
- package/lib/time-picker/themes/solar/pearl/index.js +2 -1
- package/lib/toggle/custom-elements.json +1 -1
- package/lib/toggle/custom-elements.md +3 -3
- package/lib/toggle/index.d.ts +1 -1
- package/lib/toggle/index.js +2 -5
- package/lib/toggle/themes/halo/dark/index.js +1 -1
- package/lib/toggle/themes/halo/light/index.js +1 -1
- package/lib/toggle/themes/solar/charcoal/index.js +1 -1
- package/lib/toggle/themes/solar/pearl/index.js +1 -1
- package/lib/tooltip/elements/tooltip-element.js +1 -1
- package/lib/tooltip/helpers/types.d.ts +10 -10
- package/lib/tooltip/index.js +5 -4
- package/lib/tooltip/managers/tooltip-manager.js +2 -5
- package/lib/tornado-chart/elements/tornado-item.js +8 -9
- package/lib/tornado-chart/themes/halo/dark/index.js +2 -2
- package/lib/tornado-chart/themes/halo/light/index.js +2 -2
- package/lib/tornado-chart/themes/solar/charcoal/index.js +1 -1
- package/lib/tornado-chart/themes/solar/pearl/index.js +1 -1
- package/lib/tree/custom-elements.json +2 -2
- package/lib/tree/custom-elements.md +2 -2
- package/lib/tree/elements/tree.d.ts +2 -2
- package/lib/tree/elements/tree.js +2 -4
- package/lib/tree/helpers/renderer.d.ts +0 -4
- package/lib/tree/helpers/renderer.js +5 -5
- package/lib/tree/helpers/types.d.ts +2 -2
- package/lib/tree/themes/halo/dark/index.js +2 -2
- package/lib/tree/themes/halo/light/index.js +2 -2
- package/lib/tree/themes/solar/charcoal/index.js +2 -2
- package/lib/tree/themes/solar/pearl/index.js +2 -2
- package/lib/tree-select/custom-elements.json +7 -7
- package/lib/tree-select/custom-elements.md +7 -7
- package/lib/tree-select/helpers/types.d.ts +2 -2
- package/lib/tree-select/index.d.ts +5 -6
- package/lib/tree-select/index.js +23 -23
- package/lib/tree-select/themes/halo/dark/index.js +2 -1
- package/lib/tree-select/themes/halo/light/index.js +2 -1
- package/lib/tree-select/themes/solar/charcoal/index.js +2 -1
- package/lib/tree-select/themes/solar/pearl/index.js +2 -1
- package/lib/version.js +1 -1
- package/package.json +32 -30
- package/lib/chart/helpers/legend.d.ts +0 -5
- package/lib/chart/helpers/legend.js +0 -78
package/lib/text-field/index.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { FormFieldElement, css, html } from '@refinitiv-ui/core';
|
|
2
|
+
import { FormFieldElement, css, nothing, html } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
4
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
|
-
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
6
5
|
import { isElementOverflown } from '@refinitiv-ui/utils/element.js';
|
|
7
6
|
import { VERSION } from '../version.js';
|
|
8
|
-
import { isIE } from '@refinitiv-ui/utils/browser.js';
|
|
9
7
|
import '../icon/index.js';
|
|
10
8
|
import { registerOverflowTooltip } from '../tooltip/index.js';
|
|
11
9
|
const hasChanged = (newVal, oldVal) => oldVal === undefined ? false : newVal !== oldVal;
|
|
12
10
|
/**
|
|
13
11
|
* Form control element for text.
|
|
14
12
|
*
|
|
15
|
-
* @fires value-changed -
|
|
16
|
-
* @fires error-changed -
|
|
17
|
-
* @fires icon-click -
|
|
13
|
+
* @fires value-changed - Fired when the user commits a value change. The event is not triggered if `value` property is changed programmatically.
|
|
14
|
+
* @fires error-changed - Fired when the user inputs an invalid value. The event is not triggered if `error` property is changed programmatically.
|
|
15
|
+
* @fires icon-click - Fired when the user taps on icon added into control's slot.
|
|
18
16
|
*
|
|
19
17
|
* @attr {boolean} disabled - Set disabled state
|
|
20
18
|
* @prop {boolean} [disabled=false] - Set disabled state
|
|
@@ -78,7 +76,6 @@ let TextField = class TextField extends FormFieldElement {
|
|
|
78
76
|
:host {
|
|
79
77
|
display: inline-block;
|
|
80
78
|
}
|
|
81
|
-
|
|
82
79
|
:host(:focus), :host input:focus {
|
|
83
80
|
outline: none;
|
|
84
81
|
}
|
|
@@ -148,13 +145,14 @@ let TextField = class TextField extends FormFieldElement {
|
|
|
148
145
|
* @param changedProperties Properties that has changed
|
|
149
146
|
* @returns True if input should be re-validated
|
|
150
147
|
*/
|
|
151
|
-
/*
|
|
148
|
+
/* c8 ignore start */
|
|
152
149
|
shouldValidateInput(changedProperties) {
|
|
153
150
|
// TODO: This validation should be refactored
|
|
154
151
|
return (changedProperties.has('pattern') || !!(this.pattern && changedProperties.has('value')))
|
|
155
152
|
|| (changedProperties.has('minLength') || !!(this.minLength && changedProperties.has('value')))
|
|
156
153
|
|| (changedProperties.has('maxLength') || !!(this.maxLength && changedProperties.has('value')));
|
|
157
154
|
}
|
|
155
|
+
/* c8 ignore stop */
|
|
158
156
|
/**
|
|
159
157
|
* Runs on input element `input` event
|
|
160
158
|
* @param event `input` event
|
|
@@ -181,26 +179,13 @@ let TextField = class TextField extends FormFieldElement {
|
|
|
181
179
|
this.setValueAndNotify(value);
|
|
182
180
|
}
|
|
183
181
|
/**
|
|
184
|
-
*
|
|
185
|
-
* change state of `error` property according pattern validation
|
|
182
|
+
* Uses native `checkValidity()` function to validate input
|
|
186
183
|
* @returns {void}
|
|
187
184
|
*/
|
|
188
185
|
validateInput() {
|
|
189
|
-
|
|
190
|
-
/* istanbul ignore next */
|
|
191
|
-
if (this.shouldValidateForMinLength(error)) {
|
|
192
|
-
error = !!this.minLength && (this.minLength > this.value.length);
|
|
193
|
-
}
|
|
186
|
+
const error = !this.inputElement?.checkValidity();
|
|
194
187
|
this.notifyErrorChange(error);
|
|
195
188
|
}
|
|
196
|
-
/**
|
|
197
|
-
* @param error existing state of error
|
|
198
|
-
* @returns true if there is no error and browser is IE11 and minLength more than 0 and value exists
|
|
199
|
-
*/
|
|
200
|
-
/* istanbul ignore next */
|
|
201
|
-
shouldValidateForMinLength(error) {
|
|
202
|
-
return !!(!error && isIE && this.minLength && !!this.value);
|
|
203
|
-
}
|
|
204
189
|
/**
|
|
205
190
|
* Fires event on `icon` click
|
|
206
191
|
* @returns {void}
|
|
@@ -236,14 +221,14 @@ let TextField = class TextField extends FormFieldElement {
|
|
|
236
221
|
renderIcon() {
|
|
237
222
|
return this.icon ? html `
|
|
238
223
|
<ef-icon
|
|
239
|
-
role="${
|
|
224
|
+
role="${this.iconHasAction ? 'button' : nothing}"
|
|
225
|
+
tabindex="${this.iconHasAction ? '0' : nothing}"
|
|
226
|
+
aria-label="${this.iconHasAction ? this.icon : nothing}"
|
|
240
227
|
part="icon"
|
|
241
228
|
icon="${this.icon}"
|
|
242
|
-
aria-label="${ifDefined(this.iconHasAction ? this.icon : undefined)}"
|
|
243
229
|
?readonly="${this.readonly}"
|
|
244
230
|
?disabled="${this.disabled}"
|
|
245
231
|
@tap="${this.iconClick}"
|
|
246
|
-
tabindex="${ifDefined(this.iconHasAction ? '0' : undefined)}"
|
|
247
232
|
></ef-icon>
|
|
248
233
|
` : null;
|
|
249
234
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/halo/dark';
|
|
2
|
+
import '@refinitiv-ui/elements/tooltip/themes/halo/dark';
|
|
2
3
|
|
|
3
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-text-field', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-text-field', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:12px;font-weight:400;height:24px;width:152px;max-width:100%;padding:0 8px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;border-radius:0;background-color:#0d0d0d;text-overflow:ellipsis;border:1px solid #404040;color:#ccc}:host([disabled]){border:1px solid rgba(64,64,64,.5);color:rgba(204,204,204,.5);background-color:rgba(13,13,13,.5)}:host([type=number]){padding-right:0}:host([warning]){border:1px solid #ffc800}:host([warning][disabled]){color:rgba(204,204,204,.5);border:1px solid rgba(127,100,0,.5)}:host([error]),:host([error][warning]){border:1px solid #f5475b}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(204,204,204,.5);border:1px solid rgba(160,28,43,.5)}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#334bff}: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:#ccc;min-width:1em;margin-left:2px}:host([disabled]) [part=input]{-webkit-user-select:none;-moz-user-select:none;user-select:none}:host ::-moz-selection{color:#fff;background-color:#334bff}:host ::selection{color:#fff;background-color:#334bff}:host(:not([readonly]):not([error]):not([warning]):not([focused]):hover){border-color:grey;color:#fff}:host(:not([readonly]):not([error]):not([warning]):not([focused]):hover) [part=icon]{color:#6678ff}:host([warning]:hover:not([readonly]):not([focused])){color:#fff;border-color:#ffe999}:host([warning][disabled]),:host([warning][readonly]:not([focused])){border-color:rgba(255,233,153,.5)}:host([error]:hover:not([readonly]):not([focused])){color:#fff;border-color:#faa8b1}:host([error][disabled]),:host([error][readonly]:not([focused])),:host([error][warning][disabled]){border-color:rgba(250,168,177,.5)}:host([readonly]:not([focused])){border-color:rgba(64,64,64,.5);background-color:rgba(13,13,13,.5)}:host([readonly]:not([focused])) [part=icon]{color:rgba(204,204,204,.5)}:host([focused]),:host([focused][error][warning]){border-color:#334bff;color:#fff}:host([focused]) [part=icon],:host([focused][error][warning]) [part=icon]{color:#6678ff}' }}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/halo/light';
|
|
2
|
+
import '@refinitiv-ui/elements/tooltip/themes/halo/light';
|
|
2
3
|
|
|
3
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-text-field', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-text-field', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:12px;font-weight:400;height:24px;width:152px;max-width:100%;padding:0 8px;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;border-radius:0;background-color:#fff;text-overflow:ellipsis;border:1px solid #595959;color:#404040}:host([disabled]){border:1px solid rgba(89,89,89,.5);color:rgba(64,64,64,.5);background-color:rgba(255,255,255,.5)}:host([type=number]){padding-right:0}:host([warning]){border:1px solid #cca000}:host([warning][disabled]){color:rgba(64,64,64,.5);border:1px solid rgba(204,160,0,.5)}:host([error]),:host([error][warning]){border:1px solid #d94255}:host([error][disabled]),:host([error][warning][disabled]){color:rgba(64,64,64,.5);border:1px solid rgba(182,50,67,.5)}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#334bff}: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:#404040;min-width:1em;margin-left:2px}:host([disabled]) [part=input]{-webkit-user-select:none;-moz-user-select:none;user-select:none}:host ::-moz-selection{color:#fff;background-color:#334bff}:host ::selection{color:#fff;background-color:#334bff}:host(:not([readonly]):not([error]):not([warning]):not([focused]):hover){border-color:#0d0d0d;color:#0d0d0d}:host(:not([readonly]):not([error]):not([warning]):not([focused]):hover) [part=icon]{color:#334bff}:host([warning]:hover:not([readonly]):not([focused])){color:#0d0d0d;border-color:#ffe999}:host([warning][disabled]),:host([warning][readonly]:not([focused])){border-color:rgba(255,233,153,.5)}:host([error]:hover:not([readonly]):not([focused])){color:#0d0d0d;border-color:#eeacb4}:host([error][disabled]),:host([error][readonly]:not([focused])),:host([error][warning][disabled]){border-color:rgba(238,172,180,.5)}:host([readonly]:not([focused])){border-color:rgba(89,89,89,.5);background-color:rgba(255,255,255,.5)}:host([readonly]:not([focused])) [part=icon]{color:rgba(64,64,64,.5)}:host([focused]),:host([focused][error][warning]){border-color:#334bff;color:#0d0d0d}:host([focused]) [part=icon],:host([focused][error][warning]) [part=icon]{color:#334bff}' }}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/solar/charcoal';
|
|
2
|
+
import '@refinitiv-ui/elements/tooltip/themes/solar/charcoal';
|
|
2
3
|
|
|
3
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-text-field', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-text-field', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13px;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 [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;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]::-moz-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]::placeholder{color:rgba(102,101,112,.6)}' }}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/solar/pearl';
|
|
2
|
+
import '@refinitiv-ui/elements/tooltip/themes/solar/pearl';
|
|
2
3
|
|
|
3
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-text-field', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-text-field', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13px;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 [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;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]::-moz-placeholder{color:rgba(102,101,112,.6)}:host([disabled]) [part=input]::placeholder{color:rgba(102,101,112,.6)}' }}));
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"events": [
|
|
108
108
|
{
|
|
109
109
|
"name": "value-changed",
|
|
110
|
-
"description": "
|
|
110
|
+
"description": "Fired when the user commits a value change. The event is not triggered if `value` property is changed programmatically."
|
|
111
111
|
}
|
|
112
112
|
],
|
|
113
113
|
"methods": [
|
|
@@ -23,6 +23,6 @@ Control the time input
|
|
|
23
23
|
|
|
24
24
|
## Events
|
|
25
25
|
|
|
26
|
-
| Event | Description
|
|
27
|
-
|
|
28
|
-
| `value-changed` |
|
|
26
|
+
| Event | Description |
|
|
27
|
+
|-----------------|--------------------------------------------------|
|
|
28
|
+
| `value-changed` | Fired when the user commits a value change. The event is not triggered if `value` property is changed programmatically. |
|
|
@@ -10,7 +10,7 @@ declare enum Segment {
|
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Control the time input
|
|
13
|
-
* @event value-changed -
|
|
13
|
+
* @event value-changed - Fired when the user commits a value change. The event is not triggered if `value` property is changed programmatically.
|
|
14
14
|
*
|
|
15
15
|
* @attr {boolean} readonly - Set readonly state
|
|
16
16
|
* @prop {boolean} [readonly=false] - Set readonly state
|
package/lib/time-picker/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
var TimePicker_1;
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
|
-
import { ControlElement, html, css } from '@refinitiv-ui/core';
|
|
4
|
-
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
3
|
+
import { ControlElement, html, css, nothing } from '@refinitiv-ui/core';
|
|
5
4
|
import { guard } from '@refinitiv-ui/core/directives/guard.js';
|
|
6
5
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
7
6
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
@@ -9,7 +8,6 @@ import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
|
9
8
|
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
10
9
|
import { VERSION } from '../version.js';
|
|
11
10
|
import { isValidTime, toTimeSegment, TimeFormat, getFormat, format, isAM, isPM, MILLISECONDS_IN_SECOND, MILLISECONDS_IN_MINUTE, MILLISECONDS_IN_HOUR, addOffset, padNumber, parse } from '@refinitiv-ui/utils/date.js';
|
|
12
|
-
import { isIE } from '@refinitiv-ui/utils/browser.js';
|
|
13
11
|
import '../number-field/index.js';
|
|
14
12
|
import { translate } from '@refinitiv-ui/translate';
|
|
15
13
|
import '@refinitiv-ui/phrasebook/locale/en/time-picker.js';
|
|
@@ -32,7 +30,7 @@ const Placeholder = {
|
|
|
32
30
|
};
|
|
33
31
|
/**
|
|
34
32
|
* Control the time input
|
|
35
|
-
* @event value-changed -
|
|
33
|
+
* @event value-changed - Fired when the user commits a value change. The event is not triggered if `value` property is changed programmatically.
|
|
36
34
|
*
|
|
37
35
|
* @attr {boolean} readonly - Set readonly state
|
|
38
36
|
* @prop {boolean} [readonly=false] - Set readonly state
|
|
@@ -294,10 +292,11 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
294
292
|
*/
|
|
295
293
|
updated(changedProperties) {
|
|
296
294
|
super.updated(changedProperties);
|
|
297
|
-
/*
|
|
295
|
+
/* c8 ignore start */
|
|
298
296
|
if (TimePicker_1.hasTimeChanged(changedProperties) && this.isMobile) {
|
|
299
297
|
this.updateMobileTimePickerValue();
|
|
300
298
|
}
|
|
299
|
+
/* c8 ignore stop */
|
|
301
300
|
if (this.selectedSegment && changedProperties.has('selectedSegment')) {
|
|
302
301
|
void this.selectSegment();
|
|
303
302
|
}
|
|
@@ -398,20 +397,22 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
398
397
|
* @param event Event Object
|
|
399
398
|
* @returns {void}
|
|
400
399
|
*/
|
|
401
|
-
/*
|
|
400
|
+
/* c8 ignore start */
|
|
402
401
|
onMobileTimeChange(event) {
|
|
403
402
|
this.value = event.target.value;
|
|
404
403
|
}
|
|
404
|
+
/* c8 ignore stop */
|
|
405
405
|
/**
|
|
406
406
|
* Helper, used to update the mobile time picker value
|
|
407
407
|
* @returns {void}
|
|
408
408
|
*/
|
|
409
|
-
/*
|
|
409
|
+
/* c8 ignore start */
|
|
410
410
|
updateMobileTimePickerValue() {
|
|
411
411
|
if (this.mtpInput) {
|
|
412
412
|
this.mtpInput.value = this.value;
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
|
+
/* c8 ignore stop */
|
|
415
416
|
/**
|
|
416
417
|
* Handles action when input focused change
|
|
417
418
|
* @param event Focus change event
|
|
@@ -431,10 +432,11 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
431
432
|
segment = Segment.SECONDS;
|
|
432
433
|
}
|
|
433
434
|
this.selectedSegment = focused && segment ? segment : null;
|
|
434
|
-
/*
|
|
435
|
+
/* c8 ignore start */
|
|
435
436
|
if (!segment || this.readonly) {
|
|
436
437
|
return;
|
|
437
438
|
}
|
|
439
|
+
/* c8 ignore stop */
|
|
438
440
|
const value = target.value;
|
|
439
441
|
if (value) {
|
|
440
442
|
this.updateTimeSegmentTo(segment, Number(value));
|
|
@@ -503,16 +505,13 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
503
505
|
return;
|
|
504
506
|
}
|
|
505
507
|
switch (event.key) {
|
|
506
|
-
case 'Up': // IE
|
|
507
508
|
case 'ArrowUp':
|
|
508
509
|
this.handleUpKey(event);
|
|
509
510
|
break;
|
|
510
|
-
case 'Down': // IE
|
|
511
511
|
case 'ArrowDown':
|
|
512
512
|
this.handleDownKey(event);
|
|
513
513
|
break;
|
|
514
514
|
case 'Enter':
|
|
515
|
-
case 'Spacebar':
|
|
516
515
|
case ' ':
|
|
517
516
|
this.handleEnterKey(event);
|
|
518
517
|
break;
|
|
@@ -684,7 +683,7 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
684
683
|
flex-flow: row nowrap;
|
|
685
684
|
align-items: center;
|
|
686
685
|
justify-content: center;
|
|
687
|
-
user-select:none;
|
|
686
|
+
user-select: none;
|
|
688
687
|
position: relative;
|
|
689
688
|
}
|
|
690
689
|
input {
|
|
@@ -706,13 +705,13 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
706
705
|
return html `<ef-number-field
|
|
707
706
|
id="hours"
|
|
708
707
|
part="input"
|
|
709
|
-
aria-label="${
|
|
708
|
+
aria-label="${this.t('SELECT_HOURS', { value: this.periodHours })}"
|
|
710
709
|
no-spinner
|
|
711
710
|
transparent
|
|
712
711
|
min="${this.amPm ? 1 : MIN_UNIT}"
|
|
713
712
|
max="${this.amPm ? HOURS_OF_NOON : MAX_HOURS}"
|
|
714
713
|
.value="${hours}"
|
|
715
|
-
placeholder="${
|
|
714
|
+
placeholder="${hours ? nothing : Placeholder.HOURS}"
|
|
716
715
|
?disabled="${this.disabled}"
|
|
717
716
|
?readonly="${this.readonly}"
|
|
718
717
|
@value-changed="${this.onInputValueChanged}"
|
|
@@ -726,13 +725,13 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
726
725
|
const minutes = this.formattedMinutes;
|
|
727
726
|
return html `<ef-number-field
|
|
728
727
|
id="minutes"
|
|
729
|
-
aria-label="${
|
|
728
|
+
aria-label="${this.t('SELECT_MINUTES', { value: this.minutes })}"
|
|
730
729
|
part="input"
|
|
731
730
|
no-spinner
|
|
732
731
|
min="${MIN_UNIT}"
|
|
733
732
|
max="${MAX_MINUTES}"
|
|
734
733
|
.value="${minutes}"
|
|
735
|
-
placeholder="${
|
|
734
|
+
placeholder="${minutes ? nothing : Placeholder.MINUTES}"
|
|
736
735
|
?readonly="${this.readonly}"
|
|
737
736
|
?disabled="${this.disabled}"
|
|
738
737
|
transparent
|
|
@@ -749,12 +748,12 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
749
748
|
<ef-number-field
|
|
750
749
|
id="seconds"
|
|
751
750
|
part="input"
|
|
752
|
-
aria-label="${
|
|
751
|
+
aria-label="${this.t('SELECT_SECONDS', { value: this.seconds })}"
|
|
753
752
|
no-spinner
|
|
754
753
|
min="${MIN_UNIT}"
|
|
755
754
|
max="${MAX_SECONDS}"
|
|
756
755
|
.value="${seconds}"
|
|
757
|
-
placeholder="${
|
|
756
|
+
placeholder="${seconds ? nothing : Placeholder.SECONDS}"
|
|
758
757
|
?readonly="${this.readonly}"
|
|
759
758
|
?disabled="${this.disabled}"
|
|
760
759
|
transparent
|
|
@@ -770,7 +769,7 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
770
769
|
return this.amPm ? html `
|
|
771
770
|
<div role="listbox"
|
|
772
771
|
aria-label="${this.t('TOGGLE_TIME_PERIOD')}"
|
|
773
|
-
aria-activedescendant="${
|
|
772
|
+
aria-activedescendant="${hasHours ? this.isAM() ? 'toggle-am' : 'toggle-pm' : nothing}"
|
|
774
773
|
id="toggle"
|
|
775
774
|
part="toggle"
|
|
776
775
|
@tap=${this.toggle}
|
|
@@ -802,7 +801,7 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
802
801
|
* @returns template result
|
|
803
802
|
*/
|
|
804
803
|
get selectionTemplate() {
|
|
805
|
-
if (
|
|
804
|
+
if (!this.announceValues) {
|
|
806
805
|
return;
|
|
807
806
|
}
|
|
808
807
|
const value = this.value;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/number-field/themes/halo/dark';
|
|
2
2
|
import '@refinitiv-ui/elements/icon/themes/halo/dark';
|
|
3
|
+
import '@refinitiv-ui/elements/tooltip/themes/halo/dark';
|
|
3
4
|
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-time-picker', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:
|
|
5
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-time-picker', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:12px;font-weight:400;height:24px;max-width:100%;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#ccc;border-radius:0;background-color:#0d0d0d;text-overflow:ellipsis;border:1px solid #404040;width:auto;min-width:-moz-max-content;min-width:max-content;padding:0}:host([disabled]){color:rgba(204,204,204,.5);border:1px solid rgba(64,64,64,.5)}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#334bff}:host [part=input]{margin:0;text-align:center;padding:0;color:inherit;width:24px}:host [part=divider]::before{content:\':\'}:host [part=toggle]{width:20px;font-size:50%;display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;line-height:1.2;outline:0;cursor:pointer;touch-action:manipulation}: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-left:8px solid transparent;position:absolute;left:calc(50% - 8px);bottom:0;border-bottom:4px solid transparent;display:none}:host [part=toggle-item]{opacity:.5}:host [part=toggle-item][active]{opacity:1}:host [part=divider]{width:2px}' }}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/number-field/themes/halo/light';
|
|
2
2
|
import '@refinitiv-ui/elements/icon/themes/halo/light';
|
|
3
|
+
import '@refinitiv-ui/elements/tooltip/themes/halo/light';
|
|
3
4
|
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-time-picker', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:
|
|
5
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-time-picker', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:12px;font-weight:400;height:24px;max-width:100%;margin:1px 0;outline:0;box-sizing:border-box;display:inline-flex;align-items:center;position:relative;vertical-align:middle;color:#404040;border-radius:0;background-color:#fff;text-overflow:ellipsis;border:1px solid #595959;width:auto;min-width:-moz-max-content;min-width:max-content;padding:0}:host([disabled]){color:rgba(64,64,64,.5);border:1px solid rgba(89,89,89,.5)}:host([focused]){background-size:100% 2px,100% 1px!important;background-position:center bottom!important;border-color:#334bff}:host [part=input]{margin:0;text-align:center;padding:0;color:inherit;width:24px}:host [part=divider]::before{content:\':\'}:host [part=toggle]{width:20px;font-size:50%;display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;line-height:1.2;outline:0;cursor:pointer;touch-action:manipulation}: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-left:8px solid transparent;position:absolute;left:calc(50% - 8px);bottom:0;border-bottom:4px solid transparent;display:none}:host [part=toggle-item]{opacity:.5}:host [part=toggle-item][active]{opacity:1}:host [part=divider]{width:2px}' }}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/number-field/themes/solar/charcoal';
|
|
2
2
|
import '@refinitiv-ui/elements/icon/themes/solar/charcoal';
|
|
3
|
+
import '@refinitiv-ui/elements/tooltip/themes/solar/charcoal';
|
|
3
4
|
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-time-picker', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:
|
|
5
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-time-picker', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13px;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:-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,5 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/number-field/themes/solar/pearl';
|
|
2
2
|
import '@refinitiv-ui/elements/icon/themes/solar/pearl';
|
|
3
|
+
import '@refinitiv-ui/elements/tooltip/themes/solar/pearl';
|
|
3
4
|
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-time-picker', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:
|
|
5
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-time-picker', styles: ':host{display:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;font-family:inherit;font-size:13px;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:-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}' }}));
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"events": [
|
|
77
77
|
{
|
|
78
78
|
"name": "checked-changed",
|
|
79
|
-
"description": "Fired when the `checked` property
|
|
79
|
+
"description": "Fired when user interacts with the control to check or uncheck. The event is not triggered if `checked` property is changed programmatically."
|
|
80
80
|
}
|
|
81
81
|
]
|
|
82
82
|
}
|
|
@@ -14,6 +14,6 @@ Form control that can toggle between 2 states
|
|
|
14
14
|
|
|
15
15
|
## Events
|
|
16
16
|
|
|
17
|
-
| Event | Description
|
|
18
|
-
|
|
19
|
-
| `checked-changed` | Fired when the `checked` property
|
|
17
|
+
| Event | Description |
|
|
18
|
+
|-------------------|--------------------------------------------------|
|
|
19
|
+
| `checked-changed` | Fired when user interacts with the control to check or uncheck. The event is not triggered if `checked` property is changed programmatically. |
|
package/lib/toggle/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { ControlElement, TemplateResult, CSSResultGroup, PropertyValues } from '
|
|
|
9
9
|
* @attr {boolean} disabled - Set disabled state
|
|
10
10
|
* @prop {boolean} [disabled=false] - Set disabled state
|
|
11
11
|
*
|
|
12
|
-
* @fires checked-changed - Fired when the `checked` property
|
|
12
|
+
* @fires checked-changed - Fired when user interacts with the control to check or uncheck. The event is not triggered if `checked` property is changed programmatically.
|
|
13
13
|
*/
|
|
14
14
|
export declare class Toggle extends ControlElement {
|
|
15
15
|
/**
|
package/lib/toggle/index.js
CHANGED
|
@@ -22,7 +22,7 @@ const emptyStringToNull = function (value) {
|
|
|
22
22
|
* @attr {boolean} disabled - Set disabled state
|
|
23
23
|
* @prop {boolean} [disabled=false] - Set disabled state
|
|
24
24
|
*
|
|
25
|
-
* @fires checked-changed - Fired when the `checked` property
|
|
25
|
+
* @fires checked-changed - Fired when user interacts with the control to check or uncheck. The event is not triggered if `checked` property is changed programmatically.
|
|
26
26
|
*/
|
|
27
27
|
let Toggle = class Toggle extends ControlElement {
|
|
28
28
|
constructor() {
|
|
@@ -100,10 +100,7 @@ let Toggle = class Toggle extends ControlElement {
|
|
|
100
100
|
* @returns {void}
|
|
101
101
|
*/
|
|
102
102
|
handleKeyDown(event) {
|
|
103
|
-
if (event.key === 'Enter' || event.key === ' '
|
|
104
|
-
this.handleCheckedChange();
|
|
105
|
-
}
|
|
106
|
-
else if (event.keyCode && event.keyCode === 13 || event.keyCode === 32) { // For older browsers
|
|
103
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
107
104
|
this.handleCheckedChange();
|
|
108
105
|
}
|
|
109
106
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-toggle', styles: ':host{touch-action:manipulation;font-size:
|
|
2
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-toggle', styles: ':host{touch-action:manipulation;font-size:12px;background-color:#0d0d0d;text-align:center;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;outline:0;border-radius:0;box-shadow:inset 0 0 0 rgba(0,0,0,.5);transition:box-shadow .1s,border-color .1s;width:44px;height:24px;font-weight:400;color:#ccc;line-height:18px;text-transform:uppercase}:host [part=toggle]{cursor:pointer;display:block;position:relative;width:100%;height:100%;box-sizing:border-box;border:1px solid #4d4d4d;border-radius:inherit;text-overflow:inherit;overflow:inherit;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host [part=toggle]::after{content:\'\';position:absolute;box-sizing:border-box;border-radius:inherit;top:1px;left:1px;width:calc(50% - 1px);height:calc(100% - (1px * 2));background-color:#ccc}:host([checked-label]),:host([label]){min-width:52px;width:54px;min-width:44px}:host([readonly]) [part=toggle]{cursor:default}:host([disabled]) [part=toggle]{opacity:.5}:host([checked]) [part=toggle]::after{left:auto;border-color:#334bff;background-color:#334bff;right:1px}:host([checked-label][checked]) [part=toggle],:host([label][checked]) [part=toggle]{padding-right:24px;padding-left:3px}:host([checked-label]) [part=toggle],:host([label]) [part=toggle]{padding:3px 3px 3px 24px}:host([checked-label]) [part=toggle]::after,:host([label]) [part=toggle]::after{width:20px}@media (pointer:fine){:host(:hover:not([readonly])),:host([focused=visible]){box-shadow:0 0 0 #334bff}:host(:hover:not([readonly])) [part=toggle],:host([focused=visible]) [part=toggle]{border-color:#334bff}:host(:hover:not([readonly])){color:#fff}:host(:hover:not([readonly])) [part=toggle]{border-color:#1429bd}:host(:hover:not([readonly])) [part=toggle]::after{background-color:#1429bd;border-color:#1429bd}}:host([checked]){color:#fff}:host([disabled]) [part=toggle]::after{opacity:.2}:host [part=toggle]::after,:host([checked]) [part=toggle]::after{border:1px solid #0d0d0d}' }}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-toggle', styles: ':host{touch-action:manipulation;font-size:
|
|
2
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-toggle', styles: ':host{touch-action:manipulation;font-size:12px;background-color:#fff;text-align:center;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;outline:0;border-radius:0;box-shadow:inset 0 0 0 rgba(0,0,0,.25);transition:box-shadow .1s,border-color .1s;width:44px;height:24px;font-weight:600;color:#0d0d0d;line-height:18px;text-transform:uppercase}:host [part=toggle]{cursor:pointer;display:block;position:relative;width:100%;height:100%;box-sizing:border-box;border:1px solid #ccc;border-radius:inherit;text-overflow:inherit;overflow:inherit;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host [part=toggle]::after{content:\'\';position:absolute;box-sizing:border-box;border-radius:inherit;top:1px;left:1px;width:calc(50% - 1px);height:calc(100% - (1px * 2));background-color:#0d0d0d}:host([checked-label]),:host([label]){min-width:52px;width:54px;min-width:44px}:host([readonly]) [part=toggle]{cursor:default}:host([disabled]) [part=toggle]{opacity:.5}:host([checked]) [part=toggle]::after{left:auto;border-color:#334bff;background-color:#334bff;right:1px}:host([checked-label][checked]) [part=toggle],:host([label][checked]) [part=toggle]{padding-right:24px;padding-left:3px}:host([checked-label]) [part=toggle],:host([label]) [part=toggle]{padding:3px 3px 3px 24px}:host([checked-label]) [part=toggle]::after,:host([label]) [part=toggle]::after{width:20px}@media (pointer:fine){:host(:hover:not([readonly])),:host([focused=visible]){box-shadow:0 0 0 #334bff}:host(:hover:not([readonly])) [part=toggle],:host([focused=visible]) [part=toggle]{border-color:#334bff}:host(:hover:not([readonly])){color:#0d0d0d}:host(:hover:not([readonly])) [part=toggle]{border-color:#1429bd}:host(:hover:not([readonly])) [part=toggle]::after{background-color:#1429bd;border-color:#1429bd}}' }}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-toggle', styles: ':host{touch-action:manipulation;font-size:
|
|
2
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-toggle', styles: ':host{touch-action:manipulation;font-size:13px;text-align:center;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;outline:0;border-radius:0;box-shadow:inset 0 0 0 rgba(0,0,0,.6);transition:box-shadow .2s,border-color .2s;width:44px;height:24px;color:#e2e2e2;background-color:#000;line-height:18px}:host [part=toggle]{cursor:pointer;display:block;position:relative;width:100%;height:100%;box-sizing:border-box;border:1px solid #4a4a52;border-radius:inherit;text-overflow:inherit;overflow:inherit;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host [part=toggle]::after{content:\'\';position:absolute;top:1px;left:1px;width:calc(50% - 1px);height:calc(100% - (1px * 2));background-color:#555d6c;box-sizing:border-box;border-radius:inherit}:host([checked-label]),:host([label]){width:67.6px;min-width:52px;min-width:44px}:host([readonly]) [part=toggle]{cursor:default}:host([disabled]) [part=toggle]{opacity:.5}:host([checked]) [part=toggle]::after{right:1px;left:auto;border-color:#f93;background-color:#f93}@media (pointer:fine){:host(:hover:not([readonly])),:host([focused=visible]){box-shadow:0 0 0 #f93}:host(:hover:not([readonly])) [part=toggle],:host([focused=visible]) [part=toggle]{border-color:#f93}}:host [part=toggle] ::after{top:1px;left:1px;width:calc(50% - 1px);height:calc(100% - (1px * 2));background-image:linear-gradient(rgba(255,255,255,.1) 10%,rgba(255,255,255,0) 100%)}:host([checked-label][checked]) [part=toggle],:host([label][checked]) [part=toggle]{padding-right:24px;padding-left:3px}:host([checked-label]) [part=toggle],:host([label]) [part=toggle]{padding:3px 3px 3px 24px}:host([checked-label]) [part=toggle]::after,:host([label]) [part=toggle]::after{width:20px}:host([checked]) [part=toggle] ::after{right:1px}:host(:hover:not([readonly])) [part=toggle],:host([focused=visible]) [part=toggle]{border-style:dotted}' }}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-toggle', styles: ':host{touch-action:manipulation;font-size:
|
|
2
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-toggle', styles: ':host{touch-action:manipulation;font-size:13px;text-align:center;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;outline:0;border-radius:0;box-shadow:inset 0 0 0 rgba(0,0,0,.3);transition:box-shadow .2s,border-color .2s;width:44px;height:24px;color:#484848;background-color:#fff;line-height:18px}:host [part=toggle]{cursor:pointer;display:block;position:relative;width:100%;height:100%;box-sizing:border-box;border:1px solid #a9afba;border-radius:inherit;text-overflow:inherit;overflow:inherit;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host [part=toggle]::after{content:\'\';position:absolute;top:1px;left:1px;width:calc(50% - 1px);height:calc(100% - (1px * 2));background-color:#d4d7dd;box-sizing:border-box;border-radius:inherit}:host([checked-label]),:host([label]){width:67.6px;min-width:52px;min-width:44px}:host([readonly]) [part=toggle]{cursor:default}:host([disabled]) [part=toggle]{opacity:.5}:host([checked]) [part=toggle]::after{right:1px;left:auto;border-color:#f93;background-color:#f93}@media (pointer:fine){:host(:hover:not([readonly])),:host([focused=visible]){box-shadow:0 0 0 #ffb266}:host(:hover:not([readonly])) [part=toggle],:host([focused=visible]) [part=toggle]{border-color:#ffb266}}:host [part=toggle] ::after{top:1px;left:1px;width:calc(50% - 1px);height:calc(100% - (1px * 2));background-image:linear-gradient(rgba(0,0,0,0) 0,rgba(0,0,0,.1) 100%)}:host([checked-label][checked]) [part=toggle],:host([label][checked]) [part=toggle]{padding-right:24px;padding-left:3px}:host([checked-label]) [part=toggle],:host([label]) [part=toggle]{padding:3px 3px 3px 24px}:host([checked-label]) [part=toggle]::after,:host([label]) [part=toggle]::after{width:20px}:host([checked]) [part=toggle] ::after{right:1px}:host(:hover:not([readonly])) [part=toggle],:host([focused=visible]) [part=toggle]{border-style:dotted}' }}));
|
|
@@ -48,7 +48,7 @@ if (document.body) {
|
|
|
48
48
|
appendTitleTooltip();
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
|
-
/*
|
|
51
|
+
/* c8 ignore next */
|
|
52
52
|
document.addEventListener('DOMContentLoaded', appendTitleTooltip, { once: true });
|
|
53
53
|
}
|
|
54
54
|
export { tooltipElement, addTooltipCondition, removeTooltipCondition };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { OverlayPosition } from '../../overlay';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
2
|
+
export type TooltipCondition = (target: HTMLElement, paths: EventTarget[]) => boolean;
|
|
3
|
+
export type TooltipRenderer = (target: HTMLElement) => undefined | null | string | HTMLElement | DocumentFragment;
|
|
4
|
+
export type TooltipPosition = 'auto' | 'above' | 'right' | 'below' | 'left';
|
|
5
|
+
export type TooltipPositionMap = {
|
|
6
6
|
[K in TooltipPosition]: OverlayPosition[];
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export
|
|
8
|
+
type MouseMoveCallback = (event: MouseEvent, paths: EventTarget[]) => void;
|
|
9
|
+
type MouseCallback = (event: MouseEvent) => void;
|
|
10
|
+
type WheelCallback = (event: WheelEvent) => void;
|
|
11
|
+
type FocusCallback = (event: FocusEvent) => void;
|
|
12
|
+
type KeyboardCallback = (event: KeyboardEvent) => void;
|
|
13
|
+
export type DocumentCallbacks = {
|
|
14
14
|
mousemove: MouseMoveCallback;
|
|
15
15
|
mousemoveThrottled: MouseMoveCallback;
|
|
16
16
|
click: MouseCallback;
|