acsi-core 0.1.1 → 0.1.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/dist/components/CoreButton/index.d.ts +10 -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 +13 -0
- package/dist/components/CoreModal/index.d.ts +9 -0
- package/dist/components/CoreRadio/index.d.ts +14 -0
- package/dist/components/CoreSelect/index.d.ts +18 -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 +7 -0
- package/dist/containers/Login/configs/default.d.ts +1 -0
- package/dist/index.css +247 -34
- package/dist/index.d.ts +7 -1
- package/dist/index.js +582 -22
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +571 -24
- package/dist/index.modern.js.map +1 -1
- 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 +2 -2
package/dist/index.js
CHANGED
|
@@ -9,10 +9,15 @@ 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");
|
|
@@ -32,6 +37,7 @@ var PUSHER_CONFIG = {
|
|
|
32
37
|
};
|
|
33
38
|
var ACCESS_TOKEN = "ACCESS_TOKEN";
|
|
34
39
|
var ACADEMY_DOMAIN = "ACADEMY_DOMAIN";
|
|
40
|
+
var DefaultErrorMessage = "an_unexpected_error_has_occurred";
|
|
35
41
|
var getAccessToken = function getAccessToken() {
|
|
36
42
|
try {
|
|
37
43
|
return localStorage.getItem(ACCESS_TOKEN);
|
|
@@ -52,7 +58,7 @@ var encodeParams = function encodeParams(params) {
|
|
|
52
58
|
}).join('&');
|
|
53
59
|
};
|
|
54
60
|
|
|
55
|
-
var
|
|
61
|
+
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
62
|
|
|
57
63
|
var api = axios.create({
|
|
58
64
|
baseURL: BASE_URL,
|
|
@@ -103,6 +109,8 @@ var apiLoginGoogle = function apiLoginGoogle(body) {
|
|
|
103
109
|
return api.post(BASE_URL + "/api/Auth/login", body);
|
|
104
110
|
};
|
|
105
111
|
|
|
112
|
+
var itemLogin = ['Seamless lesson planning', 'Flexibility and customization', 'Data protection and security', 'Standards alignment', 'AI smart assist'];
|
|
113
|
+
|
|
106
114
|
var BlockLogin = function BlockLogin(_ref) {
|
|
107
115
|
var onNavigate = _ref.onNavigate,
|
|
108
116
|
role = _ref.role;
|
|
@@ -143,36 +151,127 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
143
151
|
var onFailureGoogle = function onFailureGoogle() {
|
|
144
152
|
onNavigate("/login");
|
|
145
153
|
};
|
|
146
|
-
return React__default.createElement(reactstrap.
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}, React__default.createElement(reactstrap.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
154
|
+
return React__default.createElement(reactstrap.Row, {
|
|
155
|
+
style: {
|
|
156
|
+
height: "100%"
|
|
157
|
+
}
|
|
158
|
+
}, React__default.createElement(reactstrap.Col, {
|
|
159
|
+
sm: 12,
|
|
160
|
+
lg: 7
|
|
161
|
+
}, React__default.createElement("div", {
|
|
162
|
+
className: "" + styleGlobal["box-signin-container"]
|
|
163
|
+
}, React__default.createElement("div", {
|
|
164
|
+
className: styleGlobal["box-signin-logo"] + " "
|
|
165
|
+
}, React__default.createElement(reactRouterDom.Link, {
|
|
166
|
+
to: "/",
|
|
167
|
+
className: "d-flex"
|
|
168
|
+
}, React__default.createElement("img", {
|
|
169
|
+
src: "/images/Logo.png",
|
|
170
|
+
alt: "",
|
|
171
|
+
height: 37,
|
|
172
|
+
width: 155,
|
|
173
|
+
className: "my-auto"
|
|
174
|
+
}))), React__default.createElement("div", {
|
|
175
|
+
className: styleGlobal["box-signin"] + " "
|
|
176
|
+
}, React__default.createElement("div", {
|
|
177
|
+
className: "" + styleGlobal["signin_title"]
|
|
178
|
+
}, React__default.createElement("span", null, "Welcome to Edusfere")), React__default.createElement("div", {
|
|
179
|
+
className: "" + styleGlobal["signup_link"]
|
|
180
|
+
}, React__default.createElement("span", null, "Don't have an account?", " ", React__default.createElement(reactRouterDom.Link, {
|
|
181
|
+
to: "/",
|
|
182
|
+
style: {
|
|
183
|
+
color: "#00A0DA"
|
|
184
|
+
},
|
|
185
|
+
className: "text-decoration-none"
|
|
186
|
+
}, "Sign up"))), React__default.createElement(GoogleLogin__default, {
|
|
155
187
|
clientId: GOOGLE_CLIENT_ID,
|
|
156
188
|
render: function render(renderProps) {
|
|
157
189
|
return React__default.createElement("div", {
|
|
158
|
-
className: "
|
|
190
|
+
className: "" + styleGlobal["google_button"]
|
|
159
191
|
}, React__default.createElement("button", {
|
|
160
192
|
onClick: renderProps.onClick,
|
|
161
|
-
disabled: renderProps.disabled
|
|
162
|
-
className: "d-flex py-3 text-black align-items-center px-3 justify-content-center"
|
|
193
|
+
disabled: renderProps.disabled
|
|
163
194
|
}, React__default.createElement("img", {
|
|
164
|
-
width:
|
|
195
|
+
width: 24,
|
|
196
|
+
height: 24,
|
|
165
197
|
alt: "Google sign-in",
|
|
166
|
-
src: "/images/
|
|
167
|
-
}),
|
|
168
|
-
className: "mb-0 ms-3 fw-bold"
|
|
169
|
-
}, "sign in with Google")));
|
|
198
|
+
src: "/images/icons/Google__G__logo.png"
|
|
199
|
+
}), "Sign in with Google"));
|
|
170
200
|
},
|
|
171
201
|
onSuccess: onSuccessGoogle,
|
|
172
202
|
onFailure: onFailureGoogle,
|
|
173
|
-
cookiePolicy: "single_host_origin"
|
|
174
|
-
|
|
175
|
-
|
|
203
|
+
cookiePolicy: "single_host_origin"
|
|
204
|
+
}), React__default.createElement("span", {
|
|
205
|
+
className: "" + styleGlobal["box-field"]
|
|
206
|
+
}, "OR"), React__default.createElement(reactstrap.Form, null, React__default.createElement("div", {
|
|
207
|
+
className: "" + styleGlobal["box-input"]
|
|
208
|
+
}, React__default.createElement("input", {
|
|
209
|
+
type: "email",
|
|
210
|
+
placeholder: "Email"
|
|
211
|
+
})), React__default.createElement("button", {
|
|
212
|
+
type: "submit",
|
|
213
|
+
className: "" + styleGlobal["box-button-email"]
|
|
214
|
+
}, React__default.createElement("img", {
|
|
215
|
+
width: 20,
|
|
216
|
+
height: 20,
|
|
217
|
+
alt: "Email sign-in",
|
|
218
|
+
src: "/images/icons/Login_icon.png"
|
|
219
|
+
}), "Sign in with Email"))), React__default.createElement("div", {
|
|
220
|
+
className: styleGlobal["box-signin-text"] + " "
|
|
221
|
+
}, React__default.createElement("span", {
|
|
222
|
+
style: {
|
|
223
|
+
fontSize: "13px",
|
|
224
|
+
color: "#A6A6AD"
|
|
225
|
+
}
|
|
226
|
+
}, "By signing in, you agree to our Terms & Privacy Policy")))), React__default.createElement(reactstrap.Col, {
|
|
227
|
+
sm: 12,
|
|
228
|
+
lg: 5,
|
|
229
|
+
className: "d-none d-lg-block"
|
|
230
|
+
}, React__default.createElement("div", {
|
|
231
|
+
className: "" + styleGlobal["box-right"],
|
|
232
|
+
style: {
|
|
233
|
+
backgroundImage: "url('/images/bg_login.png')"
|
|
234
|
+
}
|
|
235
|
+
}, React__default.createElement("div", {
|
|
236
|
+
className: "" + styleGlobal["box-right-body"]
|
|
237
|
+
}, React__default.createElement("span", {
|
|
238
|
+
style: {
|
|
239
|
+
fontSize: "24px",
|
|
240
|
+
fontWeight: "700"
|
|
241
|
+
}
|
|
242
|
+
}, "As a teacher, your time and energy are too valuable to waste"), React__default.createElement("p", {
|
|
243
|
+
className: " fw-normal ",
|
|
244
|
+
style: {
|
|
245
|
+
marginTop: "12px",
|
|
246
|
+
marginBottom: "24px",
|
|
247
|
+
color: "#03191F"
|
|
248
|
+
}
|
|
249
|
+
}, "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) {
|
|
250
|
+
return React__default.createElement("li", {
|
|
251
|
+
key: it,
|
|
252
|
+
className: "mb-2 ",
|
|
253
|
+
style: {
|
|
254
|
+
color: "#212126"
|
|
255
|
+
}
|
|
256
|
+
}, item);
|
|
257
|
+
})), React__default.createElement("div", {
|
|
258
|
+
className: "" + styleGlobal["box-right-footer"]
|
|
259
|
+
}, React__default.createElement("img", {
|
|
260
|
+
className: "img-fluid",
|
|
261
|
+
alt: "",
|
|
262
|
+
src: "/images/image_login.png",
|
|
263
|
+
style: {
|
|
264
|
+
width: "15vw"
|
|
265
|
+
}
|
|
266
|
+
}), 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", {
|
|
267
|
+
className: "d-block"
|
|
268
|
+
}, "Thank you!"), React__default.createElement("img", {
|
|
269
|
+
style: {
|
|
270
|
+
marginTop: "-15px"
|
|
271
|
+
},
|
|
272
|
+
alt: "",
|
|
273
|
+
src: "/images/icons/Vector 22.png"
|
|
274
|
+
}))))))));
|
|
176
275
|
};
|
|
177
276
|
|
|
178
277
|
var defaultInfo = {
|
|
@@ -220,7 +319,7 @@ var Login = function Login(props) {
|
|
|
220
319
|
var _useLogin = useLogin(),
|
|
221
320
|
defaultInfo = _useLogin.defaultInfo;
|
|
222
321
|
return React__default.createElement("div", {
|
|
223
|
-
className:
|
|
322
|
+
className: styleGlobal["signup_wrap"] + " container-fluid font-family-lato"
|
|
224
323
|
}, React__default.createElement(BlockLogin, {
|
|
225
324
|
defaultInfo: defaultInfo,
|
|
226
325
|
onNavigate: onNavigate,
|
|
@@ -842,6 +941,455 @@ var CustomPagination = function CustomPagination(_ref) {
|
|
|
842
941
|
})));
|
|
843
942
|
};
|
|
844
943
|
|
|
944
|
+
var styles = {"core-button":"_xvNBN","primary":"_U9Qyp","secondary":"_1VzMy","text":"_pZNuj"};
|
|
945
|
+
|
|
946
|
+
var CoreButton = function CoreButton(props) {
|
|
947
|
+
var _props$type = props.type,
|
|
948
|
+
type = _props$type === void 0 ? "primary" : _props$type,
|
|
949
|
+
children = props.children,
|
|
950
|
+
onClick = props.onClick,
|
|
951
|
+
icon = props.icon,
|
|
952
|
+
_props$disabled = props.disabled,
|
|
953
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
954
|
+
return React__default.createElement("button", {
|
|
955
|
+
className: styles["core-button"] + " " + styles[type],
|
|
956
|
+
onClick: onClick,
|
|
957
|
+
disabled: disabled
|
|
958
|
+
}, icon && icon, children);
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
var styles$1 = {"core-input":"_1WdX2","error":"_n7n3Q"};
|
|
962
|
+
|
|
963
|
+
var CoreInput = function CoreInput(props) {
|
|
964
|
+
var name = props.name,
|
|
965
|
+
value = props.value,
|
|
966
|
+
_onChange = props.onChange,
|
|
967
|
+
_props$disabled = props.disabled,
|
|
968
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
969
|
+
label = props.label,
|
|
970
|
+
width = props.width,
|
|
971
|
+
_props$placeholder = props.placeholder,
|
|
972
|
+
placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
|
|
973
|
+
error = props.error;
|
|
974
|
+
return React__default.createElement("div", {
|
|
975
|
+
className: styles$1["core-input"] + " " + (error ? styles$1["error"] : ""),
|
|
976
|
+
style: {
|
|
977
|
+
width: width != null ? width : "100%"
|
|
978
|
+
}
|
|
979
|
+
}, label && React__default.createElement("label", null, label), React__default.createElement("input", {
|
|
980
|
+
name: name,
|
|
981
|
+
value: value,
|
|
982
|
+
onChange: function onChange(e) {
|
|
983
|
+
return _onChange(name, e.target.value);
|
|
984
|
+
},
|
|
985
|
+
disabled: disabled,
|
|
986
|
+
placeholder: placeholder
|
|
987
|
+
}));
|
|
988
|
+
};
|
|
989
|
+
|
|
990
|
+
function _extends() {
|
|
991
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
992
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
993
|
+
var t = arguments[e];
|
|
994
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
995
|
+
}
|
|
996
|
+
return n;
|
|
997
|
+
}, _extends.apply(null, arguments);
|
|
998
|
+
}
|
|
999
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
1000
|
+
if (null == r) return {};
|
|
1001
|
+
var t = {};
|
|
1002
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
1003
|
+
if (e.includes(n)) continue;
|
|
1004
|
+
t[n] = r[n];
|
|
1005
|
+
}
|
|
1006
|
+
return t;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
var styles$2 = {"core-select":"_2sg12"};
|
|
1010
|
+
|
|
1011
|
+
var CoreSelect = function CoreSelect(props) {
|
|
1012
|
+
var _options$find;
|
|
1013
|
+
var name = props.name,
|
|
1014
|
+
options = props.options,
|
|
1015
|
+
value = props.value,
|
|
1016
|
+
_onChange = props.onChange,
|
|
1017
|
+
_props$disabled = props.disabled,
|
|
1018
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
1019
|
+
label = props.label,
|
|
1020
|
+
width = props.width,
|
|
1021
|
+
_props$placeholder = props.placeholder,
|
|
1022
|
+
placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
|
|
1023
|
+
error = props.error;
|
|
1024
|
+
return React__default.createElement("div", {
|
|
1025
|
+
className: "" + styles$2["core-select"],
|
|
1026
|
+
style: {
|
|
1027
|
+
width: width != null ? width : "100%"
|
|
1028
|
+
}
|
|
1029
|
+
}, label && React__default.createElement("label", null, label), React__default.createElement(Select__default, {
|
|
1030
|
+
name: name,
|
|
1031
|
+
value: (_options$find = options.find(function (i) {
|
|
1032
|
+
return i.value === value;
|
|
1033
|
+
})) != null ? _options$find : null,
|
|
1034
|
+
onChange: function onChange(e) {
|
|
1035
|
+
return _onChange(name, e === null || e === void 0 ? void 0 : e.value);
|
|
1036
|
+
},
|
|
1037
|
+
placeholder: placeholder,
|
|
1038
|
+
isDisabled: disabled,
|
|
1039
|
+
options: options,
|
|
1040
|
+
styles: {
|
|
1041
|
+
control: function control(base, state) {
|
|
1042
|
+
return _extends({}, base, {
|
|
1043
|
+
borderRadius: "8px",
|
|
1044
|
+
border: state.isFocused ? "2px solid " + (!error ? "#00AFDA" : "#CE3636") : "1px solid " + (!error ? "#E6E6EB" : "#CE3636"),
|
|
1045
|
+
height: "32px",
|
|
1046
|
+
minHeight: 0,
|
|
1047
|
+
fontSize: "14px",
|
|
1048
|
+
fontWeight: "400",
|
|
1049
|
+
padding: "0 4px",
|
|
1050
|
+
backgroundColor: state.isDisabled ? "#F5F9FA)" : "#FFF",
|
|
1051
|
+
boxShadow: "none",
|
|
1052
|
+
"&:hover": {
|
|
1053
|
+
backgroundColor: "#F5F9FA"
|
|
1054
|
+
}
|
|
1055
|
+
});
|
|
1056
|
+
},
|
|
1057
|
+
input: function input(base) {
|
|
1058
|
+
return _extends({}, base, {
|
|
1059
|
+
margin: "0",
|
|
1060
|
+
padding: "0",
|
|
1061
|
+
color: "inherit"
|
|
1062
|
+
});
|
|
1063
|
+
},
|
|
1064
|
+
placeholder: function placeholder(base) {
|
|
1065
|
+
return _extends({}, base, {
|
|
1066
|
+
color: "#A6A6AD",
|
|
1067
|
+
position: "relative",
|
|
1068
|
+
top: "-4px"
|
|
1069
|
+
});
|
|
1070
|
+
},
|
|
1071
|
+
dropdownIndicator: function dropdownIndicator(base) {
|
|
1072
|
+
return _extends({}, base, {
|
|
1073
|
+
position: "relative",
|
|
1074
|
+
top: "-4px"
|
|
1075
|
+
});
|
|
1076
|
+
},
|
|
1077
|
+
indicatorSeparator: function indicatorSeparator() {
|
|
1078
|
+
return {
|
|
1079
|
+
display: "none"
|
|
1080
|
+
};
|
|
1081
|
+
},
|
|
1082
|
+
valueContainer: function valueContainer(base) {
|
|
1083
|
+
return _extends({}, base, {
|
|
1084
|
+
height: "32px"
|
|
1085
|
+
});
|
|
1086
|
+
},
|
|
1087
|
+
singleValue: function singleValue(base) {
|
|
1088
|
+
return _extends({}, base, {
|
|
1089
|
+
position: "relative",
|
|
1090
|
+
top: "-4px"
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
}));
|
|
1095
|
+
};
|
|
1096
|
+
|
|
1097
|
+
var styles$3 = {"core-checkbox":"_3HY4f"};
|
|
1098
|
+
|
|
1099
|
+
var CoreInput$1 = function CoreInput(props) {
|
|
1100
|
+
var name = props.name,
|
|
1101
|
+
checked = props.checked,
|
|
1102
|
+
_onChange = props.onChange,
|
|
1103
|
+
_props$disabled = props.disabled,
|
|
1104
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
1105
|
+
label = props.label;
|
|
1106
|
+
return React__default.createElement("div", {
|
|
1107
|
+
className: "" + styles$3["core-checkbox"]
|
|
1108
|
+
}, React__default.createElement(reactstrap.FormGroup, {
|
|
1109
|
+
check: true,
|
|
1110
|
+
inline: true
|
|
1111
|
+
}, React__default.createElement(reactstrap.Input, {
|
|
1112
|
+
id: "core-checkbox-" + name,
|
|
1113
|
+
type: "checkbox",
|
|
1114
|
+
name: name,
|
|
1115
|
+
checked: checked,
|
|
1116
|
+
onChange: function onChange(e) {
|
|
1117
|
+
return _onChange(name, e.target.checked);
|
|
1118
|
+
},
|
|
1119
|
+
disabled: disabled
|
|
1120
|
+
}), React__default.createElement(reactstrap.Label, {
|
|
1121
|
+
htmlFor: "core-checkbox-" + name,
|
|
1122
|
+
check: true
|
|
1123
|
+
}, label)));
|
|
1124
|
+
};
|
|
1125
|
+
|
|
1126
|
+
var styles$4 = {"core-radio":"_kvUpe","form-check":"_3ToPe"};
|
|
1127
|
+
|
|
1128
|
+
var CoreRadio = function CoreRadio(props) {
|
|
1129
|
+
var name = props.name,
|
|
1130
|
+
value = props.value,
|
|
1131
|
+
options = props.options,
|
|
1132
|
+
onChange = props.onChange,
|
|
1133
|
+
_props$disabled = props.disabled,
|
|
1134
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
1135
|
+
return React__default.createElement("div", {
|
|
1136
|
+
className: "" + styles$4["core-radio"]
|
|
1137
|
+
}, React__default.createElement(reactstrap.FormGroup, {
|
|
1138
|
+
check: true
|
|
1139
|
+
}, options.map(function (i) {
|
|
1140
|
+
return React__default.createElement("div", {
|
|
1141
|
+
key: i.value
|
|
1142
|
+
}, React__default.createElement(reactstrap.Input, {
|
|
1143
|
+
id: "core-radio-" + i.value,
|
|
1144
|
+
type: "radio",
|
|
1145
|
+
checked: value === i.value,
|
|
1146
|
+
onClick: function onClick() {
|
|
1147
|
+
onChange(name, i.value);
|
|
1148
|
+
},
|
|
1149
|
+
onChange: function onChange() {
|
|
1150
|
+
return;
|
|
1151
|
+
},
|
|
1152
|
+
disabled: disabled
|
|
1153
|
+
}), React__default.createElement(reactstrap.Label, {
|
|
1154
|
+
htmlFor: "core-radio-" + i.value
|
|
1155
|
+
}, i.label));
|
|
1156
|
+
})));
|
|
1157
|
+
};
|
|
1158
|
+
|
|
1159
|
+
var styles$5 = {"core-error":"_1Mmxr"};
|
|
1160
|
+
|
|
1161
|
+
var icons = {
|
|
1162
|
+
ErrorRedIcon: "/images/icons/error_red.svg"
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1165
|
+
var CoreError = function CoreError(props) {
|
|
1166
|
+
var message = props.message;
|
|
1167
|
+
return React__default.createElement("div", {
|
|
1168
|
+
className: "" + styles$5["core-error"]
|
|
1169
|
+
}, React__default.createElement("img", {
|
|
1170
|
+
src: icons.ErrorRedIcon,
|
|
1171
|
+
alt: "error-icon"
|
|
1172
|
+
}), React__default.createElement("p", null, message));
|
|
1173
|
+
};
|
|
1174
|
+
|
|
1175
|
+
var styles$6 = {"core-modal-header":"_2y5ln"};
|
|
1176
|
+
|
|
1177
|
+
var CoreModal = function CoreModal(props) {
|
|
1178
|
+
var open = props.open,
|
|
1179
|
+
onClose = props.onClose,
|
|
1180
|
+
children = props.children,
|
|
1181
|
+
title = props.title;
|
|
1182
|
+
return React__default.createElement(reactstrap.Modal, {
|
|
1183
|
+
isOpen: open,
|
|
1184
|
+
toggle: onClose,
|
|
1185
|
+
centered: true,
|
|
1186
|
+
className: styles$6["core-modal"]
|
|
1187
|
+
}, React__default.createElement(reactstrap.ModalHeader, {
|
|
1188
|
+
toggle: onClose,
|
|
1189
|
+
className: styles$6["core-modal-header"]
|
|
1190
|
+
}, title), React__default.createElement(reactstrap.ModalBody, null, children));
|
|
1191
|
+
};
|
|
1192
|
+
|
|
1193
|
+
var getErrorMessage = function getErrorMessage(error, defaultErrorMessage) {
|
|
1194
|
+
var _error$response, _error$response$data, _error$response2, _error$response3, _error$response3$data;
|
|
1195
|
+
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;
|
|
1196
|
+
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;
|
|
1197
|
+
if (typeof errorMessage === "string") return decodeURIComponent(errorMessage);
|
|
1198
|
+
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);
|
|
1199
|
+
if (typeof errorMessage === "string") return errorMessage;
|
|
1200
|
+
return defaultErrorMessage || DefaultErrorMessage;
|
|
1201
|
+
};
|
|
1202
|
+
|
|
1203
|
+
var customStyles = {
|
|
1204
|
+
control: function control(baseStyles, state) {
|
|
1205
|
+
return _extends({}, baseStyles, {
|
|
1206
|
+
fontSize: "14px",
|
|
1207
|
+
fontWeight: 700,
|
|
1208
|
+
color: styleGlobal.darker,
|
|
1209
|
+
borderColor: state.isFocused || state.hasValue ? styleGlobal.dark : styleGlobal.less_dark,
|
|
1210
|
+
boxShadow: state.isFocused ? "0 0 0 1px " + styleGlobal.dark + "4D" : baseStyles.boxShadow,
|
|
1211
|
+
"&:active": {
|
|
1212
|
+
borderColor: state.isFocused || state.hasValue ? styleGlobal.dark : styleGlobal.less_dark
|
|
1213
|
+
},
|
|
1214
|
+
"&:hover": {
|
|
1215
|
+
borderColor: state.isFocused || state.hasValue ? styleGlobal.dark : styleGlobal.less_dark
|
|
1216
|
+
}
|
|
1217
|
+
});
|
|
1218
|
+
},
|
|
1219
|
+
input: function input(baseStyles, _) {
|
|
1220
|
+
return _extends({}, baseStyles, {
|
|
1221
|
+
fontSize: "14px",
|
|
1222
|
+
fontWeight: 700,
|
|
1223
|
+
color: styleGlobal.darker
|
|
1224
|
+
});
|
|
1225
|
+
},
|
|
1226
|
+
singleValue: function singleValue(baseStyles) {
|
|
1227
|
+
return _extends({}, baseStyles, {
|
|
1228
|
+
fontSize: "14px",
|
|
1229
|
+
fontWeight: 700,
|
|
1230
|
+
color: styleGlobal.darker
|
|
1231
|
+
});
|
|
1232
|
+
},
|
|
1233
|
+
option: function option(baseStyles, state) {
|
|
1234
|
+
return _extends({}, baseStyles, {
|
|
1235
|
+
backgroundColor: state.isSelected ? styleGlobal.dark : state.isFocused ? styleGlobal.light : 'white',
|
|
1236
|
+
"&:active": {
|
|
1237
|
+
backgroundColor: state.isSelected ? styleGlobal.dark : state.isFocused ? styleGlobal.less_dark : baseStyles.backgroundColor
|
|
1238
|
+
}
|
|
1239
|
+
});
|
|
1240
|
+
}
|
|
1241
|
+
};
|
|
1242
|
+
|
|
1243
|
+
var DropdownIndicator = function DropdownIndicator(props) {
|
|
1244
|
+
return React__default.createElement(Select.components.DropdownIndicator, Object.assign({}, props), React__default.createElement(fa.FaCaretDown, {
|
|
1245
|
+
size: 20,
|
|
1246
|
+
color: styleGlobal.darker
|
|
1247
|
+
}));
|
|
1248
|
+
};
|
|
1249
|
+
var CustomOption = function CustomOption(props) {
|
|
1250
|
+
return React__default.createElement(Select.components.Option, Object.assign({}, props), React__default.createElement("div", {
|
|
1251
|
+
style: {
|
|
1252
|
+
fontSize: "14px",
|
|
1253
|
+
fontWeight: 500
|
|
1254
|
+
}
|
|
1255
|
+
}, props.data.label));
|
|
1256
|
+
};
|
|
1257
|
+
|
|
1258
|
+
var _excluded = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
1259
|
+
var CustomSelect = function CustomSelect(_ref) {
|
|
1260
|
+
var isDefault = _ref.isDefault,
|
|
1261
|
+
options = _ref.options,
|
|
1262
|
+
isDisabled = _ref.isDisabled,
|
|
1263
|
+
scrollBottom = _ref.scrollBottom,
|
|
1264
|
+
value = _ref.value,
|
|
1265
|
+
isMulti = _ref.isMulti,
|
|
1266
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
1267
|
+
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
|
1268
|
+
return value.includes(i.value);
|
|
1269
|
+
}) : isMulti ? options === null || options === void 0 ? void 0 : options.filter(function (i) {
|
|
1270
|
+
return i.value == value;
|
|
1271
|
+
}) : options === null || options === void 0 ? void 0 : options.find(function (i) {
|
|
1272
|
+
return i.value == value;
|
|
1273
|
+
});
|
|
1274
|
+
return React__default.createElement(Select__default, Object.assign({
|
|
1275
|
+
isDisabled: isDisabled,
|
|
1276
|
+
options: options,
|
|
1277
|
+
value: !isDefault ? initialValues != null ? initialValues : null : undefined,
|
|
1278
|
+
defaultValue: isDefault ? initialValues : undefined,
|
|
1279
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
|
1280
|
+
isMulti: isMulti,
|
|
1281
|
+
components: {
|
|
1282
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
|
1283
|
+
return null;
|
|
1284
|
+
},
|
|
1285
|
+
DropdownIndicator: DropdownIndicator,
|
|
1286
|
+
Option: CustomOption
|
|
1287
|
+
},
|
|
1288
|
+
styles: customStyles,
|
|
1289
|
+
placeholder: "Select..."
|
|
1290
|
+
}, rest));
|
|
1291
|
+
};
|
|
1292
|
+
|
|
1293
|
+
var _excluded$1 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
1294
|
+
var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
|
1295
|
+
var isDefault = _ref.isDefault,
|
|
1296
|
+
options = _ref.options,
|
|
1297
|
+
isDisabled = _ref.isDisabled,
|
|
1298
|
+
scrollBottom = _ref.scrollBottom,
|
|
1299
|
+
value = _ref.value,
|
|
1300
|
+
isMulti = _ref.isMulti,
|
|
1301
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
1302
|
+
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
|
1303
|
+
return value.includes(i.value);
|
|
1304
|
+
}) : isMulti ? options.filter(function (i) {
|
|
1305
|
+
return i.value == value;
|
|
1306
|
+
}) : options.find(function (i) {
|
|
1307
|
+
return i.value == value;
|
|
1308
|
+
});
|
|
1309
|
+
return React__default.createElement(Select__default, Object.assign({
|
|
1310
|
+
isDisabled: isDisabled,
|
|
1311
|
+
options: options,
|
|
1312
|
+
value: !isDefault ? initialValues : undefined,
|
|
1313
|
+
defaultValue: isDefault ? initialValues : undefined,
|
|
1314
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
|
1315
|
+
isMulti: isMulti,
|
|
1316
|
+
components: {
|
|
1317
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
|
1318
|
+
return null;
|
|
1319
|
+
},
|
|
1320
|
+
DropdownIndicator: DropdownIndicator,
|
|
1321
|
+
Option: CustomOption
|
|
1322
|
+
},
|
|
1323
|
+
styles: customStyles,
|
|
1324
|
+
placeholder: "Select..."
|
|
1325
|
+
}, rest));
|
|
1326
|
+
};
|
|
1327
|
+
|
|
1328
|
+
var _excluded$2 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
1329
|
+
var CustomCreatable = function CustomCreatable(_ref) {
|
|
1330
|
+
var options = _ref.options,
|
|
1331
|
+
isDisabled = _ref.isDisabled,
|
|
1332
|
+
scrollBottom = _ref.scrollBottom,
|
|
1333
|
+
value = _ref.value,
|
|
1334
|
+
isMulti = _ref.isMulti,
|
|
1335
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
1336
|
+
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
|
1337
|
+
return value.includes(i.value);
|
|
1338
|
+
}) : isMulti ? options.filter(function (i) {
|
|
1339
|
+
return i.value == value;
|
|
1340
|
+
}) : options.find(function (i) {
|
|
1341
|
+
return i.value == value;
|
|
1342
|
+
});
|
|
1343
|
+
return React__default.createElement(CreatableSelect, Object.assign({
|
|
1344
|
+
isClearable: true,
|
|
1345
|
+
isDisabled: isDisabled,
|
|
1346
|
+
options: options,
|
|
1347
|
+
value: initialValues,
|
|
1348
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
|
1349
|
+
isMulti: isMulti,
|
|
1350
|
+
components: {
|
|
1351
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
|
1352
|
+
return null;
|
|
1353
|
+
},
|
|
1354
|
+
DropdownIndicator: DropdownIndicator,
|
|
1355
|
+
Option: CustomOption
|
|
1356
|
+
},
|
|
1357
|
+
styles: customStyles,
|
|
1358
|
+
placeholder: "Select..."
|
|
1359
|
+
}, rest));
|
|
1360
|
+
};
|
|
1361
|
+
|
|
1362
|
+
var _excluded$3 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
1363
|
+
var CustomSelectOption = function CustomSelectOption(_ref) {
|
|
1364
|
+
var defaultValue = _ref.defaultValue,
|
|
1365
|
+
options = _ref.options,
|
|
1366
|
+
isDisabled = _ref.isDisabled,
|
|
1367
|
+
scrollBottom = _ref.scrollBottom,
|
|
1368
|
+
value = _ref.value,
|
|
1369
|
+
isMulti = _ref.isMulti,
|
|
1370
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
1371
|
+
var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? options.find(function (option) {
|
|
1372
|
+
return option.value === defaultValue;
|
|
1373
|
+
}) || null : null;
|
|
1374
|
+
return React__default.createElement(Select__default, Object.assign({
|
|
1375
|
+
isDisabled: isDisabled,
|
|
1376
|
+
options: options,
|
|
1377
|
+
value: value,
|
|
1378
|
+
defaultValue: initialValues,
|
|
1379
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
|
1380
|
+
isMulti: isMulti,
|
|
1381
|
+
components: {
|
|
1382
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
|
1383
|
+
return null;
|
|
1384
|
+
},
|
|
1385
|
+
DropdownIndicator: DropdownIndicator,
|
|
1386
|
+
Option: CustomOption
|
|
1387
|
+
},
|
|
1388
|
+
styles: customStyles,
|
|
1389
|
+
placeholder: "Select..."
|
|
1390
|
+
}, rest));
|
|
1391
|
+
};
|
|
1392
|
+
|
|
845
1393
|
var historyCore = history.createBrowserHistory();
|
|
846
1394
|
|
|
847
1395
|
Object.defineProperty(exports, 'ToastContainer', {
|
|
@@ -860,13 +1408,25 @@ exports.ACCESS_TOKEN = ACCESS_TOKEN;
|
|
|
860
1408
|
exports.BASE_URL = BASE_URL;
|
|
861
1409
|
exports.CommonDialog = CommonDialog;
|
|
862
1410
|
exports.ConfirmDialog = ConfirmDialog;
|
|
1411
|
+
exports.CoreButton = CoreButton;
|
|
1412
|
+
exports.CoreCheckbox = CoreInput$1;
|
|
1413
|
+
exports.CoreError = CoreError;
|
|
1414
|
+
exports.CoreInput = CoreInput;
|
|
1415
|
+
exports.CoreModal = CoreModal;
|
|
1416
|
+
exports.CoreRadio = CoreRadio;
|
|
1417
|
+
exports.CoreSelect = CoreSelect;
|
|
1418
|
+
exports.CustomAsyncSelect = CustomAsyncSelect;
|
|
1419
|
+
exports.CustomCreatable = CustomCreatable;
|
|
863
1420
|
exports.CustomPagination = CustomPagination;
|
|
1421
|
+
exports.CustomSelect = CustomSelect;
|
|
1422
|
+
exports.CustomSelectOption = CustomSelectOption;
|
|
864
1423
|
exports.LayoutContext = LayoutContext;
|
|
865
1424
|
exports.Loading = Loading;
|
|
866
1425
|
exports.Login = Login;
|
|
867
1426
|
exports.NotFound = NotFound;
|
|
868
1427
|
exports.api = api$1;
|
|
869
1428
|
exports.apiUpload = apiUpload$1;
|
|
1429
|
+
exports.getErrorMessage = getErrorMessage;
|
|
870
1430
|
exports.historyCore = historyCore;
|
|
871
1431
|
exports.setAlert = setAlert;
|
|
872
1432
|
exports.setLoading = setLoading;
|