acsi-core 0.1.37 → 0.1.39

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.
@@ -14,6 +14,12 @@ interface IProps {
14
14
  rows?: number;
15
15
  width?: number;
16
16
  minHeight?: string;
17
+ className?: string;
18
+ onKeyDown?: (e: any) => void;
19
+ onKeyFocus?: (name: string, value: string) => void;
20
+ autoResize?: boolean;
21
+ onClick?: () => void;
22
+ onBlur?: () => void;
17
23
  }
18
24
  declare const CoreTextArea: (props: IProps) => React.JSX.Element;
19
25
  export default CoreTextArea;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  declare const historyCore: import("history").History<unknown>;
2
- import { setLoading, setAlert, setTenant, setAddTenant, setTeam, setUser, setMenuCollapse, setIsRefetchSidebar } from "./redux/commons/action";
2
+ import { setLoading, setAlert, setTenant, setAddTenant, setTeam, setUser, setMenuCollapse, setIsRefetchSidebar, setLoadingPage } from "./redux/commons/action";
3
3
  import { BASE_URL, ACCESS_TOKEN, DATE_TIME_MIN_VALUE, OPENSALT_BASE_URL, ORGANIZATION_TEAM, ORGANIZATION_TENANT } from "./utils/constants";
4
4
  import Login from "./containers/Login/views/Login";
5
5
  import store from "./store";
@@ -22,4 +22,4 @@ import CustomSelect from "./components/Selects/CustomSelect";
22
22
  import CustomAsyncSelect from "./components/Selects/CustomAsyncSelect";
23
23
  import CustomCreatable from "./components/Selects/CustomCreatable";
24
24
  import CustomSelectOption from "./components/Selects/CustomSelectOption";
25
- export { setLoading, BASE_URL, OPENSALT_BASE_URL, ACCESS_TOKEN, DATE_TIME_MIN_VALUE, ORGANIZATION_TEAM, ORGANIZATION_TENANT, firstCheckToken, Login, getAccessToken, store, historyCore, setAlert, setUser, setTenant, setAddTenant, setTeam, 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, GoogleOAuthProvider };
25
+ export { setLoading, setLoadingPage, BASE_URL, OPENSALT_BASE_URL, ACCESS_TOKEN, DATE_TIME_MIN_VALUE, ORGANIZATION_TEAM, ORGANIZATION_TENANT, firstCheckToken, Login, getAccessToken, store, historyCore, setAlert, setUser, setTenant, setAddTenant, setTeam, 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, GoogleOAuthProvider };
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@ var fa = require('react-icons/fa');
19
19
  var CreatableSelect = _interopDefault(require('react-select/creatable'));
20
20
 
21
21
  var setLoading = toolkit.createAction("common/setLoading");
22
+ var setLoadingPage = toolkit.createAction("common/setLoadingPage");
22
23
  var setAlert = toolkit.createAction("common/setAlert");
23
24
  var setUser = toolkit.createAction("common/setUser");
24
25
  var setLanguage = toolkit.createAction("common/setLanguage");
@@ -551,6 +552,7 @@ function combineReducers(reducers) {
551
552
 
552
553
  var initialState = {
553
554
  isLoading: false,
555
+ isLoadingPage: false,
554
556
  alert: {
555
557
  type: "",
556
558
  message: ""
@@ -563,6 +565,8 @@ var initialState = {
563
565
  var commonReducer = toolkit.createReducer(initialState, function (builder) {
564
566
  builder.addCase(setLoading, function (state, action) {
565
567
  state.isLoading = action.payload;
568
+ }).addCase(setLoadingPage, function (state, action) {
569
+ state.isLoadingPage = action.payload;
566
570
  }).addCase(setAlert, function (state, action) {
567
571
  state.alert = action.payload;
568
572
  }).addCase(setUser, function (state, action) {
@@ -1471,6 +1475,7 @@ var Info = function Info() {
1471
1475
  }));
1472
1476
  };
1473
1477
 
1478
+ var _excluded$1 = ["name", "value", "onChange", "placeholder", "error", "label", "isOptional", "tooltip", "noBorder", "smallHeight", "cols", "rows", "minHeight", "className", "onKeyDown", "onKeyFocus", "autoResize", "width", "onClick", "onBlur"];
1474
1479
  var CoreTextArea = function CoreTextArea(props) {
1475
1480
  var _props$name = props.name,
1476
1481
  name = _props$name === void 0 ? "" : _props$name,
@@ -1490,7 +1495,15 @@ var CoreTextArea = function CoreTextArea(props) {
1490
1495
  smallHeight = _props$smallHeight === void 0 ? false : _props$smallHeight,
1491
1496
  cols = props.cols,
1492
1497
  rows = props.rows,
1493
- minHeight = props.minHeight;
1498
+ minHeight = props.minHeight,
1499
+ className = props.className,
1500
+ _onKeyDown = props.onKeyDown,
1501
+ onKeyFocus = props.onKeyFocus,
1502
+ autoResize = props.autoResize,
1503
+ width = props.width,
1504
+ onClick = props.onClick,
1505
+ onBlur = props.onBlur,
1506
+ rest = _objectWithoutPropertiesLoose(props, _excluded$1);
1494
1507
  var _useState = React.useState(false),
1495
1508
  isOpenTooltip = _useState[0],
1496
1509
  setIsOpenTooltip = _useState[1];
@@ -1498,8 +1511,20 @@ var CoreTextArea = function CoreTextArea(props) {
1498
1511
  return setIsOpenTooltip(!isOpenTooltip);
1499
1512
  };
1500
1513
  var textareaRef = React.useRef(null);
1514
+ React.useEffect(function () {
1515
+ if (autoResize && textareaRef.current) {
1516
+ var el = textareaRef.current;
1517
+ requestAnimationFrame(function () {
1518
+ el.style.height = "auto";
1519
+ el.style.height = el.scrollHeight + "px";
1520
+ });
1521
+ }
1522
+ }, [value, autoResize]);
1501
1523
  return React__default.createElement("div", {
1502
- className: styles$8["editor"] + " " + (error ? styles$8["error"] : "") + " " + (noBorder ? styles$8["no-border"] : "") + " " + (smallHeight ? styles$8["small-height"] : "")
1524
+ className: styles$8["editor"] + " " + (error ? styles$8["error"] : "") + " " + (noBorder ? styles$8["no-border"] : "") + " " + (smallHeight ? styles$8["small-height"] : ""),
1525
+ style: {
1526
+ width: width != null ? width : "100%"
1527
+ }
1503
1528
  }, label && React__default.createElement("span", {
1504
1529
  className: styles$8["label"]
1505
1530
  }, React__default.createElement("div", {
@@ -1513,7 +1538,7 @@ var CoreTextArea = function CoreTextArea(props) {
1513
1538
  target: name,
1514
1539
  isOpen: isOpenTooltip,
1515
1540
  toggle: toggleTooltip
1516
- }, tooltip))), React__default.createElement("textarea", {
1541
+ }, tooltip))), React__default.createElement("textarea", Object.assign({
1517
1542
  ref: textareaRef,
1518
1543
  placeholder: placeholder,
1519
1544
  style: {
@@ -1528,8 +1553,17 @@ var CoreTextArea = function CoreTextArea(props) {
1528
1553
  rows: rows,
1529
1554
  onChange: function onChange(e) {
1530
1555
  return _onChange(name, e.target.value);
1531
- }
1532
- }));
1556
+ },
1557
+ onKeyDown: function onKeyDown(e) {
1558
+ return _onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(e);
1559
+ },
1560
+ onFocus: function onFocus(e) {
1561
+ return onKeyFocus === null || onKeyFocus === void 0 ? void 0 : onKeyFocus(name, e.target.value);
1562
+ },
1563
+ className: className,
1564
+ onClick: onClick,
1565
+ onBlur: onBlur
1566
+ }, rest)));
1533
1567
  };
1534
1568
 
1535
1569
  var styles$9 = {"core-search":"_wyI1K","input":"_9XW-D","clear":"_1nhXy"};
@@ -1759,7 +1793,7 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
1759
1793
 
1760
1794
  var styles$b = {"core-input-compact":"_1qmXW","label":"_1argp","icon":"_3DPRG"};
1761
1795
 
1762
- var _excluded$1 = ["name", "value", "onChange", "disabled", "label", "width", "placeholder", "error", "tooltip", "onKeyDown"];
1796
+ var _excluded$2 = ["name", "value", "onChange", "disabled", "label", "width", "placeholder", "error", "tooltip", "onKeyDown"];
1763
1797
  var CoreInputCompact = function CoreInputCompact(props) {
1764
1798
  var _props$name = props.name,
1765
1799
  name = _props$name === void 0 ? "" : _props$name,
@@ -1774,7 +1808,7 @@ var CoreInputCompact = function CoreInputCompact(props) {
1774
1808
  error = props.error,
1775
1809
  tooltip = props.tooltip,
1776
1810
  _onKeyDown = props.onKeyDown,
1777
- rest = _objectWithoutPropertiesLoose(props, _excluded$1);
1811
+ rest = _objectWithoutPropertiesLoose(props, _excluded$2);
1778
1812
  var _useState = React.useState(false),
1779
1813
  isOpenTooltip = _useState[0],
1780
1814
  setIsOpenTooltip = _useState[1];
@@ -1914,7 +1948,7 @@ var CustomOption = function CustomOption(props) {
1914
1948
  }, props.data.label));
1915
1949
  };
1916
1950
 
1917
- var _excluded$2 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
1951
+ var _excluded$3 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
1918
1952
  var CustomSelect = function CustomSelect(_ref) {
1919
1953
  var isDefault = _ref.isDefault,
1920
1954
  options = _ref.options,
@@ -1922,7 +1956,7 @@ var CustomSelect = function CustomSelect(_ref) {
1922
1956
  scrollBottom = _ref.scrollBottom,
1923
1957
  value = _ref.value,
1924
1958
  isMulti = _ref.isMulti,
1925
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
1959
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
1926
1960
  var initialValues = Array.isArray(value) ? options.filter(function (i) {
1927
1961
  return value.includes(i.value);
1928
1962
  }) : isMulti ? options === null || options === void 0 ? void 0 : options.filter(function (i) {
@@ -1949,7 +1983,7 @@ var CustomSelect = function CustomSelect(_ref) {
1949
1983
  }, rest));
1950
1984
  };
1951
1985
 
1952
- var _excluded$3 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
1986
+ var _excluded$4 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
1953
1987
  var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
1954
1988
  var isDefault = _ref.isDefault,
1955
1989
  options = _ref.options,
@@ -1957,7 +1991,7 @@ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
1957
1991
  scrollBottom = _ref.scrollBottom,
1958
1992
  value = _ref.value,
1959
1993
  isMulti = _ref.isMulti,
1960
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
1994
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
1961
1995
  var initialValues = Array.isArray(value) ? options.filter(function (i) {
1962
1996
  return value.includes(i.value);
1963
1997
  }) : isMulti ? options.filter(function (i) {
@@ -1984,14 +2018,14 @@ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
1984
2018
  }, rest));
1985
2019
  };
1986
2020
 
1987
- var _excluded$4 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
2021
+ var _excluded$5 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
1988
2022
  var CustomCreatable = function CustomCreatable(_ref) {
1989
2023
  var options = _ref.options,
1990
2024
  isDisabled = _ref.isDisabled,
1991
2025
  scrollBottom = _ref.scrollBottom,
1992
2026
  value = _ref.value,
1993
2027
  isMulti = _ref.isMulti,
1994
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
2028
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
1995
2029
  var initialValues = Array.isArray(value) ? options.filter(function (i) {
1996
2030
  return value.includes(i.value);
1997
2031
  }) : isMulti ? options.filter(function (i) {
@@ -2018,7 +2052,7 @@ var CustomCreatable = function CustomCreatable(_ref) {
2018
2052
  }, rest));
2019
2053
  };
2020
2054
 
2021
- var _excluded$5 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
2055
+ var _excluded$6 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
2022
2056
  var CustomSelectOption = function CustomSelectOption(_ref) {
2023
2057
  var defaultValue = _ref.defaultValue,
2024
2058
  options = _ref.options,
@@ -2026,7 +2060,7 @@ var CustomSelectOption = function CustomSelectOption(_ref) {
2026
2060
  scrollBottom = _ref.scrollBottom,
2027
2061
  value = _ref.value,
2028
2062
  isMulti = _ref.isMulti,
2029
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
2063
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
2030
2064
  var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? options.find(function (option) {
2031
2065
  return option.value === defaultValue;
2032
2066
  }) || null : null;
@@ -2109,6 +2143,7 @@ exports.setAddTenant = setAddTenant;
2109
2143
  exports.setAlert = setAlert;
2110
2144
  exports.setIsRefetchSidebar = setIsRefetchSidebar;
2111
2145
  exports.setLoading = setLoading;
2146
+ exports.setLoadingPage = setLoadingPage;
2112
2147
  exports.setMenuCollapse = setMenuCollapse;
2113
2148
  exports.setTeam = setTeam;
2114
2149
  exports.setTenant = setTenant;