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,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "AuthenticationForm", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _AuthenticationForm["default"];
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "AuthenticationHeader", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _AuthenticationHeader["default"];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "AuthenticationWrapper", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _AuthenticationWrapper["default"];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "ChangePassword", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _ChangePassword["default"];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "DeactivatedUser", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _DeactivatedUser["default"];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "Login", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _Login["default"];
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "ProfileForm", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function get() {
|
|
45
|
+
return _ProfileForm["default"];
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "ProviderConnection", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _ProviderConnection["default"];
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "RequestPasswordReset", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _RequestPasswordReset["default"];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "ResetPassword", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function get() {
|
|
63
|
+
return _ResetPassword["default"];
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "Signup", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function get() {
|
|
69
|
+
return _Signup["default"];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "SuccessSubTitle", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function get() {
|
|
75
|
+
return _SuccessSubTitle["default"];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "VerifyCheck", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function get() {
|
|
81
|
+
return _VerifyCheck["default"];
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "VerifyEmail", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function get() {
|
|
87
|
+
return _VerifyEmail["default"];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
var _AuthenticationForm = _interopRequireDefault(require("./AuthenticationForm"));
|
|
91
|
+
var _AuthenticationHeader = _interopRequireDefault(require("./AuthenticationHeader"));
|
|
92
|
+
var _AuthenticationWrapper = _interopRequireDefault(require("./AuthenticationWrapper"));
|
|
93
|
+
var _ChangePassword = _interopRequireDefault(require("./ChangePassword"));
|
|
94
|
+
var _DeactivatedUser = _interopRequireDefault(require("./DeactivatedUser"));
|
|
95
|
+
var _Login = _interopRequireDefault(require("./Login"));
|
|
96
|
+
var _ProfileForm = _interopRequireDefault(require("./ProfileForm"));
|
|
97
|
+
var _ProviderConnection = _interopRequireDefault(require("./ProviderConnection"));
|
|
98
|
+
var _ResetPassword = _interopRequireDefault(require("./ResetPassword"));
|
|
99
|
+
var _RequestPasswordReset = _interopRequireDefault(require("./RequestPasswordReset"));
|
|
100
|
+
var _Signup = _interopRequireDefault(require("./Signup"));
|
|
101
|
+
var _SuccessSubTitle = _interopRequireDefault(require("./SuccessSubTitle"));
|
|
102
|
+
var _VerifyCheck = _interopRequireDefault(require("./VerifyCheck"));
|
|
103
|
+
var _VerifyEmail = _interopRequireDefault(require("./VerifyEmail"));
|
|
104
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -0,0 +1,63 @@
|
|
|
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 = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
var _icons = require("@ant-design/icons");
|
|
12
|
+
var _common = require("../common");
|
|
13
|
+
var _templateObject;
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
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); }
|
|
16
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
17
|
+
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."); }
|
|
18
|
+
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; } }
|
|
19
|
+
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; }
|
|
20
|
+
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; } }
|
|
21
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
22
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
23
|
+
// const Wrapper = styled.div``
|
|
24
|
+
|
|
25
|
+
var Send = (0, _styledComponents["default"])(_icons.SendOutlined)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n\n &:hover {\n cursor: pointer;\n }\n"])), function (props) {
|
|
26
|
+
return props.theme.colorPrimary;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// TODO -- this needs to be a wax editor with two plugins (mention & task)
|
|
30
|
+
|
|
31
|
+
var ChatInput = function ChatInput(props) {
|
|
32
|
+
var className = props.className,
|
|
33
|
+
onSend = props.onSend;
|
|
34
|
+
var _useState = (0, _react.useState)(''),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
inputValue = _useState2[0],
|
|
37
|
+
setInputValue = _useState2[1];
|
|
38
|
+
var handleChange = function handleChange(value) {
|
|
39
|
+
setInputValue(value);
|
|
40
|
+
};
|
|
41
|
+
var handleSend = function handleSend() {
|
|
42
|
+
return onSend(inputValue);
|
|
43
|
+
};
|
|
44
|
+
var SendIcon = /*#__PURE__*/_react["default"].createElement(Send, {
|
|
45
|
+
onClick: handleSend
|
|
46
|
+
});
|
|
47
|
+
return (
|
|
48
|
+
/*#__PURE__*/
|
|
49
|
+
// <Wrapper className={className}>
|
|
50
|
+
_react["default"].createElement(_common.Input, {
|
|
51
|
+
className: className,
|
|
52
|
+
onChange: handleChange,
|
|
53
|
+
onPressEnter: handleSend,
|
|
54
|
+
suffix: SendIcon
|
|
55
|
+
})
|
|
56
|
+
// </Wrapper>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
ChatInput.propTypes = {
|
|
60
|
+
onSend: _propTypes["default"].func.isRequired
|
|
61
|
+
};
|
|
62
|
+
ChatInput.defaultProps = {};
|
|
63
|
+
var _default = exports["default"] = ChatInput;
|
|
@@ -0,0 +1,67 @@
|
|
|
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 _common = require("../common");
|
|
13
|
+
var _excluded = ["own"],
|
|
14
|
+
_excluded2 = ["own"];
|
|
15
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
16
|
+
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); }
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
21
|
+
var pullRight = (0, _styledComponents.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-left: auto;\n"])));
|
|
22
|
+
var Wrapper = (0, _styledComponents["default"])(function (_ref) {
|
|
23
|
+
var own = _ref.own,
|
|
24
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
return /*#__PURE__*/_react["default"].createElement("div", rest);
|
|
26
|
+
})(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
27
|
+
var Message = (0, _styledComponents["default"])(function (_ref2) {
|
|
28
|
+
var own = _ref2.own,
|
|
29
|
+
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
30
|
+
return /*#__PURE__*/_react["default"].createElement("div", rest);
|
|
31
|
+
})(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: 3px;\n color: ", ";\n display: inline-block;\n max-width: 90%;\n padding: ", ";\n\n /* stylelint-disable-next-line order/properties-alphabetical-order */\n ", "\n"])), function (props) {
|
|
32
|
+
return props.own ? (0, _toolkit.th)('colorPrimary') : (0, _toolkit.th)('colorSecondary');
|
|
33
|
+
}, function (props) {
|
|
34
|
+
return props.own ? (0, _toolkit.th)('colorTextReverse') : (0, _toolkit.th)('colorText');
|
|
35
|
+
}, (0, _toolkit.grid)(2), function (props) {
|
|
36
|
+
return props.own && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", "\n\n span {\n ", "\n }\n "])), pullRight, pullRight);
|
|
37
|
+
});
|
|
38
|
+
var Name = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n font-size: ", ";\n font-weight: bold;\n"])), (0, _toolkit.th)('fontSizeBaseSmall'));
|
|
39
|
+
var Content = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral([""])));
|
|
40
|
+
var Date = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n font-size: ", ";\n font-style: italic;\n margin-top: ", ";\n"])), (0, _toolkit.th)('fontSizeBaseSmall'), (0, _toolkit.grid)(2));
|
|
41
|
+
var ChatMessage = function ChatMessage(props) {
|
|
42
|
+
var className = props.className,
|
|
43
|
+
content = props.content,
|
|
44
|
+
date = props.date,
|
|
45
|
+
own = props.own,
|
|
46
|
+
user = props.user;
|
|
47
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapper, {
|
|
48
|
+
className: className
|
|
49
|
+
}, /*#__PURE__*/_react["default"].createElement(Message, {
|
|
50
|
+
own: own
|
|
51
|
+
}, !own && /*#__PURE__*/_react["default"].createElement(Name, null, user), /*#__PURE__*/_react["default"].createElement(Content, null, content), /*#__PURE__*/_react["default"].createElement(Date, null, /*#__PURE__*/_react["default"].createElement(_common.DateParser, {
|
|
52
|
+
timestamp: date
|
|
53
|
+
}, function (timestamp, timeAgo) {
|
|
54
|
+
return /*#__PURE__*/_react["default"].createElement("span", null, timeAgo, " ago");
|
|
55
|
+
}))));
|
|
56
|
+
};
|
|
57
|
+
ChatMessage.propTypes = {
|
|
58
|
+
content: _propTypes["default"].string.isRequired,
|
|
59
|
+
date: _propTypes["default"].string.isRequired,
|
|
60
|
+
own: _propTypes["default"].bool,
|
|
61
|
+
user: _propTypes["default"].string
|
|
62
|
+
};
|
|
63
|
+
ChatMessage.defaultProps = {
|
|
64
|
+
own: false,
|
|
65
|
+
user: null
|
|
66
|
+
};
|
|
67
|
+
var _default = exports["default"] = ChatMessage;
|
|
@@ -0,0 +1,45 @@
|
|
|
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 _toolkit = require("../../toolkit");
|
|
11
|
+
var _ChatMessage = _interopRequireDefault(require("./ChatMessage"));
|
|
12
|
+
var _common = require("../common");
|
|
13
|
+
var _templateObject;
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
16
|
+
var Wrapper = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n li:not(:last-child) {\n margin-bottom: ", ";\n }\n"])), (0, _toolkit.grid)(2));
|
|
17
|
+
var ChatMessageList = function ChatMessageList(props) {
|
|
18
|
+
var className = props.className,
|
|
19
|
+
messages = props.messages;
|
|
20
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapper, {
|
|
21
|
+
className: className
|
|
22
|
+
}, /*#__PURE__*/_react["default"].createElement(_common.List, {
|
|
23
|
+
dataSource: messages,
|
|
24
|
+
renderItem: function renderItem(item) {
|
|
25
|
+
return /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement(_ChatMessage["default"], {
|
|
26
|
+
content: item.content,
|
|
27
|
+
date: item.date,
|
|
28
|
+
own: item.own,
|
|
29
|
+
user: item.user
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
ChatMessageList.propTypes = {
|
|
35
|
+
messages: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
36
|
+
content: _propTypes["default"].string,
|
|
37
|
+
date: _propTypes["default"].string,
|
|
38
|
+
own: _propTypes["default"].bool,
|
|
39
|
+
user: _propTypes["default"].string
|
|
40
|
+
}))
|
|
41
|
+
};
|
|
42
|
+
ChatMessageList.defaultProps = {
|
|
43
|
+
messages: []
|
|
44
|
+
};
|
|
45
|
+
var _default = exports["default"] = ChatMessageList;
|
|
@@ -0,0 +1,41 @@
|
|
|
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 _toolkit = require("../../toolkit");
|
|
11
|
+
var _ChatInput = _interopRequireDefault(require("./ChatInput"));
|
|
12
|
+
var _ChatMessageList = _interopRequireDefault(require("./ChatMessageList"));
|
|
13
|
+
var _templateObject;
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
16
|
+
var Wrapper = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n > div:first-child {\n margin-bottom: ", ";\n }\n"])), (0, _toolkit.grid)(5));
|
|
17
|
+
var ChatThread = function ChatThread(props) {
|
|
18
|
+
var className = props.className,
|
|
19
|
+
messages = props.messages,
|
|
20
|
+
onSend = props.onSend;
|
|
21
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapper, {
|
|
22
|
+
className: className
|
|
23
|
+
}, /*#__PURE__*/_react["default"].createElement(_ChatMessageList["default"], {
|
|
24
|
+
messages: messages
|
|
25
|
+
}), /*#__PURE__*/_react["default"].createElement(_ChatInput["default"], {
|
|
26
|
+
onSend: onSend
|
|
27
|
+
}));
|
|
28
|
+
};
|
|
29
|
+
ChatThread.propTypes = {
|
|
30
|
+
messages: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
31
|
+
content: _propTypes["default"].string,
|
|
32
|
+
date: _propTypes["default"].string,
|
|
33
|
+
own: _propTypes["default"].bool,
|
|
34
|
+
user: _propTypes["default"].string
|
|
35
|
+
})),
|
|
36
|
+
onSend: _propTypes["default"].func.isRequired
|
|
37
|
+
};
|
|
38
|
+
ChatThread.defaultProps = {
|
|
39
|
+
messages: []
|
|
40
|
+
};
|
|
41
|
+
var _default = exports["default"] = ChatThread;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ChatInput", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _ChatInput["default"];
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "ChatMessage", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _ChatMessage["default"];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "ChatMessageList", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _ChatMessageList["default"];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "ChatThread", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _ChatThread["default"];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var _ChatInput = _interopRequireDefault(require("./ChatInput"));
|
|
31
|
+
var _ChatMessage = _interopRequireDefault(require("./ChatMessage"));
|
|
32
|
+
var _ChatMessageList = _interopRequireDefault(require("./ChatMessageList"));
|
|
33
|
+
var _ChatThread = _interopRequireDefault(require("./ChatThread"));
|
|
34
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -0,0 +1,56 @@
|
|
|
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 _lodash = require("lodash");
|
|
12
|
+
var _excluded = ["className", "children", "debounce", "debounceTimeout", "onSearch"];
|
|
13
|
+
var _templateObject;
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
19
|
+
var StyledAutoComplete = (0, _styledComponents["default"])(_antd.AutoComplete)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n"])));
|
|
20
|
+
var AutoComplete = function AutoComplete(props) {
|
|
21
|
+
var className = props.className,
|
|
22
|
+
children = props.children,
|
|
23
|
+
debounce = props.debounce,
|
|
24
|
+
debounceTimeout = props.debounceTimeout,
|
|
25
|
+
onSearch = props.onSearch,
|
|
26
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
27
|
+
var handleSearch = function handleSearch(searchValue) {
|
|
28
|
+
return onSearch(searchValue);
|
|
29
|
+
};
|
|
30
|
+
var searchFunc = debounce ? (0, _lodash.debounce)(handleSearch, debounceTimeout) : handleSearch;
|
|
31
|
+
|
|
32
|
+
// Allow changing on input component, as in the docs
|
|
33
|
+
if (children) return /*#__PURE__*/_react["default"].createElement(StyledAutoComplete, _extends({
|
|
34
|
+
className: className,
|
|
35
|
+
onSearch: searchFunc
|
|
36
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
37
|
+
}, rest), children);
|
|
38
|
+
return /*#__PURE__*/_react["default"].createElement(StyledAutoComplete, _extends({
|
|
39
|
+
className: className,
|
|
40
|
+
onSearch: searchFunc
|
|
41
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
42
|
+
}, rest));
|
|
43
|
+
};
|
|
44
|
+
AutoComplete.propTypes = {
|
|
45
|
+
/** Debounce the onSearch function */
|
|
46
|
+
debounce: _propTypes["default"].bool,
|
|
47
|
+
/** Debounce timeout in milliseconds */
|
|
48
|
+
debounceTimeout: _propTypes["default"].number,
|
|
49
|
+
/** Function to run while typing */
|
|
50
|
+
onSearch: _propTypes["default"].func.isRequired
|
|
51
|
+
};
|
|
52
|
+
AutoComplete.defaultProps = {
|
|
53
|
+
debounce: false,
|
|
54
|
+
debounceTimeout: 500
|
|
55
|
+
};
|
|
56
|
+
var _default = exports["default"] = AutoComplete;
|
|
@@ -0,0 +1,83 @@
|
|
|
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 = _interopRequireWildcard(require("styled-components"));
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
var _antd = require("antd");
|
|
12
|
+
var _lodash = require("lodash");
|
|
13
|
+
var _toolkit = require("../../toolkit");
|
|
14
|
+
var _excluded = ["children", "className", "autoFocus"];
|
|
15
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
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 _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; }
|
|
20
|
+
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; }
|
|
21
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
22
|
+
var colors = {
|
|
23
|
+
danger: 'colorError',
|
|
24
|
+
error: 'colorError',
|
|
25
|
+
success: 'colorSuccess'
|
|
26
|
+
// warn: 'colorWarning',
|
|
27
|
+
};
|
|
28
|
+
var StyledButton = (0, _styledComponents["default"])(_antd.Button)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n box-shadow: none;\n font-size: ", ";\n /* let lineHeight expand the button height */\n height: unset;\n line-height: ", ";\n ", ";\n\n ", "\n padding: 0 ", ";\n"])), (0, _toolkit.th)('fontSizeBase'), (0, _toolkit.th)('lineHeightBase'), function (props) {
|
|
29
|
+
return props.direction === 'rtl' && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n direction: rtl;\n\n .anticon + span {\n margin-right: 8px;\n margin-left: 0;\n }\n "])));
|
|
30
|
+
}, function (props) {
|
|
31
|
+
var status = props.status,
|
|
32
|
+
theme = props.theme,
|
|
33
|
+
type = props.type,
|
|
34
|
+
ghost = props.ghost,
|
|
35
|
+
disabled = props.disabled;
|
|
36
|
+
if (disabled) return null;
|
|
37
|
+
if (!Object.keys(colors).includes(status)) {
|
|
38
|
+
if (type === 'primary' && !ghost) {
|
|
39
|
+
return (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n &:hover,\n &:focus,\n &:active {\n background-color: ", " !important;\n }\n "])), (0, _toolkit.darken)('colorPrimary', 0.25));
|
|
40
|
+
}
|
|
41
|
+
return (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n &:hover,\n &:focus,\n &:active {\n border-color: ", " !important;\n color: ", " !important;\n }\n "])), (0, _toolkit.darken)('colorPrimary', 0.25), (0, _toolkit.darken)('colorPrimary', 0.25));
|
|
42
|
+
}
|
|
43
|
+
var color = theme[colors[status]];
|
|
44
|
+
|
|
45
|
+
// primary
|
|
46
|
+
if (type === 'primary') return (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n\n &:hover,\n &:focus,\n &:active {\n border-color: ", ";\n color: ", ";\n }\n\n &:hover,\n &:focus {\n background-color: ", " !important;\n }\n\n &:active {\n background-color: ", " !important;\n }\n "])), color, color, theme.colorTextReverse, color, theme.colorTextReverse, (0, _toolkit.darken)(color, 0.25), (0, _toolkit.darken)(color, 0.25));
|
|
47
|
+
|
|
48
|
+
// non-primary
|
|
49
|
+
return (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n border-color: ", ";\n\n &:hover,\n &:focus {\n color: ", ";\n border-color: ", ";\n }\n\n &:active {\n color: ", ";\n border-color: ", ";\n }\n "])), color, color, (0, _toolkit.darken)(color, 0.25), (0, _toolkit.darken)(color, 0.25), (0, _toolkit.darken)(color, 0.25), (0, _toolkit.darken)(color, 0.25));
|
|
50
|
+
}, (0, _toolkit.grid)(4));
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* API is the same as https://ant.design/components/button/#API, except for the
|
|
54
|
+
* `danger` prop, which is ommited in favour of `status`, described below.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
var Button = function Button(props) {
|
|
58
|
+
var children = props.children,
|
|
59
|
+
className = props.className,
|
|
60
|
+
autoFocus = props.autoFocus,
|
|
61
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
62
|
+
var passProps = (0, _lodash.omit)(rest, 'danger');
|
|
63
|
+
var buttonRef = (0, _react.useRef)(null);
|
|
64
|
+
(0, _react.useEffect)(function () {
|
|
65
|
+
if (autoFocus) {
|
|
66
|
+
var _buttonRef$current;
|
|
67
|
+
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || _buttonRef$current.focus();
|
|
68
|
+
}
|
|
69
|
+
}, []);
|
|
70
|
+
return /*#__PURE__*/_react["default"].createElement(StyledButton, _extends({
|
|
71
|
+
className: className,
|
|
72
|
+
ref: buttonRef
|
|
73
|
+
}, passProps), children);
|
|
74
|
+
};
|
|
75
|
+
Button.propTypes = {
|
|
76
|
+
status: _propTypes["default"].oneOf(['error', 'danger', 'success']),
|
|
77
|
+
autoFocus: _propTypes["default"].bool
|
|
78
|
+
};
|
|
79
|
+
Button.defaultProps = {
|
|
80
|
+
status: null,
|
|
81
|
+
autoFocus: false
|
|
82
|
+
};
|
|
83
|
+
var _default = exports["default"] = Button;
|
|
@@ -0,0 +1,58 @@
|
|
|
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 _templateObject, _templateObject2;
|
|
13
|
+
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); }
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
16
|
+
var Wrapper = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: ", ";\n /* display: inline-block; */\n\n ", "\n\n > button {\n margin-right: ", ";\n }\n\n > button:first-child {\n margin-left: 0;\n }\n\n > button:last-child {\n margin-right: 0;\n }\n"])), function (props) {
|
|
17
|
+
return props.inline ? 'inline-block' : 'flex';
|
|
18
|
+
}, function (props) {
|
|
19
|
+
var inline = props.inline,
|
|
20
|
+
justify = props.justify;
|
|
21
|
+
var justifyValue;
|
|
22
|
+
if (inline) return null;
|
|
23
|
+
if (justify === 'left') justifyValue = 'flex-start';
|
|
24
|
+
if (justify === 'right') justifyValue = 'flex-end';
|
|
25
|
+
if (justify === 'center') justifyValue = 'center';
|
|
26
|
+
if (justifyValue) return (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n justify-content: ", ";\n "])), justifyValue);
|
|
27
|
+
return null;
|
|
28
|
+
}, (0, _toolkit.grid)(1));
|
|
29
|
+
var ButtonGroup = function ButtonGroup(props) {
|
|
30
|
+
var className = props.className,
|
|
31
|
+
children = props.children,
|
|
32
|
+
inline = props.inline,
|
|
33
|
+
justify = props.justify;
|
|
34
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapper, {
|
|
35
|
+
className: className,
|
|
36
|
+
inline: inline,
|
|
37
|
+
justify: justify
|
|
38
|
+
}, children);
|
|
39
|
+
};
|
|
40
|
+
ButtonGroup.propTypes = {
|
|
41
|
+
/** Must be multiple Button components */
|
|
42
|
+
children: _propTypes["default"].arrayOf(function (propValue, key, componentName, location, propFullName) {
|
|
43
|
+
var notButton = propValue.find(function (el) {
|
|
44
|
+
return el.type.name !== 'Button';
|
|
45
|
+
});
|
|
46
|
+
if (notButton) return new Error('ButtonGroup children should be instances of Button!');
|
|
47
|
+
return null;
|
|
48
|
+
}).isRequired,
|
|
49
|
+
/** Sets display to `inline-block` */
|
|
50
|
+
inline: _propTypes["default"].bool,
|
|
51
|
+
/** Sets position of buttons in the row. Only applies when `inline` is `false` */
|
|
52
|
+
justify: _propTypes["default"].oneOf(['left', 'right', 'center'])
|
|
53
|
+
};
|
|
54
|
+
ButtonGroup.defaultProps = {
|
|
55
|
+
inline: false,
|
|
56
|
+
justify: 'left'
|
|
57
|
+
};
|
|
58
|
+
var _default = exports["default"] = ButtonGroup;
|
|
@@ -0,0 +1,30 @@
|
|
|
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.checkboxStyles = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _excluded = ["children", "className"];
|
|
12
|
+
var _templateObject, _templateObject2;
|
|
13
|
+
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); }
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
19
|
+
// define css here and export to use in CheckboxGroup as well
|
|
20
|
+
var checkboxStyles = exports.checkboxStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-checkbox-inner,\n .ant-checkbox-checked,\n .ant-checkbox-inner::after {\n transition: all 0.2s;\n }\n"])));
|
|
21
|
+
var StyledCheckbox = (0, _styledComponents["default"])(_antd.Checkbox)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n"])), checkboxStyles);
|
|
22
|
+
var Checkbox = function Checkbox(props) {
|
|
23
|
+
var children = props.children,
|
|
24
|
+
className = props.className,
|
|
25
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
26
|
+
return /*#__PURE__*/_react["default"].createElement(StyledCheckbox, _extends({
|
|
27
|
+
className: className
|
|
28
|
+
}, rest), children);
|
|
29
|
+
};
|
|
30
|
+
var _default = exports["default"] = Checkbox;
|
|
@@ -0,0 +1,42 @@
|
|
|
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 _Checkbox = require("./Checkbox");
|
|
12
|
+
var _cssSnippets = require("../_helpers/cssSnippets");
|
|
13
|
+
var _excluded = ["className", "vertical"];
|
|
14
|
+
var _templateObject, _templateObject2;
|
|
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 StyledGroup = (0, _styledComponents["default"])(_antd.Checkbox.Group)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n\n label.ant-checkbox-wrapper {\n margin-inline-start: 0;\n }\n"])), _Checkbox.checkboxStyles);
|
|
21
|
+
var VerticalWrapper = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-block;\n\n .ant-checkbox-group {\n ", "\n }\n"])), _cssSnippets.vertical);
|
|
22
|
+
var CheckboxGroup = function CheckboxGroup(props) {
|
|
23
|
+
var className = props.className,
|
|
24
|
+
vertical = props.vertical,
|
|
25
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
26
|
+
var group =
|
|
27
|
+
/*#__PURE__*/
|
|
28
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
29
|
+
_react["default"].createElement(StyledGroup, _extends({
|
|
30
|
+
className: className
|
|
31
|
+
}, rest));
|
|
32
|
+
if (vertical) return /*#__PURE__*/_react["default"].createElement(VerticalWrapper, null, group);
|
|
33
|
+
return group;
|
|
34
|
+
};
|
|
35
|
+
CheckboxGroup.propTypes = {
|
|
36
|
+
/** Arrange items vertically instead of inline. */
|
|
37
|
+
vertical: _propTypes["default"].bool
|
|
38
|
+
};
|
|
39
|
+
CheckboxGroup.defaultProps = {
|
|
40
|
+
vertical: false
|
|
41
|
+
};
|
|
42
|
+
var _default = exports["default"] = CheckboxGroup;
|