@refinitiv-ui/elements 7.0.0 → 7.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.
Files changed (215) hide show
  1. package/CHANGELOG.md +195 -449
  2. package/LICENSE +2 -2
  3. package/README.md +12 -10
  4. package/cli.mjs +5 -3
  5. package/lib/accordion/index.d.ts +1 -1
  6. package/lib/accordion/index.js +4 -7
  7. package/lib/appstate-bar/index.d.ts +2 -2
  8. package/lib/appstate-bar/index.js +10 -4
  9. package/lib/autosuggest/index.d.ts +7 -7
  10. package/lib/autosuggest/index.js +80 -80
  11. package/lib/autosuggest/themes/solar/charcoal/index.js +1 -1
  12. package/lib/autosuggest/themes/solar/pearl/index.js +1 -1
  13. package/lib/button/index.js +7 -10
  14. package/lib/button-bar/index.d.ts +1 -1
  15. package/lib/button-bar/index.js +12 -12
  16. package/lib/calendar/index.d.ts +39 -39
  17. package/lib/calendar/index.js +156 -123
  18. package/lib/calendar/utils.js +1 -1
  19. package/lib/canvas/index.d.ts +1 -1
  20. package/lib/canvas/index.js +2 -4
  21. package/lib/card/helpers/types.d.ts +2 -2
  22. package/lib/card/index.d.ts +5 -5
  23. package/lib/card/index.js +34 -28
  24. package/lib/chart/elements/chart.d.ts +4 -4
  25. package/lib/chart/elements/chart.js +39 -33
  26. package/lib/chart/plugins/doughnut-center-label.d.ts +3 -3
  27. package/lib/chart/plugins/doughnut-center-label.js +13 -9
  28. package/lib/checkbox/index.d.ts +1 -1
  29. package/lib/checkbox/index.js +12 -13
  30. package/lib/clock/index.d.ts +55 -55
  31. package/lib/clock/index.js +84 -95
  32. package/lib/clock/themes/halo/dark/index.js +1 -1
  33. package/lib/clock/themes/halo/light/index.js +1 -1
  34. package/lib/clock/themes/solar/charcoal/index.js +1 -1
  35. package/lib/clock/themes/solar/pearl/index.js +1 -1
  36. package/lib/collapse/index.d.ts +1 -1
  37. package/lib/collapse/index.js +27 -18
  38. package/lib/collapse/themes/halo/dark/index.js +1 -1
  39. package/lib/collapse/themes/halo/light/index.js +1 -1
  40. package/lib/color-dialog/elements/color-palettes.d.ts +1 -1
  41. package/lib/color-dialog/elements/color-palettes.js +5 -6
  42. package/lib/color-dialog/elements/grayscale-palettes.d.ts +1 -1
  43. package/lib/color-dialog/elements/grayscale-palettes.js +9 -9
  44. package/lib/color-dialog/elements/palettes.js +5 -4
  45. package/lib/color-dialog/helpers/value-model.js +7 -9
  46. package/lib/color-dialog/index.d.ts +6 -6
  47. package/lib/color-dialog/index.js +53 -37
  48. package/lib/color-picker/index.d.ts +2 -2
  49. package/lib/color-picker/index.js +40 -34
  50. package/lib/combo-box/helpers/filter.d.ts +2 -2
  51. package/lib/combo-box/helpers/types.d.ts +1 -1
  52. package/lib/combo-box/index.d.ts +9 -9
  53. package/lib/combo-box/index.js +61 -55
  54. package/lib/configuration/elements/configuration.js +2 -2
  55. package/lib/counter/index.d.ts +4 -4
  56. package/lib/counter/index.js +9 -7
  57. package/lib/datetime-field/index.d.ts +4 -5
  58. package/lib/datetime-field/index.js +32 -23
  59. package/lib/datetime-field/utils.js +11 -1
  60. package/lib/datetime-picker/index.d.ts +75 -75
  61. package/lib/datetime-picker/index.js +150 -131
  62. package/lib/datetime-picker/locales.js +5 -5
  63. package/lib/datetime-picker/utils.js +9 -9
  64. package/lib/dialog/draggable-element.js +1 -2
  65. package/lib/dialog/index.d.ts +5 -5
  66. package/lib/dialog/index.js +51 -47
  67. package/lib/email-field/index.d.ts +1 -1
  68. package/lib/email-field/index.js +6 -6
  69. package/lib/events.d.ts +1 -1
  70. package/lib/flag/index.d.ts +1 -1
  71. package/lib/flag/index.js +6 -5
  72. package/lib/flag/utils/FlagLoader.js +1 -1
  73. package/lib/header/index.d.ts +1 -1
  74. package/lib/header/index.js +2 -2
  75. package/lib/header/themes/halo/dark/index.js +1 -1
  76. package/lib/header/themes/halo/light/index.js +1 -1
  77. package/lib/header/themes/solar/charcoal/index.js +1 -1
  78. package/lib/header/themes/solar/pearl/index.js +1 -1
  79. package/lib/heatmap/helpers/color.d.ts +1 -1
  80. package/lib/heatmap/helpers/color.js +11 -5
  81. package/lib/heatmap/helpers/track.js +3 -3
  82. package/lib/heatmap/index.d.ts +9 -9
  83. package/lib/heatmap/index.js +51 -42
  84. package/lib/icon/index.d.ts +2 -2
  85. package/lib/icon/index.js +8 -10
  86. package/lib/interactive-chart/helpers/types.d.ts +3 -3
  87. package/lib/interactive-chart/index.d.ts +29 -29
  88. package/lib/interactive-chart/index.js +69 -55
  89. package/lib/item/helpers/types.d.ts +1 -1
  90. package/lib/item/index.d.ts +3 -3
  91. package/lib/item/index.js +24 -20
  92. package/lib/jsx.d.ts +6 -4
  93. package/lib/label/index.d.ts +1 -1
  94. package/lib/label/index.js +10 -7
  95. package/lib/layout/index.d.ts +7 -7
  96. package/lib/layout/index.js +7 -7
  97. package/lib/led-gauge/index.d.ts +1 -1
  98. package/lib/led-gauge/index.js +10 -10
  99. package/lib/list/elements/list.d.ts +3 -3
  100. package/lib/list/elements/list.js +10 -12
  101. package/lib/list/helpers/renderer.js +2 -2
  102. package/lib/list/helpers/types.d.ts +1 -1
  103. package/lib/list/index.d.ts +1 -1
  104. package/lib/list/renderer.d.ts +7 -7
  105. package/lib/loader/index.js +7 -8
  106. package/lib/multi-input/index.d.ts +6 -6
  107. package/lib/multi-input/index.js +39 -45
  108. package/lib/notification/elements/notification-tray.d.ts +2 -2
  109. package/lib/notification/elements/notification-tray.js +3 -3
  110. package/lib/notification/elements/notification.d.ts +2 -2
  111. package/lib/notification/elements/notification.js +14 -13
  112. package/lib/notification/helpers/status.js +1 -1
  113. package/lib/notification/themes/halo/dark/index.js +1 -1
  114. package/lib/notification/themes/halo/light/index.js +1 -1
  115. package/lib/notification/themes/solar/charcoal/index.js +1 -1
  116. package/lib/notification/themes/solar/pearl/index.js +1 -1
  117. package/lib/number-field/index.d.ts +5 -6
  118. package/lib/number-field/index.js +37 -47
  119. package/lib/overlay/elements/overlay-viewport.d.ts +1 -1
  120. package/lib/overlay/elements/overlay.d.ts +2 -2
  121. package/lib/overlay/elements/overlay.js +152 -96
  122. package/lib/overlay/helpers/types.d.ts +1 -1
  123. package/lib/overlay/managers/backdrop-manager.d.ts +1 -1
  124. package/lib/overlay/managers/backdrop-manager.js +2 -2
  125. package/lib/overlay/managers/close-manager.js +2 -1
  126. package/lib/overlay/managers/focus-manager.js +23 -13
  127. package/lib/overlay/managers/interaction-lock-manager.d.ts +4 -4
  128. package/lib/overlay/managers/interaction-lock-manager.js +33 -25
  129. package/lib/overlay/managers/viewport-manager.d.ts +2 -2
  130. package/lib/overlay/managers/viewport-manager.js +3 -2
  131. package/lib/overlay/managers/zindex-manager.js +4 -2
  132. package/lib/overlay-menu/helpers/types.d.ts +2 -2
  133. package/lib/overlay-menu/index.d.ts +1 -1
  134. package/lib/overlay-menu/index.js +44 -33
  135. package/lib/overlay-menu/managers/menu-manager.d.ts +10 -10
  136. package/lib/overlay-menu/managers/menu-manager.js +14 -13
  137. package/lib/pagination/index.d.ts +4 -4
  138. package/lib/pagination/index.js +39 -14
  139. package/lib/panel/index.js +1 -1
  140. package/lib/password-field/index.d.ts +2 -2
  141. package/lib/password-field/index.js +3 -3
  142. package/lib/pill/index.d.ts +1 -1
  143. package/lib/pill/index.js +22 -19
  144. package/lib/progress-bar/index.d.ts +1 -1
  145. package/lib/progress-bar/index.js +38 -37
  146. package/lib/radio-button/index.d.ts +2 -2
  147. package/lib/radio-button/index.js +17 -12
  148. package/lib/radio-button/radio-button-registry.js +8 -5
  149. package/lib/rating/index.d.ts +1 -1
  150. package/lib/rating/index.js +2 -5
  151. package/lib/rating/utils.d.ts +6 -6
  152. package/lib/rating/utils.js +6 -6
  153. package/lib/search-field/index.d.ts +2 -2
  154. package/lib/search-field/index.js +4 -4
  155. package/lib/select/index.d.ts +34 -34
  156. package/lib/select/index.js +68 -81
  157. package/lib/sidebar-layout/index.d.ts +2 -2
  158. package/lib/sidebar-layout/index.js +7 -9
  159. package/lib/slider/index.d.ts +2 -2
  160. package/lib/slider/index.js +57 -45
  161. package/lib/slider/utils.d.ts +10 -10
  162. package/lib/slider/utils.js +10 -10
  163. package/lib/sparkline/index.d.ts +1 -1
  164. package/lib/sparkline/index.js +7 -8
  165. package/lib/swing-gauge/helpers.js +2 -2
  166. package/lib/swing-gauge/index.d.ts +19 -19
  167. package/lib/swing-gauge/index.js +91 -81
  168. package/lib/tab/index.d.ts +1 -1
  169. package/lib/tab/index.js +16 -27
  170. package/lib/tab/themes/halo/dark/index.js +1 -1
  171. package/lib/tab/themes/halo/light/index.js +1 -1
  172. package/lib/tab/themes/solar/charcoal/index.js +1 -1
  173. package/lib/tab/themes/solar/pearl/index.js +1 -1
  174. package/lib/tab-bar/helpers/animate.js +1 -1
  175. package/lib/tab-bar/index.d.ts +1 -1
  176. package/lib/tab-bar/index.js +34 -18
  177. package/lib/tab-bar/themes/halo/dark/index.js +1 -1
  178. package/lib/tab-bar/themes/halo/light/index.js +1 -1
  179. package/lib/text-field/index.d.ts +1 -1
  180. package/lib/text-field/index.js +34 -31
  181. package/lib/time-picker/index.d.ts +6 -6
  182. package/lib/time-picker/index.js +103 -89
  183. package/lib/toggle/index.d.ts +1 -1
  184. package/lib/toggle/index.js +4 -3
  185. package/lib/toggle/themes/halo/dark/index.js +1 -1
  186. package/lib/toggle/themes/halo/light/index.js +1 -1
  187. package/lib/toggle/themes/solar/charcoal/index.js +1 -1
  188. package/lib/toggle/themes/solar/pearl/index.js +1 -1
  189. package/lib/tooltip/elements/title-tooltip.js +2 -2
  190. package/lib/tooltip/index.d.ts +27 -27
  191. package/lib/tooltip/index.js +42 -38
  192. package/lib/tooltip/managers/tooltip-manager.d.ts +1 -1
  193. package/lib/tornado-chart/elements/tornado-chart.d.ts +1 -1
  194. package/lib/tornado-chart/elements/tornado-chart.js +2 -2
  195. package/lib/tornado-chart/elements/tornado-item.d.ts +2 -2
  196. package/lib/tornado-chart/elements/tornado-item.js +12 -10
  197. package/lib/tree/elements/tree-item.d.ts +3 -3
  198. package/lib/tree/elements/tree-item.js +21 -19
  199. package/lib/tree/elements/tree.d.ts +1 -1
  200. package/lib/tree/elements/tree.js +12 -11
  201. package/lib/tree/helpers/renderer.js +4 -3
  202. package/lib/tree/index.d.ts +1 -1
  203. package/lib/tree/managers/tree-manager.d.ts +1 -1
  204. package/lib/tree/managers/tree-manager.js +17 -18
  205. package/lib/tree/themes/solar/charcoal/index.js +1 -1
  206. package/lib/tree/themes/solar/pearl/index.js +1 -1
  207. package/lib/tree-select/index.d.ts +9 -9
  208. package/lib/tree-select/index.js +91 -82
  209. package/lib/tree-select/themes/halo/dark/index.js +1 -1
  210. package/lib/tree-select/themes/halo/light/index.js +1 -1
  211. package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
  212. package/lib/tree-select/themes/solar/pearl/index.js +1 -1
  213. package/lib/version.js +1 -1
  214. package/package.json +17 -17
  215. package/tsconfig.tsbuildinfo +1 -1
@@ -1,3 +1,3 @@
1
1
  import '@refinitiv-ui/elements/icon/themes/solar/charcoal';
2
2
  dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-notification-tray', styles: ':host{--max:1;--default-timeout:5000;display:flex;flex-flow:column nowrap;justify-content:flex-end}:host([attach]){position:fixed;z-index:100000}:host([attach=top]){top:0;left:0;right:0}:host([attach=right]){top:0;right:0;bottom:0}:host([attach=bottom]){left:0;right:0;bottom:0}:host([attach=left]){top:0;left:0;bottom:0}' }}));
3
- dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-notification', styles: ':host{touch-action:manipulation;perspective:2000px;position:relative;height:var(--bar-height,3em);overflow:hidden;display:flex;align-items:center;text-align:center;color:var(--color,#c2c2c2);animation:.4s forwards notification-open;--bar-height:30px;--background-color:#295e8c;color:#fff}:host [part=container]{height:var(--bar-height,3em);width:100%;position:relative;overflow:hidden;box-sizing:border-box;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:6px 27px 6px 10px;background-color:var(--background-color,#19aaee);animation:.4s notification-container-open}:host [part=container]::before{content:\'\';display:block;position:absolute;top:0;right:0;bottom:0;width:3em;opacity:0;transition:opacity .2s;color:var(--background-color,#19aaee);background:currentColor;box-shadow:0 0 1em 1em currentColor}:host [part=content]{width:100%;text-align:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host [part=clear]{touch-action:manipulation;margin:auto;display:block;position:absolute;top:0;bottom:0;opacity:0;transition:opacity .2s;right:.5em;width:16px;height:16px;stroke-width:1.5px;opacity:1}:host(:hover) [part=clear],:host(:hover) [part=container]::before{opacity:1}:host([confirm]){--background-color:#2ec57e;--background-color:#237843}:host([warning]){--background-color:#FF9933;--background-color:#cc7f33}:host([error]){--background-color:#F5475B;--background-color:#a8313f}:host([collapsed]){animation-fill-mode:forwards;animation-name:notification-close}:host([collapsed]) [part=container]{animation-name:notification-container-close}:host([collapsed]) [part=clear],:host([collapsed]) [part=container]::before{opacity:0}@keyframes notification-open{from{height:0}to{height:var(--bar-height,3em)}}@keyframes notification-close{from{height:var(--bar-height,3em)}to{height:0}}@keyframes notification-container-open{0%{opacity:.1;transform:rotateX(-90deg)}100%,80%,90%{opacity:1;transform:rotateX(0)}}@keyframes notification-container-close{from{opacity:1;transform:rotateX(0)}to{transform:rotateX(90deg)}}:host [part=content] ::slotted(a){color:inherit!important;text-decoration:underline!important}:host [part=content] ::slotted(a:hover){cursor:pointer!important;text-decoration-color:inherit!important}' }}));
3
+ dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-notification', styles: ':host{touch-action:manipulation;perspective:2000px;position:relative;height:var(--bar-height,3em);overflow:hidden;display:flex;align-items:center;text-align:center;color:var(--color,#c2c2c2);animation:.4s forwards notification-open;-webkit-user-select:none;-moz-user-select:none;user-select:none;--bar-height:30px;--background-color:#295e8c;color:#fff}:host [part=container]{height:var(--bar-height,3em);width:100%;position:relative;overflow:hidden;box-sizing:border-box;display:flex;align-items:center;justify-content:center;padding:6px 27px 6px 10px;background-color:var(--background-color,#19aaee);animation:.4s notification-container-open}:host [part=container]::before{content:\'\';display:block;position:absolute;top:0;right:0;bottom:0;width:3em;opacity:0;transition:opacity .2s;color:var(--background-color,#19aaee);background:currentColor;box-shadow:0 0 1em 1em currentColor}:host [part=content]{width:100%;text-align:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host [part=clear]{touch-action:manipulation;margin:auto;display:block;position:absolute;top:0;bottom:0;opacity:0;transition:opacity .2s;right:.5em;width:16px;height:16px;stroke-width:1.5px;opacity:1}:host(:hover) [part=clear],:host(:hover) [part=container]::before{opacity:1}:host([confirm]){--background-color:#2ec57e;--background-color:#237843}:host([warning]){--background-color:#FF9933;--background-color:#cc7f33}:host([error]){--background-color:#F5475B;--background-color:#a8313f}:host([collapsed]){animation-fill-mode:forwards;animation-name:notification-close}:host([collapsed]) [part=container]{animation-name:notification-container-close}:host([collapsed]) [part=clear],:host([collapsed]) [part=container]::before{opacity:0}@keyframes notification-open{from{height:0}to{height:var(--bar-height,3em)}}@keyframes notification-close{from{height:var(--bar-height,3em)}to{height:0}}@keyframes notification-container-open{0%{opacity:.1;transform:rotateX(-90deg)}100%,80%,90%{opacity:1;transform:rotateX(0)}}@keyframes notification-container-close{from{opacity:1;transform:rotateX(0)}to{transform:rotateX(90deg)}}:host [part=content] ::slotted(a){color:inherit!important;text-decoration:underline!important}:host [part=content] ::slotted(a:hover){cursor:pointer!important;text-decoration-color:inherit!important}' }}));
@@ -1,3 +1,3 @@
1
1
  import '@refinitiv-ui/elements/icon/themes/solar/pearl';
2
2
  dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-notification-tray', styles: ':host{--max:1;--default-timeout:5000;display:flex;flex-flow:column nowrap;justify-content:flex-end}:host([attach]){position:fixed;z-index:100000}:host([attach=top]){top:0;left:0;right:0}:host([attach=right]){top:0;right:0;bottom:0}:host([attach=bottom]){left:0;right:0;bottom:0}:host([attach=left]){top:0;left:0;bottom:0}' }}));
3
- dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-notification', styles: ':host{touch-action:manipulation;perspective:2000px;position:relative;height:var(--bar-height,3em);overflow:hidden;display:flex;align-items:center;text-align:center;color:var(--color,#505050);animation:.4s forwards notification-open;--bar-height:30px;--background-color:#295e8c;color:#fff}:host [part=container]{height:var(--bar-height,3em);width:100%;position:relative;overflow:hidden;box-sizing:border-box;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:6px 27px 6px 10px;background-color:var(--background-color,#19aaee);animation:.4s notification-container-open}:host [part=container]::before{content:\'\';display:block;position:absolute;top:0;right:0;bottom:0;width:3em;opacity:0;transition:opacity .2s;color:var(--background-color,#19aaee);background:currentColor;box-shadow:0 0 1em 1em currentColor}:host [part=content]{width:100%;text-align:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host [part=clear]{touch-action:manipulation;margin:auto;display:block;position:absolute;top:0;bottom:0;opacity:0;transition:opacity .2s;right:.5em;width:16px;height:16px;stroke-width:1.5px;opacity:1}:host(:hover) [part=clear],:host(:hover) [part=container]::before{opacity:1}:host([confirm]){--background-color:#2ec57e;--background-color:#237843}:host([warning]){--background-color:#FF9933;--background-color:#cc7f33}:host([error]){--background-color:#D94255;--background-color:#a8313f}:host([collapsed]){animation-fill-mode:forwards;animation-name:notification-close}:host([collapsed]) [part=container]{animation-name:notification-container-close}:host([collapsed]) [part=clear],:host([collapsed]) [part=container]::before{opacity:0}@keyframes notification-open{from{height:0}to{height:var(--bar-height,3em)}}@keyframes notification-close{from{height:var(--bar-height,3em)}to{height:0}}@keyframes notification-container-open{0%{opacity:.1;transform:rotateX(-90deg)}100%,80%,90%{opacity:1;transform:rotateX(0)}}@keyframes notification-container-close{from{opacity:1;transform:rotateX(0)}to{transform:rotateX(90deg)}}:host [part=content] ::slotted(a){color:inherit!important;text-decoration:underline!important}:host [part=content] ::slotted(a:hover){cursor:pointer!important;text-decoration-color:inherit!important}' }}));
3
+ dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-notification', styles: ':host{touch-action:manipulation;perspective:2000px;position:relative;height:var(--bar-height,3em);overflow:hidden;display:flex;align-items:center;text-align:center;color:var(--color,#505050);animation:.4s forwards notification-open;-webkit-user-select:none;-moz-user-select:none;user-select:none;--bar-height:30px;--background-color:#295e8c;color:#fff}:host [part=container]{height:var(--bar-height,3em);width:100%;position:relative;overflow:hidden;box-sizing:border-box;display:flex;align-items:center;justify-content:center;padding:6px 27px 6px 10px;background-color:var(--background-color,#19aaee);animation:.4s notification-container-open}:host [part=container]::before{content:\'\';display:block;position:absolute;top:0;right:0;bottom:0;width:3em;opacity:0;transition:opacity .2s;color:var(--background-color,#19aaee);background:currentColor;box-shadow:0 0 1em 1em currentColor}:host [part=content]{width:100%;text-align:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host [part=clear]{touch-action:manipulation;margin:auto;display:block;position:absolute;top:0;bottom:0;opacity:0;transition:opacity .2s;right:.5em;width:16px;height:16px;stroke-width:1.5px;opacity:1}:host(:hover) [part=clear],:host(:hover) [part=container]::before{opacity:1}:host([confirm]){--background-color:#2ec57e;--background-color:#237843}:host([warning]){--background-color:#FF9933;--background-color:#cc7f33}:host([error]){--background-color:#D94255;--background-color:#a8313f}:host([collapsed]){animation-fill-mode:forwards;animation-name:notification-close}:host([collapsed]) [part=container]{animation-name:notification-container-close}:host([collapsed]) [part=clear],:host([collapsed]) [part=container]::before{opacity:0}@keyframes notification-open{from{height:0}to{height:var(--bar-height,3em)}}@keyframes notification-close{from{height:var(--bar-height,3em)}to{height:0}}@keyframes notification-container-open{0%{opacity:.1;transform:rotateX(-90deg)}100%,80%,90%{opacity:1;transform:rotateX(0)}}@keyframes notification-container-close{from{opacity:1;transform:rotateX(0)}to{transform:rotateX(90deg)}}:host [part=content] ::slotted(a){color:inherit!important;text-decoration:underline!important}:host [part=content] ::slotted(a:hover){cursor:pointer!important;text-decoration-color:inherit!important}' }}));
@@ -1,5 +1,5 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { FormFieldElement, CSSResultGroup, TemplateResult, PropertyValues, TapEvent } from '@refinitiv-ui/core';
2
+ import { CSSResultGroup, FormFieldElement, PropertyValues, TapEvent, TemplateResult } from '@refinitiv-ui/core';
3
3
  import { TemplateMap } from '@refinitiv-ui/core/directives/template-map.js';
4
4
  import '../icon/index.js';
5
5
  type SelectionDirection = 'forward' | 'backward' | 'none';
@@ -67,10 +67,10 @@ export declare class NumberField extends FormFieldElement {
67
67
  max: string | null;
68
68
  private interimValueState;
69
69
  /**
70
- * The value of the number entered into the input.
71
- * @param value number-field value
72
- * @default -
73
- */
70
+ * The value of the number entered into the input.
71
+ * @param value number-field value
72
+ * @default -
73
+ */
74
74
  set value(value: string);
75
75
  get value(): string;
76
76
  /**
@@ -313,7 +313,6 @@ export declare class NumberField extends FormFieldElement {
313
313
  * type="text" - always `text`
314
314
  * part="input" - always "input", used for styling
315
315
  * inputmode="decimal" - show decimals keyboard by default
316
- * pattern="'^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$'" - numbers only
317
316
  * role="spinbutton" - number field is actually a spinner
318
317
  * aria-valuenow - current value or 0
319
318
  * @keydown - Listener for `keydown` event. Runs `this.onInputKeyDown`
@@ -1,11 +1,10 @@
1
1
  import { __decorate } from "tslib";
2
- import { FormFieldElement, html, css, FocusedPropertyKey } from '@refinitiv-ui/core';
2
+ import { FocusedPropertyKey, FormFieldElement, css, html } from '@refinitiv-ui/core';
3
3
  import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
4
  import { property } from '@refinitiv-ui/core/decorators/property.js';
5
5
  import { query } from '@refinitiv-ui/core/decorators/query.js';
6
- import { VERSION } from '../version.js';
7
6
  import '../icon/index.js';
8
- const NUMBER_PATTERN = '^[\\-\\+]?[0-9]*\\.?[0-9]+([eE][\\-\\+]?[0-9]+)?$';
7
+ import { VERSION } from '../version.js';
9
8
  const DEFAULT_STEP_BASE = 1;
10
9
  const ANY_STEP = 'any';
11
10
  var Direction;
@@ -81,41 +80,43 @@ let NumberField = class NumberField extends FormFieldElement {
81
80
  :host {
82
81
  display: inline-block;
83
82
  }
84
- :host(:focus), :host input:focus {
83
+ :host(:focus),
84
+ :host input:focus {
85
85
  outline: none;
86
86
  }
87
87
  :host([transparent]) {
88
88
  background: none !important;
89
89
  border: none !important;
90
90
  }
91
- [part=input] {
91
+ [part='input'] {
92
92
  font: inherit;
93
93
  background: none;
94
94
  color: currentColor;
95
95
  border: none;
96
96
  text-align: inherit;
97
97
  }
98
- [part=spinner]{
98
+ [part='spinner'] {
99
99
  display: flex;
100
100
  flex-direction: column;
101
101
  }
102
- [part=spinner-up], [part=spinner-down] {
102
+ [part='spinner-up'],
103
+ [part='spinner-down'] {
103
104
  display: flex;
104
105
  height: 50%;
105
106
  cursor: pointer;
106
107
  user-select: none;
107
108
  }
108
- [part^=spinner][disabled],
109
- [part^=spinner][readonly] {
109
+ [part^='spinner'][disabled],
110
+ [part^='spinner'][readonly] {
110
111
  cursor: default;
111
112
  }
112
113
  `;
113
114
  }
114
115
  /**
115
- * The value of the number entered into the input.
116
- * @param value number-field value
117
- * @default -
118
- */
116
+ * The value of the number entered into the input.
117
+ * @param value number-field value
118
+ * @default -
119
+ */
119
120
  set value(value) {
120
121
  this.interimValueState = true;
121
122
  super.value = value;
@@ -194,7 +195,7 @@ let NumberField = class NumberField extends FormFieldElement {
194
195
  if (Math.floor(value) === value || isNaN(value) || !isFinite(value)) {
195
196
  return 0;
196
197
  }
197
- return new Intl.NumberFormat('en', { minimumSignificantDigits: 1 }).format(value).split('.')[1].length || 0;
198
+ return (new Intl.NumberFormat('en', { minimumSignificantDigits: 1 }).format(value).split('.')[1].length || 0);
198
199
  }
199
200
  /**
200
201
  * Get number of decimals based on step base and allowed value step
@@ -304,7 +305,9 @@ let NumberField = class NumberField extends FormFieldElement {
304
305
  const selectionEnd = inputEl.selectionEnd || 0;
305
306
  const newInput = `${oldInput.substring(0, selectionStart)}${data}${oldInput.substring(selectionEnd)}`;
306
307
  const validatedInput = this.stripeInvalidCharacters(newInput, oldInput, data);
307
- const insertionData = validatedInput.slice(0, validatedInput.length - (oldInput.length - selectionEnd)).substring(selectionStart);
308
+ const insertionData = validatedInput
309
+ .slice(0, validatedInput.length - (oldInput.length - selectionEnd))
310
+ .substring(selectionStart);
308
311
  // Invalid characters or sequence of characters
309
312
  if (!insertionData.length) {
310
313
  event.preventDefault();
@@ -378,18 +381,18 @@ let NumberField = class NumberField extends FormFieldElement {
378
381
  if (dotIndex !== -1) {
379
382
  input = `${input.substring(0, dotIndex + 1)}${input.substring(dotIndex + 1).replace(/\./g, '')}`;
380
383
  if (!valueHasE) {
381
- input = `${input.substring(0, dotIndex).replace(/e/ig, '')}${input.substring(dotIndex)}`;
384
+ input = `${input.substring(0, dotIndex).replace(/e/gi, '')}${input.substring(dotIndex)}`;
382
385
  }
383
386
  }
384
387
  // stripe all dots after e and multiple e occurrences
385
388
  if (eIndex !== -1) {
386
- input = `${input.substring(0, eIndex + 1)}${input.substring(eIndex + 1).replace(/e/ig, '')}`;
389
+ input = `${input.substring(0, eIndex + 1)}${input.substring(eIndex + 1).replace(/e/gi, '')}`;
387
390
  if (!valueHasDot) {
388
391
  input = `${input.substring(0, eIndex)}${input.substring(eIndex).replace(/\./g, '')}`;
389
392
  }
390
393
  }
391
394
  // stripe all other invalid characters and make sure that + and - signs are correct
392
- return input.replace(/(^[-+]|[e][-+])|[-+]|[^0-9e.+-]/ig, '$1');
395
+ return input.replace(/(^[-+]|[e][-+])|[-+]|[^0-9e.+-]/gi, '$1');
393
396
  }
394
397
  /**
395
398
  * On *user-interaction* set the value and notify.
@@ -498,7 +501,7 @@ let NumberField = class NumberField extends FormFieldElement {
498
501
  */
499
502
  findNearestSteppedValue(value, stepBase, allowedValueStep, direction) {
500
503
  // TODO: there is probably much better way on how to implement this function
501
- let newValue = this.toFixedNumber(value + (stepBase - value) % allowedValueStep);
504
+ let newValue = this.toFixedNumber(value + ((stepBase - value) % allowedValueStep));
502
505
  if (direction === Direction.Up) {
503
506
  // with float number rounding this may need to run more than once to find the valid value
504
507
  while (newValue <= value) {
@@ -575,7 +578,9 @@ let NumberField = class NumberField extends FormFieldElement {
575
578
  }
576
579
  // If either the method invoked was the stepDown() method and value is greater than valueBeforeStepping
577
580
  // or the method invoked was the stepUp() method and value is less than valueBeforeStepping, then return.
578
- if (!isNaN(inputValue) && ((direction === Direction.Up && value < valueBeforeStepping) || (direction === Direction.Down && value > valueBeforeStepping))) {
581
+ if (!isNaN(inputValue) &&
582
+ ((direction === Direction.Up && value < valueBeforeStepping) ||
583
+ (direction === Direction.Down && value > valueBeforeStepping))) {
579
584
  return;
580
585
  }
581
586
  this.inputValue = String(value);
@@ -650,7 +655,7 @@ let NumberField = class NumberField extends FormFieldElement {
650
655
  */
651
656
  /* c8 ignore start */
652
657
  set selectionStart(index) {
653
- throw new Error('Failed to set the \'selectionStart\' property on \'NumberField\': The element does not support selection.');
658
+ throw new Error("Failed to set the 'selectionStart' property on 'NumberField': The element does not support selection.");
654
659
  }
655
660
  /* c8 ignore stop */
656
661
  /**
@@ -668,7 +673,7 @@ let NumberField = class NumberField extends FormFieldElement {
668
673
  */
669
674
  /* c8 ignore start */
670
675
  set selectionEnd(index) {
671
- throw new Error('Failed to set the \'selectionEnd\' property on \'NumberField\': The element does not support selection.');
676
+ throw new Error("Failed to set the 'selectionEnd' property on 'NumberField': The element does not support selection.");
672
677
  }
673
678
  /* c8 ignore stop */
674
679
  /**
@@ -686,7 +691,7 @@ let NumberField = class NumberField extends FormFieldElement {
686
691
  */
687
692
  /* c8 ignore start */
688
693
  set selectionDirection(direction) {
689
- throw new Error('Failed to set the \'selectionDirection\' property on \'NumberField\': The element does not support selection.');
694
+ throw new Error("Failed to set the 'selectionDirection' property on 'NumberField': The element does not support selection.");
690
695
  }
691
696
  /* c8 ignore stop */
692
697
  /**
@@ -696,7 +701,7 @@ let NumberField = class NumberField extends FormFieldElement {
696
701
  /* c8 ignore start */
697
702
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
698
703
  setSelectionRange(startSelection, endSelection, selectionDirection) {
699
- throw new Error('Failed to execute \'setSelectionRange\' on \'NumberField\': The element does not support selection.');
704
+ throw new Error("Failed to execute 'setSelectionRange' on 'NumberField': The element does not support selection.");
700
705
  }
701
706
  /* c8 ignore stop */
702
707
  /**
@@ -705,20 +710,9 @@ let NumberField = class NumberField extends FormFieldElement {
705
710
  */
706
711
  renderSpinner() {
707
712
  return html `
708
- <div
709
- part="spinner"
710
- @tap=${this.onSpinnerTap}>
711
- <ef-icon
712
- icon="up"
713
- part="spinner-up"
714
- ?readonly=${this.readonly}
715
- ?disabled=${this.disabled}>
716
- </ef-icon>
717
- <ef-icon
718
- icon="down"
719
- part="spinner-down"
720
- ?readonly=${this.readonly}
721
- ?disabled=${this.disabled}>
713
+ <div part="spinner" @tap=${this.onSpinnerTap}>
714
+ <ef-icon icon="up" part="spinner-up" ?readonly=${this.readonly} ?disabled=${this.disabled}> </ef-icon>
715
+ <ef-icon icon="down" part="spinner-down" ?readonly=${this.readonly} ?disabled=${this.disabled}>
722
716
  </ef-icon>
723
717
  </div>
724
718
  `;
@@ -728,7 +722,6 @@ let NumberField = class NumberField extends FormFieldElement {
728
722
  * type="text" - always `text`
729
723
  * part="input" - always "input", used for styling
730
724
  * inputmode="decimal" - show decimals keyboard by default
731
- * pattern="'^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$'" - numbers only
732
725
  * role="spinbutton" - number field is actually a spinner
733
726
  * aria-valuenow - current value or 0
734
727
  * @keydown - Listener for `keydown` event. Runs `this.onInputKeyDown`
@@ -738,11 +731,10 @@ let NumberField = class NumberField extends FormFieldElement {
738
731
  get decorateInputMap() {
739
732
  return {
740
733
  ...super.decorateInputMap,
741
- 'type': 'text',
742
- 'part': 'input',
743
- 'inputmode': 'decimal',
744
- 'pattern': NUMBER_PATTERN,
745
- 'role': 'spinbutton',
734
+ type: 'text',
735
+ part: 'input',
736
+ inputmode: 'decimal',
737
+ role: 'spinbutton',
746
738
  'aria-valuenow': `${this.value || 0}`,
747
739
  '@keydown': this.onInputKeyDown,
748
740
  '@beforeinput': this.onBeforeInputChange
@@ -754,9 +746,7 @@ let NumberField = class NumberField extends FormFieldElement {
754
746
  * @return {TemplateResult} Render template
755
747
  */
756
748
  render() {
757
- return html `
758
- ${super.render()}
759
- ${this.noSpinner ? null : this.renderSpinner()}`;
749
+ return html ` ${super.render()} ${this.noSpinner ? null : this.renderSpinner()}`;
760
750
  }
761
751
  };
762
752
  __decorate([
@@ -1,5 +1,5 @@
1
1
  import { JSXInterface } from '../../jsx';
2
- import { ResponsiveElement, CSSResultGroup } from '@refinitiv-ui/core';
2
+ import { CSSResultGroup, ResponsiveElement } from '@refinitiv-ui/core';
3
3
  /**
4
4
  * A private element to find overlay size boundaries
5
5
  */
@@ -1,6 +1,6 @@
1
1
  import { JSXInterface } from '../../jsx';
2
- import { ResponsiveElement, TemplateResult, CSSResultGroup, PropertyValues, ElementSize } from '@refinitiv-ui/core';
3
- import { TransitionStyle, PositionTarget, Position, NullOrUndefined, PositionTargetStrategy } from '../helpers/types.js';
2
+ import { CSSResultGroup, ElementSize, PropertyValues, ResponsiveElement, TemplateResult } from '@refinitiv-ui/core';
3
+ import { NullOrUndefined, Position, PositionTarget, PositionTargetStrategy, TransitionStyle } from '../helpers/types.js';
4
4
  export type { TransitionStyle, PositionTarget, Position, PositionTargetStrategy };
5
5
  /**
6
6
  * Element to help building modals, dialogs and other overlay content