@panneau/medias 3.0.209 → 3.0.210
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/es/index.js +33 -25
- package/lib/index.js +33 -25
- package/package.json +5 -5
package/es/index.js
CHANGED
@@ -496,7 +496,20 @@ function MediaForm(_ref) {
|
|
496
496
|
style: {
|
497
497
|
maxWidth: '66%'
|
498
498
|
}
|
499
|
-
}, /*#__PURE__*/React.createElement("
|
499
|
+
}, /*#__PURE__*/React.createElement("div", {
|
500
|
+
className: "me-3 mb-0"
|
501
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
502
|
+
theme: "secondary",
|
503
|
+
outline: true,
|
504
|
+
onClick: onClose,
|
505
|
+
icon: "arrow-left"
|
506
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
507
|
+
id: "8NyYTH",
|
508
|
+
defaultMessage: [{
|
509
|
+
"type": 0,
|
510
|
+
"value": "Back"
|
511
|
+
}]
|
512
|
+
}))), /*#__PURE__*/React.createElement("h4", {
|
500
513
|
className: "d-inline text-truncate mb-0"
|
501
514
|
}, name), /*#__PURE__*/React.createElement("span", {
|
502
515
|
className: "mx-2"
|
@@ -1068,6 +1081,7 @@ function MediasBrowser(_ref) {
|
|
1068
1081
|
withPreviousNext: true,
|
1069
1082
|
alwaysShowButtons: true
|
1070
1083
|
});
|
1084
|
+
var hidePagination = loaded && !loading && (items || []).length === 0;
|
1071
1085
|
var finalFilters = useMemo(function () {
|
1072
1086
|
var partialFilters = withTrash ? (filters || []).concat([{
|
1073
1087
|
name: 'trashed',
|
@@ -1114,7 +1128,11 @@ function MediasBrowser(_ref) {
|
|
1114
1128
|
return _objectSpread(_objectSpread({}, column), {}, {
|
1115
1129
|
actions: (actions || []).reduce(function (acc, action) {
|
1116
1130
|
if (action === 'delete') {
|
1117
|
-
acc.push(
|
1131
|
+
acc.push({
|
1132
|
+
id: 'restore',
|
1133
|
+
component: 'restore',
|
1134
|
+
withConfirmation: true
|
1135
|
+
});
|
1118
1136
|
}
|
1119
1137
|
acc.push(action);
|
1120
1138
|
return acc;
|
@@ -1162,26 +1180,14 @@ function MediasBrowser(_ref) {
|
|
1162
1180
|
|
1163
1181
|
return /*#__PURE__*/React.createElement("div", {
|
1164
1182
|
className: className
|
1165
|
-
}, currentMedia !== null ? /*#__PURE__*/React.createElement(
|
1166
|
-
className: "mt-2 mb-0"
|
1167
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
1168
|
-
theme: "primary",
|
1169
|
-
onClick: onCloseMedia,
|
1170
|
-
icon: "arrow-left"
|
1171
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
1172
|
-
id: "ac4218",
|
1173
|
-
defaultMessage: [{
|
1174
|
-
"type": 0,
|
1175
|
-
"value": "Back to files"
|
1176
|
-
}]
|
1177
|
-
}))), /*#__PURE__*/React.createElement(MediaForm, {
|
1183
|
+
}, currentMedia !== null ? /*#__PURE__*/React.createElement(MediaForm, {
|
1178
1184
|
value: currentMedia,
|
1179
1185
|
fields: fields,
|
1180
1186
|
onChange: setCurrentMedia,
|
1181
1187
|
onSave: onSaveMedia,
|
1182
1188
|
onClose: onCloseMedia,
|
1183
1189
|
withTrash: withTrash
|
1184
|
-
}, formChildren)
|
1190
|
+
}, formChildren) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
1185
1191
|
className: classNames(['d-flex', 'justify-content-between'])
|
1186
1192
|
}, filters !== null ? /*#__PURE__*/React.createElement(Filters, {
|
1187
1193
|
value: query,
|
@@ -1216,10 +1222,10 @@ function MediasBrowser(_ref) {
|
|
1216
1222
|
onClick: function onClick() {
|
1217
1223
|
return onClickLayout(lay.id);
|
1218
1224
|
},
|
1219
|
-
className: 'px-3'
|
1225
|
+
className: 'px-3 py-2'
|
1220
1226
|
});
|
1221
1227
|
})
|
1222
|
-
}) : null, pagination), layout === 'grid' ? /*#__PURE__*/React.createElement(Grid, {
|
1228
|
+
}) : null, !hidePagination ? pagination : /*#__PURE__*/React.createElement("div", null)), layout === 'grid' ? /*#__PURE__*/React.createElement(Grid, {
|
1223
1229
|
size: "small",
|
1224
1230
|
theme: theme,
|
1225
1231
|
component: MediaCard,
|
@@ -1259,14 +1265,16 @@ function MediasBrowser(_ref) {
|
|
1259
1265
|
var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
1260
1266
|
_ref10$id = _ref10.id,
|
1261
1267
|
id = _ref10$id === void 0 ? null : _ref10$id;
|
1262
|
-
return {
|
1268
|
+
return _objectSpread({
|
1263
1269
|
href: null,
|
1264
|
-
|
1265
|
-
return !showTrashed && withTrash ? mediaTrash(id) : mediaDelete(id);
|
1266
|
-
},
|
1270
|
+
withConfirmation: true,
|
1267
1271
|
disabled: trashing || deleting,
|
1268
1272
|
icon: showTrashed ? 'trash-fill' : 'trash'
|
1269
|
-
}
|
1273
|
+
}, withTrash ? {
|
1274
|
+
onClick: function onClick() {
|
1275
|
+
return !showTrashed && withTrash ? mediaTrash(id) : mediaDelete(id);
|
1276
|
+
}
|
1277
|
+
} : null);
|
1270
1278
|
},
|
1271
1279
|
getEditPropsFromItem: function getEditPropsFromItem(it) {
|
1272
1280
|
return {
|
@@ -1277,9 +1285,9 @@ function MediasBrowser(_ref) {
|
|
1277
1285
|
};
|
1278
1286
|
}
|
1279
1287
|
}
|
1280
|
-
}) : null, /*#__PURE__*/React.createElement("div", {
|
1288
|
+
}) : null, !hidePagination ? /*#__PURE__*/React.createElement("div", {
|
1281
1289
|
className: classNames(['d-flex', 'mt-3', 'mb-1', 'justify-content-end'])
|
1282
|
-
}, pagination)));
|
1290
|
+
}, pagination) : null));
|
1283
1291
|
}
|
1284
1292
|
MediasBrowser.propTypes = propTypes$5;
|
1285
1293
|
MediasBrowser.defaultProps = defaultProps$5;
|
package/lib/index.js
CHANGED
@@ -498,7 +498,20 @@ function MediaForm(_ref) {
|
|
498
498
|
style: {
|
499
499
|
maxWidth: '66%'
|
500
500
|
}
|
501
|
-
}, /*#__PURE__*/React.createElement("
|
501
|
+
}, /*#__PURE__*/React.createElement("div", {
|
502
|
+
className: "me-3 mb-0"
|
503
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
504
|
+
theme: "secondary",
|
505
|
+
outline: true,
|
506
|
+
onClick: onClose,
|
507
|
+
icon: "arrow-left"
|
508
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
509
|
+
id: "8NyYTH",
|
510
|
+
defaultMessage: [{
|
511
|
+
"type": 0,
|
512
|
+
"value": "Back"
|
513
|
+
}]
|
514
|
+
}))), /*#__PURE__*/React.createElement("h4", {
|
502
515
|
className: "d-inline text-truncate mb-0"
|
503
516
|
}, name), /*#__PURE__*/React.createElement("span", {
|
504
517
|
className: "mx-2"
|
@@ -1070,6 +1083,7 @@ function MediasBrowser(_ref) {
|
|
1070
1083
|
withPreviousNext: true,
|
1071
1084
|
alwaysShowButtons: true
|
1072
1085
|
});
|
1086
|
+
var hidePagination = loaded && !loading && (items || []).length === 0;
|
1073
1087
|
var finalFilters = React.useMemo(function () {
|
1074
1088
|
var partialFilters = withTrash ? (filters || []).concat([{
|
1075
1089
|
name: 'trashed',
|
@@ -1116,7 +1130,11 @@ function MediasBrowser(_ref) {
|
|
1116
1130
|
return _objectSpread(_objectSpread({}, column), {}, {
|
1117
1131
|
actions: (actions || []).reduce(function (acc, action) {
|
1118
1132
|
if (action === 'delete') {
|
1119
|
-
acc.push(
|
1133
|
+
acc.push({
|
1134
|
+
id: 'restore',
|
1135
|
+
component: 'restore',
|
1136
|
+
withConfirmation: true
|
1137
|
+
});
|
1120
1138
|
}
|
1121
1139
|
acc.push(action);
|
1122
1140
|
return acc;
|
@@ -1164,26 +1182,14 @@ function MediasBrowser(_ref) {
|
|
1164
1182
|
|
1165
1183
|
return /*#__PURE__*/React.createElement("div", {
|
1166
1184
|
className: className
|
1167
|
-
}, currentMedia !== null ? /*#__PURE__*/React.createElement(
|
1168
|
-
className: "mt-2 mb-0"
|
1169
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
1170
|
-
theme: "primary",
|
1171
|
-
onClick: onCloseMedia,
|
1172
|
-
icon: "arrow-left"
|
1173
|
-
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
1174
|
-
id: "ac4218",
|
1175
|
-
defaultMessage: [{
|
1176
|
-
"type": 0,
|
1177
|
-
"value": "Back to files"
|
1178
|
-
}]
|
1179
|
-
}))), /*#__PURE__*/React.createElement(MediaForm, {
|
1185
|
+
}, currentMedia !== null ? /*#__PURE__*/React.createElement(MediaForm, {
|
1180
1186
|
value: currentMedia,
|
1181
1187
|
fields: fields,
|
1182
1188
|
onChange: setCurrentMedia,
|
1183
1189
|
onSave: onSaveMedia,
|
1184
1190
|
onClose: onCloseMedia,
|
1185
1191
|
withTrash: withTrash
|
1186
|
-
}, formChildren)
|
1192
|
+
}, formChildren) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
1187
1193
|
className: classNames(['d-flex', 'justify-content-between'])
|
1188
1194
|
}, filters !== null ? /*#__PURE__*/React.createElement(Filters, {
|
1189
1195
|
value: query,
|
@@ -1218,10 +1224,10 @@ function MediasBrowser(_ref) {
|
|
1218
1224
|
onClick: function onClick() {
|
1219
1225
|
return onClickLayout(lay.id);
|
1220
1226
|
},
|
1221
|
-
className: 'px-3'
|
1227
|
+
className: 'px-3 py-2'
|
1222
1228
|
});
|
1223
1229
|
})
|
1224
|
-
}) : null, pagination), layout === 'grid' ? /*#__PURE__*/React.createElement(Grid, {
|
1230
|
+
}) : null, !hidePagination ? pagination : /*#__PURE__*/React.createElement("div", null)), layout === 'grid' ? /*#__PURE__*/React.createElement(Grid, {
|
1225
1231
|
size: "small",
|
1226
1232
|
theme: theme,
|
1227
1233
|
component: MediaCard,
|
@@ -1261,14 +1267,16 @@ function MediasBrowser(_ref) {
|
|
1261
1267
|
var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
1262
1268
|
_ref10$id = _ref10.id,
|
1263
1269
|
id = _ref10$id === void 0 ? null : _ref10$id;
|
1264
|
-
return {
|
1270
|
+
return _objectSpread({
|
1265
1271
|
href: null,
|
1266
|
-
|
1267
|
-
return !showTrashed && withTrash ? mediaTrash(id) : mediaDelete(id);
|
1268
|
-
},
|
1272
|
+
withConfirmation: true,
|
1269
1273
|
disabled: trashing || deleting,
|
1270
1274
|
icon: showTrashed ? 'trash-fill' : 'trash'
|
1271
|
-
}
|
1275
|
+
}, withTrash ? {
|
1276
|
+
onClick: function onClick() {
|
1277
|
+
return !showTrashed && withTrash ? mediaTrash(id) : mediaDelete(id);
|
1278
|
+
}
|
1279
|
+
} : null);
|
1272
1280
|
},
|
1273
1281
|
getEditPropsFromItem: function getEditPropsFromItem(it) {
|
1274
1282
|
return {
|
@@ -1279,9 +1287,9 @@ function MediasBrowser(_ref) {
|
|
1279
1287
|
};
|
1280
1288
|
}
|
1281
1289
|
}
|
1282
|
-
}) : null, /*#__PURE__*/React.createElement("div", {
|
1290
|
+
}) : null, !hidePagination ? /*#__PURE__*/React.createElement("div", {
|
1283
1291
|
className: classNames(['d-flex', 'mt-3', 'mb-1', 'justify-content-end'])
|
1284
|
-
}, pagination)));
|
1292
|
+
}, pagination) : null));
|
1285
1293
|
}
|
1286
1294
|
MediasBrowser.propTypes = propTypes$5;
|
1287
1295
|
MediasBrowser.defaultProps = defaultProps$5;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@panneau/medias",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.210",
|
4
4
|
"description": "",
|
5
5
|
"keywords": [
|
6
6
|
"javascript"
|
@@ -56,10 +56,10 @@
|
|
56
56
|
"@panneau/element-grid": "^3.0.209",
|
57
57
|
"@panneau/element-icon": "^3.0.194",
|
58
58
|
"@panneau/element-media-card": "^3.0.201",
|
59
|
-
"@panneau/element-media-player": "^3.0.
|
59
|
+
"@panneau/element-media-player": "^3.0.210",
|
60
60
|
"@panneau/element-pagination": "^3.0.194",
|
61
|
-
"@panneau/element-table": "^3.0.
|
62
|
-
"@panneau/field-upload": "^3.0.
|
61
|
+
"@panneau/element-table": "^3.0.210",
|
62
|
+
"@panneau/field-upload": "^3.0.210",
|
63
63
|
"@panneau/filter-filters": "^3.0.208",
|
64
64
|
"classnames": "^2.5.1",
|
65
65
|
"lodash": "^4.17.21",
|
@@ -69,5 +69,5 @@
|
|
69
69
|
"publishConfig": {
|
70
70
|
"access": "public"
|
71
71
|
},
|
72
|
-
"gitHead": "
|
72
|
+
"gitHead": "43a3318fcab6ff8fb8294ad640df584f01a7c156"
|
73
73
|
}
|