@refinitiv-ui/elements 6.10.1 → 6.11.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 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
+ # [6.11.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.10.2...@refinitiv-ui/elements@6.11.0) (2023-09-11)
7
+
8
+ ### Features
9
+
10
+ - **calendar:** custom cell content ([#930](https://github.com/Refinitiv/refinitiv-ui/issues/930)) ([781b9a8](https://github.com/Refinitiv/refinitiv-ui/commit/781b9a8a8718910a645267efbc4a8a9061ac4aa6))
11
+ - **number-field:** add new event step-up and step-down ([#910](https://github.com/Refinitiv/refinitiv-ui/issues/910)) ([3f42c66](https://github.com/Refinitiv/refinitiv-ui/commit/3f42c66bb1d73c4473d2e7bbfbe9df4295d5f720))
12
+
13
+ ## [6.10.2](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.10.1...@refinitiv-ui/elements@6.10.2) (2023-09-04)
14
+
15
+ ### Bug Fixes
16
+
17
+ - **number-field:** stepUp/stepDown not fire input event ([#925](https://github.com/Refinitiv/refinitiv-ui/issues/925)) ([cb2b994](https://github.com/Refinitiv/refinitiv-ui/commit/cb2b994dbdb0adf520f95f2a1239eab55024106f))
18
+
6
19
  ## [6.10.1](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.10.0...@refinitiv-ui/elements@6.10.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 | Description |
34
- |----------|--------------------------------------------------|
35
- | `footer` | Adds slotted content into the footer of the calendar control |
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` |
@@ -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 {
@@ -288,6 +289,12 @@ export declare class Calendar extends ControlElement implements MultiValue {
288
289
  * @returns {void}
289
290
  */
290
291
  private onKeyDown;
292
+ /**
293
+ * Get cell content from tap event
294
+ * @param event Keyboard event
295
+ * @returns html element
296
+ */
297
+ private getCellContent;
291
298
  /**
292
299
  * Run when tap event happens ot table.
293
300
  * Select the values or switch the view
@@ -28,6 +28,7 @@ import { ViewFormatTranslateParams, formatLocaleDate, monthInfo, monthsNames, we
28
28
  * @attr {boolean} disabled - Set disabled state
29
29
  * @prop {boolean} [disabled=false] - Set disabled state
30
30
  *
31
+ * @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`
31
32
  * @slot footer - Adds slotted content into the footer of the calendar control
32
33
  */
33
34
  let Calendar = class Calendar extends ControlElement {
@@ -623,6 +624,27 @@ let Calendar = class Calendar extends ControlElement {
623
624
  }
624
625
  event.preventDefault();
625
626
  }
627
+ /**
628
+ * Get cell content from tap event
629
+ * @param event Keyboard event
630
+ * @returns html element
631
+ */
632
+ getCellContent(event) {
633
+ const path = event.composedPath();
634
+ for (let i = 0; i <= path.length; i += 1) {
635
+ const node = path[i];
636
+ if (node === this) {
637
+ return null;
638
+ }
639
+ if (node.nodeType !== Node.ELEMENT_NODE) {
640
+ continue;
641
+ }
642
+ if (node.getAttribute('role') === 'button' && node.part.value.includes('cell-content')) {
643
+ return node;
644
+ }
645
+ }
646
+ return null;
647
+ }
626
648
  /**
627
649
  * Run when tap event happens ot table.
628
650
  * Select the values or switch the view
@@ -633,7 +655,7 @@ let Calendar = class Calendar extends ControlElement {
633
655
  if (event.defaultPrevented) {
634
656
  return;
635
657
  }
636
- const cell = event.target;
658
+ const cell = this.getCellContent(event);
637
659
  if (!cell || !this.isDateButton(cell) || !cell.value) {
638
660
  return;
639
661
  }
@@ -1140,6 +1162,7 @@ let Calendar = class Calendar extends ControlElement {
1140
1162
  const isSelectable = isSelection && !cell.disabled;
1141
1163
  const isSelected = cell.selected ? 'true' : 'false';
1142
1164
  const isActive = cell.active ? 0 : -1;
1165
+ const slotContent = cell.value ? html `<slot name=${cell.value}>${cell.text}</slot>` : cell.text;
1143
1166
  return html `<div
1144
1167
  role="gridcell"
1145
1168
  part="cell ${cell.view}"
@@ -1170,7 +1193,7 @@ let Calendar = class Calendar extends ControlElement {
1170
1193
  .value=${cell.value}
1171
1194
  .index=${cell.index}
1172
1195
  >
1173
- ${cell.text}
1196
+ ${slotContent}
1174
1197
  </div>
1175
1198
  </div>`;
1176
1199
  }
@@ -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;-ms-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;-ms-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;-ms-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;-ms-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;-ms-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;-ms-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;-ms-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;-ms-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
@@ -253,6 +255,17 @@ let NumberField = class NumberField extends FormFieldElement {
253
255
  }
254
256
  event.preventDefault();
255
257
  }
258
+ /**
259
+ * Trigger step-up or step-down event and return the event is cancelled
260
+ * @param direction Up or Down
261
+ * @returns {boolean} false if cancelled event. And true otherwise.
262
+ */
263
+ dispatchStepEvent(direction) {
264
+ const eventName = direction === Direction.Up ? 'step-up' : 'step-down';
265
+ return this.dispatchEvent(new CustomEvent(eventName, {
266
+ cancelable: true
267
+ }));
268
+ }
256
269
  /**
257
270
  * Run when spinner has been tapped
258
271
  * @param event tap event
@@ -276,13 +289,17 @@ let NumberField = class NumberField extends FormFieldElement {
276
289
  * @returns {void}
277
290
  */
278
291
  onApplyStep(direction) {
279
- try {
280
- this.applyStepDirection(direction);
281
- this.setSilentlyValueAndNotify();
282
- }
283
- catch (error) {
284
- // According to specs stepDown/stepUp may fail for some invalid inputs
285
- // do nothing and report nothing in that case
292
+ const event = this.dispatchStepEvent(direction);
293
+ if (event) {
294
+ try {
295
+ this.applyStepDirection(direction);
296
+ this.dispatchEvent(new InputEvent('input'));
297
+ this.setSilentlyValueAndNotify();
298
+ }
299
+ catch (error) {
300
+ // According to specs stepDown/stepUp may fail for some invalid inputs
301
+ // do nothing and report nothing in that case
302
+ }
286
303
  }
287
304
  }
288
305
  /**
@@ -1213,7 +1213,6 @@ let Slider = class Slider extends ControlElement {
1213
1213
  @blur=${this.onNumberFieldBlur}
1214
1214
  @keydown=${this.onNumberFieldKeyDown}
1215
1215
  @input=${this.onNumberFieldInput}
1216
- @value-changed=${this.onNumberFieldInput}
1217
1216
  part="input"
1218
1217
  name="${name}"
1219
1218
  no-spinner
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '6.10.1';
1
+ export const VERSION = '6.11.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refinitiv-ui/elements",
3
- "version": "6.10.1",
3
+ "version": "6.11.0",
4
4
  "description": "Element Framework Elements",
5
5
  "author": "Refinitiv",
6
6
  "license": "Apache-2.0",
@@ -339,8 +339,8 @@
339
339
  },
340
340
  "dependencies": {
341
341
  "@lit-labs/context": "^0.3.1",
342
- "@refinitiv-ui/halo-theme": "^6.5.8",
343
- "@refinitiv-ui/solar-theme": "^6.3.9",
342
+ "@refinitiv-ui/halo-theme": "^6.6.0",
343
+ "@refinitiv-ui/solar-theme": "^6.4.0",
344
344
  "@types/chart.js": "^2.9.31",
345
345
  "chart.js": "~2.9.4",
346
346
  "d3-interpolate": "^3.0.1",
@@ -350,7 +350,7 @@
350
350
  },
351
351
  "devDependencies": {
352
352
  "@refinitiv-ui/core": "^6.5.0",
353
- "@refinitiv-ui/demo-block": "^6.1.10",
353
+ "@refinitiv-ui/demo-block": "^6.1.11",
354
354
  "@refinitiv-ui/i18n": "^6.0.17",
355
355
  "@refinitiv-ui/phrasebook": "^6.3.6",
356
356
  "@refinitiv-ui/test-helpers": "^6.0.14",
@@ -369,5 +369,5 @@
369
369
  "publishConfig": {
370
370
  "access": "public"
371
371
  },
372
- "gitHead": "14f4b70dbd8dc19e883d3b646981bf5f43724e20"
372
+ "gitHead": "fc7e8d1a792bc0f33ccf70360397abb37f1e4e3a"
373
373
  }