acsi-core 0.1.20 → 0.1.22

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/README.md CHANGED
@@ -1,46 +1,46 @@
1
- # Getting Started with Create React App
2
-
3
- This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4
-
5
- ## Available Scripts
6
-
7
- In the project directory, you can run:
8
-
9
- ### `npm start`
10
-
11
- Runs the app in the development mode.\
12
- Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13
-
14
- The page will reload if you make edits.\
15
- You will also see any lint errors in the console.
16
-
17
- ### `npm test`
18
-
19
- Launches the test runner in the interactive watch mode.\
20
- See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21
-
22
- ### `npm run build`
23
-
24
- Builds the app for production to the `build` folder.\
25
- It correctly bundles React in production mode and optimizes the build for the best performance.
26
-
27
- The build is minified and the filenames include the hashes.\
28
- Your app is ready to be deployed!
29
-
30
- See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31
-
32
- ### `npm run eject`
33
-
34
- **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35
-
36
- If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37
-
38
- Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39
-
40
- You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41
-
42
- ## Learn More
43
-
44
- You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45
-
46
- To learn React, check out the [React documentation](https://reactjs.org/).
1
+ # Getting Started with Create React App
2
+
3
+ This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4
+
5
+ ## Available Scripts
6
+
7
+ In the project directory, you can run:
8
+
9
+ ### `npm start`
10
+
11
+ Runs the app in the development mode.\
12
+ Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13
+
14
+ The page will reload if you make edits.\
15
+ You will also see any lint errors in the console.
16
+
17
+ ### `npm test`
18
+
19
+ Launches the test runner in the interactive watch mode.\
20
+ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21
+
22
+ ### `npm run build`
23
+
24
+ Builds the app for production to the `build` folder.\
25
+ It correctly bundles React in production mode and optimizes the build for the best performance.
26
+
27
+ The build is minified and the filenames include the hashes.\
28
+ Your app is ready to be deployed!
29
+
30
+ See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31
+
32
+ ### `npm run eject`
33
+
34
+ **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35
+
36
+ If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37
+
38
+ Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39
+
40
+ You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41
+
42
+ ## Learn More
43
+
44
+ You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45
+
46
+ To learn React, check out the [React documentation](https://reactjs.org/).
@@ -1,12 +1,10 @@
1
1
  import React from "react";
2
2
  interface IProps {
3
- type?: "primary" | "secondary" | "text" | "danger";
3
+ type?: "primary" | "secondary" | "text" | "danger" | "light";
4
4
  children: string | JSX.Element;
5
5
  onClick?: any;
6
6
  icon?: JSX.Element | string;
7
7
  disabled?: boolean;
8
- background?: string;
9
- color?: string;
10
8
  htmlType?: "button" | "submit";
11
9
  }
12
10
  declare const CoreButton: (props: IProps) => React.JSX.Element;
@@ -13,8 +13,10 @@ interface IProps {
13
13
  fontSize?: string;
14
14
  fontWeight?: string;
15
15
  onKeyDown?: (e: any) => void;
16
+ onKeyFocus?: (name: string, value: string) => void;
16
17
  ref?: any;
17
18
  maxLength?: number;
19
+ className?: string;
18
20
  }
19
21
  declare const CoreInput: (props: IProps) => React.JSX.Element;
20
22
  export default CoreInput;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ interface IProps {
3
+ name: string;
4
+ value: string | null | string[];
5
+ onChange: any;
6
+ disabled?: boolean;
7
+ label?: string;
8
+ width?: number;
9
+ placeholder?: string;
10
+ error?: boolean;
11
+ errorMessage?: string;
12
+ type?: "outline" | "no-outline";
13
+ isMulti?: boolean;
14
+ closeMenuOnSelect?: boolean;
15
+ hideSelectedOptions?: boolean;
16
+ }
17
+ declare const CoreSelectModal: (props: IProps) => React.JSX.Element;
18
+ export default CoreSelectModal;
@@ -1,16 +1,16 @@
1
1
  import React from "react";
2
2
  interface IProps {
3
- name: string;
3
+ name?: string;
4
4
  value: string;
5
5
  onChange: (name: string, value: string) => void;
6
6
  placeholder?: string;
7
+ error?: boolean;
7
8
  label?: string;
8
- cols?: number;
9
- rows?: number;
10
- width?: number;
11
- tooltip?: string;
12
9
  isOptional?: boolean;
13
- minHeight?: string;
10
+ tooltip?: string;
11
+ noBorder?: boolean;
12
+ smallHeight?: boolean;
13
+ hideToolbar?: boolean;
14
14
  }
15
15
  declare const CoreTextArea: (props: IProps) => React.JSX.Element;
16
16
  export default CoreTextArea;
package/dist/index.css CHANGED
@@ -161,6 +161,12 @@
161
161
  ._2uYm1 svg, ._2uYm1 i, ._2uYm1 path {
162
162
  fill: #fff; }
163
163
 
164
+ ._wxH5S {
165
+ background-color: #F5F9FA;
166
+ color: #03191F; }
167
+ ._wxH5S svg, ._wxH5S i, ._wxH5S path {
168
+ fill: #03191F; }
169
+
164
170
  ._1WdX2 {
165
171
  display: flex;
166
172
  flex-direction: column; }
@@ -286,34 +292,47 @@
286
292
  font-weight: 600;
287
293
  margin-bottom: 4px; }
288
294
 
289
- ._1b_C3 textarea {
290
- width: 100%;
295
+ ._3TUh3 > div {
296
+ padding: 8px 12px;
291
297
  outline: none;
292
- border-radius: 8px;
293
298
  border: 1px solid #e6e6eb;
294
- padding: 8px 12px;
299
+ border-radius: 8px;
300
+ font-family: Nunito;
295
301
  font-size: 14px;
296
- font-weight: 400;
297
- color: #212126; }
298
- ._1b_C3 textarea:hover {
302
+ color: #212126;
303
+ min-height: 73px; }
304
+ ._3TUh3 > div:hover {
299
305
  background-color: #e5f9ff; }
300
- ._1b_C3 textarea::-moz-placeholder {
301
- color: #a6a6ad; }
302
- ._1b_C3 textarea::placeholder {
303
- color: #a6a6ad; }
306
+ ._3TUh3 > div::before {
307
+ left: 12px !important;
308
+ color: #a6a6ad !important; }
304
309
 
305
- ._1b_C3 ._15n2K {
310
+ ._3TUh3 p {
311
+ margin: 0; }
312
+
313
+ ._3TUh3 ._15n2K {
314
+ display: flex;
315
+ align-items: center;
316
+ gap: 4px;
306
317
  font-size: 14px;
307
318
  font-weight: 400;
308
- margin-bottom: 4px;
309
319
  color: #585869;
310
- display: flex;
311
- align-items: center;
312
- gap: 2px; }
313
- ._1b_C3 ._15n2K ._1fHZB {
320
+ margin-bottom: 8px; }
321
+ ._3TUh3 ._15n2K ._1fHZB {
314
322
  color: #a6a6ad; }
315
- ._1b_C3 ._15n2K ._38AfS {
316
- cursor: pointer; }
323
+ ._3TUh3 ._15n2K ._38AfS {
324
+ cursor: pointer;
325
+ display: flex;
326
+ align-items: center; }
327
+
328
+ ._DaofN > div {
329
+ background-color: #fff5ce; }
330
+
331
+ ._2JOcF > div {
332
+ border: none; }
333
+
334
+ ._1EXev > div {
335
+ min-height: 54px; }
317
336
 
318
337
  ._wyI1K {
319
338
  height: 32px;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  declare const historyCore: import("history").History<unknown>;
2
2
  import { setLoading, setAlert, setUser, setMenuCollapse, setIsRefetchSidebar } from "./redux/commons/action";
3
- import { BASE_URL, ACCESS_TOKEN, DATE_TIME_MIN_VALUE } from "./utils/constants";
3
+ import { BASE_URL, ACCESS_TOKEN, DATE_TIME_MIN_VALUE, OPENSALT_BASE_URL } from "./utils/constants";
4
4
  import Login from "./containers/Login/views/Login";
5
5
  import store from "./store";
6
6
  import NotFound from "./components/Commons/NotFound";
@@ -19,4 +19,4 @@ import CustomSelect from "./components/Selects/CustomSelect";
19
19
  import CustomAsyncSelect from "./components/Selects/CustomAsyncSelect";
20
20
  import CustomCreatable from "./components/Selects/CustomCreatable";
21
21
  import CustomSelectOption from "./components/Selects/CustomSelectOption";
22
- export { setLoading, BASE_URL, ACCESS_TOKEN, DATE_TIME_MIN_VALUE, Login, store, historyCore, setAlert, setUser, setMenuCollapse, setIsRefetchSidebar, Loading, NotFound, LayoutContext, api, apiUpload, ConfirmDialog, CommonDialog, ToastContainer, toast, Role, CustomPagination, useGoogleSignOut, CoreButton, CoreInput, CoreSelect, CoreCheckbox, CoreRadio, CoreError, CoreModal, CoreRange, CoreTextArea, CoreSearch, CoreSelectCompact, CoreInputCompact, CoreTitleInput, getErrorMessage, CustomSelect, CustomAsyncSelect, CustomCreatable, CustomSelectOption };
22
+ export { setLoading, BASE_URL, OPENSALT_BASE_URL, ACCESS_TOKEN, DATE_TIME_MIN_VALUE, Login, store, historyCore, setAlert, setUser, setMenuCollapse, setIsRefetchSidebar, Loading, NotFound, LayoutContext, api, apiUpload, ConfirmDialog, CommonDialog, ToastContainer, toast, Role, CustomPagination, useGoogleSignOut, CoreButton, CoreInput, CoreSelect, CoreCheckbox, CoreRadio, CoreError, CoreModal, CoreRange, CoreTextArea, CoreSearch, CoreSelectCompact, CoreInputCompact, CoreTitleInput, getErrorMessage, CustomSelect, CustomAsyncSelect, CustomCreatable, CustomSelectOption };
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ var material = require('@mui/material');
16
16
  var reactToastify = require('react-toastify');
17
17
  var ReactSelect = require('react-select');
18
18
  var ReactSelect__default = _interopDefault(ReactSelect);
19
+ var tinymceReact = require('@tinymce/tinymce-react');
19
20
  var fa = require('react-icons/fa');
20
21
  var CreatableSelect = _interopDefault(require('react-select/creatable'));
21
22
 
@@ -37,6 +38,7 @@ var PUSHER_CONFIG = {
37
38
  cluster: process.env.REACT_APP_PUSHER_CONFIG_CLUSTER || "",
38
39
  key: process.env.REACT_APP_PUSHER_CONFIG_KEY || ""
39
40
  };
41
+ var OPENSALT_BASE_URL = process.env.REACT_APP_OPENSALT || "";
40
42
  var ACCESS_TOKEN = "ACCESS_TOKEN";
41
43
  var ACADEMY_DOMAIN = "ACADEMY_DOMAIN";
42
44
  var DATE_TIME_MIN_VALUE = "0001-01-01T00:00:00";
@@ -978,7 +980,7 @@ var CustomPagination = function CustomPagination(_ref) {
978
980
  })));
979
981
  };
980
982
 
981
- var styles = {"core-button":"_xvNBN","primary":"_U9Qyp","secondary":"_1VzMy","text":"_pZNuj","danger":"_2uYm1"};
983
+ var styles = {"core-button":"_xvNBN","primary":"_U9Qyp","secondary":"_1VzMy","text":"_pZNuj","danger":"_2uYm1","light":"_wxH5S"};
982
984
 
983
985
  var CoreButton = function CoreButton(props) {
984
986
  var _props$type = props.type,
@@ -1028,7 +1030,9 @@ var CoreInput = function CoreInput(props) {
1028
1030
  fontWeight = props.fontWeight,
1029
1031
  _onKeyDown = props.onKeyDown,
1030
1032
  ref = props.ref,
1031
- maxLength = props.maxLength;
1033
+ maxLength = props.maxLength,
1034
+ className = props.className,
1035
+ onKeyFocus = props.onKeyFocus;
1032
1036
  return React__default.createElement("div", {
1033
1037
  className: styles$1["core-input"] + " " + styles$1[type] + " " + (error ? styles$1["error"] : ""),
1034
1038
  style: {
@@ -1048,9 +1052,13 @@ var CoreInput = function CoreInput(props) {
1048
1052
  placeholder: placeholder,
1049
1053
  onKeyDown: function onKeyDown(e) {
1050
1054
  return _onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(e);
1055
+ },
1056
+ onFocus: function onFocus(e) {
1057
+ return onKeyFocus === null || onKeyFocus === void 0 ? void 0 : onKeyFocus(name, e.target.value);
1051
1058
  }
1052
1059
  }, ref, {
1053
- maxLength: maxLength
1060
+ maxLength: maxLength,
1061
+ className: className
1054
1062
  })), error && React__default.createElement(CoreError, {
1055
1063
  message: errorMessage
1056
1064
  }));
@@ -1349,10 +1357,11 @@ var CoreModal = function CoreModal(props) {
1349
1357
  return React__default.createElement(reactstrap.Modal, {
1350
1358
  isOpen: open,
1351
1359
  toggle: onClose,
1352
- centered: true
1360
+ centered: true,
1361
+ modalClassName: className
1353
1362
  }, React__default.createElement("form", {
1354
1363
  onSubmit: onSubmit ? handleSubmit(onSubmit) : undefined,
1355
- className: styles$6["core-modal-container"] + " " + className
1364
+ className: "" + styles$6["core-modal-container"]
1356
1365
  }, React__default.createElement(reactstrap.ModalHeader, {
1357
1366
  toggle: onClose,
1358
1367
  className: styles$6["core-modal-header"]
@@ -1392,7 +1401,7 @@ var CoreRange = function CoreRange(props) {
1392
1401
  }));
1393
1402
  };
1394
1403
 
1395
- var styles$8 = {"core-text-area":"_1b_C3","label":"_15n2K","optional":"_1fHZB","icon":"_38AfS"};
1404
+ var styles$8 = {"editor":"_3TUh3","label":"_15n2K","optional":"_1fHZB","icon":"_38AfS","error":"_DaofN","no-border":"_2JOcF","small-height":"_1EXev"};
1396
1405
 
1397
1406
  var Search = function Search(props) {
1398
1407
  var _props$size = props.size,
@@ -1480,78 +1489,57 @@ var Info = function Info() {
1480
1489
  };
1481
1490
 
1482
1491
  var CoreTextArea = function CoreTextArea(props) {
1483
- var name = props.name,
1484
- _onChange = props.onChange,
1492
+ var _props$name = props.name,
1493
+ name = _props$name === void 0 ? "" : _props$name,
1485
1494
  value = props.value,
1486
- _props$cols = props.cols,
1487
- cols = _props$cols === void 0 ? 0 : _props$cols,
1488
- label = props.label,
1489
- _props$rows = props.rows,
1490
- rows = _props$rows === void 0 ? 2 : _props$rows,
1495
+ onChange = props.onChange,
1491
1496
  _props$placeholder = props.placeholder,
1492
- placeholder = _props$placeholder === void 0 ? "Type here" : _props$placeholder,
1493
- width = props.width,
1494
- _props$tooltip = props.tooltip,
1495
- tooltip = _props$tooltip === void 0 ? '' : _props$tooltip,
1497
+ placeholder = _props$placeholder === void 0 ? "Type here..." : _props$placeholder,
1498
+ _props$error = props.error,
1499
+ error = _props$error === void 0 ? false : _props$error,
1500
+ label = props.label,
1496
1501
  _props$isOptional = props.isOptional,
1497
1502
  isOptional = _props$isOptional === void 0 ? false : _props$isOptional,
1498
- minHeight = props.minHeight;
1499
- var textareaRef = React.useRef(null);
1503
+ tooltip = props.tooltip,
1504
+ _props$noBorder = props.noBorder,
1505
+ noBorder = _props$noBorder === void 0 ? false : _props$noBorder,
1506
+ _props$smallHeight = props.smallHeight,
1507
+ smallHeight = _props$smallHeight === void 0 ? false : _props$smallHeight,
1508
+ _props$hideToolbar = props.hideToolbar,
1509
+ hideToolbar = _props$hideToolbar === void 0 ? false : _props$hideToolbar;
1500
1510
  var _useState = React.useState(false),
1501
1511
  isOpenTooltip = _useState[0],
1502
1512
  setIsOpenTooltip = _useState[1];
1503
1513
  var toggleTooltip = function toggleTooltip() {
1504
1514
  return setIsOpenTooltip(!isOpenTooltip);
1505
1515
  };
1506
- React.useEffect(function () {
1507
- var _textareaRef$current2;
1508
- if (textareaRef.current) {
1509
- var _textareaRef$current;
1510
- textareaRef.current.style.height = "auto";
1511
- textareaRef.current.style.height = ((_textareaRef$current = textareaRef.current) === null || _textareaRef$current === void 0 ? void 0 : _textareaRef$current.scrollHeight) + "px";
1512
- }
1513
- if (((_textareaRef$current2 = textareaRef.current) === null || _textareaRef$current2 === void 0 ? void 0 : _textareaRef$current2.scrollHeight) == 0 && value.length > 0) {
1514
- setTimeout(function () {
1515
- if (textareaRef.current) {
1516
- var _textareaRef$current3;
1517
- textareaRef.current.style.height = ((_textareaRef$current3 = textareaRef.current) === null || _textareaRef$current3 === void 0 ? void 0 : _textareaRef$current3.scrollHeight) + "px";
1518
- }
1519
- }, 0);
1520
- }
1521
- }, [value]);
1522
1516
  return React__default.createElement("div", {
1523
- className: styles$8["core-text-area"],
1524
- style: {
1525
- width: width != null ? width : "100%"
1526
- }
1527
- }, label && React__default.createElement("div", {
1528
- className: styles$8['label']
1517
+ className: styles$8["editor"] + " " + (error ? styles$8["error"] : "") + " " + (noBorder ? styles$8["no-border"] : "") + " " + (smallHeight ? styles$8["small-height"] : "")
1518
+ }, label && React__default.createElement("span", {
1519
+ className: styles$8["label"]
1529
1520
  }, React__default.createElement("div", {
1530
- className: styles$8['text']
1521
+ className: styles$8["label-content"]
1531
1522
  }, label), isOptional && React__default.createElement("div", {
1532
- className: styles$8['optional']
1533
- }, "(optional)"), React__default.createElement("div", {
1534
- className: styles$8['icon'],
1535
- id: name
1536
- }, React__default.createElement(Info, null)), tooltip ? React__default.createElement(reactstrap.Tooltip, {
1523
+ className: styles$8["optional"]
1524
+ }, "(optional)"), tooltip && React__default.createElement("div", {
1525
+ id: name,
1526
+ className: styles$8["icon"]
1527
+ }, React__default.createElement(Info, null), React__default.createElement(reactstrap.Tooltip, {
1537
1528
  target: name,
1538
1529
  isOpen: isOpenTooltip,
1539
1530
  toggle: toggleTooltip
1540
- }, tooltip) : null), React__default.createElement("textarea", {
1541
- ref: textareaRef,
1542
- placeholder: placeholder,
1543
- style: {
1544
- whiteSpace: "pre-wrap",
1545
- width: "100%",
1546
- minHeight: minHeight ? minHeight : "123px",
1547
- resize: "none",
1548
- overflow: "hidden"
1549
- },
1531
+ }, tooltip))), React__default.createElement(tinymceReact.Editor, {
1532
+ apiKey: "xu4ccvi83xlprx56l8lwwme1q8vstxn0abjzvyqm1t9mabv7",
1550
1533
  value: value,
1551
- cols: cols,
1552
- rows: rows,
1553
- onChange: function onChange(e) {
1554
- return _onChange(name, e.target.value);
1534
+ onEditorChange: function onEditorChange(value) {
1535
+ return onChange(name, value);
1536
+ },
1537
+ init: {
1538
+ menubar: false,
1539
+ inline: true,
1540
+ plugins: ["lists", "table", "link", "image", "advlist"],
1541
+ toolbar: hideToolbar ? '' : "undo redo | styleselect | bold italic forecolor backcolor | \n table link image | \n alignleft aligncenter alignright bullist numlist",
1542
+ placeholder: placeholder
1555
1543
  }
1556
1544
  }));
1557
1545
  };
@@ -2110,6 +2098,7 @@ exports.LayoutContext = LayoutContext;
2110
2098
  exports.Loading = Loading;
2111
2099
  exports.Login = Login;
2112
2100
  exports.NotFound = NotFound;
2101
+ exports.OPENSALT_BASE_URL = OPENSALT_BASE_URL;
2113
2102
  exports.api = api$1;
2114
2103
  exports.apiUpload = apiUpload$1;
2115
2104
  exports.getErrorMessage = getErrorMessage;