@adminforth/upload 1.4.3 → 1.4.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/build.log CHANGED
@@ -11,5 +11,5 @@ custom/preview.vue
11
11
  custom/tsconfig.json
12
12
  custom/uploader.vue
13
13
 
14
- sent 42,322 bytes received 134 bytes 84,912.00 bytes/sec
14
+ sent 42,329 bytes received 134 bytes 84,926.00 bytes/sec
15
15
  total size is 41,840 speedup is 0.99
package/dist/index.js CHANGED
@@ -99,7 +99,7 @@ getBucketLifecycleConfiguration on bucket ${this.options.s3Bucket} in region ${t
99
99
  modifyResourceConfig: { get: () => super.modifyResourceConfig }
100
100
  });
101
101
  return __awaiter(this, void 0, void 0, function* () {
102
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
102
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
103
103
  _super.modifyResourceConfig.call(this, adminforth, resourceConfig);
104
104
  // after column to store the path of the uploaded file, add new VirtualColumn,
105
105
  // show only in edit and create views
@@ -162,14 +162,16 @@ getBucketLifecycleConfiguration on bucket ${this.options.s3Bucket} in region ${t
162
162
  }
163
163
  const pathColumn = resourceConfig.columns[pathColumnIndex];
164
164
  // add preview column to list
165
- resourceConfig.columns[pathColumnIndex].components.list = {
166
- file: this.componentPath('preview.vue'),
167
- meta: pluginFrontendOptions,
168
- };
169
- resourceConfig.columns[pathColumnIndex].components.show = {
170
- file: this.componentPath('preview.vue'),
171
- meta: pluginFrontendOptions,
172
- };
165
+ if (((_l = this.options.preview) === null || _l === void 0 ? void 0 : _l.usePreviewComponents) !== false) {
166
+ resourceConfig.columns[pathColumnIndex].components.list = {
167
+ file: this.componentPath('preview.vue'),
168
+ meta: pluginFrontendOptions,
169
+ };
170
+ resourceConfig.columns[pathColumnIndex].components.show = {
171
+ file: this.componentPath('preview.vue'),
172
+ meta: pluginFrontendOptions,
173
+ };
174
+ }
173
175
  // insert virtual column after path column if it is not already there
174
176
  const virtualColumnIndex = resourceConfig.columns.findIndex((column) => column.name === virtualColumn.name);
175
177
  if (virtualColumnIndex === -1) {
package/index.ts CHANGED
@@ -165,15 +165,17 @@ getBucketLifecycleConfiguration on bucket ${this.options.s3Bucket} in region ${t
165
165
  const pathColumn = resourceConfig.columns[pathColumnIndex];
166
166
 
167
167
  // add preview column to list
168
- resourceConfig.columns[pathColumnIndex].components.list = {
169
- file: this.componentPath('preview.vue'),
170
- meta: pluginFrontendOptions,
171
- };
168
+ if (this.options.preview?.usePreviewComponents !== false) {
169
+ resourceConfig.columns[pathColumnIndex].components.list = {
170
+ file: this.componentPath('preview.vue'),
171
+ meta: pluginFrontendOptions,
172
+ };
172
173
 
173
- resourceConfig.columns[pathColumnIndex].components.show = {
174
- file: this.componentPath('preview.vue'),
175
- meta: pluginFrontendOptions,
176
- };
174
+ resourceConfig.columns[pathColumnIndex].components.show = {
175
+ file: this.componentPath('preview.vue'),
176
+ meta: pluginFrontendOptions,
177
+ };
178
+ }
177
179
 
178
180
  // insert virtual column after path column if it is not already there
179
181
  const virtualColumnIndex = resourceConfig.columns.findIndex((column: any) => column.name === virtualColumn.name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/upload",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "description": "Plugin for uploading files for adminforth",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/types.ts CHANGED
@@ -65,6 +65,11 @@ export type PluginOptions = {
65
65
 
66
66
  preview?: {
67
67
 
68
+ /**
69
+ * Whether to use preview components provided by the plugin. BY default true
70
+ */
71
+ usePreviewComponents?: boolean,
72
+
68
73
  /**
69
74
  * Maximum width of the preview image
70
75
  */