acsi-core 0.1.36 → 0.1.38
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/CoreTextArea/index.d.ts +6 -0
- package/dist/index.js +48 -36
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +48 -36
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
|
@@ -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.js
CHANGED
|
@@ -682,9 +682,6 @@ var apiUpload$1 = axios.create({
|
|
|
682
682
|
});
|
|
683
683
|
|
|
684
684
|
var AUTH_URL = BASE_URL + "/api/auth";
|
|
685
|
-
var getInfo = function getInfo(role) {
|
|
686
|
-
return api$1.get(BASE_URL + "/api/Auth/info?role=" + role);
|
|
687
|
-
};
|
|
688
685
|
var checkToken = function checkToken(token) {
|
|
689
686
|
return api$1.post(AUTH_URL + "/checktoken", {
|
|
690
687
|
token: token
|
|
@@ -783,34 +780,19 @@ var useGoogleSignOut = function useGoogleSignOut(props) {
|
|
|
783
780
|
|
|
784
781
|
var LayoutContext = function LayoutContext(_ref) {
|
|
785
782
|
var children = _ref.children,
|
|
786
|
-
role = _ref.role,
|
|
787
783
|
onNavigate = _ref.onNavigate;
|
|
788
784
|
var _useGoogleSignOut = useGoogleSignOut({
|
|
789
785
|
onNavigate: onNavigate
|
|
790
786
|
}),
|
|
791
787
|
handleSignOut = _useGoogleSignOut.handleSignOut;
|
|
792
|
-
var dispatch = reactRedux.useDispatch();
|
|
793
788
|
var resetAuth = function resetAuth() {
|
|
794
789
|
handleSignOut();
|
|
795
790
|
};
|
|
796
791
|
var loadInfo = function loadInfo() {
|
|
797
792
|
try {
|
|
798
|
-
var
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
var token = getAccessToken();
|
|
802
|
-
if (!token) {
|
|
803
|
-
resetAuth();
|
|
804
|
-
return Promise.resolve();
|
|
805
|
-
}
|
|
806
|
-
dispatch(setLoading(true));
|
|
807
|
-
var _temp = _catch(function () {
|
|
808
|
-
return Promise.resolve(getInfo(role)).then(function (info) {
|
|
809
|
-
if (!info) {}
|
|
810
|
-
dispatch(setUser(info.data));
|
|
811
|
-
});
|
|
812
|
-
}, function () {});
|
|
813
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
|
793
|
+
var token = firstCheckToken();
|
|
794
|
+
!token && resetAuth();
|
|
795
|
+
return Promise.resolve();
|
|
814
796
|
} catch (e) {
|
|
815
797
|
return Promise.reject(e);
|
|
816
798
|
}
|
|
@@ -1489,6 +1471,7 @@ var Info = function Info() {
|
|
|
1489
1471
|
}));
|
|
1490
1472
|
};
|
|
1491
1473
|
|
|
1474
|
+
var _excluded$1 = ["name", "value", "onChange", "placeholder", "error", "label", "isOptional", "tooltip", "noBorder", "smallHeight", "cols", "rows", "minHeight", "className", "onKeyDown", "onKeyFocus", "autoResize", "width", "onClick", "onBlur"];
|
|
1492
1475
|
var CoreTextArea = function CoreTextArea(props) {
|
|
1493
1476
|
var _props$name = props.name,
|
|
1494
1477
|
name = _props$name === void 0 ? "" : _props$name,
|
|
@@ -1508,7 +1491,15 @@ var CoreTextArea = function CoreTextArea(props) {
|
|
|
1508
1491
|
smallHeight = _props$smallHeight === void 0 ? false : _props$smallHeight,
|
|
1509
1492
|
cols = props.cols,
|
|
1510
1493
|
rows = props.rows,
|
|
1511
|
-
minHeight = props.minHeight
|
|
1494
|
+
minHeight = props.minHeight,
|
|
1495
|
+
className = props.className,
|
|
1496
|
+
_onKeyDown = props.onKeyDown,
|
|
1497
|
+
onKeyFocus = props.onKeyFocus,
|
|
1498
|
+
autoResize = props.autoResize,
|
|
1499
|
+
width = props.width,
|
|
1500
|
+
onClick = props.onClick,
|
|
1501
|
+
onBlur = props.onBlur,
|
|
1502
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded$1);
|
|
1512
1503
|
var _useState = React.useState(false),
|
|
1513
1504
|
isOpenTooltip = _useState[0],
|
|
1514
1505
|
setIsOpenTooltip = _useState[1];
|
|
@@ -1516,8 +1507,20 @@ var CoreTextArea = function CoreTextArea(props) {
|
|
|
1516
1507
|
return setIsOpenTooltip(!isOpenTooltip);
|
|
1517
1508
|
};
|
|
1518
1509
|
var textareaRef = React.useRef(null);
|
|
1510
|
+
React.useEffect(function () {
|
|
1511
|
+
if (autoResize && textareaRef.current) {
|
|
1512
|
+
var el = textareaRef.current;
|
|
1513
|
+
requestAnimationFrame(function () {
|
|
1514
|
+
el.style.height = "auto";
|
|
1515
|
+
el.style.height = el.scrollHeight + "px";
|
|
1516
|
+
});
|
|
1517
|
+
}
|
|
1518
|
+
}, [value, autoResize]);
|
|
1519
1519
|
return React__default.createElement("div", {
|
|
1520
|
-
className: styles$8["editor"] + " " + (error ? styles$8["error"] : "") + " " + (noBorder ? styles$8["no-border"] : "") + " " + (smallHeight ? styles$8["small-height"] : "")
|
|
1520
|
+
className: styles$8["editor"] + " " + (error ? styles$8["error"] : "") + " " + (noBorder ? styles$8["no-border"] : "") + " " + (smallHeight ? styles$8["small-height"] : ""),
|
|
1521
|
+
style: {
|
|
1522
|
+
width: width != null ? width : "100%"
|
|
1523
|
+
}
|
|
1521
1524
|
}, label && React__default.createElement("span", {
|
|
1522
1525
|
className: styles$8["label"]
|
|
1523
1526
|
}, React__default.createElement("div", {
|
|
@@ -1531,7 +1534,7 @@ var CoreTextArea = function CoreTextArea(props) {
|
|
|
1531
1534
|
target: name,
|
|
1532
1535
|
isOpen: isOpenTooltip,
|
|
1533
1536
|
toggle: toggleTooltip
|
|
1534
|
-
}, tooltip))), React__default.createElement("textarea", {
|
|
1537
|
+
}, tooltip))), React__default.createElement("textarea", Object.assign({
|
|
1535
1538
|
ref: textareaRef,
|
|
1536
1539
|
placeholder: placeholder,
|
|
1537
1540
|
style: {
|
|
@@ -1546,8 +1549,17 @@ var CoreTextArea = function CoreTextArea(props) {
|
|
|
1546
1549
|
rows: rows,
|
|
1547
1550
|
onChange: function onChange(e) {
|
|
1548
1551
|
return _onChange(name, e.target.value);
|
|
1549
|
-
}
|
|
1550
|
-
|
|
1552
|
+
},
|
|
1553
|
+
onKeyDown: function onKeyDown(e) {
|
|
1554
|
+
return _onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(e);
|
|
1555
|
+
},
|
|
1556
|
+
onFocus: function onFocus(e) {
|
|
1557
|
+
return onKeyFocus === null || onKeyFocus === void 0 ? void 0 : onKeyFocus(name, e.target.value);
|
|
1558
|
+
},
|
|
1559
|
+
className: className,
|
|
1560
|
+
onClick: onClick,
|
|
1561
|
+
onBlur: onBlur
|
|
1562
|
+
}, rest)));
|
|
1551
1563
|
};
|
|
1552
1564
|
|
|
1553
1565
|
var styles$9 = {"core-search":"_wyI1K","input":"_9XW-D","clear":"_1nhXy"};
|
|
@@ -1777,7 +1789,7 @@ var CoreSelectCompact = function CoreSelectCompact(props) {
|
|
|
1777
1789
|
|
|
1778
1790
|
var styles$b = {"core-input-compact":"_1qmXW","label":"_1argp","icon":"_3DPRG"};
|
|
1779
1791
|
|
|
1780
|
-
var _excluded$
|
|
1792
|
+
var _excluded$2 = ["name", "value", "onChange", "disabled", "label", "width", "placeholder", "error", "tooltip", "onKeyDown"];
|
|
1781
1793
|
var CoreInputCompact = function CoreInputCompact(props) {
|
|
1782
1794
|
var _props$name = props.name,
|
|
1783
1795
|
name = _props$name === void 0 ? "" : _props$name,
|
|
@@ -1792,7 +1804,7 @@ var CoreInputCompact = function CoreInputCompact(props) {
|
|
|
1792
1804
|
error = props.error,
|
|
1793
1805
|
tooltip = props.tooltip,
|
|
1794
1806
|
_onKeyDown = props.onKeyDown,
|
|
1795
|
-
rest = _objectWithoutPropertiesLoose(props, _excluded$
|
|
1807
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded$2);
|
|
1796
1808
|
var _useState = React.useState(false),
|
|
1797
1809
|
isOpenTooltip = _useState[0],
|
|
1798
1810
|
setIsOpenTooltip = _useState[1];
|
|
@@ -1932,7 +1944,7 @@ var CustomOption = function CustomOption(props) {
|
|
|
1932
1944
|
}, props.data.label));
|
|
1933
1945
|
};
|
|
1934
1946
|
|
|
1935
|
-
var _excluded$
|
|
1947
|
+
var _excluded$3 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
1936
1948
|
var CustomSelect = function CustomSelect(_ref) {
|
|
1937
1949
|
var isDefault = _ref.isDefault,
|
|
1938
1950
|
options = _ref.options,
|
|
@@ -1940,7 +1952,7 @@ var CustomSelect = function CustomSelect(_ref) {
|
|
|
1940
1952
|
scrollBottom = _ref.scrollBottom,
|
|
1941
1953
|
value = _ref.value,
|
|
1942
1954
|
isMulti = _ref.isMulti,
|
|
1943
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1955
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
1944
1956
|
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
|
1945
1957
|
return value.includes(i.value);
|
|
1946
1958
|
}) : isMulti ? options === null || options === void 0 ? void 0 : options.filter(function (i) {
|
|
@@ -1967,7 +1979,7 @@ var CustomSelect = function CustomSelect(_ref) {
|
|
|
1967
1979
|
}, rest));
|
|
1968
1980
|
};
|
|
1969
1981
|
|
|
1970
|
-
var _excluded$
|
|
1982
|
+
var _excluded$4 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
1971
1983
|
var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
|
1972
1984
|
var isDefault = _ref.isDefault,
|
|
1973
1985
|
options = _ref.options,
|
|
@@ -1975,7 +1987,7 @@ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
|
|
1975
1987
|
scrollBottom = _ref.scrollBottom,
|
|
1976
1988
|
value = _ref.value,
|
|
1977
1989
|
isMulti = _ref.isMulti,
|
|
1978
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1990
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
1979
1991
|
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
|
1980
1992
|
return value.includes(i.value);
|
|
1981
1993
|
}) : isMulti ? options.filter(function (i) {
|
|
@@ -2002,14 +2014,14 @@ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
|
|
2002
2014
|
}, rest));
|
|
2003
2015
|
};
|
|
2004
2016
|
|
|
2005
|
-
var _excluded$
|
|
2017
|
+
var _excluded$5 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
2006
2018
|
var CustomCreatable = function CustomCreatable(_ref) {
|
|
2007
2019
|
var options = _ref.options,
|
|
2008
2020
|
isDisabled = _ref.isDisabled,
|
|
2009
2021
|
scrollBottom = _ref.scrollBottom,
|
|
2010
2022
|
value = _ref.value,
|
|
2011
2023
|
isMulti = _ref.isMulti,
|
|
2012
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2024
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
2013
2025
|
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
|
2014
2026
|
return value.includes(i.value);
|
|
2015
2027
|
}) : isMulti ? options.filter(function (i) {
|
|
@@ -2036,7 +2048,7 @@ var CustomCreatable = function CustomCreatable(_ref) {
|
|
|
2036
2048
|
}, rest));
|
|
2037
2049
|
};
|
|
2038
2050
|
|
|
2039
|
-
var _excluded$
|
|
2051
|
+
var _excluded$6 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
|
2040
2052
|
var CustomSelectOption = function CustomSelectOption(_ref) {
|
|
2041
2053
|
var defaultValue = _ref.defaultValue,
|
|
2042
2054
|
options = _ref.options,
|
|
@@ -2044,7 +2056,7 @@ var CustomSelectOption = function CustomSelectOption(_ref) {
|
|
|
2044
2056
|
scrollBottom = _ref.scrollBottom,
|
|
2045
2057
|
value = _ref.value,
|
|
2046
2058
|
isMulti = _ref.isMulti,
|
|
2047
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2059
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
2048
2060
|
var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? options.find(function (option) {
|
|
2049
2061
|
return option.value === defaultValue;
|
|
2050
2062
|
}) || null : null;
|