@refinitiv-ui/elements 6.0.0-next.3 → 6.0.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 +51 -0
- package/README.md +3 -15
- package/lib/accordion/index.js +2 -2
- package/lib/autosuggest/custom-elements.json +5 -15
- package/lib/autosuggest/custom-elements.md +14 -14
- package/lib/autosuggest/helpers/renderer.d.ts +8 -0
- package/lib/autosuggest/helpers/renderer.js +35 -0
- package/lib/autosuggest/helpers/types.d.ts +101 -1
- package/lib/autosuggest/helpers/utils.d.ts +1 -8
- package/lib/autosuggest/helpers/utils.js +0 -27
- package/lib/autosuggest/index.d.ts +34 -32
- package/lib/autosuggest/index.js +246 -202
- 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/index.js +2 -1
- package/lib/button/themes/halo/dark/index.js +1 -1
- package/lib/button/themes/halo/light/index.js +1 -1
- package/lib/button/themes/solar/charcoal/index.js +1 -1
- package/lib/button/themes/solar/pearl/index.js +1 -1
- package/lib/calendar/index.d.ts +1 -1
- 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/chart/plugins/doughnut-center-label.js +1 -1
- package/lib/chart/themes/halo/dark/index.js +1 -1
- package/lib/chart/themes/halo/light/index.js +1 -1
- package/lib/checkbox/index.d.ts +8 -15
- package/lib/checkbox/index.js +19 -41
- 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 +10 -10
- package/lib/clock/custom-elements.md +1 -1
- package/lib/clock/index.d.ts +44 -16
- package/lib/clock/index.js +178 -61
- 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/combo-box/index.d.ts +4 -3
- package/lib/combo-box/index.js +7 -3
- 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/datetime-field/index.d.ts +1 -1
- package/lib/datetime-field/utils.d.ts +1 -1
- package/lib/datetime-picker/themes/halo/dark/index.js +1 -1
- package/lib/datetime-picker/themes/halo/light/index.js +1 -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/email-field/themes/halo/dark/index.js +1 -1
- package/lib/email-field/themes/halo/light/index.js +1 -1
- package/lib/email-field/themes/solar/charcoal/index.js +1 -1
- package/lib/email-field/themes/solar/pearl/index.js +1 -1
- package/lib/flag/utils/FlagLoader.d.ts +2 -32
- package/lib/flag/utils/FlagLoader.js +2 -69
- package/lib/heatmap/index.d.ts +2 -2
- package/lib/heatmap/themes/halo/dark/index.js +1 -1
- package/lib/heatmap/themes/halo/light/index.js +1 -1
- package/lib/icon/utils/IconLoader.d.ts +2 -37
- package/lib/icon/utils/IconLoader.js +2 -76
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/interactive-chart/themes/halo/dark/index.js +1 -1
- package/lib/interactive-chart/themes/halo/light/index.js +1 -1
- package/lib/item/helpers/types.d.ts +6 -6
- package/lib/item/index.d.ts +2 -2
- package/lib/item/index.js +0 -1
- package/lib/item/themes/halo/dark/index.js +1 -1
- package/lib/item/themes/halo/light/index.js +1 -1
- package/lib/list/elements/list-item.d.ts +30 -0
- package/lib/list/elements/list-item.js +19 -0
- package/lib/list/elements/list.d.ts +307 -0
- package/lib/list/elements/list.js +632 -0
- package/lib/list/helpers/renderer.d.ts +0 -1
- package/lib/list/helpers/renderer.js +1 -3
- package/lib/list/index.d.ts +3 -317
- package/lib/list/index.js +3 -641
- package/lib/list/themes/halo/dark/index.js +4 -1
- package/lib/list/themes/halo/light/index.js +5 -2
- package/lib/list/themes/solar/charcoal/index.js +4 -1
- package/lib/list/themes/solar/pearl/index.js +4 -1
- package/lib/multi-input/index.d.ts +1 -5
- package/lib/multi-input/index.js +17 -18
- package/lib/notification/themes/halo/dark/index.js +1 -1
- package/lib/notification/themes/halo/light/index.js +1 -1
- package/lib/notification/themes/solar/charcoal/index.js +1 -1
- package/lib/notification/themes/solar/pearl/index.js +1 -1
- package/lib/number-field/themes/halo/dark/index.js +1 -1
- package/lib/number-field/themes/halo/light/index.js +1 -1
- 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/index.d.ts +2 -1
- package/lib/overlay-menu/helpers/constants.d.ts +6 -0
- package/lib/overlay-menu/helpers/constants.js +7 -0
- package/lib/overlay-menu/helpers/types.d.ts +0 -6
- package/lib/overlay-menu/helpers/types.js +1 -7
- package/lib/overlay-menu/index.d.ts +1 -1
- package/lib/overlay-menu/index.js +1 -1
- package/lib/password-field/themes/halo/dark/index.js +1 -1
- package/lib/password-field/themes/halo/light/index.js +1 -1
- 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/index.d.ts +11 -3
- package/lib/pill/index.js +25 -11
- package/lib/radio-button/index.d.ts +7 -11
- package/lib/radio-button/index.js +14 -25
- 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 +4 -4
- package/lib/rating/custom-elements.md +2 -2
- package/lib/rating/index.d.ts +84 -32
- package/lib/rating/index.js +209 -80
- package/lib/rating/themes/halo/dark/index.js +1 -1
- package/lib/rating/themes/halo/light/index.js +1 -1
- package/lib/rating/themes/solar/charcoal/index.js +1 -1
- package/lib/rating/themes/solar/pearl/index.js +1 -1
- package/lib/rating/utils.d.ts +9 -0
- package/lib/rating/utils.js +11 -0
- package/lib/search-field/themes/halo/dark/index.js +1 -1
- package/lib/search-field/themes/halo/light/index.js +1 -1
- 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/index.d.ts +13 -1
- package/lib/select/index.js +25 -7
- package/lib/select/themes/halo/dark/index.js +1 -1
- package/lib/select/themes/halo/light/index.js +1 -1
- package/lib/select/themes/solar/charcoal/index.js +1 -1
- package/lib/select/themes/solar/pearl/index.js +1 -1
- package/lib/slider/constants.d.ts +5 -1
- package/lib/slider/constants.js +6 -1
- package/lib/slider/index.d.ts +112 -49
- package/lib/slider/index.js +331 -182
- package/lib/slider/themes/halo/dark/index.js +1 -1
- package/lib/slider/themes/halo/light/index.js +1 -1
- package/lib/slider/themes/solar/charcoal/index.js +1 -1
- package/lib/slider/themes/solar/pearl/index.js +1 -1
- package/lib/slider/utils.d.ts +1 -9
- package/lib/slider/utils.js +1 -18
- package/lib/sparkline/themes/halo/dark/index.js +1 -1
- package/lib/sparkline/themes/halo/light/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/index.d.ts +6 -7
- package/lib/tab-bar/index.js +12 -10
- package/lib/tab-bar/themes/halo/dark/index.js +1 -0
- package/lib/tab-bar/themes/halo/light/index.js +1 -0
- package/lib/tab-bar/themes/solar/charcoal/index.js +1 -0
- package/lib/tab-bar/themes/solar/pearl/index.js +1 -0
- package/lib/text-field/index.js +2 -3
- package/lib/text-field/themes/halo/dark/index.js +1 -1
- package/lib/text-field/themes/halo/light/index.js +1 -1
- package/lib/text-field/themes/solar/charcoal/index.js +1 -1
- package/lib/text-field/themes/solar/pearl/index.js +1 -1
- package/lib/toggle/index.d.ts +7 -10
- package/lib/toggle/index.js +14 -24
- 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/helpers/overflow-tooltip.d.ts +11 -4
- package/lib/tooltip/helpers/overflow-tooltip.js +34 -6
- package/lib/tooltip/index.d.ts +2 -2
- package/lib/tooltip/index.js +2 -2
- package/lib/tree/elements/tree-item.d.ts +4 -0
- package/lib/tree/elements/tree-item.js +5 -2
- package/lib/tree/elements/tree.d.ts +7 -0
- package/lib/tree/elements/tree.js +12 -1
- package/lib/tree/helpers/renderer.d.ts +0 -1
- package/lib/tree/helpers/renderer.js +0 -2
- package/lib/tree/index.d.ts +2 -1
- package/lib/tree/themes/halo/dark/index.js +2 -2
- package/lib/tree/themes/halo/light/index.js +3 -3
- package/lib/tree/themes/solar/charcoal/index.js +2 -2
- package/lib/tree/themes/solar/pearl/index.js +2 -2
- package/lib/tree-select/index.js +15 -5
- package/lib/tree-select/themes/halo/dark/index.js +1 -1
- package/lib/tree-select/themes/halo/light/index.js +1 -1
- package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
- package/lib/tree-select/themes/solar/pearl/index.js +1 -1
- package/lib/version.js +1 -1
- package/package.json +20 -19
- package/lib/clock/utils/timestamps.d.ts +0 -6
- package/lib/clock/utils/timestamps.js +0 -6
package/lib/checkbox/index.js
CHANGED
|
@@ -20,13 +20,14 @@ let Checkbox = class Checkbox extends ControlElement {
|
|
|
20
20
|
constructor() {
|
|
21
21
|
super(...arguments);
|
|
22
22
|
this.defaultRole = 'checkbox';
|
|
23
|
-
this._checked = false;
|
|
24
|
-
this._indeterminate = false;
|
|
25
23
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @ignore
|
|
24
|
+
* Value of checkbox
|
|
28
25
|
*/
|
|
29
|
-
this.
|
|
26
|
+
this.checked = false;
|
|
27
|
+
/**
|
|
28
|
+
* Set state to indeterminate
|
|
29
|
+
*/
|
|
30
|
+
this.indeterminate = false;
|
|
30
31
|
}
|
|
31
32
|
/**
|
|
32
33
|
* Element version number
|
|
@@ -69,45 +70,25 @@ let Checkbox = class Checkbox extends ControlElement {
|
|
|
69
70
|
`;
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
72
|
-
*
|
|
73
|
-
* @param
|
|
74
|
-
* @
|
|
73
|
+
* Called before update() to compute values needed during the update.
|
|
74
|
+
* @param changedProperties Properties that has changed
|
|
75
|
+
* @returns {void}
|
|
75
76
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (
|
|
79
|
-
this.
|
|
80
|
-
// remove indeterminate if change state to checked
|
|
81
|
-
if (this._checked) {
|
|
77
|
+
willUpdate(changedProperties) {
|
|
78
|
+
super.willUpdate(changedProperties);
|
|
79
|
+
if (changedProperties.has('checked')) {
|
|
80
|
+
if (this.checked) {
|
|
82
81
|
this.indeterminate = false;
|
|
83
82
|
}
|
|
84
|
-
this.
|
|
85
|
-
void this.requestUpdate('checked', oldValue);
|
|
83
|
+
this.setAttribute('aria-checked', String(this.checked));
|
|
86
84
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return this._checked;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Set state to indeterminate
|
|
93
|
-
* @param value new indeterminate value
|
|
94
|
-
* @default false
|
|
95
|
-
*/
|
|
96
|
-
set indeterminate(value) {
|
|
97
|
-
const oldValue = this._indeterminate;
|
|
98
|
-
if (oldValue !== value) {
|
|
99
|
-
this._indeterminate = value;
|
|
100
|
-
// remove checked if change state to indeterminate
|
|
101
|
-
if (value) {
|
|
85
|
+
if (changedProperties.has('indeterminate')) {
|
|
86
|
+
if (this.indeterminate) {
|
|
102
87
|
this.checked = false;
|
|
103
88
|
}
|
|
104
|
-
this.
|
|
105
|
-
void this.requestUpdate('indeterminate', oldValue);
|
|
89
|
+
this.setAttribute('aria-checked', this.indeterminate ? 'mixed' : String(this.checked));
|
|
106
90
|
}
|
|
107
91
|
}
|
|
108
|
-
get indeterminate() {
|
|
109
|
-
return this._indeterminate;
|
|
110
|
-
}
|
|
111
92
|
/**
|
|
112
93
|
* Called once after the component is first rendered
|
|
113
94
|
* @param changedProperties map of changed properties with old values
|
|
@@ -176,13 +157,10 @@ let Checkbox = class Checkbox extends ControlElement {
|
|
|
176
157
|
};
|
|
177
158
|
__decorate([
|
|
178
159
|
property({ type: Boolean, reflect: true })
|
|
179
|
-
], Checkbox.prototype, "checked",
|
|
160
|
+
], Checkbox.prototype, "checked", void 0);
|
|
180
161
|
__decorate([
|
|
181
162
|
property({ type: Boolean, reflect: true })
|
|
182
|
-
], Checkbox.prototype, "indeterminate",
|
|
183
|
-
__decorate([
|
|
184
|
-
property({ type: String, reflect: true, attribute: 'aria-checked' })
|
|
185
|
-
], Checkbox.prototype, "ariaChecked", void 0);
|
|
163
|
+
], Checkbox.prototype, "indeterminate", void 0);
|
|
186
164
|
__decorate([
|
|
187
165
|
query('[part=label]', true)
|
|
188
166
|
], Checkbox.prototype, "labelEl", void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/halo/dark';
|
|
2
2
|
import '@refinitiv-ui/elements/tooltip/themes/halo/dark';
|
|
3
3
|
|
|
4
|
-
elf.customStyles.define('ef-checkbox', ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation;--check-color:#6678FF;color:#ccc}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#0d0d0d;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.5);-webkit-user-select:none;-moz-user-select:none
|
|
4
|
+
elf.customStyles.define('ef-checkbox', ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation;--check-color:#6678FF;color:#ccc}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#0d0d0d;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.5);-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;border:1px solid #404040;width:14px;height:14px}:host [part=check]{display:flex;justify-content:center;align-items:center;box-sizing:border-box;color:var(--check-color,#6678ff);width:95%;height:95%}:host [part=label]{margin:0 7px;cursor:default}:host([indeterminate]) [part=check]{border:none;background-color:currentColor;transform:none;border-radius:1px;margin:0;width:70%;height:1px}:host([disabled]) [part=check],:host([readonly]) [part=check]{color:var(--check-color,#ccc)}:host([disabled]) [part=check]{opacity:.5}:host([disabled][checked]) [part=check]{opacity:.5}:host([disabled]) [part=label]{opacity:.65}@media (-ms-high-contrast:none),(pointer:fine){:host(:focus) [part=container]{border-color:#334bff;box-shadow:0 0 0 #334bff}}:host(:not([readonly])) [part=container]{cursor:pointer}:host(:hover:not([checked]):not([indeterminate]):not([readonly])) [part=container]{border-color:grey}:host(:hover:not([readonly])){color:#fff}:host([disabled]),:host([disabled]) [part=label]{opacity:.5}:host([checked]) [part=container]{border:1px solid #334bff}:host(:focus[readonly]:not([checked])) [part=container]{border-color:#404040}:host([focused=visible]){outline:#334bff solid 1px;outline-offset:2px}:host([indeterminate]) [part=container]{border:1px solid #334bff}:host(:focus[readonly]) [part=container],:host(:focus[readonly][indeterminate]) [part=container]{border-color:#334bff}');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/halo/light';
|
|
2
2
|
import '@refinitiv-ui/elements/tooltip/themes/halo/light';
|
|
3
3
|
|
|
4
|
-
elf.customStyles.define('ef-checkbox', ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation;--check-color:#334BFF;color:#404040}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#fff;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.25);-webkit-user-select:none;-moz-user-select:none
|
|
4
|
+
elf.customStyles.define('ef-checkbox', ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation;--check-color:#334BFF;color:#404040}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#fff;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.25);-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;border:1px solid #595959;width:14px;height:14px}:host [part=check]{display:flex;justify-content:center;align-items:center;box-sizing:border-box;color:var(--check-color,#334bff);width:95%;height:95%}:host [part=label]{margin:0 7px;cursor:default}:host([indeterminate]) [part=check]{border:none;background-color:currentColor;transform:none;border-radius:1px;margin:0;width:70%;height:1px}:host([disabled]) [part=check],:host([readonly]) [part=check]{color:var(--check-color,#404040)}:host([disabled]) [part=check]{opacity:.5}:host([disabled][checked]) [part=check]{opacity:.5}:host([disabled]) [part=label]{opacity:.65}@media (-ms-high-contrast:none),(pointer:fine){:host(:focus) [part=container]{border-color:#334bff;box-shadow:0 0 0 #334bff}}:host(:not([readonly])) [part=container]{cursor:pointer}:host(:hover:not([checked]):not([indeterminate]):not([readonly])) [part=container]{border-color:#0d0d0d}:host(:hover:not([readonly])){color:#0d0d0d}:host([disabled]),:host([disabled]) [part=label]{opacity:.5}:host([checked]) [part=container]{border:1px solid #334bff}:host(:focus[readonly]:not([checked])) [part=container]{border-color:#595959}:host([focused=visible]){outline:#334bff solid 1px;outline-offset:2px}:host([indeterminate]) [part=container]{border:1px solid #334bff}:host(:focus[readonly]) [part=container],:host(:focus[readonly][indeterminate]) [part=container]{border-color:#334bff}');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/solar/charcoal';
|
|
2
2
|
import '@refinitiv-ui/elements/tooltip/themes/solar/charcoal';
|
|
3
3
|
|
|
4
|
-
elf.customStyles.define('ef-checkbox', ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#000;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.6);-webkit-user-select:none;-moz-user-select:none
|
|
4
|
+
elf.customStyles.define('ef-checkbox', ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#000;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.6);-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;border:1px solid #4a4a52;height:11px;width:11px}:host [part=check]{display:flex;justify-content:center;align-items:center;box-sizing:border-box;color:var(--check-color,#f93);border-width:0 2px 2px 0;width:95%;height:95%}:host [part=label]{cursor:default;margin:0 4px}:host([indeterminate]) [part=check]{border:none;background-color:currentColor;transform:none;border-radius:1px;margin:0;width:5px;height:5px}:host([disabled]) [part=check],:host([readonly]) [part=check]{color:var(--check-color,#e2e2e2)}:host([disabled]) [part=check]{opacity:.5}:host([disabled][checked]) [part=check]{opacity:.5}:host([disabled]) [part=label]{opacity:.65;color:rgba(194,194,194,.6)}:host([disabled][checked]) [part=check],:host([disabled][indeterminate]) [part=check]{color:#c2c2c2}:host([readonly][checked]) [part=check],:host([readonly][indeterminate]) [part=check]{color:rgba(194,194,194,.5)}:host([disabled]) [part=container],:host([readonly]) [part=container]{color:rgba(194,194,194,.6);border-color:rgba(74,74,82,.6);background-color:rgba(0,0,0,.6)}@media (-ms-high-contrast:none),(pointer:fine){:host(:focus) [part=container]{box-shadow:0 0 0 #f93;border:1px dotted #f93}}');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/solar/pearl';
|
|
2
2
|
import '@refinitiv-ui/elements/tooltip/themes/solar/pearl';
|
|
3
3
|
|
|
4
|
-
elf.customStyles.define('ef-checkbox', ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#fff;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.3);-webkit-user-select:none;-moz-user-select:none
|
|
4
|
+
elf.customStyles.define('ef-checkbox', ':host{margin:1px 0;vertical-align:middle;display:inline-flex;align-items:center;flex-wrap:nowrap;font-size:inherit;font-weight:inherit;touch-action:manipulation}:host(:focus){outline:0}:host [part=container]{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:0;background-color:#fff;transition:box-shadow 150ms,border-color 150ms;box-shadow:inset 0 0 0 rgba(0,0,0,.3);-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;border:1px solid #a9afba;height:11px;width:11px}:host [part=check]{display:flex;justify-content:center;align-items:center;box-sizing:border-box;color:var(--check-color,#ee7600);border-width:0 2px 2px 0;width:95%;height:95%}:host [part=label]{cursor:default;margin:0 4px}:host([indeterminate]) [part=check]{border:none;background-color:currentColor;transform:none;border-radius:1px;margin:0;width:5px;height:5px}:host([disabled]) [part=check],:host([readonly]) [part=check]{color:var(--check-color,#acafb5)}:host([disabled]) [part=check]{opacity:.5}:host([disabled][checked]) [part=check]{opacity:.5}:host([disabled]) [part=label]{opacity:.65;color:rgba(72,72,72,.6)}:host([disabled][checked]) [part=check],:host([disabled][indeterminate]) [part=check]{color:#a9afba}:host([readonly][checked]) [part=check],:host([readonly][indeterminate]) [part=check]{color:rgba(169,175,186,.5)}:host([disabled]) [part=container],:host([readonly]) [part=container]{color:rgba(72,72,72,.6);border-color:rgba(169,175,186,.6);background-color:rgba(255,255,255,.6)}@media (-ms-high-contrast:none),(pointer:fine){:host(:focus) [part=container]{box-shadow:0 0 0 #ffb266;border:1px dotted #ffb266}}');
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"default": "false"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
"name": "
|
|
39
|
-
"description": "
|
|
38
|
+
"name": "analogue",
|
|
39
|
+
"description": "Display clock in analogue style.",
|
|
40
40
|
"type": "boolean",
|
|
41
41
|
"default": "false"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
|
-
"name": "
|
|
45
|
-
"description": "
|
|
44
|
+
"name": "interactive",
|
|
45
|
+
"description": "Enable interactive mode. Allowing the user to offset the value.",
|
|
46
46
|
"type": "boolean",
|
|
47
47
|
"default": "false"
|
|
48
48
|
}
|
|
@@ -83,16 +83,16 @@
|
|
|
83
83
|
"default": "false"
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
|
-
"name": "
|
|
87
|
-
"attribute": "
|
|
88
|
-
"description": "
|
|
86
|
+
"name": "analogue",
|
|
87
|
+
"attribute": "analogue",
|
|
88
|
+
"description": "Display clock in analogue style.",
|
|
89
89
|
"type": "boolean",
|
|
90
90
|
"default": "false"
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
|
-
"name": "
|
|
94
|
-
"attribute": "
|
|
95
|
-
"description": "
|
|
93
|
+
"name": "interactive",
|
|
94
|
+
"attribute": "interactive",
|
|
95
|
+
"description": "Enable interactive mode. Allowing the user to offset the value.",
|
|
96
96
|
"type": "boolean",
|
|
97
97
|
"default": "false"
|
|
98
98
|
}
|
|
@@ -8,7 +8,7 @@ Display hours, minutes and seconds as clock interface
|
|
|
8
8
|
|---------------|----------------|-----------|------------|--------------------------------------------------|
|
|
9
9
|
| `amPm` | `am-pm` | `boolean` | false | Display the digital clock in 12hr format. |
|
|
10
10
|
| `analogue` | `analogue` | `boolean` | false | Display clock in analogue style. |
|
|
11
|
-
| `interactive` | `interactive` | `boolean` | false |
|
|
11
|
+
| `interactive` | `interactive` | `boolean` | false | Enable interactive mode. Allowing the user to offset the value. |
|
|
12
12
|
| `offset` | `offset` | `number` | | Get offset value |
|
|
13
13
|
| `showSeconds` | `show-seconds` | `boolean` | false | Display the seconds segment. |
|
|
14
14
|
| `tick` | `tick` | `boolean` | false | Toggles clock ticking function. |
|
package/lib/clock/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
2
|
import { TemplateResult, CSSResultGroup, PropertyValues, ResponsiveElement, ElementSize } from '@refinitiv-ui/core';
|
|
3
|
+
import '@refinitiv-ui/phrasebook/locale/en/clock.js';
|
|
4
|
+
import { TranslatePromise } from '@refinitiv-ui/translate';
|
|
3
5
|
/**
|
|
4
6
|
* Display hours, minutes and seconds as clock interface
|
|
5
7
|
* @fires value-changed - Fired when the value property changes while ticking.
|
|
@@ -42,6 +44,14 @@ export declare class Clock extends ResponsiveElement {
|
|
|
42
44
|
* Used for accurately ticking time.
|
|
43
45
|
*/
|
|
44
46
|
private tickTimestamp;
|
|
47
|
+
/**
|
|
48
|
+
* Current active segment for interactive mode
|
|
49
|
+
*/
|
|
50
|
+
private activeSegment;
|
|
51
|
+
/**
|
|
52
|
+
* Clock internal translation strings
|
|
53
|
+
*/
|
|
54
|
+
protected tPromise: TranslatePromise;
|
|
45
55
|
/**
|
|
46
56
|
* Get time value in format `hh:mm:ss`
|
|
47
57
|
* @default 00:00:00
|
|
@@ -81,14 +91,14 @@ export declare class Clock extends ResponsiveElement {
|
|
|
81
91
|
* Display the seconds segment.
|
|
82
92
|
*/
|
|
83
93
|
showSeconds: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Enabled interactive mode. Allowing the user to offset the value.
|
|
86
|
-
*/
|
|
87
|
-
interactive: boolean;
|
|
88
94
|
/**
|
|
89
95
|
* Display clock in analogue style.
|
|
90
96
|
*/
|
|
91
97
|
analogue: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Enable interactive mode. Allowing the user to offset the value.
|
|
100
|
+
*/
|
|
101
|
+
interactive: boolean;
|
|
92
102
|
/**
|
|
93
103
|
* Getter for hours part.
|
|
94
104
|
*/
|
|
@@ -151,6 +161,11 @@ export declare class Clock extends ResponsiveElement {
|
|
|
151
161
|
* @returns display seconds
|
|
152
162
|
*/
|
|
153
163
|
private get displaySeconds();
|
|
164
|
+
/**
|
|
165
|
+
* Get display value
|
|
166
|
+
* @returns display value
|
|
167
|
+
*/
|
|
168
|
+
private get displayValue();
|
|
154
169
|
/**
|
|
155
170
|
* Get display AM or PM depending on time
|
|
156
171
|
* @returns `AM` or `PM`
|
|
@@ -161,6 +176,11 @@ export declare class Clock extends ResponsiveElement {
|
|
|
161
176
|
* @returns Result
|
|
162
177
|
*/
|
|
163
178
|
private get isAM();
|
|
179
|
+
/**
|
|
180
|
+
* Returns `true` if display minutes has changed
|
|
181
|
+
* @returns Result
|
|
182
|
+
*/
|
|
183
|
+
private get isDisplayMinutesChange();
|
|
164
184
|
/**
|
|
165
185
|
* Configures the tick manager to either start or stop ticking,
|
|
166
186
|
* depending on the state of the element.
|
|
@@ -182,15 +202,15 @@ export declare class Clock extends ResponsiveElement {
|
|
|
182
202
|
*/
|
|
183
203
|
private shift;
|
|
184
204
|
/**
|
|
185
|
-
* Returns any shift amount assigned to a
|
|
186
|
-
* @param
|
|
205
|
+
* Returns any shift amount assigned to a segment.
|
|
206
|
+
* @param segment Segment.
|
|
187
207
|
* @returns {void}
|
|
188
208
|
*/
|
|
189
|
-
private
|
|
209
|
+
private getShiftAmountFromSegment;
|
|
190
210
|
/**
|
|
191
211
|
* Returns `true` or `false` depends on the offset value's effect on giving segment
|
|
192
212
|
*
|
|
193
|
-
* @param segment segment
|
|
213
|
+
* @param segment segment
|
|
194
214
|
* @returns Result
|
|
195
215
|
*/
|
|
196
216
|
private isSegmentShifted;
|
|
@@ -217,27 +237,24 @@ export declare class Clock extends ResponsiveElement {
|
|
|
217
237
|
private manageControlKeys;
|
|
218
238
|
/**
|
|
219
239
|
* Handles UP key press
|
|
220
|
-
* @param event Event Object
|
|
221
240
|
* @returns {void}
|
|
222
241
|
*/
|
|
223
242
|
private handleUpKey;
|
|
224
243
|
/**
|
|
225
244
|
* Handle DOWN key press
|
|
226
|
-
* @param event Event Object
|
|
227
245
|
* @returns {void}
|
|
228
246
|
*/
|
|
229
247
|
private handleDownKey;
|
|
230
248
|
/**
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
* @returns {
|
|
249
|
+
* Set aria-valuenow to display value and aria-valuetext to translated format
|
|
250
|
+
* @param updateAriaValueText condition to update aria-valueText
|
|
251
|
+
* @returns {void}
|
|
234
252
|
*/
|
|
235
|
-
private
|
|
253
|
+
private updateAriaValue;
|
|
236
254
|
/**
|
|
237
255
|
* Get template of segment
|
|
238
|
-
* @param
|
|
256
|
+
* @param segment segment
|
|
239
257
|
* @param value segment's value
|
|
240
|
-
* @param shiftAmount amount to shift
|
|
241
258
|
* @returns {TemplateResult} template
|
|
242
259
|
*/
|
|
243
260
|
private generateSegmentTemplate;
|
|
@@ -288,6 +305,17 @@ export declare class Clock extends ResponsiveElement {
|
|
|
288
305
|
* @returns {void}
|
|
289
306
|
*/
|
|
290
307
|
protected firstUpdated(changedProperties: PropertyValues): void;
|
|
308
|
+
/**
|
|
309
|
+
* Handles interactive by update role, tabindex, and aria attribute
|
|
310
|
+
* @returns {void}
|
|
311
|
+
*/
|
|
312
|
+
private interactiveChanged;
|
|
313
|
+
/**
|
|
314
|
+
* Called before update() to compute values needed during the update.
|
|
315
|
+
* @param changedProperties Properties that has changed
|
|
316
|
+
* @returns {void}
|
|
317
|
+
*/
|
|
318
|
+
protected willUpdate(changedProperties: PropertyValues): void;
|
|
291
319
|
/**
|
|
292
320
|
* Template for digital clock
|
|
293
321
|
* @returns {TemplateResult} template
|