@oracle/oraclejet-webdriver 16.1.6 → 17.0.1

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 (249) hide show
  1. package/elements/OjWebElement.js +2 -26
  2. package/elements/OjWebElement.js.map +1 -1
  3. package/elements/OjWebElement.ts +6 -40
  4. package/elements/oj-chart/OjChartBase.ts +8 -0
  5. package/elements/oj-checkboxset/OjCheckboxset.js +11 -12
  6. package/elements/oj-checkboxset/OjCheckboxset.js.map +1 -1
  7. package/elements/oj-checkboxset/OjCheckboxset.ts +14 -14
  8. package/elements/oj-combobox-many/OjComboboxMany.js +11 -20
  9. package/elements/oj-combobox-many/OjComboboxMany.js.map +1 -1
  10. package/elements/oj-combobox-many/OjComboboxMany.ts +14 -22
  11. package/elements/oj-combobox-one/OjComboboxOne.js +9 -18
  12. package/elements/oj-combobox-one/OjComboboxOne.js.map +1 -1
  13. package/elements/oj-combobox-one/OjComboboxOne.ts +12 -20
  14. package/elements/oj-data-grid/OjDataGridBase.ts +24 -0
  15. package/elements/oj-date-picker/OjDatePickerBase.js +20 -20
  16. package/elements/oj-date-picker/OjDatePickerBase.ts +53 -20
  17. package/elements/oj-date-time-picker/OjDateTimePickerBase.js +16 -16
  18. package/elements/oj-date-time-picker/OjDateTimePickerBase.ts +48 -16
  19. package/elements/oj-diagram/OjDiagramBase.ts +4 -0
  20. package/elements/oj-file-picker/OjFilePicker.js +90 -24
  21. package/elements/oj-file-picker/OjFilePicker.js.map +1 -1
  22. package/elements/oj-file-picker/OjFilePicker.ts +101 -27
  23. package/elements/oj-input-date/OjInputDateBase.js +7 -7
  24. package/elements/oj-input-date/OjInputDateBase.ts +37 -7
  25. package/elements/oj-input-date-time/OjInputDateTimeBase.js +7 -7
  26. package/elements/oj-input-date-time/OjInputDateTimeBase.ts +37 -7
  27. package/elements/oj-list-view/OjListView.js +6 -6
  28. package/elements/oj-list-view/OjListView.js.map +1 -1
  29. package/elements/oj-list-view/OjListView.ts +9 -8
  30. package/elements/oj-navigation-list/OjNavigationList.js +8 -10
  31. package/elements/oj-navigation-list/OjNavigationList.js.map +1 -1
  32. package/elements/oj-navigation-list/OjNavigationList.ts +11 -12
  33. package/elements/oj-navigation-list/OjNavigationListBase.js +2 -2
  34. package/elements/oj-navigation-list/OjNavigationListBase.ts +3 -2
  35. package/elements/oj-popup/OjPopupBase.js +1 -1
  36. package/elements/oj-popup/OjPopupBase.ts +1 -1
  37. package/elements/oj-row-expander/OjRowExpanderBase.ts +4 -0
  38. package/elements/oj-select-many/OjSelectMany.js +11 -20
  39. package/elements/oj-select-many/OjSelectMany.js.map +1 -1
  40. package/elements/oj-select-many/OjSelectMany.ts +14 -22
  41. package/elements/oj-select-one/OjSelectOne.js +9 -17
  42. package/elements/oj-select-one/OjSelectOne.js.map +1 -1
  43. package/elements/oj-select-one/OjSelectOne.ts +12 -19
  44. package/elements/oj-select-single/OjSelectSingle.js +7 -14
  45. package/elements/oj-select-single/OjSelectSingle.js.map +1 -1
  46. package/elements/oj-select-single/OjSelectSingle.ts +10 -16
  47. package/elements/oj-stream-list/OjStreamList.js +28 -33
  48. package/elements/oj-stream-list/OjStreamList.js.map +1 -1
  49. package/elements/oj-stream-list/OjStreamList.ts +28 -34
  50. package/elements/oj-sunburst/OjSunburstBase.ts +8 -0
  51. package/elements/oj-swipe-actions/OjSwipeActions.js +7 -10
  52. package/elements/oj-swipe-actions/OjSwipeActions.js.map +1 -1
  53. package/elements/oj-swipe-actions/OjSwipeActions.ts +11 -15
  54. package/elements/oj-tab-bar/OjTabBarBase.ts +1 -0
  55. package/elements/oj-table/OjTable.js +100 -81
  56. package/elements/oj-table/OjTable.js.map +1 -1
  57. package/elements/oj-table/OjTable.ts +146 -97
  58. package/elements/oj-table/OjTableBase.js +9 -0
  59. package/elements/oj-table/OjTableBase.js.map +1 -1
  60. package/elements/oj-table/OjTableBase.ts +10 -0
  61. package/elements/oj-tree-view/OjTreeView.js +25 -29
  62. package/elements/oj-tree-view/OjTreeView.js.map +1 -1
  63. package/elements/oj-tree-view/OjTreeView.ts +34 -35
  64. package/elements/oj-treemap/OjTreemapBase.ts +8 -0
  65. package/index.js +28 -139
  66. package/index.js.map +1 -1
  67. package/index.ts +29 -151
  68. package/lib/busy-context-utils.js +28 -46
  69. package/lib/busy-context-utils.js.map +1 -1
  70. package/lib/busy-context-utils.ts +39 -48
  71. package/lib/dataprovider-utils.js +24 -28
  72. package/lib/dataprovider-utils.js.map +1 -1
  73. package/lib/dataprovider-utils.ts +28 -31
  74. package/lib/no-require-jet.js +12 -0
  75. package/lib/no-require-jet.js.map +1 -0
  76. package/lib/no-require-jet.ts +8 -0
  77. package/lib/oj-module-proxy.js +113 -0
  78. package/lib/oj-module-proxy.js.map +1 -0
  79. package/lib/oj-module-proxy.ts +123 -0
  80. package/lib/viewmodel-utils.js +99 -0
  81. package/lib/viewmodel-utils.js.map +1 -0
  82. package/lib/viewmodel-utils.ts +107 -0
  83. package/package.json +6 -6
  84. package/tsconfig.json +2 -1
  85. package/wdtsdoc/assets/navigation.js +1 -1
  86. package/wdtsdoc/assets/search.js +1 -1
  87. package/wdtsdoc/classes/elements.OjAccordion.html +2 -2
  88. package/wdtsdoc/classes/elements.OjActionCard.html +2 -2
  89. package/wdtsdoc/classes/elements.OjButton.html +2 -2
  90. package/wdtsdoc/classes/elements.OjButtonsetMany.html +2 -2
  91. package/wdtsdoc/classes/elements.OjButtonsetOne.html +2 -2
  92. package/wdtsdoc/classes/elements.OjChart.html +2 -2
  93. package/wdtsdoc/classes/elements.OjCheckboxset.html +2 -2
  94. package/wdtsdoc/classes/elements.OjCollapsible.html +2 -2
  95. package/wdtsdoc/classes/elements.OjColorPalette.html +2 -2
  96. package/wdtsdoc/classes/elements.OjColorSpectrum.html +2 -2
  97. package/wdtsdoc/classes/elements.OjComboboxMany.html +2 -2
  98. package/wdtsdoc/classes/elements.OjComboboxOne.html +2 -2
  99. package/wdtsdoc/classes/elements.OjConveyorBelt.html +2 -2
  100. package/wdtsdoc/classes/elements.OjDataGrid.html +2 -2
  101. package/wdtsdoc/classes/elements.OjDatePicker.html +67 -49
  102. package/wdtsdoc/classes/elements.OjDateTimePicker.html +57 -42
  103. package/wdtsdoc/classes/elements.OjDiagram.html +2 -2
  104. package/wdtsdoc/classes/elements.OjDialog.html +2 -2
  105. package/wdtsdoc/classes/elements.OjDrawerLayout.html +2 -2
  106. package/wdtsdoc/classes/elements.OjDrawerPopup.html +2 -2
  107. package/wdtsdoc/classes/elements.OjFilePicker.html +11 -2
  108. package/wdtsdoc/classes/elements.OjFilmStrip.html +2 -2
  109. package/wdtsdoc/classes/elements.OjGantt.html +2 -2
  110. package/wdtsdoc/classes/elements.OjIndexer.html +2 -2
  111. package/wdtsdoc/classes/elements.OjInputDate.html +28 -21
  112. package/wdtsdoc/classes/elements.OjInputDateTime.html +28 -21
  113. package/wdtsdoc/classes/elements.OjInputNumber.html +2 -2
  114. package/wdtsdoc/classes/elements.OjInputPassword.html +2 -2
  115. package/wdtsdoc/classes/elements.OjInputSearch.html +2 -2
  116. package/wdtsdoc/classes/elements.OjInputText.html +2 -2
  117. package/wdtsdoc/classes/elements.OjInputTime.html +2 -2
  118. package/wdtsdoc/classes/elements.OjLabel.html +2 -2
  119. package/wdtsdoc/classes/elements.OjLedGauge.html +2 -2
  120. package/wdtsdoc/classes/elements.OjLegend.html +2 -2
  121. package/wdtsdoc/classes/elements.OjListView.html +4 -4
  122. package/wdtsdoc/classes/elements.OjMasonryLayout.html +2 -2
  123. package/wdtsdoc/classes/elements.OjMenu.html +2 -2
  124. package/wdtsdoc/classes/elements.OjMenuButton.html +2 -2
  125. package/wdtsdoc/classes/elements.OjMessage.html +2 -2
  126. package/wdtsdoc/classes/elements.OjMessageBanner.html +2 -2
  127. package/wdtsdoc/classes/elements.OjNBox.html +2 -2
  128. package/wdtsdoc/classes/elements.OjNavigationList.html +14 -12
  129. package/wdtsdoc/classes/elements.OjPagingControl.html +2 -2
  130. package/wdtsdoc/classes/elements.OjPictoChart.html +2 -2
  131. package/wdtsdoc/classes/elements.OjPopup.html +6 -5
  132. package/wdtsdoc/classes/elements.OjProgress.html +2 -2
  133. package/wdtsdoc/classes/elements.OjProgressList.html +2 -2
  134. package/wdtsdoc/classes/elements.OjRadioset.html +2 -2
  135. package/wdtsdoc/classes/elements.OjRatingGauge.html +2 -2
  136. package/wdtsdoc/classes/elements.OjRefresher.html +2 -2
  137. package/wdtsdoc/classes/elements.OjRowExpander.html +2 -2
  138. package/wdtsdoc/classes/elements.OjSelectMany.html +2 -2
  139. package/wdtsdoc/classes/elements.OjSelectOne.html +2 -2
  140. package/wdtsdoc/classes/elements.OjSelectSingle.html +2 -2
  141. package/wdtsdoc/classes/elements.OjSelector.html +2 -2
  142. package/wdtsdoc/classes/elements.OjSlider.html +2 -2
  143. package/wdtsdoc/classes/elements.OjSparkChart.html +2 -2
  144. package/wdtsdoc/classes/elements.OjStatusMeterGauge.html +2 -2
  145. package/wdtsdoc/classes/elements.OjStreamList.html +2 -2
  146. package/wdtsdoc/classes/elements.OjSunburst.html +2 -2
  147. package/wdtsdoc/classes/elements.OjSwipeActions.html +2 -2
  148. package/wdtsdoc/classes/elements.OjSwitch.html +2 -2
  149. package/wdtsdoc/classes/elements.OjTabBar.html +2 -2
  150. package/wdtsdoc/classes/elements.OjTable.html +27 -9
  151. package/wdtsdoc/classes/elements.OjTagCloud.html +2 -2
  152. package/wdtsdoc/classes/elements.OjTextArea.html +2 -2
  153. package/wdtsdoc/classes/elements.OjThematicMap.html +2 -2
  154. package/wdtsdoc/classes/elements.OjTimeAxis.html +2 -2
  155. package/wdtsdoc/classes/elements.OjTimeline.html +2 -2
  156. package/wdtsdoc/classes/elements.OjTrain.html +2 -2
  157. package/wdtsdoc/classes/elements.OjTreeView.html +5 -5
  158. package/wdtsdoc/classes/elements.OjTreemap.html +2 -2
  159. package/wdtsdoc/classes/elements.OjWaterfallLayout.html +2 -2
  160. package/wdtsdoc/classes/elements.OjWebElement.html +2 -2
  161. package/wdtsdoc/classes/index.DriverManager.html +2 -2
  162. package/wdtsdoc/classes/index.Expectation.html +2 -2
  163. package/wdtsdoc/functions/elements.ojAccordion-1.html +2 -2
  164. package/wdtsdoc/functions/elements.ojActionCard-1.html +2 -2
  165. package/wdtsdoc/functions/elements.ojButton-1.html +2 -2
  166. package/wdtsdoc/functions/elements.ojButtonsetMany-1.html +2 -2
  167. package/wdtsdoc/functions/elements.ojButtonsetOne-1.html +2 -2
  168. package/wdtsdoc/functions/elements.ojChart-1.html +2 -2
  169. package/wdtsdoc/functions/elements.ojCheckboxset-1.html +2 -2
  170. package/wdtsdoc/functions/elements.ojCollapsible-1.html +2 -2
  171. package/wdtsdoc/functions/elements.ojColorPalette-1.html +2 -2
  172. package/wdtsdoc/functions/elements.ojColorSpectrum-1.html +2 -2
  173. package/wdtsdoc/functions/elements.ojComboboxMany-1.html +2 -2
  174. package/wdtsdoc/functions/elements.ojComboboxOne-1.html +2 -2
  175. package/wdtsdoc/functions/elements.ojConveyorBelt-1.html +2 -2
  176. package/wdtsdoc/functions/elements.ojDataGrid-1.html +2 -2
  177. package/wdtsdoc/functions/elements.ojDatePicker-1.html +2 -2
  178. package/wdtsdoc/functions/elements.ojDateTimePicker-1.html +2 -2
  179. package/wdtsdoc/functions/elements.ojDiagram-1.html +2 -2
  180. package/wdtsdoc/functions/elements.ojDialog-1.html +2 -2
  181. package/wdtsdoc/functions/elements.ojDrawerLayout-1.html +2 -2
  182. package/wdtsdoc/functions/elements.ojDrawerPopup-1.html +2 -2
  183. package/wdtsdoc/functions/elements.ojFilePicker-1.html +2 -2
  184. package/wdtsdoc/functions/elements.ojFilmStrip-1.html +2 -2
  185. package/wdtsdoc/functions/elements.ojGantt-1.html +2 -2
  186. package/wdtsdoc/functions/elements.ojIndexer-1.html +2 -2
  187. package/wdtsdoc/functions/elements.ojInputDate-1.html +2 -2
  188. package/wdtsdoc/functions/elements.ojInputDateTime-1.html +2 -2
  189. package/wdtsdoc/functions/elements.ojInputNumber-1.html +2 -2
  190. package/wdtsdoc/functions/elements.ojInputPassword-1.html +2 -2
  191. package/wdtsdoc/functions/elements.ojInputSearch-1.html +2 -2
  192. package/wdtsdoc/functions/elements.ojInputText-1.html +2 -2
  193. package/wdtsdoc/functions/elements.ojInputTime-1.html +2 -2
  194. package/wdtsdoc/functions/elements.ojLabel-1.html +2 -2
  195. package/wdtsdoc/functions/elements.ojLedGauge-1.html +2 -2
  196. package/wdtsdoc/functions/elements.ojLegend-1.html +2 -2
  197. package/wdtsdoc/functions/elements.ojListView-1.html +2 -2
  198. package/wdtsdoc/functions/elements.ojMasonryLayout-1.html +2 -2
  199. package/wdtsdoc/functions/elements.ojMenu-1.html +2 -2
  200. package/wdtsdoc/functions/elements.ojMenuButton-1.html +2 -2
  201. package/wdtsdoc/functions/elements.ojMessage-1.html +2 -2
  202. package/wdtsdoc/functions/elements.ojMessageBanner-1.html +2 -2
  203. package/wdtsdoc/functions/elements.ojNBox-1.html +2 -2
  204. package/wdtsdoc/functions/elements.ojNavigationList-1.html +2 -2
  205. package/wdtsdoc/functions/elements.ojPagingControl-1.html +2 -2
  206. package/wdtsdoc/functions/elements.ojPictoChart-1.html +2 -2
  207. package/wdtsdoc/functions/elements.ojPopup-1.html +2 -2
  208. package/wdtsdoc/functions/elements.ojProgress-1.html +2 -2
  209. package/wdtsdoc/functions/elements.ojProgressList-1.html +2 -2
  210. package/wdtsdoc/functions/elements.ojRadioset-1.html +2 -2
  211. package/wdtsdoc/functions/elements.ojRatingGauge-1.html +2 -2
  212. package/wdtsdoc/functions/elements.ojRefresher-1.html +2 -2
  213. package/wdtsdoc/functions/elements.ojRowExpander-1.html +2 -2
  214. package/wdtsdoc/functions/elements.ojSelectMany-1.html +2 -2
  215. package/wdtsdoc/functions/elements.ojSelectOne-1.html +2 -2
  216. package/wdtsdoc/functions/elements.ojSelectSingle-1.html +2 -2
  217. package/wdtsdoc/functions/elements.ojSelector-1.html +2 -2
  218. package/wdtsdoc/functions/elements.ojSlider-1.html +2 -2
  219. package/wdtsdoc/functions/elements.ojSparkChart-1.html +2 -2
  220. package/wdtsdoc/functions/elements.ojStatusMeterGauge-1.html +2 -2
  221. package/wdtsdoc/functions/elements.ojStreamList-1.html +2 -2
  222. package/wdtsdoc/functions/elements.ojSunburst-1.html +2 -2
  223. package/wdtsdoc/functions/elements.ojSwipeActions-1.html +2 -2
  224. package/wdtsdoc/functions/elements.ojSwitch-1.html +2 -2
  225. package/wdtsdoc/functions/elements.ojTabBar-1.html +2 -2
  226. package/wdtsdoc/functions/elements.ojTable-1.html +2 -2
  227. package/wdtsdoc/functions/elements.ojTagCloud-1.html +2 -2
  228. package/wdtsdoc/functions/elements.ojTextArea-1.html +2 -2
  229. package/wdtsdoc/functions/elements.ojThematicMap-1.html +2 -2
  230. package/wdtsdoc/functions/elements.ojTimeAxis-1.html +2 -2
  231. package/wdtsdoc/functions/elements.ojTimeline-1.html +2 -2
  232. package/wdtsdoc/functions/elements.ojTrain-1.html +2 -2
  233. package/wdtsdoc/functions/elements.ojTreeView-1.html +2 -2
  234. package/wdtsdoc/functions/elements.ojTreemap-1.html +2 -2
  235. package/wdtsdoc/functions/elements.ojWaterfallLayout-1.html +2 -2
  236. package/wdtsdoc/functions/elements.ojWebElement-1.html +2 -2
  237. package/wdtsdoc/functions/index.ScreenshotManager.create.html +2 -2
  238. package/wdtsdoc/functions/index.ScreenshotManager.get.html +2 -2
  239. package/wdtsdoc/functions/index.ScreenshotManager.set.html +2 -2
  240. package/wdtsdoc/functions/index.fetchKeyByFilter.html +2 -2
  241. package/wdtsdoc/functions/index.register.html +2 -2
  242. package/wdtsdoc/functions/index.slotProxy-1.html +2 -2
  243. package/wdtsdoc/index.html +2 -2
  244. package/wdtsdoc/interfaces/index.DriverLike.html +2 -2
  245. package/wdtsdoc/interfaces/index.SlotProxy.html +2 -2
  246. package/wdtsdoc/modules/elements.html +2 -2
  247. package/wdtsdoc/modules/index.ScreenshotManager.html +2 -2
  248. package/wdtsdoc/modules/index.html +2 -2
  249. package/wdtsdoc/variables/index.default.html +7 -4
@@ -1,6 +1,8 @@
1
1
  import { OjFilePickerBase } from './OjFilePickerBase';
2
2
  import * as fs from 'fs';
3
3
  import * as path from 'path';
4
+ import { whenBusyContextReady } from '../../lib/busy-context-utils';
5
+ import { WebDriver } from 'selenium-webdriver';
4
6
  /**
5
7
  * The component WebElement for [oj-file-picker](../../jsdocs/oj.ojFilePicker.html).
6
8
  * Do not instantiate this class directly, instead, use
@@ -16,35 +18,107 @@ export class OjFilePicker extends OjFilePickerBase {
16
18
  * @param files An array of objects containing the path and type of selected files
17
19
  */
18
20
  async doSelect(files: Array<{ path: string; type: string }>) {
19
- await this.whenReady();
20
- let dataList: Array<any>;
21
- dataList = [];
22
- let file: any;
23
- for (let i = 0; i < files.length; i++) {
24
- const fileInfo = files[i];
25
- const filePath = fileInfo.path;
26
- const fileType = fileInfo.type;
27
- const data = fs.readFileSync(filePath);
28
- if (data) {
29
- file = { bytes: Array.from(data), path: path.basename(filePath), type: fileType };
30
- dataList.push(file);
21
+ await OjFilePicker.setupPickFiles(this.getDriver(), files);
22
+
23
+ await this.getDriver().executeScript(`arguments[0].firstChild.click();`, this);
24
+
25
+ await this.whenBusyContextReady();
26
+ }
27
+
28
+ /**
29
+ * This method should be called right before ojfilepickerutils.pickFiles
30
+ * Takes the webdriver and an Array of objects containing file paths + types.
31
+ * These files will be read from the local filesystem and then sent
32
+ * to the pickFiles method to simulate user file selection. Only the basename of
33
+ * the file will be sent, not the entire path to make it consistent with how
34
+ * the browser sets the value.
35
+ * @param driver the Webdriver of the test
36
+ * @param files An array of objects containing the path and type of selected files
37
+ */
38
+ static async setupPickFiles(driver: WebDriver, files: Array<{ path: string; type: string }>) {
39
+ await whenBusyContextReady(driver);
40
+ //create a buffer with the files
41
+ const dataList = files.map(({ path: filePath, type }) => {
42
+ const fileSizeInMB = fs.statSync(filePath).size / (1024 * 1024);
43
+ const numberChunks = Math.ceil(fileSizeInMB / 8);
44
+ const fileContent = Array.from(fs.readFileSync(filePath));
45
+ const chunkSize = Math.floor(fileContent.length / numberChunks);
46
+ const fileChunks = [];
47
+ for (let i = 0; i < numberChunks; i++) {
48
+ if (i + 1 == numberChunks) {
49
+ fileChunks.push(fileContent.slice(i * chunkSize));
50
+ } else {
51
+ fileChunks.push(fileContent.slice(i * chunkSize, (i + 1) * chunkSize));
52
+ }
53
+ }
54
+
55
+ return {
56
+ bytes: fileChunks, //split it into 8MB chunks
57
+ path: path.basename(filePath),
58
+ type,
59
+ numberChunks
60
+ };
61
+ });
62
+
63
+ for (let i = 0; i < dataList.length; i++) {
64
+ const { bytes, path, type, numberChunks } = dataList[i];
65
+ for (let j = 0; j < bytes.length; j++) {
66
+ const file = {
67
+ bytes: bytes[j],
68
+ path,
69
+ type,
70
+ numberChunks,
71
+ chunkNumber: j,
72
+ fileNumber: i
73
+ };
74
+ await driver.executeScript(
75
+ `const file = arguments[0];
76
+ const chunkNumber = file.chunkNumber;
77
+ var data = {
78
+ bytes: file.bytes,
79
+ path: file.path,
80
+ type: file.type
81
+ }
82
+ if (chunkNumber == 0) {
83
+ window['_file' + file.fileNumber] = [data];
84
+ } else {
85
+ window['_file' + file.fileNumber].push(data);
86
+ }`,
87
+ file
88
+ );
31
89
  }
32
90
  }
33
- await this.getDriver().executeAsyncScript(
34
- [
35
- 'var fileList = [];',
36
- 'var list = arguments[1];',
37
- 'for(var i = 0; i < list.length; i++) {',
38
- 'var data = list[i];',
39
- 'fileList.push(new File([Uint8Array.from(data.bytes)], data.path, {type: data.type}));',
40
- '}',
41
- 'fileList.item = function(i){return fileList[i];}',
42
- //arguments[2] is a callback automatically passed in to continue executing the code
43
- 'arguments[0]._doSelectHelper(fileList).then(arguments[2]);'
44
- ].join('\n'),
45
- this,
46
- dataList
91
+
92
+ driver.executeScript(
93
+ `const numFiles = arguments[0];
94
+ const list = [];
95
+ for ( let i = 0; i < numFiles; i++) {
96
+ const file = window['_file' + i];
97
+ delete window['_file' + i];
98
+ list.push({
99
+ bytes: file.map(chunk => chunk.bytes).join(''),
100
+ path: file[0].path,
101
+ type: file[0].type
102
+ });
103
+ }
104
+ const fileList = list.map((data) => {
105
+ return new File([Uint8Array.from(data.bytes)], data.path, {type: data.type});
106
+ })
107
+ // Only if setupPickFiles has not been called yet
108
+ if (!HTMLInputElement.prototype._pickerTestData) {
109
+ //Save the native click method
110
+ const clickMethod = HTMLInputElement.prototype.click;
111
+ //Overwrite the click method
112
+ HTMLInputElement.prototype.click = function() {
113
+ const event = new CustomEvent("change");
114
+ this.dispatchEvent(event);
115
+ delete HTMLInputElement.prototype._pickerTestData;
116
+ HTMLInputElement.prototype.click = clickMethod;
117
+ }
118
+ }
119
+ HTMLInputElement.prototype._pickerTestData = fileList;
120
+ `,
121
+ dataList.length
47
122
  );
48
- await this.whenBusyContextReady();
49
123
  }
50
124
  }
@@ -22,7 +22,7 @@ class OjInputDateBase extends __1.OjWebElement {
22
22
  * Gets the value of <code>autocomplete</code> property.
23
23
  * Specifies a component's autocomplete state. See the Help documentation for more information.
24
24
  * @return The value of <code>autocomplete</code> property.
25
- *
25
+ * @deprecated Since 17.0.0. The date field contains mask segments instead of a general input, so autocomplete is not supported.
26
26
  */
27
27
  getAutocomplete() {
28
28
  return this.getProperty('autocomplete');
@@ -31,7 +31,7 @@ class OjInputDateBase extends __1.OjWebElement {
31
31
  * Gets the value of <code>autofocus</code> property.
32
32
  * Specifies whether the component will get input focus when the page is loaded. See the Help documentation for more information.
33
33
  * @return The value of <code>autofocus</code> property.
34
- *
34
+ * @deprecated Since 17.0.0. This is not recommended for accessibility reasons.
35
35
  */
36
36
  getAutofocus() {
37
37
  return this.getProperty('autofocus');
@@ -67,7 +67,7 @@ class OjInputDateBase extends __1.OjWebElement {
67
67
  * Gets the value of <code>dayMetaData</code> property.
68
68
  * Specifies additional information to be used when rendering the day. See the Help documentation for more information.
69
69
  * @return The value of <code>dayMetaData</code> property.
70
- *
70
+ * @deprecated Since 17.0.0. Use dayFormatter instead, as it is more flexible.
71
71
  */
72
72
  getDayMetaData() {
73
73
  return this.getProperty('dayMetaData');
@@ -121,7 +121,7 @@ class OjInputDateBase extends __1.OjWebElement {
121
121
  * Gets the value of <code>keyboardEdit</code> property.
122
122
  * Determines if keyboard entry of the text is allowed. When disabled, the picker must be used to select the date. See the Help documentation for more information.
123
123
  * @return The value of <code>keyboardEdit</code> property.
124
- *
124
+ * @deprecated Since 17.0.0. This is not supported in the Redwood UX specification.
125
125
  */
126
126
  getKeyboardEdit() {
127
127
  return this.getProperty('keyboardEdit');
@@ -148,7 +148,7 @@ class OjInputDateBase extends __1.OjWebElement {
148
148
  * Gets the value of <code>labelledBy</code> property.
149
149
  * The oj-label sets the labelledBy property programmatically on the form component. See the Help documentation for more information.
150
150
  * @return The value of <code>labelledBy</code> property.
151
- *
151
+ * @deprecated Since 17.0.0. This is an internal API and is not supported in the Redwood UX specification.
152
152
  */
153
153
  getLabelledBy() {
154
154
  return this.getProperty('labelledBy');
@@ -202,7 +202,7 @@ class OjInputDateBase extends __1.OjWebElement {
202
202
  * Gets the value of <code>pickerAttributes</code> property.
203
203
  * Specifies attributes to be set on the picker DOM element when it is launched. See the Help documentation for more information.
204
204
  * @return The value of <code>pickerAttributes</code> property.
205
- *
205
+ * @deprecated Since 17.0.0. Changing the Class or Style property is not recommended, as it leads to an inconsistent UI.
206
206
  */
207
207
  getPickerAttributes() {
208
208
  return this.getProperty('pickerAttributes');
@@ -211,7 +211,7 @@ class OjInputDateBase extends __1.OjWebElement {
211
211
  * Gets the value of <code>placeholder</code> property.
212
212
  * The placeholder text to set on the element.
213
213
  * @return The value of <code>placeholder</code> property.
214
- *
214
+ * @deprecated Since 17.0.0. The date field contains mask segments instead of a general input, so placeholder is not supported.
215
215
  */
216
216
  getPlaceholder() {
217
217
  return this.getProperty('placeholder');
@@ -21,7 +21,7 @@ export class OjInputDateBase extends OjWebElement {
21
21
  * Gets the value of <code>autocomplete</code> property.
22
22
  * Specifies a component's autocomplete state. See the Help documentation for more information.
23
23
  * @return The value of <code>autocomplete</code> property.
24
- *
24
+ * @deprecated Since 17.0.0. The date field contains mask segments instead of a general input, so autocomplete is not supported.
25
25
  */
26
26
  public getAutocomplete(): Promise<string> {
27
27
  return this.getProperty<string>('autocomplete');
@@ -31,7 +31,7 @@ export class OjInputDateBase extends OjWebElement {
31
31
  * Gets the value of <code>autofocus</code> property.
32
32
  * Specifies whether the component will get input focus when the page is loaded. See the Help documentation for more information.
33
33
  * @return The value of <code>autofocus</code> property.
34
- *
34
+ * @deprecated Since 17.0.0. This is not recommended for accessibility reasons.
35
35
  */
36
36
  public getAutofocus(): Promise<boolean> {
37
37
  return this.getProperty<boolean>('autofocus');
@@ -71,7 +71,7 @@ export class OjInputDateBase extends OjWebElement {
71
71
  * Gets the value of <code>dayMetaData</code> property.
72
72
  * Specifies additional information to be used when rendering the day. See the Help documentation for more information.
73
73
  * @return The value of <code>dayMetaData</code> property.
74
- *
74
+ * @deprecated Since 17.0.0. Use dayFormatter instead, as it is more flexible.
75
75
  */
76
76
  public getDayMetaData(): Promise<object> {
77
77
  return this.getProperty<object>('dayMetaData');
@@ -131,7 +131,7 @@ export class OjInputDateBase extends OjWebElement {
131
131
  * Gets the value of <code>keyboardEdit</code> property.
132
132
  * Determines if keyboard entry of the text is allowed. When disabled, the picker must be used to select the date. See the Help documentation for more information.
133
133
  * @return The value of <code>keyboardEdit</code> property.
134
- *
134
+ * @deprecated Since 17.0.0. This is not supported in the Redwood UX specification.
135
135
  */
136
136
  public getKeyboardEdit(): Promise<string> {
137
137
  return this.getProperty<string>('keyboardEdit');
@@ -161,7 +161,7 @@ export class OjInputDateBase extends OjWebElement {
161
161
  * Gets the value of <code>labelledBy</code> property.
162
162
  * The oj-label sets the labelledBy property programmatically on the form component. See the Help documentation for more information.
163
163
  * @return The value of <code>labelledBy</code> property.
164
- *
164
+ * @deprecated Since 17.0.0. This is an internal API and is not supported in the Redwood UX specification.
165
165
  */
166
166
  public getLabelledBy(): Promise<string | null> {
167
167
  return this.getProperty<string | null>('labelledBy');
@@ -221,7 +221,7 @@ export class OjInputDateBase extends OjWebElement {
221
221
  * Gets the value of <code>pickerAttributes</code> property.
222
222
  * Specifies attributes to be set on the picker DOM element when it is launched. See the Help documentation for more information.
223
223
  * @return The value of <code>pickerAttributes</code> property.
224
- *
224
+ * @deprecated Since 17.0.0. Changing the Class or Style property is not recommended, as it leads to an inconsistent UI.
225
225
  */
226
226
  public getPickerAttributes(): Promise<PickerAttributes> {
227
227
  return this.getProperty<PickerAttributes>('pickerAttributes');
@@ -231,7 +231,7 @@ export class OjInputDateBase extends OjWebElement {
231
231
  * Gets the value of <code>placeholder</code> property.
232
232
  * The placeholder text to set on the element.
233
233
  * @return The value of <code>placeholder</code> property.
234
- *
234
+ * @deprecated Since 17.0.0. The date field contains mask segments instead of a general input, so placeholder is not supported.
235
235
  */
236
236
  public getPlaceholder(): Promise<string> {
237
237
  return this.getProperty<string>('placeholder');
@@ -348,6 +348,7 @@ export interface DatePicker {
348
348
  changeYear: string;
349
349
  /**
350
350
  * Specifies the position in multiple months at which to show the current month (starting at 0).
351
+ * @deprecated Since 17.0.0. This is required when date-picker.number-of-months > 1, which is now deprecated, so this is no longer needed.
351
352
  */
352
353
  currentMonthPos: number;
353
354
  /**
@@ -361,18 +362,22 @@ export interface DatePicker {
361
362
  footerLayout: string;
362
363
  /**
363
364
  * Specifies the number of months to show at once. See the Help documentation for more information.
365
+ * @deprecated Since 17.0.0. This is not supported in the Redwood UX specification for Date Picker. See the Range Picker UX specification.
364
366
  */
365
367
  numberOfMonths: number;
366
368
  /**
367
369
  * Specifies when the date picker should be shown.
370
+ * @deprecated Since 17.0.0. This is not supported in the Redwood UX specification.
368
371
  */
369
372
  showOn: string;
370
373
  /**
371
374
  * Specifies the number of months to step backwards and forwards for the Ctrl+Alt+Page Up and Ctrl+Alt+Page Down keystrokes.
375
+ * @deprecated Since 17.0.0. This is not in the Redwood UX specification.
372
376
  */
373
377
  stepBigMonths: number;
374
378
  /**
375
379
  * Specifies how the prev and next keys will step backwards and forwards through the months. See the Help documentation for more information.
380
+ * @deprecated Since 17.0.0. This is not in the Redwood UX specification.
376
381
  */
377
382
  stepMonths: string | number;
378
383
  /**
@@ -381,6 +386,7 @@ export interface DatePicker {
381
386
  weekDisplay: string;
382
387
  /**
383
388
  * Specifies the range of years displayed in the year drop-down. See the Help documentation for more information.
389
+ * @deprecated Since 17.0.0. This is not in the Redwood UX specification. The 'min' and 'max' properties should be used instead.
384
390
  */
385
391
  yearRange: string;
386
392
  }
@@ -422,6 +428,7 @@ export interface HelpHints {
422
428
  export interface PickerAttributes {
423
429
  /**
424
430
  *
431
+ * @deprecated Since 17.0.0. We are recommending not to change the Class property of pickerAttribute as it leads to an inconsistent UI.
425
432
  */
426
433
  class: string;
427
434
  /**
@@ -433,14 +440,17 @@ export interface PickerAttributes {
433
440
  export interface Translations {
434
441
  /**
435
442
  * Message to announce to AT via aria-live when the length.max is exceeded.
443
+ * @deprecated Since 17.0.0. This is not supported by the component.
436
444
  */
437
445
  accessibleMaxLengthExceeded: string;
438
446
  /**
439
447
  * Message to annnouce to AT via aria-live for the remaining character count.
448
+ * @deprecated Since 17.0.0. This is not supported by the component.
440
449
  */
441
450
  accessibleMaxLengthRemaining: string;
442
451
  /**
443
452
  * The text to display for the current day link.
453
+ * @deprecated Since 17.0.0. The Redwood UX specification does not allow this to be configurable.
444
454
  */
445
455
  currentText: string;
446
456
  /**
@@ -453,14 +463,17 @@ export interface Translations {
453
463
  dateTimeRange: TranslationsDateTimeRange;
454
464
  /**
455
465
  * The text to display for the next month link.
466
+ * @deprecated Since 17.0.0. The Redwood UX specification does not allow this to be configurable.
456
467
  */
457
468
  nextText: string;
458
469
  /**
459
470
  * The text to display for the previous month link.
471
+ * @deprecated Since 17.0.0. The Redwood UX specification does not allow this to be configurable.
460
472
  */
461
473
  prevText: string;
462
474
  /**
463
475
  * Provides properties to customize the message text used by the implicit regexp validator associated to the InputText and TextArea components.
476
+ * @deprecated Since 17.0.0. This is not supported by the component.
464
477
  */
465
478
  regexp: TranslationsRegexp;
466
479
  /**
@@ -469,28 +482,34 @@ export interface Translations {
469
482
  required: TranslationsRequired;
470
483
  /**
471
484
  * Tooltip text for the calendar icon.
485
+ * @deprecated Since 17.0.0. This is not configurable per component instance in the Redwood UX specification.
472
486
  */
473
487
  tooltipCalendar: string;
474
488
  /**
475
489
  * Tooltip text for the calendar icon when the component is disabled.
490
+ * @deprecated Since 17.0.0. This is not configurable per component instance in the Redwood UX specification.
476
491
  */
477
492
  tooltipCalendarDisabled: string;
478
493
  /**
479
494
  * Tooltip text for the calendar + time icon.
495
+ * @deprecated Since 17.0.0. This is not configurable per component instance in the Redwood UX specification.
480
496
  */
481
497
  tooltipCalendarTime: string;
482
498
  /**
483
499
  * Tooltip text for the calendar + time icon when the component is disabled.
500
+ * @deprecated Since 17.0.0. This is not configurable per component instance in the Redwood UX specification.
484
501
  */
485
502
  tooltipCalendarTimeDisabled: string;
486
503
  /**
487
504
  * The text to display for the week of the year column heading.
505
+ * @deprecated Since 17.0.0. The Redwood UX specification does not allow this to be configurable.
488
506
  */
489
507
  weekHeader: string;
490
508
  }
491
509
  export interface TranslationsDateRestriction {
492
510
  /**
493
511
  * Hint text used by the implicit date restriction validator associated to the InputDateTime and InputDate components.
512
+ * @deprecated Since 17.0.0. Please use help-hints instead.
494
513
  */
495
514
  hint: string;
496
515
  /**
@@ -499,12 +518,14 @@ export interface TranslationsDateRestriction {
499
518
  messageDetail: string;
500
519
  /**
501
520
  * Message summary for the implicit date restriction validator associated to the InputDateTime and InputDate components.
521
+ * @deprecated Since 17.0.0. This is not supported in the Redwood UX specification.
502
522
  */
503
523
  messageSummary: string;
504
524
  }
505
525
  export interface TranslationsDateTimeRange {
506
526
  /**
507
527
  * Provides properties to customize the hint text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components.
528
+ * @deprecated Since 17.0.0. Please use help-hints instead.
508
529
  */
509
530
  hint: TranslationsDateTimeRangeHint;
510
531
  /**
@@ -513,20 +534,24 @@ export interface TranslationsDateTimeRange {
513
534
  messageDetail: TranslationsDateTimeRangeMessageDetail;
514
535
  /**
515
536
  * Provides properties to customize the error message summary text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components.
537
+ * @deprecated Since 17.0.0. This is not supported in the Redwood UX specification.
516
538
  */
517
539
  messageSummary: TranslationsDateTimeRangeMessageSummary;
518
540
  }
519
541
  export interface TranslationsDateTimeRangeHint {
520
542
  /**
521
543
  * Hint text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components. hint.inRange is shown when both min and max are set, and is used to tell the user the allowed number range.
544
+ * @deprecated Since 17.0.0. Please use help-hints instead.
522
545
  */
523
546
  inRange: string;
524
547
  /**
525
548
  * Hint text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components. hint.max is shown when max is set and min is not set, and is used to tell the user the allowed maximum.
549
+ * @deprecated Since 17.0.0. Please use help-hints instead.
526
550
  */
527
551
  max: string;
528
552
  /**
529
553
  * Hint text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components. hint.min is shown when min is set and max is not set, and is used to tell the user the allowed minimum.
554
+ * @deprecated Since 17.0.0. Please use help-hints instead.
530
555
  */
531
556
  min: string;
532
557
  }
@@ -543,26 +568,31 @@ export interface TranslationsDateTimeRangeMessageDetail {
543
568
  export interface TranslationsDateTimeRangeMessageSummary {
544
569
  /**
545
570
  * Error message summary text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components. messageSummary.rangeOverflow is shown when max is set, and the value is greater than the maximum.
571
+ * @deprecated Since 17.0.0. This is not supported in the Redwood UX specification.
546
572
  */
547
573
  rangeOverflow: string;
548
574
  /**
549
575
  * Error message summary text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components. messageSummary.rangeUnderflow is shown when min is set, and the value is less than the minimum.
576
+ * @deprecated Since 17.0.0. This is not supported in the Redwood UX specification.
550
577
  */
551
578
  rangeUnderflow: string;
552
579
  }
553
580
  export interface TranslationsRegexp {
554
581
  /**
555
582
  * Provides properties to customize the error message detail used by the implicit regexp validator associated to the InputText and TextArea components.
583
+ * @deprecated Since 17.0.0. This is not supported by the component.
556
584
  */
557
585
  messageDetail: string;
558
586
  /**
559
587
  * Provides properties to customize the error message summary used by the implicit regexp validator associated to the InputText and TextArea components.
588
+ * @deprecated Since 17.0.0. This is not supported by the component.
560
589
  */
561
590
  messageSummary: string;
562
591
  }
563
592
  export interface TranslationsRequired {
564
593
  /**
565
594
  * Hint text used by required validation error.
595
+ * @deprecated Since 17.0.0. Please use help-hints instead.
566
596
  */
567
597
  hint: string;
568
598
  /**
@@ -22,7 +22,7 @@ class OjInputDateTimeBase extends __1.OjWebElement {
22
22
  * Gets the value of <code>autocomplete</code> property.
23
23
  * Specifies a component's autocomplete state. See the Help documentation for more information.
24
24
  * @return The value of <code>autocomplete</code> property.
25
- *
25
+ * @deprecated Since 17.0.0. The date field contains mask segments instead of a general input, so autocomplete is not supported.
26
26
  */
27
27
  getAutocomplete() {
28
28
  return this.getProperty('autocomplete');
@@ -31,7 +31,7 @@ class OjInputDateTimeBase extends __1.OjWebElement {
31
31
  * Gets the value of <code>autofocus</code> property.
32
32
  * Specifies whether the component will get input focus when the page is loaded. See the Help documentation for more information.
33
33
  * @return The value of <code>autofocus</code> property.
34
- *
34
+ * @deprecated Since 17.0.0. This is not recommended for accessibility reasons.
35
35
  */
36
36
  getAutofocus() {
37
37
  return this.getProperty('autofocus');
@@ -67,7 +67,7 @@ class OjInputDateTimeBase extends __1.OjWebElement {
67
67
  * Gets the value of <code>dayMetaData</code> property.
68
68
  * Specifies additional information to be used when rendering the day. See the Help documentation for more information.
69
69
  * @return The value of <code>dayMetaData</code> property.
70
- *
70
+ * @deprecated Since 17.0.0. Use dayFormatter instead, as it is more flexible.
71
71
  */
72
72
  getDayMetaData() {
73
73
  return this.getProperty('dayMetaData');
@@ -121,7 +121,7 @@ class OjInputDateTimeBase extends __1.OjWebElement {
121
121
  * Gets the value of <code>keyboardEdit</code> property.
122
122
  * Determines if keyboard entry of the text is allowed. When disabled, the picker must be used to select the date. See the Help documentation for more information.
123
123
  * @return The value of <code>keyboardEdit</code> property.
124
- *
124
+ * @deprecated Since 17.0.0. This is not supported in the Redwood UX specification.
125
125
  */
126
126
  getKeyboardEdit() {
127
127
  return this.getProperty('keyboardEdit');
@@ -148,7 +148,7 @@ class OjInputDateTimeBase extends __1.OjWebElement {
148
148
  * Gets the value of <code>labelledBy</code> property.
149
149
  * The oj-label sets the labelledBy property programmatically on the form component. See the Help documentation for more information.
150
150
  * @return The value of <code>labelledBy</code> property.
151
- *
151
+ * @deprecated Since 17.0.0. This is an internal API and is not supported in the Redwood UX specification.
152
152
  */
153
153
  getLabelledBy() {
154
154
  return this.getProperty('labelledBy');
@@ -202,7 +202,7 @@ class OjInputDateTimeBase extends __1.OjWebElement {
202
202
  * Gets the value of <code>pickerAttributes</code> property.
203
203
  * Specifies attributes to be set on the picker DOM element when it is launched. See the Help documentation for more information.
204
204
  * @return The value of <code>pickerAttributes</code> property.
205
- *
205
+ * @deprecated Since 17.0.0. Changing the Class or Style property is not recommended, as it leads to an inconsistent UI.
206
206
  */
207
207
  getPickerAttributes() {
208
208
  return this.getProperty('pickerAttributes');
@@ -211,7 +211,7 @@ class OjInputDateTimeBase extends __1.OjWebElement {
211
211
  * Gets the value of <code>placeholder</code> property.
212
212
  * The placeholder text to set on the element.
213
213
  * @return The value of <code>placeholder</code> property.
214
- *
214
+ * @deprecated Since 17.0.0. The date field contains mask segments instead of a general input, so placeholder is not supported.
215
215
  */
216
216
  getPlaceholder() {
217
217
  return this.getProperty('placeholder');