orc-shared 5.10.2-dev.4 → 5.99.0-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/dist/components/AppFrame/About.js +13 -13
  2. package/dist/components/AppFrame/Anchor.js +7 -7
  3. package/dist/components/AppFrame/AppFrame.js +3 -3
  4. package/dist/components/AppFrame/Help.js +4 -4
  5. package/dist/components/AppFrame/MenuItem.js +17 -26
  6. package/dist/components/AppFrame/Preferences.js +14 -14
  7. package/dist/components/AppFrame/Sidebar.js +6 -6
  8. package/dist/components/AppFrame/Topbar.js +6 -6
  9. package/dist/components/ApplicationModuleLoader.js +3 -2
  10. package/dist/components/Authenticate.js +29 -22
  11. package/dist/components/DropMenu/Menu.js +9 -9
  12. package/dist/components/ErrorPlaceholder.js +8 -24
  13. package/dist/components/Form/Field.js +4 -4
  14. package/dist/components/Form/Inputs/Button.js +2 -2
  15. package/dist/components/{IconButton.js → Form/Inputs/MultiSelector.js} +33 -31
  16. package/dist/components/Form/Inputs/index.js +1 -1
  17. package/dist/components/InternetExplorerWarningMessage.js +15 -15
  18. package/dist/components/LoadingIcon.js +38 -17
  19. package/dist/components/MaterialUI/DataDisplay/Modal.js +3 -3
  20. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +6 -6
  21. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +4 -4
  22. package/dist/components/MaterialUI/DataDisplay/SelectionList.js +1 -1
  23. package/dist/components/MaterialUI/DataDisplay/Table.js +2 -1
  24. package/dist/components/MaterialUI/DataDisplay/TableProps.js +3 -1
  25. package/dist/components/MaterialUI/DataDisplay/TransferList.js +1 -1
  26. package/dist/components/MaterialUI/Inputs/CheckboxGroup.js +1 -1
  27. package/dist/components/MaterialUI/Inputs/DatePicker.js +1 -1
  28. package/dist/components/MaterialUI/Inputs/InputBase.js +20 -188
  29. package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -1
  30. package/dist/components/MaterialUI/Inputs/Select.js +10 -0
  31. package/dist/components/MaterialUI/Inputs/SelectProps.js +3 -1
  32. package/dist/components/MaterialUI/Inputs/Switch.js +1 -1
  33. package/dist/components/MaterialUI/Navigation/DropDownMenu.js +2 -4
  34. package/dist/components/MaterialUI/ScopeSelector/ScopeSelector.js +1 -1
  35. package/dist/components/MaterialUI/ScopeSelector/TreeItem.js +27 -42
  36. package/dist/components/MaterialUI/Surfaces/Paper.js +1 -1
  37. package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +3 -2
  38. package/dist/components/MaterialUI/muiThemes.js +2 -0
  39. package/dist/components/Provision.js +30 -13
  40. package/dist/components/Routing/SegmentPage.js +115 -56
  41. package/dist/components/Scope/ScopeNode.js +62 -57
  42. package/dist/components/Sidepanel.js +59 -23
  43. package/dist/components/Spritesheet.js +35 -17
  44. package/dist/components/Text.js +1 -60
  45. package/dist/components/ToastList.js +95 -64
  46. package/dist/components/Treeview/Branch.js +82 -20
  47. package/dist/components/Treeview/Label.js +108 -31
  48. package/dist/components/Treeview/Leaf.js +56 -12
  49. package/dist/components/Treeview/Node.js +22 -9
  50. package/dist/components/Treeview/index.js +7 -1
  51. package/dist/components/Treeview/settings.js +17 -6
  52. package/dist/utils/index.js +0 -4
  53. package/dist/utils/testUtils.js +1 -12
  54. package/dist/{components/Modal/Background.js → utils/toastHelper.js} +11 -14
  55. package/package.json +2 -2
  56. package/src/components/AppFrame/About.js +13 -13
  57. package/src/components/AppFrame/Anchor.js +7 -7
  58. package/src/components/AppFrame/AppFrame.js +3 -3
  59. package/src/components/AppFrame/Help.js +4 -4
  60. package/src/components/AppFrame/MenuItem.js +15 -23
  61. package/src/components/AppFrame/Preferences.js +14 -14
  62. package/src/components/AppFrame/Sidebar.js +6 -6
  63. package/src/components/AppFrame/Topbar.js +6 -6
  64. package/src/components/ApplicationModuleLoader.js +2 -2
  65. package/src/components/ApplicationModuleLoader.test.js +15 -28
  66. package/src/components/Authenticate.js +21 -23
  67. package/src/components/Authenticate.test.js +19 -27
  68. package/src/components/DropMenu/Menu.js +9 -9
  69. package/src/components/ErrorPlaceholder.js +4 -21
  70. package/src/components/ErrorPlaceholder.test.js +7 -14
  71. package/src/components/Form/Field.js +4 -4
  72. package/src/components/Form/InputField.test.js +2 -1
  73. package/src/components/Form/Inputs/Button.js +2 -2
  74. package/src/components/Form/Inputs/MultiSelector.js +23 -0
  75. package/src/components/Form/Inputs/MultiSelector.test.js +112 -0
  76. package/src/components/Form/Inputs/index.js +1 -1
  77. package/src/components/InternetExplorerWarningMessage.js +15 -15
  78. package/src/components/Loader.test.js +50 -59
  79. package/src/components/LoadingIcon.js +27 -14
  80. package/src/components/LoadingIcon.test.js +11 -15
  81. package/src/components/MaterialUI/DataDisplay/Modal.js +3 -3
  82. package/src/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +6 -6
  83. package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +3 -3
  84. package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.test.js +0 -74
  85. package/src/components/MaterialUI/DataDisplay/PredefinedElements/Translations.test.js +6 -18
  86. package/src/components/MaterialUI/DataDisplay/SelectionList.js +1 -1
  87. package/src/components/MaterialUI/DataDisplay/Table.js +6 -1
  88. package/src/components/MaterialUI/DataDisplay/Table.test.js +21 -1
  89. package/src/components/MaterialUI/DataDisplay/TableProps.js +2 -0
  90. package/src/components/MaterialUI/DataDisplay/TableProps.test.js +20 -2
  91. package/src/components/MaterialUI/DataDisplay/TransferList.js +1 -1
  92. package/src/components/MaterialUI/Inputs/CheckboxGroup.js +1 -1
  93. package/src/components/MaterialUI/Inputs/DatePicker.js +1 -1
  94. package/src/components/MaterialUI/Inputs/InputBase.js +31 -214
  95. package/src/components/MaterialUI/Inputs/InputBase.test.js +1 -460
  96. package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -1
  97. package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.test.js +1 -1
  98. package/src/components/MaterialUI/Inputs/Select.js +7 -0
  99. package/src/components/MaterialUI/Inputs/Select.test.js +45 -0
  100. package/src/components/MaterialUI/Inputs/SelectProps.js +2 -0
  101. package/src/components/MaterialUI/Inputs/SelectProps.test.js +2 -0
  102. package/src/components/MaterialUI/Inputs/Switch.js +1 -1
  103. package/src/components/MaterialUI/Navigation/DropDownMenu.js +2 -2
  104. package/src/components/MaterialUI/Navigation/DropDownMenu.test.js +5 -6
  105. package/src/components/MaterialUI/ScopeSelector/ScopeSelector.js +1 -2
  106. package/src/components/MaterialUI/ScopeSelector/TreeItem.js +8 -31
  107. package/src/components/MaterialUI/Surfaces/Paper.js +1 -1
  108. package/src/components/MaterialUI/Surfaces/SectionExpansionPanel.js +2 -1
  109. package/src/components/MaterialUI/muiThemes.js +3 -0
  110. package/src/components/Navigation/Navigation.test.js +0 -5
  111. package/src/components/Navigation/useNavigationState.test.js +79 -222
  112. package/src/components/Provision.js +36 -42
  113. package/src/components/Provision.test.js +10 -26
  114. package/src/components/Routing/SegmentPage.js +68 -52
  115. package/src/components/Routing/SegmentPage.test.js +4 -12
  116. package/src/components/Scope/ScopeNode.js +44 -55
  117. package/src/components/Scope/ScopeNode.test.js +84 -163
  118. package/src/components/ScopeExtendedConfigurationLoader.test.js +1 -4
  119. package/src/components/Sidepanel.js +38 -32
  120. package/src/components/Sidepanel.test.js +54 -27
  121. package/src/components/Spritesheet.js +23 -21
  122. package/src/components/Spritesheet.test.js +10 -10
  123. package/src/components/Text.js +0 -49
  124. package/src/components/ToastList.js +79 -90
  125. package/src/components/ToastList.test.js +29 -103
  126. package/src/components/Treeview/Branch.js +65 -47
  127. package/src/components/Treeview/Branch.test.js +2 -43
  128. package/src/components/Treeview/Label.js +68 -54
  129. package/src/components/Treeview/Label.test.js +55 -63
  130. package/src/components/Treeview/Leaf.js +41 -22
  131. package/src/components/Treeview/Leaf.test.js +1 -15
  132. package/src/components/Treeview/Node.js +16 -9
  133. package/src/components/Treeview/Node.test.js +269 -200
  134. package/src/components/Treeview/Treeview.test.js +248 -248
  135. package/src/components/Treeview/index.js +6 -0
  136. package/src/components/Treeview/settings.js +10 -6
  137. package/src/utils/index.js +0 -4
  138. package/src/utils/testUtils.js +0 -10
  139. package/src/utils/testUtils.test.js +0 -68
  140. package/src/utils/toastHelper.js +8 -0
  141. package/src/utils/toastHelper.test.js +41 -0
  142. package/dist/components/Button.js +0 -70
  143. package/dist/components/CategoryList.js +0 -197
  144. package/dist/components/Checkbox.js +0 -103
  145. package/dist/components/Icon.js +0 -69
  146. package/dist/components/Input.js +0 -101
  147. package/dist/components/List/DataCell.js +0 -129
  148. package/dist/components/List/HeadCell.js +0 -125
  149. package/dist/components/List/HeadRow.js +0 -73
  150. package/dist/components/List/List.js +0 -274
  151. package/dist/components/List/Row.js +0 -109
  152. package/dist/components/List/enhanceColumnDefs.js +0 -111
  153. package/dist/components/List/index.js +0 -59
  154. package/dist/components/Modal/Dialog.js +0 -75
  155. package/dist/components/Modal/Wrapper.js +0 -69
  156. package/dist/components/Modal/index.js +0 -86
  157. package/dist/components/MultiSelector.js +0 -187
  158. package/dist/components/Navigation/Bar.js +0 -293
  159. package/dist/components/Navigation/Tab.js +0 -182
  160. package/dist/components/Placeholder.js +0 -114
  161. package/dist/components/Scope/Selector.js +0 -123
  162. package/dist/components/Selector.js +0 -185
  163. package/dist/components/Switch.js +0 -128
  164. package/dist/components/Toolbar.js +0 -227
  165. package/dist/components/Tooltip.js +0 -66
  166. package/dist/getTheme.js +0 -158
  167. package/dist/getThemeOverrides.js +0 -93
  168. package/dist/hocs/withAuthentication.js +0 -72
  169. package/dist/utils/styledPropFuncs.js +0 -88
  170. package/src/components/Button.js +0 -90
  171. package/src/components/Button.test.js +0 -49
  172. package/src/components/CategoryList.js +0 -140
  173. package/src/components/CategoryList.test.js +0 -667
  174. package/src/components/Checkbox.js +0 -63
  175. package/src/components/Checkbox.test.js +0 -122
  176. package/src/components/Icon.js +0 -18
  177. package/src/components/IconButton.js +0 -30
  178. package/src/components/IconButton.test.js +0 -61
  179. package/src/components/Input.js +0 -35
  180. package/src/components/Input.test.js +0 -34
  181. package/src/components/List/DataCell.js +0 -77
  182. package/src/components/List/DataCell.test.js +0 -357
  183. package/src/components/List/HeadCell.js +0 -105
  184. package/src/components/List/HeadCell.test.js +0 -331
  185. package/src/components/List/HeadRow.js +0 -21
  186. package/src/components/List/HeadRow.test.js +0 -27
  187. package/src/components/List/List.js +0 -162
  188. package/src/components/List/List.test.js +0 -705
  189. package/src/components/List/Row.js +0 -72
  190. package/src/components/List/Row.test.js +0 -194
  191. package/src/components/List/enhanceColumnDefs.js +0 -54
  192. package/src/components/List/enhanceColumnDefs.test.js +0 -179
  193. package/src/components/List/index.js +0 -6
  194. package/src/components/Modal/Background.js +0 -10
  195. package/src/components/Modal/Dialog.js +0 -27
  196. package/src/components/Modal/Dialog.test.js +0 -20
  197. package/src/components/Modal/Modal.test.js +0 -52
  198. package/src/components/Modal/Wrapper.js +0 -32
  199. package/src/components/Modal/Wrapper.test.js +0 -55
  200. package/src/components/Modal/index.js +0 -22
  201. package/src/components/MultiSelector.js +0 -104
  202. package/src/components/MultiSelector.test.js +0 -348
  203. package/src/components/Navigation/Bar.js +0 -212
  204. package/src/components/Navigation/Bar.test.js +0 -552
  205. package/src/components/Navigation/Tab.js +0 -156
  206. package/src/components/Navigation/Tab.test.js +0 -404
  207. package/src/components/Placeholder.js +0 -61
  208. package/src/components/Placeholder.test.js +0 -106
  209. package/src/components/Scope/Selector.js +0 -70
  210. package/src/components/Scope/Selector.test.js +0 -138
  211. package/src/components/Selector.js +0 -191
  212. package/src/components/Selector.test.js +0 -157
  213. package/src/components/Switch.js +0 -112
  214. package/src/components/Switch.test.js +0 -130
  215. package/src/components/Text.test.js +0 -132
  216. package/src/components/Toolbar.js +0 -178
  217. package/src/components/Toolbar.test.js +0 -478
  218. package/src/components/Tooltip.js +0 -51
  219. package/src/components/Tooltip.test.js +0 -21
  220. package/src/getTheme.js +0 -103
  221. package/src/getTheme.test.js +0 -92
  222. package/src/getThemeOverrides.js +0 -27
  223. package/src/hocs/withAuthentication.js +0 -18
  224. package/src/hocs/withAuthentication.test.js +0 -120
  225. package/src/utils/styledPropFuncs.js +0 -20
  226. package/src/utils/styledPropFuncs.test.js +0 -166
@@ -1,93 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.default = void 0;
5
- (function () {
6
- var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
7
- enterModule && enterModule(module);
8
- })();
9
- (function () {
10
- var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
11
- enterModule && enterModule(module);
12
- })();
13
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
15
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
16
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
17
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
- var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
19
- return a;
20
- };
21
- var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
22
- return a;
23
- };
24
- /* istanbul ignore file */
25
- // Override values to use Orckestra icon sheet and colors
26
- // See also orc-shared/src/getTheme.js#setApplicationColors()
27
- var colors = {
28
- orckestraBlue: "#00b2e2",
29
- pim: {
30
- base: "#0a98cf",
31
- highlight: "#8ad5f2"
32
- },
33
- oms: {
34
- base: "#1f5b7f",
35
- primary: "#b4cfe3",
36
- highlight: "#b4cfe3",
37
- select: "#b4cfe3"
38
- },
39
- marketing: {
40
- base: "#fd6b35",
41
- highlight: "#fd6b35"
42
- },
43
- analytics: {
44
- base: "#ffa205",
45
- dark: "#cf8409",
46
- highlight: "#f1eae0"
47
- }
48
- };
49
- var getThemeOverrides = function getThemeOverrides(appName) {
50
- var application = colors[appName] || {
51
- base: "#ff00ff",
52
- // Deliberately godawful default value
53
- highlight: "#efefef"
54
- };
55
- return {
56
- colors: _objectSpread(_objectSpread({}, colors), {}, {
57
- application: application
58
- })
59
- };
60
- };
61
- var _default = getThemeOverrides;
62
- var _default2 = _default;
63
- var _default3 = exports.default = _default2;
64
- ;
65
- (function () {
66
- var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
67
- if (!reactHotLoader) {
68
- return;
69
- }
70
- reactHotLoader.register(colors, "colors", "/home/vsts/work/1/s/src/getThemeOverrides.js");
71
- reactHotLoader.register(getThemeOverrides, "getThemeOverrides", "/home/vsts/work/1/s/src/getThemeOverrides.js");
72
- reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/getThemeOverrides.js");
73
- })();
74
- ;
75
- (function () {
76
- var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
77
- leaveModule && leaveModule(module);
78
- })();
79
- ;
80
- (function () {
81
- var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
82
- if (!reactHotLoader) {
83
- return;
84
- }
85
- reactHotLoader.register(colors, "colors", "/home/vsts/work/1/s/src/getThemeOverrides.js");
86
- reactHotLoader.register(getThemeOverrides, "getThemeOverrides", "/home/vsts/work/1/s/src/getThemeOverrides.js");
87
- reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/getThemeOverrides.js");
88
- })();
89
- ;
90
- (function () {
91
- var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
92
- leaveModule && leaveModule(module);
93
- })();
@@ -1,72 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.default = void 0;
5
- var _recompose = require("recompose");
6
- var _Authenticate = require("../components/Authenticate");
7
- var _excluded = ["authedUser", "loading", "requestError", "needLogin"];
8
- (function () {
9
- var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
10
- enterModule && enterModule(module);
11
- })();
12
- (function () {
13
- var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
14
- enterModule && enterModule(module);
15
- })();
16
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
17
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
18
- var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
19
- return a;
20
- };
21
- var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
22
- return a;
23
- };
24
- console.warn("Higher order component withAuthentication has been deprecated in favor of component Authenticate");
25
- var isAuthenticated = (0, _recompose.withProps)(_Authenticate.useAuthenticationData);
26
- var withAuthentication = (0, _recompose.compose)(isAuthenticated, (0, _recompose.branch)(function (_ref) {
27
- var loading = _ref.loading;
28
- return loading;
29
- }, (0, _recompose.renderComponent)(_Authenticate.Loader)), (0, _recompose.branch)(function (_ref2) {
30
- var authedUser = _ref2.authedUser;
31
- return !authedUser;
32
- }, (0, _recompose.renderComponent)(_Authenticate.Error), (0, _recompose.mapProps)(function (_ref3) {
33
- var authedUser = _ref3.authedUser,
34
- loading = _ref3.loading,
35
- requestError = _ref3.requestError,
36
- needLogin = _ref3.needLogin,
37
- props = _objectWithoutProperties(_ref3, _excluded);
38
- return props;
39
- })));
40
- var _default = withAuthentication;
41
- var _default2 = _default;
42
- var _default3 = exports.default = _default2;
43
- ;
44
- (function () {
45
- var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
46
- if (!reactHotLoader) {
47
- return;
48
- }
49
- reactHotLoader.register(isAuthenticated, "isAuthenticated", "/home/vsts/work/1/s/src/hocs/withAuthentication.js");
50
- reactHotLoader.register(withAuthentication, "withAuthentication", "/home/vsts/work/1/s/src/hocs/withAuthentication.js");
51
- reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/hocs/withAuthentication.js");
52
- })();
53
- ;
54
- (function () {
55
- var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
56
- leaveModule && leaveModule(module);
57
- })();
58
- ;
59
- (function () {
60
- var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
61
- if (!reactHotLoader) {
62
- return;
63
- }
64
- reactHotLoader.register(isAuthenticated, "isAuthenticated", "/home/vsts/work/1/s/src/hocs/withAuthentication.js");
65
- reactHotLoader.register(withAuthentication, "withAuthentication", "/home/vsts/work/1/s/src/hocs/withAuthentication.js");
66
- reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/hocs/withAuthentication.js");
67
- })();
68
- ;
69
- (function () {
70
- var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
71
- leaveModule && leaveModule(module);
72
- })();
@@ -1,88 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.switchEnum = exports.ifFlag = exports.getThemeProp = void 0;
5
- var _safeGet = _interopRequireDefault(require("./safeGet"));
6
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
7
- (function () {
8
- var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
9
- enterModule && enterModule(module);
10
- })();
11
- (function () {
12
- var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
13
- enterModule && enterModule(module);
14
- })();
15
- var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
16
- return a;
17
- };
18
- var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
19
- return a;
20
- };
21
- var feedPropFunc = function feedPropFunc(props) {
22
- return function (value) {
23
- return typeof value === "function" ? value(props) : value;
24
- };
25
- };
26
-
27
- /* Safely gets a (potentially nested) theme property, can run a function on the resulting value */
28
- var getThemeProp = exports.getThemeProp = function getThemeProp(path, defaultValue, func) {
29
- if (func === void 0) {
30
- func = function func(x) {
31
- return x;
32
- };
33
- }
34
- return function (props) {
35
- return func(_safeGet.default.apply(void 0, [props, "theme"].concat(path.map(feedPropFunc(props)))) || feedPropFunc(props)(defaultValue));
36
- };
37
- };
38
-
39
- /* Use in styled components to check if a prop has a truthy value and
40
- return values based on that. */
41
- var ifFlag = exports.ifFlag = function ifFlag(name, thenVal, elseVal) {
42
- if (elseVal === void 0) {
43
- elseVal = "";
44
- }
45
- return function (props) {
46
- return props[name] ? feedPropFunc(props)(thenVal) : feedPropFunc(props)(elseVal);
47
- };
48
- };
49
-
50
- /* Creates a prop function that checks a field against a list of cases,
51
- and gives back a found case, or a default */
52
- var switchEnum = exports.switchEnum = function switchEnum(enumField, cases) {
53
- return function (props) {
54
- return cases[props[enumField]] || cases["default"];
55
- };
56
- };
57
- ;
58
- (function () {
59
- var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
60
- if (!reactHotLoader) {
61
- return;
62
- }
63
- reactHotLoader.register(feedPropFunc, "feedPropFunc", "/home/vsts/work/1/s/src/utils/styledPropFuncs.js");
64
- reactHotLoader.register(getThemeProp, "getThemeProp", "/home/vsts/work/1/s/src/utils/styledPropFuncs.js");
65
- reactHotLoader.register(ifFlag, "ifFlag", "/home/vsts/work/1/s/src/utils/styledPropFuncs.js");
66
- reactHotLoader.register(switchEnum, "switchEnum", "/home/vsts/work/1/s/src/utils/styledPropFuncs.js");
67
- })();
68
- ;
69
- (function () {
70
- var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
71
- leaveModule && leaveModule(module);
72
- })();
73
- ;
74
- (function () {
75
- var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
76
- if (!reactHotLoader) {
77
- return;
78
- }
79
- reactHotLoader.register(feedPropFunc, "feedPropFunc", "/home/vsts/work/1/s/src/utils/styledPropFuncs.js");
80
- reactHotLoader.register(getThemeProp, "getThemeProp", "/home/vsts/work/1/s/src/utils/styledPropFuncs.js");
81
- reactHotLoader.register(ifFlag, "ifFlag", "/home/vsts/work/1/s/src/utils/styledPropFuncs.js");
82
- reactHotLoader.register(switchEnum, "switchEnum", "/home/vsts/work/1/s/src/utils/styledPropFuncs.js");
83
- })();
84
- ;
85
- (function () {
86
- var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
87
- leaveModule && leaveModule(module);
88
- })();
@@ -1,90 +0,0 @@
1
- import styled, { css } from "styled-components";
2
- import { getThemeProp, ifFlag } from "../utils";
3
- import { tint } from "polished";
4
-
5
- const borderColor = base => ifFlag("primary", getThemeProp(["colors", "application", "base"], base), base);
6
-
7
- const background = ifFlag(
8
- "primary",
9
- ifFlag(
10
- "active",
11
- css`
12
- color: #fff;
13
- background-image: linear-gradient(
14
- ${getThemeProp(["colors", "application", "base"], "#333", color => tint(0.05, color))},
15
- ${getThemeProp(["colors", "application", "base"], "#333")}
16
- );
17
- &:enabled:active {
18
- background-image: none;
19
- background-color: #fff;
20
- color: ${getThemeProp(["colors", "application", "base"], "#333")};
21
- }
22
- `,
23
- css`
24
- color: ${getThemeProp(["colors", "application", "base"], "#333")};
25
- background-image: none;
26
- background-color: #fff;
27
- &:enabled:active {
28
- color: #fff;
29
- background-image: linear-gradient(
30
- ${getThemeProp(["colors", "application", "base"], "#333", color => tint(0.05, color))},
31
- ${getThemeProp(["colors", "application", "base"], "#333")}
32
- );
33
- }
34
- `,
35
- ),
36
- ifFlag(
37
- "active",
38
- css`
39
- background-image: none;
40
- background-color: ${getThemeProp(["colors", "bgLight"], "#efefef")};
41
- &:enabled:active {
42
- background-color: #f7f7f7;
43
- }
44
- `,
45
- css`
46
- background-image: none;
47
- background-color: #f7f7f7;
48
- &:enabled:active {
49
- background-color: ${getThemeProp(["colors", "bgLight"], "#efefef")};
50
- }
51
- `,
52
- ),
53
- );
54
-
55
- const Button = styled.button`
56
- display: inline-block;
57
- margin: 0;
58
- font-weight: 400;
59
- text-align: center;
60
- vertical-align: middle;
61
- cursor: pointer;
62
- white-space: nowrap;
63
- padding: 6px 10px;
64
- font-size: 13px;
65
- line-height: 1.42857;
66
- border-radius: 4px;
67
- user-select: none;
68
- height: 30px;
69
- border: 1px solid ${borderColor(getThemeProp(["colors", "borderLight"], "#cccccc"))};
70
- outline: none;
71
- font-family: ${getThemeProp(["fonts", "header"], "sans-serif")};
72
- text-transform: uppercase;
73
- min-width: 50px;
74
- box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
75
- ${background};
76
-
77
- &:enabled:active,
78
- &:enabled:focus,
79
- &:enabled:hover {
80
- border-color: ${borderColor("#4fa1f0")};
81
- box-shadow: 0 0 4px #4fa1f0;
82
- outline: none;
83
- }
84
- &:disabled {
85
- opacity: 0.6;
86
- cursor: default;
87
- }
88
- `;
89
-
90
- export default Button;
@@ -1,49 +0,0 @@
1
- import React from "react";
2
- import Button from "./Button";
3
-
4
- describe("Button", () => {
5
- let onClick;
6
- beforeEach(() => {
7
- onClick = () => {};
8
- });
9
-
10
- it("renders a button", () =>
11
- expect(
12
- <Button onClick={onClick}>Label</Button>,
13
- "when mounted",
14
- "to satisfy",
15
- <button onClick={onClick}>Label</button>,
16
- ));
17
-
18
- it("sets an inactive background-color", () =>
19
- expect(<Button />, "when mounted", "to have style rules satisfying", "to contain", "background-color: #f7f7f7;"));
20
-
21
- it("sets an active background-color", () =>
22
- expect(
23
- <Button active />,
24
- "when mounted",
25
- "to have style rules satisfying",
26
- "to contain",
27
- "background-color: #efefef;",
28
- ));
29
-
30
- describe("primary", () => {
31
- it("sets an inactive background gradient", () =>
32
- expect(
33
- <Button primary />,
34
- "when mounted",
35
- "to have style rules satisfying",
36
- "to contain",
37
- "background-color: #fff;",
38
- ));
39
-
40
- it("sets an active background-color", () =>
41
- expect(
42
- <Button primary active />,
43
- "when mounted",
44
- "to have style rules satisfying",
45
- "to contain",
46
- "background-image: linear-gradient( #3d3d3d,#333 )",
47
- ));
48
- });
49
- });
@@ -1,140 +0,0 @@
1
- /*
2
- Multiple lists with a single header, aligned with each other
3
- No virtualization or page loading
4
- Categories can be folded up to hide content
5
- Sortable, within categories
6
- */
7
- import React from "react";
8
- import styled, { css } from "styled-components";
9
- import { compose, setDisplayName } from "recompose";
10
- import { safeGet, ifFlag, getThemeProp } from "../utils";
11
- import withScrollBox from "../hocs/withScrollBox";
12
- import useViewState from "../hooks/useViewState";
13
- import Icon from "./Icon";
14
- import Row from "./List/Row";
15
- import HeadRow from "./List/HeadRow";
16
- import { useListState, Table, Placeholder, HEADER_HEIGHT } from "./List/List";
17
-
18
- const arrayToggle = (array, item) => (array.includes(item) ? array.filter(x => x !== item) : array.concat(item));
19
-
20
- export const CategoryRow = styled.tr``;
21
-
22
- export const CategoryHeader = styled.td`
23
- border: 0 solid ${getThemeProp(["colors", "borderLight"], "#cccccc")};
24
- border-top-width: 1px;
25
- tr:first-child & {
26
- border-top-width: 0;
27
- }
28
- tr:last-child & {
29
- border-bottom-width: 1px;
30
- }
31
-
32
- position: relative;
33
- padding: 11px 45px;
34
- background-color: #f1eae0;
35
- ${ifFlag(
36
- "closed",
37
- css`
38
- border-bottom: 1px solid ${getThemeProp(["colors", "borderLight"], "#cccccc")};
39
- `,
40
- )}
41
- cursor: pointer;
42
- `;
43
-
44
- export const CategoryIndicator = styled(Icon).attrs(props => ({
45
- id: ifFlag(
46
- "closed",
47
- getThemeProp(["icons", "indicators", "right"], "chevron-right"),
48
- getThemeProp(["icons", "indicators", "down"], "chevron-down"),
49
- )(props),
50
- }))`
51
- font-size: 12px;
52
- position: absolute;
53
- left: 22px;
54
- top: 15px;
55
- `;
56
-
57
- export const CategoryList = ({
58
- name,
59
- columnDefs = [],
60
- rows = [],
61
- rowOnClick,
62
- placeholder,
63
- keyField = ["id"],
64
- categoryField = ["category"],
65
- openAll = false,
66
- height,
67
- rowBackgroundGetter = () => {},
68
- }) => {
69
- const [enhancedColumnDefs, selection] = useListState(name, columnDefs);
70
- const [{ closedCategories = [] }, updateViewState] = useViewState(name);
71
- if (columnDefs.length === 0) return null;
72
- const rowIds = [],
73
- rowCategories = {};
74
- rows.forEach((row, index) => {
75
- const id = safeGet(row, ...keyField) + ""; // Ensure rowId is string
76
- const category = safeGet(row, ...categoryField) || "";
77
- rowIds.push(id);
78
- if (!rowCategories[category]) {
79
- rowCategories[category] = [];
80
- }
81
- rowCategories[category].push(
82
- <Row
83
- columnDefs={enhancedColumnDefs}
84
- key={id}
85
- rowId={id}
86
- row={row}
87
- rowOnClick={rowOnClick}
88
- selected={selection.indexOf(id) !== -1}
89
- bgColor={rowBackgroundGetter(row, index)}
90
- />,
91
- );
92
- });
93
- const rowElements = [];
94
- if (Object.keys(rowCategories).length === 0) {
95
- if (placeholder) {
96
- rowElements.push(
97
- <Placeholder key="placeholder" width={columnDefs.length} height={height - HEADER_HEIGHT}>
98
- {placeholder}
99
- </Placeholder>,
100
- );
101
- }
102
- } else {
103
- Object.entries(rowCategories).forEach(([key, rows]) => {
104
- const clickHandler = () => updateViewState("closedCategories", arrayToggle(closedCategories, key));
105
- const closed = !openAll && closedCategories.includes(key);
106
- rowElements.push(
107
- <CategoryRow key={"category_" + key}>
108
- <CategoryHeader
109
- data-test-id={"category_" + key}
110
- closed={closed}
111
- colSpan={columnDefs.length}
112
- onClick={clickHandler}
113
- >
114
- <CategoryIndicator closed={closed} />
115
- {key}
116
- </CategoryHeader>
117
- </CategoryRow>,
118
- );
119
- if (!closed) {
120
- rowElements.push(...rows);
121
- }
122
- });
123
- }
124
- return (
125
- <Table>
126
- <thead>
127
- <HeadRow
128
- columnDefs={enhancedColumnDefs}
129
- rowIds={rowIds}
130
- allSelected={rows.length === selection.length && rows.length !== 0}
131
- />
132
- </thead>
133
- <tbody>{rowElements}</tbody>
134
- </Table>
135
- );
136
- };
137
-
138
- const StatefulCategoryList = compose(setDisplayName("CategoryList"), withScrollBox)(CategoryList);
139
-
140
- export default StatefulCategoryList;