aefis-core-ui 2.1.8-rc4 → 2.1.8-rc5
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/index.modern.js +76 -44
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -719,7 +719,8 @@ const severityObject = {
|
|
|
719
719
|
warning: "warning",
|
|
720
720
|
error: "error",
|
|
721
721
|
success: "success",
|
|
722
|
-
hint: "info"
|
|
722
|
+
hint: "info",
|
|
723
|
+
basic: "info"
|
|
723
724
|
};
|
|
724
725
|
const DismissableAlert = props => {
|
|
725
726
|
const [open, setOpen] = useState(true);
|
|
@@ -781,6 +782,10 @@ const Alert = /*#__PURE__*/forwardRef(function Alert(props, ref) {
|
|
|
781
782
|
//style.color = props.variant === "dark" ? "#ffffff" : deepPurple[900];
|
|
782
783
|
}
|
|
783
784
|
|
|
785
|
+
if (props.type === "basic") {
|
|
786
|
+
style.backgroundColor = "transparent";
|
|
787
|
+
style.color = "#757575";
|
|
788
|
+
}
|
|
784
789
|
return /*#__PURE__*/jsx(Box$1, {
|
|
785
790
|
sx: {
|
|
786
791
|
width: "100%"
|
|
@@ -815,7 +820,7 @@ Alert.defaultProps = {
|
|
|
815
820
|
};
|
|
816
821
|
Alert.propTypes = {
|
|
817
822
|
/** The type of alert. */
|
|
818
|
-
type: PropTypes.oneOf(["info", "warning", "error", "success", "hint"]),
|
|
823
|
+
type: PropTypes.oneOf(["info", "warning", "error", "success", "hint", "basic"]),
|
|
819
824
|
/** The color variant of the alert. */
|
|
820
825
|
variant: PropTypes.oneOf(["dark", "light"]),
|
|
821
826
|
/** The title to display in the alert. */
|
|
@@ -16264,6 +16269,7 @@ const BadgeKeywordFieldReadOnly = props => {
|
|
|
16264
16269
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
16265
16270
|
gutterBottom: true,
|
|
16266
16271
|
variant: "subtitle2",
|
|
16272
|
+
component: "h2",
|
|
16267
16273
|
children: props.schema.title
|
|
16268
16274
|
}), /*#__PURE__*/jsx("div", {
|
|
16269
16275
|
style: {
|
|
@@ -16335,6 +16341,7 @@ const ReadOnlyView = ({
|
|
|
16335
16341
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
16336
16342
|
gutterBottom: true,
|
|
16337
16343
|
variant: "subtitle2",
|
|
16344
|
+
component: "h2",
|
|
16338
16345
|
children: label
|
|
16339
16346
|
}), /*#__PURE__*/jsx(Typography, {
|
|
16340
16347
|
variant: "h3",
|
|
@@ -16349,9 +16356,13 @@ const ReadOnlyView = ({
|
|
|
16349
16356
|
const isEmpty = value == undefined || value === "" || Array.isArray(value) && value.length === 0;
|
|
16350
16357
|
if (isEmpty) {
|
|
16351
16358
|
const _emptyViewText = emptyViewText || `No data ${multiple ? "selected" : "provided"} for this field`;
|
|
16352
|
-
return /*#__PURE__*/jsx(Alert
|
|
16353
|
-
|
|
16354
|
-
|
|
16359
|
+
return /*#__PURE__*/jsx(Alert, {
|
|
16360
|
+
type: "basic",
|
|
16361
|
+
sx: {
|
|
16362
|
+
fontStyle: "italic"
|
|
16363
|
+
},
|
|
16364
|
+
description: _emptyViewText,
|
|
16365
|
+
showIcon: false
|
|
16355
16366
|
});
|
|
16356
16367
|
}
|
|
16357
16368
|
if (multiple) {
|
|
@@ -16372,6 +16383,7 @@ const ReadOnlyView = ({
|
|
|
16372
16383
|
return /*#__PURE__*/jsx(Typography, {
|
|
16373
16384
|
color: "text.secondary",
|
|
16374
16385
|
variant: "body1",
|
|
16386
|
+
component: "p",
|
|
16375
16387
|
children: value
|
|
16376
16388
|
});
|
|
16377
16389
|
}, [value]);
|
|
@@ -16380,6 +16392,7 @@ const ReadOnlyView = ({
|
|
|
16380
16392
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
16381
16393
|
gutterBottom: true,
|
|
16382
16394
|
variant: "subtitle2",
|
|
16395
|
+
component: "h2",
|
|
16383
16396
|
children: label
|
|
16384
16397
|
}), renderValue()]
|
|
16385
16398
|
});
|
|
@@ -16389,7 +16402,8 @@ ReadOnlyView.propTypes = {
|
|
|
16389
16402
|
renderValue: PropTypes.func,
|
|
16390
16403
|
value: PropTypes.any,
|
|
16391
16404
|
emptyViewText: PropTypes.string,
|
|
16392
|
-
multiple: PropTypes.bool
|
|
16405
|
+
multiple: PropTypes.bool,
|
|
16406
|
+
loading: PropTypes.bool
|
|
16393
16407
|
};
|
|
16394
16408
|
|
|
16395
16409
|
const useSelector = (selector, defaultValue) => {
|
|
@@ -18558,6 +18572,7 @@ TextWidgetReadOnly.propTypes = {
|
|
|
18558
18572
|
value: PropTypes.any
|
|
18559
18573
|
};
|
|
18560
18574
|
const TextWidget = props => {
|
|
18575
|
+
var _props$uiSchema$uiOp;
|
|
18561
18576
|
// INFO: debouncing added for performance concerns
|
|
18562
18577
|
const handleChange = useDebounceCallback(e => {
|
|
18563
18578
|
props.onChange(e.target.value || undefined);
|
|
@@ -18565,46 +18580,62 @@ const TextWidget = props => {
|
|
|
18565
18580
|
const {
|
|
18566
18581
|
error
|
|
18567
18582
|
} = useFormControl();
|
|
18568
|
-
|
|
18569
|
-
|
|
18570
|
-
|
|
18571
|
-
|
|
18572
|
-
|
|
18573
|
-
|
|
18574
|
-
|
|
18575
|
-
|
|
18576
|
-
|
|
18577
|
-
|
|
18578
|
-
|
|
18579
|
-
|
|
18580
|
-
|
|
18581
|
-
|
|
18582
|
-
|
|
18583
|
-
|
|
18584
|
-
|
|
18585
|
-
|
|
18586
|
-
|
|
18587
|
-
|
|
18588
|
-
|
|
18589
|
-
|
|
18590
|
-
|
|
18591
|
-
|
|
18592
|
-
|
|
18593
|
-
|
|
18594
|
-
|
|
18595
|
-
|
|
18596
|
-
|
|
18597
|
-
|
|
18598
|
-
|
|
18599
|
-
|
|
18600
|
-
|
|
18601
|
-
|
|
18602
|
-
|
|
18603
|
-
|
|
18604
|
-
|
|
18605
|
-
|
|
18583
|
+
const message = ((_props$uiSchema$uiOp = props.uiSchema["ui:options"]) == null ? void 0 : _props$uiSchema$uiOp.message) || undefined;
|
|
18584
|
+
const messageProps = {
|
|
18585
|
+
title: (message == null ? void 0 : message.title) || undefined,
|
|
18586
|
+
description: (message == null ? void 0 : message.description) || undefined,
|
|
18587
|
+
type: (message == null ? void 0 : message.type) || "info",
|
|
18588
|
+
canDismiss: (message == null ? void 0 : message.canDismiss) || true
|
|
18589
|
+
};
|
|
18590
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
18591
|
+
children: [/*#__PURE__*/jsx(TextField, {
|
|
18592
|
+
id: props.id,
|
|
18593
|
+
error: error,
|
|
18594
|
+
disabled: props.disabled,
|
|
18595
|
+
label: props.schema.title,
|
|
18596
|
+
required: props.required,
|
|
18597
|
+
defaultValue: props.value
|
|
18598
|
+
// value={props.value}
|
|
18599
|
+
// INFO: for performance concerns, textfield is NOT controlled field. This will prevent his field to be changed outside of
|
|
18600
|
+
// Once concurrency pattern implemented with React 18, it can be
|
|
18601
|
+
// controlled as other fields value={props.value || ""}
|
|
18602
|
+
// onChange={(event) => props.onChange(event.target.value || null)}
|
|
18603
|
+
,
|
|
18604
|
+
onChange: handleChange,
|
|
18605
|
+
autoComplete: "off",
|
|
18606
|
+
variant: "outlined",
|
|
18607
|
+
InputProps: {
|
|
18608
|
+
readOnly: props.readonly,
|
|
18609
|
+
startAdornment: props.options.prefix ? /*#__PURE__*/jsx(InputAdornment, {
|
|
18610
|
+
position: "start",
|
|
18611
|
+
style: {
|
|
18612
|
+
fontSize: 14
|
|
18613
|
+
},
|
|
18614
|
+
children: props.options.prefix
|
|
18615
|
+
}) : null,
|
|
18616
|
+
endAdornment: props.options.suffix ? /*#__PURE__*/jsx(InputAdornment, {
|
|
18617
|
+
position: "end",
|
|
18618
|
+
style: {
|
|
18619
|
+
fontSize: 14
|
|
18620
|
+
},
|
|
18621
|
+
children: props.options.suffix
|
|
18622
|
+
}) : null
|
|
18623
|
+
},
|
|
18624
|
+
sx: {
|
|
18625
|
+
width: "100%"
|
|
18626
|
+
},
|
|
18627
|
+
type: props.schema.format,
|
|
18628
|
+
placeholder: props.schema.placeholder
|
|
18629
|
+
}), message && /*#__PURE__*/jsx(Alert, _extends({
|
|
18630
|
+
sx: {
|
|
18631
|
+
mt: 1
|
|
18632
|
+
}
|
|
18633
|
+
}, messageProps))]
|
|
18606
18634
|
});
|
|
18607
18635
|
};
|
|
18636
|
+
TextWidget.defaultProps = {
|
|
18637
|
+
uiSchema: {}
|
|
18638
|
+
};
|
|
18608
18639
|
TextWidget.propTypes = {
|
|
18609
18640
|
disabled: PropTypes.any,
|
|
18610
18641
|
id: PropTypes.any,
|
|
@@ -18621,6 +18652,7 @@ TextWidget.propTypes = {
|
|
|
18621
18652
|
placeholder: PropTypes.any,
|
|
18622
18653
|
title: PropTypes.any
|
|
18623
18654
|
}),
|
|
18655
|
+
uiSchema: PropTypes.any,
|
|
18624
18656
|
value: PropTypes.any
|
|
18625
18657
|
};
|
|
18626
18658
|
const HOCs$1 = [...commonWidgetHOCs, withReadyOnly(TextWidgetReadOnly), withEvalDisable()];
|