@operato/attachment 1.0.0-beta.3 → 1.0.0-beta.30

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,362 @@
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.0-beta.30](https://github.com/hatiolab/operato/compare/v1.0.0-beta.29...v1.0.0-beta.30) (2022-06-13)
7
+
8
+ **Note:** Version bump only for package @operato/attachment
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.0.0-beta.29](https://github.com/hatiolab/operato/compare/v1.0.0-beta.28...v1.0.0-beta.29) (2022-06-10)
15
+
16
+ **Note:** Version bump only for package @operato/attachment
17
+
18
+
19
+
20
+
21
+
22
+ ## [1.0.0-beta.28](https://github.com/hatiolab/operato/compare/v1.0.0-beta.27...v1.0.0-beta.28) (2022-06-10)
23
+
24
+ **Note:** Version bump only for package @operato/attachment
25
+
26
+
27
+
28
+
29
+
30
+ ## [1.0.0-beta.27](https://github.com/hatiolab/operato/compare/v1.0.0-beta.26...v1.0.0-beta.27) (2022-06-09)
31
+
32
+ **Note:** Version bump only for package @operato/attachment
33
+
34
+
35
+
36
+
37
+
38
+ ## [1.0.0-beta.26](https://github.com/hatiolab/operato/compare/v1.0.0-beta.25...v1.0.0-beta.26) (2022-06-04)
39
+
40
+
41
+ ### :bug: Bug Fix
42
+
43
+ * remove empty valued filters from data-grist default filters ([4a23485](https://github.com/hatiolab/operato/commit/4a2348525bdee4e1cd43abad469ad9451e6d7f5d))
44
+
45
+
46
+
47
+ ## [1.0.0-beta.25](https://github.com/hatiolab/operato/compare/v1.0.0-beta.24...v1.0.0-beta.25) (2022-06-02)
48
+
49
+ **Note:** Version bump only for package @operato/attachment
50
+
51
+
52
+
53
+
54
+
55
+ ## [1.0.0-beta.24](https://github.com/hatiolab/operato/compare/v1.0.0-beta.23...v1.0.0-beta.24) (2022-06-02)
56
+
57
+ **Note:** Version bump only for package @operato/attachment
58
+
59
+
60
+
61
+
62
+
63
+ ## [1.0.0-beta.23](https://github.com/hatiolab/operato/compare/v1.0.0-beta.22...v1.0.0-beta.23) (2022-06-02)
64
+
65
+ **Note:** Version bump only for package @operato/attachment
66
+
67
+
68
+
69
+
70
+
71
+ ## [1.0.0-beta.22](https://github.com/hatiolab/operato/compare/v1.0.0-beta.21...v1.0.0-beta.22) (2022-05-31)
72
+
73
+ **Note:** Version bump only for package @operato/attachment
74
+
75
+
76
+
77
+
78
+
79
+ ## [1.0.0-beta.21](https://github.com/hatiolab/operato/compare/v1.0.0-beta.20...v1.0.0-beta.21) (2022-05-31)
80
+
81
+ **Note:** Version bump only for package @operato/attachment
82
+
83
+
84
+
85
+
86
+
87
+ ## [1.0.0-beta.20](https://github.com/hatiolab/operato/compare/v1.0.0-beta.19...v1.0.0-beta.20) (2022-05-30)
88
+
89
+ **Note:** Version bump only for package @operato/attachment
90
+
91
+
92
+
93
+
94
+
95
+ ## [1.0.0-beta.19](https://github.com/hatiolab/operato/compare/v1.0.0-beta.18...v1.0.0-beta.19) (2022-05-29)
96
+
97
+ **Note:** Version bump only for package @operato/attachment
98
+
99
+
100
+
101
+
102
+
103
+ ## [1.0.0-beta.18](https://github.com/hatiolab/operato/compare/v1.0.0-beta.17...v1.0.0-beta.18) (2022-05-27)
104
+
105
+ **Note:** Version bump only for package @operato/attachment
106
+
107
+
108
+
109
+
110
+
111
+ ## [1.0.0-beta.17](https://github.com/hatiolab/operato/compare/v1.0.0-beta.16...v1.0.0-beta.17) (2022-05-25)
112
+
113
+ **Note:** Version bump only for package @operato/attachment
114
+
115
+
116
+
117
+
118
+
119
+ ## [1.0.0-beta.16](https://github.com/hatiolab/operato/compare/v1.0.0-beta.15...v1.0.0-beta.16) (2022-05-23)
120
+
121
+ **Note:** Version bump only for package @operato/attachment
122
+
123
+
124
+
125
+
126
+
127
+ ## [1.0.0-beta.15](https://github.com/hatiolab/operato/compare/v1.0.0-beta.14...v1.0.0-beta.15) (2022-05-20)
128
+
129
+ **Note:** Version bump only for package @operato/attachment
130
+
131
+
132
+
133
+
134
+
135
+ ## [1.0.0-beta.14](https://github.com/hatiolab/operato/compare/v1.0.0-beta.13...v1.0.0-beta.14) (2022-05-19)
136
+
137
+ **Note:** Version bump only for package @operato/attachment
138
+
139
+
140
+
141
+
142
+
143
+ ## [1.0.0-beta.13](https://github.com/hatiolab/operato/compare/v1.0.0-beta.12...v1.0.0-beta.13) (2022-05-19)
144
+
145
+
146
+ ### :bug: Bug Fix
147
+
148
+ * incorrect package.json scripts for storybooks ([8c8c405](https://github.com/hatiolab/operato/commit/8c8c405443247108b9c411b8161c008d9b6a2261))
149
+
150
+
151
+
152
+ ## [1.0.0-beta.12](https://github.com/hatiolab/operato/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2022-05-13)
153
+
154
+
155
+ ### :rocket: New Features
156
+
157
+ * storybook started ([90c08c9](https://github.com/hatiolab/operato/commit/90c08c9a15e5fe554baaa1becca07793e8434799))
158
+
159
+
160
+
161
+ ## [1.0.0-beta.11](https://github.com/hatiolab/operato/compare/v1.0.0-beta.10...v1.0.0-beta.11) (2022-05-01)
162
+
163
+ **Note:** Version bump only for package @operato/attachment
164
+
165
+
166
+
167
+
168
+
169
+ ## [1.0.0-beta.10](https://github.com/hatiolab/operato/compare/v1.0.0-beta.9...v1.0.0-beta.10) (2022-04-28)
170
+
171
+ **Note:** Version bump only for package @operato/attachment
172
+
173
+
174
+
175
+
176
+
177
+ ## [1.0.0-beta.9](https://github.com/hatiolab/operato/compare/v1.0.0-beta.8...v1.0.0-beta.9) (2022-04-28)
178
+
179
+ **Note:** Version bump only for package @operato/attachment
180
+
181
+
182
+
183
+
184
+
185
+ ## [1.0.0-beta.8](https://github.com/hatiolab/operato/compare/v1.0.0-beta.7...v1.0.0-beta.8) (2022-04-27)
186
+
187
+ **Note:** Version bump only for package @operato/attachment
188
+
189
+
190
+
191
+
192
+
193
+ ## [1.0.0-beta.7](https://github.com/hatiolab/operato/compare/v1.0.0-beta.6...v1.0.0-beta.7) (2022-04-24)
194
+
195
+ **Note:** Version bump only for package @operato/attachment
196
+
197
+
198
+
199
+
200
+
201
+ ## [1.0.0-beta.6](https://github.com/hatiolab/operato/compare/v0.4.5...v1.0.0-beta.6) (2022-04-22)
202
+
203
+ ## [1.0.0-beta.5](https://github.com/hatiolab/operato/compare/v1.0.0-beta.4...v1.0.0-beta.5) (2022-04-18)
204
+
205
+ ## [1.0.0-beta.4](https://github.com/hatiolab/operato/compare/v1.0.0-beta.3...v1.0.0-beta.4) (2022-04-14)
206
+
207
+ ## [1.0.0-beta.3](https://github.com/hatiolab/operato/compare/v1.0.0-beta.2...v1.0.0-beta.3) (2022-04-12)
208
+
209
+ ## [1.0.0-beta.2](https://github.com/hatiolab/operato/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2022-04-12)
210
+
211
+ ## [1.0.0-beta.1](https://github.com/hatiolab/operato/compare/v1.0.0-beta.0...v1.0.0-beta.1) (2022-04-11)
212
+
213
+ ## [1.0.0-beta.0](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.53...v1.0.0-beta.0) (2022-04-10)
214
+
215
+ ## [1.0.0-alpha.53](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.52...v1.0.0-alpha.53) (2022-04-08)
216
+
217
+ ## [1.0.0-alpha.52](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.51...v1.0.0-alpha.52) (2022-04-08)
218
+
219
+ ## [1.0.0-alpha.51](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.50...v1.0.0-alpha.51) (2022-04-05)
220
+
221
+ ## [1.0.0-alpha.50](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.49...v1.0.0-alpha.50) (2022-04-04)
222
+
223
+ ## [1.0.0-alpha.49](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.48...v1.0.0-alpha.49) (2022-04-04)
224
+
225
+
226
+ ### :bug: Bug Fix
227
+
228
+ * lit@2.2.1 ([6707752](https://github.com/hatiolab/operato/commit/6707752907d24f7ecbe248cba18a4b18cfda282f))
229
+
230
+ ## [1.0.0-alpha.48](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.47...v1.0.0-alpha.48) (2022-04-03)
231
+
232
+ ## [1.0.0-alpha.47](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.46...v1.0.0-alpha.47) (2022-04-02)
233
+
234
+ ## [1.0.0-alpha.46](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.45...v1.0.0-alpha.46) (2022-04-02)
235
+
236
+ ## [1.0.0-alpha.45](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.44...v1.0.0-alpha.45) (2022-03-31)
237
+
238
+ ## [1.0.0-alpha.44](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.43...v1.0.0-alpha.44) (2022-03-31)
239
+
240
+ ## [1.0.0-alpha.43](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.42...v1.0.0-alpha.43) (2022-03-30)
241
+
242
+ ## [1.0.0-alpha.42](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.41...v1.0.0-alpha.42) (2022-03-29)
243
+
244
+ ## [1.0.0-alpha.41](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.40...v1.0.0-alpha.41) (2022-03-27)
245
+
246
+ ## [1.0.0-alpha.40](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.39...v1.0.0-alpha.40) (2022-03-26)
247
+
248
+ ## [1.0.0-alpha.39](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.38...v1.0.0-alpha.39) (2022-03-25)
249
+
250
+ ## [1.0.0-alpha.38](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.37...v1.0.0-alpha.38) (2022-03-25)
251
+
252
+ ## [1.0.0-alpha.37](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.36...v1.0.0-alpha.37) (2022-03-25)
253
+
254
+ ## [1.0.0-alpha.36](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.35...v1.0.0-alpha.36) (2022-03-21)
255
+
256
+ ## [1.0.0-alpha.35](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.34...v1.0.0-alpha.35) (2022-03-21)
257
+
258
+ ## [1.0.0-alpha.34](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.33...v1.0.0-alpha.34) (2022-03-20)
259
+
260
+ ## [1.0.0-alpha.33](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.32...v1.0.0-alpha.33) (2022-03-19)
261
+
262
+ ## [1.0.0-alpha.32](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.31...v1.0.0-alpha.32) (2022-03-19)
263
+
264
+ ## [1.0.0-alpha.31](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.30...v1.0.0-alpha.31) (2022-03-19)
265
+
266
+ ## [1.0.0-alpha.30](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.29...v1.0.0-alpha.30) (2022-03-18)
267
+
268
+ ## [1.0.0-alpha.29](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.28...v1.0.0-alpha.29) (2022-03-17)
269
+
270
+ ## [1.0.0-alpha.28](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.26...v1.0.0-alpha.28) (2022-03-17)
271
+
272
+ ## [1.0.0-alpha.26](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.25...v1.0.0-alpha.26) (2022-03-17)
273
+
274
+ ## [1.0.0-alpha.25](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.24...v1.0.0-alpha.25) (2022-03-17)
275
+
276
+ ## [1.0.0-alpha.24](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.23...v1.0.0-alpha.24) (2022-03-17)
277
+
278
+ ## [1.0.0-alpha.23](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.22...v1.0.0-alpha.23) (2022-03-17)
279
+
280
+ ## [1.0.0-alpha.22](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.21...v1.0.0-alpha.22) (2022-03-17)
281
+
282
+ ## [1.0.0-alpha.21](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.20...v1.0.0-alpha.21) (2022-03-16)
283
+
284
+ ## [1.0.0-alpha.20](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.19...v1.0.0-alpha.20) (2022-03-15)
285
+
286
+ ## [1.0.0-alpha.19](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.18...v1.0.0-alpha.19) (2022-03-14)
287
+
288
+ ## [1.0.0-alpha.18](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.17...v1.0.0-alpha.18) (2022-03-14)
289
+
290
+ ## [1.0.0-alpha.17](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.16...v1.0.0-alpha.17) (2022-03-13)
291
+
292
+ ## [1.0.0-alpha.16](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.15...v1.0.0-alpha.16) (2022-03-13)
293
+
294
+ ## [1.0.0-alpha.15](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.14...v1.0.0-alpha.15) (2022-03-13)
295
+
296
+ ## [1.0.0-alpha.14](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.13...v1.0.0-alpha.14) (2022-03-13)
297
+
298
+ ## [1.0.0-alpha.13](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.12...v1.0.0-alpha.13) (2022-03-13)
299
+
300
+ ## [1.0.0-alpha.12](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2022-03-13)
301
+
302
+
303
+ ### :bug: Bug Fix
304
+
305
+ * missing import ([c9ed5f9](https://github.com/hatiolab/operato/commit/c9ed5f9c3566e899ebd40e920d9f08200ca5a5c6))
306
+
307
+
308
+ ### :rocket: New Features
309
+
310
+ * migrate input, property-editor from things-factory ([4800d85](https://github.com/hatiolab/operato/commit/4800d859473bf623325233a7f2af851e5d093dcb))
311
+
312
+ ## [1.0.0-alpha.11](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2022-03-12)
313
+
314
+
315
+ ### :bug: Bug Fix
316
+
317
+ * ox-property-editor-attachment-selector ([a1a2d20](https://github.com/hatiolab/operato/commit/a1a2d20640746c891248fdb729097614676c9cff))
318
+
319
+ ## [1.0.0-alpha.10](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.9...v1.0.0-alpha.10) (2022-03-12)
320
+
321
+ ## [1.0.0-alpha.9](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2022-03-12)
322
+
323
+
324
+ ### :rocket: New Features
325
+
326
+ * settled concept for input, property-editor, grist-editor, so on ([0c9e1d0](https://github.com/hatiolab/operato/commit/0c9e1d054c7aef5d965868242cf471667af7a3c3))
327
+
328
+ ## [1.0.0-alpha.8](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2022-03-11)
329
+
330
+ ## [1.0.0-alpha.7](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2022-03-11)
331
+
332
+ ## [1.0.0-alpha.6](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2022-03-11)
333
+
334
+ ## [1.0.0-alpha.5](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2022-03-11)
335
+
336
+ ## [1.0.0-alpha.4](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2022-03-11)
337
+
338
+ ## [1.0.0-alpha.3](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2022-03-10)
339
+
340
+ ## [1.0.0-alpha.2](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2022-03-10)
341
+
342
+ ## [1.0.0-alpha.1](https://github.com/hatiolab/operato/compare/v0.4.3...v1.0.0-alpha.1) (2022-03-09)
343
+
344
+
345
+
346
+ ## [1.0.0-beta.5](https://github.com/hatiolab/operato/compare/v1.0.0-beta.4...v1.0.0-beta.5) (2022-04-18)
347
+
348
+ **Note:** Version bump only for package @operato/attachment
349
+
350
+
351
+
352
+
353
+
354
+ ## [1.0.0-beta.4](https://github.com/hatiolab/operato/compare/v1.0.0-beta.3...v1.0.0-beta.4) (2022-04-14)
355
+
356
+ **Note:** Version bump only for package @operato/attachment
357
+
358
+
359
+
360
+
361
+
6
362
  ## [1.0.0-beta.3](https://github.com/hatiolab/operato/compare/v1.0.0-beta.2...v1.0.0-beta.3) (2022-04-12)
7
363
 
8
364
  **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 { ColumnConfig, FieldRenderer, FiltersForm, GristData, GristRecord, QueryFilter, SortersConfig } from '@operato/data-grist';
4
- import { LitElement, PropertyValues } from 'lit';
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>;
@@ -1,13 +1,12 @@
1
1
  import { __decorate } from "tslib";
2
2
  import '@operato/data-grist';
3
3
  import '@operato/input/ox-input-file.js';
4
- import { LitElement, css, html } from 'lit';
5
- import { ScrollbarStyles, TooltipStyles } from '@operato/styles';
6
- import { buildArgs, client } from '@operato/graphql';
7
- import { customElement, property, query } from 'lit/decorators.js';
8
4
  import gql from 'graphql-tag';
9
- import i18next from 'i18next';
10
- import { sleep } from '@operato/utils';
5
+ import { css, html, LitElement } from 'lit';
6
+ import { customElement, property, query } from 'lit/decorators.js';
7
+ import { buildArgs, client } from '@operato/graphql';
8
+ import { ScrollbarStyles, TooltipStyles } from '@operato/styles';
9
+ import { copyToClipboard, sleep } from '@operato/utils';
11
10
  const FETCH_ATTACHMENT_LIST_GQL = (listParam) => {
12
11
  return gql `
13
12
  {
@@ -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
  }
@@ -62,21 +60,7 @@ let OxAttachmentList = class OxAttachmentList extends LitElement {
62
60
  <div slot="headroom" id="headroom">
63
61
 
64
62
  <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>
63
+ <ox-filters-form></ox-filters-form>
80
64
  </div>
81
65
 
82
66
  <ox-input-file
@@ -88,9 +72,8 @@ let OxAttachmentList = class OxAttachmentList extends LitElement {
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
@@ -129,7 +112,7 @@ let OxAttachmentList = class OxAttachmentList extends LitElement {
129
112
  handlers: {
130
113
  click: async (columns, data, column, record, rowIndex, target) => {
131
114
  var { protocol, hostname, port } = location;
132
- await navigator.clipboard.writeText(`${protocol}//${hostname}:${port}${record.fullpath}`);
115
+ await copyToClipboard(`${protocol}//${hostname}:${port}${record.fullpath}`);
133
116
  target.setAttribute('data-tooltip', 'url copied!');
134
117
  await sleep(2000);
135
118
  target.removeAttribute('data-tooltip');
@@ -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);