@steroidsjs/core 2.2.80 → 2.2.83
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/actions/list.d.ts +2 -1
- package/actions/list.js +9 -5
- package/hooks/useDataProvider.js +7 -0
- package/hooks/useFile.js +4 -0
- package/package.json +1 -1
- package/ui/nav/Nav/Nav.js +1 -3
package/actions/list.d.ts
CHANGED
|
@@ -84,8 +84,9 @@ export declare const listDestroy: (listId: string) => {
|
|
|
84
84
|
listId: string;
|
|
85
85
|
type: string;
|
|
86
86
|
};
|
|
87
|
-
export declare const add: (listId: any, item: any) => {
|
|
87
|
+
export declare const add: (listId: any, item: any, prepend?: boolean) => {
|
|
88
88
|
item: any;
|
|
89
|
+
prepend: boolean;
|
|
89
90
|
listId: any;
|
|
90
91
|
type: string;
|
|
91
92
|
};
|
package/actions/list.js
CHANGED
|
@@ -269,11 +269,15 @@ var listDestroy = function (listId) {
|
|
|
269
269
|
};
|
|
270
270
|
};
|
|
271
271
|
exports.listDestroy = listDestroy;
|
|
272
|
-
var add = function (listId, item) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
272
|
+
var add = function (listId, item, prepend) {
|
|
273
|
+
if (prepend === void 0) { prepend = false; }
|
|
274
|
+
return ({
|
|
275
|
+
item: item,
|
|
276
|
+
prepend: prepend,
|
|
277
|
+
listId: listId,
|
|
278
|
+
type: exports.LIST_ITEM_ADD
|
|
279
|
+
});
|
|
280
|
+
};
|
|
277
281
|
exports.add = add;
|
|
278
282
|
var update = function (listId, item, condition) { return ({
|
|
279
283
|
item: item,
|
package/hooks/useDataProvider.js
CHANGED
|
@@ -105,6 +105,13 @@ function useDataProvider(config) {
|
|
|
105
105
|
setSourceInternalItems(value);
|
|
106
106
|
}
|
|
107
107
|
}, [reduxDataProviderId, dispatch]);
|
|
108
|
+
// Check change items from props
|
|
109
|
+
var prevInitialItems = react_use_1.usePrevious(initialItems);
|
|
110
|
+
react_1.useEffect(function () {
|
|
111
|
+
if (prevInitialItems && !isEqual_1["default"](prevInitialItems, initialItems)) {
|
|
112
|
+
setSourceInternalItems(initialItems);
|
|
113
|
+
}
|
|
114
|
+
}, [prevInitialItems, initialItems]);
|
|
108
115
|
// Normalize autoComplete
|
|
109
116
|
var autoComplete = react_1.useMemo(function () { return (__assign(__assign({}, defaultProps.autoComplete), (typeof config.autoComplete === 'boolean') ? { enable: config.autoComplete } : config.autoComplete)); }, [config.autoComplete]);
|
|
110
117
|
var dataProvider = react_1.useMemo(function () { return (__assign({ action: '', actionMethod: 'get', params: null, onSearch: null }, config.dataProvider)); }, [config.dataProvider]);
|
package/hooks/useFile.js
CHANGED
|
@@ -30,6 +30,10 @@ var imagesMimeTypes = [
|
|
|
30
30
|
'image/jpeg',
|
|
31
31
|
'image/pjpeg',
|
|
32
32
|
'image/png',
|
|
33
|
+
'image/heif',
|
|
34
|
+
'image/heic',
|
|
35
|
+
'image/heif-sequence',
|
|
36
|
+
'image/heic-sequence',
|
|
33
37
|
];
|
|
34
38
|
function generateBackendUrl(props) {
|
|
35
39
|
return buildURL_1["default"](props.backendUrl, {
|
package/package.json
CHANGED
package/ui/nav/Nav/Nav.js
CHANGED
|
@@ -76,12 +76,10 @@ function Nav(props) {
|
|
|
76
76
|
};
|
|
77
77
|
var onClick = react_1.useCallback(function (item, index) {
|
|
78
78
|
var newActiveTab = has_1["default"](item, 'id') ? item.id : index;
|
|
79
|
+
setActiveTab(newActiveTab);
|
|
79
80
|
if (props.onChange) {
|
|
80
81
|
props.onChange.call(null, newActiveTab);
|
|
81
82
|
}
|
|
82
|
-
else {
|
|
83
|
-
setActiveTab(newActiveTab);
|
|
84
|
-
}
|
|
85
83
|
}, [props.onChange]);
|
|
86
84
|
var items = react_1.useMemo(function () { return (Array.isArray(props.items)
|
|
87
85
|
? props.items.map(function (item, index) { return (__assign(__assign({}, item), { isActive: activeTab === (has_1["default"](item, 'id') ? item.id : index) })); })
|