@watermarkinsights/ripple 3.6.0-0 → 3.6.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.
Files changed (181) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/{functions-653e695c.js → functions-068b9a56.js} +1128 -486
  3. package/dist/cjs/{global-e676a97a.js → global-51e309da.js} +65 -65
  4. package/dist/cjs/{http-service-494d81de.js → http-service-9e8c4dd5.js} +49 -49
  5. package/dist/cjs/{interfaces-a3338581.js → interfaces-30a74c1f.js} +29 -29
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/priv-chart-popover.cjs.entry.js +79 -79
  8. package/dist/cjs/priv-datepicker.cjs.entry.js +667 -667
  9. package/dist/cjs/priv-navigator-button.cjs.entry.js +18 -18
  10. package/dist/cjs/priv-navigator-item.cjs.entry.js +23 -23
  11. package/dist/cjs/ripple.cjs.js +2 -2
  12. package/dist/cjs/wm-action-menu_2.cjs.entry.js +341 -341
  13. package/dist/cjs/wm-button.cjs.entry.js +218 -218
  14. package/dist/cjs/wm-chart-slice.cjs.entry.js +13 -13
  15. package/dist/cjs/wm-chart.cjs.entry.js +475 -475
  16. package/dist/cjs/wm-datepicker.cjs.entry.js +256 -256
  17. package/dist/cjs/wm-input.cjs.entry.js +134 -133
  18. package/dist/cjs/wm-modal-footer.cjs.entry.js +31 -31
  19. package/dist/cjs/wm-modal-header.cjs.entry.js +34 -34
  20. package/dist/cjs/wm-modal.cjs.entry.js +161 -161
  21. package/dist/cjs/wm-navigator.cjs.entry.js +268 -268
  22. package/dist/cjs/wm-network-uploader.cjs.entry.js +420 -420
  23. package/dist/cjs/wm-option_2.cjs.entry.js +494 -492
  24. package/dist/cjs/wm-pagination.cjs.entry.js +167 -167
  25. package/dist/cjs/wm-search.cjs.entry.js +231 -231
  26. package/dist/cjs/wm-snackbar.cjs.entry.js +170 -170
  27. package/dist/cjs/wm-tab-item_3.cjs.entry.js +300 -300
  28. package/dist/cjs/wm-tag-input.cjs.entry.js +570 -556
  29. package/dist/cjs/wm-timepicker.cjs.entry.js +380 -379
  30. package/dist/cjs/wm-toggletip.cjs.entry.js +124 -124
  31. package/dist/cjs/wm-uploader.cjs.entry.js +347 -356
  32. package/dist/cjs/wm-wrapper.cjs.entry.js +12 -12
  33. package/dist/collection/components/wm-action-menu/wm-action-menu.js +460 -460
  34. package/dist/collection/components/wm-button/wm-button.js +485 -485
  35. package/dist/collection/components/wm-chart/priv-chart-popover/priv-chart-popover.css +1 -0
  36. package/dist/collection/components/wm-chart/priv-chart-popover/priv-chart-popover.js +232 -232
  37. package/dist/collection/components/wm-chart/wm-chart-slice.js +64 -64
  38. package/dist/collection/components/wm-chart/wm-chart.css +4 -0
  39. package/dist/collection/components/wm-chart/wm-chart.js +719 -719
  40. package/dist/collection/components/wm-datepicker/priv-datepicker/priv-datepicker.js +1015 -1015
  41. package/dist/collection/components/wm-datepicker/wm-datepicker.js +462 -462
  42. package/dist/collection/components/wm-input/wm-input.js +424 -423
  43. package/dist/collection/components/wm-menuitem/wm-menuitem.js +444 -444
  44. package/dist/collection/components/wm-modal/wm-modal-footer.js +141 -141
  45. package/dist/collection/components/wm-modal/wm-modal-header.js +92 -92
  46. package/dist/collection/components/wm-modal/wm-modal.js +459 -459
  47. package/dist/collection/components/wm-navigator/priv-navigator-button/priv-navigator-button.js +97 -97
  48. package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.js +114 -114
  49. package/dist/collection/components/wm-navigator/wm-navigator.js +468 -468
  50. package/dist/collection/components/wm-option/wm-option.js +422 -422
  51. package/dist/collection/components/wm-pagination/wm-pagination.js +368 -368
  52. package/dist/collection/components/wm-search/wm-search.js +479 -479
  53. package/dist/collection/components/wm-select/wm-select.js +720 -718
  54. package/dist/collection/components/wm-snackbar/wm-snackbar.js +297 -297
  55. package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +219 -219
  56. package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +331 -331
  57. package/dist/collection/components/wm-tabs/wm-tab-panel/wm-tab-panel.js +104 -104
  58. package/dist/collection/components/wm-tag-input/wm-tag-input.js +801 -787
  59. package/dist/collection/components/wm-timepicker/wm-timepicker.js +580 -579
  60. package/dist/collection/components/wm-toggletip/wm-toggletip.js +241 -241
  61. package/dist/collection/components/wm-uploader/wm-network-uploader/wm-network-uploader.js +753 -753
  62. package/dist/collection/components/wm-uploader/wm-uploader.css +9 -16
  63. package/dist/collection/components/wm-uploader/wm-uploader.js +748 -790
  64. package/dist/collection/components/wm-wrapper/wm-wrapper.js +27 -27
  65. package/dist/collection/dev/scripts.js +20 -20
  66. package/dist/collection/global/__mocks__/functions.js +6 -6
  67. package/dist/collection/global/functions.js +445 -445
  68. package/dist/collection/global/global.js +72 -72
  69. package/dist/collection/global/interfaces.js +49 -49
  70. package/dist/collection/global/services/__mocks__/http-service.js +130 -130
  71. package/dist/collection/global/services/http-service.js +50 -50
  72. package/dist/collection/lang/lang.js +5 -5
  73. package/dist/collection/lang/missing.js +39 -0
  74. package/dist/collection/lang/piglatin.js +93 -93
  75. package/dist/esm/{functions-e528c934.js → functions-122ab496.js} +1128 -486
  76. package/dist/esm/{global-39a2f585.js → global-c36ac692.js} +65 -65
  77. package/dist/esm/{http-service-3dc3b3e7.js → http-service-5d037e16.js} +49 -49
  78. package/dist/esm/{interfaces-2b97fab2.js → interfaces-61c6305b.js} +29 -29
  79. package/dist/esm/loader.js +2 -2
  80. package/dist/esm/polyfills/core-js.js +0 -0
  81. package/dist/esm/polyfills/dom.js +0 -0
  82. package/dist/esm/polyfills/es5-html-element.js +0 -0
  83. package/dist/esm/polyfills/index.js +0 -0
  84. package/dist/esm/polyfills/system.js +0 -0
  85. package/dist/esm/priv-chart-popover.entry.js +79 -79
  86. package/dist/esm/priv-datepicker.entry.js +667 -667
  87. package/dist/esm/priv-navigator-button.entry.js +18 -18
  88. package/dist/esm/priv-navigator-item.entry.js +23 -23
  89. package/dist/esm/ripple.js +2 -2
  90. package/dist/esm/wm-action-menu_2.entry.js +341 -341
  91. package/dist/esm/wm-button.entry.js +218 -218
  92. package/dist/esm/wm-chart-slice.entry.js +13 -13
  93. package/dist/esm/wm-chart.entry.js +475 -475
  94. package/dist/esm/wm-datepicker.entry.js +256 -256
  95. package/dist/esm/wm-input.entry.js +134 -133
  96. package/dist/esm/wm-modal-footer.entry.js +31 -31
  97. package/dist/esm/wm-modal-header.entry.js +34 -34
  98. package/dist/esm/wm-modal.entry.js +161 -161
  99. package/dist/esm/wm-navigator.entry.js +268 -268
  100. package/dist/esm/wm-network-uploader.entry.js +420 -420
  101. package/dist/esm/wm-option_2.entry.js +494 -492
  102. package/dist/esm/wm-pagination.entry.js +167 -167
  103. package/dist/esm/wm-search.entry.js +231 -231
  104. package/dist/esm/wm-snackbar.entry.js +170 -170
  105. package/dist/esm/wm-tab-item_3.entry.js +300 -300
  106. package/dist/esm/wm-tag-input.entry.js +570 -556
  107. package/dist/esm/wm-timepicker.entry.js +380 -379
  108. package/dist/esm/wm-toggletip.entry.js +124 -124
  109. package/dist/esm/wm-uploader.entry.js +347 -356
  110. package/dist/esm/wm-wrapper.entry.js +12 -12
  111. package/dist/ripple/{p-b3d5ea85.entry.js → p-067909ce.entry.js} +1 -1
  112. package/dist/ripple/p-08e67884.js +16 -0
  113. package/dist/ripple/{p-1e0c41a9.entry.js → p-1c23f228.entry.js} +1 -1
  114. package/dist/ripple/p-2aa79663.entry.js +1 -0
  115. package/dist/ripple/{p-d8ecd974.entry.js → p-2b3f75eb.entry.js} +1 -1
  116. package/dist/ripple/{p-65e3a656.entry.js → p-3ff67fd5.entry.js} +1 -1
  117. package/dist/ripple/{p-aa973691.entry.js → p-4629470d.entry.js} +1 -1
  118. package/dist/ripple/{p-dc9c9fda.entry.js → p-4b1f14bb.entry.js} +1 -1
  119. package/dist/ripple/{p-e9e8334e.entry.js → p-4b72f4eb.entry.js} +1 -1
  120. package/dist/ripple/{p-8cd1396e.entry.js → p-54c39a0b.entry.js} +1 -1
  121. package/dist/ripple/p-7da00f33.entry.js +1 -0
  122. package/dist/ripple/{p-092b01f3.entry.js → p-803b19aa.entry.js} +1 -1
  123. package/dist/ripple/{p-43f1298b.js → p-888bec42.js} +0 -0
  124. package/dist/ripple/p-888c18c3.entry.js +1 -0
  125. package/dist/ripple/p-8c93b893.js +1 -0
  126. package/dist/ripple/{p-8923b7d0.entry.js → p-97884327.entry.js} +1 -1
  127. package/dist/ripple/{p-33524565.entry.js → p-9a8fbfad.entry.js} +1 -1
  128. package/dist/ripple/p-a2b02aec.entry.js +1 -0
  129. package/dist/ripple/{p-fcdc6395.entry.js → p-a61b07de.entry.js} +1 -1
  130. package/dist/ripple/{p-fd8070fb.js → p-a6d6eae7.js} +0 -0
  131. package/dist/ripple/p-e36853fd.entry.js +1 -0
  132. package/dist/ripple/{p-4cc71463.entry.js → p-ecbb441f.entry.js} +1 -1
  133. package/dist/ripple/{p-efdaf3b6.entry.js → p-f6bed262.entry.js} +1 -1
  134. package/dist/ripple/p-f95c2283.entry.js +1 -0
  135. package/dist/ripple/ripple.esm.js +1 -1
  136. package/dist/types/components/wm-action-menu/wm-action-menu.d.ts +48 -48
  137. package/dist/types/components/wm-button/wm-button.d.ts +44 -44
  138. package/dist/types/components/wm-chart/priv-chart-popover/priv-chart-popover.d.ts +23 -23
  139. package/dist/types/components/wm-chart/wm-chart-slice.d.ts +8 -8
  140. package/dist/types/components/wm-chart/wm-chart.d.ts +82 -82
  141. package/dist/types/components/wm-datepicker/priv-datepicker/priv-datepicker.d.ts +76 -76
  142. package/dist/types/components/wm-datepicker/wm-datepicker.d.ts +41 -41
  143. package/dist/types/components/wm-input/wm-input.d.ts +46 -46
  144. package/dist/types/components/wm-menuitem/wm-menuitem.d.ts +34 -34
  145. package/dist/types/components/wm-modal/wm-modal-footer.d.ts +15 -15
  146. package/dist/types/components/wm-modal/wm-modal-header.d.ts +12 -12
  147. package/dist/types/components/wm-modal/wm-modal.d.ts +41 -41
  148. package/dist/types/components/wm-navigator/priv-navigator-button/priv-navigator-button.d.ts +10 -10
  149. package/dist/types/components/wm-navigator/priv-navigator-item/priv-navigator-item.d.ts +13 -13
  150. package/dist/types/components/wm-navigator/wm-navigator.d.ts +61 -61
  151. package/dist/types/components/wm-option/wm-option.d.ts +32 -32
  152. package/dist/types/components/wm-pagination/wm-pagination.d.ts +32 -32
  153. package/dist/types/components/wm-search/wm-search.d.ts +86 -86
  154. package/dist/types/components/wm-select/wm-select.d.ts +66 -66
  155. package/dist/types/components/wm-snackbar/wm-snackbar.d.ts +35 -35
  156. package/dist/types/components/wm-tabs/wm-tab-item/wm-tab-item.d.ts +38 -38
  157. package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +53 -53
  158. package/dist/types/components/wm-tabs/wm-tab-panel/wm-tab-panel.d.ts +20 -20
  159. package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +92 -91
  160. package/dist/types/components/wm-timepicker/wm-timepicker.d.ts +61 -61
  161. package/dist/types/components/wm-toggletip/wm-toggletip.d.ts +27 -27
  162. package/dist/types/components/wm-uploader/wm-network-uploader/wm-network-uploader.d.ts +85 -85
  163. package/dist/types/components/wm-uploader/wm-uploader.d.ts +80 -82
  164. package/dist/types/components/wm-wrapper/wm-wrapper.d.ts +7 -7
  165. package/dist/types/components.d.ts +24 -28
  166. package/dist/types/global/__mocks__/functions.d.ts +6 -6
  167. package/dist/types/global/functions.d.ts +40 -40
  168. package/dist/types/global/global.d.ts +1 -1
  169. package/dist/types/global/interfaces.d.ts +34 -34
  170. package/dist/types/global/services/__mocks__/http-service.d.ts +6 -6
  171. package/dist/types/global/services/http-service.d.ts +4 -4
  172. package/dist/types/lang/lang.d.ts +5 -5
  173. package/package.json +47 -46
  174. package/dist/ripple/p-588b4475.js +0 -16
  175. package/dist/ripple/p-67e288fe.entry.js +0 -1
  176. package/dist/ripple/p-690b4f41.entry.js +0 -1
  177. package/dist/ripple/p-754d3d41.entry.js +0 -1
  178. package/dist/ripple/p-a53165df.entry.js +0 -1
  179. package/dist/ripple/p-c9dcb2ef.js +0 -1
  180. package/dist/ripple/p-e7616311.entry.js +0 -1
  181. package/dist/ripple/p-ec9697db.entry.js +0 -1
@@ -72,7 +72,7 @@ const en = {
72
72
  }
73
73
  ]
74
74
  },
75
- iso: {
75
+ other: {
76
76
  value: [
77
77
  {
78
78
  type: 0,
@@ -144,7 +144,7 @@ const en = {
144
144
  }
145
145
  ]
146
146
  },
147
- iso: {
147
+ other: {
148
148
  value: [
149
149
  {
150
150
  type: 0,
@@ -336,6 +336,43 @@ const en = {
336
336
  type: 0,
337
337
  value: "Wednesday"
338
338
  }
339
+ ],
340
+ "global.characterLimit": [
341
+ {
342
+ style: null,
343
+ type: 2,
344
+ value: "limit"
345
+ },
346
+ {
347
+ type: 0,
348
+ value: " characters allowed."
349
+ }
350
+ ],
351
+ "global.characterLimitReached": [
352
+ {
353
+ type: 0,
354
+ value: "No additional characters will be entered."
355
+ }
356
+ ],
357
+ "global.charactersEntered": [
358
+ {
359
+ style: null,
360
+ type: 2,
361
+ value: "x"
362
+ },
363
+ {
364
+ type: 0,
365
+ value: " of "
366
+ },
367
+ {
368
+ style: null,
369
+ type: 2,
370
+ value: "y"
371
+ },
372
+ {
373
+ type: 0,
374
+ value: " characters entered."
375
+ }
339
376
  ],
340
377
  "global.closeVerb": [
341
378
  {
@@ -348,6 +385,12 @@ const en = {
348
385
  type: 0,
349
386
  value: "An error occurred. Please try again."
350
387
  }
388
+ ],
389
+ "global.newWindowLink": [
390
+ {
391
+ type: 0,
392
+ value: "Opens in a new window."
393
+ }
351
394
  ],
352
395
  "global.next": [
353
396
  {
@@ -360,6 +403,24 @@ const en = {
360
403
  type: 0,
361
404
  value: "previous"
362
405
  }
406
+ ],
407
+ "global.requiredError": [
408
+ {
409
+ type: 0,
410
+ value: "This field is required."
411
+ }
412
+ ],
413
+ "global.requiredField": [
414
+ {
415
+ type: 0,
416
+ value: "required field"
417
+ }
418
+ ],
419
+ "input.numberError": [
420
+ {
421
+ type: 0,
422
+ value: "Please enter a valid number."
423
+ }
363
424
  ],
364
425
  "navigator.WatermarkAppNavigation": [
365
426
  {
@@ -523,6 +584,127 @@ const en = {
523
584
  type: 0,
524
585
  value: "Make a selection"
525
586
  }
587
+ ],
588
+ "tagInput.existingOptions": [
589
+ {
590
+ offset: 0,
591
+ options: {
592
+ one: {
593
+ value: [
594
+ {
595
+ type: 0,
596
+ value: "1 existing option."
597
+ }
598
+ ]
599
+ },
600
+ other: {
601
+ value: [
602
+ {
603
+ type: 7
604
+ },
605
+ {
606
+ type: 0,
607
+ value: " existing options."
608
+ }
609
+ ]
610
+ }
611
+ },
612
+ pluralType: "cardinal",
613
+ type: 6,
614
+ value: "num"
615
+ }
616
+ ],
617
+ "tagInput.helpTextCanSelect": [
618
+ {
619
+ type: 0,
620
+ value: "Search and select a tag."
621
+ }
622
+ ],
623
+ "tagInput.helpTextEditable": [
624
+ {
625
+ type: 0,
626
+ value: "Press the Enter or Comma key to add a new tag."
627
+ }
628
+ ],
629
+ "tagInput.maxTagsReached": [
630
+ {
631
+ type: 0,
632
+ value: "The maximum amount of tags has been reached, no additional tags can be added."
633
+ }
634
+ ],
635
+ "tagInput.placeholderAdd": [
636
+ {
637
+ type: 0,
638
+ value: "Add a new tag"
639
+ }
640
+ ],
641
+ "tagInput.placeholderAddAndSearch": [
642
+ {
643
+ type: 0,
644
+ value: "Add or search for a tag"
645
+ }
646
+ ],
647
+ "tagInput.placeholderSearch": [
648
+ {
649
+ type: 0,
650
+ value: "Search and select a tag"
651
+ }
652
+ ],
653
+ "tagInput.tagAdded": [
654
+ {
655
+ type: 1,
656
+ value: "tagName"
657
+ },
658
+ {
659
+ type: 0,
660
+ value: " added."
661
+ }
662
+ ],
663
+ "tagInput.tagAlreadyAdded": [
664
+ {
665
+ type: 1,
666
+ value: "tagName"
667
+ },
668
+ {
669
+ type: 0,
670
+ value: " has already been added."
671
+ }
672
+ ],
673
+ "tagInput.tagAreaInstructions": [
674
+ {
675
+ type: 0,
676
+ value: "tag selection. Press Backspace or Delete to remove a tag."
677
+ }
678
+ ],
679
+ "tagInput.tagRemoved": [
680
+ {
681
+ type: 1,
682
+ value: "tag"
683
+ },
684
+ {
685
+ type: 0,
686
+ value: " removed"
687
+ }
688
+ ],
689
+ "tagInput.tagsAddedCounter": [
690
+ {
691
+ type: 0,
692
+ value: "Tags added: "
693
+ },
694
+ {
695
+ style: null,
696
+ type: 2,
697
+ value: "x"
698
+ },
699
+ {
700
+ type: 0,
701
+ value: "/"
702
+ },
703
+ {
704
+ style: null,
705
+ type: 2,
706
+ value: "y"
707
+ }
526
708
  ],
527
709
  "time.invalidTime": [
528
710
  {
@@ -547,6 +729,12 @@ const en = {
547
729
  type: 0,
548
730
  value: "hh:mm"
549
731
  }
732
+ ],
733
+ "toggletip.moreInformation": [
734
+ {
735
+ type: 0,
736
+ value: "More information"
737
+ }
550
738
  ],
551
739
  "uploader.duplicateName": [
552
740
  {
@@ -762,7 +950,7 @@ const fr = {
762
950
  }
763
951
  ]
764
952
  },
765
- iso: {
953
+ other: {
766
954
  value: [
767
955
  {
768
956
  type: 0,
@@ -834,7 +1022,7 @@ const fr = {
834
1022
  }
835
1023
  ]
836
1024
  },
837
- iso: {
1025
+ other: {
838
1026
  value: [
839
1027
  {
840
1028
  type: 0,
@@ -912,6 +1100,12 @@ const fr = {
912
1100
  type: 0,
913
1101
  value: "Octobre"
914
1102
  }
1103
+ ],
1104
+ "date.requiredDateError": [
1105
+ {
1106
+ type: 0,
1107
+ value: "Vous devez renseigner une date."
1108
+ }
915
1109
  ],
916
1110
  "date.sa": [
917
1111
  {
@@ -1020,12 +1214,61 @@ const fr = {
1020
1214
  type: 0,
1021
1215
  value: "Mercredi"
1022
1216
  }
1217
+ ],
1218
+ "global.characterLimit": [
1219
+ {
1220
+ style: null,
1221
+ type: 2,
1222
+ value: "limit"
1223
+ },
1224
+ {
1225
+ type: 0,
1226
+ value: " caractères autorisés."
1227
+ }
1228
+ ],
1229
+ "global.characterLimitReached": [
1230
+ {
1231
+ type: 0,
1232
+ value: "Aucun autre caractère ne peut être ajouté."
1233
+ }
1234
+ ],
1235
+ "global.charactersEntered": [
1236
+ {
1237
+ style: null,
1238
+ type: 2,
1239
+ value: "x"
1240
+ },
1241
+ {
1242
+ type: 0,
1243
+ value: " caractères sur "
1244
+ },
1245
+ {
1246
+ style: null,
1247
+ type: 2,
1248
+ value: "y"
1249
+ },
1250
+ {
1251
+ type: 0,
1252
+ value: " ajoutés."
1253
+ }
1254
+ ],
1255
+ "global.closeVerb": [
1256
+ {
1257
+ type: 0,
1258
+ value: "Fermer"
1259
+ }
1023
1260
  ],
1024
1261
  "global.genericError": [
1025
1262
  {
1026
1263
  type: 0,
1027
1264
  value: "Une erreur s'est produite. Veuillez réessayer."
1028
1265
  }
1266
+ ],
1267
+ "global.newWindowLink": [
1268
+ {
1269
+ type: 0,
1270
+ value: "S'ouvre dans une nouvelle fenêtre."
1271
+ }
1029
1272
  ],
1030
1273
  "global.next": [
1031
1274
  {
@@ -1038,6 +1281,24 @@ const fr = {
1038
1281
  type: 0,
1039
1282
  value: "précédent"
1040
1283
  }
1284
+ ],
1285
+ "global.requiredError": [
1286
+ {
1287
+ type: 0,
1288
+ value: "Ce champ est requis."
1289
+ }
1290
+ ],
1291
+ "global.requiredField": [
1292
+ {
1293
+ type: 0,
1294
+ value: "champ requis"
1295
+ }
1296
+ ],
1297
+ "input.numberError": [
1298
+ {
1299
+ type: 0,
1300
+ value: "Entrez un nombre valide."
1301
+ }
1041
1302
  ],
1042
1303
  "navigator.WatermarkAppNavigation": [
1043
1304
  {
@@ -1050,6 +1311,36 @@ const fr = {
1050
1311
  type: 0,
1051
1312
  value: "Se déconnecter"
1052
1313
  }
1314
+ ],
1315
+ "navigator.userinfo": [
1316
+ {
1317
+ type: 0,
1318
+ value: "Informations utilisateur"
1319
+ }
1320
+ ],
1321
+ "navigator.userinfoAndProductNavigator": [
1322
+ {
1323
+ type: 0,
1324
+ value: "Informations utilisateur et navigateur de produits"
1325
+ }
1326
+ ],
1327
+ "navigator.userinfoLabel": [
1328
+ {
1329
+ type: 0,
1330
+ value: "pour "
1331
+ },
1332
+ {
1333
+ type: 1,
1334
+ value: "name"
1335
+ },
1336
+ {
1337
+ type: 0,
1338
+ value: ", email "
1339
+ },
1340
+ {
1341
+ type: 1,
1342
+ value: "email"
1343
+ }
1053
1344
  ],
1054
1345
  "navigator.watermarkApps": [
1055
1346
  {
@@ -1115,45 +1406,208 @@ const fr = {
1115
1406
  "search.typeToFilterResults": [
1116
1407
  {
1117
1408
  type: 0,
1118
- value: "Tapez pour filtrer les résultats"
1409
+ value: "Tapez pour filtrer les résultats"
1410
+ }
1411
+ ],
1412
+ "search.xOfYResults": [
1413
+ {
1414
+ offset: 0,
1415
+ options: {
1416
+ "=0": {
1417
+ value: [
1418
+ {
1419
+ type: 0,
1420
+ value: "Aucun résultat"
1421
+ }
1422
+ ]
1423
+ },
1424
+ other: {
1425
+ value: [
1426
+ {
1427
+ type: 0,
1428
+ value: "Résultat "
1429
+ },
1430
+ {
1431
+ type: 1,
1432
+ value: "current"
1433
+ },
1434
+ {
1435
+ type: 0,
1436
+ value: " de "
1437
+ },
1438
+ {
1439
+ type: 1,
1440
+ value: "numResults"
1441
+ }
1442
+ ]
1443
+ }
1444
+ },
1445
+ pluralType: "cardinal",
1446
+ type: 6,
1447
+ value: "numResults"
1448
+ }
1449
+ ],
1450
+ "select.allSelected": [
1451
+ {
1452
+ type: 0,
1453
+ value: "Tous sélectionnés"
1454
+ }
1455
+ ],
1456
+ "select.multiPlaceholder": [
1457
+ {
1458
+ type: 0,
1459
+ value: "Faites une sélection"
1460
+ }
1461
+ ],
1462
+ "tagInput.existingOptions": [
1463
+ {
1464
+ offset: 0,
1465
+ options: {
1466
+ one: {
1467
+ value: [
1468
+ {
1469
+ type: 0,
1470
+ value: "1 option existante."
1471
+ }
1472
+ ]
1473
+ },
1474
+ other: {
1475
+ value: [
1476
+ {
1477
+ type: 7
1478
+ },
1479
+ {
1480
+ type: 0,
1481
+ value: " options existantes."
1482
+ }
1483
+ ]
1484
+ }
1485
+ },
1486
+ pluralType: "cardinal",
1487
+ type: 6,
1488
+ value: "num"
1489
+ }
1490
+ ],
1491
+ "tagInput.helpTextCanSelect": [
1492
+ {
1493
+ type: 0,
1494
+ value: "Recherchez et sélectionnez une étiquette."
1495
+ }
1496
+ ],
1497
+ "tagInput.helpTextEditable": [
1498
+ {
1499
+ type: 0,
1500
+ value: "Appuyez sur Entrée ou insérez une virgule pour ajouter une nouvelle étiquette."
1501
+ }
1502
+ ],
1503
+ "tagInput.maxTagsReached": [
1504
+ {
1505
+ type: 0,
1506
+ value: "Le nombre maximal d'étiquettes est atteint, aucune autre ne peut être ajoutée."
1507
+ }
1508
+ ],
1509
+ "tagInput.placeholderAdd": [
1510
+ {
1511
+ type: 0,
1512
+ value: "Ajoutez une nouvelle étiquette"
1513
+ }
1514
+ ],
1515
+ "tagInput.placeholderAddAndSearch": [
1516
+ {
1517
+ type: 0,
1518
+ value: "Ajoutez ou recherchez une étiquette"
1519
+ }
1520
+ ],
1521
+ "tagInput.placeholderSearch": [
1522
+ {
1523
+ type: 0,
1524
+ value: "Recherchez et sélectionnez une étiquette"
1525
+ }
1526
+ ],
1527
+ "tagInput.tagAdded": [
1528
+ {
1529
+ type: 1,
1530
+ value: "tagName"
1531
+ },
1532
+ {
1533
+ type: 0,
1534
+ value: " ajoutée."
1535
+ }
1536
+ ],
1537
+ "tagInput.tagAlreadyAdded": [
1538
+ {
1539
+ type: 1,
1540
+ value: "tagName"
1541
+ },
1542
+ {
1543
+ type: 0,
1544
+ value: " a déjà été ajoutée."
1545
+ }
1546
+ ],
1547
+ "tagInput.tagAreaInstructions": [
1548
+ {
1549
+ type: 0,
1550
+ value: "selection d'étiquettes. Touche retour arrière ou supprimer pour enlever une étiquette."
1551
+ }
1552
+ ],
1553
+ "tagInput.tagRemoved": [
1554
+ {
1555
+ type: 1,
1556
+ value: "tag"
1557
+ },
1558
+ {
1559
+ type: 0,
1560
+ value: " enlevée"
1561
+ }
1562
+ ],
1563
+ "tagInput.tagsAddedCounter": [
1564
+ {
1565
+ type: 0,
1566
+ value: "Étiquette ajoutée : "
1567
+ },
1568
+ {
1569
+ style: null,
1570
+ type: 2,
1571
+ value: "x"
1572
+ },
1573
+ {
1574
+ type: 0,
1575
+ value: "/"
1576
+ },
1577
+ {
1578
+ style: null,
1579
+ type: 2,
1580
+ value: "y"
1581
+ }
1582
+ ],
1583
+ "time.invalidTime": [
1584
+ {
1585
+ type: 0,
1586
+ value: "Entrez une heure valide."
1587
+ }
1588
+ ],
1589
+ "time.requiredError": [
1590
+ {
1591
+ type: 0,
1592
+ value: "Vous devez renseigner une heure."
1593
+ }
1594
+ ],
1595
+ "time.selectTime": [
1596
+ {
1597
+ type: 0,
1598
+ value: "Choisissez une heure"
1599
+ }
1600
+ ],
1601
+ "time.timeFormat": [
1602
+ {
1603
+ type: 0,
1604
+ value: "hh:mm"
1119
1605
  }
1120
1606
  ],
1121
- "search.xOfYResults": [
1607
+ "toggletip.moreInformation": [
1122
1608
  {
1123
- offset: 0,
1124
- options: {
1125
- "=0": {
1126
- value: [
1127
- {
1128
- type: 0,
1129
- value: "Aucun résultat"
1130
- }
1131
- ]
1132
- },
1133
- other: {
1134
- value: [
1135
- {
1136
- type: 0,
1137
- value: "Résultat "
1138
- },
1139
- {
1140
- type: 1,
1141
- value: "current"
1142
- },
1143
- {
1144
- type: 0,
1145
- value: " de "
1146
- },
1147
- {
1148
- type: 1,
1149
- value: "numResults"
1150
- }
1151
- ]
1152
- }
1153
- },
1154
- pluralType: "cardinal",
1155
- type: 6,
1156
- value: "numResults"
1609
+ type: 0,
1610
+ value: "Plus d'information"
1157
1611
  }
1158
1612
  ],
1159
1613
  "uploader.duplicateName": [
@@ -1374,7 +1828,7 @@ const es = {
1374
1828
  }
1375
1829
  ]
1376
1830
  },
1377
- iso: {
1831
+ other: {
1378
1832
  value: [
1379
1833
  {
1380
1834
  type: 0,
@@ -1446,7 +1900,7 @@ const es = {
1446
1900
  }
1447
1901
  ]
1448
1902
  },
1449
- iso: {
1903
+ other: {
1450
1904
  value: [
1451
1905
  {
1452
1906
  type: 0,
@@ -1990,7 +2444,7 @@ const pig = {
1990
2444
  }
1991
2445
  ]
1992
2446
  },
1993
- iso: {
2447
+ other: {
1994
2448
  value: [
1995
2449
  {
1996
2450
  type: 0,
@@ -2062,7 +2516,7 @@ const pig = {
2062
2516
  }
2063
2517
  ]
2064
2518
  },
2065
- iso: {
2519
+ other: {
2066
2520
  value: [
2067
2521
  {
2068
2522
  type: 0,
@@ -2254,6 +2708,43 @@ const pig = {
2254
2708
  type: 0,
2255
2709
  value: "Ednesdayway"
2256
2710
  }
2711
+ ],
2712
+ "global.characterLimit": [
2713
+ {
2714
+ style: null,
2715
+ type: 2,
2716
+ value: "limit"
2717
+ },
2718
+ {
2719
+ type: 0,
2720
+ value: " aracterschay allowedyay."
2721
+ }
2722
+ ],
2723
+ "global.characterLimitReached": [
2724
+ {
2725
+ type: 0,
2726
+ value: "Onay additionalyay aracterschay illway ebay enteredyay."
2727
+ }
2728
+ ],
2729
+ "global.charactersEntered": [
2730
+ {
2731
+ style: null,
2732
+ type: 2,
2733
+ value: "x"
2734
+ },
2735
+ {
2736
+ type: 0,
2737
+ value: " ofyay "
2738
+ },
2739
+ {
2740
+ style: null,
2741
+ type: 2,
2742
+ value: "y"
2743
+ },
2744
+ {
2745
+ type: 0,
2746
+ value: " aracterschay enteredyay."
2747
+ }
2257
2748
  ],
2258
2749
  "global.closeVerb": [
2259
2750
  {
@@ -2266,6 +2757,12 @@ const pig = {
2266
2757
  type: 0,
2267
2758
  value: "Anyay erroryay occurredyay. Easeplay tryay againyay."
2268
2759
  }
2760
+ ],
2761
+ "global.newWindowLink": [
2762
+ {
2763
+ type: 0,
2764
+ value: "Opensyay inyay ayay ewnay indowway."
2765
+ }
2269
2766
  ],
2270
2767
  "global.next": [
2271
2768
  {
@@ -2278,6 +2775,24 @@ const pig = {
2278
2775
  type: 0,
2279
2776
  value: "eviouspray"
2280
2777
  }
2778
+ ],
2779
+ "global.requiredError": [
2780
+ {
2781
+ type: 0,
2782
+ value: "Isthay ieldfay isyay equiredray."
2783
+ }
2784
+ ],
2785
+ "global.requiredField": [
2786
+ {
2787
+ type: 0,
2788
+ value: "equiredray ieldfay"
2789
+ }
2790
+ ],
2791
+ "input.numberError": [
2792
+ {
2793
+ type: 0,
2794
+ value: "Easeplay enteryay ayay alidvay umbernay."
2795
+ }
2281
2796
  ],
2282
2797
  "navigator.WatermarkAppNavigation": [
2283
2798
  {
@@ -2441,6 +2956,127 @@ const pig = {
2441
2956
  type: 0,
2442
2957
  value: "Akemay ayay electionsay"
2443
2958
  }
2959
+ ],
2960
+ "tagInput.existingOptions": [
2961
+ {
2962
+ offset: 0,
2963
+ options: {
2964
+ one: {
2965
+ value: [
2966
+ {
2967
+ type: 0,
2968
+ value: "1 existingyay optionyay."
2969
+ }
2970
+ ]
2971
+ },
2972
+ other: {
2973
+ value: [
2974
+ {
2975
+ type: 7
2976
+ },
2977
+ {
2978
+ type: 0,
2979
+ value: " existingyay optionsyay."
2980
+ }
2981
+ ]
2982
+ }
2983
+ },
2984
+ pluralType: "cardinal",
2985
+ type: 6,
2986
+ value: "num"
2987
+ }
2988
+ ],
2989
+ "tagInput.helpTextCanSelect": [
2990
+ {
2991
+ type: 0,
2992
+ value: "Earchsay andyay electsay ayay agtay."
2993
+ }
2994
+ ],
2995
+ "tagInput.helpTextEditable": [
2996
+ {
2997
+ type: 0,
2998
+ value: "Esspray ethay Enteryay oryay Ommacay eykay otay addyay ayay ewnay agtay."
2999
+ }
3000
+ ],
3001
+ "tagInput.maxTagsReached": [
3002
+ {
3003
+ type: 0,
3004
+ value: "Ethay aximummay amountyay ofyay agstay ashay eenbay eachedray, onay additionalyay agstay ancay ebay addedyay."
3005
+ }
3006
+ ],
3007
+ "tagInput.placeholderAdd": [
3008
+ {
3009
+ type: 0,
3010
+ value: "Addyay ayay ewnay agtay"
3011
+ }
3012
+ ],
3013
+ "tagInput.placeholderAddAndSearch": [
3014
+ {
3015
+ type: 0,
3016
+ value: "Addyay oryay earchsay orfay ayay agtay"
3017
+ }
3018
+ ],
3019
+ "tagInput.placeholderSearch": [
3020
+ {
3021
+ type: 0,
3022
+ value: "Earchsay andyay electsay ayay agtay"
3023
+ }
3024
+ ],
3025
+ "tagInput.tagAdded": [
3026
+ {
3027
+ type: 1,
3028
+ value: "tagName"
3029
+ },
3030
+ {
3031
+ type: 0,
3032
+ value: " addedyay."
3033
+ }
3034
+ ],
3035
+ "tagInput.tagAlreadyAdded": [
3036
+ {
3037
+ type: 1,
3038
+ value: "tagName"
3039
+ },
3040
+ {
3041
+ type: 0,
3042
+ value: " ashay alreadyyay eenbay addedyay."
3043
+ }
3044
+ ],
3045
+ "tagInput.tagAreaInstructions": [
3046
+ {
3047
+ type: 0,
3048
+ value: "agtay electionsay. Esspray Ackspacebay oryay Eleteday otay emoveray ayay agtay."
3049
+ }
3050
+ ],
3051
+ "tagInput.tagRemoved": [
3052
+ {
3053
+ type: 1,
3054
+ value: "tag"
3055
+ },
3056
+ {
3057
+ type: 0,
3058
+ value: " emovedray"
3059
+ }
3060
+ ],
3061
+ "tagInput.tagsAddedCounter": [
3062
+ {
3063
+ type: 0,
3064
+ value: "Agstay addedyay: "
3065
+ },
3066
+ {
3067
+ style: null,
3068
+ type: 2,
3069
+ value: "x"
3070
+ },
3071
+ {
3072
+ type: 0,
3073
+ value: "/"
3074
+ },
3075
+ {
3076
+ style: null,
3077
+ type: 2,
3078
+ value: "y"
3079
+ }
2444
3080
  ],
2445
3081
  "time.invalidTime": [
2446
3082
  {
@@ -2465,6 +3101,12 @@ const pig = {
2465
3101
  type: 0,
2466
3102
  value: "hh:mmay"
2467
3103
  }
3104
+ ],
3105
+ "toggletip.moreInformation": [
3106
+ {
3107
+ type: 0,
3108
+ value: "Oremay informationyay"
3109
+ }
2468
3110
  ],
2469
3111
  "uploader.duplicateName": [
2470
3112
  {
@@ -5699,448 +6341,448 @@ function createIntl(config, cache) {
5699
6341
  return __assign(__assign({}, resolvedConfig), { formatters: formatters, formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat), formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat), formatRelativeTime: formatRelativeTime.bind(null, resolvedConfig, formatters.getRelativeTimeFormat), formatDate: formatDate.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateToParts: formatDateToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTime: formatTime.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateTimeRange: formatDateTimeRange.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTimeToParts: formatTimeToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatPlural: formatPlural.bind(null, resolvedConfig, formatters.getPluralRules), formatMessage: formatMessage.bind(null, resolvedConfig, formatters), formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat), formatListToParts: formatListToParts.bind(null, resolvedConfig, formatters.getListFormat), formatDisplayName: formatDisplayName.bind(null, resolvedConfig, formatters.getDisplayNames) });
5700
6342
  }
5701
6343
 
5702
- const DEFAULT_LANGUAGE = "en";
5703
- function getBrowserLang() {
5704
- const langAttr = document.documentElement.getAttribute("lang");
5705
- if (!!langAttr) {
5706
- return langAttr;
5707
- }
5708
- else if (window.navigator && window.navigator.language) {
5709
- const lang = window.navigator.languages ? window.navigator.languages[0] : window.navigator.language;
5710
- return lang.slice(0, 2);
5711
- }
5712
- else {
5713
- return DEFAULT_LANGUAGE;
5714
- }
5715
- }
5716
- // prevents memory leak
5717
- const cache = createIntlCache();
5718
- const locale = getBrowserLang();
5719
- const intl = createIntl({
5720
- locale: locale,
5721
- defaultLocale: "en",
5722
- messages: lang[locale] || en,
5723
- }, cache);
5724
- function generateId() {
5725
- return "wmcl-" + Math.random().toString(36).substr(2, 10);
5726
- }
5727
- function debounce(fn, wait) {
5728
- let timeout;
5729
- return function () {
5730
- const context = this;
5731
- const functionCall = () => fn.apply(context, arguments);
5732
- clearTimeout(timeout);
5733
- timeout = setTimeout(functionCall, wait);
5734
- };
5735
- }
5736
- function getTextDir() {
5737
- const dir = document.querySelector("html").getAttribute("dir");
5738
- return dir ? dir.toLowerCase() : "";
5739
- }
5740
- function getPosition(el) {
5741
- const coords = el.getBoundingClientRect();
5742
- let x = coords.x;
5743
- let y = coords.y;
5744
- // Edge doesn't have x and y
5745
- if (!x) {
5746
- if (getTextDir() === "rtl") {
5747
- x = coords.right;
5748
- }
5749
- else {
5750
- x = coords.left;
5751
- }
5752
- y = coords.top;
5753
- }
5754
- return { x, y };
5755
- }
5756
- function findParentWithScrollbar(el) {
5757
- while (!!el) {
5758
- if (el.scrollHeight > el.clientHeight && ["scroll", "auto"].includes(window.getComputedStyle(el).overflowY)) {
5759
- return el;
5760
- }
5761
- el = el.parentElement;
5762
- }
5763
- }
5764
- function findParentWithHiddenOverflow(el) {
5765
- while (!!el) {
5766
- if (window.getComputedStyle(el).overflowY !== "visible") {
5767
- return el;
5768
- }
5769
- el = el.parentElement;
5770
- }
5771
- }
5772
- function getClosableElementMeasurements(fixedEl, closableEl) {
5773
- const parent = findParentWithHiddenOverflow(fixedEl);
5774
- // if parent is not found, measurements are checked against the viewport
5775
- return {
5776
- closableElHeight: closableEl.clientHeight,
5777
- closableElWidth: closableEl.clientWidth,
5778
- // NB boundingClientRect.bottom is space from top of viewport to bottom of el
5779
- // to get space below the el -> height of viewport minus boundingClientRect.bottom
5780
- spaceAbove: parent
5781
- ? fixedEl.getBoundingClientRect().top - parent.getBoundingClientRect().top
5782
- : fixedEl.getBoundingClientRect().top,
5783
- // NB boundingClientRect.bottom is space from top of viewport to bottom of el
5784
- // to get space below the el -> height of viewport minus boundingClientRect.bottom
5785
- spaceBelow: parent
5786
- ? parent.getBoundingClientRect().bottom - fixedEl.getBoundingClientRect().bottom
5787
- : document.documentElement.clientHeight - fixedEl.getBoundingClientRect().bottom,
5788
- spaceLeft: parent
5789
- ? fixedEl.getBoundingClientRect().left - parent.getBoundingClientRect().left
5790
- : fixedEl.getBoundingClientRect().left,
5791
- spaceRight: parent
5792
- ? parent.getBoundingClientRect().right - fixedEl.getBoundingClientRect().right
5793
- : document.documentElement.clientWidth - fixedEl.getBoundingClientRect().right,
5794
- };
5795
- }
5796
- function shouldOpenUp(fixedEl, //the element visible on the page when the component is closed
5797
- closableEl, //the dropdown/popup/etc that becomes visible when the component is open
5798
- offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
5799
- offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
5800
- ) {
5801
- const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
5802
- //we want to open up only if there's not enough space below AND there is enough space above
5803
- const openUp = closableElHeight > spaceBelow + offsetBelow && closableElHeight <= spaceAbove + offsetAbove;
5804
- return openUp;
5805
- }
5806
- function shouldOpenDown(fixedEl, //the element visible on the page when the component is closed
5807
- closableEl, //the dropdown/popup/etc that becomes visible when the component is open
5808
- offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
5809
- offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
5810
- ) {
5811
- const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
5812
- //we want to open up only if there's not enough space below AND there is enough space above
5813
- const openDown = closableElHeight > spaceAbove + offsetAbove && closableElHeight <= spaceBelow + offsetBelow;
5814
- return openDown;
5815
- }
5816
- function shouldShiftRight(fixedEl, closableEl) {
5817
- const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
5818
- const needsSpaceLeft = closableElWidth > spaceLeft && spaceRight > spaceLeft;
5819
- return needsSpaceLeft;
5820
- }
5821
- function shouldShiftLeft(fixedEl, closableEl) {
5822
- const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
5823
- const needsSpaceRight = closableElWidth > spaceRight && spaceLeft > spaceRight;
5824
- return needsSpaceRight;
5825
- }
5826
- function adjustTooltipPosition(tPos, el, tooltipEl) {
5827
- // position must be reset before measurements are taken in adjustTooltipPosition
5828
- // otherwise text-wrapping from previous position makes width measurement inconsistent
5829
- tooltipEl.style.top = "";
5830
- tooltipEl.style.left = "";
5831
- const { spaceLeft, spaceRight, spaceBelow, spaceAbove } = getClosableElementMeasurements(el, tooltipEl);
5832
- const tooltipWidth = tooltipEl.getBoundingClientRect().width;
5833
- const tooltipHeight = tooltipEl.getBoundingClientRect().height;
5834
- const enoughSpaceAbove = spaceAbove > tooltipHeight;
5835
- const enoughSpaceBelow = spaceBelow > tooltipHeight;
5836
- // a tooltip should never be closer than 24px to the edge of a screen
5837
- const enoughSpaceLeft = spaceLeft - 24 > tooltipWidth;
5838
- const enoughSpaceRight = spaceRight - 24 > tooltipWidth;
5839
- const swapAbove = (position) => {
5840
- return !enoughSpaceAbove ? position.replace("top", "bottom") : position;
5841
- };
5842
- const swapBelow = (position) => {
5843
- return !enoughSpaceBelow && enoughSpaceAbove ? position.replace("bottom", "top") : position;
5844
- };
5845
- const swapLeft = (position, centeredPosition) => {
5846
- if (!enoughSpaceLeft && enoughSpaceRight) {
5847
- position = position.replace("left", "right");
5848
- }
5849
- else if (!enoughSpaceLeft && !enoughSpaceRight) {
5850
- position = centeredPosition;
5851
- }
5852
- return position;
5853
- };
5854
- const swapRight = (position, centeredPosition) => {
5855
- if (!enoughSpaceRight && enoughSpaceLeft) {
5856
- position = position.replace("right", "left");
5857
- }
5858
- else if (!enoughSpaceRight && !enoughSpaceLeft) {
5859
- position = centeredPosition;
5860
- }
5861
- return position;
5862
- };
5863
- // horizontal checks must occur before vertical checks, because horizontal can affect vertical positioning but not vice versa
5864
- switch (tPos) {
5865
- case "left":
5866
- tPos = swapLeft(tPos, "bottom");
5867
- case "right":
5868
- tPos = swapRight(tPos, "bottom");
5869
- case "top-left":
5870
- tPos = swapLeft(tPos, "top");
5871
- tPos = swapAbove(tPos);
5872
- case "top-right":
5873
- tPos = swapRight(tPos, "top");
5874
- tPos = swapAbove(tPos);
5875
- case "bottom-left":
5876
- tPos = swapLeft(tPos, "bottom");
5877
- tPos = swapBelow(tPos);
5878
- case "bottom-right":
5879
- tPos = swapRight(tPos, "bottom");
5880
- tPos = swapBelow(tPos);
5881
- case "top":
5882
- tPos = swapAbove(tPos);
5883
- case "bottom":
5884
- tPos = swapBelow(tPos);
5885
- }
5886
- return tPos;
5887
- }
5888
- function hasRoomRight(x, spaceNeeded) {
5889
- let horizOffset = 0;
5890
- // if (getTextDir() === "ltr") {
5891
- if (x.type === "click") {
5892
- // if it's a mouse event, deal with mouse coords
5893
- horizOffset = x.clientX;
5894
- // if it's a focus event, the offset is 0
5895
- }
5896
- else if (x.type === "focus") {
5897
- horizOffset = 0;
5898
- }
5899
- else {
5900
- // otherwise an element was passed, calculate how far it is from the edge of the window
5901
- let el = x; // re-assignment is for clarity
5902
- while (el) {
5903
- if (el.tagName == "BODY") {
5904
- // deal with browser quirks with body/window/document and page scroll
5905
- var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
5906
- horizOffset += el.offsetLeft - xScroll + el.clientLeft;
5907
- }
5908
- else {
5909
- // for all other non-BODY elements
5910
- horizOffset += el.offsetLeft - el.scrollLeft + el.clientLeft;
5911
- }
5912
- el = el.offsetParent;
5913
- }
5914
- // }
5915
- }
5916
- return window.innerWidth - horizOffset >= spaceNeeded;
5917
- }
5918
- function checkForActiveElInShadow(element) {
5919
- while (element && element.shadowRoot) {
5920
- element = element.shadowRoot.activeElement;
5921
- }
5922
- return element;
5923
- }
5924
- function checkForFocusableElInShadow(element) {
5925
- const selectors = [
5926
- "button",
5927
- "a",
5928
- "input",
5929
- "select",
5930
- "textarea",
5931
- "wm-button",
5932
- "wm-search",
5933
- "wm-select",
5934
- "wm-action-menu",
5935
- "wm-tab-item",
5936
- "wm-datepicker",
5937
- ];
5938
- let focusableEl = element;
5939
- selectors.forEach((selector) => {
5940
- if (focusableEl && focusableEl.shadowRoot) {
5941
- let elInShadow = focusableEl.shadowRoot.querySelector(selector);
5942
- if (elInShadow) {
5943
- if (selector.startsWith("wm-")) {
5944
- focusableEl = checkForFocusableElInShadow(elInShadow);
5945
- }
5946
- else {
5947
- focusableEl = elInShadow;
5948
- }
5949
- }
5950
- }
5951
- });
5952
- return focusableEl;
5953
- }
5954
- function isFocusable(element) {
5955
- if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute("tabIndex") !== null)) {
5956
- return true;
5957
- }
5958
- if (element.disabled) {
5959
- return false;
5960
- }
5961
- switch (element.nodeName) {
5962
- case "A":
5963
- return !!element.href && element.rel != "ignore";
5964
- case "INPUT":
5965
- return element.type != "hidden" && element.type != "file";
5966
- case "BUTTON":
5967
- case "SELECT":
5968
- case "TEXTAREA":
5969
- case "WM-BUTTON":
5970
- case "WM-SELECT":
5971
- case "WM-ACTION-MENU":
5972
- case "WM-DATEPICKER":
5973
- case "WM-TIMEPICKER":
5974
- case "WM-INPUT":
5975
- case "WM-TAG-INPUT":
5976
- case "WM-TAB-ITEM":
5977
- case "WM-SEARCH":
5978
- return true;
5979
- default:
5980
- return false;
5981
- }
5982
- }
5983
- function getFirstFocusableDescendant(element) {
5984
- if (isFocusable(element)) {
5985
- return checkForFocusableElInShadow(element);
5986
- }
5987
- else if (element.childNodes.length > 0) {
5988
- element.childNodes.forEach((i) => {
5989
- const childEl = getFirstFocusableDescendant(i);
5990
- return childEl && checkForFocusableElInShadow(childEl);
5991
- });
5992
- }
5993
- }
5994
- function hasValidType(file, types) {
5995
- const acceptedExtensions = types.split(" ");
5996
- const parts = file.name && file.name.split(".");
5997
- const ext = parts && parts.length > 1 && parts[parts.length - 1];
5998
- return ext
5999
- ? acceptedExtensions.includes(ext.toLowerCase())
6000
- : // fallback: if we couldn't obtain an extension,
6001
- // validate based on MIME type...
6002
- !!file.type
6003
- ? getAcceptedMimeTypesList(acceptedExtensions).includes(file.type)
6004
- : // ...and if that failed too, accept the file
6005
- // as it's preferable to accept an invalid file
6006
- // than refusing a valid one (back-end will take care of what slips through)
6007
- true;
6008
- }
6009
- // takes a string (space separated list of extensions), returns an array of strings (corresponding MIME types)
6010
- function getAcceptedMimeTypesList(acceptedExtensions) {
6011
- // this is just a list of common file types (regardless of whether they are/can be valid or not)
6012
- // front end checks are just a convenience to users, independent of security.
6013
- // it allows users to be notified of an invalid type as soon as they select the file, rather than when it gets uploaded
6014
- const lookupTable = {
6015
- aac: ["audio/aac"],
6016
- abw: ["application/x-abiword"],
6017
- arc: ["application/x-freearc"],
6018
- avi: ["video/x-msvideo"],
6019
- azw: ["application/vnd.amazon.ebook"],
6020
- bin: ["application/octet-stream"],
6021
- bmp: ["image/bmp"],
6022
- bz: ["application/x-bzip"],
6023
- bz2: ["application/x-bzip2"],
6024
- csh: ["application/x-csh"],
6025
- css: ["text/css"],
6026
- csv: ["text/csv"],
6027
- doc: ["application/msword"],
6028
- docx: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
6029
- eot: ["application/vnd.ms-fontobject"],
6030
- epub: ["application/epub+zip"],
6031
- gz: ["application/gzip"],
6032
- gif: ["image/gif"],
6033
- htm: ["text/html"],
6034
- html: ["text/html"],
6035
- ico: ["image/vnd.microsoft.icon"],
6036
- ics: ["text/calendar"],
6037
- jar: ["application/java-archive"],
6038
- jpeg: ["image/jpeg"],
6039
- jpg: ["image/jpeg"],
6040
- js: ["text/javascript"],
6041
- json: ["application/json"],
6042
- jsonld: ["application/ld+json"],
6043
- log: ["text/plain"],
6044
- mid: ["audio/x-midi"],
6045
- midi: ["audio/x-midi"],
6046
- mjs: ["text/javascript"],
6047
- mp3: ["audio/mpeg"],
6048
- mpeg: ["video/mpeg"],
6049
- mpkg: ["application/vnd.apple.installer+xml"],
6050
- odp: ["application/vnd.oasis.opendocument.presentation"],
6051
- ods: ["application/vnd.oasis.opendocument.spreadsheet"],
6052
- odt: ["application/vnd.oasis.opendocument.text"],
6053
- oga: ["audio/ogg"],
6054
- ogv: ["video/ogg"],
6055
- ogx: ["application/ogg"],
6056
- opus: ["audio/opus"],
6057
- otf: ["font/otf"],
6058
- png: ["image/png"],
6059
- pdf: ["application/pdf"],
6060
- php: ["application/php"],
6061
- ppt: ["application/vnd.ms-powerpoint"],
6062
- pptx: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
6063
- rar: ["application/vnd.rar", "application/x-rar", "application/x-rar-compressed"],
6064
- rtf: ["application/rtf"],
6065
- sh: ["application/x-sh"],
6066
- svg: ["image/svg+xml"],
6067
- swf: ["application/x-shockwave-flash"],
6068
- tar: ["application/x-tar"],
6069
- tif: ["image/tiff"],
6070
- tiff: ["image/tiff"],
6071
- ts: ["video/mp2t"],
6072
- ttf: ["font/ttf"],
6073
- txt: ["text/plain"],
6074
- vsd: ["application/vnd.visio"],
6075
- wav: ["audio/wav"],
6076
- weba: ["audio/webm"],
6077
- webm: ["video/webm"],
6078
- webp: ["image/webp"],
6079
- woff: ["font/woff"],
6080
- woff2: ["font/woff2"],
6081
- xhtml: ["application/xhtml+xml"],
6082
- xls: ["application/vnd.ms-excel"],
6083
- xlsx: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
6084
- xml: ["application/xml", "text/xml"],
6085
- xul: ["application/vnd.mozilla.xul+xml"],
6086
- zip: ["application/zip", "application/x-zip-compressed", "multipart/x-zip"],
6087
- "3gp": ["video/3gpp", "audio/3gpp"],
6088
- "3g2": ["video/3gpp2", "audio/3gpp2"],
6089
- "7z": ["application/x-7z-compressed"],
6090
- };
6091
- return acceptedExtensions.reduce((acc, ext) => acc.concat(lookupTable[ext]), []);
6092
- }
6093
- function snakeCaseToCamelCase(str) {
6094
- const snakeCaseRegexp = /^([a-z0-9]*)(_[a-z0-9]*)*$/g;
6095
- if (snakeCaseRegexp.test(str)) {
6096
- let camelCase = "";
6097
- let arr = str.split("_");
6098
- arr.forEach((word, idx) => {
6099
- camelCase += idx === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1);
6100
- });
6101
- return camelCase;
6102
- }
6103
- else {
6104
- return str;
6105
- }
6106
- }
6107
- function getNewIndexToFocus(currentIndex, direction, listLength) {
6108
- let newIndex = currentIndex;
6109
- if (direction === "ArrowDown") {
6110
- newIndex = (currentIndex + 1) % listLength;
6111
- }
6112
- if (direction === "ArrowUp") {
6113
- newIndex = currentIndex === 0 ? listLength - 1 : currentIndex - 1;
6114
- }
6115
- return newIndex;
6116
- }
6117
- function isRelatedTarget(ev, id) {
6118
- // used for onBlur events to check the element that has been clicked
6119
- const ids = id.split(" ");
6120
- return ev.relatedTarget && ids.includes(ev.relatedTarget.id);
6121
- }
6122
- /*
6123
- * this is going to be needed to solve the extra tabbing on navigator
6124
- * and for programmatic focus of tabs
6125
- * Here's a draft, not bug proof, see:
6126
- * https://stackoverflow.com/a/10730308/3741713
6127
-
6128
- function getKeyboardFocusableElements(element = document) {
6129
- const els = Array.from(element.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), wm-search, wm-timepicker, wm-tab-list, wm-tab-item, wm-button, wm-action-menu'));
6130
- return els.filter((el: Element) => !el.hasAttribute("disabled")) as HTMLElement[];
6131
- }
6132
-
6133
- export function getPreviousKeyboardFocusableElement(element: HTMLElement) {
6134
- const els = getKeyboardFocusableElements();
6135
- const current = els.indexOf(element);
6136
- return els[current - 1] as HTMLElement;
6137
- }
6138
-
6139
- export function getNextKeyboardFocusableElement(element: HTMLElement) {
6140
- const els = getKeyboardFocusableElements();
6141
- const current = els.indexOf(element);
6142
- return els[current + 1] as HTMLElement;
6143
- }
6344
+ const DEFAULT_LANGUAGE = "en";
6345
+ function getBrowserLang() {
6346
+ const langAttr = document.documentElement.getAttribute("lang");
6347
+ if (!!langAttr) {
6348
+ return langAttr;
6349
+ }
6350
+ else if (window.navigator && window.navigator.language) {
6351
+ const lang = window.navigator.languages ? window.navigator.languages[0] : window.navigator.language;
6352
+ return lang.slice(0, 2);
6353
+ }
6354
+ else {
6355
+ return DEFAULT_LANGUAGE;
6356
+ }
6357
+ }
6358
+ // prevents memory leak
6359
+ const cache = createIntlCache();
6360
+ const locale = getBrowserLang();
6361
+ const intl = createIntl({
6362
+ locale: locale,
6363
+ defaultLocale: "en",
6364
+ messages: lang[locale] || en,
6365
+ }, cache);
6366
+ function generateId() {
6367
+ return "wmcl-" + Math.random().toString(36).substr(2, 10);
6368
+ }
6369
+ function debounce(fn, wait) {
6370
+ let timeout;
6371
+ return function () {
6372
+ const context = this;
6373
+ const functionCall = () => fn.apply(context, arguments);
6374
+ clearTimeout(timeout);
6375
+ timeout = setTimeout(functionCall, wait);
6376
+ };
6377
+ }
6378
+ function getTextDir() {
6379
+ const dir = document.querySelector("html").getAttribute("dir");
6380
+ return dir ? dir.toLowerCase() : "";
6381
+ }
6382
+ function getPosition(el) {
6383
+ const coords = el.getBoundingClientRect();
6384
+ let x = coords.x;
6385
+ let y = coords.y;
6386
+ // Edge doesn't have x and y
6387
+ if (!x) {
6388
+ if (getTextDir() === "rtl") {
6389
+ x = coords.right;
6390
+ }
6391
+ else {
6392
+ x = coords.left;
6393
+ }
6394
+ y = coords.top;
6395
+ }
6396
+ return { x, y };
6397
+ }
6398
+ function findParentWithScrollbar(el) {
6399
+ while (!!el) {
6400
+ if (el.scrollHeight > el.clientHeight && ["scroll", "auto"].includes(window.getComputedStyle(el).overflowY)) {
6401
+ return el;
6402
+ }
6403
+ el = el.parentElement;
6404
+ }
6405
+ }
6406
+ function findParentWithHiddenOverflow(el) {
6407
+ while (!!el) {
6408
+ if (window.getComputedStyle(el).overflowY !== "visible") {
6409
+ return el;
6410
+ }
6411
+ el = el.parentElement;
6412
+ }
6413
+ }
6414
+ function getClosableElementMeasurements(fixedEl, closableEl) {
6415
+ const parent = findParentWithHiddenOverflow(fixedEl);
6416
+ // if parent is not found, measurements are checked against the viewport
6417
+ return {
6418
+ closableElHeight: closableEl.clientHeight,
6419
+ closableElWidth: closableEl.clientWidth,
6420
+ // NB boundingClientRect.bottom is space from top of viewport to bottom of el
6421
+ // to get space below the el -> height of viewport minus boundingClientRect.bottom
6422
+ spaceAbove: parent
6423
+ ? fixedEl.getBoundingClientRect().top - parent.getBoundingClientRect().top
6424
+ : fixedEl.getBoundingClientRect().top,
6425
+ // NB boundingClientRect.bottom is space from top of viewport to bottom of el
6426
+ // to get space below the el -> height of viewport minus boundingClientRect.bottom
6427
+ spaceBelow: parent
6428
+ ? parent.getBoundingClientRect().bottom - fixedEl.getBoundingClientRect().bottom
6429
+ : document.documentElement.clientHeight - fixedEl.getBoundingClientRect().bottom,
6430
+ spaceLeft: parent
6431
+ ? fixedEl.getBoundingClientRect().left - parent.getBoundingClientRect().left
6432
+ : fixedEl.getBoundingClientRect().left,
6433
+ spaceRight: parent
6434
+ ? parent.getBoundingClientRect().right - fixedEl.getBoundingClientRect().right
6435
+ : document.documentElement.clientWidth - fixedEl.getBoundingClientRect().right,
6436
+ };
6437
+ }
6438
+ function shouldOpenUp(fixedEl, //the element visible on the page when the component is closed
6439
+ closableEl, //the dropdown/popup/etc that becomes visible when the component is open
6440
+ offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
6441
+ offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
6442
+ ) {
6443
+ const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
6444
+ //we want to open up only if there's not enough space below AND there is enough space above
6445
+ const openUp = closableElHeight > spaceBelow + offsetBelow && closableElHeight <= spaceAbove + offsetAbove;
6446
+ return openUp;
6447
+ }
6448
+ function shouldOpenDown(fixedEl, //the element visible on the page when the component is closed
6449
+ closableEl, //the dropdown/popup/etc that becomes visible when the component is open
6450
+ offsetAbove = 0, // if closableEl covers a part of fixedEl, that part should be offset
6451
+ offsetBelow = 0 // if closableEl covers a part of fixedEl, that part should be offset
6452
+ ) {
6453
+ const { closableElHeight, spaceAbove, spaceBelow } = getClosableElementMeasurements(fixedEl, closableEl);
6454
+ //we want to open up only if there's not enough space below AND there is enough space above
6455
+ const openDown = closableElHeight > spaceAbove + offsetAbove && closableElHeight <= spaceBelow + offsetBelow;
6456
+ return openDown;
6457
+ }
6458
+ function shouldShiftRight(fixedEl, closableEl) {
6459
+ const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
6460
+ const needsSpaceLeft = closableElWidth > spaceLeft && spaceRight > spaceLeft;
6461
+ return needsSpaceLeft;
6462
+ }
6463
+ function shouldShiftLeft(fixedEl, closableEl) {
6464
+ const { closableElWidth, spaceLeft, spaceRight } = getClosableElementMeasurements(fixedEl, closableEl);
6465
+ const needsSpaceRight = closableElWidth > spaceRight && spaceLeft > spaceRight;
6466
+ return needsSpaceRight;
6467
+ }
6468
+ function adjustTooltipPosition(tPos, el, tooltipEl) {
6469
+ // position must be reset before measurements are taken in adjustTooltipPosition
6470
+ // otherwise text-wrapping from previous position makes width measurement inconsistent
6471
+ tooltipEl.style.top = "";
6472
+ tooltipEl.style.left = "";
6473
+ const { spaceLeft, spaceRight, spaceBelow, spaceAbove } = getClosableElementMeasurements(el, tooltipEl);
6474
+ const tooltipWidth = tooltipEl.getBoundingClientRect().width;
6475
+ const tooltipHeight = tooltipEl.getBoundingClientRect().height;
6476
+ const enoughSpaceAbove = spaceAbove > tooltipHeight;
6477
+ const enoughSpaceBelow = spaceBelow > tooltipHeight;
6478
+ // a tooltip should never be closer than 24px to the edge of a screen
6479
+ const enoughSpaceLeft = spaceLeft - 24 > tooltipWidth;
6480
+ const enoughSpaceRight = spaceRight - 24 > tooltipWidth;
6481
+ const swapAbove = (position) => {
6482
+ return !enoughSpaceAbove ? position.replace("top", "bottom") : position;
6483
+ };
6484
+ const swapBelow = (position) => {
6485
+ return !enoughSpaceBelow && enoughSpaceAbove ? position.replace("bottom", "top") : position;
6486
+ };
6487
+ const swapLeft = (position, centeredPosition) => {
6488
+ if (!enoughSpaceLeft && enoughSpaceRight) {
6489
+ position = position.replace("left", "right");
6490
+ }
6491
+ else if (!enoughSpaceLeft && !enoughSpaceRight) {
6492
+ position = centeredPosition;
6493
+ }
6494
+ return position;
6495
+ };
6496
+ const swapRight = (position, centeredPosition) => {
6497
+ if (!enoughSpaceRight && enoughSpaceLeft) {
6498
+ position = position.replace("right", "left");
6499
+ }
6500
+ else if (!enoughSpaceRight && !enoughSpaceLeft) {
6501
+ position = centeredPosition;
6502
+ }
6503
+ return position;
6504
+ };
6505
+ // horizontal checks must occur before vertical checks, because horizontal can affect vertical positioning but not vice versa
6506
+ switch (tPos) {
6507
+ case "left":
6508
+ tPos = swapLeft(tPos, "bottom");
6509
+ case "right":
6510
+ tPos = swapRight(tPos, "bottom");
6511
+ case "top-left":
6512
+ tPos = swapLeft(tPos, "top");
6513
+ tPos = swapAbove(tPos);
6514
+ case "top-right":
6515
+ tPos = swapRight(tPos, "top");
6516
+ tPos = swapAbove(tPos);
6517
+ case "bottom-left":
6518
+ tPos = swapLeft(tPos, "bottom");
6519
+ tPos = swapBelow(tPos);
6520
+ case "bottom-right":
6521
+ tPos = swapRight(tPos, "bottom");
6522
+ tPos = swapBelow(tPos);
6523
+ case "top":
6524
+ tPos = swapAbove(tPos);
6525
+ case "bottom":
6526
+ tPos = swapBelow(tPos);
6527
+ }
6528
+ return tPos;
6529
+ }
6530
+ function hasRoomRight(x, spaceNeeded) {
6531
+ let horizOffset = 0;
6532
+ // if (getTextDir() === "ltr") {
6533
+ if (x.type === "click") {
6534
+ // if it's a mouse event, deal with mouse coords
6535
+ horizOffset = x.clientX;
6536
+ // if it's a focus event, the offset is 0
6537
+ }
6538
+ else if (x.type === "focus") {
6539
+ horizOffset = 0;
6540
+ }
6541
+ else {
6542
+ // otherwise an element was passed, calculate how far it is from the edge of the window
6543
+ let el = x; // re-assignment is for clarity
6544
+ while (el) {
6545
+ if (el.tagName == "BODY") {
6546
+ // deal with browser quirks with body/window/document and page scroll
6547
+ var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
6548
+ horizOffset += el.offsetLeft - xScroll + el.clientLeft;
6549
+ }
6550
+ else {
6551
+ // for all other non-BODY elements
6552
+ horizOffset += el.offsetLeft - el.scrollLeft + el.clientLeft;
6553
+ }
6554
+ el = el.offsetParent;
6555
+ }
6556
+ // }
6557
+ }
6558
+ return window.innerWidth - horizOffset >= spaceNeeded;
6559
+ }
6560
+ function checkForActiveElInShadow(element) {
6561
+ while (element && element.shadowRoot) {
6562
+ element = element.shadowRoot.activeElement;
6563
+ }
6564
+ return element;
6565
+ }
6566
+ function checkForFocusableElInShadow(element) {
6567
+ const selectors = [
6568
+ "button",
6569
+ "a",
6570
+ "input",
6571
+ "select",
6572
+ "textarea",
6573
+ "wm-button",
6574
+ "wm-search",
6575
+ "wm-select",
6576
+ "wm-action-menu",
6577
+ "wm-tab-item",
6578
+ "wm-datepicker",
6579
+ ];
6580
+ let focusableEl = element;
6581
+ selectors.forEach((selector) => {
6582
+ if (focusableEl && focusableEl.shadowRoot) {
6583
+ let elInShadow = focusableEl.shadowRoot.querySelector(selector);
6584
+ if (elInShadow) {
6585
+ if (selector.startsWith("wm-")) {
6586
+ focusableEl = checkForFocusableElInShadow(elInShadow);
6587
+ }
6588
+ else {
6589
+ focusableEl = elInShadow;
6590
+ }
6591
+ }
6592
+ }
6593
+ });
6594
+ return focusableEl;
6595
+ }
6596
+ function isFocusable(element) {
6597
+ if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute("tabIndex") !== null)) {
6598
+ return true;
6599
+ }
6600
+ if (element.disabled) {
6601
+ return false;
6602
+ }
6603
+ switch (element.nodeName) {
6604
+ case "A":
6605
+ return !!element.href && element.rel != "ignore";
6606
+ case "INPUT":
6607
+ return element.type != "hidden" && element.type != "file";
6608
+ case "BUTTON":
6609
+ case "SELECT":
6610
+ case "TEXTAREA":
6611
+ case "WM-BUTTON":
6612
+ case "WM-SELECT":
6613
+ case "WM-ACTION-MENU":
6614
+ case "WM-DATEPICKER":
6615
+ case "WM-TIMEPICKER":
6616
+ case "WM-INPUT":
6617
+ case "WM-TAG-INPUT":
6618
+ case "WM-TAB-ITEM":
6619
+ case "WM-SEARCH":
6620
+ return true;
6621
+ default:
6622
+ return false;
6623
+ }
6624
+ }
6625
+ function getFirstFocusableDescendant(element) {
6626
+ if (isFocusable(element)) {
6627
+ return checkForFocusableElInShadow(element);
6628
+ }
6629
+ else if (element.childNodes.length > 0) {
6630
+ element.childNodes.forEach((i) => {
6631
+ const childEl = getFirstFocusableDescendant(i);
6632
+ return childEl && checkForFocusableElInShadow(childEl);
6633
+ });
6634
+ }
6635
+ }
6636
+ function hasValidType(file, types) {
6637
+ const acceptedExtensions = types.split(" ");
6638
+ const parts = file.name && file.name.split(".");
6639
+ const ext = parts && parts.length > 1 && parts[parts.length - 1];
6640
+ return ext
6641
+ ? acceptedExtensions.includes(ext.toLowerCase())
6642
+ : // fallback: if we couldn't obtain an extension,
6643
+ // validate based on MIME type...
6644
+ !!file.type
6645
+ ? getAcceptedMimeTypesList(acceptedExtensions).includes(file.type)
6646
+ : // ...and if that failed too, accept the file
6647
+ // as it's preferable to accept an invalid file
6648
+ // than refusing a valid one (back-end will take care of what slips through)
6649
+ true;
6650
+ }
6651
+ // takes a string (space separated list of extensions), returns an array of strings (corresponding MIME types)
6652
+ function getAcceptedMimeTypesList(acceptedExtensions) {
6653
+ // this is just a list of common file types (regardless of whether they are/can be valid or not)
6654
+ // front end checks are just a convenience to users, independent of security.
6655
+ // it allows users to be notified of an invalid type as soon as they select the file, rather than when it gets uploaded
6656
+ const lookupTable = {
6657
+ aac: ["audio/aac"],
6658
+ abw: ["application/x-abiword"],
6659
+ arc: ["application/x-freearc"],
6660
+ avi: ["video/x-msvideo"],
6661
+ azw: ["application/vnd.amazon.ebook"],
6662
+ bin: ["application/octet-stream"],
6663
+ bmp: ["image/bmp"],
6664
+ bz: ["application/x-bzip"],
6665
+ bz2: ["application/x-bzip2"],
6666
+ csh: ["application/x-csh"],
6667
+ css: ["text/css"],
6668
+ csv: ["text/csv"],
6669
+ doc: ["application/msword"],
6670
+ docx: ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
6671
+ eot: ["application/vnd.ms-fontobject"],
6672
+ epub: ["application/epub+zip"],
6673
+ gz: ["application/gzip"],
6674
+ gif: ["image/gif"],
6675
+ htm: ["text/html"],
6676
+ html: ["text/html"],
6677
+ ico: ["image/vnd.microsoft.icon"],
6678
+ ics: ["text/calendar"],
6679
+ jar: ["application/java-archive"],
6680
+ jpeg: ["image/jpeg"],
6681
+ jpg: ["image/jpeg"],
6682
+ js: ["text/javascript"],
6683
+ json: ["application/json"],
6684
+ jsonld: ["application/ld+json"],
6685
+ log: ["text/plain"],
6686
+ mid: ["audio/x-midi"],
6687
+ midi: ["audio/x-midi"],
6688
+ mjs: ["text/javascript"],
6689
+ mp3: ["audio/mpeg"],
6690
+ mpeg: ["video/mpeg"],
6691
+ mpkg: ["application/vnd.apple.installer+xml"],
6692
+ odp: ["application/vnd.oasis.opendocument.presentation"],
6693
+ ods: ["application/vnd.oasis.opendocument.spreadsheet"],
6694
+ odt: ["application/vnd.oasis.opendocument.text"],
6695
+ oga: ["audio/ogg"],
6696
+ ogv: ["video/ogg"],
6697
+ ogx: ["application/ogg"],
6698
+ opus: ["audio/opus"],
6699
+ otf: ["font/otf"],
6700
+ png: ["image/png"],
6701
+ pdf: ["application/pdf"],
6702
+ php: ["application/php"],
6703
+ ppt: ["application/vnd.ms-powerpoint"],
6704
+ pptx: ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
6705
+ rar: ["application/vnd.rar", "application/x-rar", "application/x-rar-compressed"],
6706
+ rtf: ["application/rtf"],
6707
+ sh: ["application/x-sh"],
6708
+ svg: ["image/svg+xml"],
6709
+ swf: ["application/x-shockwave-flash"],
6710
+ tar: ["application/x-tar"],
6711
+ tif: ["image/tiff"],
6712
+ tiff: ["image/tiff"],
6713
+ ts: ["video/mp2t"],
6714
+ ttf: ["font/ttf"],
6715
+ txt: ["text/plain"],
6716
+ vsd: ["application/vnd.visio"],
6717
+ wav: ["audio/wav"],
6718
+ weba: ["audio/webm"],
6719
+ webm: ["video/webm"],
6720
+ webp: ["image/webp"],
6721
+ woff: ["font/woff"],
6722
+ woff2: ["font/woff2"],
6723
+ xhtml: ["application/xhtml+xml"],
6724
+ xls: ["application/vnd.ms-excel"],
6725
+ xlsx: ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
6726
+ xml: ["application/xml", "text/xml"],
6727
+ xul: ["application/vnd.mozilla.xul+xml"],
6728
+ zip: ["application/zip", "application/x-zip-compressed", "multipart/x-zip"],
6729
+ "3gp": ["video/3gpp", "audio/3gpp"],
6730
+ "3g2": ["video/3gpp2", "audio/3gpp2"],
6731
+ "7z": ["application/x-7z-compressed"],
6732
+ };
6733
+ return acceptedExtensions.reduce((acc, ext) => acc.concat(lookupTable[ext]), []);
6734
+ }
6735
+ function snakeCaseToCamelCase(str) {
6736
+ const snakeCaseRegexp = /^([a-z0-9]*)(_[a-z0-9]*)*$/g;
6737
+ if (snakeCaseRegexp.test(str)) {
6738
+ let camelCase = "";
6739
+ let arr = str.split("_");
6740
+ arr.forEach((word, idx) => {
6741
+ camelCase += idx === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1);
6742
+ });
6743
+ return camelCase;
6744
+ }
6745
+ else {
6746
+ return str;
6747
+ }
6748
+ }
6749
+ function getNewIndexToFocus(currentIndex, direction, listLength) {
6750
+ let newIndex = currentIndex;
6751
+ if (direction === "ArrowDown") {
6752
+ newIndex = (currentIndex + 1) % listLength;
6753
+ }
6754
+ if (direction === "ArrowUp") {
6755
+ newIndex = currentIndex === 0 ? listLength - 1 : currentIndex - 1;
6756
+ }
6757
+ return newIndex;
6758
+ }
6759
+ function isRelatedTarget(ev, id) {
6760
+ // used for onBlur events to check the element that has been clicked
6761
+ const ids = id.split(" ");
6762
+ return ev.relatedTarget && ids.includes(ev.relatedTarget.id);
6763
+ }
6764
+ /*
6765
+ * this is going to be needed to solve the extra tabbing on navigator
6766
+ * and for programmatic focus of tabs
6767
+ * Here's a draft, not bug proof, see:
6768
+ * https://stackoverflow.com/a/10730308/3741713
6769
+
6770
+ function getKeyboardFocusableElements(element = document) {
6771
+ const els = Array.from(element.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), wm-search, wm-timepicker, wm-tab-list, wm-tab-item, wm-button, wm-action-menu'));
6772
+ return els.filter((el: Element) => !el.hasAttribute("disabled")) as HTMLElement[];
6773
+ }
6774
+
6775
+ export function getPreviousKeyboardFocusableElement(element: HTMLElement) {
6776
+ const els = getKeyboardFocusableElements();
6777
+ const current = els.indexOf(element);
6778
+ return els[current - 1] as HTMLElement;
6779
+ }
6780
+
6781
+ export function getNextKeyboardFocusableElement(element: HTMLElement) {
6782
+ const els = getKeyboardFocusableElements();
6783
+ const current = els.indexOf(element);
6784
+ return els[current + 1] as HTMLElement;
6785
+ }
6144
6786
  */
6145
6787
 
6146
6788
  exports.adjustTooltipPosition = adjustTooltipPosition;