gogoclient 1.2.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.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/components/AuthWrapper.js +61 -0
- package/dist/components/PageLayout.js +53 -0
- package/dist/components/RequireAuth.js +86 -0
- package/dist/components/index.js +27 -0
- package/dist/helpers/Root.js +206 -0
- package/dist/helpers/SubscriptionManager.js +61 -0
- package/dist/helpers/currentUserContext.js +12 -0
- package/dist/helpers/currentUserQuery.js +11 -0
- package/dist/helpers/getUrl.js +18 -0
- package/dist/helpers/sentry.js +25 -0
- package/dist/helpers/startClient.js +25 -0
- package/dist/helpers/subscriptionManagerContext.js +22 -0
- package/dist/index.js +109 -0
- package/dist/pages/ProviderConnection.page.js +99 -0
- package/dist/pages/ProviderConnection.queries.js +12 -0
- package/dist/pages/index.js +28 -0
- package/dist/theme/elements/Action.js +29 -0
- package/dist/theme/elements/ActionGroup.js +14 -0
- package/dist/theme/elements/AppBar.js +17 -0
- package/dist/theme/elements/Button.js +31 -0
- package/dist/theme/elements/Checkbox.js +38 -0
- package/dist/theme/elements/GlobalStyle.js +10 -0
- package/dist/theme/elements/Logo.js +10 -0
- package/dist/theme/elements/Menu.js +15 -0
- package/dist/theme/elements/Radio.js +27 -0
- package/dist/theme/elements/TextField.js +39 -0
- package/dist/theme/elements/index.js +76 -0
- package/dist/theme/index.js +93 -0
- package/dist/toolkit/darkenLighten.js +57 -0
- package/dist/toolkit/headingScale.js +29 -0
- package/dist/toolkit/index.js +79 -0
- package/dist/toolkit/media.js +23 -0
- package/dist/toolkit/override.js +74 -0
- package/dist/toolkit/styles/fadeInOut.js +11 -0
- package/dist/toolkit/styles/rotate360.js +11 -0
- package/dist/toolkit/themeHelper.js +53 -0
- package/dist/ui/_helpers/_helpers.js +69 -0
- package/dist/ui/_helpers/cssSnippets.js +11 -0
- package/dist/ui/_helpers/index.js +40 -0
- package/dist/ui/_helpers/useBreakpoint.js +35 -0
- package/dist/ui/assignReviewers/AssignReviewers.js +174 -0
- package/dist/ui/assignReviewers/InviteRowProp.js +130 -0
- package/dist/ui/assignReviewers/ReviewerTable.js +268 -0
- package/dist/ui/assignReviewers/SearchBox.js +160 -0
- package/dist/ui/assignReviewers/SuggestedReviewer.js +28 -0
- package/dist/ui/assignReviewers/index.js +13 -0
- package/dist/ui/authentication/AuthenticationForm.js +87 -0
- package/dist/ui/authentication/AuthenticationHeader.js +13 -0
- package/dist/ui/authentication/AuthenticationWrapper.js +13 -0
- package/dist/ui/authentication/ChangePassword.js +128 -0
- package/dist/ui/authentication/DeactivatedUser.js +17 -0
- package/dist/ui/authentication/Login.js +74 -0
- package/dist/ui/authentication/ProfileForm.js +79 -0
- package/dist/ui/authentication/ProviderConnection.js +69 -0
- package/dist/ui/authentication/RequestPasswordReset.js +89 -0
- package/dist/ui/authentication/ResetPassword.js +96 -0
- package/dist/ui/authentication/Signup.js +180 -0
- package/dist/ui/authentication/SuccessSubTitle.js +20 -0
- package/dist/ui/authentication/VerifyCheck.js +55 -0
- package/dist/ui/authentication/VerifyEmail.js +119 -0
- package/dist/ui/authentication/index.js +104 -0
- package/dist/ui/chat/ChatInput.js +63 -0
- package/dist/ui/chat/ChatMessage.js +67 -0
- package/dist/ui/chat/ChatMessageList.js +45 -0
- package/dist/ui/chat/ChatThread.js +41 -0
- package/dist/ui/chat/index.js +34 -0
- package/dist/ui/common/AutoComplete.js +56 -0
- package/dist/ui/common/Button.js +83 -0
- package/dist/ui/common/ButtonGroup.js +58 -0
- package/dist/ui/common/Checkbox.js +30 -0
- package/dist/ui/common/CheckboxGroup.js +42 -0
- package/dist/ui/common/CokoLink.js +24 -0
- package/dist/ui/common/Collapse.js +14 -0
- package/dist/ui/common/DateParser.js +49 -0
- package/dist/ui/common/Divider.js +8 -0
- package/dist/ui/common/Empty.js +14 -0
- package/dist/ui/common/Form.js +216 -0
- package/dist/ui/common/FormSection.js +35 -0
- package/dist/ui/common/Headings.js +74 -0
- package/dist/ui/common/Input.js +72 -0
- package/dist/ui/common/InputNumber.js +54 -0
- package/dist/ui/common/InviteStatus.js +63 -0
- package/dist/ui/common/Layout.js +17 -0
- package/dist/ui/common/LinkWithoutStyles.js +12 -0
- package/dist/ui/common/List.js +390 -0
- package/dist/ui/common/Modal.js +17 -0
- package/dist/ui/common/Note.js +23 -0
- package/dist/ui/common/Page.js +33 -0
- package/dist/ui/common/Pagination.js +126 -0
- package/dist/ui/common/Popup.js +146 -0
- package/dist/ui/common/Radio.js +54 -0
- package/dist/ui/common/Result.js +8 -0
- package/dist/ui/common/Ribbon.js +54 -0
- package/dist/ui/common/Search.js +30 -0
- package/dist/ui/common/Select.js +148 -0
- package/dist/ui/common/Spin.js +87 -0
- package/dist/ui/common/Split.js +49 -0
- package/dist/ui/common/Status.js +53 -0
- package/dist/ui/common/Switch.js +47 -0
- package/dist/ui/common/Table.js +111 -0
- package/dist/ui/common/Tabs.js +8 -0
- package/dist/ui/common/TabsStyled.js +65 -0
- package/dist/ui/common/TextArea.js +29 -0
- package/dist/ui/common/Typography.js +9 -0
- package/dist/ui/common/VisuallyHiddenElement.js +17 -0
- package/dist/ui/common/_reusableStyles.js +14 -0
- package/dist/ui/common/index.js +341 -0
- package/dist/ui/index.js +49 -0
- package/package.json +114 -0
- package/scripts/coko-client-build.js +42 -0
- package/scripts/coko-client-build.sh +28 -0
- package/scripts/coko-client-dev.js +16 -0
- package/scripts/coko-client-dev.sh +28 -0
- package/scripts/env.sh +41 -0
- package/webpack/changes.md +20 -0
- package/webpack/index.ejs +15 -0
- package/webpack/noop.js +11 -0
- package/webpack/webpack.config.js +483 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
var _toolkit = require("../../toolkit");
|
|
12
|
+
var _index = require("../../index");
|
|
13
|
+
var _theme = _interopRequireDefault(require("../../theme"));
|
|
14
|
+
var _excluded = ["alignment", "children", "focusableContent", "id", "toggle", "position"];
|
|
15
|
+
var _templateObject, _templateObject2;
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
17
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
19
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
20
|
+
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."); }
|
|
21
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
22
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
23
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
24
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
25
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
26
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
27
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
28
|
+
var PopupContainer = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n border: 1px solid ", ";\n border-radius: 10px;\n display: ", ";\n\n ", "\n padding: ", ";\n position: absolute;\n\n z-index: 1000;\n"])), _theme["default"].colorBackground, _theme["default"].colorBorder, function (_ref) {
|
|
29
|
+
var visible = _ref.visible;
|
|
30
|
+
return visible ? 'block' : 'none';
|
|
31
|
+
}, function (props) {
|
|
32
|
+
var position = props.position,
|
|
33
|
+
alignment = props.alignment;
|
|
34
|
+
switch ("".concat(position, "/").concat(alignment)) {
|
|
35
|
+
case 'block-start/start':
|
|
36
|
+
return "inset-block-end: 100%; inset-inline-start: 0; margin-block-end: ".concat(props.theme.gridUnit, ";");
|
|
37
|
+
case 'block-start/end':
|
|
38
|
+
return "inset-block-end: 100%; inset-inline-end: 0; margin-block-end: ".concat(props.theme.gridUnit, ";");
|
|
39
|
+
case 'block-end/start':
|
|
40
|
+
return "inset-block-start: 100%; inset-inline-start: 0; margin-block-start: ".concat(props.theme.gridUnit, ";");
|
|
41
|
+
case 'block-end/end':
|
|
42
|
+
return "inset-block-start: 100%; inset-inline-end: 0; margin-block-start: ".concat(props.theme.gridUnit, ";");
|
|
43
|
+
case 'inline-start/start':
|
|
44
|
+
return "inset-inline-end: 100%; inset-block-start: 0; margin-inline-end: ".concat(props.theme.gridUnit, ";");
|
|
45
|
+
case 'inline-start/end':
|
|
46
|
+
return "inset-inline-end: 100%; inset-block-end: 0; margin-inline-end: ".concat(props.theme.gridUnit, ";");
|
|
47
|
+
case 'inline-end/start':
|
|
48
|
+
return "inset-inline-start: 100%; inset-block-start: 0; margin-inline-start: ".concat(props.theme.gridUnit, ";");
|
|
49
|
+
case 'inline-end/end':
|
|
50
|
+
return "inset-inline-start: 100%; inset-block-end: 0; margin-inline-start: ".concat(props.theme.gridUnit, ";");
|
|
51
|
+
default:
|
|
52
|
+
return "inset-block-end: 100%; inset-inline-start: 0; margin-block-end: ".concat(props.theme.gridUnit, ";");
|
|
53
|
+
}
|
|
54
|
+
}, (0, _toolkit.grid)(5));
|
|
55
|
+
var Wrapper = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-block;\n position: relative;\n"])));
|
|
56
|
+
var Popup = function Popup(_ref2) {
|
|
57
|
+
var alignment = _ref2.alignment,
|
|
58
|
+
children = _ref2.children,
|
|
59
|
+
focusableContent = _ref2.focusableContent,
|
|
60
|
+
id = _ref2.id,
|
|
61
|
+
toggle = _ref2.toggle,
|
|
62
|
+
position = _ref2.position,
|
|
63
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
64
|
+
var WrapperRef = (0, _react.useRef)(null);
|
|
65
|
+
var popupRef = (0, _react.useRef)(null);
|
|
66
|
+
var _useState = (0, _react.useState)([]),
|
|
67
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
68
|
+
focusableElements = _useState2[0],
|
|
69
|
+
setFocusableElements = _useState2[1];
|
|
70
|
+
var _useState3 = (0, _react.useState)(false),
|
|
71
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
72
|
+
visible = _useState4[0],
|
|
73
|
+
setVisible = _useState4[1];
|
|
74
|
+
var onClickToggle = function onClickToggle() {
|
|
75
|
+
setVisible(!visible);
|
|
76
|
+
};
|
|
77
|
+
(0, _react.useEffect)(function () {
|
|
78
|
+
if (visible && focusableElements.length > 0) {
|
|
79
|
+
// focusing the first focusable element of the popup
|
|
80
|
+
focusableElements[0].focus();
|
|
81
|
+
}
|
|
82
|
+
}, [visible]);
|
|
83
|
+
(0, _react.useEffect)(function () {
|
|
84
|
+
if (popupRef.current) {
|
|
85
|
+
var focusableContentSelector = focusableContent.join(', ');
|
|
86
|
+
setFocusableElements(popupRef.current.querySelectorAll(focusableContentSelector));
|
|
87
|
+
}
|
|
88
|
+
}, [children]);
|
|
89
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
90
|
+
var isEscapePress = e.key === 'Escape' || e.keyCode === 27;
|
|
91
|
+
var isTabPressed = e.key === 'Tab' || e.keyCode === 9;
|
|
92
|
+
if (!isTabPressed && !isEscapePress) return;
|
|
93
|
+
if (isEscapePress) {
|
|
94
|
+
popupRef.current.previousElementSibling.focus();
|
|
95
|
+
setVisible(false);
|
|
96
|
+
}
|
|
97
|
+
var firstFocusableElement = focusableElements[0];
|
|
98
|
+
var lastFocusableElement = focusableElements[focusableElements.length - 1];
|
|
99
|
+
if (e.shiftKey) {
|
|
100
|
+
if (document.activeElement === firstFocusableElement) {
|
|
101
|
+
lastFocusableElement.focus();
|
|
102
|
+
e.preventDefault();
|
|
103
|
+
}
|
|
104
|
+
} else if (document.activeElement === lastFocusableElement) {
|
|
105
|
+
firstFocusableElement.focus();
|
|
106
|
+
e.preventDefault();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
var handleBlur = function handleBlur(e) {
|
|
110
|
+
// when clicking outside the popup wrapper close the popup
|
|
111
|
+
if (!WrapperRef.current.contains(e.relatedTarget)) {
|
|
112
|
+
setVisible(false);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapper, {
|
|
116
|
+
ref: WrapperRef
|
|
117
|
+
}, /*#__PURE__*/(0, _react.cloneElement)(toggle, {
|
|
118
|
+
onClick: onClickToggle,
|
|
119
|
+
'aria-controls': id,
|
|
120
|
+
'aria-expanded': visible,
|
|
121
|
+
'aria-haspopup': 'dialog'
|
|
122
|
+
}), /*#__PURE__*/_react["default"].createElement(PopupContainer, _extends({
|
|
123
|
+
alignment: alignment,
|
|
124
|
+
id: id,
|
|
125
|
+
onBlur: handleBlur,
|
|
126
|
+
onKeyDown: handleKeyDown,
|
|
127
|
+
position: position,
|
|
128
|
+
ref: popupRef,
|
|
129
|
+
tabIndex: "0",
|
|
130
|
+
visible: visible
|
|
131
|
+
}, rest), children));
|
|
132
|
+
};
|
|
133
|
+
Popup.propTypes = {
|
|
134
|
+
alignment: _propTypes["default"].oneOf(['start', 'end']),
|
|
135
|
+
id: _propTypes["default"].string,
|
|
136
|
+
focusableContent: _propTypes["default"].arrayOf(_propTypes["default"].string),
|
|
137
|
+
toggle: _propTypes["default"].element.isRequired,
|
|
138
|
+
position: _propTypes["default"].oneOf(['block-start', 'block-end', 'inline-start', 'inline-end'])
|
|
139
|
+
};
|
|
140
|
+
Popup.defaultProps = {
|
|
141
|
+
id: (0, _index.uuid)(),
|
|
142
|
+
focusableContent: ['a[href]', 'area[href]', 'input:not([disabled]):not([type=hidden])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'object', 'embed', '[tabindex]:not([tabindex="-1"])', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])'],
|
|
143
|
+
position: 'block-start',
|
|
144
|
+
alignment: 'start'
|
|
145
|
+
};
|
|
146
|
+
var _default = exports["default"] = Popup;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
+
var _antd = require("antd");
|
|
12
|
+
var _excluded = ["className", "onChange", "vertical"];
|
|
13
|
+
var _templateObject, _templateObject2;
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
17
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
18
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
19
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
20
|
+
var StyledRadioGroup = (0, _styledComponents["default"])(_antd.Radio.Group)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n\n .ant-radio-inner,\n .ant-radio-inner::after,\n .ant-radio-checked,\n .ant-radio-button-wrapper,\n .ant-radio-button-wrapper::before {\n transition-duration: 0.1s;\n }\n"])), function (props) {
|
|
21
|
+
return props.vertical && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n "])));
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Props are the same as Ant's RadioGroup https://ant.design/components/radio/#RadioGroup
|
|
26
|
+
* with the addition of `vertical` and a slightly modified `onChange`.
|
|
27
|
+
*/
|
|
28
|
+
var Radio = function Radio(props) {
|
|
29
|
+
var className = props.className,
|
|
30
|
+
onChange = props.onChange,
|
|
31
|
+
vertical = props.vertical,
|
|
32
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
33
|
+
var handleChange = function handleChange(e) {
|
|
34
|
+
return onChange(e.target.value);
|
|
35
|
+
};
|
|
36
|
+
return /*#__PURE__*/_react["default"].createElement(StyledRadioGroup, _extends({
|
|
37
|
+
className: className,
|
|
38
|
+
onChange: handleChange,
|
|
39
|
+
role: "radiogroup",
|
|
40
|
+
vertical: vertical
|
|
41
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
42
|
+
}, rest));
|
|
43
|
+
};
|
|
44
|
+
Radio.propTypes = {
|
|
45
|
+
/** Handle change. First argument is the incoming `value`. */
|
|
46
|
+
onChange: _propTypes["default"].func,
|
|
47
|
+
/** Arrange items vertically instead of inline. */
|
|
48
|
+
vertical: _propTypes["default"].bool
|
|
49
|
+
};
|
|
50
|
+
Radio.defaultProps = {
|
|
51
|
+
onChange: null,
|
|
52
|
+
vertical: false
|
|
53
|
+
};
|
|
54
|
+
var _default = exports["default"] = Radio;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
+
var _toolkit = require("../../toolkit");
|
|
12
|
+
var _excluded = ["className", "children", "hide", "status"];
|
|
13
|
+
var _templateObject, _templateObject2;
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
17
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
18
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
19
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
20
|
+
var Wrapper = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", ";\n color: ", ";\n padding: ", " ", ";\n text-align: center;\n\n /* stylelint-disable-next-line order/properties-alphabetical-order */\n ", "\n\n ", ";\n"])), function (props) {
|
|
21
|
+
var status = props.status;
|
|
22
|
+
if (status === 'success') return props.theme.colorSuccess;
|
|
23
|
+
if (status === 'error' || status === 'danger') return props.theme.colorError;
|
|
24
|
+
return props.theme.colorSecondary;
|
|
25
|
+
}, function (props) {
|
|
26
|
+
return props.theme.borderRadius;
|
|
27
|
+
}, function (props) {
|
|
28
|
+
var status = props.status;
|
|
29
|
+
if (status === 'success' || status === 'error' || status === 'danger') return props.theme.colorTextReverse;
|
|
30
|
+
return props.theme.colorText;
|
|
31
|
+
}, (0, _toolkit.grid)(0.5), (0, _toolkit.grid)(2), function (props) {
|
|
32
|
+
return props.hide && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n visibility: hidden;\n "])));
|
|
33
|
+
}, (0, _toolkit.override)('ui.Ribbon'));
|
|
34
|
+
var Ribbon = function Ribbon(props) {
|
|
35
|
+
var className = props.className,
|
|
36
|
+
children = props.children,
|
|
37
|
+
hide = props.hide,
|
|
38
|
+
status = props.status,
|
|
39
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
40
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapper, _extends({
|
|
41
|
+
className: className,
|
|
42
|
+
hide: hide,
|
|
43
|
+
status: status
|
|
44
|
+
}, rest), children);
|
|
45
|
+
};
|
|
46
|
+
Ribbon.propTypes = {
|
|
47
|
+
hide: _propTypes["default"].bool,
|
|
48
|
+
status: _propTypes["default"].oneOf(['success', 'error', 'danger'])
|
|
49
|
+
};
|
|
50
|
+
Ribbon.defaultProps = {
|
|
51
|
+
hide: false,
|
|
52
|
+
status: null
|
|
53
|
+
};
|
|
54
|
+
var _default = exports["default"] = Ribbon;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
var _antd = require("antd");
|
|
10
|
+
var _reusableStyles = require("./_reusableStyles");
|
|
11
|
+
var _excluded = ["className"];
|
|
12
|
+
var _templateObject; // import PropTypes from 'prop-types'
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
15
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
16
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
17
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
18
|
+
var StyledSearch = (0, _styledComponents["default"])(_antd.Input.Search)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n input {\n ", "\n }\n"])), _reusableStyles.inputShadow);
|
|
19
|
+
var Search = function Search(props) {
|
|
20
|
+
var className = props.className,
|
|
21
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
22
|
+
|
|
23
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
24
|
+
return /*#__PURE__*/_react["default"].createElement(StyledSearch, _extends({
|
|
25
|
+
className: className
|
|
26
|
+
}, rest));
|
|
27
|
+
};
|
|
28
|
+
Search.propTypes = {};
|
|
29
|
+
Search.defaultProps = {};
|
|
30
|
+
var _default = exports["default"] = Search;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
+
var _lodash = require("lodash");
|
|
12
|
+
var _antd = require("antd");
|
|
13
|
+
var _toolkit = require("../../toolkit");
|
|
14
|
+
var _Empty = _interopRequireDefault(require("./Empty"));
|
|
15
|
+
var _excluded = ["async", "className", "debounceTimeout", "filterOption", "notFoundContent", "onSearch", "showSearch", "id", "isOpen", "virtual", "wrapOptionText"];
|
|
16
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
17
|
+
/* stylelint-disable indentation */
|
|
18
|
+
/* stylelint-disable selector-combinator-space-before */
|
|
19
|
+
/* stylelint-disable selector-descendant-combinator-no-non-space */
|
|
20
|
+
/* stylelint-disable string-quotes */
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
22
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
23
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
24
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
25
|
+
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."); }
|
|
26
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
27
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
28
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
29
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
30
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
31
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
32
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
33
|
+
var SelectWrapper = _styledComponents["default"].span(_templateObject || (_templateObject = _taggedTemplateLiteral([""])));
|
|
34
|
+
var StyledSelect = (0, _styledComponents["default"])(_antd.Select)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n\n &.ant-select-focused {\n outline: ", "px solid\n ", ";\n outline-offset: 1px;\n }\n\n .ant-select-arrow {\n color: ", ";\n }\n\n &.ant-select.ant-select-disabled > .ant-select-selector,\n &.ant-select-multiple.ant-select-disabled\n > .ant-select-selector\n .ant-select-selection-item-content {\n background-color: ", ";\n color: ", ";\n }\n"])), function (props) {
|
|
35
|
+
return "".concat(props.theme.lineWidth * 4);
|
|
36
|
+
}, (0, _toolkit.th)('colorPrimaryBorder'), (0, _toolkit.th)('colorBorder'), (0, _toolkit.th)('colorBackgroundHue'), function (props) {
|
|
37
|
+
return "".concat(props.theme.colorText, "cc");
|
|
38
|
+
});
|
|
39
|
+
var StyledDropdown = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .ant-select-item-option-active {\n background-color: ", ";\n outline: 2px solid ", ";\n outline-offset: -2px;\n\n &.ant-select-item-option-selected[role='option'][aria-selected='true'] {\n text-decoration: underline;\n }\n }\n\n .ant-select-item-option-selected[role='option'][aria-selected='true'] {\n background-color: ", ";\n color: ", ";\n\n .ant-select-item-option-state {\n color: ", ";\n }\n }\n\n .ant-select-item-option-content {\n /* outline: 2px solid ", "; */\n ", "\n }\n"])), (0, _toolkit.th)('colorBackgroundHue'), (0, _toolkit.th)('colorPrimary'), (0, _toolkit.th)('colorPrimary'), (0, _toolkit.th)('colorTextReverse'), (0, _toolkit.th)('colorTextReverse'), (0, _toolkit.th)('colorPrimary'), function (props) {
|
|
40
|
+
return props.wrapOptionText && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n white-space: normal;\n "])));
|
|
41
|
+
});
|
|
42
|
+
var Select = function Select(props) {
|
|
43
|
+
var async = props.async,
|
|
44
|
+
className = props.className,
|
|
45
|
+
debounceTimeout = props.debounceTimeout,
|
|
46
|
+
filterOption = props.filterOption,
|
|
47
|
+
notFoundContent = props.notFoundContent,
|
|
48
|
+
onSearch = props.onSearch,
|
|
49
|
+
showSearch = props.showSearch,
|
|
50
|
+
id = props.id,
|
|
51
|
+
isOpen = props.isOpen,
|
|
52
|
+
virtual = props.virtual,
|
|
53
|
+
wrapOptionText = props.wrapOptionText,
|
|
54
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
55
|
+
var selectRef = (0, _react.useRef)(null);
|
|
56
|
+
var _useState = (0, _react.useState)(isOpen),
|
|
57
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
58
|
+
open = _useState2[0],
|
|
59
|
+
setOpen = _useState2[1];
|
|
60
|
+
var _useState3 = (0, _react.useState)({}),
|
|
61
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
62
|
+
ariaAttributes = _useState4[0],
|
|
63
|
+
setAriaAttributes = _useState4[1];
|
|
64
|
+
var cleanUpInvalidAttrs = function cleanUpInvalidAttrs() {
|
|
65
|
+
var _selectRef$current, _selectRef$current2, _selectRef$current3, _selectRef$current4, _selectRef$current5, _selectRef$current6;
|
|
66
|
+
// store invalid attrs in local state
|
|
67
|
+
setAriaAttributes({
|
|
68
|
+
'aria-controls': (_selectRef$current = selectRef.current) === null || _selectRef$current === void 0 ? void 0 : _selectRef$current.querySelector('input[role="combobox"]').getAttribute('aria-controls'),
|
|
69
|
+
'aria-owns': (_selectRef$current2 = selectRef.current) === null || _selectRef$current2 === void 0 ? void 0 : _selectRef$current2.querySelector('input[role="combobox"]').getAttribute('aria-owns'),
|
|
70
|
+
'aria-activedescendant': (_selectRef$current3 = selectRef.current) === null || _selectRef$current3 === void 0 ? void 0 : _selectRef$current3.querySelector('input[role="combobox"]').getAttribute('aria-activedescendant')
|
|
71
|
+
});
|
|
72
|
+
// remove them from the DOM node
|
|
73
|
+
(_selectRef$current4 = selectRef.current) === null || _selectRef$current4 === void 0 || _selectRef$current4.querySelector('input[role="combobox"]').removeAttribute('aria-controls');
|
|
74
|
+
(_selectRef$current5 = selectRef.current) === null || _selectRef$current5 === void 0 || _selectRef$current5.querySelector('input[role="combobox"]').removeAttribute('aria-owns');
|
|
75
|
+
(_selectRef$current6 = selectRef.current) === null || _selectRef$current6 === void 0 || _selectRef$current6.querySelector('input[role="combobox"]').removeAttribute('aria-activedescendant');
|
|
76
|
+
};
|
|
77
|
+
(0, _react.useEffect)(function () {
|
|
78
|
+
var innerWrapper = selectRef.current.querySelector('.ant-select');
|
|
79
|
+
innerWrapper.removeAttribute('aria-required');
|
|
80
|
+
|
|
81
|
+
// hack to fix accessibility errors
|
|
82
|
+
// apply with delay to make sure attrs are already there
|
|
83
|
+
setTimeout(function () {
|
|
84
|
+
cleanUpInvalidAttrs();
|
|
85
|
+
}, 500);
|
|
86
|
+
}, []);
|
|
87
|
+
(0, _react.useEffect)(function () {
|
|
88
|
+
if (open && !!ariaAttributes) {
|
|
89
|
+
// reapply the stored aria attributes after opening input for the first time
|
|
90
|
+
Object.keys(ariaAttributes).forEach(function (attr) {
|
|
91
|
+
selectRef.current.querySelector('input[role="combobox"]').setAttribute(attr, ariaAttributes[attr]);
|
|
92
|
+
});
|
|
93
|
+
setAriaAttributes(null);
|
|
94
|
+
}
|
|
95
|
+
}, [open]);
|
|
96
|
+
var handleSearch = function handleSearch(searchValue) {
|
|
97
|
+
onSearch(searchValue);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// const useDebounce = async ? true : debounce
|
|
101
|
+
|
|
102
|
+
var searchFunc = async ? (0, _lodash.debounce)(handleSearch, debounceTimeout) : handleSearch;
|
|
103
|
+
var customDropdownRender = function customDropdownRender(menu) {
|
|
104
|
+
return /*#__PURE__*/_react["default"].createElement(StyledDropdown, {
|
|
105
|
+
"data-testid": "select-dropdown",
|
|
106
|
+
wrapOptionText: wrapOptionText
|
|
107
|
+
}, menu);
|
|
108
|
+
};
|
|
109
|
+
return /*#__PURE__*/_react["default"].createElement(SelectWrapper, {
|
|
110
|
+
className: className,
|
|
111
|
+
ref: selectRef
|
|
112
|
+
}, /*#__PURE__*/_react["default"].createElement(StyledSelect, _extends({
|
|
113
|
+
dropdownRender: customDropdownRender,
|
|
114
|
+
filterOption: async && !filterOption ? false : filterOption,
|
|
115
|
+
id: id,
|
|
116
|
+
notFoundContent: !notFoundContent && async ? null : notFoundContent,
|
|
117
|
+
onDropdownVisibleChange: function onDropdownVisibleChange(o) {
|
|
118
|
+
return setOpen(o);
|
|
119
|
+
},
|
|
120
|
+
onSearch: onSearch && searchFunc,
|
|
121
|
+
open: open,
|
|
122
|
+
showSearch: showSearch || !!onSearch,
|
|
123
|
+
virtual: virtual
|
|
124
|
+
}, rest)));
|
|
125
|
+
};
|
|
126
|
+
Select.propTypes = {
|
|
127
|
+
async: _propTypes["default"].bool,
|
|
128
|
+
// debounce: PropTypes.bool,
|
|
129
|
+
debounceTimeout: _propTypes["default"].number,
|
|
130
|
+
notFoundContent: _propTypes["default"].element,
|
|
131
|
+
isOpen: _propTypes["default"].bool,
|
|
132
|
+
virtual: _propTypes["default"].bool,
|
|
133
|
+
wrapOptionText: _propTypes["default"].bool
|
|
134
|
+
};
|
|
135
|
+
Select.defaultProps = {
|
|
136
|
+
async: false,
|
|
137
|
+
// debounce: false,
|
|
138
|
+
debounceTimeout: 500,
|
|
139
|
+
notFoundContent: /*#__PURE__*/_react["default"].createElement(_Empty["default"], {
|
|
140
|
+
description: "No Data",
|
|
141
|
+
image: _Empty["default"].PRESENTED_IMAGE_SIMPLE,
|
|
142
|
+
role: "status"
|
|
143
|
+
}),
|
|
144
|
+
isOpen: false,
|
|
145
|
+
virtual: false,
|
|
146
|
+
wrapOptionText: false
|
|
147
|
+
};
|
|
148
|
+
var _default = exports["default"] = Select;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = exports.Indicator = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
+
var _antd = require("antd");
|
|
12
|
+
var _toolkit = require("../../toolkit");
|
|
13
|
+
var _excluded = ["isNested", "renderBackground"],
|
|
14
|
+
_excluded2 = ["className", "children", "renderBackground", "size", "spinning"];
|
|
15
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
16
|
+
/**
|
|
17
|
+
* Spinner code license here (MIT): https://github.com/tobiasahlin/SpinKit/blob/master/LICENSE
|
|
18
|
+
*/
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
21
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
22
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
23
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
24
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
25
|
+
var StyledSpin = (0, _styledComponents["default"])(function (_ref) {
|
|
26
|
+
var isNested = _ref.isNested,
|
|
27
|
+
renderBackground = _ref.renderBackground,
|
|
28
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
return /*#__PURE__*/_react["default"].createElement(_antd.Spin, rest);
|
|
30
|
+
})(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n"])), function (props) {
|
|
31
|
+
return props.isNested && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n z-index: 4;\n\n > div {\n position: absolute;\n left: 50%;\n top: 50%;\n margin: -20px;\n }\n "])));
|
|
32
|
+
});
|
|
33
|
+
var bounce = (0, _styledComponents.keyframes)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n 0%,\n 100% {\n transform: scale(0);\n }\n\n 50% {\n transform: scale(1);\n }\n"])));
|
|
34
|
+
var IndicatorWrapper = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n &&& {\n height: ", ";\n position: relative;\n width: ", ";\n }\n"])), function (props) {
|
|
35
|
+
return (0, _toolkit.grid)(props.size);
|
|
36
|
+
}, function (props) {
|
|
37
|
+
return (0, _toolkit.grid)(props.size);
|
|
38
|
+
});
|
|
39
|
+
var BounceOne = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n animation: ", " 2s infinite ease-in-out;\n background-color: ", ";\n border-radius: 50%;\n height: 100%;\n left: 0;\n opacity: 0.6;\n position: absolute;\n top: 0;\n width: 100%;\n"])), bounce, function (props) {
|
|
40
|
+
return props.theme.colorPrimary;
|
|
41
|
+
});
|
|
42
|
+
var BounceTwo = (0, _styledComponents["default"])(BounceOne)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n animation-delay: -1s;\n"])));
|
|
43
|
+
var NestedWrapper = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n height: 100%;\n\n .ant-spin-nested-loading {\n height: 100%;\n\n > div {\n height: 100%;\n\n > div.ant-spin-spinning {\n height: 100%;\n }\n }\n }\n"])));
|
|
44
|
+
var Indicator = exports.Indicator = function Indicator(_ref2) {
|
|
45
|
+
var size = _ref2.size,
|
|
46
|
+
className = _ref2.className;
|
|
47
|
+
return /*#__PURE__*/_react["default"].createElement(IndicatorWrapper, {
|
|
48
|
+
className: className,
|
|
49
|
+
size: size
|
|
50
|
+
}, /*#__PURE__*/_react["default"].createElement(BounceOne, null), /*#__PURE__*/_react["default"].createElement(BounceTwo, null));
|
|
51
|
+
};
|
|
52
|
+
Indicator.propTypes = {
|
|
53
|
+
size: _propTypes["default"].number
|
|
54
|
+
};
|
|
55
|
+
Indicator.defaultProps = {
|
|
56
|
+
size: 10
|
|
57
|
+
};
|
|
58
|
+
var Spin = function Spin(props) {
|
|
59
|
+
var className = props.className,
|
|
60
|
+
children = props.children,
|
|
61
|
+
renderBackground = props.renderBackground,
|
|
62
|
+
size = props.size,
|
|
63
|
+
spinning = props.spinning,
|
|
64
|
+
rest = _objectWithoutProperties(props, _excluded2);
|
|
65
|
+
var showChildren = renderBackground || !renderBackground && !spinning;
|
|
66
|
+
var spin = /*#__PURE__*/_react["default"].createElement(StyledSpin, _extends({
|
|
67
|
+
className: className,
|
|
68
|
+
indicator: /*#__PURE__*/_react["default"].createElement(Indicator, {
|
|
69
|
+
size: size
|
|
70
|
+
}),
|
|
71
|
+
isNested: !!children,
|
|
72
|
+
renderBackground: renderBackground,
|
|
73
|
+
spinning: spinning
|
|
74
|
+
}, rest), showChildren && children);
|
|
75
|
+
if (!showChildren) return /*#__PURE__*/_react["default"].createElement(NestedWrapper, null, spin);
|
|
76
|
+
return spin;
|
|
77
|
+
};
|
|
78
|
+
Spin.propTypes = {
|
|
79
|
+
size: _propTypes["default"].number,
|
|
80
|
+
spinning: _propTypes["default"].bool.isRequired,
|
|
81
|
+
renderBackground: _propTypes["default"].bool
|
|
82
|
+
};
|
|
83
|
+
Spin.defaultProps = {
|
|
84
|
+
size: 10,
|
|
85
|
+
renderBackground: true
|
|
86
|
+
};
|
|
87
|
+
var _default = exports["default"] = Spin;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
14
|
+
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."); }
|
|
15
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
16
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
17
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
18
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
19
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
20
|
+
var Wrapper = (0, _styledComponents["default"])(_antd.Row)(_templateObject || (_templateObject = _taggedTemplateLiteral([""])));
|
|
21
|
+
var Left = (0, _styledComponents["default"])(_antd.Col)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral([""])));
|
|
22
|
+
var Right = (0, _styledComponents["default"])(_antd.Col)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral([""])));
|
|
23
|
+
var Split = function Split(props) {
|
|
24
|
+
var className = props.className,
|
|
25
|
+
children = props.children,
|
|
26
|
+
gutter = props.gutter,
|
|
27
|
+
splitAt = props.splitAt;
|
|
28
|
+
var _children = _slicedToArray(children, 2),
|
|
29
|
+
left = _children[0],
|
|
30
|
+
right = _children[1];
|
|
31
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapper, {
|
|
32
|
+
className: className,
|
|
33
|
+
gutter: gutter
|
|
34
|
+
}, /*#__PURE__*/_react["default"].createElement(Left, {
|
|
35
|
+
span: splitAt
|
|
36
|
+
}, left), /*#__PURE__*/_react["default"].createElement(Right, {
|
|
37
|
+
span: 24 - splitAt
|
|
38
|
+
}, right));
|
|
39
|
+
};
|
|
40
|
+
Split.propTypes = {
|
|
41
|
+
gutter: _propTypes["default"].number,
|
|
42
|
+
/** Number on the antd grid of 24 total */
|
|
43
|
+
splitAt: _propTypes["default"].number
|
|
44
|
+
};
|
|
45
|
+
Split.defaultProps = {
|
|
46
|
+
gutter: 0,
|
|
47
|
+
splitAt: 12
|
|
48
|
+
};
|
|
49
|
+
var _default = exports["default"] = Split;
|