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