aefis-core-ui 2.1.5 → 2.1.6-rc1
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 +53 -34
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -2049,7 +2049,8 @@ const ContentBox = props => {
|
|
|
2049
2049
|
height: props.imageHeight,
|
|
2050
2050
|
backgroundColor: props.imageBackgroundColor ? props.imageBackgroundColor : "transparent"
|
|
2051
2051
|
} : {};
|
|
2052
|
-
return /*#__PURE__*/jsxs(
|
|
2052
|
+
return /*#__PURE__*/jsxs(Box$1, {
|
|
2053
|
+
sx: props.sx,
|
|
2053
2054
|
style: props.containerStyle,
|
|
2054
2055
|
children: [props.header && /*#__PURE__*/jsx("div", {
|
|
2055
2056
|
className: classes.sectionHeader,
|
|
@@ -2153,7 +2154,9 @@ ContentBox.propTypes = {
|
|
|
2153
2154
|
/** Additional styles for the card */
|
|
2154
2155
|
cardStyle: PropTypes.any,
|
|
2155
2156
|
/** Additional styles for the content box container */
|
|
2156
|
-
containerStyle: PropTypes.any
|
|
2157
|
+
containerStyle: PropTypes.any,
|
|
2158
|
+
/** Additional styles to apply */
|
|
2159
|
+
sx: PropTypes.object
|
|
2157
2160
|
};
|
|
2158
2161
|
|
|
2159
2162
|
const defaultColorPalette = {
|
|
@@ -3617,7 +3620,6 @@ const IsometricImage = _ref => {
|
|
|
3617
3620
|
} = _ref,
|
|
3618
3621
|
other = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
|
3619
3622
|
const image = getIsometricImage(type);
|
|
3620
|
-
console.log("image ", image);
|
|
3621
3623
|
return /*#__PURE__*/jsx(Image, _extends({
|
|
3622
3624
|
src: image
|
|
3623
3625
|
}, other));
|
|
@@ -6800,7 +6802,7 @@ const setQueryStringWithoutPageReload = qsValue => {
|
|
|
6800
6802
|
}, "", newurl);
|
|
6801
6803
|
};
|
|
6802
6804
|
const setQueryStringValue = (key, value, queryString = window.location.search) => {
|
|
6803
|
-
const values = qs.parse(queryString);
|
|
6805
|
+
const values = qs.parse(queryString, options);
|
|
6804
6806
|
const newQsValue = qs.stringify(_extends({}, values, {
|
|
6805
6807
|
[key]: value
|
|
6806
6808
|
}), options);
|
|
@@ -8348,6 +8350,8 @@ const FilterPanel = props => {
|
|
|
8348
8350
|
const [pickerFilters, setPickerFilters] = useState([]);
|
|
8349
8351
|
useEffect(() => {
|
|
8350
8352
|
const formattedFilters = formatFilters(filtersProp, configuration);
|
|
8353
|
+
console.log("filtersProp ", filtersProp);
|
|
8354
|
+
console.log("formattedFilters ", formattedFilters);
|
|
8351
8355
|
setFilters(formattedFilters);
|
|
8352
8356
|
}, [filtersProp]);
|
|
8353
8357
|
|
|
@@ -11178,9 +11182,6 @@ const BusinessObjectPicker = _ref => {
|
|
|
11178
11182
|
const handleIsOptionEqualToValue = useCallback((a, b) => getKey(a) == getKey(b), []);
|
|
11179
11183
|
const renderCustomTags = useCallback(value => value.map(option => /*#__PURE__*/jsx(Box$1, {
|
|
11180
11184
|
children: /*#__PURE__*/jsx(Chip, {
|
|
11181
|
-
sx: {
|
|
11182
|
-
margin: 0.1
|
|
11183
|
-
},
|
|
11184
11185
|
id: getKey(option),
|
|
11185
11186
|
label: getLabel(option),
|
|
11186
11187
|
tooltipText: option.description,
|
|
@@ -11190,9 +11191,6 @@ const BusinessObjectPicker = _ref => {
|
|
|
11190
11191
|
})
|
|
11191
11192
|
}, getKey(option))), [props.size, getKey, getLabel, handleTagDelete]);
|
|
11192
11193
|
const renderTypeTags = useCallback(value => value.map(option => /*#__PURE__*/jsx(Box$1, {
|
|
11193
|
-
sx: {
|
|
11194
|
-
margin: 0.1
|
|
11195
|
-
},
|
|
11196
11194
|
children: /*#__PURE__*/jsx(BusinessObject, {
|
|
11197
11195
|
type: props.type,
|
|
11198
11196
|
data: option,
|
|
@@ -15859,7 +15857,50 @@ const useSelector = (selector, defaultValue) => {
|
|
|
15859
15857
|
}, [value]);
|
|
15860
15858
|
};
|
|
15861
15859
|
|
|
15860
|
+
// https://stackoverflow.com/questions/7394748/whats-the-right-way-to-decode-a-string-that-has-special-html-entities-in-it/7394787#7394787
|
|
15861
|
+
const decodeHtml$2 = html => {
|
|
15862
|
+
const textarea = document.createElement("textarea");
|
|
15863
|
+
textarea.innerHTML = html;
|
|
15864
|
+
return textarea.value;
|
|
15865
|
+
};
|
|
15866
|
+
|
|
15867
|
+
const render = (value, formState) => {
|
|
15868
|
+
if (value === undefined || value === null) {
|
|
15869
|
+
return value;
|
|
15870
|
+
}
|
|
15871
|
+
return mustache.render(value, formState);
|
|
15872
|
+
};
|
|
15873
|
+
const renderUrl = (value, formState) => {
|
|
15874
|
+
if (value === undefined || value === null) {
|
|
15875
|
+
return value;
|
|
15876
|
+
}
|
|
15877
|
+
return decodeHtml$2(mustache.render(value, formState));
|
|
15878
|
+
};
|
|
15879
|
+
const useRenderUrl = template => useSelectFormState(state => renderUrl(template, state));
|
|
15880
|
+
const useRender = template => useSelectFormState(state => render(template, state));
|
|
15881
|
+
|
|
15882
|
+
const useQueryTemplateParam = queryTemplate => {
|
|
15883
|
+
const selector = useCallback(state => {
|
|
15884
|
+
const query = render(queryTemplate, state);
|
|
15885
|
+
const o = qs.parse(query);
|
|
15886
|
+
Object.keys(o).forEach(key => {
|
|
15887
|
+
if (o[key] === "" || o[key] == undefined) {
|
|
15888
|
+
delete o[key];
|
|
15889
|
+
}
|
|
15890
|
+
});
|
|
15891
|
+
return JSON.stringify(o);
|
|
15892
|
+
}, [queryTemplate]);
|
|
15893
|
+
const queryParams = useSelectFormState(selector);
|
|
15894
|
+
const object = useMemo(() => JSON.parse(queryParams), [queryParams]);
|
|
15895
|
+
return object;
|
|
15896
|
+
};
|
|
15897
|
+
|
|
15862
15898
|
const BusinessObjectPickerMemoized = /*#__PURE__*/React.memo(BusinessObjectPicker);
|
|
15899
|
+
const useQueryParam$2 = uiSchema => {
|
|
15900
|
+
const queryParamsSelected = useSelector(uiSchema["select:queryParams"]);
|
|
15901
|
+
const queryParamFromTemplate = useQueryTemplateParam(uiSchema.queryTemplate);
|
|
15902
|
+
return queryParamFromTemplate || queryParamsSelected;
|
|
15903
|
+
};
|
|
15863
15904
|
const BusinessObjectPickerFieldReadOnly = ({
|
|
15864
15905
|
formData: formDataProp,
|
|
15865
15906
|
schema,
|
|
@@ -15888,12 +15929,12 @@ const BusinessObjectPickerField = ({
|
|
|
15888
15929
|
required
|
|
15889
15930
|
}) => {
|
|
15890
15931
|
const formData = formDataProp || emptyArray;
|
|
15891
|
-
const queryParamsSelected = useSelector(uiSchema["select:queryParams"]);
|
|
15892
15932
|
const value = schema.type === "object" && isEmpty(formData) ? undefined : formData;
|
|
15893
15933
|
const {
|
|
15894
15934
|
error
|
|
15895
15935
|
} = useFormControl();
|
|
15896
15936
|
const label = uiSchema["ui:placeholder"] || schema.title;
|
|
15937
|
+
const query = useQueryParam$2(uiSchema);
|
|
15897
15938
|
return /*#__PURE__*/jsx(BusinessObjectPickerMemoized, _extends({
|
|
15898
15939
|
error: error,
|
|
15899
15940
|
value: value,
|
|
@@ -15903,7 +15944,7 @@ const BusinessObjectPickerField = ({
|
|
|
15903
15944
|
onChange: onChange,
|
|
15904
15945
|
required: required
|
|
15905
15946
|
}, uiSchema == null ? void 0 : uiSchema["ui:props"], {
|
|
15906
|
-
parameters:
|
|
15947
|
+
parameters: query
|
|
15907
15948
|
}));
|
|
15908
15949
|
};
|
|
15909
15950
|
BusinessObjectPickerField.propTypes = {
|
|
@@ -16330,28 +16371,6 @@ const DisableWrapper = ({
|
|
|
16330
16371
|
}));
|
|
16331
16372
|
};
|
|
16332
16373
|
|
|
16333
|
-
// https://stackoverflow.com/questions/7394748/whats-the-right-way-to-decode-a-string-that-has-special-html-entities-in-it/7394787#7394787
|
|
16334
|
-
const decodeHtml$2 = html => {
|
|
16335
|
-
const textarea = document.createElement("textarea");
|
|
16336
|
-
textarea.innerHTML = html;
|
|
16337
|
-
return textarea.value;
|
|
16338
|
-
};
|
|
16339
|
-
|
|
16340
|
-
const render = (value, formState) => {
|
|
16341
|
-
if (value === undefined || value === null) {
|
|
16342
|
-
return value;
|
|
16343
|
-
}
|
|
16344
|
-
return mustache.render(value, formState);
|
|
16345
|
-
};
|
|
16346
|
-
const renderUrl = (value, formState) => {
|
|
16347
|
-
if (value === undefined || value === null) {
|
|
16348
|
-
return value;
|
|
16349
|
-
}
|
|
16350
|
-
return decodeHtml$2(mustache.render(value, formState));
|
|
16351
|
-
};
|
|
16352
|
-
const useRenderUrl = template => useSelectFormState(state => renderUrl(template, state));
|
|
16353
|
-
const useRender = template => useSelectFormState(state => render(template, state));
|
|
16354
|
-
|
|
16355
16374
|
const ImageUploadReadOnly = ({
|
|
16356
16375
|
formData,
|
|
16357
16376
|
schema,
|