@clickview/lite 0.0.24-rc.4 → 0.0.24

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 (194) hide show
  1. package/dist/css/11.chunk.css.map +1 -1
  2. package/dist/css/12.chunk.css.map +1 -1
  3. package/dist/css/13.chunk.css.map +1 -1
  4. package/dist/css/14.chunk.css.map +1 -1
  5. package/dist/css/15.chunk.css.map +1 -1
  6. package/dist/css/16.chunk.css.map +1 -1
  7. package/dist/css/17.chunk.css.map +1 -1
  8. package/dist/css/18.chunk.css.map +1 -1
  9. package/dist/css/20.chunk.css.map +1 -1
  10. package/dist/css/29.chunk.css.map +1 -1
  11. package/dist/css/3.chunk.css.map +1 -1
  12. package/dist/css/30.chunk.css.map +1 -1
  13. package/dist/css/31.chunk.css.map +1 -1
  14. package/dist/css/33.chunk.css.map +1 -1
  15. package/dist/css/38.chunk.css +11 -34
  16. package/dist/css/38.chunk.css.map +1 -1
  17. package/dist/css/4.chunk.css +3 -3
  18. package/dist/css/44.chunk.css +11 -3
  19. package/dist/css/44.chunk.css.map +1 -1
  20. package/dist/css/45.chunk.css +38 -0
  21. package/dist/css/45.chunk.css.map +1 -0
  22. package/dist/css/5.chunk.css.map +1 -1
  23. package/dist/css/52.chunk.css +52 -0
  24. package/dist/css/52.chunk.css.map +1 -0
  25. package/dist/css/59.chunk.css +14 -0
  26. package/dist/css/59.chunk.css.map +1 -0
  27. package/dist/css/6.chunk.css.map +1 -1
  28. package/dist/css/60.chunk.css +43 -0
  29. package/dist/css/60.chunk.css.map +1 -0
  30. package/dist/en.json +1 -1
  31. package/dist/libs/shared/src/components/curriculum-links/CurriculumLinks.d.ts +9 -0
  32. package/dist/libs/shared/src/components/widgets/items/resource-widget-item/ResourceWidgetItem.d.ts +12 -0
  33. package/dist/libs/shared/src/enums/CurriculumType.d.ts +6 -0
  34. package/dist/libs/shared/src/flight-requests/ClassificationRequests.d.ts +1 -0
  35. package/dist/libs/shared/src/flight-requests/ResourceRequests.d.ts +11 -0
  36. package/dist/libs/shared/src/interfaces/collections/SubtitleCollection.d.ts +3 -0
  37. package/dist/libs/shared/src/interfaces/models/Curriculum.d.ts +14 -0
  38. package/dist/libs/shared/src/interfaces/models/FileUpload.d.ts +20 -0
  39. package/dist/libs/shared/src/interfaces/models/Language.d.ts +4 -0
  40. package/dist/libs/shared/src/interfaces/models/Pdf.d.ts +4 -0
  41. package/dist/libs/shared/src/interfaces/models/Subtitle.d.ts +7 -0
  42. package/dist/libs/shared/src/interfaces/models/index.d.ts +1 -0
  43. package/dist/libs/shared/src/interfaces/requests/UpdateObjectChannel.d.ts +3 -0
  44. package/dist/libs/shared/src/interfaces/requests/UpdateObjectRating.d.ts +3 -0
  45. package/dist/libs/shared/src/interfaces/requests/UpdateResourceRequest.d.ts +3 -0
  46. package/dist/projects/lite/src/app.d.ts +1 -0
  47. package/dist/projects/lite/src/shared/components/play-page/PlayPage.d.ts +2 -1
  48. package/dist/projects/lite/src/shared/components/synopsis/Synopsis.d.ts +3 -1
  49. package/dist/projects/lite/src/shared/components/video-details/VideoDetails.d.ts +2 -0
  50. package/dist/projects/lite/src/shared/constants/MinimumGlanceHeight.d.ts +1 -0
  51. package/dist/projects/lite/src/shared/views/preview-pdf/PreviewPdfView.d.ts +7 -0
  52. package/dist/scripts/0-b02efe11fb.chunk.js +1 -0
  53. package/dist/scripts/1-4f19a5caea.chunk.js +17 -0
  54. package/dist/scripts/1.chunk.js.map +1 -1
  55. package/dist/scripts/10.chunk.js +484 -1203
  56. package/dist/scripts/10.chunk.js.map +1 -1
  57. package/dist/scripts/11-32e30d10ce.chunk.js +1 -0
  58. package/dist/scripts/11.chunk.js +289 -1388
  59. package/dist/scripts/11.chunk.js.map +1 -1
  60. package/dist/scripts/12-72a5373486.chunk.js +1 -0
  61. package/dist/scripts/12.chunk.js +1371 -283
  62. package/dist/scripts/12.chunk.js.map +1 -1
  63. package/dist/scripts/13-1cd85ad3ee.chunk.js +1 -0
  64. package/dist/scripts/13.chunk.js +361 -394
  65. package/dist/scripts/13.chunk.js.map +1 -1
  66. package/dist/scripts/14-3d60b8ee85.chunk.js +1 -0
  67. package/dist/scripts/14.chunk.js +793 -332
  68. package/dist/scripts/14.chunk.js.map +1 -1
  69. package/dist/scripts/15-90226fb996.chunk.js +1 -0
  70. package/dist/scripts/15.chunk.js +295 -214
  71. package/dist/scripts/15.chunk.js.map +1 -1
  72. package/dist/scripts/16-913b2535ea.chunk.js +1 -0
  73. package/dist/scripts/16.chunk.js +530 -434
  74. package/dist/scripts/16.chunk.js.map +1 -1
  75. package/dist/scripts/17-d6c19ccb60.chunk.js +1 -0
  76. package/dist/scripts/17.chunk.js +296 -170
  77. package/dist/scripts/17.chunk.js.map +1 -1
  78. package/dist/scripts/18-33efcac0c6.chunk.js +1 -0
  79. package/dist/scripts/18.chunk.js +265 -199
  80. package/dist/scripts/18.chunk.js.map +1 -1
  81. package/dist/scripts/19-2380200cfb.chunk.js +1 -0
  82. package/dist/scripts/19.chunk.js +7 -3
  83. package/dist/scripts/19.chunk.js.map +1 -1
  84. package/dist/scripts/2-53e37c2047.chunk.js +1 -0
  85. package/dist/scripts/2.chunk.js +18673 -622
  86. package/dist/scripts/2.chunk.js.map +1 -1
  87. package/dist/scripts/20-ca85f0514e.chunk.js +1 -0
  88. package/dist/scripts/20.chunk.js +1824 -221
  89. package/dist/scripts/20.chunk.js.map +1 -1
  90. package/dist/scripts/21-ef4a226771.chunk.js +1 -0
  91. package/dist/scripts/22-99c04e164f.chunk.js +1 -0
  92. package/dist/scripts/23-028eb81a43.chunk.js +1 -0
  93. package/dist/scripts/23.chunk.js +1 -1
  94. package/dist/scripts/23.chunk.js.map +1 -1
  95. package/dist/scripts/24-68f8df3eca.chunk.js +1 -0
  96. package/dist/scripts/24.chunk.js.map +1 -1
  97. package/dist/scripts/25-7ad07f87d4.chunk.js +1 -0
  98. package/dist/scripts/25.chunk.js.map +1 -1
  99. package/dist/scripts/26-f3dcacfe4f.chunk.js +1 -0
  100. package/dist/scripts/26.chunk.js +1 -1
  101. package/dist/scripts/26.chunk.js.map +1 -1
  102. package/dist/scripts/27-e844268f38.chunk.js +1 -0
  103. package/dist/scripts/28-853bc5de1f.chunk.js +1 -0
  104. package/dist/scripts/29-b164ecafe9.chunk.js +1 -0
  105. package/dist/scripts/29.chunk.js +435 -500
  106. package/dist/scripts/29.chunk.js.map +1 -1
  107. package/dist/scripts/3-a1bd8c9016.chunk.js +7 -0
  108. package/dist/scripts/3.chunk.js +625 -18676
  109. package/dist/scripts/3.chunk.js.map +1 -1
  110. package/dist/scripts/30-2cfcf52ea1.chunk.js +1 -0
  111. package/dist/scripts/30.chunk.js +634 -429
  112. package/dist/scripts/30.chunk.js.map +1 -1
  113. package/dist/scripts/31-e6a8291d2f.chunk.js +1 -0
  114. package/dist/scripts/31.chunk.js +371 -670
  115. package/dist/scripts/31.chunk.js.map +1 -1
  116. package/dist/scripts/32-7030dc98ed.chunk.js +1 -0
  117. package/dist/scripts/32.chunk.js +27 -54
  118. package/dist/scripts/32.chunk.js.map +1 -1
  119. package/dist/scripts/33-47b0ac90bd.chunk.js +1 -0
  120. package/dist/scripts/33.chunk.js +700 -312
  121. package/dist/scripts/33.chunk.js.map +1 -1
  122. package/dist/scripts/34-2de007b628.chunk.js +1 -0
  123. package/dist/scripts/34.chunk.js +3 -3
  124. package/dist/scripts/34.chunk.js.map +1 -1
  125. package/dist/scripts/35-d2fb66920b.chunk.js +1 -0
  126. package/dist/scripts/36-bc85df33de.chunk.js +1 -0
  127. package/dist/scripts/36.chunk.js.map +1 -1
  128. package/dist/scripts/37-e26652840b.chunk.js +1 -0
  129. package/dist/scripts/37.chunk.js +288 -464
  130. package/dist/scripts/37.chunk.js.map +1 -1
  131. package/dist/scripts/38-0b6a6b9619.chunk.js +1 -0
  132. package/dist/scripts/39-6549f483c6.chunk.js +1 -0
  133. package/dist/scripts/39.chunk.js +1 -1
  134. package/dist/scripts/39.chunk.js.map +1 -1
  135. package/dist/scripts/4-9e83a22d7a.chunk.js +1 -0
  136. package/dist/scripts/4.chunk.js +259 -1021
  137. package/dist/scripts/4.chunk.js.map +1 -1
  138. package/dist/scripts/40-8e6e9d285f.chunk.js +1 -0
  139. package/dist/scripts/41-2b44a2e66f.chunk.js +1 -0
  140. package/dist/scripts/42-9e75f420d8.chunk.js +1 -0
  141. package/dist/scripts/42.chunk.js.map +1 -1
  142. package/dist/scripts/43-1141245420.chunk.js +1 -0
  143. package/dist/scripts/44-9bc4201e0f.chunk.js +1 -0
  144. package/dist/scripts/45-5ded8ca3db.chunk.js +1 -0
  145. package/dist/scripts/46-2afd7ee1fb.chunk.js +1 -0
  146. package/dist/scripts/47-ab30686138.chunk.js +1 -0
  147. package/dist/scripts/48-d9cd99d55e.chunk.js +1 -0
  148. package/dist/scripts/49-f43a08f90b.chunk.js +1 -0
  149. package/dist/scripts/5-974660e17b.chunk.js +1 -0
  150. package/dist/scripts/5.chunk.js +1017 -259
  151. package/dist/scripts/5.chunk.js.map +1 -1
  152. package/dist/scripts/50-af699c531e.chunk.js +1 -0
  153. package/dist/scripts/51-aa7b835007.chunk.js +1 -0
  154. package/dist/scripts/52-805f7fe04d.chunk.js +1 -0
  155. package/dist/scripts/53-d75ca53045.chunk.js +1 -0
  156. package/dist/scripts/54-2e75bad46f.chunk.js +1 -0
  157. package/dist/scripts/55-ed637c4847.chunk.js +1 -0
  158. package/dist/scripts/55.chunk.js.map +1 -1
  159. package/dist/scripts/56-2ed3b5764b.chunk.js +1 -0
  160. package/dist/scripts/57-e51101c8a1.chunk.js +1 -0
  161. package/dist/scripts/58-9a32a6fb2d.chunk.js +1 -0
  162. package/dist/scripts/59-da8a8c97a9.chunk.js +1 -0
  163. package/dist/scripts/6-6ac39034e0.chunk.js +1 -0
  164. package/dist/scripts/6.chunk.js +291 -1250
  165. package/dist/scripts/6.chunk.js.map +1 -1
  166. package/dist/scripts/60-5713de53e2.chunk.js +1 -0
  167. package/dist/scripts/61-7d2ad17963.chunk.js +1 -0
  168. package/dist/scripts/62-a0a69501ac.chunk.js +1 -0
  169. package/dist/scripts/63-c921b87f3f.chunk.js +1 -0
  170. package/dist/scripts/64-87c1cf6985.chunk.js +1 -0
  171. package/dist/scripts/65-2322082836.chunk.js +1 -0
  172. package/dist/scripts/66-6d5356f6ce.chunk.js +1 -0
  173. package/dist/scripts/67-2e0d661c52.chunk.js +1 -0
  174. package/dist/scripts/7-5ac5be64dd.chunk.js +1 -0
  175. package/dist/scripts/7.chunk.js +1 -1
  176. package/dist/scripts/76.chunk.js +3 -3
  177. package/dist/scripts/76.chunk.js.map +1 -1
  178. package/dist/scripts/79.chunk.js +931 -347
  179. package/dist/scripts/79.chunk.js.map +1 -1
  180. package/dist/scripts/8-95563e3d36.chunk.js +1 -0
  181. package/dist/scripts/8.chunk.js +14 -920
  182. package/dist/scripts/8.chunk.js.map +1 -1
  183. package/dist/scripts/80.chunk.js +22 -313
  184. package/dist/scripts/80.chunk.js.map +1 -1
  185. package/dist/scripts/9.chunk.js +320 -17
  186. package/dist/scripts/9.chunk.js.map +1 -1
  187. package/dist/scripts/bundle-9ed1e126dd.min.js +15 -0
  188. package/dist/scripts/bundle.js +147 -121
  189. package/dist/scripts/bundle.js.map +1 -1
  190. package/dist/scripts/bundles.json +2 -2
  191. package/dist/scripts/pdf.worker.entry.worker.js +46239 -0
  192. package/dist/scripts/pdf.worker.entry.worker.js.map +1 -0
  193. package/dist/scripts/polyfills-2723daf478.min.js +1 -0
  194. package/package.json +2 -2
@@ -1,1025 +1,331 @@
1
1
  (window["webpackJsonp_clickview_lite"] = window["webpackJsonp_clickview_lite"] || []).push([[4],{
2
2
 
3
- /***/ "../../libs/shared/src/components/widgets/fixed-widget/FixedWidget.tsx":
4
- /*!*****************************************************************************************************************!*\
5
- !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/components/widgets/fixed-widget/FixedWidget.tsx ***!
6
- \*****************************************************************************************************************/
7
- /*! exports provided: FixedWidget */
3
+ /***/ "../../libs/shared/src/components/forms/form-buttons/FormButtons.tsx":
4
+ /*!***************************************************************************************************************!*\
5
+ !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/components/forms/form-buttons/FormButtons.tsx ***!
6
+ \***************************************************************************************************************/
7
+ /*! exports provided: FormButtons */
8
8
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
9
9
 
10
10
  "use strict";
11
11
  __webpack_require__.r(__webpack_exports__);
12
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FixedWidget", function() { return Memoized; });
12
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormButtons", function() { return FormButtons; });
13
13
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
14
14
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
15
- /* harmony import */ var _common_src_backbone_services_LanguageService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../common/src/backbone/services/LanguageService */ "../../libs/common/src/backbone/services/LanguageService.tsx");
16
- /* harmony import */ var _enums_CssMeasurement__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../enums/CssMeasurement */ "../../libs/shared/src/enums/CssMeasurement.ts");
17
- /* harmony import */ var _widget_button_WidgetButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../widget-button/WidgetButton */ "../../libs/shared/src/components/widgets/widget-button/WidgetButton.tsx");
18
- /* harmony import */ var _sliding_list_SlidingListContainer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../sliding-list/SlidingListContainer */ "../../libs/shared/src/components/widgets/sliding-list/SlidingListContainer.tsx");
19
- /* harmony import */ var _hooks_UseGetMediaQueryString__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../hooks/UseGetMediaQueryString */ "../../libs/shared/src/hooks/UseGetMediaQueryString.ts");
20
- /* harmony import */ var _hooks_UseHover__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../hooks/UseHover */ "../../libs/shared/src/hooks/UseHover.ts");
21
- /* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../interfaces */ "../../libs/shared/src/interfaces/index.ts");
22
- /* harmony import */ var _enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../enums/WidgetInteraction */ "../../libs/shared/src/enums/WidgetInteraction.ts");
23
- /* harmony import */ var _hooks_UseLazyLoad__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../hooks/UseLazyLoad */ "../../libs/shared/src/hooks/UseLazyLoad.ts");
24
- /* harmony import */ var _app_link_AppLink__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../app-link/AppLink */ "../../libs/shared/src/components/app-link/AppLink.tsx");
25
- /* harmony import */ var _svg_container_SvgContainer__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../svg-container/SvgContainer */ "../../libs/shared/src/components/svg-container/SvgContainer.tsx");
26
- /* harmony import */ var _utils_SvgHelper__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../utils/SvgHelper */ "../../libs/shared/src/utils/SvgHelper.ts");
27
- /* harmony import */ var _enums_ThumbnailSize__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../enums/ThumbnailSize */ "../../libs/shared/src/enums/ThumbnailSize.ts");
28
- /* harmony import */ var _utils_WidgetHelper__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../utils/WidgetHelper */ "../../libs/shared/src/utils/WidgetHelper.ts");
29
- /* harmony import */ var _analytics_src_AnalyticsHelper__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../../../analytics/src/AnalyticsHelper */ "../../libs/analytics/src/AnalyticsHelper.ts");
30
- /* harmony import */ var _PartialFixedWidget__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./PartialFixedWidget */ "../../libs/shared/src/components/widgets/fixed-widget/PartialFixedWidget.tsx");
31
- /* harmony import */ var _FixedWidgetUtils__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./FixedWidgetUtils */ "../../libs/shared/src/components/widgets/fixed-widget/FixedWidgetUtils.ts");
32
- /* harmony import */ var _FixedWidgetReducer__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./FixedWidgetReducer */ "../../libs/shared/src/components/widgets/fixed-widget/FixedWidgetReducer.tsx");
33
- /* harmony import */ var _fixed_widget_scss__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./fixed-widget.scss */ "../../libs/shared/src/components/widgets/fixed-widget/fixed-widget.scss");
34
- /* harmony import */ var _fixed_widget_scss__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_fixed_widget_scss__WEBPACK_IMPORTED_MODULE_19__);
35
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
36
-
37
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
38
-
39
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
40
-
41
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
42
-
43
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
44
-
45
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
- var namespace = 'shared.fixedWidget';
68
- FixedWidget.defaultProps = {
69
- type: _interfaces__WEBPACK_IMPORTED_MODULE_7__["WidgetType"].Row,
70
- minimumItemCount: 0,
71
- paddingSize: '3'
72
- };
73
-
74
- function FixedWidget(props) {
75
- var _a, _b, _c, _d, _e;
76
-
77
- var widgetType = props.type,
78
- _props$analyticsData = props.analyticsData,
79
- analyticsData = _props$analyticsData === void 0 ? {} : _props$analyticsData; // Map deprecated resources tile widget type to row type
80
-
81
- if (widgetType === _interfaces__WEBPACK_IMPORTED_MODULE_7__["WidgetType"].ResourcesTile) widgetType = _interfaces__WEBPACK_IMPORTED_MODULE_7__["WidgetType"].Row;
82
-
83
- var _React$useState = react__WEBPACK_IMPORTED_MODULE_0__["useState"](null),
84
- _React$useState2 = _slicedToArray(_React$useState, 2),
85
- initialTouchX = _React$useState2[0],
86
- setInitialTouchX = _React$useState2[1];
87
-
88
- var _React$useState3 = react__WEBPACK_IMPORTED_MODULE_0__["useState"](null),
89
- _React$useState4 = _slicedToArray(_React$useState3, 2),
90
- containerWidth = _React$useState4[0],
91
- setContainerWidth = _React$useState4[1];
92
-
93
- var _React$useState5 = react__WEBPACK_IMPORTED_MODULE_0__["useState"](0),
94
- _React$useState6 = _slicedToArray(_React$useState5, 2),
95
- percentageDragged = _React$useState6[0],
96
- setPercentageDragged = _React$useState6[1];
97
-
98
- var _React$useReducer = react__WEBPACK_IMPORTED_MODULE_0__["useReducer"](_FixedWidgetReducer__WEBPACK_IMPORTED_MODULE_18__["FixedWidgetReducer"], _FixedWidgetReducer__WEBPACK_IMPORTED_MODULE_18__["initialWidgetState"], _FixedWidgetReducer__WEBPACK_IMPORTED_MODULE_18__["lazyWidgetInit"]),
99
- _React$useReducer2 = _slicedToArray(_React$useReducer, 2),
100
- state = _React$useReducer2[0],
101
- dispatch = _React$useReducer2[1];
102
-
103
- var containerRef = react__WEBPACK_IMPORTED_MODULE_0__["useRef"](null);
104
-
105
- var _useHover = Object(_hooks_UseHover__WEBPACK_IMPORTED_MODULE_6__["useHover"])(),
106
- _useHover2 = _slicedToArray(_useHover, 2),
107
- buttonsRef = _useHover2[0],
108
- isHovering = _useHover2[1];
109
-
110
- var _React$useState7 = react__WEBPACK_IMPORTED_MODULE_0__["useState"](false),
111
- _React$useState8 = _slicedToArray(_React$useState7, 2),
112
- isHoveringOnFarLeft = _React$useState8[0],
113
- setIsHoveringOnFarLeft = _React$useState8[1];
114
-
115
- var _React$useState9 = react__WEBPACK_IMPORTED_MODULE_0__["useState"](false),
116
- _React$useState10 = _slicedToArray(_React$useState9, 2),
117
- isHoveringOnFarRight = _React$useState10[0],
118
- setIsHoveringOnFarRight = _React$useState10[1];
119
-
120
- var _useLazyLoad = Object(_hooks_UseLazyLoad__WEBPACK_IMPORTED_MODULE_9__["useLazyLoad"])(!props.lazyLoad),
121
- ref = _useLazyLoad.ref,
122
- shouldFetch = _useLazyLoad.inView;
123
-
124
- var mediaQuery = Object(_hooks_UseGetMediaQueryString__WEBPACK_IMPORTED_MODULE_5__["useGetMediaQueryString"])();
125
- react__WEBPACK_IMPORTED_MODULE_0__["useEffect"](function () {
126
- dispatch({
127
- type: _enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_8__["WidgetInteraction"].Resize,
128
- payload: {
129
- mediaQuery: mediaQuery,
130
- type: widgetType,
131
- contents: props.contents,
132
- collection: state.collection
133
- }
134
- });
135
- }, [mediaQuery]);
136
- react__WEBPACK_IMPORTED_MODULE_0__["useEffect"](function () {
137
- if (!props.prefetched) return; // If the collection changes, re-initialize the widget state.
138
-
139
- dispatch({
140
- type: _enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_8__["WidgetInteraction"].Init,
141
- payload: {
142
- mediaQuery: mediaQuery,
143
- type: widgetType,
144
- contents: props.contents,
145
- collection: props.collection
146
- }
147
- });
148
- }, [props.collection, props.prefetched]);
149
- var response = Object(_FixedWidgetUtils__WEBPACK_IMPORTED_MODULE_17__["useFetchData"])(props, dispatch, mediaQuery, shouldFetch);
150
-
151
- function onSetIsHovering(hovering, index) {
152
- if (state.collection.length === state.viewableItems) {
153
- setIsHoveringOnFarLeft(hovering);
154
- setIsHoveringOnFarRight(hovering);
155
- return;
156
- } // This callback will hide the far left button if the user is hovering on the far left widget item.
157
- // Same goes for the far right button & widget item.
158
-
159
-
160
- if (index + 1 === state.collection.length) {
161
- setIsHoveringOnFarRight(hovering);
162
- return;
163
- }
164
-
165
- if (index === 0) {
166
- setIsHoveringOnFarLeft(hovering);
167
- return;
168
- }
169
-
170
- if ((index + 1 - state.offset % state.viewableItems) % state.viewableItems === 0) {
171
- setIsHoveringOnFarRight(hovering);
172
- return;
173
- }
174
-
175
- if ((index - state.offset % state.viewableItems) % state.viewableItems === 0) {
176
- setIsHoveringOnFarLeft(hovering);
177
- return;
178
- }
179
- }
180
-
181
- var widgetContext = {
182
- type: state.type,
183
- size: state.currentSize,
184
- collectionSize: state.collection.length,
185
- contents: props.contents
186
- };
187
- var data = Object(_FixedWidgetUtils__WEBPACK_IMPORTED_MODULE_17__["formatData"])(props, ((_a = response) === null || _a === void 0 ? void 0 : _a.data) || props.collection);
188
- if ((_b = response) === null || _b === void 0 ? void 0 : _b.hasError) return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null);
189
-
190
- if (!props.prefetched && !((_c = response) === null || _c === void 0 ? void 0 : _c.statusCode)) {
191
- return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
192
- ref: ref
193
- }, react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_PartialFixedWidget__WEBPACK_IMPORTED_MODULE_16__["PartialFixedWidget"], {
194
- type: widgetType
195
- }));
196
- }
197
-
198
- if (!state.collection.length || state.collection.length < props.minimumItemCount) return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null);
199
- var WidgetItemComponent = props.childComponent;
200
-
201
- var getSliderAnalyticsData = function getSliderAnalyticsData(type) {
202
- var _a, _b;
203
-
204
- return Object.assign({
205
- id: (_a = data) === null || _a === void 0 ? void 0 : _a.id,
206
- name: (_b = data) === null || _b === void 0 ? void 0 : _b.name,
207
- direction: type === _enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_8__["WidgetInteraction"].Next ? 'right' : 'left'
208
- }, props.analyticsData);
209
- };
210
-
211
- return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
212
- className: "pb-3 px-".concat(props.paddingSize, " mx-n").concat(props.paddingSize, " overflow-hidden-x")
213
- }, react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
214
- className: 'mb-1'
215
- }, react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_app_link_AppLink__WEBPACK_IMPORTED_MODULE_10__["AppLink"], {
216
- appLink: Object(_FixedWidgetUtils__WEBPACK_IMPORTED_MODULE_17__["getCollectionAppLink"])(props.appLink, data),
217
- analyticsData: Object.assign({
218
- id: (_d = data) === null || _d === void 0 ? void 0 : _d.id,
219
- name: (_e = data) === null || _e === void 0 ? void 0 : _e.name
220
- }, props.analyticsData),
221
- analyticsOptions: _utils_WidgetHelper__WEBPACK_IMPORTED_MODULE_14__["WidgetHelper"].getSliderHeadingAnalyticsOptions()
222
- }, react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("h2", {
223
- className: "".concat(_fixed_widget_scss__WEBPACK_IMPORTED_MODULE_19___default.a.heading, " ").concat(props.appLink ? _fixed_widget_scss__WEBPACK_IMPORTED_MODULE_19___default.a.link : '', " h4 mb-0 d-inline-block align-top pl-1")
224
- }, data.name, !!props.appLink && react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_svg_container_SvgContainer__WEBPACK_IMPORTED_MODULE_11__["SvgContainer"], {
225
- svgName: _utils_SvgHelper__WEBPACK_IMPORTED_MODULE_12__["cvSvgLibrary"].ChevronRight,
226
- size: _svg_container_SvgContainer__WEBPACK_IMPORTED_MODULE_11__["SvgContainerSize"].Small
227
- })), props.settingsAppLink && react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_app_link_AppLink__WEBPACK_IMPORTED_MODULE_10__["AppLink"], {
228
- appLink: props.settingsAppLink
229
- }, react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_svg_container_SvgContainer__WEBPACK_IMPORTED_MODULE_11__["SvgContainer"], {
230
- svgName: _utils_SvgHelper__WEBPACK_IMPORTED_MODULE_12__["cvSvgLibrary"].Cog,
231
- className: 'd-inline-block svg-container cursor-pointer',
232
- title: _common_src_backbone_services_LanguageService__WEBPACK_IMPORTED_MODULE_1__["LanguageService"].getPhrase(namespace, 'preferencesTooltip'),
233
- tooltipPlacement: 'right'
234
- }))), data.description && react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("p", {
235
- className: 'text-truncate pl-1 mb-0 description'
236
- }, data.description)), react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
237
- ref: buttonsRef,
238
- className: 'position-relative'
239
- }, !isHoveringOnFarLeft && react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
240
- className: _fixed_widget_scss__WEBPACK_IMPORTED_MODULE_19___default.a.leftOverflowGradient
241
- }), react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_widget_button_WidgetButton__WEBPACK_IMPORTED_MODULE_3__["WidgetButton"], {
242
- direction: _widget_button_WidgetButton__WEBPACK_IMPORTED_MODULE_3__["WidgetButtonDirection"].Left,
243
- onClick: function onClick() {
244
- dispatch({
245
- type: _enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_8__["WidgetInteraction"].Previous
246
- });
247
- _analytics_src_AnalyticsHelper__WEBPACK_IMPORTED_MODULE_15__["AnalyticsHelper"].logUserAction(getSliderAnalyticsData(_enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_8__["WidgetInteraction"].Previous), _utils_WidgetHelper__WEBPACK_IMPORTED_MODULE_14__["WidgetHelper"].getSliderAnalyticsOptions());
248
- },
249
- hide: isHoveringOnFarLeft || state.offset <= state.collection.length && !(isHovering && state.offset !== state.viewableItems),
250
- contents: props.contents
251
- }), react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_sliding_list_SlidingListContainer__WEBPACK_IMPORTED_MODULE_4__["SlidingListContainer"], {
252
- position: state.position,
253
- positionType: _enums_CssMeasurement__WEBPACK_IMPORTED_MODULE_2__["CssMeasurement"].Percentage,
254
- onTouchMove: Object(_FixedWidgetUtils__WEBPACK_IMPORTED_MODULE_17__["getOnTouchStart"])(state, containerRef, containerWidth, setContainerWidth, initialTouchX, setInitialTouchX, setPercentageDragged),
255
- onTouchEnd: Object(_FixedWidgetUtils__WEBPACK_IMPORTED_MODULE_17__["getOnTouchEnd"])(containerRef, setInitialTouchX, percentageDragged, setPercentageDragged, dispatch),
256
- ref: containerRef,
257
- percentageDragged: percentageDragged
258
- }, state.collection.map(function (widgetItem, index) {
259
- var _a;
260
-
261
- return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](WidgetItemComponent, {
262
- key: widgetItem.id,
263
- data: widgetItem,
264
- appLink: props.childAppLink,
265
- context: widgetContext,
266
- preloadImage: Object(_FixedWidgetUtils__WEBPACK_IMPORTED_MODULE_17__["getShouldPreload"])(state)(widgetItem),
267
- thumbnailSize: props.thumbnailSize || _enums_ThumbnailSize__WEBPACK_IMPORTED_MODULE_13__["ThumbnailSize"].Medium,
268
- analyticsData: Object.assign({
269
- widgetId: data.id,
270
- widgetName: data.name,
271
- itemIndex: index
272
- }, analyticsData),
273
- analyticsOptions: Object.assign(Object.assign({}, (_a = props) === null || _a === void 0 ? void 0 : _a.analyticsOptions), _utils_WidgetHelper__WEBPACK_IMPORTED_MODULE_14__["WidgetHelper"].getSliderItemAnalyticsOptions()),
274
- onHover: function onHover(hovering) {
275
- /**
276
- * For some reason this needs to be called after a set timeout, otherwise
277
- * the `useHover` listener on the `buttonsRef` element will not detect it's hover
278
- * event. A delay of 200ms is used for when `hovering` is false so that the effects of
279
- * setting `isHoveringOnFarX` aren't applied until the CSS transform transition has
280
- * completed.
281
- */
282
- window.setTimeout(function () {
283
- onSetIsHovering(hovering, index);
284
- }, hovering ? 0 : 200);
285
- }
286
- });
287
- })), react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_widget_button_WidgetButton__WEBPACK_IMPORTED_MODULE_3__["WidgetButton"], {
288
- direction: _widget_button_WidgetButton__WEBPACK_IMPORTED_MODULE_3__["WidgetButtonDirection"].Right,
289
- onClick: function onClick() {
290
- dispatch({
291
- type: _enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_8__["WidgetInteraction"].Next
292
- });
293
- _analytics_src_AnalyticsHelper__WEBPACK_IMPORTED_MODULE_15__["AnalyticsHelper"].logUserAction(getSliderAnalyticsData(_enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_8__["WidgetInteraction"].Next), _utils_WidgetHelper__WEBPACK_IMPORTED_MODULE_14__["WidgetHelper"].getSliderAnalyticsOptions());
294
- },
295
- hide: isHoveringOnFarRight || (state.offset > state.viewableItems || state.offset === state.collection.length) && !(isHovering && state.offset < state.collection.length),
296
- contents: props.contents
297
- }), !isHoveringOnFarRight && react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
298
- className: _fixed_widget_scss__WEBPACK_IMPORTED_MODULE_19___default.a.rightOverflowGradient
299
- })));
300
- }
301
-
302
- var Memoized = react__WEBPACK_IMPORTED_MODULE_0__["memo"](FixedWidget);
303
-
304
-
305
- /***/ }),
306
-
307
- /***/ "../../libs/shared/src/components/widgets/fixed-widget/FixedWidgetReducer.tsx":
308
- /*!************************************************************************************************************************!*\
309
- !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/components/widgets/fixed-widget/FixedWidgetReducer.tsx ***!
310
- \************************************************************************************************************************/
311
- /*! exports provided: initialWidgetState, FixedWidgetReducer, lazyWidgetInit */
312
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
15
+ /* harmony import */ var formik__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! formik */ "../../../node_modules/formik/dist/formik.esm.js");
16
+ /* harmony import */ var _hooks_UseCanSubmitForm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../hooks/UseCanSubmitForm */ "../../libs/shared/src/hooks/UseCanSubmitForm.ts");
17
+ /* harmony import */ var _spinner_button_SpinnerButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../spinner-button/SpinnerButton */ "../../libs/shared/src/components/spinner-button/SpinnerButton.tsx");
18
+ /* harmony import */ var _text_Text__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../text/Text */ "../../libs/shared/src/components/text/Text.tsx");
313
19
 
314
- "use strict";
315
- __webpack_require__.r(__webpack_exports__);
316
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initialWidgetState", function() { return initialWidgetState; });
317
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FixedWidgetReducer", function() { return FixedWidgetReducer; });
318
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lazyWidgetInit", function() { return lazyWidgetInit; });
319
- /* harmony import */ var _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../enums/MediaQueries */ "../../libs/shared/src/enums/MediaQueries.ts");
320
- /* harmony import */ var _enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../enums/WidgetInteraction */ "../../libs/shared/src/enums/WidgetInteraction.ts");
321
- /* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../interfaces */ "../../libs/shared/src/interfaces/index.ts");
322
- /* harmony import */ var _FixedWidgetUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FixedWidgetUtils */ "../../libs/shared/src/components/widgets/fixed-widget/FixedWidgetUtils.ts");
323
20
 
324
21
 
325
22
 
326
23
 
327
- var initialWidgetState = {
328
- offset: 0,
329
- viewableItems: 4,
330
- position: 0,
331
- collection: [],
332
- currentSize: _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_0__["MediaQueryStrings"].LG,
333
- type: _interfaces__WEBPACK_IMPORTED_MODULE_2__["WidgetType"].Row
334
- };
335
-
336
- var computeNextPosition = function computeNextPosition(prevState) {
337
- var collection = prevState.collection,
338
- viewableItems = prevState.viewableItems,
339
- offset = prevState.offset,
340
- position = prevState.position;
341
- var remainingCount = collection.length - offset;
24
+ var namespace = 'shared.formButtons';
25
+ var ENTER_KEY_CODE = 13;
26
+ function FormButtons(props) {
27
+ var formikProps = Object(formik__WEBPACK_IMPORTED_MODULE_1__["useFormikContext"])();
28
+ var canSubmit = Object(_hooks_UseCanSubmitForm__WEBPACK_IMPORTED_MODULE_2__["useCanSubmitForm"])(formikProps);
342
29
  /**
343
- * If the remaining items are evening divisible by the items in view, or,
344
- * we have more items that can be displayed in the view, move the slider a full 100%.
30
+ * This hook listens to "Enter" keypress events, and submits the form if there
31
+ * are no errors. This prevents any edge cases where submitting doesn't work on
32
+ * Enter normally, such as when a custom component is in focus.
345
33
  */
346
34
 
347
- if (remainingCount % viewableItems === 0 || remainingCount > viewableItems) return {
348
- position: position - 100,
349
- offset: offset + viewableItems
350
- };
351
- /**
352
- * Where there are less items than we can show in a full slide,
353
- * calculate the % movement required to only show those items.
354
- */
355
-
356
- if (remainingCount < viewableItems) return {
357
- position: position - remainingCount / viewableItems * 100,
358
- offset: offset + remainingCount
359
- };
360
- /**
361
- * Default back to the current state as a fallback
362
- */
363
-
364
- return {
365
- position: position,
366
- offset: offset
367
- };
368
- };
369
-
370
- var computePreviousPosition = function computePreviousPosition(prevState) {
371
- var viewableItems = prevState.viewableItems,
372
- offset = prevState.offset,
373
- position = prevState.position;
374
- var remainingCount = offset - viewableItems;
375
- if (remainingCount % viewableItems === 0 || remainingCount > viewableItems) return {
376
- position: position + 100,
377
- offset: offset - viewableItems
378
- };
379
- if (remainingCount < viewableItems) return {
380
- position: position + remainingCount / viewableItems * 100,
381
- offset: offset - remainingCount
382
- };
383
- return {
384
- position: position,
385
- offset: offset
386
- };
387
- };
35
+ react__WEBPACK_IMPORTED_MODULE_0__["useEffect"](function () {
36
+ function onKeyPress(e) {
37
+ if (e.keyCode !== ENTER_KEY_CODE || !canSubmit) return;
38
+ formikProps.validateForm().then(function (errors) {
39
+ if (!Object.keys(errors).length) formikProps.submitForm();
40
+ });
41
+ }
388
42
 
389
- function FixedWidgetReducer(prevState, action) {
390
- var _a, _b;
391
-
392
- var type = action.type,
393
- _action$payload = action.payload,
394
- payload = _action$payload === void 0 ? {} : _action$payload;
395
-
396
- switch (type) {
397
- case _enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_1__["WidgetInteraction"].Next:
398
- {
399
- return Object.assign(Object.assign({}, prevState), computeNextPosition(prevState));
400
- }
401
-
402
- case _enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_1__["WidgetInteraction"].Previous:
403
- {
404
- return Object.assign(Object.assign({}, prevState), computePreviousPosition(prevState));
405
- }
406
-
407
- case _enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_1__["WidgetInteraction"].Resize:
408
- {
409
- var computeViewableItems = Object(_FixedWidgetUtils__WEBPACK_IMPORTED_MODULE_3__["getComputeFunction"])(payload.contents);
410
- var initialSeen = computeViewableItems(payload.mediaQuery, payload.type, (_a = payload.collection) === null || _a === void 0 ? void 0 : _a.length);
411
- return Object.assign(Object.assign({}, prevState), {
412
- currentSize: payload.mediaQuery,
413
- position: 0,
414
- offset: initialSeen,
415
- viewableItems: initialSeen,
416
- type: payload.type
417
- });
418
- }
419
-
420
- case _enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_1__["WidgetInteraction"].Init:
421
- {
422
- var _computeViewableItems = Object(_FixedWidgetUtils__WEBPACK_IMPORTED_MODULE_3__["getComputeFunction"])(payload.contents);
423
-
424
- var _initialSeen = _computeViewableItems(payload.mediaQuery, payload.type, (_b = payload.collection) === null || _b === void 0 ? void 0 : _b.length);
425
-
426
- return lazyWidgetInit(Object.assign(Object.assign({}, prevState), {
427
- collection: payload.collection,
428
- currentSize: payload.mediaQuery,
429
- offset: _initialSeen,
430
- viewableItems: _initialSeen,
431
- type: payload.type
432
- }));
433
- }
434
-
435
- default:
436
- return prevState;
437
- }
438
- }
439
- function lazyWidgetInit(newState) {
440
- return Object.assign(Object.assign({}, initialWidgetState), newState);
43
+ window.addEventListener('keypress', onKeyPress);
44
+ return function () {
45
+ return window.removeEventListener('keypress', onKeyPress);
46
+ };
47
+ }, [canSubmit]);
48
+ var phraseKey = 'save';
49
+ if (props.isNew) phraseKey = 'create';
50
+ if (props.hasNext) phraseKey = 'next';
51
+ return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_spinner_button_SpinnerButton__WEBPACK_IMPORTED_MODULE_3__["SpinnerButton"], {
52
+ variant: props.variant || 'primary',
53
+ showSpinner: formikProps.isSubmitting,
54
+ type: 'submit',
55
+ disabled: !canSubmit
56
+ }, props.submitText ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, props.submitText) : react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_text_Text__WEBPACK_IMPORTED_MODULE_4__["Text"], {
57
+ namespace: namespace,
58
+ phrase: phraseKey
59
+ }));
441
60
  }
442
61
 
443
62
  /***/ }),
444
63
 
445
- /***/ "../../libs/shared/src/components/widgets/fixed-widget/FixedWidgetUtils.ts":
446
- /*!*********************************************************************************************************************!*\
447
- !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/components/widgets/fixed-widget/FixedWidgetUtils.ts ***!
448
- \*********************************************************************************************************************/
449
- /*! exports provided: useFetchData, getShouldPreload, getCollectionAppLink, formatData, getComputeFunction, getOnTouchStart, getOnTouchEnd */
64
+ /***/ "../../libs/shared/src/components/forms/form-checkbox/FormCheckbox.tsx":
65
+ /*!*****************************************************************************************************************!*\
66
+ !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/components/forms/form-checkbox/FormCheckbox.tsx ***!
67
+ \*****************************************************************************************************************/
68
+ /*! exports provided: FormCheckbox */
450
69
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
451
70
 
452
71
  "use strict";
453
72
  __webpack_require__.r(__webpack_exports__);
454
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useFetchData", function() { return useFetchData; });
455
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getShouldPreload", function() { return getShouldPreload; });
456
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCollectionAppLink", function() { return getCollectionAppLink; });
457
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatData", function() { return formatData; });
458
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getComputeFunction", function() { return getComputeFunction; });
459
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOnTouchStart", function() { return getOnTouchStart; });
460
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOnTouchEnd", function() { return getOnTouchEnd; });
73
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormCheckbox", function() { return FormCheckbox; });
461
74
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
462
75
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
463
- /* harmony import */ var _common_src_react_utils_ObjectHelper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../common/src/react/utils/ObjectHelper */ "../../libs/common/src/react/utils/ObjectHelper.ts");
464
- /* harmony import */ var _common_src_backbone_utils_FunctionHelper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../common/src/backbone/utils/FunctionHelper */ "../../libs/common/src/backbone/utils/FunctionHelper.ts");
465
- /* harmony import */ var _common_src_react_utils_TextHelper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../common/src/react/utils/TextHelper */ "../../libs/common/src/react/utils/TextHelper.ts");
466
- /* harmony import */ var _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../enums/MediaQueries */ "../../libs/shared/src/enums/MediaQueries.ts");
467
- /* harmony import */ var _enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../enums/WidgetInteraction */ "../../libs/shared/src/enums/WidgetInteraction.ts");
468
- /* harmony import */ var _enums_WidgetContents__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../enums/WidgetContents */ "../../libs/shared/src/enums/WidgetContents.ts");
469
- /* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../interfaces */ "../../libs/shared/src/interfaces/index.ts");
470
-
471
-
472
-
473
-
474
-
475
-
476
-
477
-
478
- function useFetchData(props, dispatch, mediaQueryType, shouldFetch) {
479
- var fetch = props.fetch,
480
- setData = props.setData,
481
- type = props.type,
482
- items = props.collection,
483
- prefetched = props.prefetched,
484
- contents = props.contents;
485
- var data = items;
486
- var res;
487
-
488
- if (!data || _common_src_react_utils_ObjectHelper__WEBPACK_IMPORTED_MODULE_1__["ObjectHelper"].isEmpty(data) && !prefetched) {
489
- res = fetch(shouldFetch);
490
- data = res.data;
76
+ /* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-bootstrap */ "react-bootstrap");
77
+ /* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__);
78
+ /* harmony import */ var _form_field_FormField__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../form-field/FormField */ "../../libs/shared/src/components/forms/form-field/FormField.tsx");
79
+ var __rest = undefined && undefined.__rest || function (s, e) {
80
+ var t = {};
81
+
82
+ for (var p in s) {
83
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
491
84
  }
492
- /**
493
- * Once we have the widget data, lazily update our state with the new collection
494
- */
495
-
496
-
497
- react__WEBPACK_IMPORTED_MODULE_0__["useEffect"](function () {
498
- if (!data || _common_src_react_utils_ObjectHelper__WEBPACK_IMPORTED_MODULE_1__["ObjectHelper"].isEmpty(data)) return;
499
- dispatch({
500
- type: _enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_5__["WidgetInteraction"].Init,
501
- payload: {
502
- collection: _common_src_backbone_utils_FunctionHelper__WEBPACK_IMPORTED_MODULE_2__["FunctionHelper"].isFunction(setData) ? setData(data) : data,
503
- mediaQuery: mediaQueryType,
504
- type: type,
505
- contents: contents
506
- }
507
- });
508
- }, [data]);
509
- return res;
510
- }
511
- /**
512
- * This function wrapper determines which widget item images should be pre-fetched by the LazyImage component.
513
- * It does this by looking at which images are going to be shown after the users clicks on the "Next"
514
- * widget button.
515
- */
516
85
 
517
- function getShouldPreload(state) {
518
- var offset = state.offset,
519
- viewableItems = state.viewableItems,
520
- collection = state.collection; // The index of the latest item that has been fetched
521
-
522
- var maxLoadedIndex = offset;
523
- /**
524
- * The indicesToPreload is an array of indices of widget items that should be prefetched by the
525
- * LazyImage component
526
- */
527
-
528
- var indicesToPreload = [];
529
-
530
- for (var i = 0; i < maxLoadedIndex + viewableItems; i++) {
531
- indicesToPreload.push(i);
86
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
87
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
532
88
  }
533
- /**
534
- * A widget item calls this function to determine whether or not its image can be pre-fetched.
535
- * This is determined by whether or not its index has been deemed valid to be pre-fetched
536
- * by the scope above
537
- */
538
-
539
-
540
- return function shouldPreload(widgetItem) {
541
- var index = collection.indexOf(widgetItem);
542
- return indicesToPreload.includes(index);
543
- };
544
- }
545
- function getCollectionAppLink(appLink, data) {
546
- if (!appLink) return;
547
- return Object.assign(Object.assign({}, appLink), {
548
- args: appLink.args || [data.id, _common_src_react_utils_TextHelper__WEBPACK_IMPORTED_MODULE_3__["TextHelper"].slugify(data.name)]
549
- });
550
- }
551
- /**
552
- * Allow explicit name and description props to override the fetched
553
- * data properties.
554
- *
555
- * @param props
556
- * @param data
557
- */
558
-
559
- function formatData(props, data) {
560
- var name = props.name,
561
- description = props.description;
562
- var overrideProps = {};
563
- if (Array.isArray(data)) return {
564
- name: name,
565
- description: description
566
- };
567
- if (props.name) overrideProps.name = name;
568
- if (props.description) overrideProps.description = description;
569
- return Object.assign(Object.assign({}, data), overrideProps);
570
- }
571
- function getComputeFunction(contents) {
572
- switch (contents) {
573
- case _enums_WidgetContents__WEBPACK_IMPORTED_MODULE_6__["WidgetContents"].Playlists:
574
- return computeViewablePlaylists;
575
-
576
- case _enums_WidgetContents__WEBPACK_IMPORTED_MODULE_6__["WidgetContents"].Videos:
577
- return computeViewableVideos;
578
-
579
- case _enums_WidgetContents__WEBPACK_IMPORTED_MODULE_6__["WidgetContents"].Subjects:
580
- return computeViewableSubjects;
581
-
582
- case _enums_WidgetContents__WEBPACK_IMPORTED_MODULE_6__["WidgetContents"].UserChannels:
583
- return computeViewableUserChannels;
584
-
585
- case _enums_WidgetContents__WEBPACK_IMPORTED_MODULE_6__["WidgetContents"].Interactives:
586
- return computeViewableInteractives;
587
-
588
- case _enums_WidgetContents__WEBPACK_IMPORTED_MODULE_6__["WidgetContents"].Clips:
589
- return computeViewableClips;
590
-
591
- case _enums_WidgetContents__WEBPACK_IMPORTED_MODULE_6__["WidgetContents"].Series:
592
- default:
593
- return computeViewableSeries;
594
- }
595
- }
596
-
597
- function computeViewablePlaylists(mediaQuery, type, itemCount) {
598
- var maxItems = 5;
599
- if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].XS) maxItems = 2;else if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].SM) maxItems = 3;else if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].MD) maxItems = 4;
600
- if (itemCount < maxItems) maxItems = itemCount;
601
- return maxItems;
602
- }
89
+ return t;
90
+ };
603
91
 
604
- function computeViewableVideos(mediaQuery, type, itemCount) {
605
- var maxItems = 4;
606
- if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].XS) maxItems = 2;else if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].SM) maxItems = 3;else if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].MD) maxItems = 4;else if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].LG || mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].XL || mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].XXL) {
607
- if (type === _interfaces__WEBPACK_IMPORTED_MODULE_7__["WidgetType"].LargeRow) maxItems = 3;else if (itemCount < 4) maxItems = 3;else maxItems = 4;
608
- }
609
- if (itemCount < maxItems) maxItems = itemCount;
610
- return maxItems;
611
- }
612
92
 
613
- function computeViewableSubjects(mediaQuery, type, itemCount) {
614
- var maxItems = 6;
615
- if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].SM || mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].XS) maxItems = 3;else if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].MD) maxItems = 4;else if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].LG) maxItems = 5;else if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].XL || mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].XXL) maxItems = 6;
616
- if (itemCount < maxItems) maxItems = itemCount;
617
- return maxItems;
618
- }
619
93
 
620
- function computeViewableUserChannels(mediaQuery, type, itemCount) {
621
- var maxItems = 6;
622
- if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].XS) maxItems = 2;else if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].SM) maxItems = 3;else if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].MD) maxItems = 4;else if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].LG) maxItems = 5;else if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].XL || mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].XXL) maxItems = 6;
623
- if (itemCount < maxItems) maxItems = itemCount;
624
- return maxItems;
625
- }
626
-
627
- function computeViewableInteractives(mediaQuery, type, itemCount) {
628
- var maxItems = 3;
629
- if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].MD || mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].SM) maxItems = 2;
630
- if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].XS) maxItems = 1;
631
- if (itemCount < Math.ceil(maxItems)) maxItems = itemCount;
632
- return maxItems;
633
- }
634
94
 
635
- function computeViewableClips(mediaQuery, type, itemCount) {
636
- var maxItems = 3;
637
- if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].MD || mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].SM) maxItems = 2;
638
- if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].XS) maxItems = 1;
639
- if (itemCount < Math.ceil(maxItems)) maxItems = itemCount;
640
- return maxItems;
641
- }
642
-
643
- function computeViewableSeries(mediaQuery, type, itemCount) {
644
- var maxItems = 4;
645
- if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].XS) maxItems = 2;else if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_4__["MediaQueryStrings"].SM) maxItems = 3;
646
- if (itemCount < maxItems) maxItems = itemCount;
647
- return maxItems;
648
- }
649
95
  /**
650
- * Touch event handlers
96
+ * Use this checkbox within Formik contexts
651
97
  */
652
98
 
653
-
654
- function getOnTouchStart(widgetState, containerRef, containerWidth, setContainerWidth, initialTouchX, setInitialTouchX, setPercentageDragged) {
655
- return function (event) {
656
- var firstTouch = event.touches.item(0);
657
- var touchX = firstTouch.clientX;
658
- /**
659
- * Runs only on the very first touch event.
660
- *
661
- * Sets the initial x-coordinate as a reference point to calculate how far the user has dragged before
662
- * they release their finder
663
- */
664
-
665
- if (!initialTouchX) {
666
- containerRef.current.style.transition = '';
667
- setContainerWidth(containerRef.current.getBoundingClientRect().width);
668
- setInitialTouchX(touchX);
669
- }
670
-
671
- var pixelsDragged = initialTouchX - touchX; // Calculate how far the user has moved their finger as a percentage of the widget's container element
672
-
673
- var currentPercentageDragged = pixelsDragged / containerWidth * 100;
674
- /**
675
- * These 2 if statements prevent the user from dragging the widget beyond its limits.
676
- * One if statement handles if they have dragged to the left, and the other is for dragging to the right.
677
- *
678
- * The same logic is used to hide the widget buttons (see the `hide` prop passed to `<WidgetButton />`)
679
- */
680
-
681
- if (currentPercentageDragged < 0 && widgetState.offset === widgetState.viewableItems) currentPercentageDragged = 0;else if (currentPercentageDragged > 0 && widgetState.offset === widgetState.collection.length) currentPercentageDragged = 0;
682
- setPercentageDragged(currentPercentageDragged);
683
- };
684
- }
685
- var DRAG_TOLERANCE = 7.5; // % of container width using to trigger a transition.
686
-
687
- function getOnTouchEnd(containerRef, setInitialTouchX, percentageDragged, setPercentageDragged, dispatch) {
688
- return function () {
689
- containerRef.current.style.transition = 'transform .4s ease-in-out';
690
- setInitialTouchX(null);
691
- /**
692
- * Only trigger a Next/Previous widget event if the user has dragged beyond DRAG_TOLERANCE% either way of the
693
- * container's width. This means if the user only drags left/right a tiny little bit, the widget
694
- * will simply slide back into its original place.
695
- */
696
-
697
- if (Math.abs(percentageDragged) >= DRAG_TOLERANCE) {
698
- var reducerAction = percentageDragged > 0 ? _enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_5__["WidgetInteraction"].Next : _enums_WidgetInteraction__WEBPACK_IMPORTED_MODULE_5__["WidgetInteraction"].Previous;
699
- dispatch({
700
- type: reducerAction
701
- });
702
- }
703
-
704
- setPercentageDragged(0);
705
- };
99
+ function FormCheckbox(props) {
100
+ var label = props.label,
101
+ fieldProps = __rest(props, ["label"]);
102
+
103
+ return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Form"].Group, null, react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
104
+ className: 'custom-control custom-checkbox'
105
+ }, react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_form_field_FormField__WEBPACK_IMPORTED_MODULE_2__["FieldWrapper"], Object.assign({
106
+ className: 'custom-control-input'
107
+ }, fieldProps)), react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Form"].Label, {
108
+ className: 'custom-control-label',
109
+ htmlFor: fieldProps.id
110
+ }, label)));
706
111
  }
707
112
 
708
113
  /***/ }),
709
114
 
710
- /***/ "../../libs/shared/src/components/widgets/fixed-widget/PartialFixedWidget.tsx":
711
- /*!************************************************************************************************************************!*\
712
- !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/components/widgets/fixed-widget/PartialFixedWidget.tsx ***!
713
- \************************************************************************************************************************/
714
- /*! exports provided: PartialFixedWidget */
115
+ /***/ "../../libs/shared/src/components/forms/form-field/CharacterCounter.tsx":
116
+ /*!******************************************************************************************************************!*\
117
+ !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/components/forms/form-field/CharacterCounter.tsx ***!
118
+ \******************************************************************************************************************/
119
+ /*! exports provided: CharacterCounter */
715
120
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
716
121
 
717
122
  "use strict";
718
123
  __webpack_require__.r(__webpack_exports__);
719
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PartialFixedWidget", function() { return PartialFixedWidget; });
124
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterCounter", function() { return CharacterCounter; });
720
125
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
721
126
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
722
- /* harmony import */ var _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../enums/MediaQueries */ "../../libs/shared/src/enums/MediaQueries.ts");
723
- /* harmony import */ var _hooks_UseGetMediaQueryString__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../hooks/UseGetMediaQueryString */ "../../libs/shared/src/hooks/UseGetMediaQueryString.ts");
724
- /* harmony import */ var _fixed_widget_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fixed-widget.scss */ "../../libs/shared/src/components/widgets/fixed-widget/fixed-widget.scss");
725
- /* harmony import */ var _fixed_widget_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_fixed_widget_scss__WEBPACK_IMPORTED_MODULE_3__);
726
-
727
-
728
-
729
-
730
-
731
- function useMediaQueryListeners() {
732
- var mediaQuery = Object(_hooks_UseGetMediaQueryString__WEBPACK_IMPORTED_MODULE_2__["useGetMediaQueryString"])();
733
- if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_1__["MediaQueryStrings"].XS) return {
734
- itemCount: 1,
735
- colSize: 12
736
- };
737
- if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_1__["MediaQueryStrings"].SM) return {
738
- itemCount: 2,
739
- colSize: 6
740
- };
741
- if (mediaQuery === _enums_MediaQueries__WEBPACK_IMPORTED_MODULE_1__["MediaQueryStrings"].MD) return {
742
- itemCount: 3,
743
- colSize: 4
744
- };
745
- return {
746
- itemCount: 4,
747
- colSize: 3
748
- };
749
- }
750
-
751
- var PartialLoadingItem = function PartialLoadingItem(_ref) {
752
- var colSize = _ref.colSize;
753
- return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
754
- className: "col-".concat(colSize)
755
- }, react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
756
- className: "".concat(_fixed_widget_scss__WEBPACK_IMPORTED_MODULE_3___default.a.partialItem, " mx-1 partial-loading-background")
757
- }));
758
- };
127
+ /* harmony import */ var formik__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! formik */ "../../../node_modules/formik/dist/formik.esm.js");
759
128
 
760
- function PartialFixedWidget(props) {
761
- var _useMediaQueryListene = useMediaQueryListeners(),
762
- itemCount = _useMediaQueryListene.itemCount,
763
- colSize = _useMediaQueryListene.colSize;
764
129
 
765
- var items = [];
766
-
767
- for (var i = 0; i < itemCount; i++) {
768
- items.push(react__WEBPACK_IMPORTED_MODULE_0__["createElement"](PartialLoadingItem, {
769
- key: i,
770
- colSize: colSize
771
- }));
772
- }
130
+ function CharacterCounter(props) {
131
+ var _useFormikContext = Object(formik__WEBPACK_IMPORTED_MODULE_1__["useFormikContext"])(),
132
+ values = _useFormikContext.values;
773
133
 
134
+ var field = values[props.fieldName];
135
+ if (typeof field !== 'string') return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null);
774
136
  return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
775
- className: 'widget pb-3'
776
- }, react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
777
- className: "".concat(_fixed_widget_scss__WEBPACK_IMPORTED_MODULE_3___default.a.partialHeading, " mx-1 mb-1 partial-loading-background")
778
- }), react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
779
- className: "".concat(_fixed_widget_scss__WEBPACK_IMPORTED_MODULE_3___default.a.partialDescription, " mx-1 my-1 partial-loading-background")
780
- }), react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
781
- className: "".concat(_fixed_widget_scss__WEBPACK_IMPORTED_MODULE_3___default.a.slidingContainer, " row")
782
- }, items));
137
+ className: 'float-right text-muted'
138
+ }, field.length, "/", props.limit);
783
139
  }
784
140
 
785
141
  /***/ }),
786
142
 
787
- /***/ "../../libs/shared/src/components/widgets/fixed-widget/fixed-widget.scss":
788
- /*!*******************************************************************************************************************!*\
789
- !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/components/widgets/fixed-widget/fixed-widget.scss ***!
790
- \*******************************************************************************************************************/
791
- /*! no static exports found */
792
- /***/ (function(module, exports, __webpack_require__) {
793
-
794
- // extracted by mini-css-extract-plugin
795
- module.exports = {"leftOverflowGradient":"cv--leftOverflowGradient--u_MPi","rightOverflowGradient":"cv--rightOverflowGradient--38ooL","partialHeading":"cv--partialHeading--OVsdA","partialDescription":"cv--partialDescription--1HtA2","partialItem":"cv--partialItem--3G2hG","largePartialItem":"cv--largePartialItem--NnK8O","heading":"cv--heading--BQnCC","link":"cv--link--ph0Qy"};
796
-
797
- /***/ }),
798
-
799
- /***/ "../../libs/shared/src/components/widgets/sliding-list/SlidingListContainer.tsx":
800
- /*!**************************************************************************************************************************!*\
801
- !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/components/widgets/sliding-list/SlidingListContainer.tsx ***!
802
- \**************************************************************************************************************************/
803
- /*! exports provided: SlidingListContainer */
143
+ /***/ "../../libs/shared/src/components/forms/form-field/FormField.tsx":
144
+ /*!***********************************************************************************************************!*\
145
+ !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/components/forms/form-field/FormField.tsx ***!
146
+ \***********************************************************************************************************/
147
+ /*! exports provided: FieldWrapper, FormField */
804
148
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
805
149
 
806
150
  "use strict";
807
151
  __webpack_require__.r(__webpack_exports__);
808
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SlidingListContainer", function() { return SlidingListContainer; });
152
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FieldWrapper", function() { return FieldWrapper; });
153
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormField", function() { return FormField; });
809
154
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
810
155
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
811
- /* harmony import */ var _common_src_backbone_utils_UserAgentHelper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../common/src/backbone/utils/UserAgentHelper */ "../../libs/common/src/backbone/utils/UserAgentHelper.ts");
812
- /* harmony import */ var _enums_CssMeasurement__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../enums/CssMeasurement */ "../../libs/shared/src/enums/CssMeasurement.ts");
813
- /* harmony import */ var _utils_DragHelper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils/DragHelper */ "../../libs/shared/src/utils/DragHelper.ts");
156
+ /* harmony import */ var formik__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! formik */ "../../../node_modules/formik/dist/formik.esm.js");
157
+ /* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-bootstrap */ "react-bootstrap");
158
+ /* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_bootstrap__WEBPACK_IMPORTED_MODULE_2__);
159
+ /* harmony import */ var _common_src_backbone_utils_FunctionHelper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../common/src/backbone/utils/FunctionHelper */ "../../libs/common/src/backbone/utils/FunctionHelper.ts");
160
+ /* harmony import */ var _utils_FormHelper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../utils/FormHelper */ "../../libs/shared/src/utils/FormHelper.ts");
161
+ /* harmony import */ var _CharacterCounter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./CharacterCounter */ "../../libs/shared/src/components/forms/form-field/CharacterCounter.tsx");
162
+ /* harmony import */ var _form_checkbox_FormCheckbox__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../form-checkbox/FormCheckbox */ "../../libs/shared/src/components/forms/form-checkbox/FormCheckbox.tsx");
163
+ var __rest = undefined && undefined.__rest || function (s, e) {
164
+ var t = {};
165
+
166
+ for (var p in s) {
167
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
168
+ }
814
169
 
170
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
171
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
172
+ }
173
+ return t;
174
+ };
815
175
 
816
176
 
817
177
 
818
- var isTouchScreen = _common_src_backbone_utils_UserAgentHelper__WEBPACK_IMPORTED_MODULE_1__["UserAgentHelper"].isTouchScreen();
819
178
 
820
- function getPositionStyling(xPosition, measurement, dragPercentage) {
821
- // Used in situations where a touch screen user is dragging the `<FixedWidget />`
822
- if (measurement === _enums_CssMeasurement__WEBPACK_IMPORTED_MODULE_2__["CssMeasurement"].Percentage && dragPercentage) xPosition = xPosition - dragPercentage;
823
- return {
824
- transform: "translate3d(".concat(xPosition).concat(measurement, ", 0px, 0px)"),
825
- transition: 'transform .4s ease-in-out'
826
- };
827
- }
828
179
 
829
- var SlidingListContainer = react__WEBPACK_IMPORTED_MODULE_0__["forwardRef"](function (props, ref) {
830
- var children = props.children,
831
- positionType = props.positionType,
832
- onDrag = props.onDrag,
833
- onDragEnd = props.onDragEnd,
834
- onTouchMove = props.onTouchMove,
835
- onTouchEnd = props.onTouchEnd,
836
- percentageDragged = props.percentageDragged,
837
- _props$position = props.position,
838
- position = _props$position === void 0 ? 0 : _props$position;
839
-
840
- function getEventListeners() {
841
- var listenerProps = {};
842
-
843
- if (onDrag && onDragEnd) {
844
- listenerProps.draggable = true;
845
- listenerProps.onDrag = onDrag;
846
- listenerProps.onDragEnd = onDragEnd;
847
- listenerProps.onDragStart = _utils_DragHelper__WEBPACK_IMPORTED_MODULE_3__["DragHelper"].hideDragImage;
848
-
849
- listenerProps.onDragOver = function (e) {
850
- return e.preventDefault();
851
- };
852
- }
853
180
 
854
- if (onTouchMove && onTouchEnd && isTouchScreen) {
855
- listenerProps.onTouchMoveCapture = onTouchMove;
856
- listenerProps.onTouchEndCapture = onTouchEnd;
857
- }
858
181
 
859
- return listenerProps;
860
- }
861
182
 
862
- return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", Object.assign({
863
- className: 'd-flex flex-nowrap position-relative w-100',
864
- style: getPositionStyling(position, positionType, percentageDragged),
865
- ref: ref
866
- }, getEventListeners()), children);
867
- });
183
+ function FieldWrapper(props) {
184
+ var children = props.children,
185
+ fieldProps = __rest(props, ["children"]);
186
+
187
+ return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](formik__WEBPACK_IMPORTED_MODULE_1__["Field"], Object.assign({}, fieldProps), _common_src_backbone_utils_FunctionHelper__WEBPACK_IMPORTED_MODULE_3__["FunctionHelper"].isFunction(children) ? function (f) {
188
+ return children(f);
189
+ } : react__WEBPACK_IMPORTED_MODULE_0__["Children"].count(children) ? children : null);
190
+ }
191
+ function FormField(props) {
192
+ var label = props.label,
193
+ className = props.className,
194
+ showCharacterCounter = props.showCharacterCounter,
195
+ fieldProps = __rest(props, ["label", "className", "showCharacterCounter"]);
196
+
197
+ var _useFormikContext = Object(formik__WEBPACK_IMPORTED_MODULE_1__["useFormikContext"])(),
198
+ errors = _useFormikContext.errors,
199
+ touched = _useFormikContext.touched;
200
+
201
+ if (fieldProps.type === 'checkbox') return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_form_checkbox_FormCheckbox__WEBPACK_IMPORTED_MODULE_6__["FormCheckbox"], Object.assign({}, props));
202
+ return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react_bootstrap__WEBPACK_IMPORTED_MODULE_2__["Form"].Group, null, !!label && react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react_bootstrap__WEBPACK_IMPORTED_MODULE_2__["Form"].Label, {
203
+ htmlFor: fieldProps.id
204
+ }, label), react__WEBPACK_IMPORTED_MODULE_0__["createElement"](FieldWrapper, Object.assign({
205
+ className: _utils_FormHelper__WEBPACK_IMPORTED_MODULE_4__["FormHelper"].getCustomFormControlClassName(errors, touched, fieldProps.name, className)
206
+ }, fieldProps)), !!showCharacterCounter && !!fieldProps.maxLength && react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_CharacterCounter__WEBPACK_IMPORTED_MODULE_5__["CharacterCounter"], {
207
+ fieldName: fieldProps.name,
208
+ limit: fieldProps.maxLength
209
+ }), react__WEBPACK_IMPORTED_MODULE_0__["createElement"](formik__WEBPACK_IMPORTED_MODULE_1__["ErrorMessage"], {
210
+ name: fieldProps.name
211
+ }, function (errorMessage) {
212
+ return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react_bootstrap__WEBPACK_IMPORTED_MODULE_2__["Form"].Control.Feedback, {
213
+ type: 'invalid'
214
+ }, errorMessage);
215
+ }));
216
+ }
868
217
 
869
218
  /***/ }),
870
219
 
871
- /***/ "../../libs/shared/src/components/widgets/widget-button/WidgetButton.tsx":
872
- /*!*******************************************************************************************************************!*\
873
- !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/components/widgets/widget-button/WidgetButton.tsx ***!
874
- \*******************************************************************************************************************/
875
- /*! exports provided: WidgetButtonDirection, WidgetButton */
220
+ /***/ "../../libs/shared/src/components/forms/form-wrapper/FormWrapper.tsx":
221
+ /*!***************************************************************************************************************!*\
222
+ !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/components/forms/form-wrapper/FormWrapper.tsx ***!
223
+ \***************************************************************************************************************/
224
+ /*! exports provided: FormWrapper, useFormikContextWrapper */
876
225
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
877
226
 
878
227
  "use strict";
879
228
  __webpack_require__.r(__webpack_exports__);
880
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WidgetButtonDirection", function() { return WidgetButtonDirection; });
881
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WidgetButton", function() { return WidgetButton; });
229
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormWrapper", function() { return FormWrapper; });
230
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useFormikContextWrapper", function() { return useFormikContextWrapper; });
882
231
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
883
232
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
884
- /* harmony import */ var _svg_container_SvgContainer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../svg-container/SvgContainer */ "../../libs/shared/src/components/svg-container/SvgContainer.tsx");
885
- /* harmony import */ var _utils_SvgHelper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../utils/SvgHelper */ "../../libs/shared/src/utils/SvgHelper.ts");
886
- /* harmony import */ var _widget_button_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./widget-button.scss */ "../../libs/shared/src/components/widgets/widget-button/widget-button.scss");
887
- /* harmony import */ var _widget_button_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_widget_button_scss__WEBPACK_IMPORTED_MODULE_3__);
888
-
889
-
890
-
891
-
892
- var WidgetButtonDirection;
893
-
894
- (function (WidgetButtonDirection) {
895
- WidgetButtonDirection[WidgetButtonDirection["Left"] = 0] = "Left";
896
- WidgetButtonDirection[WidgetButtonDirection["Right"] = 1] = "Right";
897
- })(WidgetButtonDirection || (WidgetButtonDirection = {}));
898
-
899
- function getPositionClass(contents, isLeftDirection) {
900
- var className = _widget_button_scss__WEBPACK_IMPORTED_MODULE_3___default.a.topPos; // Left / Right
901
-
902
- if (isLeftDirection) className += ' ' + _widget_button_scss__WEBPACK_IMPORTED_MODULE_3___default.a.left;else className += ' ' + _widget_button_scss__WEBPACK_IMPORTED_MODULE_3___default.a.right;
903
- return className;
904
- }
905
-
906
- var WidgetButton = react__WEBPACK_IMPORTED_MODULE_0__["memo"](function (props) {
907
- var isLeft = props.direction === WidgetButtonDirection.Left;
908
- var arrowSvg = isLeft ? _utils_SvgHelper__WEBPACK_IMPORTED_MODULE_2__["cvSvgLibrary"].ChevronLeft : _utils_SvgHelper__WEBPACK_IMPORTED_MODULE_2__["cvSvgLibrary"].ChevronRight;
909
- var positionClass = getPositionClass(props.contents, isLeft);
910
- if (props.hide) return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null);
911
- return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
912
- role: 'button',
913
- className: "".concat(positionClass, " ").concat(_widget_button_scss__WEBPACK_IMPORTED_MODULE_3___default.a.button),
914
- onClick: props.onClick
915
- }, react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_svg_container_SvgContainer__WEBPACK_IMPORTED_MODULE_1__["SvgContainer"], {
916
- svgName: arrowSvg,
917
- size: _svg_container_SvgContainer__WEBPACK_IMPORTED_MODULE_1__["SvgContainerSize"].Medium,
918
- className: "svg-container d-inline-block ".concat(_widget_button_scss__WEBPACK_IMPORTED_MODULE_3___default.a.chevron)
919
- })), props.useGradientBackdrop && react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
920
- className: isLeft ? _widget_button_scss__WEBPACK_IMPORTED_MODULE_3___default.a.gradientLeft : _widget_button_scss__WEBPACK_IMPORTED_MODULE_3___default.a.gradientRight
921
- }), react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
922
- role: 'button',
923
- onClick: props.onClick,
924
- className: isLeft ? _widget_button_scss__WEBPACK_IMPORTED_MODULE_3___default.a.extendedClickableAreaLeft : _widget_button_scss__WEBPACK_IMPORTED_MODULE_3___default.a.extendedClickableAreaRight
925
- }));
926
- }, function (prevProps, nextProps) {
927
- return prevProps.hide === nextProps.hide;
928
- });
233
+ /* harmony import */ var formik__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! formik */ "../../../node_modules/formik/dist/formik.esm.js");
234
+ /* harmony import */ var _common_src_backbone_utils_FunctionHelper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../common/src/backbone/utils/FunctionHelper */ "../../libs/common/src/backbone/utils/FunctionHelper.ts");
235
+ /* harmony import */ var _common_src_react_utils_ObjectHelper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../common/src/react/utils/ObjectHelper */ "../../libs/common/src/react/utils/ObjectHelper.ts");
236
+ var __rest = undefined && undefined.__rest || function (s, e) {
237
+ var t = {};
929
238
 
930
- /***/ }),
239
+ for (var p in s) {
240
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
241
+ }
931
242
 
932
- /***/ "../../libs/shared/src/components/widgets/widget-button/widget-button.scss":
933
- /*!*********************************************************************************************************************!*\
934
- !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/components/widgets/widget-button/widget-button.scss ***!
935
- \*********************************************************************************************************************/
936
- /*! no static exports found */
937
- /***/ (function(module, exports, __webpack_require__) {
243
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
244
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
245
+ }
246
+ return t;
247
+ };
938
248
 
939
- // extracted by mini-css-extract-plugin
940
- module.exports = {"left":"cv--left--789pr","right":"cv--right--1P8qt","button":"cv--button--24q_F","chevron":"cv--chevron--3M27X","gradientLeft":"cv--gradientLeft--3fkiw","gradientRight":"cv--gradientRight--2RDDy","extendedClickableAreaRight":"cv--extendedClickableAreaRight--13dgy","extendedClickableAreaLeft":"cv--extendedClickableAreaLeft--37LtK","videoTopPos":"cv--videoTopPos--1XTRO","topPos":"cv--topPos--3_p_J"};
941
249
 
942
- /***/ }),
943
250
 
944
- /***/ "../../libs/shared/src/enums/CssMeasurement.ts":
945
- /*!*****************************************************************************************!*\
946
- !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/enums/CssMeasurement.ts ***!
947
- \*****************************************************************************************/
948
- /*! exports provided: CssMeasurement */
949
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
950
251
 
951
- "use strict";
952
- __webpack_require__.r(__webpack_exports__);
953
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CssMeasurement", function() { return CssMeasurement; });
954
- var CssMeasurement;
955
252
 
956
- (function (CssMeasurement) {
957
- CssMeasurement["Percentage"] = "%";
958
- CssMeasurement["Pixels"] = "px";
959
- })(CssMeasurement || (CssMeasurement = {}));
960
253
 
961
- /***/ }),
254
+ function omitNullInitialValues(initialValues) {
255
+ var values = _common_src_react_utils_ObjectHelper__WEBPACK_IMPORTED_MODULE_3__["ObjectHelper"].deepClone(initialValues);
256
+ Object.keys(values).forEach(function (key) {
257
+ if (!values.hasOwnProperty(key)) return;
258
+ if (_common_src_react_utils_ObjectHelper__WEBPACK_IMPORTED_MODULE_3__["ObjectHelper"].isObject(values[key])) values[key] = omitNullInitialValues(values[key]);else if (values[key] === null) delete values[key];
259
+ });
260
+ return values;
261
+ }
962
262
 
963
- /***/ "../../libs/shared/src/enums/WidgetContents.ts":
964
- /*!*****************************************************************************************!*\
965
- !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/enums/WidgetContents.ts ***!
966
- \*****************************************************************************************/
967
- /*! exports provided: WidgetContents */
968
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
263
+ FormWrapper.defaultProps = {
264
+ castInitialValues: true,
265
+ castValuesOnSubmit: true
266
+ };
267
+ function FormWrapper(props) {
268
+ var castInitialValues = props.castInitialValues,
269
+ castValuesOnSubmit = props.castValuesOnSubmit,
270
+ initialValues = props.initialValues,
271
+ onSubmit = props.onSubmit,
272
+ resetOnSubmit = props.resetOnSubmit,
273
+ formikProps = __rest(props, ["castInitialValues", "castValuesOnSubmit", "initialValues", "onSubmit", "resetOnSubmit"]);
274
+ /**
275
+ * If castInitialValues is true, cast initialValues to the validationSchema.
276
+ * This will ensure that any data fetched from the api conforms to the expected form data shape.
277
+ */
969
278
 
970
- "use strict";
971
- __webpack_require__.r(__webpack_exports__);
972
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WidgetContents", function() { return WidgetContents; });
973
- var WidgetContents;
974
-
975
- (function (WidgetContents) {
976
- WidgetContents["Videos"] = "videos";
977
- WidgetContents["Series"] = "series";
978
- WidgetContents["Subjects"] = "subjects";
979
- WidgetContents["Playlists"] = "playlists";
980
- WidgetContents["UserChannels"] = "user channels";
981
- WidgetContents["Interactives"] = "interactives";
982
- WidgetContents["Clips"] = "clips";
983
- })(WidgetContents || (WidgetContents = {}));
984
279
 
985
- /***/ }),
280
+ var formattedInitialValues = castInitialValues && props.validationSchema ? props.validationSchema.cast(omitNullInitialValues(initialValues)) : initialValues;
986
281
 
987
- /***/ "../../libs/shared/src/enums/WidgetInteraction.ts":
988
- /*!********************************************************************************************!*\
989
- !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/enums/WidgetInteraction.ts ***!
990
- \********************************************************************************************/
991
- /*! exports provided: WidgetInteraction */
992
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
282
+ var onSubmitHandler = function onSubmitHandler(values, _ref) {
283
+ var setSubmitting = _ref.setSubmitting,
284
+ resetForm = _ref.resetForm;
993
285
 
994
- "use strict";
995
- __webpack_require__.r(__webpack_exports__);
996
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WidgetInteraction", function() { return WidgetInteraction; });
997
- var WidgetInteraction;
286
+ /**
287
+ * validationSchema.cast will coerce the values to the types defined in validationSchema.
288
+ * This is useful for trimming inputs:
289
+ * e.g. if a value field has type Yup.string().trim(), it will be automatically trimmed.
290
+ */
291
+ var formattedData = castValuesOnSubmit && props.validationSchema ? props.validationSchema.cast(values) : values;
292
+ onSubmit(formattedData, function () {
293
+ resetOnSubmit && resetForm();
294
+ setSubmitting(false);
295
+ });
296
+ };
998
297
 
999
- (function (WidgetInteraction) {
1000
- WidgetInteraction["Init"] = "init";
1001
- WidgetInteraction["Next"] = "next";
1002
- WidgetInteraction["Previous"] = "previous";
1003
- WidgetInteraction["Resize"] = "resize";
1004
- WidgetInteraction["Drag"] = "drag";
1005
- })(WidgetInteraction || (WidgetInteraction = {}));
298
+ var initialStatus = {
299
+ allowInitialSubmit: props.allowInitialSubmit
300
+ };
301
+ return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](formik__WEBPACK_IMPORTED_MODULE_1__["Formik"], Object.assign({
302
+ enableReinitialize: true
303
+ }, formikProps, {
304
+ initialValues: formattedInitialValues,
305
+ onSubmit: onSubmitHandler,
306
+ initialStatus: initialStatus
307
+ }), _common_src_backbone_utils_FunctionHelper__WEBPACK_IMPORTED_MODULE_2__["FunctionHelper"].isFunction(props.children) ? function (f) {
308
+ return props.children(f);
309
+ } : react__WEBPACK_IMPORTED_MODULE_0__["Children"].count(props.children) ? props.children : null);
310
+ }
311
+ function useFormikContextWrapper() {
312
+ return Object(formik__WEBPACK_IMPORTED_MODULE_1__["useFormikContext"])();
313
+ }
1006
314
 
1007
315
  /***/ }),
1008
316
 
1009
- /***/ "../../libs/shared/src/hooks/UseHover.ts":
1010
- /*!***********************************************************************************!*\
1011
- !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/hooks/UseHover.ts ***!
1012
- \***********************************************************************************/
1013
- /*! exports provided: useHover, useHoverIntent */
317
+ /***/ "../../libs/shared/src/hooks/UseCanSubmitForm.ts":
318
+ /*!*******************************************************************************************!*\
319
+ !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/hooks/UseCanSubmitForm.ts ***!
320
+ \*******************************************************************************************/
321
+ /*! exports provided: useCanSubmitForm */
1014
322
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1015
323
 
1016
324
  "use strict";
1017
325
  __webpack_require__.r(__webpack_exports__);
1018
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useHover", function() { return useHover; });
1019
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useHoverIntent", function() { return useHoverIntent; });
326
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useCanSubmitForm", function() { return useCanSubmitForm; });
1020
327
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
1021
328
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1022
- /* harmony import */ var _common_src_backbone_utils_FunctionHelper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/src/backbone/utils/FunctionHelper */ "../../libs/common/src/backbone/utils/FunctionHelper.ts");
1023
329
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1024
330
 
1025
331
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -1033,129 +339,61 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
1033
339
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1034
340
 
1035
341
 
1036
-
1037
- var defaultOptions = {
1038
- className: '',
1039
- delay: 0
1040
- };
1041
342
  /**
1042
- * This hook detects hover events on an element.
1043
- * This should only be used where CSS hover events won't suffice for what you are trying to achieve.
343
+ * useCanSubmitForm determines if a form can be submitted.
344
+ *
345
+ * It will return true if a form is valid and has been changed from it's initial state.
346
+ *
347
+ * A common use case for this is determining whether or not to enable
348
+ * a submit button in a form.
1044
349
  */
1045
350
 
1046
- function useHover() {
1047
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultOptions;
351
+ function useCanSubmitForm(formikProps) {
352
+ var _a;
1048
353
 
1049
354
  var _React$useState = react__WEBPACK_IMPORTED_MODULE_0__["useState"](false),
1050
355
  _React$useState2 = _slicedToArray(_React$useState, 2),
1051
- isHovering = _React$useState2[0],
1052
- setHovering = _React$useState2[1];
356
+ canSubmit = _React$useState2[0],
357
+ setCanSubmit = _React$useState2[1];
1053
358
 
1054
- var ref = react__WEBPACK_IMPORTED_MODULE_0__["useRef"](null);
1055
- var triggerHover = _common_src_backbone_utils_FunctionHelper__WEBPACK_IMPORTED_MODULE_1__["FunctionHelper"].throttle(function () {
1056
- var _a, _b;
1057
-
1058
- if (options.className) (_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.add(options.className);
1059
- setHovering(true);
1060
- }, options.delay, {
1061
- leading: false
1062
- });
1063
-
1064
- var handleMouseOut = function handleMouseOut() {
1065
- var _a, _b;
359
+ react__WEBPACK_IMPORTED_MODULE_0__["useEffect"](function () {
360
+ var _a;
1066
361
 
1067
- if (_common_src_backbone_utils_FunctionHelper__WEBPACK_IMPORTED_MODULE_1__["FunctionHelper"].isFunction(triggerHover.cancel)) triggerHover.cancel();
1068
- if (options.className) (_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.remove(options.className);
1069
- setHovering(false);
1070
- };
362
+ if (!formikProps.isValid) {
363
+ setCanSubmit(false);
364
+ return;
365
+ } // If the form values have changed of if allowInitialSubmit is true, set canSubmit to true.
1071
366
 
1072
- react__WEBPACK_IMPORTED_MODULE_0__["useLayoutEffect"](function () {
1073
- var node = ref.current;
1074
367
 
1075
- if (node) {
1076
- node.addEventListener('mouseenter', triggerHover);
1077
- node.addEventListener('mouseleave', handleMouseOut);
1078
- return function () {
1079
- node.removeEventListener('mouseenter', triggerHover);
1080
- node.removeEventListener('mouseleave', handleMouseOut);
1081
- };
1082
- }
1083
- }, [ref.current, triggerHover, handleMouseOut]);
1084
- return [ref, isHovering];
1085
- }
1086
- function useHoverIntent(className) {
1087
- return useHover({
1088
- className: className,
1089
- delay: 275
1090
- });
368
+ if (formikProps.dirty || ((_a = formikProps.initialStatus) === null || _a === void 0 ? void 0 : _a.allowInitialSubmit)) setCanSubmit(true);else setCanSubmit(false);
369
+ }, [formikProps.isValid, (_a = formikProps.initialStatus) === null || _a === void 0 ? void 0 : _a.allowInitialSubmit, formikProps.dirty, formikProps.values]);
370
+ react__WEBPACK_IMPORTED_MODULE_0__["useEffect"](function () {
371
+ if (formikProps.isSubmitting) setCanSubmit(false);
372
+ }, [formikProps.isSubmitting]);
373
+ return canSubmit;
1091
374
  }
1092
375
 
1093
376
  /***/ }),
1094
377
 
1095
- /***/ "../../libs/shared/src/utils/DragHelper.ts":
378
+ /***/ "../../libs/shared/src/utils/FormHelper.ts":
1096
379
  /*!*************************************************************************************!*\
1097
- !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/utils/DragHelper.ts ***!
380
+ !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/utils/FormHelper.ts ***!
1098
381
  \*************************************************************************************/
1099
- /*! exports provided: DragHelper */
1100
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1101
-
1102
- "use strict";
1103
- __webpack_require__.r(__webpack_exports__);
1104
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DragHelper", function() { return DragHelper; });
1105
- /* harmony import */ var _common_src_backbone_utils_FunctionHelper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../common/src/backbone/utils/FunctionHelper */ "../../libs/common/src/backbone/utils/FunctionHelper.ts");
1106
-
1107
- var blankImage = new Image();
1108
- blankImage.src = 'data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=';
1109
- var DragHelper = {
1110
- // This removes the image that appears when you drag a draggable HTML element
1111
- hideDragImage: function hideDragImage(event) {
1112
- if (!event.dataTransfer.setDragImage || _common_src_backbone_utils_FunctionHelper__WEBPACK_IMPORTED_MODULE_0__["FunctionHelper"].isFunction(event.dataTransfer.setDragImage)) return;
1113
- event.dataTransfer.setDragImage(blankImage, 0, 0);
1114
- }
1115
- };
1116
-
1117
- /***/ }),
1118
-
1119
- /***/ "../../libs/shared/src/utils/WidgetHelper.ts":
1120
- /*!***************************************************************************************!*\
1121
- !*** C:/ClickView Projects/@clickview/packages/libs/shared/src/utils/WidgetHelper.ts ***!
1122
- \***************************************************************************************/
1123
- /*! exports provided: WidgetHelper */
382
+ /*! exports provided: FormHelper */
1124
383
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1125
384
 
1126
385
  "use strict";
1127
386
  __webpack_require__.r(__webpack_exports__);
1128
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WidgetHelper", function() { return WidgetHelper; });
1129
- /* harmony import */ var _analytics_src_interfaces__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../analytics/src/interfaces */ "../../libs/analytics/src/interfaces/index.ts");
387
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormHelper", function() { return FormHelper; });
388
+ /* harmony import */ var formik__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! formik */ "../../../node_modules/formik/dist/formik.esm.js");
1130
389
 
1131
- var WidgetHelper = {
1132
- /**
1133
- * Used by both the FixedWidget and DynamicWidget
1134
- */
1135
- getSliderAnalyticsOptions: function getSliderAnalyticsOptions() {
1136
- return {
1137
- actionType: _analytics_src_interfaces__WEBPACK_IMPORTED_MODULE_0__["UserAction"].Click,
1138
- location: _analytics_src_interfaces__WEBPACK_IMPORTED_MODULE_0__["LocationContext"].SlidingList,
1139
- entity: _analytics_src_interfaces__WEBPACK_IMPORTED_MODULE_0__["EntityType"].Widget,
1140
- descriptor: _analytics_src_interfaces__WEBPACK_IMPORTED_MODULE_0__["ClickDescriptor"].Slide
1141
- };
1142
- },
390
+ var FormHelper = {
391
+ getCustomFormControlClassName: function getCustomFormControlClassName(errors, touched, attribute, additionalClassName) {
392
+ var className = 'form-control'; // Using getIn as it supports dot notation
1143
393
 
1144
- /**
1145
- * Used by both the FixedWidget and DynamicWidget
1146
- */
1147
- getSliderItemAnalyticsOptions: function getSliderItemAnalyticsOptions() {
1148
- return {
1149
- location: _analytics_src_interfaces__WEBPACK_IMPORTED_MODULE_0__["LocationContext"].SlidingListItem
1150
- };
1151
- },
1152
- getSliderHeadingAnalyticsOptions: function getSliderHeadingAnalyticsOptions() {
1153
- return {
1154
- actionType: _analytics_src_interfaces__WEBPACK_IMPORTED_MODULE_0__["UserAction"].Click,
1155
- location: _analytics_src_interfaces__WEBPACK_IMPORTED_MODULE_0__["LocationContext"].SlidingList,
1156
- entity: _analytics_src_interfaces__WEBPACK_IMPORTED_MODULE_0__["EntityType"].Widget,
1157
- descriptor: _analytics_src_interfaces__WEBPACK_IMPORTED_MODULE_0__["ClickDescriptor"].Title
1158
- };
394
+ if (Object(formik__WEBPACK_IMPORTED_MODULE_0__["getIn"])(touched, attribute) && Object(formik__WEBPACK_IMPORTED_MODULE_0__["getIn"])(errors, attribute)) className += ' is-invalid';
395
+ if (additionalClassName) className += " ".concat(additionalClassName);
396
+ return className;
1159
397
  }
1160
398
  };
1161
399