acsi-core 0.1.2 → 0.1.4

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.
@@ -6,8 +6,8 @@ import GoogleLogin, { useGoogleLogout } from '@leecheuk/react-google-login';
6
6
  import axios from 'axios';
7
7
  import moment from 'moment';
8
8
  import { Link } from 'react-router-dom';
9
+ import { useDispatch, useSelector } from 'react-redux';
9
10
  import { gapi } from 'gapi-script';
10
- import { useSelector, useDispatch } from 'react-redux';
11
11
  import { Box, Typography } from '@mui/material';
12
12
  export { ToastContainer, toast } from 'react-toastify';
13
13
  import Select, { components } from 'react-select';
@@ -19,6 +19,7 @@ var setAlert = createAction("common/setAlert");
19
19
  var setUser = createAction("common/setUser");
20
20
  var setLanguage = createAction("common/setLanguage");
21
21
  var reset = createAction("common/reset");
22
+ var setMenuCollapse = createAction("common/setMenuCollapse");
22
23
 
23
24
  var GOOGLE_RECAPTCHA_KEY = process.env.REACT_APP_GOOGLE_RECAPTCHA_KEY || "";
24
25
  var GOOGLE_CLIENT_ID = process.env.REACT_APP_GOOGLE_CLIENT_ID || "";
@@ -32,6 +33,7 @@ var PUSHER_CONFIG = {
32
33
  };
33
34
  var ACCESS_TOKEN = "ACCESS_TOKEN";
34
35
  var ACADEMY_DOMAIN = "ACADEMY_DOMAIN";
36
+ var DATE_TIME_MIN_VALUE = "0001-01-01T00:00:00";
35
37
  var DefaultErrorMessage = "an_unexpected_error_has_occurred";
36
38
  var getAccessToken = function getAccessToken() {
37
39
  try {
@@ -47,13 +49,32 @@ var encodeParams = function encodeParams(params) {
47
49
  if (Array.isArray(params[key])) {
48
50
  return params[key].map(function (i) {
49
51
  return encodeURIComponent(key) + "=" + encodeURIComponent(i);
50
- }).join('&');
52
+ }).join("&");
51
53
  }
52
54
  return encodeURIComponent(key) + "=" + encodeURIComponent(params[key]);
53
- }).join('&');
55
+ }).join("&");
56
+ };
57
+ var COLORS = {
58
+ brandBlack: "#101129",
59
+ grayText: "#585869",
60
+ blackText: "#212126",
61
+ lightGray: "#a6a6ad",
62
+ lightGray2: "rgba(0, 0, 0, 0.08)",
63
+ lightGray2Text: "#c6c6cc",
64
+ grayLines: "#e6e6eb",
65
+ lightGrayBg: "#f5f9fa",
66
+ white: "#ffffff",
67
+ brandBlue: "#00afda",
68
+ lightBlue: "#caeffc",
69
+ lightBlueHover: "#e5f9ff",
70
+ brandBlueHover: "#008fb2",
71
+ darkBrandBlue: "#025675",
72
+ darkBrandBlueHover: "#007a99",
73
+ brandAccent: "#ffce09",
74
+ red: "#ce3636"
54
75
  };
55
76
 
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"};
77
+ 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","pr-30":"_2HB5r"};
57
78
 
58
79
  var api = axios.create({
59
80
  baseURL: BASE_URL,
@@ -109,9 +130,10 @@ var itemLogin = ['Seamless lesson planning', 'Flexibility and customization', 'D
109
130
  var BlockLogin = function BlockLogin(_ref) {
110
131
  var onNavigate = _ref.onNavigate,
111
132
  role = _ref.role;
133
+ var dispatch = useDispatch();
112
134
  var onSuccessGoogle = function onSuccessGoogle(res) {
113
135
  try {
114
- var _temp = function () {
136
+ return Promise.resolve(function () {
115
137
  if (!!(res !== null && res !== void 0 && res.accessToken)) {
116
138
  var _res$profileObj = res.profileObj,
117
139
  email = _res$profileObj.email,
@@ -131,14 +153,21 @@ var BlockLogin = function BlockLogin(_ref) {
131
153
  googleId: googleId,
132
154
  role: role
133
155
  };
156
+ dispatch(setLoading(true));
134
157
  return Promise.resolve(apiLoginGoogle(infoLogin)).then(function (res1) {
158
+ var _res1$data;
159
+ if (((_res1$data = res1.data) === null || _res1$data === void 0 ? void 0 : _res1$data.id) == null) {
160
+ dispatch(setLoading(false));
161
+ alert("Please contact admin.");
162
+ return;
163
+ }
135
164
  var tokenJWT = res1.data.token;
136
165
  localStorage.setItem(ACCESS_TOKEN, tokenJWT);
137
166
  onNavigate("/dashboard");
167
+ dispatch(setLoading(false));
138
168
  });
139
169
  }
140
- }();
141
- return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
170
+ }());
142
171
  } catch (e) {
143
172
  return Promise.reject(e);
144
173
  }
@@ -152,7 +181,7 @@ var BlockLogin = function BlockLogin(_ref) {
152
181
  }
153
182
  }, React.createElement(Col, {
154
183
  sm: 12,
155
- lg: 7
184
+ lg: role != "Admin" ? 7 : 12
156
185
  }, React.createElement("div", {
157
186
  className: "" + styleGlobal["box-signin-container"]
158
187
  }, React.createElement("div", {
@@ -170,7 +199,7 @@ var BlockLogin = function BlockLogin(_ref) {
170
199
  className: styleGlobal["box-signin"] + " "
171
200
  }, React.createElement("div", {
172
201
  className: "" + styleGlobal["signin_title"]
173
- }, React.createElement("span", null, "Welcome to Edusfere")), React.createElement("div", {
202
+ }, React.createElement("span", null, "Welcome to Edusfere")), role != "Admin" && React.createElement("div", {
174
203
  className: "" + styleGlobal["signup_link"]
175
204
  }, React.createElement("span", null, "Don't have an account?", " ", React.createElement(Link, {
176
205
  to: "/",
@@ -196,7 +225,7 @@ var BlockLogin = function BlockLogin(_ref) {
196
225
  onSuccess: onSuccessGoogle,
197
226
  onFailure: onFailureGoogle,
198
227
  cookiePolicy: "single_host_origin"
199
- }), React.createElement("span", {
228
+ }), role != "Admin" && React.createElement(React.Fragment, null, React.createElement("span", {
200
229
  className: "" + styleGlobal["box-field"]
201
230
  }, "OR"), React.createElement(Form, null, React.createElement("div", {
202
231
  className: "" + styleGlobal["box-input"]
@@ -211,17 +240,17 @@ var BlockLogin = function BlockLogin(_ref) {
211
240
  height: 20,
212
241
  alt: "Email sign-in",
213
242
  src: "/images/icons/Login_icon.png"
214
- }), "Sign in with Email"))), React.createElement("div", {
243
+ }), "Sign in with Email")))), React.createElement("div", {
215
244
  className: styleGlobal["box-signin-text"] + " "
216
245
  }, React.createElement("span", {
217
246
  style: {
218
247
  fontSize: "13px",
219
248
  color: "#A6A6AD"
220
249
  }
221
- }, "By signing in, you agree to our Terms & Privacy Policy")))), React.createElement(Col, {
250
+ }, "By signing in, you agree to our Terms & Privacy Policy")))), role != "Admin" && React.createElement(Col, {
222
251
  sm: 12,
223
252
  lg: 5,
224
- className: "d-none d-lg-block"
253
+ className: "d-none d-lg-block " + styleGlobal["pr-30"]
225
254
  }, React.createElement("div", {
226
255
  className: "" + styleGlobal["box-right"],
227
256
  style: {
@@ -525,7 +554,8 @@ var initialState = {
525
554
  message: ""
526
555
  },
527
556
  user: null,
528
- academy: null
557
+ academy: null,
558
+ menuCollapse: false
529
559
  };
530
560
  var commonReducer = createReducer(initialState, function (builder) {
531
561
  builder.addCase(setLoading, function (state, action) {
@@ -538,6 +568,8 @@ var commonReducer = createReducer(initialState, function (builder) {
538
568
  state.language = action.payload;
539
569
  }).addCase(reset, function (_state, _action) {
540
570
  return initialState;
571
+ }).addCase(setMenuCollapse, function (state, action) {
572
+ state.menuCollapse = action.payload;
541
573
  });
542
574
  });
543
575
 
@@ -947,40 +979,69 @@ var CoreButton = function CoreButton(props) {
947
979
  onClick = props.onClick,
948
980
  icon = props.icon,
949
981
  _props$disabled = props.disabled,
950
- disabled = _props$disabled === void 0 ? false : _props$disabled;
982
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
983
+ _props$htmlType = props.htmlType,
984
+ htmlType = _props$htmlType === void 0 ? "button" : _props$htmlType;
951
985
  return React.createElement("button", {
952
986
  className: styles["core-button"] + " " + styles[type],
953
987
  onClick: onClick,
954
- disabled: disabled
988
+ disabled: disabled,
989
+ type: htmlType
955
990
  }, icon && icon, children);
956
991
  };
957
992
 
958
- var styles$1 = {"core-input":"_1WdX2","error":"_n7n3Q"};
993
+ var styles$1 = {"core-input":"_1WdX2","outline":"_3X2RJ","no-outline":"_bVYtv","error":"_n7n3Q"};
994
+
995
+ var styles$2 = {"core-error":"_1Mmxr"};
996
+
997
+ var CoreError = function CoreError(props) {
998
+ var message = props.message;
999
+ return React.createElement("div", {
1000
+ className: "" + styles$2["core-error"]
1001
+ }, React.createElement("p", null, message));
1002
+ };
959
1003
 
960
1004
  var CoreInput = function CoreInput(props) {
961
1005
  var name = props.name,
962
1006
  value = props.value,
963
1007
  _onChange = props.onChange,
1008
+ _props$type = props.type,
1009
+ type = _props$type === void 0 ? "outline" : _props$type,
964
1010
  _props$disabled = props.disabled,
965
1011
  disabled = _props$disabled === void 0 ? false : _props$disabled,
966
1012
  label = props.label,
967
1013
  width = props.width,
968
1014
  _props$placeholder = props.placeholder,
969
- placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
970
- error = props.error;
1015
+ placeholder = _props$placeholder === void 0 ? "Type here" : _props$placeholder,
1016
+ error = props.error,
1017
+ _props$errorMessage = props.errorMessage,
1018
+ errorMessage = _props$errorMessage === void 0 ? "" : _props$errorMessage,
1019
+ fontSize = props.fontSize,
1020
+ fontWeight = props.fontWeight,
1021
+ _onKeyDown = props.onKeyDown,
1022
+ ref = props.ref;
971
1023
  return React.createElement("div", {
972
- className: styles$1["core-input"] + " " + (error ? styles$1["error"] : ""),
1024
+ className: styles$1["core-input"] + " " + styles$1[type] + " " + (error ? styles$1["error"] : ""),
973
1025
  style: {
974
1026
  width: width != null ? width : "100%"
975
1027
  }
976
- }, label && React.createElement("label", null, label), React.createElement("input", {
1028
+ }, label && React.createElement("label", null, label), React.createElement("input", Object.assign({
1029
+ style: {
1030
+ fontSize: fontSize,
1031
+ fontWeight: fontWeight
1032
+ },
977
1033
  name: name,
978
1034
  value: value,
979
1035
  onChange: function onChange(e) {
980
1036
  return _onChange(name, e.target.value);
981
1037
  },
982
1038
  disabled: disabled,
983
- placeholder: placeholder
1039
+ placeholder: placeholder,
1040
+ onKeyDown: function onKeyDown(e) {
1041
+ return _onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(e);
1042
+ }
1043
+ }, ref)), error && React.createElement(CoreError, {
1044
+ message: errorMessage
984
1045
  }));
985
1046
  };
986
1047
 
@@ -1003,95 +1064,206 @@ function _objectWithoutPropertiesLoose(r, e) {
1003
1064
  return t;
1004
1065
  }
1005
1066
 
1006
- var styles$2 = {"core-select":"_2sg12"};
1067
+ var styles$3 = {"core-select":"_2sg12","label":"_1-XBo"};
1007
1068
 
1069
+ var Option = function Option(props) {
1070
+ return React.createElement("div", null, React.createElement(components.Option, Object.assign({}, props), React.createElement(CoreInput$1, {
1071
+ checked: props.isSelected,
1072
+ onChange: function onChange() {
1073
+ return null;
1074
+ },
1075
+ name: "",
1076
+ label: props.label
1077
+ })));
1078
+ };
1008
1079
  var CoreSelect = function CoreSelect(props) {
1009
- var _options$find;
1010
1080
  var name = props.name,
1011
1081
  options = props.options,
1012
1082
  value = props.value,
1013
- _onChange = props.onChange,
1083
+ onChange = props.onChange,
1014
1084
  _props$disabled = props.disabled,
1015
1085
  disabled = _props$disabled === void 0 ? false : _props$disabled,
1016
1086
  label = props.label,
1017
1087
  width = props.width,
1018
1088
  _props$placeholder = props.placeholder,
1019
- placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
1020
- error = props.error;
1089
+ placeholder = _props$placeholder === void 0 ? "Select" : _props$placeholder,
1090
+ error = props.error,
1091
+ _props$errorMessage = props.errorMessage,
1092
+ errorMessage = _props$errorMessage === void 0 ? "" : _props$errorMessage,
1093
+ _props$type = props.type,
1094
+ type = _props$type === void 0 ? "outline" : _props$type,
1095
+ _props$isMulti = props.isMulti,
1096
+ isMulti = _props$isMulti === void 0 ? false : _props$isMulti,
1097
+ _props$closeMenuOnSel = props.closeMenuOnSelect,
1098
+ closeMenuOnSelect = _props$closeMenuOnSel === void 0 ? true : _props$closeMenuOnSel,
1099
+ _props$hideSelectedOp = props.hideSelectedOptions,
1100
+ hideSelectedOptions = _props$hideSelectedOp === void 0 ? true : _props$hideSelectedOp;
1101
+ var handleChange = function handleChange(e) {
1102
+ var newValue = isMulti ? e.map(function (item) {
1103
+ return item.value;
1104
+ }) : e === null || e === void 0 ? void 0 : e.value;
1105
+ onChange(name, newValue);
1106
+ };
1107
+ var controlStyle = function controlStyle(base, state) {
1108
+ var styles = _extends({}, base, {
1109
+ fontSize: "14px",
1110
+ fontWeight: "400",
1111
+ padding: "0 4px",
1112
+ borderRadius: "8px",
1113
+ backgroundColor: state.isDisabled ? COLORS.lightGrayBg : COLORS.white,
1114
+ border: state.isFocused ? "2px solid " + (!error ? COLORS.brandBlue : COLORS.red) : "1px solid " + (!error ? COLORS.grayLines : COLORS.red),
1115
+ height: isMulti ? undefined : "32px",
1116
+ minHeight: 0,
1117
+ boxShadow: "none"
1118
+ });
1119
+ switch (type) {
1120
+ case "outline":
1121
+ styles.overflow = "hidden";
1122
+ styles[":hover"] = {
1123
+ backgroundColor: COLORS.lightBlueHover
1124
+ };
1125
+ break;
1126
+ case "no-outline":
1127
+ styles.border = "none";
1128
+ styles.padding = 0;
1129
+ styles["&>div"] = {
1130
+ padding: 0
1131
+ };
1132
+ break;
1133
+ }
1134
+ return styles;
1135
+ };
1136
+ var inputStyles = function inputStyles(base) {
1137
+ var styles = _extends({}, base, {
1138
+ margin: "0",
1139
+ padding: "0",
1140
+ color: "inherit"
1141
+ });
1142
+ return styles;
1143
+ };
1144
+ var placeholderStyles = function placeholderStyles(base) {
1145
+ var styles = _extends({}, base, {
1146
+ color: COLORS.lightGray,
1147
+ position: "relative",
1148
+ top: "-4px"
1149
+ });
1150
+ return styles;
1151
+ };
1152
+ var dropdownIndicatorStyles = function dropdownIndicatorStyles(base) {
1153
+ var styles = _extends({}, base, {
1154
+ position: "relative",
1155
+ top: "-4px",
1156
+ padding: "8px 0"
1157
+ });
1158
+ return styles;
1159
+ };
1160
+ var valueContainerStyles = function valueContainerStyles(base) {
1161
+ var styles = _extends({}, base, {
1162
+ height: isMulti ? undefined : "32px"
1163
+ });
1164
+ return styles;
1165
+ };
1166
+ var singleValueStyles = function singleValueStyles(base) {
1167
+ var styles = _extends({}, base, {
1168
+ position: "relative",
1169
+ top: "-4px"
1170
+ });
1171
+ return styles;
1172
+ };
1173
+ var optionStyles = function optionStyles(base, state) {
1174
+ var styles = _extends({}, base, {
1175
+ padding: "8px",
1176
+ borderRadius: "8px",
1177
+ cursor: "pointer",
1178
+ fontSize: "14px",
1179
+ fontWeight: 400,
1180
+ backgroundColor: state.isSelected ? COLORS.lightBlueHover : "transparent",
1181
+ "&:hover": {
1182
+ backgroundColor: COLORS.lightBlueHover
1183
+ }
1184
+ });
1185
+ return styles;
1186
+ };
1187
+ var indicatorsContainerStyles = function indicatorsContainerStyles(base) {
1188
+ var styles = _extends({}, base, {
1189
+ display: type === "no-outline" ? "none" : "block"
1190
+ });
1191
+ return styles;
1192
+ };
1193
+ var multiValueStyles = function multiValueStyles(base) {
1194
+ var styles = _extends({}, base, {
1195
+ backgroundColor: COLORS.lightBlue,
1196
+ borderRadius: "4px",
1197
+ padding: "2px 8px",
1198
+ display: "flex",
1199
+ alignItems: "center",
1200
+ fontSize: "13px",
1201
+ color: COLORS.blackText
1202
+ });
1203
+ return styles;
1204
+ };
1205
+ var multiValueRemoveStyles = function multiValueRemoveStyles(base) {
1206
+ var styles = _extends({}, base, {
1207
+ color: COLORS.lightGray,
1208
+ cursor: "pointer"
1209
+ });
1210
+ return styles;
1211
+ };
1212
+ var multiValueLabelStyles = function multiValueLabelStyles(base) {
1213
+ var styles = _extends({}, base, {
1214
+ color: COLORS.blackText,
1215
+ fontWeight: "400",
1216
+ fontSize: "13px",
1217
+ padding: 0
1218
+ });
1219
+ return styles;
1220
+ };
1021
1221
  return React.createElement("div", {
1022
- className: "" + styles$2["core-select"],
1222
+ className: "" + styles$3["core-select"],
1023
1223
  style: {
1024
1224
  width: width != null ? width : "100%"
1025
1225
  }
1026
- }, label && React.createElement("label", null, label), React.createElement(Select, {
1226
+ }, label && React.createElement("span", {
1227
+ className: styles$3["label"]
1228
+ }, label), React.createElement(Select, {
1027
1229
  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
- },
1230
+ value: options.filter(function (i) {
1231
+ return value && (isMulti ? value.includes(i.value) : i.value === value);
1232
+ }),
1233
+ onChange: handleChange,
1034
1234
  placeholder: placeholder,
1035
1235
  isDisabled: disabled,
1236
+ isMulti: isMulti,
1237
+ closeMenuOnSelect: closeMenuOnSelect,
1238
+ hideSelectedOptions: hideSelectedOptions,
1036
1239
  options: options,
1240
+ components: isMulti ? {
1241
+ Option: Option
1242
+ } : undefined,
1037
1243
  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
- },
1244
+ control: controlStyle,
1245
+ input: inputStyles,
1246
+ placeholder: placeholderStyles,
1247
+ dropdownIndicator: dropdownIndicatorStyles,
1074
1248
  indicatorSeparator: function indicatorSeparator() {
1075
1249
  return {
1076
1250
  display: "none"
1077
1251
  };
1078
1252
  },
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
- }
1253
+ indicatorsContainer: indicatorsContainerStyles,
1254
+ valueContainer: valueContainerStyles,
1255
+ singleValue: singleValueStyles,
1256
+ option: optionStyles,
1257
+ multiValue: multiValueStyles,
1258
+ multiValueRemove: multiValueRemoveStyles,
1259
+ multiValueLabel: multiValueLabelStyles
1090
1260
  }
1261
+ }), error && React.createElement(CoreError, {
1262
+ message: errorMessage
1091
1263
  }));
1092
1264
  };
1093
1265
 
1094
- var styles$3 = {"core-checkbox":"_3HY4f"};
1266
+ var styles$4 = {"core-checkbox":"_3HY4f"};
1095
1267
 
1096
1268
  var CoreInput$1 = function CoreInput(props) {
1097
1269
  var name = props.name,
@@ -1101,7 +1273,7 @@ var CoreInput$1 = function CoreInput(props) {
1101
1273
  disabled = _props$disabled === void 0 ? false : _props$disabled,
1102
1274
  label = props.label;
1103
1275
  return React.createElement("div", {
1104
- className: "" + styles$3["core-checkbox"]
1276
+ className: "" + styles$4["core-checkbox"]
1105
1277
  }, React.createElement(FormGroup, {
1106
1278
  check: true,
1107
1279
  inline: true
@@ -1120,7 +1292,7 @@ var CoreInput$1 = function CoreInput(props) {
1120
1292
  }, label)));
1121
1293
  };
1122
1294
 
1123
- var styles$4 = {"core-radio":"_kvUpe","form-check":"_3ToPe"};
1295
+ var styles$5 = {"core-radio":"_kvUpe","form-check":"_3ToPe"};
1124
1296
 
1125
1297
  var CoreRadio = function CoreRadio(props) {
1126
1298
  var name = props.name,
@@ -1130,7 +1302,7 @@ var CoreRadio = function CoreRadio(props) {
1130
1302
  _props$disabled = props.disabled,
1131
1303
  disabled = _props$disabled === void 0 ? false : _props$disabled;
1132
1304
  return React.createElement("div", {
1133
- className: "" + styles$4["core-radio"]
1305
+ className: "" + styles$5["core-radio"]
1134
1306
  }, React.createElement(FormGroup, {
1135
1307
  check: true
1136
1308
  }, options.map(function (i) {
@@ -1153,29 +1325,14 @@ var CoreRadio = function CoreRadio(props) {
1153
1325
  })));
1154
1326
  };
1155
1327
 
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
1328
  var styles$6 = {"core-modal-header":"_2y5ln"};
1173
1329
 
1174
1330
  var CoreModal = function CoreModal(props) {
1175
1331
  var open = props.open,
1176
1332
  onClose = props.onClose,
1177
1333
  children = props.children,
1178
- title = props.title;
1334
+ title = props.title,
1335
+ footer = props.footer;
1179
1336
  return React.createElement(Modal, {
1180
1337
  isOpen: open,
1181
1338
  toggle: onClose,
@@ -1184,7 +1341,66 @@ var CoreModal = function CoreModal(props) {
1184
1341
  }, React.createElement(ModalHeader, {
1185
1342
  toggle: onClose,
1186
1343
  className: styles$6["core-modal-header"]
1187
- }, title), React.createElement(ModalBody, null, children));
1344
+ }, title), React.createElement(ModalBody, null, children), footer && React.createElement(ModalFooter, null, footer));
1345
+ };
1346
+
1347
+ var styles$7 = {"core-range":"_1dzD7"};
1348
+
1349
+ var CoreRange = function CoreRange(props) {
1350
+ var name = props.name,
1351
+ value = props.value,
1352
+ _onChange = props.onChange,
1353
+ label = props.label,
1354
+ width = props.width,
1355
+ min = props.min,
1356
+ max = props.max,
1357
+ step = props.step;
1358
+ return React.createElement("div", {
1359
+ className: "" + styles$7["core-range"],
1360
+ style: {
1361
+ width: width != null ? width : "100%"
1362
+ }
1363
+ }, label && React.createElement("label", null, label), React.createElement("input", {
1364
+ type: "range",
1365
+ name: name,
1366
+ value: value,
1367
+ onChange: function onChange(e) {
1368
+ return _onChange(name, +e.target.value);
1369
+ },
1370
+ min: min,
1371
+ max: max,
1372
+ step: step
1373
+ }));
1374
+ };
1375
+
1376
+ var styles$8 = {"core-text-area":"_1b_C3"};
1377
+
1378
+ var CoreTextArea = function CoreTextArea(props) {
1379
+ var name = props.name,
1380
+ _onChange = props.onChange,
1381
+ value = props.value,
1382
+ _props$cols = props.cols,
1383
+ cols = _props$cols === void 0 ? 0 : _props$cols,
1384
+ label = props.label,
1385
+ _props$rows = props.rows,
1386
+ rows = _props$rows === void 0 ? 2 : _props$rows,
1387
+ _props$placeholder = props.placeholder,
1388
+ placeholder = _props$placeholder === void 0 ? "Type here" : _props$placeholder,
1389
+ width = props.width;
1390
+ return React.createElement("div", {
1391
+ className: styles$8["core-text-area"],
1392
+ style: {
1393
+ width: width != null ? width : "100%"
1394
+ }
1395
+ }, label && React.createElement("label", null, label), React.createElement("textarea", {
1396
+ placeholder: placeholder,
1397
+ value: value,
1398
+ cols: cols,
1399
+ rows: rows,
1400
+ onChange: function onChange(e) {
1401
+ return _onChange(name, e.target.value);
1402
+ }
1403
+ }));
1188
1404
  };
1189
1405
 
1190
1406
  var getErrorMessage = function getErrorMessage(error, defaultErrorMessage) {
@@ -1389,5 +1605,5 @@ var CustomSelectOption = function CustomSelectOption(_ref) {
1389
1605
 
1390
1606
  var historyCore = createBrowserHistory();
1391
1607
 
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 };
1608
+ export { ACCESS_TOKEN, BASE_URL, CommonDialog, ConfirmDialog, CoreButton, CoreInput$1 as CoreCheckbox, CoreError, CoreInput, CoreModal, CoreRadio, CoreRange, CoreSelect, CoreTextArea, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_TIME_MIN_VALUE, LayoutContext, Loading, Login, NotFound, Role, api$1 as api, apiUpload$1 as apiUpload, getErrorMessage, historyCore, setAlert, setLoading, setMenuCollapse, setUser, store, useGoogleSignOut };
1393
1609
  //# sourceMappingURL=index.modern.js.map