acsi-core 0.1.1 → 0.1.3
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/dist/components/CoreButton/index.d.ts +12 -0
- package/dist/components/CoreCheckbox/index.d.ts +10 -0
- package/dist/components/CoreError/index.d.ts +6 -0
- package/dist/components/CoreInput/index.d.ts +19 -0
- package/dist/components/CoreModal/index.d.ts +10 -0
- package/dist/components/CoreRadio/index.d.ts +14 -0
- package/dist/components/CoreRange/index.d.ts +14 -0
- package/dist/components/CoreSelect/index.d.ts +19 -0
- package/dist/components/CoreTextArea/index.d.ts +13 -0
- package/dist/components/Selects/CustomAsyncSelect.d.ts +3 -0
- package/dist/components/Selects/CustomCreatable.d.ts +3 -0
- package/dist/components/Selects/CustomSelect.d.ts +3 -0
- package/dist/components/Selects/CustomSelectOption.d.ts +3 -0
- package/dist/components/Selects/partials/index.d.ts +4 -0
- package/dist/components/Selects/theme/styles.d.ts +6 -0
- package/dist/components/index.d.ts +9 -0
- package/dist/containers/Login/configs/default.d.ts +1 -0
- package/dist/index.css +287 -35
- package/dist/index.d.ts +8 -2
- package/dist/index.js +682 -23
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +668 -25
- package/dist/index.modern.js.map +1 -1
- package/dist/redux/commons/action.d.ts +1 -0
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/getErrorMessage.d.ts +1 -0
- package/dist/utils/icons.d.ts +3 -0
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -9,16 +9,22 @@ var GoogleLogin = require('@leecheuk/react-google-login');
|
|
|
9
9
|
var GoogleLogin__default = _interopDefault(GoogleLogin);
|
|
10
10
|
var axios = _interopDefault(require('axios'));
|
|
11
11
|
var moment = _interopDefault(require('moment'));
|
|
12
|
+
var reactRouterDom = require('react-router-dom');
|
|
12
13
|
var gapiScript = require('gapi-script');
|
|
13
14
|
var reactRedux = require('react-redux');
|
|
14
15
|
var material = require('@mui/material');
|
|
15
16
|
var reactToastify = require('react-toastify');
|
|
17
|
+
var Select = require('react-select');
|
|
18
|
+
var Select__default = _interopDefault(Select);
|
|
19
|
+
var fa = require('react-icons/fa');
|
|
20
|
+
var CreatableSelect = _interopDefault(require('react-select/creatable'));
|
|
16
21
|
|
|
17
22
|
var setLoading = toolkit.createAction("common/setLoading");
|
|
18
23
|
var setAlert = toolkit.createAction("common/setAlert");
|
|
19
24
|
var setUser = toolkit.createAction("common/setUser");
|
|
20
25
|
var setLanguage = toolkit.createAction("common/setLanguage");
|
|
21
26
|
var reset = toolkit.createAction("common/reset");
|
|
27
|
+
var setMenuCollapse = toolkit.createAction("common/setMenuCollapse");
|
|
22
28
|
|
|
23
29
|
var GOOGLE_RECAPTCHA_KEY = process.env.REACT_APP_GOOGLE_RECAPTCHA_KEY || "";
|
|
24
30
|
var GOOGLE_CLIENT_ID = process.env.REACT_APP_GOOGLE_CLIENT_ID || "";
|
|
@@ -32,6 +38,7 @@ var PUSHER_CONFIG = {
|
|
|
32
38
|
};
|
|
33
39
|
var ACCESS_TOKEN = "ACCESS_TOKEN";
|
|
34
40
|
var ACADEMY_DOMAIN = "ACADEMY_DOMAIN";
|
|
41
|
+
var DefaultErrorMessage = "an_unexpected_error_has_occurred";
|
|
35
42
|
var getAccessToken = function getAccessToken() {
|
|
36
43
|
try {
|
|
37
44
|
return localStorage.getItem(ACCESS_TOKEN);
|
|
@@ -52,7 +59,7 @@ var encodeParams = function encodeParams(params) {
|
|
|
52
59
|
}).join('&');
|
|
53
60
|
};
|
|
54
61
|
|
|
55
|
-
var
|
|
62
|
+
var styleGlobal = {"signup_wrap":"_1KLz9","box-signin":"_2Jo1o","signin_title":"_3egBO","signup_link":"_1DoIT","google_button":"_34hK_","box-field":"_2e9xO","box-input":"_3zXRp","box-button-email":"_21FPk","box-signin-container":"_1QERu","box-signin-text":"_2-znH","box-signin-logo":"_1aB2m","box-right":"_3qndF","box-right-body":"_JzdCr","box-right-footer":"_19aCA"};
|
|
56
63
|
|
|
57
64
|
var api = axios.create({
|
|
58
65
|
baseURL: BASE_URL,
|
|
@@ -103,6 +110,8 @@ var apiLoginGoogle = function apiLoginGoogle(body) {
|
|
|
103
110
|
return api.post(BASE_URL + "/api/Auth/login", body);
|
|
104
111
|
};
|
|
105
112
|
|
|
113
|
+
var itemLogin = ['Seamless lesson planning', 'Flexibility and customization', 'Data protection and security', 'Standards alignment', 'AI smart assist'];
|
|
114
|
+
|
|
106
115
|
var BlockLogin = function BlockLogin(_ref) {
|
|
107
116
|
var onNavigate = _ref.onNavigate,
|
|
108
117
|
role = _ref.role;
|
|
@@ -143,36 +152,127 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
143
152
|
var onFailureGoogle = function onFailureGoogle() {
|
|
144
153
|
onNavigate("/login");
|
|
145
154
|
};
|
|
146
|
-
return React__default.createElement(reactstrap.
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}, React__default.createElement(reactstrap.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
+
return React__default.createElement(reactstrap.Row, {
|
|
156
|
+
style: {
|
|
157
|
+
height: "100%"
|
|
158
|
+
}
|
|
159
|
+
}, React__default.createElement(reactstrap.Col, {
|
|
160
|
+
sm: 12,
|
|
161
|
+
lg: 7
|
|
162
|
+
}, React__default.createElement("div", {
|
|
163
|
+
className: "" + styleGlobal["box-signin-container"]
|
|
164
|
+
}, React__default.createElement("div", {
|
|
165
|
+
className: styleGlobal["box-signin-logo"] + " "
|
|
166
|
+
}, React__default.createElement(reactRouterDom.Link, {
|
|
167
|
+
to: "/",
|
|
168
|
+
className: "d-flex"
|
|
169
|
+
}, React__default.createElement("img", {
|
|
170
|
+
src: "/images/Logo.png",
|
|
171
|
+
alt: "",
|
|
172
|
+
height: 37,
|
|
173
|
+
width: 155,
|
|
174
|
+
className: "my-auto"
|
|
175
|
+
}))), React__default.createElement("div", {
|
|
176
|
+
className: styleGlobal["box-signin"] + " "
|
|
177
|
+
}, React__default.createElement("div", {
|
|
178
|
+
className: "" + styleGlobal["signin_title"]
|
|
179
|
+
}, React__default.createElement("span", null, "Welcome to Edusfere")), React__default.createElement("div", {
|
|
180
|
+
className: "" + styleGlobal["signup_link"]
|
|
181
|
+
}, React__default.createElement("span", null, "Don't have an account?", " ", React__default.createElement(reactRouterDom.Link, {
|
|
182
|
+
to: "/",
|
|
183
|
+
style: {
|
|
184
|
+
color: "#00A0DA"
|
|
185
|
+
},
|
|
186
|
+
className: "text-decoration-none"
|
|
187
|
+
}, "Sign up"))), React__default.createElement(GoogleLogin__default, {
|
|
155
188
|
clientId: GOOGLE_CLIENT_ID,
|
|
156
189
|
render: function render(renderProps) {
|
|
157
190
|
return React__default.createElement("div", {
|
|
158
|
-
className: "
|
|
191
|
+
className: "" + styleGlobal["google_button"]
|
|
159
192
|
}, React__default.createElement("button", {
|
|
160
193
|
onClick: renderProps.onClick,
|
|
161
|
-
disabled: renderProps.disabled
|
|
162
|
-
className: "d-flex py-3 text-black align-items-center px-3 justify-content-center"
|
|
194
|
+
disabled: renderProps.disabled
|
|
163
195
|
}, React__default.createElement("img", {
|
|
164
|
-
width:
|
|
196
|
+
width: 24,
|
|
197
|
+
height: 24,
|
|
165
198
|
alt: "Google sign-in",
|
|
166
|
-
src: "/images/
|
|
167
|
-
}),
|
|
168
|
-
className: "mb-0 ms-3 fw-bold"
|
|
169
|
-
}, "sign in with Google")));
|
|
199
|
+
src: "/images/icons/Google__G__logo.png"
|
|
200
|
+
}), "Sign in with Google"));
|
|
170
201
|
},
|
|
171
202
|
onSuccess: onSuccessGoogle,
|
|
172
203
|
onFailure: onFailureGoogle,
|
|
173
|
-
cookiePolicy: "single_host_origin"
|
|
174
|
-
|
|
175
|
-
|
|
204
|
+
cookiePolicy: "single_host_origin"
|
|
205
|
+
}), React__default.createElement("span", {
|
|
206
|
+
className: "" + styleGlobal["box-field"]
|
|
207
|
+
}, "OR"), React__default.createElement(reactstrap.Form, null, React__default.createElement("div", {
|
|
208
|
+
className: "" + styleGlobal["box-input"]
|
|
209
|
+
}, React__default.createElement("input", {
|
|
210
|
+
type: "email",
|
|
211
|
+
placeholder: "Email"
|
|
212
|
+
})), React__default.createElement("button", {
|
|
213
|
+
type: "submit",
|
|
214
|
+
className: "" + styleGlobal["box-button-email"]
|
|
215
|
+
}, React__default.createElement("img", {
|
|
216
|
+
width: 20,
|
|
217
|
+
height: 20,
|
|
218
|
+
alt: "Email sign-in",
|
|
219
|
+
src: "/images/icons/Login_icon.png"
|
|
220
|
+
}), "Sign in with Email"))), React__default.createElement("div", {
|
|
221
|
+
className: styleGlobal["box-signin-text"] + " "
|
|
222
|
+
}, React__default.createElement("span", {
|
|
223
|
+
style: {
|
|
224
|
+
fontSize: "13px",
|
|
225
|
+
color: "#A6A6AD"
|
|
226
|
+
}
|
|
227
|
+
}, "By signing in, you agree to our Terms & Privacy Policy")))), React__default.createElement(reactstrap.Col, {
|
|
228
|
+
sm: 12,
|
|
229
|
+
lg: 5,
|
|
230
|
+
className: "d-none d-lg-block"
|
|
231
|
+
}, React__default.createElement("div", {
|
|
232
|
+
className: "" + styleGlobal["box-right"],
|
|
233
|
+
style: {
|
|
234
|
+
backgroundImage: "url('/images/bg_login.png')"
|
|
235
|
+
}
|
|
236
|
+
}, React__default.createElement("div", {
|
|
237
|
+
className: "" + styleGlobal["box-right-body"]
|
|
238
|
+
}, React__default.createElement("span", {
|
|
239
|
+
style: {
|
|
240
|
+
fontSize: "24px",
|
|
241
|
+
fontWeight: "700"
|
|
242
|
+
}
|
|
243
|
+
}, "As a teacher, your time and energy are too valuable to waste"), React__default.createElement("p", {
|
|
244
|
+
className: " fw-normal ",
|
|
245
|
+
style: {
|
|
246
|
+
marginTop: "12px",
|
|
247
|
+
marginBottom: "24px",
|
|
248
|
+
color: "#03191F"
|
|
249
|
+
}
|
|
250
|
+
}, "So we\u2019re building a curriculum hub and and workspace that puts everything you need to plan and prep within reach."), React__default.createElement("ul", null, itemLogin.map(function (item, it) {
|
|
251
|
+
return React__default.createElement("li", {
|
|
252
|
+
key: it,
|
|
253
|
+
className: "mb-2 ",
|
|
254
|
+
style: {
|
|
255
|
+
color: "#212126"
|
|
256
|
+
}
|
|
257
|
+
}, item);
|
|
258
|
+
})), React__default.createElement("div", {
|
|
259
|
+
className: "" + styleGlobal["box-right-footer"]
|
|
260
|
+
}, React__default.createElement("img", {
|
|
261
|
+
className: "img-fluid",
|
|
262
|
+
alt: "",
|
|
263
|
+
src: "/images/image_login.png",
|
|
264
|
+
style: {
|
|
265
|
+
width: "15vw"
|
|
266
|
+
}
|
|
267
|
+
}), React__default.createElement("div", null, React__default.createElement("p", null, "As one of our earliest users,", React__default.createElement("br", null), "you are a vital part of this process"), React__default.createElement("div", null, React__default.createElement("span", {
|
|
268
|
+
className: "d-block"
|
|
269
|
+
}, "Thank you!"), React__default.createElement("img", {
|
|
270
|
+
style: {
|
|
271
|
+
marginTop: "-15px"
|
|
272
|
+
},
|
|
273
|
+
alt: "",
|
|
274
|
+
src: "/images/icons/Vector 22.png"
|
|
275
|
+
}))))))));
|
|
176
276
|
};
|
|
177
277
|
|
|
178
278
|
var defaultInfo = {
|
|
@@ -220,7 +320,7 @@ var Login = function Login(props) {
|
|
|
220
320
|
var _useLogin = useLogin(),
|
|
221
321
|
defaultInfo = _useLogin.defaultInfo;
|
|
222
322
|
return React__default.createElement("div", {
|
|
223
|
-
className:
|
|
323
|
+
className: styleGlobal["signup_wrap"] + " container-fluid font-family-lato"
|
|
224
324
|
}, React__default.createElement(BlockLogin, {
|
|
225
325
|
defaultInfo: defaultInfo,
|
|
226
326
|
onNavigate: onNavigate,
|
|
@@ -430,7 +530,8 @@ var initialState = {
|
|
|
430
530
|
message: ""
|
|
431
531
|
},
|
|
432
532
|
user: null,
|
|
433
|
-
academy: null
|
|
533
|
+
academy: null,
|
|
534
|
+
menuCollapse: false
|
|
434
535
|
};
|
|
435
536
|
var commonReducer = toolkit.createReducer(initialState, function (builder) {
|
|
436
537
|
builder.addCase(setLoading, function (state, action) {
|
|
@@ -443,6 +544,8 @@ var commonReducer = toolkit.createReducer(initialState, function (builder) {
|
|
|
443
544
|
state.language = action.payload;
|
|
444
545
|
}).addCase(reset, function (_state, _action) {
|
|
445
546
|
return initialState;
|
|
547
|
+
}).addCase(setMenuCollapse, function (state, action) {
|
|
548
|
+
state.menuCollapse = action.payload;
|
|
446
549
|
});
|
|
447
550
|
});
|
|
448
551
|
|
|
@@ -842,6 +945,547 @@ var CustomPagination = function CustomPagination(_ref) {
|
|
|
842
945
|
})));
|
|
843
946
|
};
|
|
844
947
|
|
|
948
|
+
var styles = {"core-button":"_xvNBN","primary":"_U9Qyp","secondary":"_1VzMy","text":"_pZNuj"};
|
|
949
|
+
|
|
950
|
+
var CoreButton = function CoreButton(props) {
|
|
951
|
+
var _props$type = props.type,
|
|
952
|
+
type = _props$type === void 0 ? "primary" : _props$type,
|
|
953
|
+
children = props.children,
|
|
954
|
+
onClick = props.onClick,
|
|
955
|
+
icon = props.icon,
|
|
956
|
+
_props$disabled = props.disabled,
|
|
957
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
958
|
+
_props$background = props.background,
|
|
959
|
+
background = _props$background === void 0 ? "#F5F9FA" : _props$background,
|
|
960
|
+
_props$color = props.color,
|
|
961
|
+
color = _props$color === void 0 ? "#585869" : _props$color;
|
|
962
|
+
return React__default.createElement("button", {
|
|
963
|
+
className: styles["core-button"] + " " + styles[type],
|
|
964
|
+
style: {
|
|
965
|
+
"background": background,
|
|
966
|
+
"color": color
|
|
967
|
+
},
|
|
968
|
+
onClick: onClick,
|
|
969
|
+
disabled: disabled
|
|
970
|
+
}, icon && icon, children);
|
|
971
|
+
};
|
|
972
|
+
|
|
973
|
+
var styles$1 = {"core-input":"_1WdX2","outline":"_3X2RJ","no-outline":"_bVYtv","error":"_n7n3Q"};
|
|
974
|
+
|
|
975
|
+
var styles$2 = {"core-error":"_1Mmxr"};
|
|
976
|
+
|
|
977
|
+
var icons = {
|
|
978
|
+
ErrorRedIcon: "/images/icons/error_red.svg"
|
|
979
|
+
};
|
|
980
|
+
|
|
981
|
+
var CoreError = function CoreError(props) {
|
|
982
|
+
var message = props.message;
|
|
983
|
+
return React__default.createElement("div", {
|
|
984
|
+
className: "" + styles$2["core-error"]
|
|
985
|
+
}, React__default.createElement("img", {
|
|
986
|
+
src: icons.ErrorRedIcon,
|
|
987
|
+
alt: "error-icon"
|
|
988
|
+
}), React__default.createElement("p", null, message));
|
|
989
|
+
};
|
|
990
|
+
|
|
991
|
+
var CoreInput = function CoreInput(props) {
|
|
992
|
+
var name = props.name,
|
|
993
|
+
value = props.value,
|
|
994
|
+
_onChange = props.onChange,
|
|
995
|
+
_props$type = props.type,
|
|
996
|
+
type = _props$type === void 0 ? "outline" : _props$type,
|
|
997
|
+
_props$disabled = props.disabled,
|
|
998
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
999
|
+
label = props.label,
|
|
1000
|
+
width = props.width,
|
|
1001
|
+
_props$placeholder = props.placeholder,
|
|
1002
|
+
placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
|
|
1003
|
+
error = props.error,
|
|
1004
|
+
_props$errorMessage = props.errorMessage,
|
|
1005
|
+
errorMessage = _props$errorMessage === void 0 ? "" : _props$errorMessage,
|
|
1006
|
+
fontSize = props.fontSize,
|
|
1007
|
+
fontWeight = props.fontWeight,
|
|
1008
|
+
_onKeyDown = props.onKeyDown,
|
|
1009
|
+
ref = props.ref;
|
|
1010
|
+
return React__default.createElement("div", {
|
|
1011
|
+
className: styles$1["core-input"] + " " + styles$1[type] + " " + (error ? styles$1["error"] : ""),
|
|
1012
|
+
style: {
|
|
1013
|
+
width: width != null ? width : "100%"
|
|
1014
|
+
}
|
|
1015
|
+
}, label && React__default.createElement("label", null, label), React__default.createElement("input", Object.assign({
|
|
1016
|
+
style: {
|
|
1017
|
+
fontSize: fontSize,
|
|
1018
|
+
fontWeight: fontWeight
|
|
1019
|
+
},
|
|
1020
|
+
name: name,
|
|
1021
|
+
value: value,
|
|
1022
|
+
onChange: function onChange(e) {
|
|
1023
|
+
return _onChange(name, e.target.value);
|
|
1024
|
+
},
|
|
1025
|
+
disabled: disabled,
|
|
1026
|
+
placeholder: placeholder,
|
|
1027
|
+
onKeyDown: function onKeyDown(e) {
|
|
1028
|
+
return _onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(e);
|
|
1029
|
+
}
|
|
1030
|
+
}, ref)), error && React__default.createElement(CoreError, {
|
|
1031
|
+
message: errorMessage
|
|
1032
|
+
}));
|
|
1033
|
+
};
|
|
1034
|
+
|
|
1035
|
+
function _extends() {
|
|
1036
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
1037
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
1038
|
+
var t = arguments[e];
|
|
1039
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
1040
|
+
}
|
|
1041
|
+
return n;
|
|
1042
|
+
}, _extends.apply(null, arguments);
|
|
1043
|
+
}
|
|
1044
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
1045
|
+
if (null == r) return {};
|
|
1046
|
+
var t = {};
|
|
1047
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
1048
|
+
if (e.includes(n)) continue;
|
|
1049
|
+
t[n] = r[n];
|
|
1050
|
+
}
|
|
1051
|
+
return t;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
var styles$3 = {"core-select":"_2sg12"};
|
|
1055
|
+
|
|
1056
|
+
var CoreSelect = function CoreSelect(props) {
|
|
1057
|
+
var _options$find;
|
|
1058
|
+
var name = props.name,
|
|
1059
|
+
options = props.options,
|
|
1060
|
+
value = props.value,
|
|
1061
|
+
_onChange = props.onChange,
|
|
1062
|
+
_props$disabled = props.disabled,
|
|
1063
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
1064
|
+
label = props.label,
|
|
1065
|
+
width = props.width,
|
|
1066
|
+
_props$placeholder = props.placeholder,
|
|
1067
|
+
placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
|
|
1068
|
+
error = props.error,
|
|
1069
|
+
_props$errorMessage = props.errorMessage,
|
|
1070
|
+
errorMessage = _props$errorMessage === void 0 ? "" : _props$errorMessage;
|
|
1071
|
+
return React__default.createElement("div", {
|
|
1072
|
+
className: "" + styles$3["core-select"],
|
|
1073
|
+
style: {
|
|
1074
|
+
width: width != null ? width : "100%"
|
|
1075
|
+
}
|
|
1076
|
+
}, label && React__default.createElement("label", null, label), React__default.createElement(Select__default, {
|
|
1077
|
+
name: name,
|
|
1078
|
+
value: (_options$find = options.find(function (i) {
|
|
1079
|
+
return i.value === value;
|
|
1080
|
+
})) != null ? _options$find : null,
|
|
1081
|
+
onChange: function onChange(e) {
|
|
1082
|
+
return _onChange(name, e === null || e === void 0 ? void 0 : e.value);
|
|
1083
|
+
},
|
|
1084
|
+
placeholder: placeholder,
|
|
1085
|
+
isDisabled: disabled,
|
|
1086
|
+
options: options,
|
|
1087
|
+
styles: {
|
|
1088
|
+
control: function control(base, state) {
|
|
1089
|
+
return _extends({}, base, {
|
|
1090
|
+
borderRadius: "8px",
|
|
1091
|
+
border: state.isFocused ? "2px solid " + (!error ? "#00AFDA" : "#CE3636") : "1px solid " + (!error ? "#E6E6EB" : "#CE3636"),
|
|
1092
|
+
height: "32px",
|
|
1093
|
+
minHeight: 0,
|
|
1094
|
+
fontSize: "14px",
|
|
1095
|
+
fontWeight: "400",
|
|
1096
|
+
padding: "0 4px",
|
|
1097
|
+
backgroundColor: state.isDisabled ? "#F5F9FA)" : "#FFF",
|
|
1098
|
+
boxShadow: "none",
|
|
1099
|
+
"&:hover": {
|
|
1100
|
+
backgroundColor: "#F5F9FA"
|
|
1101
|
+
},
|
|
1102
|
+
transition: "all .3s",
|
|
1103
|
+
overflow: "hidden"
|
|
1104
|
+
});
|
|
1105
|
+
},
|
|
1106
|
+
input: function input(base) {
|
|
1107
|
+
return _extends({}, base, {
|
|
1108
|
+
margin: "0",
|
|
1109
|
+
padding: "0",
|
|
1110
|
+
color: "inherit"
|
|
1111
|
+
});
|
|
1112
|
+
},
|
|
1113
|
+
placeholder: function placeholder(base) {
|
|
1114
|
+
return _extends({}, base, {
|
|
1115
|
+
color: "#A6A6AD",
|
|
1116
|
+
position: "relative",
|
|
1117
|
+
top: "-4px"
|
|
1118
|
+
});
|
|
1119
|
+
},
|
|
1120
|
+
dropdownIndicator: function dropdownIndicator(base) {
|
|
1121
|
+
return _extends({}, base, {
|
|
1122
|
+
position: "relative",
|
|
1123
|
+
top: "-4px",
|
|
1124
|
+
padding: "8px 0"
|
|
1125
|
+
});
|
|
1126
|
+
},
|
|
1127
|
+
indicatorSeparator: function indicatorSeparator() {
|
|
1128
|
+
return {
|
|
1129
|
+
display: "none"
|
|
1130
|
+
};
|
|
1131
|
+
},
|
|
1132
|
+
valueContainer: function valueContainer(base) {
|
|
1133
|
+
return _extends({}, base, {
|
|
1134
|
+
height: "32px"
|
|
1135
|
+
});
|
|
1136
|
+
},
|
|
1137
|
+
singleValue: function singleValue(base) {
|
|
1138
|
+
return _extends({}, base, {
|
|
1139
|
+
position: "relative",
|
|
1140
|
+
top: "-4px"
|
|
1141
|
+
});
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
}), error && React__default.createElement(CoreError, {
|
|
1145
|
+
message: errorMessage
|
|
1146
|
+
}));
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1149
|
+
var styles$4 = {"core-checkbox":"_3HY4f"};
|
|
1150
|
+
|
|
1151
|
+
var CoreInput$1 = function CoreInput(props) {
|
|
1152
|
+
var name = props.name,
|
|
1153
|
+
checked = props.checked,
|
|
1154
|
+
_onChange = props.onChange,
|
|
1155
|
+
_props$disabled = props.disabled,
|
|
1156
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
1157
|
+
label = props.label;
|
|
1158
|
+
return React__default.createElement("div", {
|
|
1159
|
+
className: "" + styles$4["core-checkbox"]
|
|
1160
|
+
}, React__default.createElement(reactstrap.FormGroup, {
|
|
1161
|
+
check: true,
|
|
1162
|
+
inline: true
|
|
1163
|
+
}, React__default.createElement(reactstrap.Input, {
|
|
1164
|
+
id: "core-checkbox-" + name,
|
|
1165
|
+
type: "checkbox",
|
|
1166
|
+
name: name,
|
|
1167
|
+
checked: checked,
|
|
1168
|
+
onChange: function onChange(e) {
|
|
1169
|
+
return _onChange(name, e.target.checked);
|
|
1170
|
+
},
|
|
1171
|
+
disabled: disabled
|
|
1172
|
+
}), React__default.createElement(reactstrap.Label, {
|
|
1173
|
+
htmlFor: "core-checkbox-" + name,
|
|
1174
|
+
check: true
|
|
1175
|
+
}, label)));
|
|
1176
|
+
};
|
|
1177
|
+
|
|
1178
|
+
var styles$5 = {"core-radio":"_kvUpe","form-check":"_3ToPe"};
|
|
1179
|
+
|
|
1180
|
+
var CoreRadio = function CoreRadio(props) {
|
|
1181
|
+
var name = props.name,
|
|
1182
|
+
value = props.value,
|
|
1183
|
+
options = props.options,
|
|
1184
|
+
onChange = props.onChange,
|
|
1185
|
+
_props$disabled = props.disabled,
|
|
1186
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
1187
|
+
return React__default.createElement("div", {
|
|
1188
|
+
className: "" + styles$5["core-radio"]
|
|
1189
|
+
}, React__default.createElement(reactstrap.FormGroup, {
|
|
1190
|
+
check: true
|
|
1191
|
+
}, options.map(function (i) {
|
|
1192
|
+
return React__default.createElement("div", {
|
|
1193
|
+
key: i.value
|
|
1194
|
+
}, React__default.createElement(reactstrap.Input, {
|
|
1195
|
+
id: "core-radio-" + i.value,
|
|
1196
|
+
type: "radio",
|
|
1197
|
+
checked: value === i.value,
|
|
1198
|
+
onClick: function onClick() {
|
|
1199
|
+
onChange(name, i.value);
|
|
1200
|
+
},
|
|
1201
|
+
onChange: function onChange() {
|
|
1202
|
+
return;
|
|
1203
|
+
},
|
|
1204
|
+
disabled: disabled
|
|
1205
|
+
}), React__default.createElement(reactstrap.Label, {
|
|
1206
|
+
htmlFor: "core-radio-" + i.value
|
|
1207
|
+
}, i.label));
|
|
1208
|
+
})));
|
|
1209
|
+
};
|
|
1210
|
+
|
|
1211
|
+
var styles$6 = {"core-modal-header":"_2y5ln"};
|
|
1212
|
+
|
|
1213
|
+
var CoreModal = function CoreModal(props) {
|
|
1214
|
+
var open = props.open,
|
|
1215
|
+
onClose = props.onClose,
|
|
1216
|
+
children = props.children,
|
|
1217
|
+
title = props.title,
|
|
1218
|
+
footer = props.footer;
|
|
1219
|
+
return React__default.createElement(reactstrap.Modal, {
|
|
1220
|
+
isOpen: open,
|
|
1221
|
+
toggle: onClose,
|
|
1222
|
+
centered: true,
|
|
1223
|
+
className: styles$6["core-modal"]
|
|
1224
|
+
}, React__default.createElement(reactstrap.ModalHeader, {
|
|
1225
|
+
toggle: onClose,
|
|
1226
|
+
className: styles$6["core-modal-header"]
|
|
1227
|
+
}, title), React__default.createElement(reactstrap.ModalBody, null, children), footer && React__default.createElement(reactstrap.ModalFooter, null, footer));
|
|
1228
|
+
};
|
|
1229
|
+
|
|
1230
|
+
var styles$7 = {"core-range":"_1dzD7"};
|
|
1231
|
+
|
|
1232
|
+
var CoreRange = function CoreRange(props) {
|
|
1233
|
+
var name = props.name,
|
|
1234
|
+
value = props.value,
|
|
1235
|
+
_onChange = props.onChange,
|
|
1236
|
+
label = props.label,
|
|
1237
|
+
width = props.width,
|
|
1238
|
+
min = props.min,
|
|
1239
|
+
max = props.max,
|
|
1240
|
+
step = props.step;
|
|
1241
|
+
return React__default.createElement("div", {
|
|
1242
|
+
className: "" + styles$7["core-range"],
|
|
1243
|
+
style: {
|
|
1244
|
+
width: width != null ? width : "100%"
|
|
1245
|
+
}
|
|
1246
|
+
}, label && React__default.createElement("label", null, label), React__default.createElement("input", {
|
|
1247
|
+
type: "range",
|
|
1248
|
+
name: name,
|
|
1249
|
+
value: value,
|
|
1250
|
+
onChange: function onChange(e) {
|
|
1251
|
+
return _onChange(name, +e.target.value);
|
|
1252
|
+
},
|
|
1253
|
+
min: min,
|
|
1254
|
+
max: max,
|
|
1255
|
+
step: step
|
|
1256
|
+
}));
|
|
1257
|
+
};
|
|
1258
|
+
|
|
1259
|
+
var styles$8 = {"core-text-area":"_1b_C3"};
|
|
1260
|
+
|
|
1261
|
+
var CoreTextArea = function CoreTextArea(props) {
|
|
1262
|
+
var name = props.name,
|
|
1263
|
+
_onChange = props.onChange,
|
|
1264
|
+
value = props.value,
|
|
1265
|
+
_props$cols = props.cols,
|
|
1266
|
+
cols = _props$cols === void 0 ? 0 : _props$cols,
|
|
1267
|
+
label = props.label,
|
|
1268
|
+
_props$rows = props.rows,
|
|
1269
|
+
rows = _props$rows === void 0 ? 2 : _props$rows,
|
|
1270
|
+
_props$placeholder = props.placeholder,
|
|
1271
|
+
placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
|
|
1272
|
+
width = props.width;
|
|
1273
|
+
return React__default.createElement("div", {
|
|
1274
|
+
className: styles$8["core-text-area"]
|
|
1275
|
+
}, label && React__default.createElement("label", null, label), React__default.createElement("textarea", {
|
|
1276
|
+
placeholder: placeholder,
|
|
1277
|
+
value: value,
|
|
1278
|
+
cols: cols,
|
|
1279
|
+
rows: rows,
|
|
1280
|
+
onChange: function onChange(e) {
|
|
1281
|
+
return _onChange(name, e.target.value);
|
|
1282
|
+
},
|
|
1283
|
+
style: {
|
|
1284
|
+
width: width != null ? width : "100%"
|
|
1285
|
+
}
|
|
1286
|
+
}));
|
|
1287
|
+
};
|
|
1288
|
+
|
|
1289
|
+
var getErrorMessage = function getErrorMessage(error, defaultErrorMessage) {
|
|
1290
|
+
var _error$response, _error$response$data, _error$response2, _error$response3, _error$response3$data;
|
|
1291
|
+
var errorMessage = error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.title;
|
|
1292
|
+
if ((error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.status) === 500) return defaultErrorMessage || DefaultErrorMessage;
|
|
1293
|
+
if (typeof errorMessage === "string") return decodeURIComponent(errorMessage);
|
|
1294
|
+
errorMessage = (error === null || error === void 0 ? void 0 : error.message) || (error === null || error === void 0 ? void 0 : (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : (_error$response3$data = _error$response3.data) === null || _error$response3$data === void 0 ? void 0 : _error$response3$data.message);
|
|
1295
|
+
if (typeof errorMessage === "string") return errorMessage;
|
|
1296
|
+
return defaultErrorMessage || DefaultErrorMessage;
|
|
1297
|
+
};
|
|
1298
|
+
|
|
1299
|
+
var customStyles = {
|
|
1300
|
+
control: function control(baseStyles, state) {
|
|
1301
|
+
return _extends({}, baseStyles, {
|
|
1302
|
+
fontSize: "14px",
|
|
1303
|
+
fontWeight: 700,
|
|
1304
|
+
color: styleGlobal.darker,
|
|
1305
|
+
borderColor: state.isFocused || state.hasValue ? styleGlobal.dark : styleGlobal.less_dark,
|
|
1306
|
+
boxShadow: state.isFocused ? "0 0 0 1px " + styleGlobal.dark + "4D" : baseStyles.boxShadow,
|
|
1307
|
+
"&:active": {
|
|
1308
|
+
borderColor: state.isFocused || state.hasValue ? styleGlobal.dark : styleGlobal.less_dark
|
|
1309
|
+
},
|
|
1310
|
+
"&:hover": {
|
|
1311
|
+
borderColor: state.isFocused || state.hasValue ? styleGlobal.dark : styleGlobal.less_dark
|
|
1312
|
+
}
|
|
1313
|
+
});
|
|
1314
|
+
},
|
|
1315
|
+
input: function input(baseStyles, _) {
|
|
1316
|
+
return _extends({}, baseStyles, {
|
|
1317
|
+
fontSize: "14px",
|
|
1318
|
+
fontWeight: 700,
|
|
1319
|
+
color: styleGlobal.darker
|
|
1320
|
+
});
|
|
1321
|
+
},
|
|
1322
|
+
singleValue: function singleValue(baseStyles) {
|
|
1323
|
+
return _extends({}, baseStyles, {
|
|
1324
|
+
fontSize: "14px",
|
|
1325
|
+
fontWeight: 700,
|
|
1326
|
+
color: styleGlobal.darker
|
|
1327
|
+
});
|
|
1328
|
+
},
|
|
1329
|
+
option: function option(baseStyles, state) {
|
|
1330
|
+
return _extends({}, baseStyles, {
|
|
1331
|
+
backgroundColor: state.isSelected ? styleGlobal.dark : state.isFocused ? styleGlobal.light : 'white',
|
|
1332
|
+
"&:active": {
|
|
1333
|
+
backgroundColor: state.isSelected ? styleGlobal.dark : state.isFocused ? styleGlobal.less_dark : baseStyles.backgroundColor
|
|
1334
|
+
}
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
};
|
|
1338
|
+
|
|
1339
|
+
var DropdownIndicator = function DropdownIndicator(props) {
|
|
1340
|
+
return React__default.createElement(Select.components.DropdownIndicator, Object.assign({}, props), React__default.createElement(fa.FaCaretDown, {
|
|
1341
|
+
size: 20,
|
|
1342
|
+
color: styleGlobal.darker
|
|
1343
|
+
}));
|
|
1344
|
+
};
|
|
1345
|
+
var CustomOption = function CustomOption(props) {
|
|
1346
|
+
return React__default.createElement(Select.components.Option, Object.assign({}, props), React__default.createElement("div", {
|
|
1347
|
+
style: {
|
|
1348
|
+
fontSize: "14px",
|
|
1349
|
+
fontWeight: 500
|
|
1350
|
+
}
|
|
1351
|
+
}, props.data.label));
|
|
1352
|
+
};
|
|
1353
|
+
|
|
1354
|
+
var _excluded = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
1355
|
+
var CustomSelect = function CustomSelect(_ref) {
|
|
1356
|
+
var isDefault = _ref.isDefault,
|
|
1357
|
+
options = _ref.options,
|
|
1358
|
+
isDisabled = _ref.isDisabled,
|
|
1359
|
+
scrollBottom = _ref.scrollBottom,
|
|
1360
|
+
value = _ref.value,
|
|
1361
|
+
isMulti = _ref.isMulti,
|
|
1362
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
1363
|
+
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
|
1364
|
+
return value.includes(i.value);
|
|
1365
|
+
}) : isMulti ? options === null || options === void 0 ? void 0 : options.filter(function (i) {
|
|
1366
|
+
return i.value == value;
|
|
1367
|
+
}) : options === null || options === void 0 ? void 0 : options.find(function (i) {
|
|
1368
|
+
return i.value == value;
|
|
1369
|
+
});
|
|
1370
|
+
return React__default.createElement(Select__default, Object.assign({
|
|
1371
|
+
isDisabled: isDisabled,
|
|
1372
|
+
options: options,
|
|
1373
|
+
value: !isDefault ? initialValues != null ? initialValues : null : undefined,
|
|
1374
|
+
defaultValue: isDefault ? initialValues : undefined,
|
|
1375
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
|
1376
|
+
isMulti: isMulti,
|
|
1377
|
+
components: {
|
|
1378
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
|
1379
|
+
return null;
|
|
1380
|
+
},
|
|
1381
|
+
DropdownIndicator: DropdownIndicator,
|
|
1382
|
+
Option: CustomOption
|
|
1383
|
+
},
|
|
1384
|
+
styles: customStyles,
|
|
1385
|
+
placeholder: "Select..."
|
|
1386
|
+
}, rest));
|
|
1387
|
+
};
|
|
1388
|
+
|
|
1389
|
+
var _excluded$1 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
1390
|
+
var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
|
1391
|
+
var isDefault = _ref.isDefault,
|
|
1392
|
+
options = _ref.options,
|
|
1393
|
+
isDisabled = _ref.isDisabled,
|
|
1394
|
+
scrollBottom = _ref.scrollBottom,
|
|
1395
|
+
value = _ref.value,
|
|
1396
|
+
isMulti = _ref.isMulti,
|
|
1397
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
1398
|
+
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
|
1399
|
+
return value.includes(i.value);
|
|
1400
|
+
}) : isMulti ? options.filter(function (i) {
|
|
1401
|
+
return i.value == value;
|
|
1402
|
+
}) : options.find(function (i) {
|
|
1403
|
+
return i.value == value;
|
|
1404
|
+
});
|
|
1405
|
+
return React__default.createElement(Select__default, Object.assign({
|
|
1406
|
+
isDisabled: isDisabled,
|
|
1407
|
+
options: options,
|
|
1408
|
+
value: !isDefault ? initialValues : undefined,
|
|
1409
|
+
defaultValue: isDefault ? initialValues : undefined,
|
|
1410
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
|
1411
|
+
isMulti: isMulti,
|
|
1412
|
+
components: {
|
|
1413
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
|
1414
|
+
return null;
|
|
1415
|
+
},
|
|
1416
|
+
DropdownIndicator: DropdownIndicator,
|
|
1417
|
+
Option: CustomOption
|
|
1418
|
+
},
|
|
1419
|
+
styles: customStyles,
|
|
1420
|
+
placeholder: "Select..."
|
|
1421
|
+
}, rest));
|
|
1422
|
+
};
|
|
1423
|
+
|
|
1424
|
+
var _excluded$2 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
1425
|
+
var CustomCreatable = function CustomCreatable(_ref) {
|
|
1426
|
+
var options = _ref.options,
|
|
1427
|
+
isDisabled = _ref.isDisabled,
|
|
1428
|
+
scrollBottom = _ref.scrollBottom,
|
|
1429
|
+
value = _ref.value,
|
|
1430
|
+
isMulti = _ref.isMulti,
|
|
1431
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
1432
|
+
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
|
1433
|
+
return value.includes(i.value);
|
|
1434
|
+
}) : isMulti ? options.filter(function (i) {
|
|
1435
|
+
return i.value == value;
|
|
1436
|
+
}) : options.find(function (i) {
|
|
1437
|
+
return i.value == value;
|
|
1438
|
+
});
|
|
1439
|
+
return React__default.createElement(CreatableSelect, Object.assign({
|
|
1440
|
+
isClearable: true,
|
|
1441
|
+
isDisabled: isDisabled,
|
|
1442
|
+
options: options,
|
|
1443
|
+
value: initialValues,
|
|
1444
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
|
1445
|
+
isMulti: isMulti,
|
|
1446
|
+
components: {
|
|
1447
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
|
1448
|
+
return null;
|
|
1449
|
+
},
|
|
1450
|
+
DropdownIndicator: DropdownIndicator,
|
|
1451
|
+
Option: CustomOption
|
|
1452
|
+
},
|
|
1453
|
+
styles: customStyles,
|
|
1454
|
+
placeholder: "Select..."
|
|
1455
|
+
}, rest));
|
|
1456
|
+
};
|
|
1457
|
+
|
|
1458
|
+
var _excluded$3 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
1459
|
+
var CustomSelectOption = function CustomSelectOption(_ref) {
|
|
1460
|
+
var defaultValue = _ref.defaultValue,
|
|
1461
|
+
options = _ref.options,
|
|
1462
|
+
isDisabled = _ref.isDisabled,
|
|
1463
|
+
scrollBottom = _ref.scrollBottom,
|
|
1464
|
+
value = _ref.value,
|
|
1465
|
+
isMulti = _ref.isMulti,
|
|
1466
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
1467
|
+
var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? options.find(function (option) {
|
|
1468
|
+
return option.value === defaultValue;
|
|
1469
|
+
}) || null : null;
|
|
1470
|
+
return React__default.createElement(Select__default, Object.assign({
|
|
1471
|
+
isDisabled: isDisabled,
|
|
1472
|
+
options: options,
|
|
1473
|
+
value: value,
|
|
1474
|
+
defaultValue: initialValues,
|
|
1475
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
|
1476
|
+
isMulti: isMulti,
|
|
1477
|
+
components: {
|
|
1478
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
|
1479
|
+
return null;
|
|
1480
|
+
},
|
|
1481
|
+
DropdownIndicator: DropdownIndicator,
|
|
1482
|
+
Option: CustomOption
|
|
1483
|
+
},
|
|
1484
|
+
styles: customStyles,
|
|
1485
|
+
placeholder: "Select..."
|
|
1486
|
+
}, rest));
|
|
1487
|
+
};
|
|
1488
|
+
|
|
845
1489
|
var historyCore = history.createBrowserHistory();
|
|
846
1490
|
|
|
847
1491
|
Object.defineProperty(exports, 'ToastContainer', {
|
|
@@ -860,16 +1504,31 @@ exports.ACCESS_TOKEN = ACCESS_TOKEN;
|
|
|
860
1504
|
exports.BASE_URL = BASE_URL;
|
|
861
1505
|
exports.CommonDialog = CommonDialog;
|
|
862
1506
|
exports.ConfirmDialog = ConfirmDialog;
|
|
1507
|
+
exports.CoreButton = CoreButton;
|
|
1508
|
+
exports.CoreCheckbox = CoreInput$1;
|
|
1509
|
+
exports.CoreError = CoreError;
|
|
1510
|
+
exports.CoreInput = CoreInput;
|
|
1511
|
+
exports.CoreModal = CoreModal;
|
|
1512
|
+
exports.CoreRadio = CoreRadio;
|
|
1513
|
+
exports.CoreRange = CoreRange;
|
|
1514
|
+
exports.CoreSelect = CoreSelect;
|
|
1515
|
+
exports.CoreTextArea = CoreTextArea;
|
|
1516
|
+
exports.CustomAsyncSelect = CustomAsyncSelect;
|
|
1517
|
+
exports.CustomCreatable = CustomCreatable;
|
|
863
1518
|
exports.CustomPagination = CustomPagination;
|
|
1519
|
+
exports.CustomSelect = CustomSelect;
|
|
1520
|
+
exports.CustomSelectOption = CustomSelectOption;
|
|
864
1521
|
exports.LayoutContext = LayoutContext;
|
|
865
1522
|
exports.Loading = Loading;
|
|
866
1523
|
exports.Login = Login;
|
|
867
1524
|
exports.NotFound = NotFound;
|
|
868
1525
|
exports.api = api$1;
|
|
869
1526
|
exports.apiUpload = apiUpload$1;
|
|
1527
|
+
exports.getErrorMessage = getErrorMessage;
|
|
870
1528
|
exports.historyCore = historyCore;
|
|
871
1529
|
exports.setAlert = setAlert;
|
|
872
1530
|
exports.setLoading = setLoading;
|
|
1531
|
+
exports.setMenuCollapse = setMenuCollapse;
|
|
873
1532
|
exports.setUser = setUser;
|
|
874
1533
|
exports.store = store;
|
|
875
1534
|
exports.useGoogleSignOut = useGoogleSignOut;
|