@operato/attachment 1.0.0-beta.9 → 1.0.6

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/CHANGELOG.md CHANGED
@@ -3,6 +3,397 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [1.0.6](https://github.com/hatiolab/operato/compare/v1.0.5...v1.0.6) (2022-07-31)
7
+
8
+ **Note:** Version bump only for package @operato/attachment
9
+
10
+
11
+
12
+
13
+
14
+ ### [1.0.5](https://github.com/hatiolab/operato/compare/v1.0.4...v1.0.5) (2022-07-31)
15
+
16
+ **Note:** Version bump only for package @operato/attachment
17
+
18
+
19
+
20
+
21
+
22
+ ### [1.0.4](https://github.com/hatiolab/operato/compare/v1.0.3...v1.0.4) (2022-07-31)
23
+
24
+ **Note:** Version bump only for package @operato/attachment
25
+
26
+
27
+
28
+
29
+
30
+ ### [1.0.3](https://github.com/hatiolab/operato/compare/v1.0.2...v1.0.3) (2022-07-31)
31
+
32
+
33
+ ### :bug: Bug Fix
34
+
35
+ * exports types ([ff5dc11](https://github.com/hatiolab/operato/commit/ff5dc119acbbf5a93459115f3929ba4a6720f9bb))
36
+
37
+
38
+
39
+ ### [1.0.1](https://github.com/hatiolab/operato/compare/v1.0.0...v1.0.1) (2022-07-25)
40
+
41
+
42
+ ### :bug: Bug Fix
43
+
44
+ * support ox-grist filters-form for ox-grist-editor-resource-object ([e7ffdaa](https://github.com/hatiolab/operato/commit/e7ffdaa9951a4596aff7ec7c60848570605c54ac))
45
+
46
+
47
+
48
+ ## [1.0.0](https://github.com/hatiolab/operato/compare/v1.0.0-beta.51...v1.0.0) (2022-07-24)
49
+
50
+ **Note:** Version bump only for package @operato/attachment
51
+
52
+
53
+
54
+
55
+
56
+ ## [1.0.0-beta.51](https://github.com/hatiolab/operato/compare/v1.0.0-beta.50...v1.0.0-beta.51) (2022-07-22)
57
+
58
+ **Note:** Version bump only for package @operato/attachment
59
+
60
+
61
+
62
+
63
+
64
+ ## [1.0.0-beta.50](https://github.com/hatiolab/operato/compare/v1.0.0-beta.49...v1.0.0-beta.50) (2022-07-18)
65
+
66
+ **Note:** Version bump only for package @operato/attachment
67
+
68
+
69
+
70
+
71
+
72
+ ## [1.0.0-beta.49](https://github.com/hatiolab/operato/compare/v1.0.0-beta.48...v1.0.0-beta.49) (2022-07-17)
73
+
74
+ **Note:** Version bump only for package @operato/attachment
75
+
76
+
77
+
78
+
79
+
80
+ ## [1.0.0-beta.48](https://github.com/hatiolab/operato/compare/v1.0.0-beta.47...v1.0.0-beta.48) (2022-07-17)
81
+
82
+ **Note:** Version bump only for package @operato/attachment
83
+
84
+
85
+
86
+
87
+
88
+ ## [1.0.0-beta.47](https://github.com/hatiolab/operato/compare/v1.0.0-beta.46...v1.0.0-beta.47) (2022-07-15)
89
+
90
+ **Note:** Version bump only for package @operato/attachment
91
+
92
+
93
+
94
+
95
+
96
+ ## [1.0.0-beta.46](https://github.com/hatiolab/operato/compare/v1.0.0-beta.45...v1.0.0-beta.46) (2022-07-11)
97
+
98
+
99
+ ### :bug: Bug Fix
100
+
101
+ * property-editor spec. changed ([b10e4ef](https://github.com/hatiolab/operato/commit/b10e4ef151450a0ca19cbf00c9c96da80ddaaed8))
102
+
103
+
104
+
105
+ ## [1.0.0-beta.45](https://github.com/hatiolab/operato/compare/v1.0.0-beta.44...v1.0.0-beta.45) (2022-07-09)
106
+
107
+
108
+ ### :bug: Bug Fix
109
+
110
+ * upgrade dependencies ([4986392](https://github.com/hatiolab/operato/commit/4986392e64524b5602cc9a144def239e85524bee))
111
+
112
+
113
+
114
+ ## [1.0.0-beta.44](https://github.com/hatiolab/operato/compare/v1.0.0-beta.43...v1.0.0-beta.44) (2022-07-07)
115
+
116
+ **Note:** Version bump only for package @operato/attachment
117
+
118
+
119
+
120
+
121
+
122
+ ## [1.0.0-beta.43](https://github.com/hatiolab/operato/compare/v1.0.0-beta.42...v1.0.0-beta.43) (2022-07-03)
123
+
124
+ **Note:** Version bump only for package @operato/attachment
125
+
126
+
127
+
128
+
129
+
130
+ ## [1.0.0-beta.42](https://github.com/hatiolab/operato/compare/v1.0.0-beta.41...v1.0.0-beta.42) (2022-07-03)
131
+
132
+ **Note:** Version bump only for package @operato/attachment
133
+
134
+
135
+
136
+
137
+
138
+ ## [1.0.0-beta.41](https://github.com/hatiolab/operato/compare/v1.0.0-beta.40...v1.0.0-beta.41) (2022-06-30)
139
+
140
+ **Note:** Version bump only for package @operato/attachment
141
+
142
+
143
+
144
+
145
+
146
+ ## [1.0.0-beta.40](https://github.com/hatiolab/operato/compare/v1.0.0-beta.39...v1.0.0-beta.40) (2022-06-29)
147
+
148
+ **Note:** Version bump only for package @operato/attachment
149
+
150
+
151
+
152
+
153
+
154
+ ## [1.0.0-beta.39](https://github.com/hatiolab/operato/compare/v1.0.0-beta.38...v1.0.0-beta.39) (2022-06-22)
155
+
156
+ **Note:** Version bump only for package @operato/attachment
157
+
158
+
159
+
160
+
161
+
162
+ ## [1.0.0-beta.38](https://github.com/hatiolab/operato/compare/v1.0.0-beta.37...v1.0.0-beta.38) (2022-06-20)
163
+
164
+ **Note:** Version bump only for package @operato/attachment
165
+
166
+
167
+
168
+
169
+
170
+ ## [1.0.0-beta.37](https://github.com/hatiolab/operato/compare/v1.0.0-beta.36...v1.0.0-beta.37) (2022-06-20)
171
+
172
+ **Note:** Version bump only for package @operato/attachment
173
+
174
+
175
+
176
+
177
+
178
+ ## [1.0.0-beta.36](https://github.com/hatiolab/operato/compare/v1.0.0-beta.35...v1.0.0-beta.36) (2022-06-16)
179
+
180
+ **Note:** Version bump only for package @operato/attachment
181
+
182
+
183
+
184
+
185
+
186
+ ## [1.0.0-beta.35](https://github.com/hatiolab/operato/compare/v1.0.0-beta.34...v1.0.0-beta.35) (2022-06-16)
187
+
188
+ **Note:** Version bump only for package @operato/attachment
189
+
190
+
191
+
192
+
193
+
194
+ ## [1.0.0-beta.34](https://github.com/hatiolab/operato/compare/v1.0.0-beta.33...v1.0.0-beta.34) (2022-06-16)
195
+
196
+ **Note:** Version bump only for package @operato/attachment
197
+
198
+
199
+
200
+
201
+
202
+ ## [1.0.0-beta.33](https://github.com/hatiolab/operato/compare/v1.0.0-beta.32...v1.0.0-beta.33) (2022-06-16)
203
+
204
+ **Note:** Version bump only for package @operato/attachment
205
+
206
+
207
+
208
+
209
+
210
+ ## [1.0.0-beta.32](https://github.com/hatiolab/operato/compare/v1.0.0-beta.31...v1.0.0-beta.32) (2022-06-15)
211
+
212
+ **Note:** Version bump only for package @operato/attachment
213
+
214
+
215
+
216
+
217
+
218
+ ## [1.0.0-beta.31](https://github.com/hatiolab/operato/compare/v1.0.0-beta.30...v1.0.0-beta.31) (2022-06-15)
219
+
220
+ **Note:** Version bump only for package @operato/attachment
221
+
222
+
223
+
224
+
225
+
226
+ ## [1.0.0-beta.30](https://github.com/hatiolab/operato/compare/v1.0.0-beta.29...v1.0.0-beta.30) (2022-06-13)
227
+
228
+ **Note:** Version bump only for package @operato/attachment
229
+
230
+
231
+
232
+
233
+
234
+ ## [1.0.0-beta.29](https://github.com/hatiolab/operato/compare/v1.0.0-beta.28...v1.0.0-beta.29) (2022-06-10)
235
+
236
+ **Note:** Version bump only for package @operato/attachment
237
+
238
+
239
+
240
+
241
+
242
+ ## [1.0.0-beta.28](https://github.com/hatiolab/operato/compare/v1.0.0-beta.27...v1.0.0-beta.28) (2022-06-10)
243
+
244
+ **Note:** Version bump only for package @operato/attachment
245
+
246
+
247
+
248
+
249
+
250
+ ## [1.0.0-beta.27](https://github.com/hatiolab/operato/compare/v1.0.0-beta.26...v1.0.0-beta.27) (2022-06-09)
251
+
252
+ **Note:** Version bump only for package @operato/attachment
253
+
254
+
255
+
256
+
257
+
258
+ ## [1.0.0-beta.26](https://github.com/hatiolab/operato/compare/v1.0.0-beta.25...v1.0.0-beta.26) (2022-06-04)
259
+
260
+
261
+ ### :bug: Bug Fix
262
+
263
+ * remove empty valued filters from data-grist default filters ([4a23485](https://github.com/hatiolab/operato/commit/4a2348525bdee4e1cd43abad469ad9451e6d7f5d))
264
+
265
+
266
+
267
+ ## [1.0.0-beta.25](https://github.com/hatiolab/operato/compare/v1.0.0-beta.24...v1.0.0-beta.25) (2022-06-02)
268
+
269
+ **Note:** Version bump only for package @operato/attachment
270
+
271
+
272
+
273
+
274
+
275
+ ## [1.0.0-beta.24](https://github.com/hatiolab/operato/compare/v1.0.0-beta.23...v1.0.0-beta.24) (2022-06-02)
276
+
277
+ **Note:** Version bump only for package @operato/attachment
278
+
279
+
280
+
281
+
282
+
283
+ ## [1.0.0-beta.23](https://github.com/hatiolab/operato/compare/v1.0.0-beta.22...v1.0.0-beta.23) (2022-06-02)
284
+
285
+ **Note:** Version bump only for package @operato/attachment
286
+
287
+
288
+
289
+
290
+
291
+ ## [1.0.0-beta.22](https://github.com/hatiolab/operato/compare/v1.0.0-beta.21...v1.0.0-beta.22) (2022-05-31)
292
+
293
+ **Note:** Version bump only for package @operato/attachment
294
+
295
+
296
+
297
+
298
+
299
+ ## [1.0.0-beta.21](https://github.com/hatiolab/operato/compare/v1.0.0-beta.20...v1.0.0-beta.21) (2022-05-31)
300
+
301
+ **Note:** Version bump only for package @operato/attachment
302
+
303
+
304
+
305
+
306
+
307
+ ## [1.0.0-beta.20](https://github.com/hatiolab/operato/compare/v1.0.0-beta.19...v1.0.0-beta.20) (2022-05-30)
308
+
309
+ **Note:** Version bump only for package @operato/attachment
310
+
311
+
312
+
313
+
314
+
315
+ ## [1.0.0-beta.19](https://github.com/hatiolab/operato/compare/v1.0.0-beta.18...v1.0.0-beta.19) (2022-05-29)
316
+
317
+ **Note:** Version bump only for package @operato/attachment
318
+
319
+
320
+
321
+
322
+
323
+ ## [1.0.0-beta.18](https://github.com/hatiolab/operato/compare/v1.0.0-beta.17...v1.0.0-beta.18) (2022-05-27)
324
+
325
+ **Note:** Version bump only for package @operato/attachment
326
+
327
+
328
+
329
+
330
+
331
+ ## [1.0.0-beta.17](https://github.com/hatiolab/operato/compare/v1.0.0-beta.16...v1.0.0-beta.17) (2022-05-25)
332
+
333
+ **Note:** Version bump only for package @operato/attachment
334
+
335
+
336
+
337
+
338
+
339
+ ## [1.0.0-beta.16](https://github.com/hatiolab/operato/compare/v1.0.0-beta.15...v1.0.0-beta.16) (2022-05-23)
340
+
341
+ **Note:** Version bump only for package @operato/attachment
342
+
343
+
344
+
345
+
346
+
347
+ ## [1.0.0-beta.15](https://github.com/hatiolab/operato/compare/v1.0.0-beta.14...v1.0.0-beta.15) (2022-05-20)
348
+
349
+ **Note:** Version bump only for package @operato/attachment
350
+
351
+
352
+
353
+
354
+
355
+ ## [1.0.0-beta.14](https://github.com/hatiolab/operato/compare/v1.0.0-beta.13...v1.0.0-beta.14) (2022-05-19)
356
+
357
+ **Note:** Version bump only for package @operato/attachment
358
+
359
+
360
+
361
+
362
+
363
+ ## [1.0.0-beta.13](https://github.com/hatiolab/operato/compare/v1.0.0-beta.12...v1.0.0-beta.13) (2022-05-19)
364
+
365
+
366
+ ### :bug: Bug Fix
367
+
368
+ * incorrect package.json scripts for storybooks ([8c8c405](https://github.com/hatiolab/operato/commit/8c8c405443247108b9c411b8161c008d9b6a2261))
369
+
370
+
371
+
372
+ ## [1.0.0-beta.12](https://github.com/hatiolab/operato/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2022-05-13)
373
+
374
+
375
+ ### :rocket: New Features
376
+
377
+ * storybook started ([90c08c9](https://github.com/hatiolab/operato/commit/90c08c9a15e5fe554baaa1becca07793e8434799))
378
+
379
+
380
+
381
+ ## [1.0.0-beta.11](https://github.com/hatiolab/operato/compare/v1.0.0-beta.10...v1.0.0-beta.11) (2022-05-01)
382
+
383
+ **Note:** Version bump only for package @operato/attachment
384
+
385
+
386
+
387
+
388
+
389
+ ## [1.0.0-beta.10](https://github.com/hatiolab/operato/compare/v1.0.0-beta.9...v1.0.0-beta.10) (2022-04-28)
390
+
391
+ **Note:** Version bump only for package @operato/attachment
392
+
393
+
394
+
395
+
396
+
6
397
  ## [1.0.0-beta.9](https://github.com/hatiolab/operato/compare/v1.0.0-beta.8...v1.0.0-beta.9) (2022-04-28)
7
398
 
8
399
  **Note:** Version bump only for package @operato/attachment
@@ -1,21 +1,16 @@
1
1
  import '@operato/data-grist';
2
2
  import '@operato/input/ox-input-file.js';
3
- import { LitElement, PropertyValues } from 'lit';
4
- import { ColumnConfig, FieldRenderer, FiltersForm, GristData, GristRecord, QueryFilter, SortersConfig } from '@operato/data-grist';
3
+ import { LitElement } from 'lit';
4
+ import { ColumnConfig, FetchOption, FieldRenderer, FiltersForm, FilterValue, GristData, GristRecord, SortersConfig } from '@operato/data-grist';
5
5
  export declare class OxAttachmentList extends LitElement {
6
6
  static styles: import("lit").CSSResult[];
7
- categories: any[];
8
7
  category: string;
9
8
  creatable: boolean;
10
9
  private grist;
11
10
  fileUploader: any;
12
11
  filtersForm: FiltersForm;
13
12
  render(): import("lit-html").TemplateResult<1>;
14
- fetchHandler({ page, limit, sorters }: {
15
- page: number;
16
- limit: number;
17
- sorters: SortersConfig;
18
- }): Promise<{
13
+ fetchHandler({ page, limit, sortings, filters }: FetchOption): Promise<{
19
14
  total: any;
20
15
  records: any;
21
16
  }>;
@@ -71,6 +66,7 @@ export declare class OxAttachmentList extends LitElement {
71
66
  record: {
72
67
  editable: boolean;
73
68
  align: string;
69
+ options?: undefined;
74
70
  renderer?: undefined;
75
71
  };
76
72
  width: number;
@@ -87,6 +83,7 @@ export declare class OxAttachmentList extends LitElement {
87
83
  record: {
88
84
  editable: boolean;
89
85
  align: string;
86
+ options?: undefined;
90
87
  renderer?: undefined;
91
88
  };
92
89
  width: number;
@@ -99,6 +96,25 @@ export declare class OxAttachmentList extends LitElement {
99
96
  icon?: undefined;
100
97
  hidden?: undefined;
101
98
  sortable?: undefined;
99
+ } | {
100
+ type: string;
101
+ name: string;
102
+ header: string;
103
+ record: {
104
+ options: string[];
105
+ editable: boolean;
106
+ align?: undefined;
107
+ renderer?: undefined;
108
+ };
109
+ hidden: boolean;
110
+ filter: {
111
+ value: string;
112
+ };
113
+ gutterName?: undefined;
114
+ icon?: undefined;
115
+ handlers?: undefined;
116
+ width?: undefined;
117
+ sortable?: undefined;
102
118
  } | {
103
119
  type: string;
104
120
  name: string;
@@ -107,6 +123,7 @@ export declare class OxAttachmentList extends LitElement {
107
123
  editable: boolean;
108
124
  renderer: FieldRenderer;
109
125
  align?: undefined;
126
+ options?: undefined;
110
127
  };
111
128
  handlers: {
112
129
  click: (columns: ColumnConfig[], data: GristData, column: ColumnConfig, record: GristRecord, rowIndex: number, target: HTMLElement) => void;
@@ -125,6 +142,7 @@ export declare class OxAttachmentList extends LitElement {
125
142
  record: {
126
143
  editable: boolean;
127
144
  align?: undefined;
145
+ options?: undefined;
128
146
  renderer?: undefined;
129
147
  };
130
148
  sortable: boolean;
@@ -156,7 +174,6 @@ export declare class OxAttachmentList extends LitElement {
156
174
  };
157
175
  };
158
176
  firstUpdated(): Promise<void>;
159
- updated(changes: PropertyValues<this>): void;
160
177
  onClickSelect(attachment: any): void;
161
178
  onCreateAttachment(e: CustomEvent): Promise<void>;
162
179
  onDeleteAttachment(id: string): Promise<void>;
@@ -164,7 +181,7 @@ export declare class OxAttachmentList extends LitElement {
164
181
  getAttachments({ page, limit, filters, sortings }?: {
165
182
  page?: number;
166
183
  limit?: number;
167
- filters?: QueryFilter[];
184
+ filters?: FilterValue[];
168
185
  sortings?: SortersConfig;
169
186
  }): Promise<any>;
170
187
  createAttachments(files: File[]): Promise<void>;
@@ -2,7 +2,6 @@ import { __decorate } from "tslib";
2
2
  import '@operato/data-grist';
3
3
  import '@operato/input/ox-input-file.js';
4
4
  import gql from 'graphql-tag';
5
- import i18next from 'i18next';
6
5
  import { css, html, LitElement } from 'lit';
7
6
  import { customElement, property, query } from 'lit/decorators.js';
8
7
  import { buildArgs, client } from '@operato/graphql';
@@ -52,7 +51,6 @@ const CREATE_ATTACHMENTS_GQL = gql `
52
51
  let OxAttachmentList = class OxAttachmentList extends LitElement {
53
52
  constructor() {
54
53
  super(...arguments);
55
- this.categories = ['audio', 'video', 'image', 'text', 'application'];
56
54
  this.category = '';
57
55
  this.creatable = false;
58
56
  }
@@ -60,23 +58,8 @@ let OxAttachmentList = class OxAttachmentList extends LitElement {
60
58
  return html `
61
59
  <ox-grist .config=${this.gristConfig} .mode=${'CARD'} auto-fetch .fetchHandler=${this.fetchHandler.bind(this)}>
62
60
  <div slot="headroom" id="headroom">
63
-
64
61
  <div id="filters">
65
- <ox-filters-form
66
- slot="headroom"
67
- @change=${(e) => this.grist.fetch(true)}
68
- ></ox-filters-form>
69
-
70
- <select
71
- @change=${(e) => {
72
- var _a;
73
- this.category = (_a = e.currentTarget) === null || _a === void 0 ? void 0 : _a.value;
74
- this.requestUpdate();
75
- }}
76
- >
77
- <option value="">${i18next.t('text.please choose a category')}</option>
78
- ${this.categories.map(category => html ` <option value=${category} ?selected=${this.category == category}>${category}</option> `)}
79
- </select>
62
+ <ox-filters-form autofocus></ox-filters-form>
80
63
  </div>
81
64
 
82
65
  <ox-input-file
@@ -85,12 +68,12 @@ let OxAttachmentList = class OxAttachmentList extends LitElement {
85
68
  hide-filelist
86
69
  @change=${this.onCreateAttachment.bind(this)}
87
70
  ></ox-input-file>
71
+ </div>
88
72
  </ox-grist>
89
73
  `;
90
74
  }
91
- async fetchHandler({ page, limit, sorters = [] }) {
92
- const filters = await this.filtersForm.getQueryFilters();
93
- const { items: records, total } = await this.getAttachments({ page, limit, filters, sortings: sorters });
75
+ async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }) {
76
+ const { items: records, total } = await this.getAttachments({ page, limit, filters, sortings });
94
77
  return {
95
78
  total,
96
79
  records
@@ -194,6 +177,19 @@ let OxAttachmentList = class OxAttachmentList extends LitElement {
194
177
  }
195
178
  }
196
179
  },
180
+ {
181
+ type: 'select',
182
+ name: 'category',
183
+ header: 'category',
184
+ record: {
185
+ options: ['', 'audio', 'video', 'image', 'text', 'application'],
186
+ editable: false
187
+ },
188
+ hidden: true,
189
+ filter: {
190
+ value: this.category
191
+ }
192
+ },
197
193
  {
198
194
  type: 'image',
199
195
  name: 'thumbnail',
@@ -263,11 +259,6 @@ let OxAttachmentList = class OxAttachmentList extends LitElement {
263
259
  async firstUpdated() {
264
260
  this.refreshAttachments();
265
261
  }
266
- updated(changes) {
267
- if (changes.has('category')) {
268
- this.refreshAttachments();
269
- }
270
- }
271
262
  onClickSelect(attachment) {
272
263
  this.dispatchEvent(new CustomEvent('attachment-selected', {
273
264
  composed: true,
@@ -295,12 +286,6 @@ let OxAttachmentList = class OxAttachmentList extends LitElement {
295
286
  limit,
296
287
  page
297
288
  };
298
- if (this.category)
299
- filters.push({
300
- name: 'category',
301
- operator: 'eq',
302
- value: this.category
303
- });
304
289
  var params = {
305
290
  filters,
306
291
  sortings,
@@ -392,9 +377,6 @@ OxAttachmentList.styles = [
392
377
  }
393
378
  `
394
379
  ];
395
- __decorate([
396
- property({ type: Array })
397
- ], OxAttachmentList.prototype, "categories", void 0);
398
380
  __decorate([
399
381
  property({ type: String })
400
382
  ], OxAttachmentList.prototype, "category", void 0);