@refinitiv-ui/elements 7.3.1 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/lib/calendar/custom-elements.json +4 -0
- package/lib/calendar/custom-elements.md +4 -3
- package/lib/calendar/index.d.ts +8 -1
- package/lib/calendar/index.js +26 -3
- 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/number-field/custom-elements.json +11 -0
- package/lib/number-field/custom-elements.md +3 -0
- package/lib/number-field/index.d.ts +8 -0
- package/lib/number-field/index.js +24 -7
- package/lib/slider/index.js +0 -1
- package/lib/version.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [7.4.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.3.2...@refinitiv-ui/elements@7.4.0) (2023-09-11)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **calendar:** custom cell content ([#928](https://github.com/Refinitiv/refinitiv-ui/issues/928)) ([ce8ec58](https://github.com/Refinitiv/refinitiv-ui/commit/ce8ec5859f503af45750f9838b809a1a2db2365e))
|
|
11
|
+
- **number-field:** add new event step-up and step-down ([#906](https://github.com/Refinitiv/refinitiv-ui/issues/906)) ([75ec298](https://github.com/Refinitiv/refinitiv-ui/commit/75ec298d646913b645e3057160bdb664f298ba3d))
|
|
12
|
+
|
|
13
|
+
## [7.3.2](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.3.1...@refinitiv-ui/elements@7.3.2) (2023-09-04)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
- **number-field:** stepUp/stepDown not fire input event ([#921](https://github.com/Refinitiv/refinitiv-ui/issues/921)) ([e89e124](https://github.com/Refinitiv/refinitiv-ui/commit/e89e124461cc101bd065fd6262cab64c484d50dc))
|
|
18
|
+
|
|
6
19
|
## [7.3.1](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.3.0...@refinitiv-ui/elements@7.3.1) (2023-08-28)
|
|
7
20
|
|
|
8
21
|
### Bug Fixes
|
|
@@ -191,6 +191,10 @@
|
|
|
191
191
|
}
|
|
192
192
|
],
|
|
193
193
|
"slots": [
|
|
194
|
+
{
|
|
195
|
+
"name": "yyyy-mm-dd",
|
|
196
|
+
"description": "Adds slotted content into the specific date which use value in `ISO8601` date string format as a key e.g. `yyyy-MM-dd`, `yyyy-MM` and `yyyy`"
|
|
197
|
+
},
|
|
194
198
|
{
|
|
195
199
|
"name": "footer",
|
|
196
200
|
"description": "Adds slotted content into the footer of the calendar control"
|
|
@@ -30,6 +30,7 @@ Standard calendar element
|
|
|
30
30
|
|
|
31
31
|
## Slots
|
|
32
32
|
|
|
33
|
-
| Name
|
|
34
|
-
|
|
35
|
-
| `footer`
|
|
33
|
+
| Name | Description |
|
|
34
|
+
|--------------|--------------------------------------------------|
|
|
35
|
+
| `footer` | Adds slotted content into the footer of the calendar control |
|
|
36
|
+
| `yyyy-mm-dd` | Adds slotted content into the specific date which use value in `ISO8601` date string format as a key e.g. `yyyy-MM-dd`, `yyyy-MM` and `yyyy` |
|
package/lib/calendar/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export { CalendarFilter };
|
|
|
18
18
|
* @attr {boolean} disabled - Set disabled state
|
|
19
19
|
* @prop {boolean} [disabled=false] - Set disabled state
|
|
20
20
|
*
|
|
21
|
+
* @slot yyyy-mm-dd - Adds slotted content into the specific date which use value in `ISO8601` date string format as a key e.g. `yyyy-MM-dd`, `yyyy-MM` and `yyyy`
|
|
21
22
|
* @slot footer - Adds slotted content into the footer of the calendar control
|
|
22
23
|
*/
|
|
23
24
|
export declare class Calendar extends ControlElement implements MultiValue {
|
|
@@ -289,7 +290,13 @@ export declare class Calendar extends ControlElement implements MultiValue {
|
|
|
289
290
|
*/
|
|
290
291
|
private onKeyDown;
|
|
291
292
|
/**
|
|
292
|
-
*
|
|
293
|
+
* Get cell content from tap event
|
|
294
|
+
* @param event Keyboard event
|
|
295
|
+
* @returns html element
|
|
296
|
+
*/
|
|
297
|
+
private getCellContent;
|
|
298
|
+
/**
|
|
299
|
+
* Run when tap event happens to table.
|
|
293
300
|
* Select the values or switch the view
|
|
294
301
|
* @param event Tap event
|
|
295
302
|
* @returns {void}
|
package/lib/calendar/index.js
CHANGED
|
@@ -27,6 +27,7 @@ import { ViewFormatTranslateParams, monthInfo, monthsNames, weekdaysNames } from
|
|
|
27
27
|
* @attr {boolean} disabled - Set disabled state
|
|
28
28
|
* @prop {boolean} [disabled=false] - Set disabled state
|
|
29
29
|
*
|
|
30
|
+
* @slot yyyy-mm-dd - Adds slotted content into the specific date which use value in `ISO8601` date string format as a key e.g. `yyyy-MM-dd`, `yyyy-MM` and `yyyy`
|
|
30
31
|
* @slot footer - Adds slotted content into the footer of the calendar control
|
|
31
32
|
*/
|
|
32
33
|
let Calendar = class Calendar extends ControlElement {
|
|
@@ -618,7 +619,28 @@ let Calendar = class Calendar extends ControlElement {
|
|
|
618
619
|
event.preventDefault();
|
|
619
620
|
}
|
|
620
621
|
/**
|
|
621
|
-
*
|
|
622
|
+
* Get cell content from tap event
|
|
623
|
+
* @param event Keyboard event
|
|
624
|
+
* @returns html element
|
|
625
|
+
*/
|
|
626
|
+
getCellContent(event) {
|
|
627
|
+
const path = event.composedPath();
|
|
628
|
+
for (let i = 0; i <= path.length; i += 1) {
|
|
629
|
+
const node = path[i];
|
|
630
|
+
if (node === this) {
|
|
631
|
+
return null;
|
|
632
|
+
}
|
|
633
|
+
if (node.nodeType !== Node.ELEMENT_NODE) {
|
|
634
|
+
continue;
|
|
635
|
+
}
|
|
636
|
+
if (node.getAttribute('role') === 'button' && node.part.value.includes('cell-content')) {
|
|
637
|
+
return node;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
return null;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Run when tap event happens to table.
|
|
622
644
|
* Select the values or switch the view
|
|
623
645
|
* @param event Tap event
|
|
624
646
|
* @returns {void}
|
|
@@ -627,7 +649,7 @@ let Calendar = class Calendar extends ControlElement {
|
|
|
627
649
|
if (event.defaultPrevented) {
|
|
628
650
|
return;
|
|
629
651
|
}
|
|
630
|
-
const cell = event
|
|
652
|
+
const cell = this.getCellContent(event);
|
|
631
653
|
if (!cell || !this.isDateButton(cell) || !cell.value) {
|
|
632
654
|
return;
|
|
633
655
|
}
|
|
@@ -1128,6 +1150,7 @@ let Calendar = class Calendar extends ControlElement {
|
|
|
1128
1150
|
const isSelectable = isSelection && !cell.disabled;
|
|
1129
1151
|
const isSelected = cell.selected ? 'true' : 'false';
|
|
1130
1152
|
const isActive = cell.active ? 0 : -1;
|
|
1153
|
+
const slotContent = cell.value ? html `<slot name=${cell.value}>${cell.text}</slot>` : cell.text;
|
|
1131
1154
|
return html `<div
|
|
1132
1155
|
role="gridcell"
|
|
1133
1156
|
part="cell ${cell.view}"
|
|
@@ -1157,7 +1180,7 @@ let Calendar = class Calendar extends ControlElement {
|
|
|
1157
1180
|
.value=${cell.value}
|
|
1158
1181
|
.index=${cell.index}
|
|
1159
1182
|
>
|
|
1160
|
-
${
|
|
1183
|
+
${slotContent}
|
|
1161
1184
|
</div>
|
|
1162
1185
|
</div>`;
|
|
1163
1186
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/button/themes/halo/dark';
|
|
2
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12px;color:#ccc;min-width:196px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#262626;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#262626}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#333}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#fff}:host [part~=cell][today] [part~=selection]{background:#404040}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([today]):not([range]) [part~=selection]:hover{color:#fff}:host [part~=cell]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([today]):not([range]):not(:active) [part~=selection]:hover,:host [part~=cell][today][selected] [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]) [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range]:not(:active) [part~=selection]:hover,:host [part~=cell][selected]:not(:active) [part~=selection]:hover,:host [part~=cell][today]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell][range]:not([disabled]):active [part~=selection],:host [part~=cell][selected]:not([disabled]):active [part~=selection],:host [part~=cell][today]:not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range] [part~=selection]{background:rgba(51,75,255,.2)}:host [part~=cell][range][today]{color:#fff}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#334bff}:host [part~=cell]:not(:first-of-type) [part~=cell-content]{left:1px}:host [part~=day-name]{color:#999;font-weight:600}:host [part~=day-name] [part~=cell-content]{background-color:#1a1a1a}:host [part~=cell-content]{background:#0d0d0d;top:0;bottom:0;right:0;left:0}:host [part~=selection]{outline:0;border:1px solid #0d0d0d}:host([focused=visible]) [part~=cell] [part~=selection]:focus{outline:#1429bd solid 1px}:host([disabled]){opacity:.4}' }}));
|
|
2
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12px;color:#ccc;min-width:196px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#262626;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#262626}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#333}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#fff}:host [part~=cell][today] [part~=selection]{background:#404040}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([today]):not([range]) [part~=selection]:hover{color:#fff}:host [part~=cell]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([today]):not([range]):not(:active) [part~=selection]:hover,:host [part~=cell][today][selected] [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]) [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range]:not(:active) [part~=selection]:hover,:host [part~=cell][selected]:not(:active) [part~=selection]:hover,:host [part~=cell][today]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell][range]:not([disabled]):active [part~=selection],:host [part~=cell][selected]:not([disabled]):active [part~=selection],:host [part~=cell][today]:not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range] [part~=selection]{background:rgba(51,75,255,.2)}:host [part~=cell][range][today]{color:#fff}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#334bff}:host [part~=cell]:not(:first-of-type) [part~=cell-content]{left:1px}:host [part~=day-name]{color:#999;font-weight:600}:host [part~=day-name] [part~=cell-content]{background-color:#1a1a1a}:host [part~=cell-content]{background:#0d0d0d;top:0;bottom:0;right:0;left:0}:host [part~=selection]{outline:0;border:1px solid #0d0d0d}:host [part~=selection] ::slotted(*){position:absolute}:host([focused=visible]) [part~=cell] [part~=selection]:focus{outline:#1429bd solid 1px}:host([disabled]){opacity:.4}' }}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/button/themes/halo/light';
|
|
2
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12px;color:#0d0d0d;min-width:196px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#f2f2f2;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-next]:not(:hover):not(:focus):not(:active),:host [part=btn-prev]:not(:hover):not(:focus):not(:active){color:#595959}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#e6e6e6}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#e6e6e6}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#0d0d0d}:host [part~=cell][today] [part~=selection]{background:#d9d9d9}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([today]):not([range]) [part~=selection]:hover{color:#fff}:host [part~=cell]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([today]):not([range]):not(:active) [part~=selection]:hover,:host [part~=cell][today][selected] [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]) [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range]:not(:active) [part~=selection]:hover,:host [part~=cell][selected]:not(:active) [part~=selection]:hover,:host [part~=cell][today]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell][range]:not([disabled]):active [part~=selection],:host [part~=cell][selected]:not([disabled]):active [part~=selection],:host [part~=cell][today]:not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range] [part~=selection]{background:rgba(51,75,255,.2)}:host [part~=cell][range][today]{color:#fff}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#334bff}:host [part~=cell]:not(:first-of-type) [part~=cell-content]{left:1px}:host [part~=day-name]{color:#737373;font-weight:600}:host [part~=day-name] [part~=cell-content]{background-color:#fafafa}:host [part~=cell-content]{background:#fff;top:0;bottom:0;right:0;left:0}:host [part~=selection]{outline:0;border:1px solid #fff}:host([focused=visible]) [part~=cell] [part~=selection]:focus{outline:#1429bd solid 1px}:host([disabled]){opacity:.4}' }}));
|
|
2
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:12px;color:#0d0d0d;min-width:196px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#f2f2f2;padding:4px 3px}:host [part=navigation]{padding-bottom:3px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-next]:not(:hover):not(:focus):not(:active),:host [part=btn-prev]:not(:hover):not(:focus):not(:active){color:#595959}:host [part=btn-view]{background:0 0;margin-left:16px;border:none;color:inherit;padding:0}:host [part=btn-view]:hover,:host [part=btn-view][focused=visible]{opacity:.8}:host [part=table]{width:100%;background:#e6e6e6}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=cell-content]{top:1px}:host [part~=day-name-row]{background-color:#e6e6e6}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#0d0d0d}:host [part~=cell][today] [part~=selection]{background:#d9d9d9}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([today]):not([range]) [part~=selection]:hover{color:#fff}:host [part~=cell]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([today]):not([range]):not(:active) [part~=selection]:hover,:host [part~=cell][today][selected] [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]) [part~=selection]:hover{background:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell]:not([selected]):not([range]):not([today]):not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range]:not(:active) [part~=selection]:hover,:host [part~=cell][selected]:not(:active) [part~=selection]:hover,:host [part~=cell][today]:not(:active) [part~=selection]:hover{border-color:#1429bd}:host [part~=cell][range]:not([disabled]):active [part~=selection],:host [part~=cell][selected]:not([disabled]):active [part~=selection],:host [part~=cell][today]:not([disabled]):active [part~=selection]{color:#fff;background-color:#0f1e8a}:host [part~=cell][range] [part~=selection]{background:rgba(51,75,255,.2)}:host [part~=cell][range][today]{color:#fff}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#334bff}:host [part~=cell]:not(:first-of-type) [part~=cell-content]{left:1px}:host [part~=day-name]{color:#737373;font-weight:600}:host [part~=day-name] [part~=cell-content]{background-color:#fafafa}:host [part~=cell-content]{background:#fff;top:0;bottom:0;right:0;left:0}:host [part~=selection]{outline:0;border:1px solid #fff}:host [part~=selection] ::slotted(*){position:absolute}:host([focused=visible]) [part~=cell] [part~=selection]:focus{outline:#1429bd solid 1px}:host([disabled]){opacity:.4}' }}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/button/themes/solar/charcoal';
|
|
2
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13px;color:#c2c2c2;min-width:224px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#3c3c42;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #000;background:#212124}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #0a0a0a}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]:not(:last-of-type){box-shadow:1px 0 0 0 #0a0a0a}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#f93}:host [part~=cell][today] [part~=selection]{background:#3c3c42}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus,:host [part~=cell]:not([selected]):not([range]) [part~=selection]:hover{background:#3c3c42;color:#e2e2e2}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus{outline:#f93 dotted 1px}:host [part~=cell][range] [part~=selection]{background:rgba(255,153,51,.2)}:host [part~=cell][range][today]{color:#f93}:host [part~=cell][selected]{color:#000}:host [part~=cell][selected] [part~=selection]{background:#f93}:host [part~=cell]:not(:first-of-type) [part~=selection]{left:1px}:host [part~=day-name]{background-color:#151516;color:#666570;font-size:10px;font-weight:700}:host [part~=selection]{outline:0;top:0;bottom:0;right:0;left:0}:host([disabled]){opacity:.4}' }}));
|
|
2
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13px;color:#c2c2c2;min-width:224px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#3c3c42;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #000;background:#212124}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #0a0a0a}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]:not(:last-of-type){box-shadow:1px 0 0 0 #0a0a0a}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#f93}:host [part~=cell][today] [part~=selection]{background:#3c3c42}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus,:host [part~=cell]:not([selected]):not([range]) [part~=selection]:hover{background:#3c3c42;color:#e2e2e2}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus{outline:#f93 dotted 1px}:host [part~=cell][range] [part~=selection]{background:rgba(255,153,51,.2)}:host [part~=cell][range][today]{color:#f93}:host [part~=cell][selected]{color:#000}:host [part~=cell][selected] [part~=selection]{background:#f93}:host [part~=cell]:not(:first-of-type) [part~=selection]{left:1px}:host [part~=day-name]{background-color:#151516;color:#666570;font-size:10px;font-weight:700}:host [part~=selection]{outline:0;top:0;bottom:0;right:0;left:0}:host [part~=selection] ::slotted(*){position:absolute}:host([disabled]){opacity:.4}' }}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/button/themes/solar/pearl';
|
|
2
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13px;color:#484848;min-width:224px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#fff;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #a9afba;background:#fff}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #d5d8db}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]:not(:last-of-type){box-shadow:1px 0 0 0 #d5d8db}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#fff}:host [part~=cell][today] [part~=selection]{background:#acafb5}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus,:host [part~=cell]:not([selected]):not([range]) [part~=selection]:hover{background:#e4e8ed;color:#000}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus{outline:#ee7600 dotted 1px}:host [part~=cell][range] [part~=selection]{background:rgba(255,153,51,.2)}:host [part~=cell][range][today]{color:#f93}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#f93}:host [part~=cell]:not(:first-of-type) [part~=selection]{left:1px}:host [part~=day-name]{background-color:#e4e8ed;color:#6e6e78;font-size:10px;font-weight:700}:host [part~=selection]{outline:0;top:0;bottom:0;right:0;left:0}:host([disabled]){opacity:.4}' }}));
|
|
2
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-calendar', styles: ':host{font-style:normal;font-variant:normal;font-weight:400;line-height:normal;text-align:left;text-indent:0;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;outline:0;font-size:13px;color:#484848;min-width:224px;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:#fff;padding:4px}:host [part=navigation]{padding-bottom:4px}:host [part=btn-next],:host [part=btn-prev],:host [part=btn-view]{margin:0}:host [part=btn-view]{background:0 0;color:inherit;box-shadow:none;margin-left:15px;padding:0}:host [part=btn-view]:not([focused=visible]){border:none}:host [part=table]{width:100%;box-shadow:0 0 0 1px #a9afba;background:#fff}:host [part~=row]:not(:last-of-type){box-shadow:0 1px 0 0 #d5d8db}:host [part~=row]:not(:first-of-type) [part~=cell] [part~=selection]{top:1px}:host [part~=cell]:not(:last-of-type){box-shadow:1px 0 0 0 #d5d8db}:host [part~=cell][disabled]{opacity:.4}:host [part~=cell][today]{color:#fff}:host [part~=cell][today] [part~=selection]{background:#acafb5}:host [part~=cell]:not([selected]):not([range]):not([disabled])[idle] [part~=selection]{opacity:.6}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus,:host [part~=cell]:not([selected]):not([range]) [part~=selection]:hover{background:#e4e8ed;color:#000}:host [part~=cell]:not([selected]):not([range]) [part~=selection]:focus{outline:#ee7600 dotted 1px}:host [part~=cell][range] [part~=selection]{background:rgba(255,153,51,.2)}:host [part~=cell][range][today]{color:#f93}:host [part~=cell][selected]{color:#fff}:host [part~=cell][selected] [part~=selection]{background:#f93}:host [part~=cell]:not(:first-of-type) [part~=selection]{left:1px}:host [part~=day-name]{background-color:#e4e8ed;color:#6e6e78;font-size:10px;font-weight:700}:host [part~=selection]{outline:0;top:0;bottom:0;right:0;left:0}:host [part~=selection] ::slotted(*){position:absolute}:host([disabled]){opacity:.4}' }}));
|
|
@@ -158,6 +158,17 @@
|
|
|
158
158
|
{
|
|
159
159
|
"name": "error-changed",
|
|
160
160
|
"description": "Fired when user inputs invalid value. The event is not triggered if `error` property is changed programmatically."
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"name": "step-up",
|
|
164
|
+
"description": "Fired when user acts value up on both pressing arrow up or tapping the spinner up. The event is not triggered if stepUp method is called programmatically."
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "step-down",
|
|
168
|
+
"description": "Fired when user acts value down on both pressing arrow down or tapping the spinner down. The event is not triggered if stepDown method is called programmatically."
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "input"
|
|
161
172
|
}
|
|
162
173
|
],
|
|
163
174
|
"methods": [
|
|
@@ -33,4 +33,7 @@ Form control element for numbers.
|
|
|
33
33
|
| Event | Description |
|
|
34
34
|
|-----------------|--------------------------------------------------|
|
|
35
35
|
| `error-changed` | Fired when user inputs invalid value. The event is not triggered if `error` property is changed programmatically. |
|
|
36
|
+
| `input` | |
|
|
37
|
+
| `step-down` | Fired when user acts value down on both pressing arrow down or tapping the spinner down. The event is not triggered if stepDown method is called programmatically. |
|
|
38
|
+
| `step-up` | Fired when user acts value up on both pressing arrow up or tapping the spinner up. The event is not triggered if stepUp method is called programmatically. |
|
|
36
39
|
| `value-changed` | Fired when user commits a value change. The event is not triggered if `value` property is changed programmatically. |
|
|
@@ -12,6 +12,8 @@ declare enum Direction {
|
|
|
12
12
|
*
|
|
13
13
|
* @fires value-changed - Fired when user commits a value change. The event is not triggered if `value` property is changed programmatically.
|
|
14
14
|
* @fires error-changed - Fired when user inputs invalid value. The event is not triggered if `error` property is changed programmatically.
|
|
15
|
+
* @fires step-up - Fired when user acts value up on both pressing arrow up or tapping the spinner up. The event is not triggered if stepUp method is called programmatically.
|
|
16
|
+
* @fires step-down - Fired when user acts value down on both pressing arrow down or tapping the spinner down. The event is not triggered if stepDown method is called programmatically.
|
|
15
17
|
*
|
|
16
18
|
* @attr {boolean} disabled - Set disabled state
|
|
17
19
|
* @prop {boolean} [disabled=false] - Set disabled state
|
|
@@ -150,6 +152,12 @@ export declare class NumberField extends FormFieldElement {
|
|
|
150
152
|
* @returns {void}
|
|
151
153
|
*/
|
|
152
154
|
protected onInputKeyDown(event: KeyboardEvent): void;
|
|
155
|
+
/**
|
|
156
|
+
* Trigger step-up or step-down event and return the event is cancelled
|
|
157
|
+
* @param direction Up or Down
|
|
158
|
+
* @returns {boolean} false if cancelled event. And true otherwise.
|
|
159
|
+
*/
|
|
160
|
+
private dispatchStepEvent;
|
|
153
161
|
/**
|
|
154
162
|
* Run when spinner has been tapped
|
|
155
163
|
* @param event tap event
|
|
@@ -17,6 +17,8 @@ var Direction;
|
|
|
17
17
|
*
|
|
18
18
|
* @fires value-changed - Fired when user commits a value change. The event is not triggered if `value` property is changed programmatically.
|
|
19
19
|
* @fires error-changed - Fired when user inputs invalid value. The event is not triggered if `error` property is changed programmatically.
|
|
20
|
+
* @fires step-up - Fired when user acts value up on both pressing arrow up or tapping the spinner up. The event is not triggered if stepUp method is called programmatically.
|
|
21
|
+
* @fires step-down - Fired when user acts value down on both pressing arrow down or tapping the spinner down. The event is not triggered if stepDown method is called programmatically.
|
|
20
22
|
*
|
|
21
23
|
* @attr {boolean} disabled - Set disabled state
|
|
22
24
|
* @prop {boolean} [disabled=false] - Set disabled state
|
|
@@ -251,6 +253,17 @@ let NumberField = class NumberField extends FormFieldElement {
|
|
|
251
253
|
}
|
|
252
254
|
event.preventDefault();
|
|
253
255
|
}
|
|
256
|
+
/**
|
|
257
|
+
* Trigger step-up or step-down event and return the event is cancelled
|
|
258
|
+
* @param direction Up or Down
|
|
259
|
+
* @returns {boolean} false if cancelled event. And true otherwise.
|
|
260
|
+
*/
|
|
261
|
+
dispatchStepEvent(direction) {
|
|
262
|
+
const eventName = direction === Direction.Up ? 'step-up' : 'step-down';
|
|
263
|
+
return this.dispatchEvent(new CustomEvent(eventName, {
|
|
264
|
+
cancelable: true
|
|
265
|
+
}));
|
|
266
|
+
}
|
|
254
267
|
/**
|
|
255
268
|
* Run when spinner has been tapped
|
|
256
269
|
* @param event tap event
|
|
@@ -274,13 +287,17 @@ let NumberField = class NumberField extends FormFieldElement {
|
|
|
274
287
|
* @returns {void}
|
|
275
288
|
*/
|
|
276
289
|
onApplyStep(direction) {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
290
|
+
const event = this.dispatchStepEvent(direction);
|
|
291
|
+
if (event) {
|
|
292
|
+
try {
|
|
293
|
+
this.applyStepDirection(direction);
|
|
294
|
+
this.dispatchEvent(new InputEvent('input'));
|
|
295
|
+
this.setSilentlyValueAndNotify();
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
// According to specs stepDown/stepUp may fail for some invalid inputs
|
|
299
|
+
// do nothing and report nothing in that case
|
|
300
|
+
}
|
|
284
301
|
}
|
|
285
302
|
}
|
|
286
303
|
/**
|
package/lib/slider/index.js
CHANGED
|
@@ -1209,7 +1209,6 @@ let Slider = class Slider extends ControlElement {
|
|
|
1209
1209
|
@blur=${this.onNumberFieldBlur}
|
|
1210
1210
|
@keydown=${this.onNumberFieldKeyDown}
|
|
1211
1211
|
@input=${this.onNumberFieldInput}
|
|
1212
|
-
@value-changed=${this.onNumberFieldInput}
|
|
1213
1212
|
part="input"
|
|
1214
1213
|
name="${name}"
|
|
1215
1214
|
no-spinner
|
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '7.
|
|
1
|
+
export const VERSION = '7.4.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refinitiv-ui/elements",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0",
|
|
4
4
|
"description": "Element Framework Elements",
|
|
5
5
|
"author": "Refinitiv",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -341,8 +341,8 @@
|
|
|
341
341
|
},
|
|
342
342
|
"dependencies": {
|
|
343
343
|
"@lit-labs/context": "^0.3.1",
|
|
344
|
-
"@refinitiv-ui/halo-theme": "^7.0
|
|
345
|
-
"@refinitiv-ui/solar-theme": "^7.0
|
|
344
|
+
"@refinitiv-ui/halo-theme": "^7.1.0",
|
|
345
|
+
"@refinitiv-ui/solar-theme": "^7.1.0",
|
|
346
346
|
"chart.js": "^4.3.0",
|
|
347
347
|
"chartjs-adapter-date-fns": "^3.0.0",
|
|
348
348
|
"d3-interpolate": "^3.0.1",
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
},
|
|
353
353
|
"devDependencies": {
|
|
354
354
|
"@refinitiv-ui/core": "^7.1.0",
|
|
355
|
-
"@refinitiv-ui/demo-block": "^7.0.
|
|
355
|
+
"@refinitiv-ui/demo-block": "^7.0.5",
|
|
356
356
|
"@refinitiv-ui/i18n": "^7.0.3",
|
|
357
357
|
"@refinitiv-ui/phrasebook": "^7.0.3",
|
|
358
358
|
"@refinitiv-ui/test-helpers": "^7.0.3",
|
|
@@ -371,5 +371,5 @@
|
|
|
371
371
|
"publishConfig": {
|
|
372
372
|
"access": "public"
|
|
373
373
|
},
|
|
374
|
-
"gitHead": "
|
|
374
|
+
"gitHead": "d220dde5331f239eb4d3ca99ed4972ff3d290f9a"
|
|
375
375
|
}
|