react-asc 21.0.6 → 21.1.0
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/hooks/index.d.ts +1 -0
- package/hooks/useCssClasses.d.ts +1 -0
- package/index.es.js +11 -14
- package/index.js +11 -13
- package/package.json +1 -1
package/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useCssClasses(cssClasses: Array<string>): string[];
|
package/index.es.js
CHANGED
|
@@ -282,6 +282,11 @@ function useDebounce(callback, timeout, deps) {
|
|
|
282
282
|
}, deps);
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
+
function useCssClasses(cssClasses) {
|
|
286
|
+
const cssClassName = cssClasses.filter(css => css).join(' ');
|
|
287
|
+
return [cssClassName];
|
|
288
|
+
}
|
|
289
|
+
|
|
285
290
|
var css_248z$X = ".Backdrop-module_backdrop__IRMoL {\n height: 100%;\n width: 100%;\n position: absolute;\n opacity: 0.5;\n z-index: 1040;\n top: 0;\n left: 0;\n background-color: #000; }\n .Backdrop-module_backdrop__IRMoL.Backdrop-module_isTransparent__F5nA5 {\n opacity: 0; }\n";
|
|
286
291
|
var styles$X = {"backdrop":"Backdrop-module_backdrop__IRMoL","isTransparent":"Backdrop-module_isTransparent__F5nA5"};
|
|
287
292
|
styleInject(css_248z$X);
|
|
@@ -1051,7 +1056,7 @@ const FormInput = (props) => {
|
|
|
1051
1056
|
const handleOnChange = (value, type, name) => {
|
|
1052
1057
|
onChange && onChange({ value, type, name });
|
|
1053
1058
|
};
|
|
1054
|
-
return (React.createElement(Fragment, null,
|
|
1059
|
+
return (React.createElement(React.Fragment, null,
|
|
1055
1060
|
(type === 'text' ||
|
|
1056
1061
|
type === 'date' ||
|
|
1057
1062
|
type === 'datetime-local' ||
|
|
@@ -1067,11 +1072,9 @@ const FormInput = (props) => {
|
|
|
1067
1072
|
type === 'textarea' &&
|
|
1068
1073
|
React.createElement(Textarea, { id: name, name: name, className: className, error: !isValid, value: value, autoFocus: autoFocus, onInput: e => handleOnInput(e.target.value, type, name), onChange: e => handleOnChange(e.target.value, type, name), placeholder: placeholder, rows: textareaOptions === null || textareaOptions === void 0 ? void 0 : textareaOptions.rows, style: (textareaOptions === null || textareaOptions === void 0 ? void 0 : textareaOptions.resize) !== false ? undefined : { resize: 'none' } }),
|
|
1069
1074
|
type === 'select' &&
|
|
1070
|
-
React.createElement(Select, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, multiple: selectOptions === null || selectOptions === void 0 ? void 0 : selectOptions.multiple, onChange: e => handleOnChange(e, type, name),
|
|
1071
|
-
// onKeyDown={e => onKeyDown(e)}
|
|
1072
|
-
options: options }),
|
|
1075
|
+
React.createElement(Select, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, multiple: selectOptions === null || selectOptions === void 0 ? void 0 : selectOptions.multiple, onChange: e => handleOnChange(e, type, name), options: options }),
|
|
1073
1076
|
type === 'autocomplete' &&
|
|
1074
|
-
React.createElement(AutoComplete, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, openOnFocus: autoCompleteOptions === null || autoCompleteOptions === void 0 ? void 0 : autoCompleteOptions.openOnFocus, onChange: e => handleOnChange(e, type, name), options: options }),
|
|
1077
|
+
React.createElement(AutoComplete, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, openOnFocus: autoCompleteOptions === null || autoCompleteOptions === void 0 ? void 0 : autoCompleteOptions.openOnFocus, onChange: e => handleOnChange(e, type, name), onSelect: e => handleOnChange(e.value, type, name), options: options }),
|
|
1075
1078
|
type === 'checkbox' &&
|
|
1076
1079
|
React.createElement(Checkbox, { id: name, name: name, label: label, className: (!isValid ? ' is-invalid' : ''), onChange: e => handleOnChange((e === null || e === void 0 ? void 0 : e.target).checked, type, name), checked: value }),
|
|
1077
1080
|
type === 'radio' &&
|
|
@@ -1632,20 +1635,14 @@ styleInject(css_248z$l);
|
|
|
1632
1635
|
const Link = (props) => {
|
|
1633
1636
|
const { href = '#', className, target, children } = props, rest = __rest(props, ["href", "className", "target", "children"]);
|
|
1634
1637
|
const [status, setStatus] = useState(STATUS.NORMAL);
|
|
1635
|
-
const
|
|
1636
|
-
const cssClasses = [];
|
|
1637
|
-
cssClasses.push(styles$l.link);
|
|
1638
|
-
className && cssClasses.push(className);
|
|
1639
|
-
status !== STATUS.NORMAL && cssClasses.push(status);
|
|
1640
|
-
return cssClasses.filter(css => css).join(' ');
|
|
1641
|
-
};
|
|
1638
|
+
const [cssClassName] = useCssClasses([styles$l.link, className, status]);
|
|
1642
1639
|
const onMouseEnter = () => {
|
|
1643
1640
|
setStatus(STATUS.HOVERED);
|
|
1644
1641
|
};
|
|
1645
1642
|
const onMouseLeave = () => {
|
|
1646
1643
|
setStatus(STATUS.NORMAL);
|
|
1647
1644
|
};
|
|
1648
|
-
return (React.createElement("a", Object.assign({ className:
|
|
1645
|
+
return (React.createElement("a", Object.assign({ className: cssClassName, href: href, target: target, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, rest), children));
|
|
1649
1646
|
};
|
|
1650
1647
|
|
|
1651
1648
|
var css_248z$k = ".LoadingIndicator-module_loadingIndicatorContainer__GS9OG {\n position: fixed;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%; }\n\n.LoadingIndicator-module_loadingIndicator__EC9sx {\n animation-name: LoadingIndicator-module_spinAnimation__LeY4Z;\n animation-duration: 5000ms;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n width: 24px;\n height: 24px; }\n\n@keyframes LoadingIndicator-module_spinAnimation__LeY4Z {\n from {\n transform: rotate(0deg); }\n to {\n transform: rotate(360deg); } }\n";
|
|
@@ -2623,4 +2620,4 @@ const TreeItem = (props) => {
|
|
|
2623
2620
|
children && _isExpanded ? React.createElement("ul", null, children) : null));
|
|
2624
2621
|
};
|
|
2625
2622
|
|
|
2626
|
-
export { Alert, AppBar, AppBarTitle, AutoComplete, Backdrop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, COLOR, Card, CardBody, CardFooter, CardImage, CardSubtitle, CardText, CardTitle, CaretDownSolidIcon, CheckSolidIcon, CheckSquareRegularIcon, Checkbox, ChevronDownSolidIcon, ChevronLeftSolidIcon, ChevronRightSolidIcon, ChevronUpSolidIcon, Chip, CircleSolidIcon, Column, ConditionalWrapper, DATEMODE, DateSelect, DaySelect, Drawer, EmailValidator, ExpansionPanel, ExpansionPanelContent, ExpansionPanelHeader, FileInput, FloatingActionButton, Form, FormControl, FormError, FormGroup, FormHint, FormInput, FormLabel, GlobalModal, HomeSolidIcon, HourSelect, Icon, IconButton, IsEmptyValidator, IsEqualValidator, Link, List, ListItem, ListItemAction, ListItemAvatar, ListItemIcon, ListItemText, LoadingIndicator, LoadingIndicatorContainer, MODALBUTTONTYPE, MODALTYPE, Menu, MenuBody, MenuDivider, MenuItem, MenuToggle, MilliSecondSelect, MinuteSelect, Modal, ModalBody, ModalFooter, ModalHeader, MonthSelect, NumberSelect, POSITION, PlusSolidIcon, Row, SIZE, STATUS, SecondSelect, Select, Sidebar, Snackbar, SpeedDial, SpeedDialAction, SpeedDialIcon, SpinnerSolidIcon, SquareRegularIcon, Step, Stepper, StepperActions, TIMEMODE, Tab, TabPanel, Table, Tabs, Textarea, TimeSelect, TimesCircleSolidIcon, TimesSolidIcon, Tooltip, TreeItem, TreeView, Typography, VARIANT, YearSelect, loadingIndicatorService, modalService, snackbarService, useConstructor, useDebounce, useHover, useWindowSize };
|
|
2623
|
+
export { Alert, AppBar, AppBarTitle, AutoComplete, Backdrop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, COLOR, Card, CardBody, CardFooter, CardImage, CardSubtitle, CardText, CardTitle, CaretDownSolidIcon, CheckSolidIcon, CheckSquareRegularIcon, Checkbox, ChevronDownSolidIcon, ChevronLeftSolidIcon, ChevronRightSolidIcon, ChevronUpSolidIcon, Chip, CircleSolidIcon, Column, ConditionalWrapper, DATEMODE, DateSelect, DaySelect, Drawer, EmailValidator, ExpansionPanel, ExpansionPanelContent, ExpansionPanelHeader, FileInput, FloatingActionButton, Form, FormControl, FormError, FormGroup, FormHint, FormInput, FormLabel, GlobalModal, HomeSolidIcon, HourSelect, Icon, IconButton, IsEmptyValidator, IsEqualValidator, Link, List, ListItem, ListItemAction, ListItemAvatar, ListItemIcon, ListItemText, LoadingIndicator, LoadingIndicatorContainer, MODALBUTTONTYPE, MODALTYPE, Menu, MenuBody, MenuDivider, MenuItem, MenuToggle, MilliSecondSelect, MinuteSelect, Modal, ModalBody, ModalFooter, ModalHeader, MonthSelect, NumberSelect, POSITION, PlusSolidIcon, Row, SIZE, STATUS, SecondSelect, Select, Sidebar, Snackbar, SpeedDial, SpeedDialAction, SpeedDialIcon, SpinnerSolidIcon, SquareRegularIcon, Step, Stepper, StepperActions, TIMEMODE, Tab, TabPanel, Table, Tabs, Textarea, TimeSelect, TimesCircleSolidIcon, TimesSolidIcon, Tooltip, TreeItem, TreeView, Typography, VARIANT, YearSelect, loadingIndicatorService, modalService, snackbarService, useConstructor, useCssClasses, useDebounce, useHover, useWindowSize };
|
package/index.js
CHANGED
|
@@ -290,6 +290,11 @@ function useDebounce(callback, timeout, deps) {
|
|
|
290
290
|
}, deps);
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
+
function useCssClasses(cssClasses) {
|
|
294
|
+
const cssClassName = cssClasses.filter(css => css).join(' ');
|
|
295
|
+
return [cssClassName];
|
|
296
|
+
}
|
|
297
|
+
|
|
293
298
|
var css_248z$X = ".Backdrop-module_backdrop__IRMoL {\n height: 100%;\n width: 100%;\n position: absolute;\n opacity: 0.5;\n z-index: 1040;\n top: 0;\n left: 0;\n background-color: #000; }\n .Backdrop-module_backdrop__IRMoL.Backdrop-module_isTransparent__F5nA5 {\n opacity: 0; }\n";
|
|
294
299
|
var styles$X = {"backdrop":"Backdrop-module_backdrop__IRMoL","isTransparent":"Backdrop-module_isTransparent__F5nA5"};
|
|
295
300
|
styleInject(css_248z$X);
|
|
@@ -1059,7 +1064,7 @@ const FormInput = (props) => {
|
|
|
1059
1064
|
const handleOnChange = (value, type, name) => {
|
|
1060
1065
|
onChange && onChange({ value, type, name });
|
|
1061
1066
|
};
|
|
1062
|
-
return (React__default["default"].createElement(
|
|
1067
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1063
1068
|
(type === 'text' ||
|
|
1064
1069
|
type === 'date' ||
|
|
1065
1070
|
type === 'datetime-local' ||
|
|
@@ -1075,11 +1080,9 @@ const FormInput = (props) => {
|
|
|
1075
1080
|
type === 'textarea' &&
|
|
1076
1081
|
React__default["default"].createElement(Textarea, { id: name, name: name, className: className, error: !isValid, value: value, autoFocus: autoFocus, onInput: e => handleOnInput(e.target.value, type, name), onChange: e => handleOnChange(e.target.value, type, name), placeholder: placeholder, rows: textareaOptions === null || textareaOptions === void 0 ? void 0 : textareaOptions.rows, style: (textareaOptions === null || textareaOptions === void 0 ? void 0 : textareaOptions.resize) !== false ? undefined : { resize: 'none' } }),
|
|
1077
1082
|
type === 'select' &&
|
|
1078
|
-
React__default["default"].createElement(Select, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, multiple: selectOptions === null || selectOptions === void 0 ? void 0 : selectOptions.multiple, onChange: e => handleOnChange(e, type, name),
|
|
1079
|
-
// onKeyDown={e => onKeyDown(e)}
|
|
1080
|
-
options: options }),
|
|
1083
|
+
React__default["default"].createElement(Select, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, multiple: selectOptions === null || selectOptions === void 0 ? void 0 : selectOptions.multiple, onChange: e => handleOnChange(e, type, name), options: options }),
|
|
1081
1084
|
type === 'autocomplete' &&
|
|
1082
|
-
React__default["default"].createElement(AutoComplete, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, openOnFocus: autoCompleteOptions === null || autoCompleteOptions === void 0 ? void 0 : autoCompleteOptions.openOnFocus, onChange: e => handleOnChange(e, type, name), options: options }),
|
|
1085
|
+
React__default["default"].createElement(AutoComplete, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, openOnFocus: autoCompleteOptions === null || autoCompleteOptions === void 0 ? void 0 : autoCompleteOptions.openOnFocus, onChange: e => handleOnChange(e, type, name), onSelect: e => handleOnChange(e.value, type, name), options: options }),
|
|
1083
1086
|
type === 'checkbox' &&
|
|
1084
1087
|
React__default["default"].createElement(Checkbox, { id: name, name: name, label: label, className: (!isValid ? ' is-invalid' : ''), onChange: e => handleOnChange((e === null || e === void 0 ? void 0 : e.target).checked, type, name), checked: value }),
|
|
1085
1088
|
type === 'radio' &&
|
|
@@ -1640,20 +1643,14 @@ styleInject(css_248z$l);
|
|
|
1640
1643
|
const Link = (props) => {
|
|
1641
1644
|
const { href = '#', className, target, children } = props, rest = __rest(props, ["href", "className", "target", "children"]);
|
|
1642
1645
|
const [status, setStatus] = React.useState(STATUS.NORMAL);
|
|
1643
|
-
const
|
|
1644
|
-
const cssClasses = [];
|
|
1645
|
-
cssClasses.push(styles$l.link);
|
|
1646
|
-
className && cssClasses.push(className);
|
|
1647
|
-
status !== STATUS.NORMAL && cssClasses.push(status);
|
|
1648
|
-
return cssClasses.filter(css => css).join(' ');
|
|
1649
|
-
};
|
|
1646
|
+
const [cssClassName] = useCssClasses([styles$l.link, className, status]);
|
|
1650
1647
|
const onMouseEnter = () => {
|
|
1651
1648
|
setStatus(STATUS.HOVERED);
|
|
1652
1649
|
};
|
|
1653
1650
|
const onMouseLeave = () => {
|
|
1654
1651
|
setStatus(STATUS.NORMAL);
|
|
1655
1652
|
};
|
|
1656
|
-
return (React__default["default"].createElement("a", Object.assign({ className:
|
|
1653
|
+
return (React__default["default"].createElement("a", Object.assign({ className: cssClassName, href: href, target: target, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, rest), children));
|
|
1657
1654
|
};
|
|
1658
1655
|
|
|
1659
1656
|
var css_248z$k = ".LoadingIndicator-module_loadingIndicatorContainer__GS9OG {\n position: fixed;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%; }\n\n.LoadingIndicator-module_loadingIndicator__EC9sx {\n animation-name: LoadingIndicator-module_spinAnimation__LeY4Z;\n animation-duration: 5000ms;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n width: 24px;\n height: 24px; }\n\n@keyframes LoadingIndicator-module_spinAnimation__LeY4Z {\n from {\n transform: rotate(0deg); }\n to {\n transform: rotate(360deg); } }\n";
|
|
@@ -2737,6 +2734,7 @@ exports.loadingIndicatorService = loadingIndicatorService;
|
|
|
2737
2734
|
exports.modalService = modalService;
|
|
2738
2735
|
exports.snackbarService = snackbarService;
|
|
2739
2736
|
exports.useConstructor = useConstructor;
|
|
2737
|
+
exports.useCssClasses = useCssClasses;
|
|
2740
2738
|
exports.useDebounce = useDebounce;
|
|
2741
2739
|
exports.useHover = useHover;
|
|
2742
2740
|
exports.useWindowSize = useWindowSize;
|