react-asc 19.0.0 → 19.0.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.
- package/components/AutoComplete/AutoComplete.d.ts +0 -1
- package/components/Badge/Badge.d.ts +1 -1
- package/components/Breadcrumb/BreadcrumbItem.d.ts +2 -5
- package/components/ButtonGroup/ButtonGroup.d.ts +1 -3
- package/components/Card/CardBody.d.ts +1 -4
- package/components/Card/CardFooter.d.ts +1 -4
- package/components/Card/CardImage.d.ts +1 -4
- package/components/Card/CardSubtitle.d.ts +1 -4
- package/components/Card/CardText.d.ts +1 -4
- package/components/Checkbox/Checkbox.d.ts +0 -1
- package/components/Chip/Chip.d.ts +1 -1
- package/components/ConditionalWrapper/ConditionalWrapper.d.ts +3 -3
- package/components/Drawer/Drawer.d.ts +3 -4
- package/components/FloatingActionButton/FloatingActionButton.d.ts +1 -1
- package/components/Form/Form.d.ts +1 -1
- package/components/Form/FormHint/FormHint.d.ts +1 -4
- package/components/Form/FormInput/FormInput.d.ts +4 -4
- package/components/Form/FormLabel/FormLabel.d.ts +2 -4
- package/components/Form/form.interfaces.d.ts +1 -1
- package/components/Form/form.models.d.ts +2 -2
- package/components/Form/validators/IsEmptyValidator.d.ts +1 -1
- package/components/Form/validators/IsEqualValidator.d.ts +1 -1
- package/components/List/list.models.d.ts +2 -2
- package/components/LoadingIndicator/LoadingIndicator.d.ts +0 -2
- package/components/LoadingIndicator/loading-indicator.service.d.ts +2 -4
- package/components/Menu/Menu.d.ts +0 -1
- package/components/Menu/MenuBody.d.ts +1 -1
- package/components/Modal/Modal.d.ts +2 -2
- package/components/Modal/ModalHeader.d.ts +3 -4
- package/components/Select/Select.d.ts +2 -2
- package/components/SpeedDial/SpeedDialActions.d.ts +2 -6
- package/components/Stepper/Step/Step.d.ts +5 -2
- package/components/Tabs/Tab.d.ts +5 -2
- package/components/Tabs/TabIndicator.d.ts +2 -2
- package/components/Tabs/TabPanel.d.ts +0 -1
- package/components/Tabs/Tabs.d.ts +6 -2
- package/components/Tooltip/Tooltip.d.ts +2 -3
- package/components/TreeView/TreeItem.d.ts +6 -5
- package/hooks/useConstructor.d.ts +1 -1
- package/hooks/useDebounce.d.ts +2 -1
- package/index.es.js +81 -74
- package/index.js +81 -74
- package/package.json +1 -1
- package/react-asc.scss +52 -52
package/index.es.js
CHANGED
|
@@ -249,6 +249,7 @@ function useHover() {
|
|
|
249
249
|
const handleMouseOver = () => setValue(true);
|
|
250
250
|
const handleMouseOut = () => setValue(false);
|
|
251
251
|
useEffect(() => {
|
|
252
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
252
253
|
const node = ref.current;
|
|
253
254
|
if (node) {
|
|
254
255
|
node.addEventListener("mouseover", handleMouseOver);
|
|
@@ -264,7 +265,7 @@ function useHover() {
|
|
|
264
265
|
return [ref, value];
|
|
265
266
|
}
|
|
266
267
|
|
|
267
|
-
const useConstructor = (callBack
|
|
268
|
+
const useConstructor = (callBack) => {
|
|
268
269
|
const [hasBeenCalled, setHasBeenCalled] = useState(false);
|
|
269
270
|
if (hasBeenCalled)
|
|
270
271
|
return;
|
|
@@ -575,7 +576,7 @@ const Breadcrumb = (props) => {
|
|
|
575
576
|
|
|
576
577
|
const ConditionalWrapper = ({ condition, wrapper, children }) => condition ? wrapper(children) : children;
|
|
577
578
|
|
|
578
|
-
var css_248z$F = ".BreadcrumbItem-module_breadcrumbItem__zsUq- + .BreadcrumbItem-module_breadcrumbItem__zsUq- {\n
|
|
579
|
+
var css_248z$F = ".BreadcrumbItem-module_breadcrumbItem__zsUq- {\n display: flex;\n align-items: center; }\n .BreadcrumbItem-module_breadcrumbItem__zsUq- + .BreadcrumbItem-module_breadcrumbItem__zsUq- {\n padding-left: 0.5rem; }\n .BreadcrumbItem-module_breadcrumbItem__zsUq- + .BreadcrumbItem-module_breadcrumbItem__zsUq-::before {\n float: left;\n padding-right: 0.5rem;\n color: #6c757d;\n content: \"/\"; }\n .BreadcrumbItem-module_breadcrumbItem__zsUq- a:not([href]):not([class]) {\n color: var(--primary); }\n .BreadcrumbItem-module_breadcrumbItem__zsUq-:hover {\n cursor: pointer; }\n .BreadcrumbItem-module_breadcrumbItem__zsUq-.BreadcrumbItem-module_active__Kn1dA:hover {\n cursor: unset; }\n";
|
|
579
580
|
var styles$F = {"breadcrumbItem":"BreadcrumbItem-module_breadcrumbItem__zsUq-","active":"BreadcrumbItem-module_active__Kn1dA"};
|
|
580
581
|
styleInject(css_248z$F);
|
|
581
582
|
|
|
@@ -592,9 +593,7 @@ const BreadcrumbItem = (props) => {
|
|
|
592
593
|
onClick && onClick(event);
|
|
593
594
|
};
|
|
594
595
|
return (React.createElement("li", { className: getCssClasses(), onClick: handleClick },
|
|
595
|
-
React.createElement(ConditionalWrapper, { condition: !isActive,
|
|
596
|
-
// eslint-disable-next-line jsx-a11y/anchor-is-valid
|
|
597
|
-
wrapper: label => React.createElement("a", null, label) }, children)));
|
|
596
|
+
React.createElement(ConditionalWrapper, { condition: !isActive, wrapper: label => React.createElement("a", null, label) }, children)));
|
|
598
597
|
};
|
|
599
598
|
|
|
600
599
|
var css_248z$E = ".Card-module_card__TQdQq {\n background: var(--white);\n border-radius: var(--borderRadius); }\n .Card-module_card__TQdQq.Card-module_shadow__NxDVz {\n box-shadow: var(--shadow); }\n";
|
|
@@ -670,7 +669,7 @@ const CardText = (props) => {
|
|
|
670
669
|
className && cssClasses.push(className);
|
|
671
670
|
return cssClasses.filter(css => css).join(' ');
|
|
672
671
|
};
|
|
673
|
-
return (React.createElement("p", Object.assign({ className: getCssClasses() }, rest),
|
|
672
|
+
return (React.createElement("p", Object.assign({ className: getCssClasses() }, rest), children));
|
|
674
673
|
};
|
|
675
674
|
|
|
676
675
|
var css_248z$z = ".CardTitle-module_cardTitle__aiPSE {\n margin-bottom: 0;\n font-size: 1.5rem;\n font-weight: 400;\n line-height: 1.334;\n letter-spacing: 0em; }\n";
|
|
@@ -776,8 +775,8 @@ var css_248z$v = ".FormLabel-module_formLabel__TXcHc {\n margin-bottom: .5rem;
|
|
|
776
775
|
var styles$v = {"formLabel":"FormLabel-module_formLabel__TXcHc"};
|
|
777
776
|
styleInject(css_248z$v);
|
|
778
777
|
|
|
779
|
-
const FormLabel = (
|
|
780
|
-
|
|
778
|
+
const FormLabel = (_a) => {
|
|
779
|
+
var { children, className, htmlFor } = _a, rest = __rest(_a, ["children", "className", "htmlFor"]);
|
|
781
780
|
const getCssClasses = () => {
|
|
782
781
|
const cssClasses = [];
|
|
783
782
|
cssClasses.push(styles$v.formLabel);
|
|
@@ -793,7 +792,7 @@ const FormGroup = (props) => {
|
|
|
793
792
|
};
|
|
794
793
|
|
|
795
794
|
const FileInput = (props) => {
|
|
796
|
-
const { id,
|
|
795
|
+
const { id, className, children, name, multiple = false, accept, disabled, onChange, readOnly, value, deletable = false } = props, rest = __rest(props, ["id", "className", "children", "name", "multiple", "accept", "disabled", "onChange", "readOnly", "value", "deletable"]);
|
|
797
796
|
const inputFileElement = useRef(null);
|
|
798
797
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
799
798
|
const [model, setModel] = useState(value);
|
|
@@ -808,8 +807,7 @@ const FileInput = (props) => {
|
|
|
808
807
|
setFileList(values);
|
|
809
808
|
onChange && onChange(event);
|
|
810
809
|
};
|
|
811
|
-
const handleOnDelete = (
|
|
812
|
-
// TODO - setModel
|
|
810
|
+
const handleOnDelete = () => {
|
|
813
811
|
alert('coming soon');
|
|
814
812
|
};
|
|
815
813
|
return (React.createElement("div", { className: "d-flex align-items-start" },
|
|
@@ -837,7 +835,7 @@ const Select = (props) => {
|
|
|
837
835
|
return cssClasses.filter(r => r).join(' ');
|
|
838
836
|
};
|
|
839
837
|
useEffect(() => {
|
|
840
|
-
const newValue =
|
|
838
|
+
const newValue = value ? value : '';
|
|
841
839
|
writeValue(newValue);
|
|
842
840
|
if (newValue) {
|
|
843
841
|
const option = options.find(o => o.value === newValue);
|
|
@@ -909,7 +907,7 @@ const Select = (props) => {
|
|
|
909
907
|
let result = null;
|
|
910
908
|
if (selectedOptions.length <= multipleMaxCountItems && selectedOptions.length > 0) {
|
|
911
909
|
result = selectedOptions
|
|
912
|
-
.map(
|
|
910
|
+
.map(option => React.createElement(Chip, { key: option.value, className: "mr-2", color: COLOR.primary, isDeletable: true, onDelete: (e) => handleOnDelete(e, option) }, option.label));
|
|
913
911
|
}
|
|
914
912
|
else {
|
|
915
913
|
result = React.createElement("span", null,
|
|
@@ -995,9 +993,11 @@ const FormInput = (props) => {
|
|
|
995
993
|
!isValid && cssClasses.push('is-invalid');
|
|
996
994
|
return cssClasses.filter(css => css).join(' ');
|
|
997
995
|
};
|
|
996
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
998
997
|
const handleOnInput = (value, type, name) => {
|
|
999
998
|
onInput && onInput({ value, type, name });
|
|
1000
999
|
};
|
|
1000
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1001
1001
|
const handleOnChange = (value, type, name) => {
|
|
1002
1002
|
onChange && onChange({ value, type, name });
|
|
1003
1003
|
};
|
|
@@ -1015,15 +1015,17 @@ const FormInput = (props) => {
|
|
|
1015
1015
|
type === 'file' &&
|
|
1016
1016
|
React.createElement(FileInput, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, autoFocus: autoFocus, readOnly: readonly, disabled: disabled, onChange: e => handleOnChange(e.target.value, type, name) }, "choose a file"),
|
|
1017
1017
|
type === 'textarea' &&
|
|
1018
|
-
React.createElement(Textarea, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, autoFocus: autoFocus, onInput: e => handleOnInput(e.target.value, type, name), onChange: e => handleOnChange(
|
|
1018
|
+
React.createElement(Textarea, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), 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' } }),
|
|
1019
1019
|
type === 'select' &&
|
|
1020
|
-
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),
|
|
1020
|
+
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),
|
|
1021
|
+
// onKeyDown={e => onKeyDown(e)}
|
|
1022
|
+
options: options }),
|
|
1021
1023
|
type === 'autocomplete' &&
|
|
1022
|
-
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),
|
|
1024
|
+
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 }),
|
|
1023
1025
|
type === 'checkbox' &&
|
|
1024
|
-
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
|
|
1026
|
+
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 === 'true' ? true : false }),
|
|
1025
1027
|
type === 'radio' &&
|
|
1026
|
-
React.createElement(Fragment, null, options.map((option) => React.createElement("div", { className: "form-check", key: option.id },
|
|
1028
|
+
React.createElement(React.Fragment, null, options.map((option) => React.createElement("div", { className: "form-check", key: option.id },
|
|
1027
1029
|
React.createElement("input", { id: option.id ? option.id : option.value, name: name, type: "radio", className: "form-check-input", onChange: e => handleOnChange((e === null || e === void 0 ? void 0 : e.target).value, type, name), value: option.value, checked: value === option.value, onKeyDown: onKeyDown }),
|
|
1028
1030
|
React.createElement("label", { className: "form-check-label", htmlFor: option.id }, option.label))))));
|
|
1029
1031
|
};
|
|
@@ -1044,7 +1046,7 @@ const FormError = (props) => {
|
|
|
1044
1046
|
React.createElement("div", { className: className }, errors.map(e => React.createElement("div", { key: e.validator }, e.message)))));
|
|
1045
1047
|
};
|
|
1046
1048
|
|
|
1047
|
-
const IsEmptyValidator = (value) => value === '' || value === null || value === undefined;
|
|
1049
|
+
const IsEmptyValidator = (value) => value.trim() === '' || value === null || value === undefined;
|
|
1048
1050
|
|
|
1049
1051
|
const EmailValidator = (value) => {
|
|
1050
1052
|
const isInvalidEmailFormat = value.match(/^([\w.%+-]+)@([\w-]+\.)+([\w]{2,})$/i) === null;
|
|
@@ -1074,7 +1076,7 @@ class Form extends Component {
|
|
|
1074
1076
|
const values = keys.reduce((obj, f) => {
|
|
1075
1077
|
const control = this.getControl(f);
|
|
1076
1078
|
// TODO - refactor
|
|
1077
|
-
const newValue = ((control.type === 'date' || control.type === 'datetime-local') && control.value && isValidDate(control.value)) ? new Date(control.value).toISOString() : control.value;
|
|
1079
|
+
const newValue = ((control.type === 'date' || control.type === 'datetime-local') && control.value && isValidDate((control.value))) ? new Date((control.value)).toISOString() : control.value;
|
|
1078
1080
|
return (Object.assign(Object.assign({}, obj), { [f]: newValue }));
|
|
1079
1081
|
}, {});
|
|
1080
1082
|
if (this.state.isValid && this.state.isSubmitted) {
|
|
@@ -1121,7 +1123,7 @@ class Form extends Component {
|
|
|
1121
1123
|
}
|
|
1122
1124
|
return errors;
|
|
1123
1125
|
}
|
|
1124
|
-
handleInputChange(name, value
|
|
1126
|
+
handleInputChange(name, value) {
|
|
1125
1127
|
const field = this.getControl(name);
|
|
1126
1128
|
field.value = value;
|
|
1127
1129
|
// redundant mit handleOnBlur
|
|
@@ -1146,7 +1148,6 @@ class Form extends Component {
|
|
|
1146
1148
|
}
|
|
1147
1149
|
}
|
|
1148
1150
|
}
|
|
1149
|
-
;
|
|
1150
1151
|
isRequired(fieldName) {
|
|
1151
1152
|
let result = false;
|
|
1152
1153
|
result = this.getControl(fieldName).validators.indexOf('required') >= 0;
|
|
@@ -1165,7 +1166,6 @@ class Form extends Component {
|
|
|
1165
1166
|
const cssClasses = [labelClassName, this.isRequired(fieldKey) ? 'required' : undefined];
|
|
1166
1167
|
return React.createElement(FormLabel, { htmlFor: fieldKey, className: cssClasses.join(' ') }, label);
|
|
1167
1168
|
}
|
|
1168
|
-
;
|
|
1169
1169
|
// trigger via ref
|
|
1170
1170
|
handleFormSubmit() {
|
|
1171
1171
|
for (const fieldKey of Object.keys(this.state.controls)) {
|
|
@@ -1207,7 +1207,7 @@ class Form extends Component {
|
|
|
1207
1207
|
this.setState({ controls: {}, isValid: false, isChanged: false, isSubmitted: false });
|
|
1208
1208
|
}
|
|
1209
1209
|
getFormGroupCssClass(fieldKey) {
|
|
1210
|
-
|
|
1210
|
+
const result = this.getControl(fieldKey).config.formGroupClassName;
|
|
1211
1211
|
return result;
|
|
1212
1212
|
}
|
|
1213
1213
|
render() {
|
|
@@ -1215,7 +1215,7 @@ class Form extends Component {
|
|
|
1215
1215
|
return (React.createElement(FormGroup, { key: fieldKey, className: this.getFormGroupCssClass(fieldKey) },
|
|
1216
1216
|
this.getControl(fieldKey).config.labelPosition !== 'behind' && this.getControl(fieldKey).type !== 'checkbox' &&
|
|
1217
1217
|
this.renderLabel(fieldKey, this.getControl(fieldKey).config.label, this.getControl(fieldKey).config.labelClassName),
|
|
1218
|
-
React.createElement(FormInput, { autoFocus: this.getControl(fieldKey).config.autoFocus, className: this.getControl(fieldKey).config.formControlClassName, isValid: !this.isInvalid(fieldKey), label: this.getControl(fieldKey).config.label, name: fieldKey, options: this.getControl(fieldKey).config.options, placeholder: this.getControl(fieldKey).config.placeholder, textareaOptions: this.getControl(fieldKey).config.textareaOptions, selectOptions: this.getControl(fieldKey).config.selectOptions, autoCompleteOptions: this.getControl(fieldKey).config.autoCompleteOptions, type: this.getControl(fieldKey).type, value: this.getControl(fieldKey).value, disabled: this.getControl(fieldKey).config.disabled, readonly: this.getControl(fieldKey).config.readonly, onChange: ({ name, value
|
|
1218
|
+
React.createElement(FormInput, { autoFocus: this.getControl(fieldKey).config.autoFocus, className: this.getControl(fieldKey).config.formControlClassName, isValid: !this.isInvalid(fieldKey), label: this.getControl(fieldKey).config.label, name: fieldKey, options: this.getControl(fieldKey).config.options, placeholder: this.getControl(fieldKey).config.placeholder, textareaOptions: this.getControl(fieldKey).config.textareaOptions, selectOptions: this.getControl(fieldKey).config.selectOptions, autoCompleteOptions: this.getControl(fieldKey).config.autoCompleteOptions, type: this.getControl(fieldKey).type, value: this.getControl(fieldKey).value, disabled: this.getControl(fieldKey).config.disabled, readonly: this.getControl(fieldKey).config.readonly, onChange: ({ name, value }) => this.handleInputChange(name, value), onBlur: (e) => this.handleOnBlur(e), onKeyDown: (e) => this.handleOnKeyDown(e) }),
|
|
1219
1219
|
this.getControl(fieldKey).config.labelPosition === 'behind' && this.getControl(fieldKey).type !== 'checkbox' &&
|
|
1220
1220
|
this.renderLabel(fieldKey, this.getControl(fieldKey).config.label, this.getControl(fieldKey).config.labelClassName),
|
|
1221
1221
|
this.getControl(fieldKey).config.hint &&
|
|
@@ -1230,7 +1230,9 @@ function isValidDate(dateObject) {
|
|
|
1230
1230
|
}
|
|
1231
1231
|
|
|
1232
1232
|
class FormControl {
|
|
1233
|
-
constructor(
|
|
1233
|
+
constructor(
|
|
1234
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1235
|
+
value, validators = [], type, config) {
|
|
1234
1236
|
this.value = value;
|
|
1235
1237
|
this.validators = validators;
|
|
1236
1238
|
this.type = type;
|
|
@@ -1247,7 +1249,7 @@ const DaySelect = (props) => {
|
|
|
1247
1249
|
init();
|
|
1248
1250
|
}, [month, year]);
|
|
1249
1251
|
const init = () => {
|
|
1250
|
-
|
|
1252
|
+
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
1251
1253
|
const newDays = [];
|
|
1252
1254
|
for (let i = 1; i <= daysInMonth; i++) {
|
|
1253
1255
|
newDays.push({ value: i.toString(), label: i.toString() });
|
|
@@ -1356,12 +1358,12 @@ const DateSelect = (props) => {
|
|
|
1356
1358
|
// return Math.ceil((((d - yearStart) / 86400000) + 1) / 7)
|
|
1357
1359
|
// };
|
|
1358
1360
|
|
|
1359
|
-
var css_248z$r = ".Drawer-module_drawer__kdQCk {\n height: 100%;\n z-index: 1101;\n bottom: 0;\n position: fixed;\n background: white;\n min-width: 280px;\n overflow-y: auto; }\n .Drawer-module_drawer__kdQCk.Drawer-module_permanent__c-y8y {\n position: inherit;\n z-index: 0; }\n .Drawer-module_drawer__kdQCk.Drawer-module_left__loQVO {\n order: 0; }\n .Drawer-module_drawer__kdQCk.Drawer-module_right__sJ3mZ {\n order: 2; }\n\n.Drawer-module_drawerOpen__07ptP {\n overflow: hidden; }\n";
|
|
1360
|
-
var styles$r = {"drawer":"Drawer-module_drawer__kdQCk","permanent":"Drawer-module_permanent__c-y8y","left":"Drawer-module_left__loQVO","right":"Drawer-module_right__sJ3mZ","drawerOpen":"Drawer-module_drawerOpen__07ptP"};
|
|
1361
|
+
var css_248z$r = ".Drawer-module_drawer__kdQCk {\n height: 100%;\n z-index: 1101;\n bottom: 0;\n position: fixed;\n background: white;\n min-width: 280px;\n overflow-y: auto; }\n .Drawer-module_drawer__kdQCk.Drawer-module_permanent__c-y8y {\n position: inherit;\n z-index: 0; }\n .Drawer-module_drawer__kdQCk.Drawer-module_left__loQVO {\n order: 0; }\n .Drawer-module_drawer__kdQCk.Drawer-module_right__sJ3mZ {\n order: 2; }\n .Drawer-module_drawer__kdQCk.Drawer-module_shadow__Myo3n {\n box-shadow: var(--shadow); }\n\n.Drawer-module_drawerOpen__07ptP {\n overflow: hidden; }\n";
|
|
1362
|
+
var styles$r = {"drawer":"Drawer-module_drawer__kdQCk","permanent":"Drawer-module_permanent__c-y8y","left":"Drawer-module_left__loQVO","right":"Drawer-module_right__sJ3mZ","shadow":"Drawer-module_shadow__Myo3n","drawerOpen":"Drawer-module_drawerOpen__07ptP"};
|
|
1361
1363
|
styleInject(css_248z$r);
|
|
1362
1364
|
|
|
1363
1365
|
const Drawer = (props) => {
|
|
1364
|
-
const { children, className, position = 'left', permanent = false, target = document.body, onClickBackdrop } = props;
|
|
1366
|
+
const { children, className, position = 'left', permanent = false, target = document.body, shadow = true, onClickBackdrop } = props, rest = __rest(props, ["children", "className", "position", "permanent", "target", "shadow", "onClickBackdrop"]);
|
|
1365
1367
|
useEffect(() => {
|
|
1366
1368
|
document.body.classList.add(styles$r.drawerOpen);
|
|
1367
1369
|
return () => {
|
|
@@ -1371,18 +1373,19 @@ const Drawer = (props) => {
|
|
|
1371
1373
|
const handleClickBackdrop = () => {
|
|
1372
1374
|
onClickBackdrop && onClickBackdrop();
|
|
1373
1375
|
};
|
|
1374
|
-
return createPortal(React.createElement(Fragment, null,
|
|
1375
|
-
React.createElement(DrawerContent, { className: className, position: position, permanent: permanent }, children),
|
|
1376
|
+
return createPortal(React.createElement(React.Fragment, null,
|
|
1377
|
+
React.createElement(DrawerContent, Object.assign({ className: className, position: position, permanent: permanent, shadow: shadow }, rest), children),
|
|
1376
1378
|
!permanent && React.createElement(Backdrop, { onClick: handleClickBackdrop })), target);
|
|
1377
1379
|
};
|
|
1378
1380
|
const DrawerContent = (props) => {
|
|
1379
|
-
const { children, className, position = 'left', permanent = false } = props;
|
|
1381
|
+
const { children, className, position = 'left', permanent = false, shadow } = props, rest = __rest(props, ["children", "className", "position", "permanent", "shadow"]);
|
|
1380
1382
|
const getCssClasses = () => {
|
|
1381
1383
|
const cssClasses = [];
|
|
1382
1384
|
cssClasses.push(styles$r.drawer);
|
|
1383
|
-
|
|
1385
|
+
shadow && cssClasses.push(styles$r.shadow);
|
|
1384
1386
|
!!permanent && cssClasses.push(styles$r['permanent']);
|
|
1385
1387
|
position === 'left' ? cssClasses.push(styles$r['left']) : cssClasses.push(styles$r['right']);
|
|
1388
|
+
className && cssClasses.push(className);
|
|
1386
1389
|
return cssClasses.filter(css => css).join(' ');
|
|
1387
1390
|
};
|
|
1388
1391
|
const positionStyles = {
|
|
@@ -1392,7 +1395,7 @@ const DrawerContent = (props) => {
|
|
|
1392
1395
|
const getStyles = () => {
|
|
1393
1396
|
return !permanent ? positionStyles[position] : undefined;
|
|
1394
1397
|
};
|
|
1395
|
-
return (React.createElement("div", { className: getCssClasses(), style: getStyles() }, children));
|
|
1398
|
+
return (React.createElement("div", Object.assign({ className: getCssClasses(), style: getStyles() }, rest), children));
|
|
1396
1399
|
};
|
|
1397
1400
|
|
|
1398
1401
|
var css_248z$q = ".MenuBody-module_menuBody__u4FIQ {\n z-index: 1111;\n margin: 0;\n position: absolute;\n top: 100%;\n left: 0;\n min-width: 10rem;\n padding: 8px 0px;\n font-size: 1rem;\n color: #212529;\n text-align: left;\n list-style: none;\n background-color: #fff;\n background-clip: padding-box;\n border-radius: var(--borderRadius); }\n .MenuBody-module_menuBody__u4FIQ.MenuBody-module_shadow__OBp-f {\n box-shadow: var(--shadow); }\n";
|
|
@@ -1403,14 +1406,15 @@ const MenuBody = (props) => {
|
|
|
1403
1406
|
const { parentRef, children, className, shadow = true, menuPosition = 'left', onClickBackdrop } = props;
|
|
1404
1407
|
const menuBodyRef = useRef(null);
|
|
1405
1408
|
useEffect(() => {
|
|
1406
|
-
if (menuBodyRef) {
|
|
1409
|
+
if (menuBodyRef && parentRef.current && menuBodyRef.current) {
|
|
1407
1410
|
createPopper(parentRef.current, menuBodyRef.current, {
|
|
1408
1411
|
placement: `${menuPosition}-start`,
|
|
1409
1412
|
modifiers: [
|
|
1410
1413
|
{
|
|
1411
1414
|
name: 'offset',
|
|
1412
1415
|
options: {
|
|
1413
|
-
|
|
1416
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1417
|
+
offset: ({ placement, popper }) => {
|
|
1414
1418
|
if (placement === 'left-start') {
|
|
1415
1419
|
return [0, -popper.width]; // y, x
|
|
1416
1420
|
}
|
|
@@ -1445,7 +1449,7 @@ var styles$p = {"menu":"Menu-module_menu__p8QL-"};
|
|
|
1445
1449
|
styleInject(css_248z$p);
|
|
1446
1450
|
|
|
1447
1451
|
const Menu = (props) => {
|
|
1448
|
-
const { toggle, children, className, open, menuPosition, onClickBackdrop
|
|
1452
|
+
const { toggle, children, className, open, menuPosition, onClickBackdrop } = props, rest = __rest(props, ["toggle", "children", "className", "open", "menuPosition", "onClickBackdrop"]);
|
|
1449
1453
|
const menuContainer = useRef(null);
|
|
1450
1454
|
const toggleContainerRef = useRef(null);
|
|
1451
1455
|
const getCssClasses = () => {
|
|
@@ -1481,9 +1485,7 @@ const MenuItem = (props) => {
|
|
|
1481
1485
|
e.stopPropagation();
|
|
1482
1486
|
onClick && onClick(e);
|
|
1483
1487
|
};
|
|
1484
|
-
return (React.createElement(ConditionalWrapper, { condition: true, wrapper: children => ((type === 'item' ? (
|
|
1485
|
-
// eslint-disable-next-line jsx-a11y/anchor-is-valid
|
|
1486
|
-
React.createElement("a", { className: getCssClasses(), onClick: handleClick }, children)) :
|
|
1488
|
+
return (React.createElement(ConditionalWrapper, { condition: true, wrapper: children => ((type === 'item' ? (React.createElement("a", { className: getCssClasses(), onClick: handleClick }, children)) :
|
|
1487
1489
|
React.createElement("div", { className: getCssClasses(), onClick: handleClick }, children))) }, children));
|
|
1488
1490
|
};
|
|
1489
1491
|
|
|
@@ -1645,23 +1647,21 @@ const LoadingIndicatorContainer = ({ children }) => {
|
|
|
1645
1647
|
|
|
1646
1648
|
class LoadingIndicatorService {
|
|
1647
1649
|
show() {
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
React.createElement(LoadingIndicator, null)), this.container);
|
|
1657
|
-
});
|
|
1650
|
+
if (this.container) {
|
|
1651
|
+
this.hide();
|
|
1652
|
+
}
|
|
1653
|
+
this.container = document.createElement('div');
|
|
1654
|
+
this.container.classList.add('snackbar-container');
|
|
1655
|
+
document.body.appendChild(this.container);
|
|
1656
|
+
render(React.createElement(LoadingIndicatorContainer, null,
|
|
1657
|
+
React.createElement(LoadingIndicator, null)), this.container);
|
|
1658
1658
|
}
|
|
1659
1659
|
hide() {
|
|
1660
1660
|
if (this.container) {
|
|
1661
1661
|
unmountComponentAtNode(this.container);
|
|
1662
1662
|
document.body.removeChild(this.container);
|
|
1663
|
-
this.container =
|
|
1664
|
-
clearTimeout(this.handler);
|
|
1663
|
+
this.container = undefined;
|
|
1664
|
+
this.handler && clearTimeout(this.handler);
|
|
1665
1665
|
}
|
|
1666
1666
|
}
|
|
1667
1667
|
}
|
|
@@ -1672,11 +1672,11 @@ var styles$h = {"modalHeader":"ModalHeader-module_modalHeader__tw-u-"};
|
|
|
1672
1672
|
styleInject(css_248z$h);
|
|
1673
1673
|
|
|
1674
1674
|
const ModalHeader = (props) => {
|
|
1675
|
-
const { children, isDismissable = false, onClose } = props;
|
|
1675
|
+
const { children, isDismissable = false, onClose } = props, rest = __rest(props, ["children", "isDismissable", "onClose"]);
|
|
1676
1676
|
const handleClick = () => {
|
|
1677
1677
|
onClose && onClose();
|
|
1678
1678
|
};
|
|
1679
|
-
return (React.createElement("div", { className: "modal-header " + styles$h.modalHeader },
|
|
1679
|
+
return (React.createElement("div", Object.assign({ className: "modal-header " + styles$h.modalHeader }, rest),
|
|
1680
1680
|
React.createElement("h5", { className: "modal-title" }, children),
|
|
1681
1681
|
isDismissable &&
|
|
1682
1682
|
React.createElement(IconButton, { icon: React.createElement(TimesSolidIcon, null), variant: VARIANT.text, onClick: handleClick })));
|
|
@@ -1717,7 +1717,7 @@ const Modal = (props) => {
|
|
|
1717
1717
|
return (React.createElement(Fragment, null,
|
|
1718
1718
|
React.createElement("div", { className: "modal show " + styles$g.modal, style: { display: 'block' } },
|
|
1719
1719
|
React.createElement("div", { className: getCssClass() },
|
|
1720
|
-
React.createElement("div", { className: 'modal-content ' + (
|
|
1720
|
+
React.createElement("div", { className: 'modal-content ' + (fullScreen ? styles$g['modalContent'] : undefined) },
|
|
1721
1721
|
header &&
|
|
1722
1722
|
React.createElement(ModalHeader, { isDismissable: isDismissable, onClose: () => onHeaderCloseClick && onHeaderCloseClick() }, header),
|
|
1723
1723
|
React.createElement(ModalBody, null, children),
|
|
@@ -1946,7 +1946,7 @@ class SnackbarService {
|
|
|
1946
1946
|
show(message, options) {
|
|
1947
1947
|
const defaultOptions = { timeout: 3000, actionText: 'ok', color: COLOR.dark, target: document.body };
|
|
1948
1948
|
const mergedOptions = Object.assign(defaultOptions, options);
|
|
1949
|
-
return new Promise((resolve
|
|
1949
|
+
return new Promise((resolve) => {
|
|
1950
1950
|
if (this.container) {
|
|
1951
1951
|
this.hide();
|
|
1952
1952
|
}
|
|
@@ -1969,8 +1969,8 @@ class SnackbarService {
|
|
|
1969
1969
|
if (this.container) {
|
|
1970
1970
|
unmountComponentAtNode(this.container);
|
|
1971
1971
|
document.body.removeChild(this.container);
|
|
1972
|
-
this.container =
|
|
1973
|
-
clearTimeout(this.handler);
|
|
1972
|
+
this.container = undefined;
|
|
1973
|
+
this.handler && clearTimeout(this.handler);
|
|
1974
1974
|
}
|
|
1975
1975
|
}
|
|
1976
1976
|
}
|
|
@@ -2124,7 +2124,7 @@ const Stepper = (props) => {
|
|
|
2124
2124
|
isDisabled: isLinear && (activeIndex + 1 < index),
|
|
2125
2125
|
showLabel: showLabel,
|
|
2126
2126
|
showProgressCheckIcon: showProgressCheckIcon,
|
|
2127
|
-
onClick: (
|
|
2127
|
+
onClick: (e) => handleClickStep(e.event, e.value, index)
|
|
2128
2128
|
});
|
|
2129
2129
|
};
|
|
2130
2130
|
const isStepOptional = (index) => {
|
|
@@ -2217,9 +2217,9 @@ styleInject(css_248z$6);
|
|
|
2217
2217
|
const Step = (props) => {
|
|
2218
2218
|
const { className, label, showLabel, index, value, isActive, isDone, isDisabled, showProgressCheckIcon, onClick } = props;
|
|
2219
2219
|
const [hoverRef, isHovered] = useHover();
|
|
2220
|
-
const handleClick = (
|
|
2220
|
+
const handleClick = (event) => {
|
|
2221
2221
|
if (!isDisabled) {
|
|
2222
|
-
onClick && onClick(
|
|
2222
|
+
onClick && onClick({ event, value });
|
|
2223
2223
|
}
|
|
2224
2224
|
};
|
|
2225
2225
|
const getCssClasses = () => {
|
|
@@ -2237,11 +2237,18 @@ const Step = (props) => {
|
|
|
2237
2237
|
isDisabled && cssClasses.push(styles$6['disabled']);
|
|
2238
2238
|
return cssClasses.filter(css => css).join(' ');
|
|
2239
2239
|
};
|
|
2240
|
+
const getCssClassesStepValue = () => {
|
|
2241
|
+
const cssClasses = [];
|
|
2242
|
+
cssClasses.push(styles$6.stepValue);
|
|
2243
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2244
|
+
isActive && cssClasses.push(styles$6.stepValue['isActive']);
|
|
2245
|
+
return cssClasses.filter(css => css).join(' ');
|
|
2246
|
+
};
|
|
2240
2247
|
return (React.createElement("div", { ref: hoverRef, className: getCssClasses(), onClick: handleClick },
|
|
2241
2248
|
React.createElement("div", { className: getCssClassesStep() },
|
|
2242
2249
|
React.createElement(Icon, { className: styles$6.stepIconCircle, iconColor: (isHovered || isActive) && !isDisabled ? COLOR.primary : COLOR.secondary },
|
|
2243
2250
|
React.createElement(CircleSolidIcon, null)),
|
|
2244
|
-
React.createElement("div", { className:
|
|
2251
|
+
React.createElement("div", { className: getCssClassesStepValue() }, showProgressCheckIcon && isActive && isDone ?
|
|
2245
2252
|
React.createElement(Icon, null,
|
|
2246
2253
|
React.createElement(CheckSolidIcon, null))
|
|
2247
2254
|
:
|
|
@@ -2307,17 +2314,17 @@ const Tabs = (props) => {
|
|
|
2307
2314
|
const handleClickTab = (event, newValue, index) => {
|
|
2308
2315
|
setSelectedValue(newValue);
|
|
2309
2316
|
setSelectedIndex(index);
|
|
2310
|
-
onChange && onChange(event, newValue);
|
|
2317
|
+
onChange && onChange({ event, newValue });
|
|
2311
2318
|
};
|
|
2312
2319
|
const renderTabs = (child, index) => {
|
|
2313
2320
|
return React.isValidElement(child) && cloneElement(child, {
|
|
2314
2321
|
key: child.props.value,
|
|
2315
2322
|
isActive: child.props.value === selectedValue,
|
|
2316
2323
|
fixed: fixed,
|
|
2317
|
-
onClick: (
|
|
2324
|
+
onClick: (e) => handleClickTab(e.event, e.value, index),
|
|
2318
2325
|
});
|
|
2319
2326
|
};
|
|
2320
|
-
return (React.createElement(Fragment, null,
|
|
2327
|
+
return (React.createElement(React.Fragment, null,
|
|
2321
2328
|
React.createElement("div", { className: getCssClasses() },
|
|
2322
2329
|
children && React.Children.toArray(children).map((child, index) => renderTabs(child, index)),
|
|
2323
2330
|
children &&
|
|
@@ -2339,11 +2346,11 @@ const Tab = (props) => {
|
|
|
2339
2346
|
className && cssClasses.push(className);
|
|
2340
2347
|
return cssClasses.filter(css => css).join(' ');
|
|
2341
2348
|
};
|
|
2342
|
-
return (React.createElement(Button, { className: getCssClasses(), onClick: (event) => onClick && onClick(event, value), isActive: isActive, disabled: disabled }, label));
|
|
2349
|
+
return (React.createElement(Button, { className: getCssClasses(), onClick: (event) => onClick && onClick({ event, value }), isActive: isActive, disabled: disabled }, label));
|
|
2343
2350
|
};
|
|
2344
2351
|
|
|
2345
2352
|
const TabPanel = (props) => {
|
|
2346
|
-
const { children,
|
|
2353
|
+
const { children, value, index } = props, rest = __rest(props, ["children", "value", "index"]);
|
|
2347
2354
|
return (React.createElement("div", Object.assign({ role: "tabpanel", hidden: value !== index, id: `tabpanel-${index}`, "aria-labelledby": `wrapped-tab-${index}` }, rest), value === index && children));
|
|
2348
2355
|
};
|
|
2349
2356
|
|
|
@@ -2354,10 +2361,10 @@ styleInject(css_248z$2);
|
|
|
2354
2361
|
const Tooltip = (props) => {
|
|
2355
2362
|
const { children, text, placement = 'bottom' } = props;
|
|
2356
2363
|
const [show, setShow] = useState(false);
|
|
2357
|
-
const refChild = useRef(
|
|
2358
|
-
const refTooltip = useRef(
|
|
2364
|
+
const refChild = useRef();
|
|
2365
|
+
const refTooltip = useRef();
|
|
2359
2366
|
useEffect(() => {
|
|
2360
|
-
if (show === true && refChild && refChild.current) {
|
|
2367
|
+
if (show === true && refChild && refChild.current && refTooltip && refTooltip.current) {
|
|
2361
2368
|
// TODO - extract to own component?
|
|
2362
2369
|
createPopper(refChild.current, refTooltip.current, {
|
|
2363
2370
|
placement: placement,
|
|
@@ -2376,7 +2383,7 @@ const Tooltip = (props) => {
|
|
|
2376
2383
|
const handleMouseLeave = () => {
|
|
2377
2384
|
setShow(false);
|
|
2378
2385
|
};
|
|
2379
|
-
return (React.createElement(Fragment, null,
|
|
2386
|
+
return (React.createElement(React.Fragment, null,
|
|
2380
2387
|
React.createElement("div", { className: styles$2.tooltipContainer, ref: refChild, id: "tooltip-container" }, cloneElement(children, {
|
|
2381
2388
|
onMouseOver: handleMouseOver,
|
|
2382
2389
|
onMouseLeave: handleMouseLeave,
|
|
@@ -2546,7 +2553,7 @@ var styles = {"treeItem":"TreeItem-module_treeItem__Mxsjr"};
|
|
|
2546
2553
|
styleInject(css_248z);
|
|
2547
2554
|
|
|
2548
2555
|
const TreeItem = (props) => {
|
|
2549
|
-
const { nodeId, label, children, className, isExpanded, isSelected, isSelectable, onToggleExpand,
|
|
2556
|
+
const { nodeId, label, children, className, isExpanded, isSelected, isSelectable, onToggleExpand, onItemSelect } = props;
|
|
2550
2557
|
const [_isExpanded, setIsExpanded] = useState(false);
|
|
2551
2558
|
const [_isSelected, setIsSelected] = useState(false);
|
|
2552
2559
|
const getCssClasses = () => {
|
|
@@ -2569,7 +2576,7 @@ const TreeItem = (props) => {
|
|
|
2569
2576
|
};
|
|
2570
2577
|
const handleOnSelect = (nodeId) => {
|
|
2571
2578
|
setIsSelected(!_isSelected);
|
|
2572
|
-
|
|
2579
|
+
onItemSelect && onItemSelect({ id: nodeId, isSelected: !_isSelected });
|
|
2573
2580
|
};
|
|
2574
2581
|
return (React.createElement("li", { className: getCssClasses(), style: { paddingLeft: `${(48 * (children ? 0 : 1))}px` } },
|
|
2575
2582
|
React.createElement("div", { className: "d-flex align-items-center" },
|